@cloudnux/local-cloud-provider 0.2.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@ interface QueueService {
21
21
  timeoutId: NodeJS.Timeout | null;
22
22
  processingBatch: boolean;
23
23
  activeProcessing: number;
24
+ module?: string;
24
25
  }
25
26
  interface QueueConfig {
26
27
  batchSize: number;
@@ -59,18 +60,44 @@ interface QueuePluginOptions extends FastifyPluginOptions {
59
60
  config?: Partial<QueueConfig>;
60
61
  }
61
62
  interface QueueManager {
62
- addQueue: (queueName: string, handler: EventHandler) => Promise<void>;
63
+ addQueue: (queueName: string, handler: EventHandler, module?: string) => Promise<void>;
63
64
  removeQueue: (queueName: string) => Promise<void>;
64
65
  hasQueue: (queueName: string) => boolean;
65
- listQueues: () => string[];
66
+ listQueues: (module?: string) => string[];
66
67
  getQueueStats: (queueName: string) => QueueService | null;
67
68
  getQueuesMap: () => Record<string, QueueService>;
69
+ getConfig: () => QueueConfig;
70
+ getDashboardSummary: () => Record<string, QueueSummary>;
71
+ getQueueSummary: (queueName: string) => {
72
+ stats: QueueSummary;
73
+ messages: {
74
+ incoming: QueueMessage[];
75
+ processing: QueueMessage[];
76
+ dlq: QueueMessage[];
77
+ };
78
+ } | null;
79
+ enqueueMessage: (queueName: string, body: any, attributes: any) => Promise<{
80
+ id: string;
81
+ queueName: string;
82
+ } | null>;
83
+ processDlq: (queueName: string) => Promise<{
84
+ status: string;
85
+ message: string;
86
+ processed: number;
87
+ } | null>;
88
+ purgeDlq: (queueName: string) => Promise<{
89
+ status: string;
90
+ message: string;
91
+ purged: number;
92
+ } | null>;
68
93
  }
69
94
  interface QueueDecoratorOptions {
70
95
  config: QueueConfig;
71
96
  queues: Record<string, QueueService>;
72
97
  saveQueueState?: (queueName: string, queueService: QueueService) => Promise<void>;
73
98
  loadQueueState?: (queueName: string) => Promise<void>;
99
+ scheduleProcessing: (queueName: string, queueService: QueueService) => void;
100
+ processBatch: (queueName: string, queueService: QueueService) => Promise<void>;
74
101
  }
75
102
  declare module 'fastify' {
76
103
  interface FastifyInstance {