mockforge_recorder/
lib.rs1pub mod api;
7pub mod behavioral_cloning;
8pub mod database;
9pub mod diff;
10pub mod har_export;
11pub mod integration_testing;
12pub mod middleware;
13pub mod models;
14pub mod openapi_export;
15pub mod protocols;
16pub mod query;
17pub mod recorder;
18pub mod replay;
19pub mod scrubbing;
20pub mod stub_mapping;
21pub mod sync;
22pub mod sync_drift;
23pub mod sync_gitops;
24pub mod sync_snapshots;
25pub mod sync_traffic;
26pub mod test_generation;
27
28pub use api::create_api_router;
29pub use behavioral_cloning::{
30 BehavioralScenario, BehavioralScenarioReplayEngine, BehavioralScenarioStep, Flow, FlowCompiler,
31 FlowGroupingStrategy, FlowRecorder, FlowRecordingConfig, FlowStep, ReplayResponse,
32 ScenarioInfo, ScenarioStorage, StateVariable,
33};
34pub use database::RecorderDatabase;
35pub use diff::{ComparisonResult, Difference, DifferenceType, ResponseComparator};
36pub use har_export::export_to_har;
37pub use integration_testing::{
38 IntegrationTestGenerator, IntegrationWorkflow, StepCondition, StepRequest, StepValidation,
39 VariableExtraction, WorkflowSetup, WorkflowStep,
40};
41pub use middleware::recording_middleware;
42pub use models::{Protocol, RecordedRequest, RecordedResponse};
43pub use openapi_export::{QueryFilters, RecordingsToOpenApi};
44pub use query::{QueryFilter, QueryResult};
45pub use recorder::Recorder;
46pub use replay::ReplayEngine;
47pub use scrubbing::{
48 CaptureFilter, CaptureFilterConfig, ScrubConfig, ScrubRule, ScrubTarget, Scrubber,
49};
50pub use stub_mapping::{
51 RequestMatcher, ResponseTemplate, StubFormat, StubMapping, StubMappingConverter,
52};
53pub use sync::{GitOpsConfig, SyncConfig, SyncService, SyncStatus, TrafficAwareConfig};
54pub use sync_drift::SyncDriftEvaluator;
55pub use sync_gitops::GitOpsSyncHandler;
56pub use sync_snapshots::{
57 EndpointEvolutionSummary, EndpointTimeline, ErrorPattern, SnapshotData, SyncSnapshot,
58};
59pub use sync_traffic::{EndpointPriority, EndpointUsageStats, TrafficAnalyzer};
60pub use test_generation::{
61 GeneratedTest, LlmConfig, TestFormat, TestGenerationConfig, TestGenerationResult,
62 TestGenerator, TestSuiteMetadata,
63};
64
65use thiserror::Error;
66
67#[derive(Error, Debug)]
69pub enum RecorderError {
70 #[error("Database error: {0}")]
71 Database(#[from] sqlx::Error),
72
73 #[error("Serialization error: {0}")]
74 Serialization(#[from] serde_json::Error),
75
76 #[error("IO error: {0}")]
77 Io(#[from] std::io::Error),
78
79 #[error("Request not found: {0}")]
80 NotFound(String),
81
82 #[error("Invalid filter: {0}")]
83 InvalidFilter(String),
84
85 #[error("Replay error: {0}")]
86 Replay(String),
87
88 #[error("Test generation error: {0}")]
89 TestGeneration(String),
90}
91
92pub type Result<T> = std::result::Result<T, RecorderError>;