@webpieces/cloudtasks-client 0.3.286 → 0.3.287

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.286",
3
+ "version": "0.3.287",
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.286",
27
- "@webpieces/core-util": "0.3.286",
28
- "@webpieces/gcp-identity": "0.3.286",
26
+ "@webpieces/core-context": "0.3.287",
27
+ "@webpieces/core-util": "0.3.287",
28
+ "@webpieces/gcp-identity": "0.3.287",
29
29
  "@google-cloud/tasks": "5.5.2",
30
30
  "inversify": "7.10.4",
31
31
  "reflect-metadata": "0.2.2"
@@ -1,4 +1,3 @@
1
- import { HeaderRegistry } from '@webpieces/core-util';
2
1
  import { TaskInvoker } from './TaskTypes';
3
2
  /** Constructor whose prototype is T (the abstract @PubSub API class). */
4
3
  type ApiPrototype<T> = Function & {
@@ -13,8 +12,7 @@ type ApiPrototype<T> = Function & {
13
12
  */
14
13
  export declare class TaskClientCreator {
15
14
  private readonly invoker;
16
- private readonly registry;
17
- constructor(invoker: TaskInvoker, registry: HeaderRegistry);
15
+ constructor(invoker: TaskInvoker);
18
16
  /** Enqueue client whose delivery URL is another Cloud Run service (by name). */
19
17
  createClientOnService<T extends object>(apiClass: ApiPrototype<T>, serviceName: string): T;
20
18
  /** Enqueue client whose delivery URL is a fixed base URL. */
@@ -17,10 +17,8 @@ const TaskClientFactory_1 = require("./TaskClientFactory");
17
17
  */
18
18
  let TaskClientCreator = class TaskClientCreator {
19
19
  invoker;
20
- registry;
21
- constructor(invoker, registry) {
20
+ constructor(invoker) {
22
21
  this.invoker = invoker;
23
- this.registry = registry;
24
22
  }
25
23
  /** Enqueue client whose delivery URL is another Cloud Run service (by name). */
26
24
  createClientOnService(apiClass, serviceName) {
@@ -33,7 +31,7 @@ let TaskClientCreator = class TaskClientCreator {
33
31
  return (0, TaskClientFactory_1.createTaskClient)(apiClass, config);
34
32
  }
35
33
  buildContextMgr() {
36
- return new core_context_1.ContextMgr(new core_context_1.RequestContextReader(), this.registry);
34
+ return new core_context_1.ContextMgr(new core_context_1.RequestContextReader());
37
35
  }
38
36
  };
39
37
  exports.TaskClientCreator = TaskClientCreator;
@@ -42,8 +40,6 @@ exports.TaskClientCreator = TaskClientCreator = tslib_1.__decorate([
42
40
  (0, core_context_1.provideFrameworkSingleton)(),
43
41
  (0, inversify_1.injectable)(),
44
42
  tslib_1.__param(0, (0, inversify_1.inject)(TaskTypes_1.TaskInvoker)),
45
- tslib_1.__param(1, (0, inversify_1.inject)(core_util_1.HeaderRegistry)),
46
- tslib_1.__metadata("design:paramtypes", [TaskTypes_1.TaskInvoker,
47
- core_util_1.HeaderRegistry])
43
+ tslib_1.__metadata("design:paramtypes", [TaskTypes_1.TaskInvoker])
48
44
  ], TaskClientCreator);
49
45
  //# sourceMappingURL=TaskClientCreator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TaskClientCreator.js","sourceRoot":"","sources":["../../../../../packages/cloud/cloudtasks-client/src/TaskClientCreator.ts"],"names":[],"mappings":";;;;AAAA,yCAA+C;AAC/C,0DAAsG;AACtG,oDAAsE;AACtE,0DAAyD;AACzD,2CAA0C;AAC1C,2DAAyE;AAKzE;;;;;;GAMG;AAII,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEgB;IACG;IAF7C,YAC0C,OAAoB,EACjB,QAAwB;QAD3B,YAAO,GAAP,OAAO,CAAa;QACjB,aAAQ,GAAR,QAAQ,CAAgB;IAClE,CAAC;IAEJ,gFAAgF;IAChF,qBAAqB,CAAmB,QAAyB,EAAE,WAAmB;QAClF,MAAM,MAAM,GAAG,IAAI,oCAAgB,CAC/B,GAAG,EAAE,CAAC,IAAA,6BAAc,EAAC,WAAW,CAAC,EACjC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,eAAe,EAAE,CACzB,CAAC;QACF,OAAO,IAAA,oCAAgB,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,6DAA6D;IAC7D,iBAAiB,CAAmB,QAAyB,EAAE,GAAW;QACtE,MAAM,MAAM,GAAG,IAAI,oCAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;QAC/E,OAAO,IAAA,oCAAgB,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAEO,eAAe;QACnB,OAAO,IAAI,yBAAU,CAAC,IAAI,mCAAoB,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrE,CAAC;CACJ,CAAA;AAzBY,8CAAiB;4BAAjB,iBAAiB;IAH7B,IAAA,0BAAc,GAAE;IAChB,IAAA,wCAAyB,GAAE;IAC3B,IAAA,sBAAU,GAAE;IAGJ,mBAAA,IAAA,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 { provideFrameworkSingleton, 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@provideFrameworkSingleton()\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"]}
1
+ {"version":3,"file":"TaskClientCreator.js","sourceRoot":"","sources":["../../../../../packages/cloud/cloudtasks-client/src/TaskClientCreator.ts"],"names":[],"mappings":";;;;AAAA,yCAA+C;AAC/C,0DAAsG;AACtG,oDAAsD;AACtD,0DAAyD;AACzD,2CAA0C;AAC1C,2DAAyE;AAKzE;;;;;;GAMG;AAII,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEgB;IAD1C,YAC0C,OAAoB;QAApB,YAAO,GAAP,OAAO,CAAa;IAC3D,CAAC;IAEJ,gFAAgF;IAChF,qBAAqB,CAAmB,QAAyB,EAAE,WAAmB;QAClF,MAAM,MAAM,GAAG,IAAI,oCAAgB,CAC/B,GAAG,EAAE,CAAC,IAAA,6BAAc,EAAC,WAAW,CAAC,EACjC,IAAI,CAAC,OAAO,EACZ,IAAI,CAAC,eAAe,EAAE,CACzB,CAAC;QACF,OAAO,IAAA,oCAAgB,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED,6DAA6D;IAC7D,iBAAiB,CAAmB,QAAyB,EAAE,GAAW;QACtE,MAAM,MAAM,GAAG,IAAI,oCAAgB,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC;QAC/E,OAAO,IAAA,oCAAgB,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAEO,eAAe;QACnB,OAAO,IAAI,yBAAU,CAAC,IAAI,mCAAoB,EAAE,CAAC,CAAC;IACtD,CAAC;CACJ,CAAA;AAxBY,8CAAiB;4BAAjB,iBAAiB;IAH7B,IAAA,0BAAc,GAAE;IAChB,IAAA,wCAAyB,GAAE;IAC3B,IAAA,sBAAU,GAAE;IAGJ,mBAAA,IAAA,kBAAM,EAAC,uBAAW,CAAC,CAAA;6CAA2B,uBAAW;GAFrD,iBAAiB,CAwB7B","sourcesContent":["import { inject, injectable } from 'inversify';\nimport { provideFrameworkSingleton, RequestContextReader, ContextMgr } from '@webpieces/core-context';\nimport { 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@provideFrameworkSingleton()\n@injectable()\nexport class TaskClientCreator {\n constructor(\n @inject(TaskInvoker) private readonly invoker: TaskInvoker,\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());\n }\n}\n"]}