@anchan828/nest-cloud-run-queue-tasks-publisher 3.3.7 → 3.4.1
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/cjs/interfaces.d.ts
CHANGED
|
@@ -12,5 +12,6 @@ export type TasksPublisherModuleOptionsFactory = ModuleOptionsFactory<TasksPubli
|
|
|
12
12
|
export type PublishConfig = Omit<google.cloud.tasks.v2.ITask, "name">;
|
|
13
13
|
export type PublishOptions = {
|
|
14
14
|
queue?: string;
|
|
15
|
+
deduplicationId?: string;
|
|
15
16
|
} & PublishConfig;
|
|
16
17
|
export type PublishData<T> = Message<T>;
|
|
@@ -25,9 +25,11 @@ let TasksPublisherService = class TasksPublisherService {
|
|
|
25
25
|
const taskMessage = this.options.extraConfig?.prePublish
|
|
26
26
|
? await this.options.extraConfig?.prePublish(message)
|
|
27
27
|
: message;
|
|
28
|
+
const queue = options?.queue || this.options.queue;
|
|
28
29
|
const [task] = await this.client.createTask({
|
|
29
|
-
parent:
|
|
30
|
+
parent: queue,
|
|
30
31
|
task: {
|
|
32
|
+
name: options?.deduplicationId ? `${queue}/tasks/${options.deduplicationId}` : undefined,
|
|
31
33
|
...this.options.publishConfig,
|
|
32
34
|
...options,
|
|
33
35
|
httpRequest: {
|
package/dist/esm/interfaces.d.ts
CHANGED
|
@@ -12,5 +12,6 @@ export type TasksPublisherModuleOptionsFactory = ModuleOptionsFactory<TasksPubli
|
|
|
12
12
|
export type PublishConfig = Omit<google.cloud.tasks.v2.ITask, "name">;
|
|
13
13
|
export type PublishOptions = {
|
|
14
14
|
queue?: string;
|
|
15
|
+
deduplicationId?: string;
|
|
15
16
|
} & PublishConfig;
|
|
16
17
|
export type PublishData<T> = Message<T>;
|
|
@@ -22,9 +22,11 @@ let TasksPublisherService = class TasksPublisherService {
|
|
|
22
22
|
const taskMessage = this.options.extraConfig?.prePublish
|
|
23
23
|
? await this.options.extraConfig?.prePublish(message)
|
|
24
24
|
: message;
|
|
25
|
+
const queue = options?.queue || this.options.queue;
|
|
25
26
|
const [task] = await this.client.createTask({
|
|
26
|
-
parent:
|
|
27
|
+
parent: queue,
|
|
27
28
|
task: {
|
|
29
|
+
name: options?.deduplicationId ? `${queue}/tasks/${options.deduplicationId}` : undefined,
|
|
28
30
|
...this.options.publishConfig,
|
|
29
31
|
...options,
|
|
30
32
|
httpRequest: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anchan828/nest-cloud-run-queue-tasks-publisher",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"homepage": "https://github.com/anchan828/nest-cloud-run-queue/tree/master/packages/pubsub-publish#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"watch": "tsc -w"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@anchan828/nest-cloud-run-queue-common": "^3.
|
|
36
|
+
"@anchan828/nest-cloud-run-queue-common": "^3.4.1",
|
|
37
37
|
"@google-cloud/tasks": "^5.5.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@nestjs/common": "11.0.
|
|
40
|
+
"@nestjs/common": "11.0.12",
|
|
41
41
|
"rxjs": "7.8.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"default": "./dist/cjs/index.js"
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "d56972947ed749f482641dc6713d687a449b097c"
|
|
65
65
|
}
|