@anchan828/nest-cloud-run-queue-worker 1.0.9 → 1.0.10
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/index.d.ts +1 -1
- package/dist/interfaces.d.ts +5 -4
- package/dist/worker.module.js +12 -4
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ALL_WORKERS_QUEUE_WORKER_NAME as ALL_QUEUE_WORKERS, UNHANDLED_QUEUE_WORKER_NAME as UNHANDLED_QUEUE_WORKER, } from "./constants";
|
|
2
2
|
export { QueueWorker, QueueWorkerProcess } from "./decorators";
|
|
3
|
-
export { QueueWorkerModuleAsyncOptions, QueueWorkerModuleOptions, QueueWorkerModuleOptionsFactory, QueueWorkerProcessor, QueueWorkerProcessorStatus, QueueWorkerExtraConfig, QueueWorkerRawMessage, QueueWorkerControllerInterface, QueueWorkerControllerMetadata, } from "./interfaces";
|
|
3
|
+
export { QueueWorkerModuleAsyncOptions, QueueWorkerModuleOptions, QueueWorkerModuleOptionsFactory, QueueWorkerProcessor, QueueWorkerProcessorStatus, QueueWorkerExtraConfig, QueueWorkerRawMessage, QueueWorkerControllerInterface, QueueWorkerControllerMetadata, QueueWorkerReceivedMessage, } from "./interfaces";
|
|
4
4
|
export { QueueWorkerModule } from "./worker.module";
|
|
5
5
|
export { QueueWorkerService } from "./worker.service";
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -27,10 +27,11 @@ export interface QueueWorkerModuleOptions extends ModuleOptions {
|
|
|
27
27
|
/**
|
|
28
28
|
* Define a Route for the controller.
|
|
29
29
|
* Default: POST /
|
|
30
|
-
*
|
|
30
|
+
* If you provide your own Controller, set it to null.
|
|
31
|
+
* @type {(QueueWorkerControllerMetadata | null)}
|
|
31
32
|
* @memberof QueueWorkerModuleOptions
|
|
32
33
|
*/
|
|
33
|
-
workerController?: QueueWorkerControllerMetadata;
|
|
34
|
+
workerController?: QueueWorkerControllerMetadata | null;
|
|
34
35
|
}
|
|
35
36
|
export declare type QueueWorkerModuleAsyncOptions = ModuleAsyncOptions<Omit<QueueWorkerModuleOptions, "workerController">> & Pick<QueueWorkerModuleOptions, "workerController">;
|
|
36
37
|
export declare type QueueWorkerModuleOptionsFactory = ModuleOptionsFactory<Omit<QueueWorkerModuleOptions, "workerController">> & Pick<QueueWorkerModuleOptions, "workerController">;
|
|
@@ -75,7 +76,7 @@ export declare type QueueWorkerRawMessage<T = Record<string, any>> = {
|
|
|
75
76
|
readonly data?: string | Uint8Array | Buffer | null;
|
|
76
77
|
readonly headers?: Record<string, string>;
|
|
77
78
|
} & T;
|
|
78
|
-
export declare type
|
|
79
|
+
export declare type QueueWorkerReceivedMessage = {
|
|
79
80
|
readonly message: QueueWorkerRawMessage;
|
|
80
81
|
};
|
|
81
82
|
export interface QueueWorkerControllerMetadata extends RequestMappingMetadata {
|
|
@@ -88,5 +89,5 @@ export interface QueueWorkerControllerMetadata extends RequestMappingMetadata {
|
|
|
88
89
|
statusCode?: number;
|
|
89
90
|
}
|
|
90
91
|
export interface QueueWorkerControllerInterface {
|
|
91
|
-
execute(body:
|
|
92
|
+
execute(body: QueueWorkerReceivedMessage, headers: Record<string, string>): Promise<void>;
|
|
92
93
|
}
|
package/dist/worker.module.js
CHANGED
|
@@ -18,20 +18,28 @@ const worker_controller_1 = require("./worker.controller");
|
|
|
18
18
|
const worker_service_1 = require("./worker.service");
|
|
19
19
|
let QueueWorkerModule = QueueWorkerModule_1 = class QueueWorkerModule {
|
|
20
20
|
static register(options = {}) {
|
|
21
|
-
const
|
|
21
|
+
const controllers = [];
|
|
22
22
|
const providers = [(0, nest_cloud_run_queue_common_1.createOptionProvider)(constants_1.QUEUE_WORKER_MODULE_OPTIONS, options)];
|
|
23
|
+
if (options.workerController !== null) {
|
|
24
|
+
const WorkerController = (0, worker_controller_1.getWorkerController)(options.workerController);
|
|
25
|
+
controllers.push(WorkerController);
|
|
26
|
+
}
|
|
23
27
|
return {
|
|
24
|
-
controllers
|
|
28
|
+
controllers,
|
|
25
29
|
global: true,
|
|
26
30
|
module: QueueWorkerModule_1,
|
|
27
31
|
providers,
|
|
28
32
|
};
|
|
29
33
|
}
|
|
30
34
|
static registerAsync(options) {
|
|
31
|
-
const
|
|
35
|
+
const controllers = [];
|
|
32
36
|
const providers = [...(0, nest_cloud_run_queue_common_1.createAsyncProviders)(constants_1.QUEUE_WORKER_MODULE_OPTIONS, options)];
|
|
37
|
+
if (options.workerController !== null) {
|
|
38
|
+
const WorkerController = (0, worker_controller_1.getWorkerController)(options.workerController);
|
|
39
|
+
controllers.push(WorkerController);
|
|
40
|
+
}
|
|
33
41
|
return {
|
|
34
|
-
controllers
|
|
42
|
+
controllers,
|
|
35
43
|
global: true,
|
|
36
44
|
imports: [...(options.imports || [])],
|
|
37
45
|
module: QueueWorkerModule_1,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anchan828/nest-cloud-run-queue-worker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "https://github.com/anchan828/nest-cloud-run-queue/tree/master/packages/worker#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"watch": "tsc -w"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@anchan828/nest-cloud-run-queue-common": "^1.0.
|
|
36
|
+
"@anchan828/nest-cloud-run-queue-common": "^1.0.10",
|
|
37
37
|
"class-validator": "0.13.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "6d7b6c1abb9408cffa16aea7c4eb07f4f381a4fa"
|
|
50
50
|
}
|