@holo-js/queue 0.2.5 → 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.
@@ -0,0 +1,32 @@
1
+ import {
2
+ DEFAULT_DATABASE_QUEUE_TABLE,
3
+ DEFAULT_FAILED_JOBS_CONNECTION,
4
+ DEFAULT_FAILED_JOBS_TABLE,
5
+ DEFAULT_QUEUE_BLOCK_FOR,
6
+ DEFAULT_QUEUE_CONNECTION,
7
+ DEFAULT_QUEUE_NAME,
8
+ DEFAULT_QUEUE_RETRY_AFTER,
9
+ DEFAULT_QUEUE_SLEEP,
10
+ DEFAULT_REDIS_DB,
11
+ DEFAULT_REDIS_HOST,
12
+ DEFAULT_REDIS_PORT,
13
+ holoQueueDefaults,
14
+ normalizeQueueConfig,
15
+ queueInternals
16
+ } from "./chunk-5MPOVBVE.mjs";
17
+ export {
18
+ DEFAULT_DATABASE_QUEUE_TABLE,
19
+ DEFAULT_FAILED_JOBS_CONNECTION,
20
+ DEFAULT_FAILED_JOBS_TABLE,
21
+ DEFAULT_QUEUE_BLOCK_FOR,
22
+ DEFAULT_QUEUE_CONNECTION,
23
+ DEFAULT_QUEUE_NAME,
24
+ DEFAULT_QUEUE_RETRY_AFTER,
25
+ DEFAULT_QUEUE_SLEEP,
26
+ DEFAULT_REDIS_DB,
27
+ DEFAULT_REDIS_HOST,
28
+ DEFAULT_REDIS_PORT,
29
+ holoQueueDefaults,
30
+ normalizeQueueConfig,
31
+ queueInternals
32
+ };
package/dist/index.d.ts CHANGED
@@ -1,375 +1,5 @@
1
- type QueueJsonPrimitive = string | number | boolean | null;
2
- type QueueJsonValue = QueueJsonPrimitive | readonly QueueJsonValue[] | {
3
- readonly [key: string]: QueueJsonValue;
4
- };
5
- type QueueJobDispatcher = <TPayload extends QueueJsonValue>(jobName: string, payload: TPayload) => QueuePendingDispatch<TPayload>;
6
- type QueueJobSyncDispatcher = <TPayload extends QueueJsonValue, TResult>(jobName: string, payload: TPayload) => Promise<TResult>;
7
- declare function setQueueJobDispatcher(dispatcher: QueueJobDispatcher): void;
8
- declare function setQueueJobSyncDispatcher(dispatcher: QueueJobSyncDispatcher): void;
9
- declare function setQueueJobDefinitionName(definition: object, name: string): void;
10
- declare function deleteQueueJobDefinitionName(name: string): void;
11
- declare function clearQueueJobDefinitionNames(): void;
12
- declare function resolveQueueJobDefinitionName(definition: object): string;
13
- declare function dispatchDefinedQueueJob<TPayload extends QueueJsonValue>(definition: object, payload: TPayload): QueuePendingDispatch<TPayload>;
14
- declare function dispatchDefinedQueueJobSync<TPayload extends QueueJsonValue, TResult>(definition: object, payload: TPayload): Promise<TResult>;
15
- declare function normalizeOptionalString(value: string | undefined, label: string): string | undefined;
16
- declare function normalizeOptionalInteger(value: number | undefined, label: string, options?: {
17
- minimum?: number;
18
- }): number | undefined;
19
- declare function normalizeBackoff(value: number | readonly number[] | undefined): number | readonly number[] | undefined;
20
- declare function normalizeOptionalHook<THandler extends (...args: never[]) => unknown>(value: THandler | undefined, label: string): THandler | undefined;
21
- interface QueueJobContext {
22
- readonly jobId: string;
23
- readonly jobName: string;
24
- readonly connection: string;
25
- readonly queue: string;
26
- readonly attempt: number;
27
- readonly maxAttempts: number;
28
- release(delaySeconds?: number): Promise<void>;
29
- fail(error: Error): Promise<void>;
30
- }
31
- interface QueueJobCompletedHook<TPayload extends QueueJsonValue = QueueJsonValue, TResult = unknown> {
32
- (payload: TPayload, result: TResult, context: QueueJobContext): void | Promise<void>;
33
- }
34
- interface QueueJobFailedHook<TPayload extends QueueJsonValue = QueueJsonValue> {
35
- (payload: TPayload, error: Error, context: QueueJobContext): void | Promise<void>;
36
- }
37
- interface QueueJobDefinition<TPayload extends QueueJsonValue = QueueJsonValue, TResult = unknown> {
38
- readonly connection?: string;
39
- readonly queue?: string;
40
- readonly tries?: number;
41
- readonly backoff?: number | readonly number[];
42
- readonly timeout?: number;
43
- readonly onCompleted?: QueueJobCompletedHook<TPayload, TResult>;
44
- readonly onFailed?: QueueJobFailedHook<TPayload>;
45
- handle(payload: TPayload, context: QueueJobContext): Promise<TResult> | TResult;
46
- }
47
- interface DefinedQueueJobDefinition<TPayload extends QueueJsonValue = QueueJsonValue, TResult = unknown> extends QueueJobDefinition<TPayload, TResult> {
48
- dispatch(payload: TPayload): QueuePendingDispatch<TPayload>;
49
- dispatchSync(payload: TPayload): Promise<TResult>;
50
- }
51
- interface QueueJobEnvelope<TPayload extends QueueJsonValue = QueueJsonValue> {
52
- readonly id: string;
53
- readonly name: string;
54
- readonly connection: string;
55
- readonly queue: string;
56
- readonly payload: TPayload;
57
- readonly attempts: number;
58
- readonly maxAttempts: number;
59
- readonly availableAt?: number;
60
- readonly createdAt: number;
61
- }
62
- type QueueDelayValue = number | Date;
63
- interface QueueDispatchOptions {
64
- readonly connection?: string;
65
- readonly queue?: string;
66
- readonly delay?: QueueDelayValue;
67
- }
68
- interface QueueDispatchResult {
69
- readonly jobId: string;
70
- readonly connection: string;
71
- readonly queue: string;
72
- readonly synchronous: boolean;
73
- }
74
- interface QueueDispatchCompletedHook {
75
- (result: QueueDispatchResult): void | Promise<void>;
76
- }
77
- interface QueueDispatchFailedHook {
78
- (error: unknown): void | Promise<void>;
79
- }
80
- interface QueueDriverDispatchResult<TResult = unknown> {
81
- readonly jobId: string;
82
- readonly synchronous: boolean;
83
- readonly result?: TResult;
84
- }
85
- interface QueueRegisteredJob<TPayload extends QueueJsonValue = QueueJsonValue, TResult = unknown> {
86
- readonly name: string;
87
- readonly sourcePath?: string;
88
- readonly definition: QueueJobDefinition<TPayload, TResult>;
89
- }
90
- interface HoloQueueJobRegistry {
91
- }
92
- type KnownQueueJobName = Extract<keyof HoloQueueJobRegistry, string>;
93
- type DynamicQueueJobName<TJobName extends string> = [KnownQueueJobName] extends [never] ? TJobName : TJobName extends KnownQueueJobName ? never : KnownQueueJobName extends TJobName ? never : TJobName;
94
- type ResolveRegisteredQueueJobDefinition<TJobName extends string> = TJobName extends KnownQueueJobName ? HoloQueueJobRegistry[TJobName] extends QueueJobDefinition<infer TPayload, infer TResult> ? QueueJobDefinition<TPayload, TResult> : QueueJobDefinition : QueueJobDefinition;
95
- type ExportedQueueJobDefinition<TValue> = TValue extends QueueJobDefinition<infer TPayload, infer TResult> ? QueueJobDefinition<TPayload, TResult> : QueueJobDefinition;
96
- type QueuePayloadFor<TJobName extends string> = ResolveRegisteredQueueJobDefinition<TJobName> extends QueueJobDefinition<infer TPayload, infer _TResult> ? TPayload : QueueJsonValue;
97
- type QueueResultFor<TJobName extends string> = ResolveRegisteredQueueJobDefinition<TJobName> extends QueueJobDefinition<infer _TPayload, infer TResult> ? TResult : unknown;
98
- interface RegisterQueueJobOptions {
99
- readonly name?: string;
100
- readonly sourcePath?: string;
101
- readonly replaceExisting?: boolean;
102
- }
103
- type RegisterableQueueJobDefinition<TPayload extends QueueJsonValue = QueueJsonValue, TResult = unknown> = QueueJobDefinition<TPayload, TResult>;
104
- interface QueuePendingDispatch<TPayload extends QueueJsonValue = QueueJsonValue> extends PromiseLike<QueueDispatchResult> {
105
- onConnection(name: string): QueuePendingDispatch<TPayload>;
106
- onQueue(name: string): QueuePendingDispatch<TPayload>;
107
- delay(value: QueueDelayValue): QueuePendingDispatch<TPayload>;
108
- onComplete(callback: QueueDispatchCompletedHook): QueuePendingDispatch<TPayload>;
109
- onFailed(callback: QueueDispatchFailedHook): QueuePendingDispatch<TPayload>;
110
- then<TResult1 = QueueDispatchResult, TResult2 = never>(onfulfilled?: ((value: QueueDispatchResult) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
111
- catch<TResult = never>(onrejected?: ((reason: unknown) => TResult | PromiseLike<TResult>) | null): Promise<QueueDispatchResult | TResult>;
112
- finally(onfinally?: (() => void) | null): Promise<QueueDispatchResult>;
113
- dispatch(): Promise<QueueDispatchResult>;
114
- }
115
- interface QueueConnectionFacade {
116
- readonly name: string;
117
- dispatch<TJobName extends KnownQueueJobName>(jobName: TJobName, payload: QueuePayloadFor<TJobName>, options?: QueueDispatchOptions): QueuePendingDispatch<QueuePayloadFor<TJobName>>;
118
- dispatch<TPayload extends QueueJsonValue = QueueJsonValue, const TJobName extends string = string>(jobName: TJobName & DynamicQueueJobName<TJobName>, payload: TPayload, options?: QueueDispatchOptions): QueuePendingDispatch<TPayload>;
119
- dispatchSync<TJobName extends KnownQueueJobName>(jobName: TJobName, payload: QueuePayloadFor<TJobName>): Promise<QueueResultFor<TJobName>>;
120
- dispatchSync<TPayload extends QueueJsonValue = QueueJsonValue, TResult = unknown, const TJobName extends string = string>(jobName: TJobName & DynamicQueueJobName<TJobName>, payload: TPayload): Promise<TResult>;
121
- }
122
- interface QueueEnqueueResult {
123
- readonly jobId: string;
124
- }
125
- interface QueueReserveInput {
126
- readonly queueNames: readonly string[];
127
- readonly workerId: string;
128
- }
129
- interface QueueReservedJob<TPayload extends QueueJsonValue = QueueJsonValue> {
130
- readonly reservationId: string;
131
- readonly envelope: QueueJobEnvelope<TPayload>;
132
- readonly reservedAt: number;
133
- }
134
- interface QueueReleaseOptions {
135
- readonly delaySeconds?: number;
136
- }
137
- interface QueueClearInput {
138
- readonly queueNames?: readonly string[];
139
- }
140
- interface QueueJobContextOverrides {
141
- readonly maxAttempts?: number;
142
- shouldSkipLifecycleHooks?(): boolean;
143
- release?(delaySeconds?: number): Promise<void>;
144
- fail?(error: Error): Promise<void>;
145
- }
146
- interface QueueDriverFactoryContext {
147
- execute<TPayload extends QueueJsonValue = QueueJsonValue, TResult = unknown>(job: QueueJobEnvelope<TPayload>): Promise<TResult>;
148
- }
149
- interface QueueDriverBase {
150
- readonly name: string;
151
- readonly driver: NormalizedQueueConnectionConfig['driver'];
152
- readonly mode: 'sync' | 'async';
153
- dispatch<TPayload extends QueueJsonValue = QueueJsonValue, TResult = unknown>(job: QueueJobEnvelope<TPayload>): Promise<QueueDriverDispatchResult<TResult>>;
154
- clear(input?: QueueClearInput): Promise<number>;
155
- close(): Promise<void>;
156
- }
157
- interface QueueAsyncDriver extends QueueDriverBase {
158
- readonly mode: 'async';
159
- reserve<TPayload extends QueueJsonValue = QueueJsonValue>(input: QueueReserveInput): Promise<QueueReservedJob<TPayload> | null>;
160
- acknowledge(job: QueueReservedJob): Promise<void>;
161
- release(job: QueueReservedJob, options?: QueueReleaseOptions): Promise<void>;
162
- delete(job: QueueReservedJob): Promise<void>;
163
- }
164
- interface QueueSyncDriver extends QueueDriverBase {
165
- readonly mode: 'sync';
166
- }
167
- type QueueDriver = QueueSyncDriver | QueueAsyncDriver;
168
- interface QueueDriverFactory<TConfig extends NormalizedQueueConnectionConfig = NormalizedQueueConnectionConfig> {
169
- readonly driver: TConfig['driver'];
170
- create(connection: TConfig, context: QueueDriverFactoryContext): QueueDriver;
171
- }
172
- interface QueueRuntimeBinding {
173
- readonly config: NormalizedHoloQueueConfig;
174
- readonly drivers: ReadonlyMap<string, QueueDriver>;
175
- }
176
- interface QueueWorkerOptions {
177
- readonly connection?: string;
178
- readonly queueNames?: readonly string[];
179
- readonly once?: boolean;
180
- readonly stopWhenEmpty?: boolean;
181
- readonly sleep?: number;
182
- readonly tries?: number;
183
- readonly timeout?: number;
184
- readonly maxJobs?: number;
185
- readonly maxTime?: number;
186
- readonly workerId?: string;
187
- readonly shouldStop?: () => boolean | Promise<boolean>;
188
- readonly sleepFn?: (milliseconds: number) => Promise<void>;
189
- }
190
- interface QueueWorkerJobEvent {
191
- readonly jobId: string;
192
- readonly jobName: string;
193
- readonly connection: string;
194
- readonly queue: string;
195
- readonly attempt: number;
196
- readonly maxAttempts: number;
197
- }
198
- interface QueueWorkerHooks {
199
- onJobProcessed?(event: QueueWorkerJobEvent): void | Promise<void>;
200
- onJobReleased?(event: QueueWorkerJobEvent & {
201
- readonly delaySeconds?: number;
202
- readonly error?: Error;
203
- }): void | Promise<void>;
204
- onJobFailed?(event: QueueWorkerJobEvent & {
205
- readonly error: Error;
206
- }): void | Promise<void>;
207
- onIdle?(): void | Promise<void>;
208
- }
209
- interface QueueWorkerRunOptions extends QueueWorkerOptions, QueueWorkerHooks {
210
- }
211
- interface QueueWorkerResult {
212
- readonly processed: number;
213
- readonly released: number;
214
- readonly failed: number;
215
- readonly stoppedBecause: 'once' | 'empty' | 'max-jobs' | 'max-time' | 'signal';
216
- }
217
- interface QueueFailedJobRecord<TPayload extends QueueJsonValue = QueueJsonValue> {
218
- readonly id: string;
219
- readonly jobId: string;
220
- readonly job: QueueJobEnvelope<TPayload>;
221
- readonly exception: string;
222
- readonly failedAt: number;
223
- }
224
- interface QueueFailedJobStore {
225
- persistFailedJob(reserved: QueueReservedJob, error: Error): Promise<QueueFailedJobRecord | null>;
226
- listFailedJobs(): Promise<readonly QueueFailedJobRecord[]>;
227
- retryFailedJobs(identifier: 'all' | string, retry: (record: QueueFailedJobRecord) => Promise<void>): Promise<number>;
228
- forgetFailedJob(id: string): Promise<boolean>;
229
- flushFailedJobs(): Promise<number>;
230
- }
231
- declare function isQueueJobDefinition(value: unknown): value is QueueJobDefinition;
232
- declare function normalizeQueueJobDefinition<TPayload extends QueueJsonValue, TResult, TJob extends QueueJobDefinition<TPayload, TResult>>(job: TJob): TJob;
233
- declare function defineJob<TPayload extends QueueJsonValue, TResult = unknown>(job: QueueJobDefinition<TPayload, TResult>): DefinedQueueJobDefinition<TPayload, TResult>;
234
- interface QueueFailedStoreConfig {
235
- readonly driver?: 'database';
236
- readonly connection?: string;
237
- readonly table?: string;
238
- }
239
- interface QueueRedisConnectionConfig {
240
- readonly driver: 'redis';
241
- readonly connection?: string;
242
- readonly queue?: string;
243
- readonly retryAfter?: number | string;
244
- readonly blockFor?: number | string;
245
- readonly redis?: {
246
- readonly url?: string;
247
- readonly clusters?: readonly {
248
- readonly url?: string;
249
- readonly host?: string;
250
- readonly port?: number | string;
251
- }[];
252
- readonly host?: string;
253
- readonly port?: number | string;
254
- readonly password?: string;
255
- readonly username?: string;
256
- readonly db?: number | string;
257
- };
258
- }
259
- interface QueueDatabaseConnectionConfig {
260
- readonly driver: 'database';
261
- readonly queue?: string;
262
- readonly retryAfter?: number | string;
263
- readonly sleep?: number | string;
264
- readonly connection?: string;
265
- readonly table?: string;
266
- }
267
- interface QueueSyncConnectionConfig {
268
- readonly driver: 'sync';
269
- readonly queue?: string;
270
- }
271
- type QueueConnectionConfig = QueueSyncConnectionConfig | QueueRedisConnectionConfig | QueueDatabaseConnectionConfig;
272
- interface HoloQueueConfig {
273
- readonly default?: string;
274
- readonly failed?: false | QueueFailedStoreConfig;
275
- readonly connections?: Readonly<Record<string, QueueConnectionConfig>>;
276
- }
277
- interface NormalizedQueueFailedStoreConfig {
278
- readonly driver: 'database';
279
- readonly connection: string;
280
- readonly table: string;
281
- }
282
- interface NormalizedQueueSyncConnectionConfig {
283
- readonly name: string;
284
- readonly driver: 'sync';
285
- readonly queue: string;
286
- }
287
- interface NormalizedQueueRedisConnectionConfig {
288
- readonly name: string;
289
- readonly driver: 'redis';
290
- readonly connection: string;
291
- readonly queue: string;
292
- readonly retryAfter: number;
293
- readonly blockFor: number;
294
- readonly redis: {
295
- readonly url?: string;
296
- readonly clusters?: readonly {
297
- readonly url?: string;
298
- readonly host: string;
299
- readonly port: number;
300
- }[];
301
- readonly host: string;
302
- readonly port: number;
303
- readonly password?: string;
304
- readonly username?: string;
305
- readonly db: number;
306
- };
307
- }
308
- interface QueueSharedRedisConnectionConfig {
309
- readonly name: string;
310
- readonly url?: string;
311
- readonly clusters?: readonly {
312
- readonly url?: string;
313
- readonly host: string;
314
- readonly port: number;
315
- }[];
316
- readonly host: string;
317
- readonly port: number;
318
- readonly password?: string;
319
- readonly username?: string;
320
- readonly db: number;
321
- }
322
- interface QueueSharedRedisConfig {
323
- readonly default: string;
324
- readonly connections: Readonly<Record<string, QueueSharedRedisConnectionConfig>>;
325
- }
326
- interface NormalizedQueueDatabaseConnectionConfig {
327
- readonly name: string;
328
- readonly driver: 'database';
329
- readonly queue: string;
330
- readonly retryAfter: number;
331
- readonly sleep: number;
332
- readonly connection: string;
333
- readonly table: string;
334
- }
335
- type NormalizedQueueConnectionConfig = NormalizedQueueSyncConnectionConfig | NormalizedQueueRedisConnectionConfig | NormalizedQueueDatabaseConnectionConfig;
336
- interface NormalizedHoloQueueConfig {
337
- readonly default: string;
338
- readonly failed: false | NormalizedQueueFailedStoreConfig;
339
- readonly connections: Readonly<Record<string, NormalizedQueueConnectionConfig>>;
340
- }
341
- declare const queueJobInternals: {
342
- clearQueueJobDefinitionNames: typeof clearQueueJobDefinitionNames;
343
- deleteQueueJobDefinitionName: typeof deleteQueueJobDefinitionName;
344
- dispatchDefinedQueueJob: typeof dispatchDefinedQueueJob;
345
- dispatchDefinedQueueJobSync: typeof dispatchDefinedQueueJobSync;
346
- normalizeQueueJobDefinition: typeof normalizeQueueJobDefinition;
347
- normalizeBackoff: typeof normalizeBackoff;
348
- normalizeOptionalHook: typeof normalizeOptionalHook;
349
- normalizeOptionalInteger: typeof normalizeOptionalInteger;
350
- normalizeOptionalString: typeof normalizeOptionalString;
351
- resolveQueueJobDefinitionName: typeof resolveQueueJobDefinitionName;
352
- setQueueJobDefinitionName: typeof setQueueJobDefinitionName;
353
- setQueueJobDispatcher: typeof setQueueJobDispatcher;
354
- setQueueJobSyncDispatcher: typeof setQueueJobSyncDispatcher;
355
- };
356
-
357
- declare const DEFAULT_QUEUE_CONNECTION = "sync";
358
- declare const DEFAULT_QUEUE_NAME = "default";
359
- declare const DEFAULT_QUEUE_RETRY_AFTER = 90;
360
- declare const DEFAULT_QUEUE_BLOCK_FOR = 5;
361
- declare const DEFAULT_QUEUE_SLEEP = 1;
362
- declare const DEFAULT_FAILED_JOBS_CONNECTION = "default";
363
- declare const DEFAULT_FAILED_JOBS_TABLE = "failed_jobs";
364
- declare const DEFAULT_DATABASE_QUEUE_TABLE = "jobs";
365
- declare function parseInteger(value: number | string | undefined, fallback: number, label: string, options?: {
366
- minimum?: number;
367
- }): number;
368
- declare function normalizeQueueConfig(config?: HoloQueueConfig, redisConfig?: QueueSharedRedisConfig): NormalizedHoloQueueConfig;
369
- declare const holoQueueDefaults: Readonly<NormalizedHoloQueueConfig>;
370
- declare const queueInternals: {
371
- parseInteger: typeof parseInteger;
372
- };
1
+ import { Q as QueueRegisteredJob, a as QueueJsonValue, R as RegisterableQueueJobDefinition, b as RegisterQueueJobOptions, c as QueueDriverFactory, N as NormalizedQueueSyncConnectionConfig, d as QueueSyncDriver, e as QueueDriverFactoryContext, f as QueueJobEnvelope, g as QueueDriverDispatchResult, h as QueueConnectionFacade, H as HoloQueueJobRegistry, i as QueuePayloadFor, j as QueueDispatchOptions, k as QueuePendingDispatch, l as QueueResultFor, m as HoloQueueConfig, n as NormalizedHoloQueueConfig, o as QueueSharedRedisConfig, p as QueueFailedJobStore, q as QueueRuntimeBinding, r as QueueDriver, s as QueueJobContextOverrides, t as QueueJobContext, u as QueueDispatchResult, v as QueueDelayValue, w as NormalizedQueueConnectionConfig, x as QueueFailedJobRecord, y as QueueReservedJob, z as QueueClearInput, A as QueueWorkerJobEvent, B as QueueAsyncDriver, C as QueueWorkerRunOptions, D as QueueJobDefinition, E as QueueWorkerOptions, F as QueueWorkerResult } from './config-Bleufve4.js';
2
+ export { G as DEFAULT_DATABASE_QUEUE_TABLE, I as DEFAULT_FAILED_JOBS_CONNECTION, J as DEFAULT_FAILED_JOBS_TABLE, K as DEFAULT_QUEUE_BLOCK_FOR, L as DEFAULT_QUEUE_CONNECTION, M as DEFAULT_QUEUE_NAME, O as DEFAULT_QUEUE_RETRY_AFTER, P as DEFAULT_QUEUE_SLEEP, S as DefinedQueueJobDefinition, T as ExportedQueueJobDefinition, U as NormalizedQueueDatabaseConnectionConfig, V as NormalizedQueueFailedStoreConfig, W as NormalizedQueuePluginConnectionConfig, X as NormalizedQueueRedisConnectionConfig, Y as QueueConnectionConfig, Z as QueueDatabaseConnectionConfig, _ as QueueDispatchCompletedHook, $ as QueueDispatchFailedHook, a0 as QueueEnqueueResult, a1 as QueueFailedStoreConfig, a2 as QueuePluginConnectionConfig, a3 as QueueRedisConnectionConfig, a4 as QueueReleaseOptions, a5 as QueueReserveInput, a6 as QueueSharedRedisConnectionConfig, a7 as QueueSyncConnectionConfig, a8 as QueueWorkerHooks, a9 as defineJob, aa as holoQueueDefaults, ab as isQueueJobDefinition, ac as normalizeQueueConfig, ad as normalizeQueueJobDefinition, ae as queueInternals, af as queueJobInternals } from './config-Bleufve4.js';
373
3
 
374
4
  declare function deriveJobNameFromSourcePath(sourcePath: string): string;
375
5
  declare function registerQueueJob<TPayload extends QueueJsonValue, TResult>(definition: RegisterableQueueJobDefinition<TPayload, TResult>, options?: RegisterQueueJobOptions): QueueRegisteredJob<TPayload, TResult>;
@@ -385,67 +15,6 @@ declare const queueRegistryInternals: {
385
15
  deriveJobNameFromSourcePath: typeof deriveJobNameFromSourcePath;
386
16
  };
387
17
 
388
- type RedisDriverModule = {
389
- redisQueueDriverFactory: QueueDriverFactory<NormalizedQueueRedisConnectionConfig>;
390
- };
391
- type RedisQueuedEnvelope = QueueJobEnvelope<QueueJsonValue>;
392
- declare function loadRedisDriverModule(): Promise<RedisDriverModule>;
393
- declare function normalizeRedisErrorMessage(error: unknown): string;
394
- declare function isQueueEnvelope(value: unknown): value is RedisQueuedEnvelope;
395
- type RedisConnectionOptions = {
396
- url?: string;
397
- clusters?: readonly {
398
- readonly url?: string;
399
- readonly host: string;
400
- readonly port: number;
401
- }[];
402
- host?: string;
403
- port?: number;
404
- path?: string;
405
- username?: string;
406
- password?: string;
407
- db: number;
408
- maxRetriesPerRequest: null;
409
- };
410
- declare function toRedisSocketPath(value: string): string;
411
- declare function resolveBullConnectionOptions(connection: NormalizedQueueRedisConnectionConfig): RedisConnectionOptions;
412
- declare class RedisQueueDriverError extends Error {
413
- constructor(connectionName: string, action: string, cause: unknown);
414
- }
415
- declare function wrapRedisError(connectionName: string, action: string, error: unknown): RedisQueueDriverError;
416
- declare function resolveAttempts(job: {
417
- attemptsStarted?: number;
418
- attemptsMade?: number;
419
- }): number;
420
- declare class RedisQueueDriver implements QueueAsyncDriver {
421
- private readonly connection;
422
- private readonly context;
423
- readonly name: string;
424
- readonly driver: "redis";
425
- readonly mode: "async";
426
- private driverInstance?;
427
- private pending?;
428
- constructor(connection: NormalizedQueueRedisConnectionConfig, context: QueueDriverFactoryContext);
429
- private resolveDriver;
430
- dispatch<TPayload extends QueueJsonValue = QueueJsonValue, TResult = unknown>(job: QueueJobEnvelope<TPayload>): Promise<QueueDriverDispatchResult<TResult>>;
431
- reserve<TPayload extends QueueJsonValue = QueueJsonValue>(input: Parameters<QueueAsyncDriver['reserve']>[0]): Promise<QueueReservedJob<TPayload> | null>;
432
- acknowledge(job: QueueReservedJob): Promise<void>;
433
- release(job: QueueReservedJob, options?: QueueReleaseOptions): Promise<void>;
434
- delete(job: QueueReservedJob): Promise<void>;
435
- clear(input?: Parameters<QueueAsyncDriver['clear']>[0]): Promise<number>;
436
- close(): Promise<void>;
437
- }
438
- declare const redisQueueDriverFactory: QueueDriverFactory<NormalizedQueueRedisConnectionConfig>;
439
- declare const redisQueueDriverInternals: {
440
- isQueueEnvelope: typeof isQueueEnvelope;
441
- loadRedisDriverModule: typeof loadRedisDriverModule;
442
- normalizeRedisErrorMessage: typeof normalizeRedisErrorMessage;
443
- resolveAttempts: typeof resolveAttempts;
444
- resolveBullConnectionOptions: typeof resolveBullConnectionOptions;
445
- toRedisSocketPath: typeof toRedisSocketPath;
446
- wrapRedisError: typeof wrapRedisError;
447
- };
448
-
449
18
  declare class SyncQueueDriver implements QueueSyncDriver {
450
19
  readonly name: string;
451
20
  readonly driver: "sync";
@@ -497,6 +66,7 @@ declare function executeRegisteredQueueJobFailedHook<TPayload extends QueueJsonV
497
66
  declare function dispatchThroughDriver(driver: QueueDriver, envelope: QueueJobEnvelope): Promise<Awaited<ReturnType<QueueDriver['dispatch']>>>;
498
67
  declare function createQueueDriverFactoryContext(): QueueDriverFactoryContext;
499
68
  declare function resolveDriverFactory(state: RuntimeQueueState, connection: NormalizedQueueConnectionConfig): QueueDriverFactory;
69
+ declare function loadQueuePluginDrivers(projectRoot?: string, pluginNames?: readonly string[]): Promise<void>;
500
70
  declare function resolveConnectionDriver(connectionName?: string): QueueDriver;
501
71
  declare function resolveSyncExecutionDriver(): QueueDriver;
502
72
  declare function createJobEnvelope<TPayload extends QueueJsonValue>(jobName: string, payload: TPayload, options: QueueDispatchOptions): QueueJobEnvelope<TPayload>;
@@ -550,6 +120,9 @@ declare const queueRuntimeInternals: {
550
120
  };
551
121
  declare function closeQueueDrivers(drivers: Iterable<QueueDriver>): Promise<void>;
552
122
 
123
+ declare function loadQueuePluginDriverFactories(projectRoot?: string, pluginNames?: readonly string[]): Promise<readonly QueueDriverFactory[]>;
124
+ declare function resetQueuePluginDriverFactories(): void;
125
+
553
126
  declare function normalizeFailedStoreErrorMessage(error: unknown): string;
554
127
  declare class QueueFailedStoreError extends Error {
555
128
  constructor(action: string, cause: unknown);
@@ -629,4 +202,4 @@ declare const queueWorkerInternals: {
629
202
 
630
203
  declare function defineQueueConfig<TConfig extends HoloQueueConfig>(config: TConfig): Readonly<TConfig>;
631
204
 
632
- export { DEFAULT_DATABASE_QUEUE_TABLE, DEFAULT_FAILED_JOBS_CONNECTION, DEFAULT_FAILED_JOBS_TABLE, DEFAULT_QUEUE_BLOCK_FOR, DEFAULT_QUEUE_CONNECTION, DEFAULT_QUEUE_NAME, DEFAULT_QUEUE_RETRY_AFTER, DEFAULT_QUEUE_SLEEP, type DefinedQueueJobDefinition, type ExportedQueueJobDefinition, type HoloQueueConfig, type HoloQueueJobRegistry, type NormalizedHoloQueueConfig, type NormalizedQueueConnectionConfig, type NormalizedQueueDatabaseConnectionConfig, type NormalizedQueueFailedStoreConfig, type NormalizedQueueRedisConnectionConfig, type NormalizedQueueSyncConnectionConfig, Queue, type QueueAsyncDriver, type QueueClearInput, type QueueConnectionConfig, type QueueConnectionFacade, type QueueDatabaseConnectionConfig, type QueueDelayValue, type QueueDispatchCompletedHook, type QueueDispatchFailedHook, type QueueDispatchOptions, type QueueDispatchResult, type QueueDriver, type QueueDriverDispatchResult, type QueueDriverFactory, type QueueDriverFactoryContext, type QueueEnqueueResult, type QueueFailedJobRecord, type QueueFailedJobStore, type QueueFailedStoreConfig, QueueFailedStoreError, type QueueJobContext, type QueueJobContextOverrides, type QueueJobDefinition, type QueueJobEnvelope, type QueueJsonValue, type QueuePayloadFor, type QueuePendingDispatch, type QueueRedisConnectionConfig, type QueueRegisteredJob, type QueueReleaseOptions, QueueReleaseUnsupportedError, type QueueReserveInput, type QueueReservedJob, type QueueResultFor, type QueueRuntimeBinding, type QueueSharedRedisConfig, type QueueSharedRedisConnectionConfig, type QueueSyncConnectionConfig, type QueueSyncDriver, type QueueWorkerHooks, type QueueWorkerJobEvent, type QueueWorkerOptions, type QueueWorkerResult, type QueueWorkerRunOptions, QueueWorkerTimeoutError, QueueWorkerUnsupportedDriverError, RedisQueueDriver, RedisQueueDriverError, type RegisterQueueJobOptions, type RegisterableQueueJobDefinition, clearQueueConnection, configureQueueRuntime, defineJob, defineQueueConfig, dispatch, dispatchSync, flushFailedQueueJobs, forgetFailedQueueJob, getQueueRuntime, getRegisteredQueueJob, holoQueueDefaults, isQueueJobDefinition, listFailedQueueJobs, listRegisteredQueueJobs, normalizeQueueConfig, normalizeQueueJobDefinition, persistFailedQueueJob, queueFailedInternals, queueInternals, queueJobInternals, queueRegistryInternals, queueRuntimeInternals, queueWorkerInternals, redisQueueDriverFactory, redisQueueDriverInternals, registerQueueJob, registerQueueJobs, resetQueueRegistry, resetQueueRuntime, retryFailedQueueJobs, runQueueWorker, shutdownQueueRuntime, syncQueueDriverFactory, syncQueueDriverInternals, unregisterQueueJob, useQueueConnection };
205
+ export { HoloQueueConfig, HoloQueueJobRegistry, NormalizedHoloQueueConfig, NormalizedQueueConnectionConfig, NormalizedQueueSyncConnectionConfig, Queue, QueueAsyncDriver, QueueClearInput, QueueConnectionFacade, QueueDelayValue, QueueDispatchOptions, QueueDispatchResult, QueueDriver, QueueDriverDispatchResult, QueueDriverFactory, QueueDriverFactoryContext, QueueFailedJobRecord, QueueFailedJobStore, QueueFailedStoreError, QueueJobContext, QueueJobContextOverrides, QueueJobDefinition, QueueJobEnvelope, QueueJsonValue, QueuePayloadFor, QueuePendingDispatch, QueueRegisteredJob, QueueReleaseUnsupportedError, QueueReservedJob, QueueResultFor, QueueRuntimeBinding, QueueSharedRedisConfig, QueueSyncDriver, QueueWorkerJobEvent, QueueWorkerOptions, QueueWorkerResult, QueueWorkerRunOptions, QueueWorkerTimeoutError, QueueWorkerUnsupportedDriverError, RegisterQueueJobOptions, RegisterableQueueJobDefinition, clearQueueConnection, configureQueueRuntime, defineQueueConfig, dispatch, dispatchSync, flushFailedQueueJobs, forgetFailedQueueJob, getQueueRuntime, getRegisteredQueueJob, listFailedQueueJobs, listRegisteredQueueJobs, loadQueuePluginDriverFactories, loadQueuePluginDrivers, persistFailedQueueJob, queueFailedInternals, queueRegistryInternals, queueRuntimeInternals, queueWorkerInternals, registerQueueJob, registerQueueJobs, resetQueuePluginDriverFactories, resetQueueRegistry, resetQueueRuntime, retryFailedQueueJobs, runQueueWorker, shutdownQueueRuntime, syncQueueDriverFactory, syncQueueDriverInternals, unregisterQueueJob, useQueueConnection };