/** * SyncEngine - Core synchronization orchestrator * * This is the central engine that coordinates sync operations across all resource types. * It uses the Strategy pattern to handle different resources uniformly. * * Key benefits: * - One engine handles projects, integrations, AKB, attributes, conversations * - Adding new resource = implement one strategy class * - No duplicate pull/push logic * - Easy to test (mock strategies) */ import type { ISyncStrategy, PullOptions, PullResult, PushResult, StatusSummary, ValidationResult } from '../../domain/strategies/sync/ISyncStrategy.js'; import type { CustomerConfig, ILogger } from '../../domain/resources/common/types.js'; /** * Combined pull result from all strategies */ export interface SyncPullResult { customer: string; resources: Array<{ resourceType: string; displayName: string; result: PullResult; }>; totalItems: number; errors: string[]; } /** * Combined push result from all strategies */ export interface SyncPushResult { customer: string; resources: Array<{ resourceType: string; displayName: string; result: PushResult; }>; totalCreated: number; totalUpdated: number; totalDeleted: number; errors: string[]; } /** * Status report for all resources */ export interface StatusReport { customer: string; resources: StatusSummary[]; totalChanges: number; } /** * Sync error with context */ export declare class SyncError extends Error { resourceType: string; cause?: Error | undefined; constructor(message: string, resourceType: string, cause?: Error | undefined); } /** * Validation error with details */ export declare class ValidationError extends Error { results: ValidationResult[]; constructor(message: string, results: ValidationResult[]); } /** * SyncEngine Options */ export interface SyncEngineOptions { /** * Stop on first error instead of continuing */ stopOnError?: boolean; /** * Run strategies in parallel where possible */ parallel?: boolean; } /** * SyncEngine - Generic synchronization orchestrator * * Orchestrates pull/push/status operations across all registered strategies. */ export declare class SyncEngine { private logger; private options; private strategies; constructor(strategies: ISyncStrategy[], logger: ILogger, options?: SyncEngineOptions); /** * Register a new strategy */ registerStrategy(strategy: ISyncStrategy): void; /** * Get a specific strategy by resource type */ getStrategy(resourceType: string): ISyncStrategy | undefined; /** * Get all registered strategies */ getStrategies(): ISyncStrategy[]; /** * Pull ALL resources using registered strategies */ pullAll(customer: CustomerConfig, options?: PullOptions): Promise; /** * Pull specific resource types */ pullSelected(customer: CustomerConfig, resourceTypes: string[], options?: PullOptions): Promise; /** * Push ALL changed resources using registered strategies */ pushAll(customer: CustomerConfig): Promise; /** * Push specific resource types */ pushSelected(customer: CustomerConfig, resourceTypes: string[]): Promise; /** * Get status for ALL resources */ getStatus(customer: CustomerConfig): Promise; /** * Get status for specific resource types */ getStatusSelected(customer: CustomerConfig, resourceTypes: string[]): Promise; /** * Helper to execute pull with a single strategy */ private pullWithStrategy; } /** * Factory function for creating SyncEngine with default strategies */ export declare function createSyncEngine(strategies: ISyncStrategy[], logger: ILogger, options?: SyncEngineOptions): SyncEngine; //# sourceMappingURL=SyncEngine.d.ts.map