@nest-boot/bullmq 7.0.1 → 7.0.3
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/bullmq-module-options.interface.d.ts +2 -0
- package/dist/bullmq.module-definition.d.ts +1 -1
- package/dist/bullmq.module-definition.js +2 -2
- package/dist/bullmq.module-definition.js.map +1 -1
- package/dist/bullmq.module.d.ts +30 -1
- package/dist/bullmq.module.js +34 -1
- package/dist/bullmq.module.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/processor.decorator.d.ts +26 -0
- package/dist/processor.decorator.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +22 -13
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ConnectionOptions, type QueueOptions } from "bullmq";
|
|
2
|
+
/** Configuration options for the BullMQ module. */
|
|
2
3
|
export interface BullModuleOptions extends Omit<QueueOptions, "connection"> {
|
|
4
|
+
/** Redis connection options for BullMQ queues and workers. */
|
|
3
5
|
connection?: ConnectionOptions;
|
|
4
6
|
}
|
|
@@ -2,4 +2,4 @@ import { BullModuleOptions } from "./bullmq-module-options.interface";
|
|
|
2
2
|
export declare const SCHEDULE_QUEUE_NAME = "schedule";
|
|
3
3
|
export declare const SCHEDULE_METADATA_KEY: `${string}-${string}-${string}-${string}-${string}`;
|
|
4
4
|
export declare const MODULE_OPTIONS_TOKEN: unique symbol;
|
|
5
|
-
export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<BullModuleOptions, "forRoot", "create", {}>, BASE_MODULE_OPTIONS_TOKEN: string | symbol
|
|
5
|
+
export declare const ConfigurableModuleClass: import("@nestjs/common").ConfigurableModuleCls<BullModuleOptions, "forRoot", "create", {}>, BASE_MODULE_OPTIONS_TOKEN: string | symbol, OPTIONS_TYPE: BullModuleOptions & Partial<{}>, ASYNC_OPTIONS_TYPE: import("@nestjs/common").ConfigurableModuleAsyncOptions<BullModuleOptions, "create"> & Partial<{}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.BASE_MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = exports.MODULE_OPTIONS_TOKEN = exports.SCHEDULE_METADATA_KEY = exports.SCHEDULE_QUEUE_NAME = void 0;
|
|
4
|
+
exports.ASYNC_OPTIONS_TYPE = exports.OPTIONS_TYPE = exports.BASE_MODULE_OPTIONS_TOKEN = exports.ConfigurableModuleClass = exports.MODULE_OPTIONS_TOKEN = exports.SCHEDULE_METADATA_KEY = exports.SCHEDULE_QUEUE_NAME = void 0;
|
|
5
5
|
const common_1 = require("@nestjs/common");
|
|
6
6
|
const crypto_1 = require("crypto");
|
|
7
7
|
exports.SCHEDULE_QUEUE_NAME = "schedule";
|
|
@@ -9,5 +9,5 @@ exports.SCHEDULE_METADATA_KEY = (0, crypto_1.randomUUID)();
|
|
|
9
9
|
exports.MODULE_OPTIONS_TOKEN = Symbol("BullModuleOptions");
|
|
10
10
|
_a = new common_1.ConfigurableModuleBuilder()
|
|
11
11
|
.setClassMethodName("forRoot")
|
|
12
|
-
.build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.BASE_MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN;
|
|
12
|
+
.build(), exports.ConfigurableModuleClass = _a.ConfigurableModuleClass, exports.BASE_MODULE_OPTIONS_TOKEN = _a.MODULE_OPTIONS_TOKEN, exports.OPTIONS_TYPE = _a.OPTIONS_TYPE, exports.ASYNC_OPTIONS_TYPE = _a.ASYNC_OPTIONS_TYPE;
|
|
13
13
|
//# sourceMappingURL=bullmq.module-definition.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bullmq.module-definition.js","sourceRoot":"","sources":["../src/bullmq.module-definition.ts"],"names":[],"mappings":";;;;AAAA,2CAA2D;AAC3D,mCAAoC;AAIvB,QAAA,mBAAmB,GAAG,UAAU,CAAC;AAEjC,QAAA,qBAAqB,GAAG,IAAA,mBAAU,GAAE,CAAC;AAErC,QAAA,oBAAoB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEnD,
|
|
1
|
+
{"version":3,"file":"bullmq.module-definition.js","sourceRoot":"","sources":["../src/bullmq.module-definition.ts"],"names":[],"mappings":";;;;AAAA,2CAA2D;AAC3D,mCAAoC;AAIvB,QAAA,mBAAmB,GAAG,UAAU,CAAC;AAEjC,QAAA,qBAAqB,GAAG,IAAA,mBAAU,GAAE,CAAC;AAErC,QAAA,oBAAoB,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAEnD,KAKT,IAAI,kCAAyB,EAAqB;KACnD,kBAAkB,CAAC,SAAS,CAAC;KAC7B,KAAK,EAAE,EANR,+BAAuB,+BACD,iCAAyB,4BAC/C,oBAAY,oBACZ,0BAAkB,yBAGT"}
|
package/dist/bullmq.module.d.ts
CHANGED
|
@@ -1,7 +1,36 @@
|
|
|
1
1
|
import { BullModule as BaseBullModule } from "@nestjs/bullmq";
|
|
2
2
|
import { type DynamicModule } from "@nestjs/common";
|
|
3
|
-
import { ConfigurableModuleClass } from "./bullmq.module-definition";
|
|
3
|
+
import { ASYNC_OPTIONS_TYPE, ConfigurableModuleClass, OPTIONS_TYPE } from "./bullmq.module-definition";
|
|
4
|
+
/**
|
|
5
|
+
* BullMQ integration module for job queue processing.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Wraps `@nestjs/bullmq` with automatic Redis connection configuration
|
|
9
|
+
* from environment variables. Supports registering queues and flow producers.
|
|
10
|
+
*/
|
|
4
11
|
export declare class BullModule extends ConfigurableModuleClass {
|
|
12
|
+
/**
|
|
13
|
+
* Registers the BullModule with the given options.
|
|
14
|
+
* @param options - Configuration options including Redis connection
|
|
15
|
+
* @returns Dynamic module configuration
|
|
16
|
+
*/
|
|
17
|
+
static forRoot(options: typeof OPTIONS_TYPE): DynamicModule;
|
|
18
|
+
/**
|
|
19
|
+
* Registers the BullModule asynchronously with factory functions.
|
|
20
|
+
* @param options - Async configuration options
|
|
21
|
+
* @returns Dynamic module configuration
|
|
22
|
+
*/
|
|
23
|
+
static forRootAsync(options: typeof ASYNC_OPTIONS_TYPE): DynamicModule;
|
|
24
|
+
/**
|
|
25
|
+
* Registers a BullMQ queue.
|
|
26
|
+
* @param args - registerQueue arguments
|
|
27
|
+
* @returns Dynamic module configuration
|
|
28
|
+
*/
|
|
5
29
|
static registerQueue(...args: Parameters<typeof BaseBullModule.registerQueue>): DynamicModule;
|
|
30
|
+
/**
|
|
31
|
+
* Registers a BullMQ queue asynchronously.
|
|
32
|
+
* @param args - registerQueueAsync arguments
|
|
33
|
+
* @returns Dynamic module configuration
|
|
34
|
+
*/
|
|
6
35
|
static registerQueueAsync(...args: Parameters<typeof BaseBullModule.registerQueueAsync>): DynamicModule;
|
|
7
36
|
}
|
package/dist/bullmq.module.js
CHANGED
|
@@ -11,10 +11,43 @@ const bullmq_1 = require("@nestjs/bullmq");
|
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
12
|
const bullmq_module_definition_1 = require("./bullmq.module-definition");
|
|
13
13
|
const load_config_from_env_util_1 = require("./utils/load-config-from-env.util");
|
|
14
|
+
/**
|
|
15
|
+
* BullMQ integration module for job queue processing.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Wraps `@nestjs/bullmq` with automatic Redis connection configuration
|
|
19
|
+
* from environment variables. Supports registering queues and flow producers.
|
|
20
|
+
*/
|
|
14
21
|
let BullModule = class BullModule extends bullmq_module_definition_1.ConfigurableModuleClass {
|
|
22
|
+
/**
|
|
23
|
+
* Registers the BullModule with the given options.
|
|
24
|
+
* @param options - Configuration options including Redis connection
|
|
25
|
+
* @returns Dynamic module configuration
|
|
26
|
+
*/
|
|
27
|
+
static forRoot(options) {
|
|
28
|
+
return super.forRoot(options);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Registers the BullModule asynchronously with factory functions.
|
|
32
|
+
* @param options - Async configuration options
|
|
33
|
+
* @returns Dynamic module configuration
|
|
34
|
+
*/
|
|
35
|
+
static forRootAsync(options) {
|
|
36
|
+
return super.forRootAsync(options);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Registers a BullMQ queue.
|
|
40
|
+
* @param args - registerQueue arguments
|
|
41
|
+
* @returns Dynamic module configuration
|
|
42
|
+
*/
|
|
15
43
|
static registerQueue(...args) {
|
|
16
44
|
return bullmq_1.BullModule.registerQueue(...args);
|
|
17
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Registers a BullMQ queue asynchronously.
|
|
48
|
+
* @param args - registerQueueAsync arguments
|
|
49
|
+
* @returns Dynamic module configuration
|
|
50
|
+
*/
|
|
18
51
|
static registerQueueAsync(...args) {
|
|
19
52
|
return bullmq_1.BullModule.registerQueueAsync(...args);
|
|
20
53
|
}
|
|
@@ -38,7 +71,7 @@ exports.BullModule = BullModule = __decorate([
|
|
|
38
71
|
{
|
|
39
72
|
provide: bullmq_module_definition_1.MODULE_OPTIONS_TOKEN,
|
|
40
73
|
inject: [{ token: bullmq_module_definition_1.BASE_MODULE_OPTIONS_TOKEN, optional: true }],
|
|
41
|
-
useFactory: (options
|
|
74
|
+
useFactory: (options) => options ?? {},
|
|
42
75
|
},
|
|
43
76
|
],
|
|
44
77
|
exports: [bullmq_module_definition_1.MODULE_OPTIONS_TOKEN],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bullmq.module.js","sourceRoot":"","sources":["../src/bullmq.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA8D;AAC9D,2CAAoE;AAEpE,
|
|
1
|
+
{"version":3,"file":"bullmq.module.js","sourceRoot":"","sources":["../src/bullmq.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA8D;AAC9D,2CAAoE;A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;GACW,UAAU,CA0CtB"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -23,5 +23,4 @@ Object.defineProperty(exports, "Processor", { enumerable: true, get: function ()
|
|
|
23
23
|
__exportStar(require("@nestjs/bullmq"), exports);
|
|
24
24
|
var bullmq_1 = require("@nestjs/bullmq");
|
|
25
25
|
Object.defineProperty(exports, "QueueEventsListener", { enumerable: true, get: function () { return bullmq_1.QueueEventsListener; } });
|
|
26
|
-
__exportStar(require("bullmq"), exports);
|
|
27
26
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAA6C;AAApC,2GAAA,UAAU,OAAA;AACnB,oEAAkD;AAClD,6DAAkD;AAAzC,gHAAA,SAAS,OAAA;AAClB,iDAA+B;AAC/B,yCAAqD;AAA5C,6GAAA,mBAAmB,OAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iDAA6C;AAApC,2GAAA,UAAU,OAAA;AACnB,oEAAkD;AAClD,6DAAkD;AAAzC,gHAAA,SAAS,OAAA;AAClB,iDAA+B;AAC/B,yCAAqD;AAA5C,6GAAA,mBAAmB,OAAA"}
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { ProcessorOptions } from "@nestjs/bullmq";
|
|
2
2
|
import { NestWorkerOptions } from "@nestjs/bullmq/dist/interfaces/worker-options.interface";
|
|
3
|
+
/**
|
|
4
|
+
* Decorator that marks a class as a BullMQ queue processor.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Wraps the `@nestjs/bullmq` `Processor` decorator to automatically
|
|
8
|
+
* create a {@link RequestContext} for each processed job.
|
|
9
|
+
*
|
|
10
|
+
* @param queueName - The name of the queue to process
|
|
11
|
+
*/
|
|
3
12
|
export declare function Processor(queueName: string): ClassDecorator;
|
|
13
|
+
/**
|
|
14
|
+
* Decorator that marks a class as a BullMQ queue processor with worker options.
|
|
15
|
+
*
|
|
16
|
+
* @param queueName - The name of the queue to process
|
|
17
|
+
* @param workerOptions - Worker configuration options
|
|
18
|
+
*/
|
|
4
19
|
export declare function Processor(queueName: string, workerOptions: NestWorkerOptions): ClassDecorator;
|
|
20
|
+
/**
|
|
21
|
+
* Decorator that marks a class as a BullMQ queue processor with processor options.
|
|
22
|
+
*
|
|
23
|
+
* @param processorOptions - Processor configuration options
|
|
24
|
+
*/
|
|
5
25
|
export declare function Processor(processorOptions: ProcessorOptions): ClassDecorator;
|
|
26
|
+
/**
|
|
27
|
+
* Decorator that marks a class as a BullMQ queue processor with processor and worker options.
|
|
28
|
+
*
|
|
29
|
+
* @param processorOptions - Processor configuration options
|
|
30
|
+
* @param workerOptions - Worker configuration options
|
|
31
|
+
*/
|
|
6
32
|
export declare function Processor(processorOptions: ProcessorOptions, workerOptions: NestWorkerOptions): ClassDecorator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processor.decorator.js","sourceRoot":"","sources":["../src/processor.decorator.ts"],"names":[],"mappings":";AAAA,0DAA0D;;
|
|
1
|
+
{"version":3,"file":"processor.decorator.js","sourceRoot":"","sources":["../src/processor.decorator.ts"],"names":[],"mappings":";AAAA,0DAA0D;;AAqD1D,8BAuBC;AA1ED,gEAA4D;AAC5D,2CAKwB;AA6CxB,SAAgB,SAAS,CACvB,kBAA8C,EAC9C,kBAAsC;IAEtC,OAAO,CAAC,MAA2B,EAAE,EAAE;QACrC,MAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC;QACjD,IAAI,eAAe,EAAE,CAAC;YACpB,MAAM,CAAC,SAAS,CAAC,OAAO,GAAG,KAAK,WAAW,GAAQ;gBACjD,MAAM,GAAG,GAAG,IAAI,gCAAc,CAAC;oBAC7B,EAAE,EAAE,GAAG,CAAC,EAAE;oBACV,IAAI,EAAE,OAAO;iBACd,CAAC,CAAC;gBAEH,GAAG,CAAC,GAAG,CAAC,gBAAO,EAAE,GAAG,CAAC,CAAC;gBAEtB,OAAO,MAAM,gCAAc,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,CACxC,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAChC,CAAC;YACJ,CAAC,CAAC;QACJ,CAAC;QAED,IAAA,kBAAa,EAAC,kBAAyB,EAAE,kBAAyB,CAAC,CAAC,MAAM,CAAC,CAAC;IAC9E,CAAC,CAAC;AACJ,CAAC"}
|