Skip to main content

force_sync/
lib.rs

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