@webpieces/cloudtasks-client 0.3.272 → 0.3.274
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpieces/cloudtasks-client",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.274",
|
|
4
4
|
"description": "Cloud Tasks enqueue client generated from a shared @PubSub API contract (twin of http-client)",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@webpieces/core-context": "0.3.
|
|
27
|
-
"@webpieces/core-util": "0.3.
|
|
28
|
-
"@webpieces/gcp-identity": "0.3.
|
|
26
|
+
"@webpieces/core-context": "0.3.274",
|
|
27
|
+
"@webpieces/core-util": "0.3.274",
|
|
28
|
+
"@webpieces/gcp-identity": "0.3.274",
|
|
29
29
|
"@google-cloud/tasks": "5.5.2",
|
|
30
30
|
"inversify": "7.10.4",
|
|
31
31
|
"reflect-metadata": "0.2.2"
|
package/src/TaskClientCreator.js
CHANGED
|
@@ -38,6 +38,7 @@ let TaskClientCreator = class TaskClientCreator {
|
|
|
38
38
|
};
|
|
39
39
|
exports.TaskClientCreator = TaskClientCreator;
|
|
40
40
|
exports.TaskClientCreator = TaskClientCreator = tslib_1.__decorate([
|
|
41
|
+
(0, core_util_1.DocumentDesign)(),
|
|
41
42
|
(0, core_context_1.provideSingleton)(),
|
|
42
43
|
(0, inversify_1.injectable)(),
|
|
43
44
|
tslib_1.__param(0, (0, inversify_1.inject)(TaskTypes_1.TaskInvoker)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskClientCreator.js","sourceRoot":"","sources":["../../../../../packages/cloud/cloudtasks-client/src/TaskClientCreator.ts"],"names":[],"mappings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,kBAAM,EAAC,uBAAW,CAAC,CAAA;IACnB,mBAAA,IAAA,kBAAM,EAAC,0BAAc,CAAC,CAAA;6CADwB,uBAAW;QACP,0BAAc;GAH5D,iBAAiB,CAyB7B","sourcesContent":["import { inject, injectable } from 'inversify';\nimport { provideSingleton, RequestContextReader, ContextMgr } from '@webpieces/core-context';\nimport { HeaderRegistry, DocumentDesign } from '@webpieces/core-util';\nimport { getCloudRunUrl } from '@webpieces/gcp-identity';\nimport { TaskInvoker } from './TaskTypes';\nimport { createTaskClient, TaskClientConfig } from './TaskClientFactory';\n\n/** Constructor whose prototype is T (the abstract @PubSub API class). */\ntype ApiPrototype<T> = Function & { prototype: T };\n\n/**\n * Injectable factory for Cloud Tasks enqueue clients — the twin of http-client's\n * RpcClientCreator. Resolves the bound TaskInvoker + a context-propagating ContextMgr\n * so a service just asks for a typed client:\n *\n * const emailTasks = creator.createClientOnService(EmailApi, 'email-svc'); // self/other svc\n */\n@DocumentDesign()\n@provideSingleton()\n@injectable()\nexport class TaskClientCreator {\n constructor(\n @inject(TaskInvoker) private readonly invoker: TaskInvoker,\n @inject(HeaderRegistry) private readonly registry: HeaderRegistry,\n ) {}\n\n /** Enqueue client whose delivery URL is another Cloud Run service (by name). */\n createClientOnService<T extends object>(apiClass: ApiPrototype<T>, serviceName: string): T {\n const config = new TaskClientConfig(\n () => getCloudRunUrl(serviceName),\n this.invoker,\n this.buildContextMgr(),\n );\n return createTaskClient(apiClass, config);\n }\n\n /** Enqueue client whose delivery URL is a fixed base URL. */\n createClientOnUrl<T extends object>(apiClass: ApiPrototype<T>, url: string): T {\n const config = new TaskClientConfig(url, this.invoker, this.buildContextMgr());\n return createTaskClient(apiClass, config);\n }\n\n private buildContextMgr(): ContextMgr {\n return new ContextMgr(new RequestContextReader(), this.registry);\n }\n}\n"]}
|