@versori/run 0.5.0-alpha.1 → 0.5.0-alpha.2

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 (93) hide show
  1. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts +35 -0
  2. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts.map +1 -0
  3. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.js +113 -0
  4. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +4 -0
  5. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +1 -0
  6. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +13 -0
  7. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +9 -0
  8. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +1 -0
  9. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.js +2 -0
  10. package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +40 -0
  11. package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +1 -0
  12. package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.js +82 -0
  13. package/esm/src/connection/CredentialsProvider.d.ts +23 -0
  14. package/esm/src/connection/CredentialsProvider.d.ts.map +1 -0
  15. package/esm/src/connection/CredentialsProvider.js +130 -0
  16. package/esm/src/connection/DirectConnectionFactory.d.ts +3 -3
  17. package/esm/src/connection/DirectConnectionFactory.d.ts.map +1 -1
  18. package/esm/src/context/ContextProvider.d.ts.map +1 -1
  19. package/esm/src/context/ContextProvider.js +1 -0
  20. package/esm/src/credentials/CredentialsProvider.d.ts +49 -0
  21. package/esm/src/credentials/CredentialsProvider.d.ts.map +1 -0
  22. package/esm/src/credentials/CredentialsProvider.js +102 -0
  23. package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
  24. package/esm/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
  25. package/esm/src/dsl/http/versori/webhookmiddleware.js +9 -1
  26. package/esm/src/internal/supervisor.d.ts +2 -0
  27. package/esm/src/internal/supervisor.d.ts.map +1 -1
  28. package/esm/src/internal/supervisor.js +23 -0
  29. package/esm/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
  30. package/esm/src/interpreter/durable/DurableInterpreter.js +6 -39
  31. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  32. package/esm/src/interpreter/memory/MemoryInterpreter.js +6 -39
  33. package/esm/src/interpreter/memory/compilers/catch.d.ts.map +1 -1
  34. package/esm/src/interpreter/memory/compilers/catch.js +2 -0
  35. package/esm/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
  36. package/esm/src/interpreter/memory/compilers/fn.js +2 -1
  37. package/esm/src/interpreter/memory/compilers/http.d.ts.map +1 -1
  38. package/esm/src/interpreter/memory/compilers/http.js +2 -1
  39. package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  40. package/esm/src/interpreter/memory/compilers/schedule.js +2 -0
  41. package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  42. package/esm/src/interpreter/memory/compilers/webhook.js +7 -3
  43. package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
  44. package/esm/src/kv/nats/NatsKeyValueProvider.js +2 -2
  45. package/esm/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
  46. package/esm/src/kv/sdk/SDKKeyValueProvider.js +3 -3
  47. package/package.json +1 -1
  48. package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts +35 -0
  49. package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts.map +1 -0
  50. package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.js +119 -0
  51. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +4 -0
  52. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +1 -0
  53. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +16 -0
  54. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +9 -0
  55. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +1 -0
  56. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.js +3 -0
  57. package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +40 -0
  58. package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +1 -0
  59. package/script/deps/jsr.io/@std/encoding/1.0.10/base64.js +86 -0
  60. package/script/src/connection/CredentialsProvider.d.ts +23 -0
  61. package/script/src/connection/CredentialsProvider.d.ts.map +1 -0
  62. package/script/src/connection/CredentialsProvider.js +134 -0
  63. package/script/src/connection/DirectConnectionFactory.d.ts +3 -3
  64. package/script/src/connection/DirectConnectionFactory.d.ts.map +1 -1
  65. package/script/src/context/ContextProvider.d.ts.map +1 -1
  66. package/script/src/context/ContextProvider.js +1 -0
  67. package/script/src/credentials/CredentialsProvider.d.ts +49 -0
  68. package/script/src/credentials/CredentialsProvider.d.ts.map +1 -0
  69. package/script/src/credentials/CredentialsProvider.js +106 -0
  70. package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
  71. package/script/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
  72. package/script/src/dsl/http/versori/webhookmiddleware.js +9 -1
  73. package/script/src/internal/supervisor.d.ts +2 -0
  74. package/script/src/internal/supervisor.d.ts.map +1 -1
  75. package/script/src/internal/supervisor.js +24 -0
  76. package/script/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
  77. package/script/src/interpreter/durable/DurableInterpreter.js +5 -38
  78. package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  79. package/script/src/interpreter/memory/MemoryInterpreter.js +5 -38
  80. package/script/src/interpreter/memory/compilers/catch.d.ts.map +1 -1
  81. package/script/src/interpreter/memory/compilers/catch.js +2 -0
  82. package/script/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
  83. package/script/src/interpreter/memory/compilers/fn.js +1 -0
  84. package/script/src/interpreter/memory/compilers/http.d.ts.map +1 -1
  85. package/script/src/interpreter/memory/compilers/http.js +1 -0
  86. package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  87. package/script/src/interpreter/memory/compilers/schedule.js +2 -0
  88. package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  89. package/script/src/interpreter/memory/compilers/webhook.js +7 -3
  90. package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
  91. package/script/src/kv/nats/NatsKeyValueProvider.js +2 -2
  92. package/script/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
  93. package/script/src/kv/sdk/SDKKeyValueProvider.js +3 -3
