import type { Connection } from '../../models/Connection.js'; import type { ReportedSyncJobStatus, SyncCommand } from '../../models/Sync.js'; import { SyncStatus } from '../../models/Sync.js'; import type { ServiceResponse } from '../../models/Generic.js'; import type { LogContext, LogContextGetter } from '@nangohq/logs'; import type { Orchestrator, RecordsServiceInterface } from '../../clients/orchestrator.js'; import type { DBEnvironment, IncomingFlowConfig, SyncDeploymentResult } from '@nangohq/types'; export declare const syncCommandToOperation: { readonly PAUSE: "pause"; readonly UNPAUSE: "unpause"; readonly RUN: "request_run"; readonly RUN_FULL: "request_run_full"; readonly CANCEL: "cancel"; }; export interface CreateSyncArgs { connections: Connection[]; providerConfigKey: string; environmentId: number; sync: IncomingFlowConfig; syncName: string; } export declare class SyncManagerService { createSyncForConnection(nangoConnectionId: number, logContextGetter: LogContextGetter, orchestrator: Orchestrator): Promise; createSyncForConnections(connections: Connection[], syncName: string, providerConfigKey: string, environmentId: number, sync: IncomingFlowConfig, logContextGetter: LogContextGetter, orchestrator: Orchestrator, debug?: boolean, logCtx?: LogContext): Promise; createSyncs(syncArgs: CreateSyncArgs[], logContextGetter: LogContextGetter, orchestrator: Orchestrator, debug?: boolean, logCtx?: LogContext): Promise; /** * Delete * @desc delete a sync and all the related objects * 1) sync config files * 2) sync config */ deleteConfig(syncConfigId: number, environmentId: number): Promise; softDeleteSync(syncId: string, environmentId: number, orchestrator: Orchestrator): Promise; softDeleteSyncsByConnection(connection: Connection, orchestrator: Orchestrator): Promise; deleteSyncsByProviderConfig(environmentId: number, providerConfigKey: string, orchestrator: Orchestrator): Promise; runSyncCommand({ recordsService, orchestrator, environment, providerConfigKey, syncNames, command, logContextGetter, connectionId, initiator }: { recordsService: RecordsServiceInterface; orchestrator: Orchestrator; environment: DBEnvironment; providerConfigKey: string; syncNames: string[]; command: SyncCommand; logContextGetter: LogContextGetter; connectionId?: string; initiator: string; }): Promise>; getSyncStatus(environmentId: number, providerConfigKey: string, syncNames: string[], orchestrator: Orchestrator, recordsService: RecordsServiceInterface, connectionId?: string, includeJobStatus?: boolean, optionalConnection?: Connection | null): Promise>; classifySyncStatus(jobStatus: SyncStatus, scheduleState: 'STARTED' | 'PAUSED' | 'DELETED'): SyncStatus; /** * Trigger If Connections Exist * @desc for the recently deploy flows, create the sync and trigger it if there are connections */ triggerIfConnectionsExist(flows: SyncDeploymentResult[], environmentId: number, logContextGetter: LogContextGetter, orchestrator: Orchestrator): Promise; private syncStatus; } declare const _default: SyncManagerService; export default _default;