@idpass/data-collect-core / InternalSyncManager
Class: InternalSyncManager
Defined in: components/InternalSyncManager.ts:40
Manages bidirectional synchronization between local DataCollect instances and the remote sync server.
Thin wrapper around an XState actor that implements the sync statechart. The public API is preserved: sync(), isSyncing, setSelectiveSyncOptions(), hasUnsyncedEvents().
Constructors
Constructor
new InternalSyncManager(
eventStore,entityStore,eventApplierService,syncServerUrl,authStorage,configId?,reauthenticate?):InternalSyncManager
Defined in: components/InternalSyncManager.ts:64
Parameters
eventStore
entityStore
eventApplierService
syncServerUrl
string
authStorage
configId?
string = "default"
reauthenticate?
Returns
InternalSyncManager
Accessors
isSyncing
Get Signature
get isSyncing():
boolean
Defined in: components/InternalSyncManager.ts:59
Whether a sync operation is currently running (read-only accessor).
Returns
boolean
Methods
setSelectiveSyncOptions()
setSelectiveSyncOptions(
options):void
Defined in: components/InternalSyncManager.ts:118
Sets selective sync options for area-based and entity-based filtering.
Parameters
options
Returns
void
getSelectiveSyncOptions()
getSelectiveSyncOptions():
SelectiveSyncOptions
Defined in: components/InternalSyncManager.ts:125
Gets the current selective sync options.
Returns
getUnsyncedEventsCount()
getUnsyncedEventsCount():
Promise<number>
Defined in: components/InternalSyncManager.ts:132
Gets the count of events waiting to be synchronized with the server.
Returns
Promise<number>
hasUnsyncedEvents()
hasUnsyncedEvents():
Promise<boolean>
Defined in: components/InternalSyncManager.ts:141
Checks if there are any events waiting to be synchronized.
Returns
Promise<boolean>
checkIfDuplicatesExist()
checkIfDuplicatesExist():
Promise<boolean>
Defined in: components/InternalSyncManager.ts:151
Checks if there are any unresolved potential duplicates.
Returns
Promise<boolean>
sync()
sync(
options?):Promise<void>
Defined in: components/InternalSyncManager.ts:159
Performs a complete bidirectional synchronization with the remote server.
Parameters
options?
Returns
Promise<void>