/** * dcrouter migration runner. * * Uses @push.rocks/smartmigration via dynamic import so smartmigration's type * chain (which pulls in mongodb 7.x and related types) doesn't leak into * compile-time type checking for this folder. */ /** Matches the subset of IMigrationRunResult we actually log. */ export interface IMigrationRunResult { stepsApplied: Array; wasFreshInstall: boolean; currentVersionBefore: string | null; currentVersionAfter: string; totalDurationMs: number; } export interface IMigrationRunner { run(): Promise; } export interface IMigrationBlobStorage { set(key: string, value: Buffer): Promise; get(key: string): Promise; } export interface IDcRouterMigrationOptions { remoteIngressHubSettings?: { enabled?: boolean; tunnelPort?: number; hubDomain?: string | null; performance?: Record | null; }; emailServerSettings?: { enabled?: boolean; outboundMode?: 'direct' | 'remoteIngress'; emailConfig?: Record; emailPortConfig?: Record; }; /** Explicit legacy raw-file adapter root; never inferred from process state. */ legacySmartMtaStoragePath?: string; /** SmartBucket adapter injected for the versioned CachedEmail payload migration. */ legacyRawMessageBlobStorage?: IMigrationBlobStorage; } /** * Create a configured SmartMigration runner with all dcrouter migration steps registered. * * Call `.run()` on the returned instance at startup (after DcRouterDb is ready, * before any service that reads migrated collections). * * @param db - The initialized SmartdataDb instance from DcRouterDb.getDb() * @param targetVersion - The current app version (from commitinfo.version) */ export declare function createMigrationRunner(db: unknown, targetVersion: string, options?: IDcRouterMigrationOptions): Promise;