/** * Job Types and Interfaces */ export interface JobConfig { name: string; pattern?: string; interval?: number; priority?: number; attempts?: number; backoff?: BackoffConfig; removeOnComplete?: boolean; removeOnFail?: boolean; timeout?: number; } export interface BackoffConfig { type: 'fixed' | 'exponential'; delay: number; } export type JobDataValue = string | number | boolean | null | JobDataValue[] | { [key: string]: JobDataValue; }; export interface JobData { [key: string]: JobDataValue; } export interface CleanupJobData { olderThan: string; targetType: 'deliveries' | 'logs' | 'cache' | 'metrics'; } export interface ReportGenerationJobData { reportType: 'usage' | 'cost' | 'performance'; startDate: string; endDate: string; format: 'pdf' | 'csv' | 'json'; } export interface HealthCheckJobData { modelIds?: string[]; checkType: 'availability' | 'performance' | 'full'; } export interface CacheWarmingJobData { patterns: string[]; priority: 'high' | 'medium' | 'low'; } export interface MetricsAggregationJobData { timeWindow: '1h' | '24h' | '7d' | '30d'; metricTypes: string[]; } export interface JobResultData { [key: string]: JobDataValue; } export interface JobResult { success: boolean; message?: string; data?: T; error?: string; } export declare enum JobType { CLEANUP = "cleanup", REPORT_GENERATION = "report-generation", HEALTH_CHECK = "health-check", CACHE_WARMING = "cache-warming", METRICS_AGGREGATION = "metrics-aggregation", COST_ANALYSIS = "cost-analysis", WEBHOOK_RETRY = "webhook-retry", BACKUP = "backup", CUSTOM = "custom" } export interface JobStatus { id: string; name: string; type: JobType; status: 'waiting' | 'active' | 'completed' | 'failed' | 'delayed'; progress?: number; attempts: number; maxAttempts: number; createdAt: Date; processedAt?: Date; finishedAt?: Date; failedReason?: string; data?: JobData; result?: JobResult; } export interface JobHandler { (data: TData): Promise>; } export interface SchedulerConfig { redis?: { host: string; port: number; password?: string; db?: number; }; defaultJobOptions?: { attempts?: number; backoff?: BackoffConfig; removeOnComplete?: boolean; removeOnFail?: boolean; }; } //# sourceMappingURL=types.d.ts.map