Skip to content

SudoSOS Back-end API / internal/sync-service-factory / SyncServiceFactory

Abstract Class: SyncServiceFactory<T, S> ​

Abstract factory class for creating and initializing sync services. Centralizes the logic for determining which sync services to create based on environment variables and configuration.

Extended by ​

Type Parameters ​

Type ParameterDescription
TThe entity type that the sync services operate on
S extends SyncService<T>The specific sync service type that extends SyncService

Constructors ​

Constructor ​

ts
new SyncServiceFactory<T, S>(): SyncServiceFactory<T, S>;

Returns ​

SyncServiceFactory<T, S>

Methods ​

createSyncServices() ​

ts
abstract createSyncServices(options): S[];

Creates and returns an array of configured sync services.

Parameters ​

ParameterTypeDescription
optionsSyncServiceFactoryOptionsConfiguration options for the factory

Returns ​

S[]

Array of initialized sync services


getAvailableServices() ​

ts
abstract getAvailableServices(): Record<string, boolean>;

Gets information about which sync services are available based on environment configuration.

Returns ​

Record<string, boolean>

Object describing available services