@versori/run 0.2.0 → 0.2.1-alpha.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.
Files changed (51) hide show
  1. package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +21 -0
  2. package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
  3. package/esm/src/context/Context.d.ts +13 -24
  4. package/esm/src/context/Context.d.ts.map +1 -1
  5. package/esm/src/context/Context.js +19 -15
  6. package/esm/src/context/ContextProvider.d.ts +3 -3
  7. package/esm/src/context/ContextProvider.d.ts.map +1 -1
  8. package/esm/src/dsl/http/default.js +1 -1
  9. package/esm/src/dsl/http/versori/contextcredentials.d.ts +2 -2
  10. package/esm/src/dsl/http/versori/contextcredentials.d.ts.map +1 -1
  11. package/esm/src/dsl/http/versori/credentials/credentials.d.ts +4 -3
  12. package/esm/src/dsl/http/versori/credentials/credentials.d.ts.map +1 -1
  13. package/esm/src/dsl/http/versori/credentials/credentials.js +0 -1
  14. package/esm/src/dsl/http/versori/roundtripper.d.ts +7 -7
  15. package/esm/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
  16. package/esm/src/dsl/http/versori/roundtripper.js +59 -66
  17. package/esm/src/dsl/tasks/HttpTask.d.ts +13 -4
  18. package/esm/src/dsl/tasks/HttpTask.d.ts.map +1 -1
  19. package/esm/src/dsl/tasks/HttpTask.js +42 -21
  20. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  21. package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  22. package/esm/src/interpreter/memory/compilers/schedule.js +1 -1
  23. package/esm/src/interpreter/memory/compilers/webhook.js +1 -1
  24. package/esm/src/kv/nats/NatsKeyValueProvider.d.ts +1 -0
  25. package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
  26. package/package.json +2 -2
  27. package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +21 -0
  28. package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
  29. package/script/src/context/Context.d.ts +13 -24
  30. package/script/src/context/Context.d.ts.map +1 -1
  31. package/script/src/context/Context.js +19 -15
  32. package/script/src/context/ContextProvider.d.ts +3 -3
  33. package/script/src/context/ContextProvider.d.ts.map +1 -1
  34. package/script/src/dsl/http/default.js +1 -1
  35. package/script/src/dsl/http/versori/contextcredentials.d.ts +2 -2
  36. package/script/src/dsl/http/versori/contextcredentials.d.ts.map +1 -1
  37. package/script/src/dsl/http/versori/credentials/credentials.d.ts +4 -3
  38. package/script/src/dsl/http/versori/credentials/credentials.d.ts.map +1 -1
  39. package/script/src/dsl/http/versori/credentials/credentials.js +0 -1
  40. package/script/src/dsl/http/versori/roundtripper.d.ts +7 -7
  41. package/script/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
  42. package/script/src/dsl/http/versori/roundtripper.js +63 -70
  43. package/script/src/dsl/tasks/HttpTask.d.ts +13 -4
  44. package/script/src/dsl/tasks/HttpTask.d.ts.map +1 -1
  45. package/script/src/dsl/tasks/HttpTask.js +42 -21
  46. package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  47. package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  48. package/script/src/interpreter/memory/compilers/schedule.js +1 -1
  49. package/script/src/interpreter/memory/compilers/webhook.js +1 -1
  50. package/script/src/kv/nats/NatsKeyValueProvider.d.ts +1 -0
  51. package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
@@ -1,5 +1,15 @@
1
- var _a;
2
- import { ContextImpl } from '../../context/Context.js';
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _a, _HttpContextImpl_dynamicFetcher, _HttpContextImpl_staticFetcher, _HttpContextImpl_inner;
3
13
  import { ensureTask } from '../ensureTask.js';
4
14
  import { wrapDynamicFetcher } from '../http/types.js';
5
15
  import { TaskType } from '../Task.js';
@@ -57,11 +67,8 @@ export class HttpTaskImpl {
57
67
  }
58
68
  }
