Skip to main content

force_sync/
lib.rs

1//! Correctness-first bidirectional Salesforce and Postgres sync engine.
2
3#![forbid(unsafe_code)]
4#![warn(missing_docs)]
5
6/// Apply lanes for target systems.
7pub(crate) mod apply;
8/// Capture workers for source systems.
9pub(crate) mod capture;
10/// Object-level sync configuration and conflict policy types.
11pub(crate) mod config;
12/// Error types for force-sync.
13pub(crate) mod error;
14/// Canonical identity types for synced records.
15pub(crate) mod identity;
16/// Change envelope and cursor types for sync events.
17pub mod model;
18/// Pure planner and merge logic for sync envelopes.
19pub(crate) mod plan;
20/// Reconciliation helpers for drift detection and repair.
21pub(crate) mod reconcile;
22/// Explicit runtime orchestration for the v0.1 vertical slice.
23pub(crate) mod runtime;
24/// Storage backends and migration helpers.
25pub(crate) mod store;
26
27/// Returns the crate version for smoke tests and runtime diagnostics.
28#[must_use]
29pub const fn version() -> &'static str {
30    env!("CARGO_PKG_VERSION")
31}
32
33pub use apply::{ApplyError, RestApplyResult, SalesforceApplier, project_sync_link};
34pub use capture::{capture_batch, capture_stream, load_replay_id};
35pub use config::{ConflictPolicy, LaneThresholds, ObjectSync, Owner};
36pub use error::ForceSyncError;
37pub use identity::SyncKey;
38pub use model::{ChangeEnvelope, ChangeOperation, SourceCursor, SourceSystem};
39pub use plan::{ApplyLane, MergeOutcome, PlanDecision, PlannerContext, merge_payload, plan_change};
40pub use reconcile::DriftItem;
41pub use reconcile::{detect_drift, enqueue_repair, run_reconcile_once};
42pub use runtime::{SyncEngine, SyncEngineBuilder};
43pub use store::pg::{
44    AppendResult, CheckpointState, DeadLetter, LeasedTask, PgStore, SyncConflict, SyncLink, migrate,
45};