@@ -0,0 +1,35 @@
1
+ import type { Uint8Array_ } from "./_types.js";
2
+ export type { Uint8Array_ };
3
+ export declare const padding: number;
4
+ export declare const alphabet: Record<Base64Alphabet, Uint8Array>;
5
+ export declare const rAlphabet: Record<Base64Alphabet, Uint8Array>;
6
+ /**
7
+ * Options for encoding and decoding base64 strings.
8
+ */
9
+ export interface Base64Options {
10
+ /** The base64 alphabet. Defaults to "base64" */
11
+ alphabet?: Base64Alphabet;
12
+ }
13
+ /**
14
+ * The base64 alphabets.
15
+ */
16
+ export type Base64Alphabet = "base64" | "base64url";
17
+ /**
18
+ * Calculate the output size needed to encode a given input size for
19
+ * {@linkcode encodeIntoBase64}.
20
+ *
21
+ * @param originalSize The size of the input buffer.
22
+ * @returns The size of the output buffer.
23
+ *
24
+ * @example Basic Usage
25
+ * ```ts
26
+ * import { assertEquals } from "@std/assert";
27
+ * import { calcSizeBase64 } from "@std/encoding/unstable-base64";
28
+ *
29
+ * assertEquals(calcSizeBase64(1), 4);
30
+ * ```
31
+ */
32
+ export declare function calcSizeBase64(originalSize: number): number;
33
+ export declare function encode(buffer: Uint8Array_, i: number, o: number, alphabet: Uint8Array, padding: number): number;
34
+ export declare function decode(buffer: Uint8Array_, i: number, o: number, alphabet: Uint8Array, padding: number): number;
35
+ //# sourceMappingURL=_common64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_common64.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/_common64.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,eAAO,MAAM,OAAO,QAAoB,CAAC;AACzC,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,cAAc,EAAE,UAAU,CAKvD,CAAC;AACF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,cAAc,EAAE,UAAU,CAGxD,CAAC;AAMF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEpD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,WAAW,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,CA4BR;AAED,wBAAgB,MAAM,CACpB,MAAM,EAAE,WAAW,EACnB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,EAAE,UAAU,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,CAmDR"}
@@ -0,0 +1,113 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ export const padding = "=".charCodeAt(0);
3
+ export const alphabet = {
4
+ base64: new TextEncoder()
5
+ .encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),
6
+ base64url: new TextEncoder()
7
+ .encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),
8
+ };
9
+ export const rAlphabet = {
10
+ base64: new Uint8Array(128).fill(64), // alphabet.base64.length
11
+ base64url: new Uint8Array(128).fill(64),
12
+ };
13
+ alphabet.base64
14
+ .forEach((byte, i) => rAlphabet.base64[byte] = i);
15
+ alphabet.base64url
16
+ .forEach((byte, i) => rAlphabet.base64url[byte] = i);
17
+ /**
18
+ * Calculate the output size needed to encode a given input size for
19
+ * {@linkcode encodeIntoBase64}.
20
+ *
21
+ * @param originalSize The size of the input buffer.
22
+ * @returns The size of the output buffer.
23
+ *
24
+ * @example Basic Usage
25
+ * ```ts
26
+ * import { assertEquals } from "@std/assert";
27
+ * import { calcSizeBase64 } from "@std/encoding/unstable-base64";
28
+ *
29
+ * assertEquals(calcSizeBase64(1), 4);
30
+ * ```
31
+ */
32
+ export function calcSizeBase64(originalSize) {
33
+ return ((originalSize + 2) / 3 | 0) * 4;
34
+ }
35
+ export function encode(buffer, i, o, alphabet, padding) {
36
+ i += 2;
37
+ for (; i < buffer.length; i += 3) {
38
+ const x = (buffer[i - 2] << 16) | (buffer[i - 1] << 8) | buffer[i];
39
+ buffer[o++] = alphabet[x >> 18];
40
+ buffer[o++] = alphabet[x >> 12 & 0x3F];
41
+ buffer[o++] = alphabet[x >> 6 & 0x3F];
42
+ buffer[o++] = alphabet[x & 0x3F];
43
+ }
44
+ switch (i) {
45
+ case buffer.length + 1: {
46
+ const x = buffer[i - 2] << 16;
47
+ buffer[o++] = alphabet[x >> 18];
48
+ buffer[o++] = alphabet[x >> 12 & 0x3F];
49
+ buffer[o++] = padding;
50
+ buffer[o++] = padding;
51
+ break;
52
+ }
53
+ case buffer.length: {
54
+ const x = (buffer[i - 2] << 16) | (buffer[i - 1] << 8);
55
+ buffer[o++] = alphabet[x >> 18];
56
+ buffer[o++] = alphabet[x >> 12 & 0x3F];
57
+ buffer[o++] = alphabet[x >> 6 & 0x3F];
58
+ buffer[o++] = padding;
59
+ break;
60
+ }
61
+ }
62
+ return o;
63
+ }
64
+ export function decode(buffer, i, o, alphabet, padding) {
65
+ for (let x = buffer.length - 2; x < buffer.length; ++x) {
66
+ if (buffer[x] === padding) {
67
+ for (let y = x + 1; y < buffer.length; ++y) {
68
+ if (buffer[y] !== padding) {
69
+ throw new TypeError(`Cannot decode input as base64: Invalid character (${String.fromCharCode(buffer[y])})`);
70
+ }
71
+ }
72
+ buffer = buffer.subarray(0, x);
73
+ break;
74
+ }
75
+ }
76
+ if ((buffer.length - o) % 4 === 1) {
77
+ throw new RangeError(`Cannot decode input as base64: Length (${buffer.length - o}), excluding padding, must not have a remainder of 1 when divided by 4`);
78
+ }
79
+ i += 3;
80
+ for (; i < buffer.length; i += 4) {
81
+ const x = (getByte(buffer[i - 3], alphabet) << 18) |
82
+ (getByte(buffer[i - 2], alphabet) << 12) |
83
+ (getByte(buffer[i - 1], alphabet) << 6) |
84
+ getByte(buffer[i], alphabet);
85
+ buffer[o++] = x >> 16;
86
+ buffer[o++] = x >> 8 & 0xFF;
87
+ buffer[o++] = x & 0xFF;
88
+ }
89
+ switch (i) {
90
+ case buffer.length + 1: {
91
+ const x = (getByte(buffer[i - 3], alphabet) << 18) |
92
+ (getByte(buffer[i - 2], alphabet) << 12);
93
+ buffer[o++] = x >> 16;
94
+ break;
95
+ }
96
+ case buffer.length: {
97
+ const x = (getByte(buffer[i - 3], alphabet) << 18) |
98
+ (getByte(buffer[i - 2], alphabet) << 12) |
99
+ (getByte(buffer[i - 1], alphabet) << 6);
100
+ buffer[o++] = x >> 16;
101
+ buffer[o++] = x >> 8 & 0xFF;
102
+ break;
103
+ }
104
+ }
105
+ return o;
106
+ }
107
+ function getByte(char, alphabet) {
108
+ const byte = alphabet[char] ?? 64;
109
+ if (byte === 64) { // alphabet.Base64.length
110
+ throw new TypeError(`Cannot decode input as base64: Invalid character (${String.fromCharCode(char)})`);
111
+ }
112
+ return byte;
113
+ }
@@ -0,0 +1,4 @@
1
+ import type { Uint8Array_ } from "./_types.js";
2
+ export type { Uint8Array_ };
3
+ export declare function detach(buffer: Uint8Array_, maxSize: number): [Uint8Array_, number];
4
+ //# sourceMappingURL=_common_detach.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_common_detach.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/_common_detach.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAE5B,wBAAgB,MAAM,CACpB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,MAAM,GACd,CAAC,WAAW,EAAE,MAAM,CAAC,CAWvB"}
@@ -0,0 +1,13 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ export function detach(buffer, maxSize) {
3
+ const originalSize = buffer.length;
4
+ if (buffer.byteOffset) {
5
+ const b = new Uint8Array(buffer.buffer);
6
+ b.set(buffer);
7
+ buffer = b.subarray(0, originalSize);
8
+ }
9
+ // deno-lint-ignore no-explicit-any
10
+ buffer = new Uint8Array(buffer.buffer.transfer(maxSize));
11
+ buffer.set(buffer.subarray(0, originalSize), maxSize - originalSize);
12
+ return [buffer, maxSize - originalSize];
13
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Proxy type of {@code Uint8Array<ArrayBuffer} or {@code Uint8Array} in TypeScript 5.7 or below respectively.
3
+ *
4
+ * This type is internal utility type and should not be used directly.
5
+ *
6
+ * @internal @private
7
+ */
8
+ export type Uint8Array_ = ReturnType<Uint8Array["slice"]>;
9
+ //# sourceMappingURL=_types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_types.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/_types.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ export {};
@@ -0,0 +1,40 @@
1
+ import type { Uint8Array_ } from "./_types.js";
2
+ export type { Uint8Array_ };
3
+ /**
4
+ * Converts data into a base64-encoded string.
5
+ *
6
+ * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
7
+ *
8
+ * @param data The data to encode.
9
+ * @returns The base64-encoded string.
10
+ *
11
+ * @example Usage
12
+ * ```ts
13
+ * import { encodeBase64 } from "@std/encoding/base64";
14
+ * import { assertEquals } from "@std/assert";
15
+ *
16
+ * assertEquals(encodeBase64("foobar"), "Zm9vYmFy");
17
+ * ```
18
+ */
19
+ export declare function encodeBase64(data: ArrayBuffer | Uint8Array | string): string;
20
+ /**
21
+ * Decodes a base64-encoded string.
22
+ *
23
+ * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
24
+ *
25
+ * @param b64 The base64-encoded string to decode.
26
+ * @returns The decoded data.
27
+ *
28
+ * @example Usage
29
+ * ```ts
30
+ * import { decodeBase64 } from "@std/encoding/base64";
31
+ * import { assertEquals } from "@std/assert";
32
+ *
33
+ * assertEquals(
34
+ * decodeBase64("Zm9vYmFy"),
35
+ * new TextEncoder().encode("foobar")
36
+ * );
37
+ * ```
38
+ */
39
+ export declare function decodeBase64(b64: string): Uint8Array_;
40
+ //# sourceMappingURL=base64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/encoding/1.0.10/base64.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC/C,YAAY,EAAE,WAAW,EAAE,CAAC;AAQ5B;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAW5E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAKrD"}
@@ -0,0 +1,82 @@
1
+ // Copyright 2018-2025 the Deno authors. MIT license.
2
+ // This module is browser compatible.
3
+ /**
4
+ * Utilities for
5
+ * {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4 | base64}
6
+ * encoding and decoding.
7
+ *
8
+ * ```ts
9
+ * import {
10
+ * encodeBase64,
11
+ * decodeBase64,
12
+ * } from "@std/encoding/base64";
13
+ * import { assertEquals } from "@std/assert";
14
+ *
15
+ * const foobar = new TextEncoder().encode("foobar");
16
+ *
17
+ * assertEquals(encodeBase64(foobar), "Zm9vYmFy");
18
+ * assertEquals(decodeBase64("Zm9vYmFy"), foobar);
19
+ * ```
20
+ *
21
+ * @module
22
+ */
23
+ import { calcSizeBase64, decode, encode } from "./_common64.js";
24
+ import { detach } from "./_common_detach.js";
25
+ const padding = "=".charCodeAt(0);
26
+ const alphabet = new TextEncoder()
27
+ .encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
28
+ const rAlphabet = new Uint8Array(128).fill(64); // alphabet.length
29
+ alphabet.forEach((byte, i) => rAlphabet[byte] = i);
30
+ /**
31
+ * Converts data into a base64-encoded string.
32
+ *
33
+ * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
34
+ *
35
+ * @param data The data to encode.
36
+ * @returns The base64-encoded string.
37
+ *
38
+ * @example Usage
39
+ * ```ts
40
+ * import { encodeBase64 } from "@std/encoding/base64";
41
+ * import { assertEquals } from "@std/assert";
42
+ *
43
+ * assertEquals(encodeBase64("foobar"), "Zm9vYmFy");
44
+ * ```
45
+ */
46
+ export function encodeBase64(data) {
47
+ if (typeof data === "string") {
48
+ data = new TextEncoder().encode(data);
49
+ }
50
+ else if (data instanceof ArrayBuffer)
51
+ data = new Uint8Array(data).slice();
52
+ else
53
+ data = data.slice();
54
+ const [output, i] = detach(data, calcSizeBase64(data.length));
55
+ encode(output, i, 0, alphabet, padding);
56
+ return new TextDecoder().decode(output);
57
+ }
58
+ /**
59
+ * Decodes a base64-encoded string.
60
+ *
61
+ * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
62
+ *
63
+ * @param b64 The base64-encoded string to decode.
64
+ * @returns The decoded data.
65
+ *
66
+ * @example Usage
67
+ * ```ts
68
+ * import { decodeBase64 } from "@std/encoding/base64";
69
+ * import { assertEquals } from "@std/assert";
70
+ *
71
+ * assertEquals(
72
+ * decodeBase64("Zm9vYmFy"),
73
+ * new TextEncoder().encode("foobar")
74
+ * );
75
+ * ```
76
+ */
77
+ export function decodeBase64(b64) {
78
+ const output = new TextEncoder().encode(b64);
79
+ // deno-lint-ignore no-explicit-any
80
+ return new Uint8Array(output.buffer
81
+ .transfer(decode(output, 0, 0, rAlphabet, padding)));
82
+ }
@@ -0,0 +1,23 @@
1
+ import { Client } from '@connectrpc/connect';
2
+ import { CredentialsProvider } from '../credentials/CredentialsProvider.js';
3
+ import { VersoriConfigReader } from '../dsl/http/versori/configloader.js';
4
+ import { credentialv1alpha1, oauth1v1, tokensv1 } from '../services/credentials/mod.js';
5
+ import { PlatformApi } from '../services/platform/mod.js';
6
+ export declare class CredentialsProviderImpl implements CredentialsProvider {
7
+ private readonly credentials;
8
+ private readonly tokens;
9
+ private readonly oauth1;
10
+ private readonly configReader;
11
+ private platformApi;
12
+ private readonly organisationId;
13
+ constructor(credentials: Client<typeof credentialv1alpha1.CredentialService>, tokens: Client<typeof tokensv1.TokenService>, oauth1: Client<typeof oauth1v1.AuthorizationService>, configReader: VersoriConfigReader, platformApi: PlatformApi);
14
+ getRaw(name: string, _activationId?: string): Promise<Uint8Array>;
15
+ getAccessToken(name: string, forceRefresh?: boolean, _activationId?: string): Promise<{
16
+ accessToken: string;
17
+ tokenType: string;
18
+ expiry: Date | undefined;
19
+ }>;
20
+ getOAuth1Metadata(name: string, _activationId?: string): Promise<oauth1v1.GetAuthorizationMetadataResponse>;
21
+ private getCredentialIDFromName;
22
+ }
23
+ //# sourceMappingURL=CredentialsProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialsProvider.d.ts","sourceRoot":"","sources":["../../../src/src/connection/CredentialsProvider.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,qBAAa,uBAAwB,YAAW,mBAAmB;IAI3D,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,WAAW;IAPvB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;gBAGnB,WAAW,EAAE,MAAM,CAAC,OAAO,kBAAkB,CAAC,iBAAiB,CAAC,EAChE,MAAM,EAAE,MAAM,CAAC,OAAO,QAAQ,CAAC,YAAY,CAAC,EAC5C,MAAM,EAAE,MAAM,CAAC,OAAO,QAAQ,CAAC,oBAAoB,CAAC,EACpD,YAAY,EAAE,mBAAmB,EAC1C,WAAW,EAAE,WAAW;IAK9B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAWjE,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,MAAM;;;;;IAc3E,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM;YAU9C,uBAAuB;CA4DxC"}
@@ -0,0 +1,130 @@
1
+ /*
2
+ * Copyright (c) 2025 Versori Group Inc
3
+ *
4
+ * Use of this software is governed by the Business Source License 1.1
5
+ * included in the LICENSE file at the root of this repository.
6
+ *
7
+ * Change Date: 2029-01-01
8
+ * Change License: Apache License, Version 2.0
9
+ *
10
+ * As of the Change Date, in accordance with the Business Source License,
11
+ * use of this software will be governed by the Apache License, Version 2.0.
12
+ */
13
+ import { create } from '@bufbuild/protobuf';
14
+ import { timestampMs } from '@bufbuild/protobuf/wkt';
15
+ import { envVarOrgId } from '../internal/constants.js';
16
+ import { credentialv1alpha1 } from '../services/credentials/mod.js';
17
+ export class CredentialsProviderImpl {
18
+ constructor(credentials, tokens, oauth1, configReader, platformApi) {
19
+ Object.defineProperty(this, "credentials", {
20
+ enumerable: true,
21
+ configurable: true,
22
+ writable: true,
23
+ value: credentials
24
+ });
25
+ Object.defineProperty(this, "tokens", {
26
+ enumerable: true,
27
+ configurable: true,
28
+ writable: true,
29
+ value: tokens
30
+ });
31
+ Object.defineProperty(this, "oauth1", {
32
+ enumerable: true,
33
+ configurable: true,
34
+ writable: true,
35
+ value: oauth1
36
+ });
37
+ Object.defineProperty(this, "configReader", {
38
+ enumerable: true,
39
+ configurable: true,
40
+ writable: true,
41
+ value: configReader
42
+ });
43
+ Object.defineProperty(this, "platformApi", {
44
+ enumerable: true,
45
+ configurable: true,
46
+ writable: true,
47
+ value: platformApi
48
+ });
49
+ Object.defineProperty(this, "organisationId", {
50
+ enumerable: true,
51
+ configurable: true,
52
+ writable: true,
53
+ value: void 0
54
+ });
55
+ this.organisationId = Deno.env.get(envVarOrgId) || 'development';
56
+ }
57
+ async getRaw(name, _activationId) {
58
+ const credentialId = await this.getCredentialIDFromName(name, _activationId);
59
+ const response = await this.credentials.get({ id: credentialId, organisationId: '' });
60
+ if (!response.credential) {
61
+ throw new Error(`Failed to get credential: ${name}`);
62
+ }
63
+ const rawData = create(credentialv1alpha1.CredentialDataRawSchema, response.credential.data);
64
+ return rawData.raw;
65
+ }
66
+ async getAccessToken(name, forceRefresh, _activationId) {
67
+ const credentialId = await this.getCredentialIDFromName(name, _activationId);
68
+ const response = await this.tokens.getToken({ credentialId: credentialId, forceRefresh: forceRefresh || false });
69
+ if (!response.token) {
70
+ throw new Error(`Failed to get token for credential: ${name}`);
71
+ }
72
+ return {
73
+ accessToken: response.token.accessToken,
74
+ tokenType: response.token.tokenType,
75
+ expiry: response.token.expiry ? new Date(timestampMs(response.token.expiry)) : undefined,
76
+ };
77
+ }
78
+ async getOAuth1Metadata(name, _activationId) {
79
+ const credentialId = await this.getCredentialIDFromName(name, _activationId);
80
+ const response = await this.oauth1.getAuthorizationMetadata({ credentialId: credentialId });
81
+ if (!response) {
82
+ throw new Error(`Failed to get OAuth1 metadata for credential: ${name}`);
83
+ }
84
+ return response;
85
+ }
86
+ async getCredentialIDFromName(name, activationId) {
87
+ // fin connection config from versori file
88
+ const conn = this.configReader.getCnxMapping(name);
89
+ if (!conn) {
90
+ return '';
91
+ }
92
+ // if connection is dynamic try and load the activation
93
+ if (conn.dynamic) {
94
+ if (!activationId) {
95
+ throw new Error(`Connection ${name} is dynamic, but no activation ID was found on the context`);
96
+ }
97
+ if (!conn.templateId) {
98
+ throw new Error(`Connection ${name} is dynamic, but no template ID was found on the config`);
99
+ }
100
+ const { data: dynamicConn } = await this.platformApi.getActivationConnection({
101
+ path: {
102
+ activation_id: activationId,
103
+ env_system_id: conn.templateId,
104
+ organisation_id: this.organisationId,
105
+ },
106
+ });
107
+ if (!dynamicConn) {
108
+ throw new Error(`Connection ${name} not found`);
109
+ }
110
+ if (!dynamicConn.credentials[0]?.credential?.id) {
111
+ throw new Error(`Connection ${name} has no credentials defined on it`);
112
+ }
113
+ return dynamicConn.credentials[0].credential?.id;
114
+ }
115
+ // connection is not dynamic try and load static connection
116
+ if (!conn.connId) {
117
+ throw new Error(`Connection ${name} is static, but no connection ID was found on the config`);
118
+ }
119
+ const { data: staticConn } = await this.platformApi.getConnection({
120
+ path: {
121
+ organisation_id: this.organisationId,
122
+ connection_id: conn.connId,
123
+ },
124
+ });
125
+ if (!staticConn?.credentials[0]?.credential?.id) {
126
+ throw new Error(`Connection ${name}/${conn.connId} has no credentials defined on it`);
127
+ }
128
+ return staticConn.credentials[0].credential.id;
129
+ }
130
+ }
@@ -15,9 +15,9 @@ import { ConnectionFactory, FetchLike } from './types.js';
15
15
  */
16
16
  export declare class DirectConnectionFactory implements ConnectionFactory {
17
17
  private readonly httpClientFactory;
18
- private readonly credentials;
19
- private readonly tokens;
20
- private readonly oauth1;
18
+ readonly credentials: Client<typeof credentialv1alpha1.CredentialService>;
19
+ readonly tokens: Client<typeof tokensv1.TokenService>;
20
+ readonly oauth1: Client<typeof oauth1v1.AuthorizationService>;
21
21
  private readonly logger;
22
22
  private readonly outboundConnectionFactory;
23
23
  private readonly expressInboundConnectionFactory;
@@ -1 +1 @@
1
- {"version":3,"file":"DirectConnectionFactory.d.ts","sourceRoot":"","sources":["../../../src/src/connection/DirectConnectionFactory.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAEzC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE1D;;;;;;;GAOG;AACH,qBAAa,uBAAwB,YAAW,iBAAiB;IAKzD,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,O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EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,GAAE,cAAmB,GAAG,WAAW,CAAC,CAAC,CAAC;IAiCxF,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1C"}
@@ -71,6 +71,7 @@ export class ContextProviderImpl {
71
71
  }
72
72
  create(activation, data, options = {}) {
73
73
  const executionId = ulid();
74
+ console.log('Creating context for activation', activation);
74
75
  const logger = this.log.child({
75
76
  executionId,
76
77
  activationId: activation.id,
@@ -0,0 +1,49 @@
1
+ import { MessageInitShape } from '@bufbuild/protobuf';
2
+ import { Client } from '@connectrpc/connect';
3
+ import { credentialv1alpha1, oauth1v1 } from '../services/credentials/mod.js';
4
+ export type Token = {
5
+ accessToken: string;
6
+ tokenType: string;
7
+ expiry?: Date;
8
+ };
9
+ /**
10
+ * CredentialsProvider is the interface for interacting with the credentials service.
11
+ */
12
+ export interface CredentialsProvider {
13
+ getRaw(name: string, activationId?: string): Promise<Uint8Array>;
14
+ getAccessToken(name: string, forceRefresh?: boolean, activationId?: string): Promise<Token>;
15
+ getOAuth1Metadata(name: string, activationId?: string): Promise<oauth1v1.GetAuthorizationMetadataResponse>;
16
+ }
17
+ export type CredentialData = {
18
+ [key: string]: Uint8Array;
19
+ };
20
+ /**
21
+ * CredentialsProviderV2 is the latest version of the CredentialsProvider interface and provides more capabilities for
22
+ * interacting with the credentials service.
23
+ *
24
+ * All implementations should be provided a fixed organisation ID to prevent misuse of the API.
25
+ */
26
+ export interface CredentialsProviderV2 {
27
+ get(id: string): Promise<credentialv1alpha1.Credential>;
28
+ updateApiKey(id: string, key: string): Promise<credentialv1alpha1.Credential>;
29
+ updateBasicAuth(id: string, username: string, password: string): Promise<credentialv1alpha1.Credential>;
30
+ updateCertificate(id: string, payload: MessageInitShape<typeof credentialv1alpha1.CredentialDataCertificateSchema>): Promise<credentialv1alpha1.Credential>;
31
+ }
32
+ /**
33
+ * CredentialsProviderV2 is the latest version of the CredentialsProvider interface and provides more capabilities for
34
+ * interacting with the credentials service.
35
+ *
36
+ * THIS IS A WORK IN PROGRESS - WE SHOULD STILL USE THE V1 INTERFACE FOR NOW.
37
+ *
38
+ * No idea if this approach is a good idea, happy to change it if there's a better way.
39
+ */
40
+ export declare class CredentialsProviderImpl implements CredentialsProviderV2 {
41
+ private readonly client;
42
+ private readonly organisationId;
43
+ constructor(client: Client<typeof credentialv1alpha1.CredentialService>, organisationId: string);
44
+ get(id: string): Promise<credentialv1alpha1.Credential>;
45
+ updateApiKey(id: string, key: string): Promise<credentialv1alpha1.Credential>;
46
+ updateBasicAuth(id: string, username: string, password: string): Promise<credentialv1alpha1.Credential>;
47
+ updateCertificate(id: string, payload: MessageInitShape<typeof credentialv1alpha1.CredentialDataCertificateSchema>): Promise<credentialv1alpha1.Credential>;
48
+ }
49
+ //# sourceMappingURL=CredentialsProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialsProvider.d.ts","sourceRoot":"","sources":["../../../src/src/credentials/CredentialsProvider.ts"],"names":[],"mappings":"AAaA,OAAO,EAAU,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAS9E,MAAM,MAAM,KAAK,GAAG;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEjE,cAAc,CACV,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,OAAO,EACtB,YAAY,CAAC,EAAE,MAAM,GACtB,OAAO,C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