59
69
  _a = TaskType;
60
- export class HttpContextImpl extends ContextImpl {
70
+ export class HttpContextImpl {
61
71
  constructor(ctx, connectionVars, staticFetcher, dynamicFetcher, pageParams) {
62
- // We need to cast ctx to InternalContext to access kvp
63
- const internalCtx = ctx;
64
- super(ctx.log, internalCtx.kvp, ctx.creds, ctx.executionId, ctx.startTime, ctx.data, ctx.options);
65
72
  Object.defineProperty(this, "connectionVariables", {
66
73
  enumerable: true,
67
74
  configurable: true,
@@ -75,31 +82,45 @@ export class HttpContextImpl extends ContextImpl {
75
82
  value: void 0
76
83
  });
77
84
  // ideally only one of these should be set to a value
78
- Object.defineProperty(this, "dynamicFetcher", {
79
- enumerable: true,
80
- configurable: true,
81
- writable: true,
82
- value: void 0
83
- });
84
- Object.defineProperty(this, "staticFetcher", {
85
- enumerable: true,
86
- configurable: true,
87
- writable: true,
88
- value: void 0
89
- });
85
+ _HttpContextImpl_dynamicFetcher.set(this, void 0);
86
+ _HttpContextImpl_staticFetcher.set(this, void 0);
87
+ _HttpContextImpl_inner.set(this, void 0);
88
+ __classPrivateFieldSet(this, _HttpContextImpl_inner, ctx, "f");
90
89
  this.pageParams = pageParams;
91
90
  this.connectionVariables = connectionVars;
92
- this.dynamicFetcher = dynamicFetcher;
93
- this.staticFetcher = staticFetcher;
91
+ __classPrivateFieldSet(this, _HttpContextImpl_dynamicFetcher, dynamicFetcher, "f");
92
+ __classPrivateFieldSet(this, _HttpContextImpl_staticFetcher, staticFetcher, "f");
93
+ }
94
+ get log() {
95
+ return __classPrivateFieldGet(this, _HttpContextImpl_inner, "f").log;
96
+ }
97
+ get executionId() {
98
+ return __classPrivateFieldGet(this, _HttpContextImpl_inner, "f").executionId;
99
+ }
100
+ get startTime() {
101
+ return __classPrivateFieldGet(this, _HttpContextImpl_inner, "f").startTime;
102
+ }
103
+ get activation() {
104
+ return __classPrivateFieldGet(this, _HttpContextImpl_inner, "f").activation;
105
+ }
106
+ get data() {
107
+ return __classPrivateFieldGet(this, _HttpContextImpl_inner, "f").data;
108
+ }
109
+ openKv(scope) {
110
+ return __classPrivateFieldGet(this, _HttpContextImpl_inner, "f").openKv(scope);
111
+ }
112
+ credentials() {
113
+ return __classPrivateFieldGet(this, _HttpContextImpl_inner, "f").credentials();
94
114
  }
95
115
  get fetch() {
96
116
  // This is maybe hard to read.
97
- return this.dynamicFetcher && this.activation ? wrapDynamicFetcher(this.dynamicFetcher, this.activation) : this.staticFetcher ?? globalThis.fetch;
117
+ return __classPrivateFieldGet(this, _HttpContextImpl_dynamicFetcher, "f") && __classPrivateFieldGet(this, _HttpContextImpl_inner, "f").activation ? wrapDynamicFetcher(__classPrivateFieldGet(this, _HttpContextImpl_dynamicFetcher, "f"), __classPrivateFieldGet(this, _HttpContextImpl_inner, "f").activation) : __classPrivateFieldGet(this, _HttpContextImpl_staticFetcher, "f") ?? globalThis.fetch;
98
118
  }
99
119
  async nextPage(nextParams) {
100
120
  throw new Error("Method not implemented.");
101
121
  }
102
122
  }
123
+ _HttpContextImpl_dynamicFetcher = new WeakMap(), _HttpContextImpl_staticFetcher = new WeakMap(), _HttpContextImpl_inner = new WeakMap();
103
124
  export function http(taskId, opts, fn) {
104
125
  return new HttpTaskImpl(taskId, opts, fn);
105
126
  }
@@ -1 +1 @@
1
- {"version":3,"file":"MemoryInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/memory/MemoryInterpreter.ts"],"names":[],"mappings":"AACA,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAA+B,UAAU,EAAW,YAAY,EAAE,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,eAAe,EAAuB,MAAM,kCAAkC,CAAC;AAExF,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAGhG,OAAO,EAAE,QAAQ,EAAgB,MAAM,uBAAuB,CAAC;AAI/D,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAmB,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAKpE,MAAM,MAAM,wBAAwB,GAAG;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACpC,CAAC;AAEF,KAAK,YAAY,GAAG;IAChB,QAAQ,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;IAC7C,KAAK,EAAE,uBAAuB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC9C,oBAAoB,EAAE,eAAe,CAAC;IACtC,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B,CAAA;AAED,qBAAa,iBAAiB;IAOtB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO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AM,EACX,QAAQ,EAAE,kBAAkB,EAC5B,eAAe,EAAE,eAAe,EAChC,mBAAmB,EAAE,mBAAmB,EACxC,MAAM,EAAE,MAAM,EACvB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACxB,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY;WASlC,WAAW,CAAC,OAAO,GAAE,wBAA6B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAwC5F,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,wBAAwB;IA8C/D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAoJtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAK9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/schedule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAuF7C,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,YAAY,EAAE,eAAe,CAG3E,CAAC"}
1
+ {"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/schedule.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAsF7C,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,YAAY,EAAE,eAAe,CAG3E,CAAC"}
@@ -47,7 +47,7 @@ function compileSchedule(ctx, trigger, signal) {
47
47
  res.status(200).json({ status: 'triggered' });
48
48
  }
49
49
  catch (error) {
50
- executionCtx.log.error('execution error inside schedule', { error });
50
+ ctx.log.error('execution error inside schedule', { error });
51
51
  res.status(500).json({ error: 'Failed to trigger schedule' });
52
52
  }
53
53
  });
