import type { IConfigSnapshotUseCase } from '../../application/ports/inbound/IConfigSnapshotUseCase.js'; import type { IConfigSnapshotScheduleUseCase } from '../../application/ports/inbound/IConfigSnapshotScheduleUseCase.js'; import type { IConfigSnapshotRepository } from '../../application/ports/outbound/IConfigSnapshotRepository.js'; import type { ConfigSnapshotSchedule } from '../../domain/entities/ConfigSnapshotSchedule.js'; /** * Info about a running cron job */ export interface CronJobInfo { scheduleName: string; serverName: string; cronExpression: string; retentionCount: number; } /** * Logger interface for dependency injection */ export interface ISchedulerLogger { info(msg: string): void; warn(msg: string): void; error(msg: string): void; error(error: unknown, msg: string): void; } /** * ConfigSnapshotSchedulerService * Manages cron-based config snapshot scheduling using node-cron. * Follows the same pattern as BackupSchedulerService. */ export declare class ConfigSnapshotSchedulerService { private readonly snapshotUseCase; private readonly scheduleUseCase; private readonly snapshotRepository; private readonly logger; private tasks; private jobInfo; private cronSchedule; private cronValidate; constructor(snapshotUseCase: IConfigSnapshotUseCase, scheduleUseCase: IConfigSnapshotScheduleUseCase, snapshotRepository: IConfigSnapshotRepository, logger: ISchedulerLogger); /** * Initialize the scheduler: load node-cron and start enabled schedules */ initialize(): Promise; /** * Load all enabled schedules and register cron tasks */ loadEnabledSchedules(): Promise; /** * Register a cron task for a schedule */ registerTask(schedule: ConfigSnapshotSchedule): void; /** * Unregister a cron task */ unregisterTask(scheduleId: string): void; /** * Add a schedule (called when a new schedule is created via API) */ addSchedule(schedule: ConfigSnapshotSchedule): void; /** * Update a schedule (called when a schedule is updated via API) */ updateSchedule(schedule: ConfigSnapshotSchedule): void; /** * Remove a schedule (called when a schedule is deleted via API) */ removeSchedule(scheduleId: string): void; /** * Execute a config snapshot for a given schedule. */ private executeSnapshot; /** * Apply retention policy: delete oldest snapshots exceeding retentionCount */ private applyRetentionPolicy; /** * Reload all schedules (e.g., after external changes) */ reload(): Promise; /** * Stop all scheduled tasks (graceful shutdown) */ shutdown(): void; /** * Get the number of active tasks */ get activeTaskCount(): number; /** * Get info about running cron jobs */ getRunningJobs(): Map; } //# sourceMappingURL=ConfigSnapshotSchedulerService.d.ts.map