@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.
- package/dist/dev-console-plugin/index.d.ts +177 -0
- package/dist/dev-console-plugin/index.js +3047 -0
- package/dist/dev-console-plugin/index.js.map +1 -0
- package/dist/index.js +79 -53988
- package/dist/index.js.map +1 -1
- package/dist/queue-plugin/index.d.ts +29 -2
- package/dist/queue-plugin/index.js +231 -893
- package/dist/queue-plugin/index.js.map +1 -1
- package/dist/schedule-plugin/index.d.ts +3 -1
- package/dist/schedule-plugin/index.js +129 -8520
- package/dist/schedule-plugin/index.js.map +1 -1
- package/package.json +12 -10
- package/dist/index.d.mts +0 -11
- package/dist/index.mjs +0 -55728
- package/dist/index.mjs.map +0 -1
- package/dist/queue-plugin/index.d.mts +0 -83
- package/dist/queue-plugin/index.mjs +0 -2190
- package/dist/queue-plugin/index.mjs.map +0 -1
- package/dist/schedule-plugin/index.d.mts +0 -111
- package/dist/schedule-plugin/index.mjs +0 -10330
- package/dist/schedule-plugin/index.mjs.map +0 -1
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { FastifyPluginOptions, FastifyPluginAsync } from 'fastify';
|
|
2
|
-
|
|
3
|
-
interface QueueMessage {
|
|
4
|
-
id: string;
|
|
5
|
-
timestamp: Date;
|
|
6
|
-
attempts: number;
|
|
7
|
-
payload: any;
|
|
8
|
-
attributes: Record<string, any>;
|
|
9
|
-
nextAttempt?: Date;
|
|
10
|
-
error?: string;
|
|
11
|
-
failedAt?: Date;
|
|
12
|
-
reprocessed?: boolean;
|
|
13
|
-
originalId?: string;
|
|
14
|
-
}
|
|
15
|
-
type EventHandler = (message: QueueMessage) => Promise<void>;
|
|
16
|
-
interface QueueService {
|
|
17
|
-
handler: EventHandler;
|
|
18
|
-
incoming: QueueMessage[];
|
|
19
|
-
processing: QueueMessage[];
|
|
20
|
-
dlq: QueueMessage[];
|
|
21
|
-
timeoutId: NodeJS.Timeout | null;
|
|
22
|
-
processingBatch: boolean;
|
|
23
|
-
activeProcessing: number;
|
|
24
|
-
}
|
|
25
|
-
interface QueueConfig {
|
|
26
|
-
batchSize: number;
|
|
27
|
-
batchWindowMs: number;
|
|
28
|
-
maxRetries: number;
|
|
29
|
-
parallel: boolean;
|
|
30
|
-
maxConcurrent: number;
|
|
31
|
-
retryBackoff: boolean;
|
|
32
|
-
persistence: {
|
|
33
|
-
enabled: boolean;
|
|
34
|
-
directory: string;
|
|
35
|
-
saveInterval: number;
|
|
36
|
-
saveOnShutdown: boolean;
|
|
37
|
-
loadOnStartup: boolean;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
interface QueueSummary {
|
|
41
|
-
incoming: number;
|
|
42
|
-
processing: number;
|
|
43
|
-
dlq: number;
|
|
44
|
-
isProcessing: boolean;
|
|
45
|
-
activeProcessing: number;
|
|
46
|
-
configuration: {
|
|
47
|
-
batchSize: number;
|
|
48
|
-
batchWindowMs: number;
|
|
49
|
-
parallel: boolean;
|
|
50
|
-
maxConcurrent: number;
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
interface QueueRegistryItem {
|
|
54
|
-
queueName: string;
|
|
55
|
-
handler: EventHandler;
|
|
56
|
-
}
|
|
57
|
-
interface QueuePluginOptions extends FastifyPluginOptions {
|
|
58
|
-
prefix?: string;
|
|
59
|
-
config?: Partial<QueueConfig>;
|
|
60
|
-
}
|
|
61
|
-
interface QueueManager {
|
|
62
|
-
addQueue: (queueName: string, handler: EventHandler) => Promise<void>;
|
|
63
|
-
removeQueue: (queueName: string) => Promise<void>;
|
|
64
|
-
hasQueue: (queueName: string) => boolean;
|
|
65
|
-
listQueues: () => string[];
|
|
66
|
-
getQueueStats: (queueName: string) => QueueService | null;
|
|
67
|
-
getQueuesMap: () => Record<string, QueueService>;
|
|
68
|
-
}
|
|
69
|
-
interface QueueDecoratorOptions {
|
|
70
|
-
config: QueueConfig;
|
|
71
|
-
queues: Record<string, QueueService>;
|
|
72
|
-
saveQueueState?: (queueName: string, queueService: QueueService) => Promise<void>;
|
|
73
|
-
loadQueueState?: (queueName: string) => Promise<void>;
|
|
74
|
-
}
|
|
75
|
-
declare module 'fastify' {
|
|
76
|
-
interface FastifyInstance {
|
|
77
|
-
queues: QueueManager;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
declare const queuesPlugin: FastifyPluginAsync<QueuePluginOptions>;
|
|
82
|
-
|
|
83
|
-
export { type EventHandler, type QueueConfig, type QueueDecoratorOptions, type QueueManager, type QueueMessage, type QueuePluginOptions, type QueueRegistryItem, type QueueService, type QueueSummary, queuesPlugin };
|