@@ -1,7 +1,7 @@
1
1
  // In src/interpreter/memory/compilers/webhook.ts
2
2
  import cors from 'cors';
3
- import { Observable } from 'rxjs';
4
3
  import { pipeline } from 'node:stream/promises';
4
+ import { Observable } from 'rxjs';
5
5
  import { WebhookTrigger } from '../../../dsl/triggers/WebhookTrigger.js';
6
6
  const DEFAULT_SYNC_ON_SUCCESS = (ctx) => new Response(JSON.stringify(ctx.data), {
7
7
  status: 200,
@@ -19,6 +19,7 @@ export declare class NatsKeyValueProvider implements KeyValueProvider, AsyncDisp
19
19
  private constructor();
20
20
  static newInstance(opts?: Partial<NatsKeyValueProviderOptions>): Promise<NatsKeyValueProvider>;
21
21
  static fromEnv(): Promise<NatsKeyValueProvider>;
22
+ [Symbol.asyncDispose](): PromiseLike<void>;
22
23
  kv(options: KVOptions): KeyValue;
23
24
  destroy(options: DestroyOptions): Promise<void>;
24
25
  private subjectPrefix;
@@ -1 +1 @@
1
- {"version":3,"file":"NatsKeyValueProvider.d.ts","sourceRoot":"","sources":["../../../../src/src/kv/nats/NatsKeyValueProvider.ts"],"names":[],"mappings":"AAEA,OAAO,EAA+B,UAAU,EAAE,MAAM,+DAA+D,CAAC;AACxH,OAAO,EACH,cAAc,EAEd,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACZ,MAAM,gBAAgB,CAAC;AA4CxB,MAAM,MAAM,2BAA2B,GAAG;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE;QACF,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,GAAG,CAAC,EAAE,UAAU,CAAC;KACpB,CAAC;CACL,CAAC;AAuBF,qBAAa,oBAAqB,YAAW,gBAAgB,EAAE,eAAe;IAEtE,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,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,CACpB,IAAI,GAAE,OAAO,CAAC,2BAA2B,CAAM,GAChD,OAAO,CAAC,oBAAoB,CAAC;IA0BhC,MAAM,CAAC,OAAO,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAI/C,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC;IAI1C,EAAE,CAAC,OAAO,EAAE,SAAS,GAAG,QAAQ;IAqB1B,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAuBrD,OAAO,CAAC,aAAa;CAYxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versori/run",
3
- "version": "v0.2.0",
3
+ "version": "v0.2.1-alpha.1",
4
4
  "description": "Versori Run",
5
5
  "homepage": "https://github.com/versori/versori-run#readme",
6
6
  "repository": {
@@ -26,8 +26,8 @@
26
26
  "@bufbuild/protobuf": "^2.2.3",
27
27
  "@connectrpc/connect": "^2.0.1",
28
28
  "@connectrpc/connect-node": "^2.0.1",
29
+ "@types/express": "*",
29
30
  "cors": "^2.8.5",
30
- "cron": "3.5.0",
31
31
  "express": "^4.18.3",
32
32
  "express-xml-bodyparser": "^0.3.0",
33
33
  "rxjs": "^7.8.1",
@@ -301,5 +301,26 @@ export declare abstract class BaseHandler {
301
301
  * ```
302
302
  */
303
303
  destroy(): void;
304
+ /**
305
+ * Automatically disposes of the handler when instantiated with the `using`
306
+ * keyword by calling the {@linkcode BaseHandler.destroy} method.
307
+ *
308
+ * @example Usage
309
+ * ```ts
310
+ * import { BaseHandler } from "@std/log/base-handler";
311
+ * import { LogRecord } from "@std/log/logger";
312
+ * import { assertInstanceOf } from "@std/assert/instance-of";
313
+ *
314
+ * class MyHandler extends BaseHandler {
315
+ * log(msg: string) {
316
+ * console.log(msg);
317
+ * }
318
+ * }
319
+ *
320
+ * using handler = new MyHandler("INFO");
321
+ * assertInstanceOf(handler, BaseHandler);
322
+ * ```
323
+ */
324
+ [Symbol.dispose](): void;
304
325
  }
305
326
  //# sourceMappingURL=base_handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base_handler.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/log/0.224.14/base_handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,SAAS,KAAK,MAAM,CAAC;AAIjE,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,SAAS,CAAC,EAAE,iBAAiB,CAAC;CAC/B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8BAAsB,WAAW;;IAG/B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,SAAS,EAAE,iBAAiB,CAAC;IAE7B;;;;;OAKG;gBAED,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,kBAAkB;IAQ9B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,IAAI,KAAK,IAAI,QAAQ,CAEpB;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,IAAI,KAAK,CAAC,KAAK,EAAE,QAAQ,EAGxB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,SAAS,IAAI,SAAS,CAEzB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,IAAI,SAAS,CAAC,SAAS,EAAE,SAAS,EAGjC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CAAC,SAAS,EAAE,SAAS;IAO3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CAAC,SAAS,EAAE,SA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,EAGjC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CAAC,SAAS,EAAE,SAAS;IAO3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,MAAM,CAAC,SAAS,EAAE,SAAS,GAAG,MAAM;IAIpC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,KAAK;IAEL;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,OAAO;IAEP;;;;;;;;;;;;;;;;;;;OAmBG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC;CAGjB"}
@@ -10,11 +10,11 @@ export type ContextOptions = {
10
10
  onError?: OnErrorFn;
11
11
  };
12
12
  export interface Context<D> {
13
- log: Logger;
14
- executionId: string;
15
- startTime: Date;
13
+ readonly log: Logger;
14
+ readonly executionId: string;
15
+ readonly startTime: Date;
16
+ readonly data: D;
16
17
  activation?: Activation;
17
- data: D;
18
18
  /**
19
19
  * Opens a key value store for the given scope, defaulting to ':project:' if not provided.
20
20
  * @param scope
@@ -22,34 +22,23 @@ export interface Context<D> {
22
22
  openKv(scope?: KeyValueScope): KeyValue;
23
23
  credentials(): Credentials;
24
24
  }
25
- export interface InternalContext<D, Index = void> extends Context<D> {
26
- withData<D2>(data: D2): InternalContext<D2, Index>;
27
- withActivation(activation: Activation): InternalContext<D, Index>;
28
- setIndex(idx: number): InternalContext<D, number>;
29
- idx: Index;
30
- readonly activation: Activation | undefined;
31
- readonly kvp: KeyValueProvider;
32
- readonly options: ContextOptions;
33
- destroy(scope: KeyValueScope): Promise<void>;
34
- }
35
- export declare class ContextImpl<D, Index = void> implements InternalContext<D, Index> {
36
- log: Logger;
37
- executionId: string;
38
- startTime: Date;
39
- data: D;
40
- creds: Credentials;
25
+ export declare class ContextImpl<D, Index = void> implements Context<D> {
26
+ #private;
27
+ readonly log: Logger;
28
+ readonly executionId: string;
29
+ readonly startTime: Date;
30
+ readonly data: D;
41
31
  idx: Index;
42
32
  readonly kvp: KeyValueProvider;
43
33
  readonly options: ContextOptions;
44
34
  constructor(log: Logger, kvp: KeyValueProvider, creds: Credentials, executionId: string, startTime: Date, data: D, options?: ContextOptions);
45
35
  get activation(): Activation | undefined;
46
- setIndex(idx: number): InternalContext<D, number>;
47
- withActivation(activation: Activation): InternalContext<D, Index>;
48
- withData<D2>(data: D2): InternalContext<D2, Index>;
36
+ setIndex(idx: number): ContextImpl<D, number>;
37
+ withActivation(activation: Activation): ContextImpl<D, Index>;
38
+ withData<D2>(data: D2): ContextImpl<D2, Index>;
49
39
  openKv(scope?: KeyValueScope): KeyValue;
50
40
  credentials(): Credentials;
51
41
  destroy(scope: KeyValueScope): Promise<void>;
52
42
  [Symbol.toPrimitive](): Record<string, unknown>;
53
- toJSON(): Record<string, unknown>;
54
43
  }
55
44
  //# sourceMappingURL=Context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/src/context/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAExE,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AACtD,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,WAAW,CAAC;I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AG,SAAS,CAEvC;IAED,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC;IAe7C,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC;IAoB7D,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC;IAY9C,MAAM,CAAC,KAAK,GAAE,aAA2B,GAAG,QAAQ;IAepD,WAAW,IAAI,WAAW;IAI1B,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5C,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAQlD"}
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
3
+ if (kind === "m") throw new TypeError("Private method is not writable");
4
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
5
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
6
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
7
+ };
8
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
9
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
10
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
11
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
12
+ };
13
+ var _ContextImpl_creds;
2
14
  Object.defineProperty(exports, "__esModule", { value: true });
3
15
  exports.ContextImpl = void 0;
4
16
  class ContextImpl {
@@ -27,12 +39,6 @@ class ContextImpl {
27
39
  writable: true,
28
40
  value: void 0
29
41
  });
30
- Object.defineProperty(this, "creds", {
31
- enumerable: true,
32
- configurable: true,
33
- writable: true,
34
- value: void 0
35
- });
36
42
  Object.defineProperty(this, "idx", {
37
43
  enumerable: true,
38
44
  configurable: true,
@@ -51,9 +57,10 @@ class ContextImpl {
51
57
  writable: true,
52
58
  value: void 0
53
59
  });
60
+ _ContextImpl_creds.set(this, void 0);
54
61
  this.log = log;
55
62
  this.executionId = executionId;
56
- this.creds = creds;
63
+ __classPrivateFieldSet(this, _ContextImpl_creds, creds, "f");
57
64
  this.startTime = startTime;
58
65
  this.data = data;
59
66
  this.idx = void 0;
@@ -69,7 +76,7 @@ class ContextImpl {
69
76
  return this.options.activation;
70
77
  }
71
78
  setIndex(idx) {
72
- const next = new ContextImpl(this.log, this.kvp, this.creds, this.executionId, this.startTime, this.data, this.options);
79
+ const next = new ContextImpl(this.log, this.kvp, __classPrivateFieldGet(this, _ContextImpl_creds, "f"), this.executionId, this.startTime, this.data, this.options);
73
80
  next.idx = idx;
74
81
  return next;
75
82
  }
@@ -78,13 +85,13 @@ class ContextImpl {
78
85
  if (this.activation) {
79
86
  throw new Error('Activation is already set');
80
87
  }
81
- return new ContextImpl(this.log, this.kvp, this.creds, this.executionId, this.startTime, this.data, {
88
+ return new ContextImpl(this.log, this.kvp, __classPrivateFieldGet(this, _ContextImpl_creds, "f"), this.executionId, this.startTime, this.data, {
82
89
  ...this.options,
83
90
  activation,
84
91
  });
85
92
  }
86
93
  withData(data) {
87
- return new ContextImpl(this.log, this.kvp, this.creds, this.executionId, this.startTime, data, this.options);
94
+ return new ContextImpl(this.log, this.kvp, __classPrivateFieldGet(this, _ContextImpl_creds, "f"), this.executionId, this.startTime, data, this.options);
88
95
  }
89
96
  openKv(scope = ':project:') {
90
97
  if (scope === ':execution:') {
@@ -100,7 +107,7 @@ class ContextImpl {
100
107
  });
101
108
  }
102
109
  credentials() {
103
- return this.creds;
110
+ return __classPrivateFieldGet(this, _ContextImpl_creds, "f");
104
111
  }
105
112
  destroy(scope) {
106
113
  if (scope === ':execution:') {
@@ -115,7 +122,7 @@ class ContextImpl {
115
122
  activationId: this.activation?.id,
116
123
  });
117
124
  }
118
- [Symbol.toPrimitive]() {
125
+ [(_ContextImpl_creds = new WeakMap(), Symbol.toPrimitive)]() {
119
126
  return {
120
127
  startTime: this.startTime,
121
128
  executionId: this.executionId,
@@ -123,8 +130,5 @@ class ContextImpl {
123
130
  data: this.data,
124
131
  };
125
132
  }
126
- toJSON() {
127
- return this[Symbol.toPrimitive]();
128
- }
129
133
  }
130
134
  exports.ContextImpl = ContextImpl;
@@ -1,9 +1,9 @@
1
1
  import { KeyValueProvider } from '../kv/KeyValue.js';
2
2
  import { Logger } from '../observability/logging/Logger.js';
3
- import { Context, ContextOptions, InternalContext } from './Context.js';
3
+ import { Context, ContextImpl, ContextOptions } from './Context.js';
4
4
  import { Credentials } from '../dsl/http/versori/contextcredentials.js';
5
5
  export interface ContextProvider {
6
- create<D>(data: D, options?: ContextOptions): InternalContext<D, void>;
6
+ create<D>(data: D, options?: ContextOptions): ContextImpl<D, void>;
7
7
  destroy(ctx: Context<any>): Promise<void>;
8
8
  }
9
9
  export declare class ContextProviderImpl implements ContextProvider {
@@ -11,7 +11,7 @@ export declare class ContextProviderImpl implements ContextProvider {
11
11
  kvp: KeyValueProvider;
12
12
  creds: Credentials;
13
13
  constructor(log: Logger, kvp: KeyValueProvider, creds: Credentials);
14
- create<D>(data: D, options?: ContextOptions): InternalContext<D, void>;
14
+ create<D>(data: D, options?: ContextOptions): ContextImpl<D>;
15
15
  destroy(ctx: Context<any>): Promise<void>;
16
16
  }
17
17
  //# sourceMappingURL=ContextProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../../../src/src/context/ContextProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,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C;IACnE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED,qBAAa,mBAAoB,YAAW,eAAe;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,gBAAgB,CAAC;IACtB,KAAK,EAAE,WAAW,CAAC;gBAEP,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW;IAMlE,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,GAAE,cAAmB,GAAG,WAAW,CAAC,CAAC,CAAC;IAehE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAM5C"}
@@ -29,7 +29,7 @@ class DefaultRoundTripperFactory {
29
29
  }
30
30
  credentials() {
31
31
  return {
32
- getRaw: () => Promise.resolve(new ArrayBuffer(0)),
32
+ getRaw: () => Promise.resolve(new Uint8Array(0)),
33
33
  getAccessToken: () => Promise.resolve({
34
34
  accessToken: '',
35
35
  tokenType: '',
@@ -4,7 +4,7 @@ export type Token = {
4
4
  expiry?: Date;
5
5
  };
6
6
  export interface Credentials {
7
- getRaw(name: string): Promise<ArrayBuffer>;
8
- getAccessToken(name: string): Promise<Token>;
7
+ getRaw(name: string): Promise<Uint8Array>;
8
+ getAccessToken(name: string, forceRefresh?: boolean): Promise<Token>;
9
9
  }
10
10
  //# sourceMappingURL=contextcredentials.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contextcredentials.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/contextcredentials.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB,CAAA;AAED,MAAM,WAAW,WAAW;IACxB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3C,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAChD"}
1
+ {"version":3,"file":"contextcredentials.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/contextcredentials.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB,CAAA;AAED,MAAM,WAAW,WAAW;IACxB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC1C,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CACxE"}
@@ -1,4 +1,5 @@
1
- export declare function createTokenClient(baseUrl?: string): import("@connectrpc/connect").Client<import("@bufbuild/protobuf/codegenv1").GenService<{
1
+ import { Client } from '@connectrpc/connect';
2
+ export declare function createTokenClient(baseUrl?: string): Client<import("@bufbuild/protobuf/codegenv1").GenService<{
2
3
  getToken: {
3
4
  methodKind: "unary";
4
5
  input: typeof import("./tokens/v1/token_service_pb.js").GetTokenRequestSchema;
@@ -11,7 +12,7 @@ export declare function createTokenClient(baseUrl?: string): import("@connectrpc
11
12
  };
12
13
  }>>;
13
14
  export type TokenClient = ReturnType<typeof createTokenClient>;
14
- export declare function createOAuth2TokenService(baseUrl?: string): import("@connectrpc/connect").Client<import("@bufbuild/protobuf/codegenv1").GenService<{
15
+ export declare function createOAuth2TokenService(baseUrl?: string): Client<import("@bufbuild/protobuf/codegenv1").GenService<{
15
16
  getAccessToken: {
16
17
  methodKind: "unary";
17
18
  input: typeof import("./oauth2/v1/token_service_pb.js").GetAccessTokenRequestSchema;
@@ -39,7 +40,7 @@ export declare function createOAuth2TokenService(baseUrl?: string): import("@con
39
40
  };
40
41
  }>>;
41
42
  export type OAuth2TokenClient = ReturnType<typeof createOAuth2TokenService>;
42
- export declare function createCredentialsClient(baseUrl?: string): import("@connectrpc/connect").Client<import("@bufbuild/protobuf/codegenv1").GenService<{
43
+ export declare function createCredentialsClient(baseUrl?: string): Client<import("@bufbuild/protobuf/codegenv1").GenService<{
43
44
  create: {
44
45
  methodKind: "unary";
45
46
  input: typeof import("./v1alpha1/credential_service_pb.js").CreateCredentialRequestSchema;
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../../../src/src/dsl/http/versori/credentials/credentials.ts"],"names":[],"mappings":"AAeA,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,MAAgC;;;;;;;;;;;IAK1E;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE/D,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,MAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;IAKjF;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE5E,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,MAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKhF;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../../../../../../src/src/dsl/http/versori/credentials/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAe3D,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,MAAgC;;;;;;;;;;;IAK1E;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE/D,wBAAgB,wBAAwB,CAAC,OAAO,GAAE,MAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;IAKjF;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE5E,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,MAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKhF;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -7,7 +7,6 @@ const connect_1 = require("@connectrpc/connect");
7
7
  const connect_node_1 = require("@connectrpc/connect-node");
8
8
  const token_service_pb_js_1 = require("./tokens/v1/token_service_pb.js");
9
9
  const token_service_pb_js_2 = require("./oauth2/v1/token_service_pb.js");
10
- // // @deno-types="./v1alpha1/credential_service_pb.d.ts"
11
10
  const credential_service_pb_js_1 = require("./v1alpha1/credential_service_pb.js");
12
11
  // // @deno-types="./customauth/v1/customauth_service_pb.d.ts"
13
12
  // import { CustomAuthenticationService } from './customauth/v1/customauth_service_pb.d.ts';
@@ -1,8 +1,8 @@
1
+ import { Logger } from '../../../observability/logging/Logger.js';
1
2
  import { DynamicFetcher, RoundTripperFactory } from '../types.js';
3
+ import { Credentials, Token } from './contextcredentials.js';
2
4
  import { VersoriCredentialClient } from './credentials/mod.js';
3
5
  import { PlatformAPIClient } from './platformapi.js';
4
- import { Logger } from '../../../observability/logging/Logger.js';
5
- import { Credentials } from './contextcredentials.js';
6
6
  /**
7
7
  * VersoriRoundTripper is an implementation of the RoundTripperFactory interface for Versori connections.
8
8
  * This is the intended implementation for when projects/services are hosted on Versori infrastructure.
@@ -21,16 +21,16 @@ export declare class VersoriCredentialsFactory implements RoundTripperFactory {
21
21
  private platformAPIClient;
22
22
  private versoriCfg;
23
23
  private log;
24
- private readonly defaultDynamic;
25
24
  constructor(credsClient: VersoriCredentialClient, credsBaseURL: string, platformAPIClient: PlatformAPIClient, logger: Logger);
26
25
  static fromEnv(logger?: Logger): VersoriCredentialsFactory;
27
- private changeRequestInit;
28
- private changeBaseUrl;
29
26
  create(connName: string, fn?: typeof fetch): Promise<typeof fetch | undefined>;
30
27
  createDynamic(templateName: string, fn?: typeof fetch): Promise<DynamicFetcher | undefined>;
31
28
  credentials(): Credentials;
32
- private getTokenByName;
33
- private getRawByName;
29
+ private readonly defaultDynamic;
30
+ private changeRequestInit;
31
+ private changeBaseUrl;
32
+ getTokenByName(name: string, forceRefresh?: boolean): Promise<Token>;
33
+ getRawByName(name: string): Promise<Uint8Array>;
34
34
  private getCredentialIDFromName;
35
35
  private getConnectionID;
36
36
  private getTemplateID;
@@ -1 +1 @@
1
- {"version":3,"file":"roundtripper.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/roundtripper.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,cAAc,EACd,mBAAmB,EAEtB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAWlE,OAAO,EAAE,WAAW,EAAS,MAAM,yBAAyB,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,qBAAa,yBAA0B,YAAW,mBAAmB;IACjE,OAAO,CAAC,WAAW,CAA0B;IAC7C,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,iBAAiB,CAAoB;IAE7C,OAAO,CAAC,UAAU,CAAmB;IAErC,OAAO,CAAC,GAAG,CAAS;IAEpB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAK7B;gBAGE,WAAW,EAAE,uBAAuB,EACpC,YAAY,EAAE,MAAM,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM;IAWlB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,yBAAyB;IA6B1D,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,aAAa;IAwBrB,M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