Skip to main content

@idpass/data-collect-core / SyncAdapterImpl

Class: SyncAdapterImpl

Defined in: components/SyncAdapter.ts:22

Sync adapter interface for external system synchronization.

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

Implements

Constructors

Constructor

new SyncAdapterImpl(apiUrl): SyncAdapterImpl

Defined in: components/SyncAdapter.ts:31

Parameters

apiUrl

string

Returns

SyncAdapterImpl

Methods

pushEvents()

pushEvents(events): Promise<void>

Defined in: components/SyncAdapter.ts:33

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:56

Push entities to external system

Parameters

entities

EntityDoc[]

Returns

Promise<void>

Implementation of

SyncAdapter.pushEntities


pullEntities()

pullEntities(): Promise<void>

Defined in: components/SyncAdapter.ts:79

Pull entities from external system

Returns

Promise<void>

Implementation of

SyncAdapter.pullEntities


onSyncComplete()

onSyncComplete(callback): void

Defined in: components/SyncAdapter.ts:104

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:108

Start automatic synchronization at specified interval

Parameters

interval

number

Returns

void

Implementation of

SyncAdapter.startAutoSync


stopAutoSync()

stopAutoSync(): void

Defined in: components/SyncAdapter.ts:115

Stop automatic synchronization

Returns

void

Implementation of

SyncAdapter.stopAutoSync


getServerTimestamp()

getServerTimestamp(): Promise<string>

Defined in: components/SyncAdapter.ts:146

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

Returns

Promise<string>

Implementation of

SyncAdapter.getServerTimestamp