Skip to main content

@idpass/data-collect-core / SyncAdapterImpl

Class: SyncAdapterImpl

Defined in: components/SyncAdapter.ts:25

Sync adapter interface for external system synchronization.

Provides integration with external systems for bi-directional data sync. Implementations include OpenSppSyncAdapter and MockRegistrySyncAdapter.

Implements​

Constructors​

Constructor​

new SyncAdapterImpl(apiUrl): SyncAdapterImpl

Defined in: components/SyncAdapter.ts:34

Parameters​

apiUrl​

string

Returns​

SyncAdapterImpl

Methods​

pushEvents()​

pushEvents(events): Promise<void>

Defined in: components/SyncAdapter.ts:36

Push events to external system

Parameters​

events​

FormSubmission[]

Returns​

Promise<void>

Implementation of​

SyncAdapter.pushEvents


pushEntities()​

pushEntities(entities): Promise<void>

Defined in: components/SyncAdapter.ts:59

Push entities to external system

Parameters​

entities​

EntityDoc[]

Returns​

Promise<void>

Implementation of​

SyncAdapter.pushEntities


pullEntities()​

pullEntities(): Promise<void>

Defined in: components/SyncAdapter.ts:82

Pull entities from external system

Returns​

Promise<void>

Implementation of​

SyncAdapter.pullEntities


onSyncComplete()​

onSyncComplete(callback): void

Defined in: components/SyncAdapter.ts:107

Map the response from the server to the expected format

Parameters​

callback​

(status) => void

Returns​

void

Implementation of​

SyncAdapter.onSyncComplete


startAutoSync()​

startAutoSync(interval): void

Defined in: components/SyncAdapter.ts:111

Start automatic synchronization at specified interval

Parameters​

interval​

number

Returns​

void

Implementation of​

SyncAdapter.startAutoSync


stopAutoSync()​

stopAutoSync(): void

Defined in: components/SyncAdapter.ts:118

Stop automatic synchronization

Returns​

void

Implementation of​

SyncAdapter.stopAutoSync


getServerTimestamp()​

getServerTimestamp(): Promise<string>

Defined in: components/SyncAdapter.ts:149

Get the server timestamp to prevent clock differences between clients and server

Returns​

Promise<string>

Implementation of​

SyncAdapter.getServerTimestamp