@versori/run 0.4.5 → 0.5.0-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 (199) hide show
  1. package/esm/src/connection/DirectConnectionFactory.d.ts +3 -5
  2. package/esm/src/connection/DirectConnectionFactory.d.ts.map +1 -1
  3. package/esm/src/connection/DirectConnectionFactory.js +0 -5
  4. package/esm/src/connection/internal/CredentialHolder.d.ts.map +1 -1
  5. package/esm/src/connection/internal/CredentialHolder.js +1 -1
  6. package/esm/src/connection/internal/FetchBuilder.d.ts +9 -2
  7. package/esm/src/connection/internal/FetchBuilder.d.ts.map +1 -1
  8. package/esm/src/connection/internal/FetchBuilder.js +120 -4
  9. package/esm/src/connection/internal/OutboundConnectionFactory.d.ts.map +1 -1
  10. package/esm/src/connection/internal/OutboundConnectionFactory.js +2 -2
  11. package/esm/src/context/Context.d.ts +1 -0
  12. package/esm/src/context/Context.d.ts.map +1 -1
  13. package/esm/src/context/Context.js +3 -0
  14. package/esm/src/context/ContextProvider.d.ts +1 -1
  15. package/esm/src/context/ContextProvider.d.ts.map +1 -1
  16. package/esm/src/context/ContextProvider.js +1 -1
  17. package/esm/src/dsl/Workflow.d.ts.map +1 -1
  18. package/esm/src/dsl/Workflow.js +2 -0
  19. package/esm/src/dsl/http/types.d.ts +2 -0
  20. package/esm/src/dsl/http/types.d.ts.map +1 -1
  21. package/esm/src/dsl/http/versori/configloader.js +1 -1
  22. package/esm/src/dsl/http/versori/cronapi.d.ts +2 -3
  23. package/esm/src/dsl/http/versori/cronapi.d.ts.map +1 -1
  24. package/esm/src/dsl/http/versori/cronapi.js +14 -15
  25. package/esm/src/dsl/http/versori/kvapi/core/OpenAPI.js +1 -1
  26. package/esm/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
  27. package/esm/src/dsl/http/versori/webhookmiddleware.js +69 -38
  28. package/esm/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
  29. package/esm/src/dsl/triggers/WebhookTrigger.js +3 -1
  30. package/esm/src/internal/InternalAuth.d.ts +0 -1
  31. package/esm/src/internal/InternalAuth.d.ts.map +1 -1
  32. package/esm/src/internal/InternalAuth.js +1 -14
  33. package/esm/src/internal/constants.d.ts +3 -1
  34. package/esm/src/internal/constants.d.ts.map +1 -1
  35. package/esm/src/internal/constants.js +4 -1
  36. package/esm/src/internal/supervisor.d.ts +25 -0
  37. package/esm/src/internal/supervisor.d.ts.map +1 -0
  38. package/esm/src/internal/supervisor.js +156 -0
  39. package/esm/src/interpreter/durable/DurableInterpreter.d.ts +8 -2
  40. package/esm/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
  41. package/esm/src/interpreter/durable/DurableInterpreter.js +80 -15
  42. package/esm/src/interpreter/durable/ObservableCompiler.d.ts +6 -1
  43. package/esm/src/interpreter/durable/ObservableCompiler.d.ts.map +1 -1
  44. package/esm/src/interpreter/durable/Queue.js +1 -1
  45. package/esm/src/interpreter/durable/compilers/catch.d.ts.map +1 -1
  46. package/esm/src/interpreter/durable/compilers/catch.js +1 -0
  47. package/esm/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
  48. package/esm/src/interpreter/durable/compilers/fn.js +19 -4
  49. package/esm/src/interpreter/durable/compilers/http.d.ts.map +1 -1
  50. package/esm/src/interpreter/durable/compilers/http.js +40 -7
  51. package/esm/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
  52. package/esm/src/interpreter/durable/compilers/schedule.js +2 -1
  53. package/esm/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
  54. package/esm/src/interpreter/durable/compilers/webhook.js +14 -4
  55. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +7 -1
  56. package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  57. package/esm/src/interpreter/memory/MemoryInterpreter.js +79 -14
  58. package/esm/src/interpreter/memory/ObservableCompiler.d.ts +6 -1
  59. package/esm/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
  60. package/esm/src/interpreter/memory/compilers/catch.d.ts.map +1 -1
  61. package/esm/src/interpreter/memory/compilers/catch.js +1 -0
  62. package/esm/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
  63. package/esm/src/interpreter/memory/compilers/fn.js +19 -16
  64. package/esm/src/interpreter/memory/compilers/http.d.ts.map +1 -1
  65. package/esm/src/interpreter/memory/compilers/http.js +39 -6
  66. package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  67. package/esm/src/interpreter/memory/compilers/schedule.js +2 -1
  68. package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  69. package/esm/src/interpreter/memory/compilers/webhook.js +15 -4
  70. package/esm/src/issues/Issues.js +1 -1
  71. package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
  72. package/esm/src/kv/nats/NatsKeyValueProvider.js +2 -2
  73. package/esm/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
  74. package/esm/src/kv/sdk/SDKKeyValueProvider.js +3 -3
  75. package/esm/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
  76. package/package.json +3 -1
  77. package/script/src/connection/DirectConnectionFactory.d.ts +3 -5
  78. package/script/src/connection/DirectConnectionFactory.d.ts.map +1 -1
  79. package/script/src/connection/DirectConnectionFactory.js +0 -5
  80. package/script/src/connection/internal/CredentialHolder.d.ts.map +1 -1
  81. package/script/src/connection/internal/CredentialHolder.js +1 -1
  82. package/script/src/connection/internal/FetchBuilder.d.ts +9 -2
  83. package/script/src/connection/internal/FetchBuilder.d.ts.map +1 -1
  84. package/script/src/connection/internal/FetchBuilder.js +143 -4
  85. package/script/src/connection/internal/OutboundConnectionFactory.d.ts.map +1 -1
  86. package/script/src/connection/internal/OutboundConnectionFactory.js +2 -2
  87. package/script/src/context/Context.d.ts +1 -0
  88. package/script/src/context/Context.d.ts.map +1 -1
  89. package/script/src/context/Context.js +3 -0
  90. package/script/src/context/ContextProvider.d.ts +1 -1
  91. package/script/src/context/ContextProvider.d.ts.map +1 -1
  92. package/script/src/context/ContextProvider.js +1 -1
  93. package/script/src/dsl/Workflow.d.ts.map +1 -1
  94. package/script/src/dsl/Workflow.js +2 -0
  95. package/script/src/dsl/http/types.d.ts +2 -0
  96. package/script/src/dsl/http/types.d.ts.map +1 -1
  97. package/script/src/dsl/http/versori/configloader.js +1 -1
  98. package/script/src/dsl/http/versori/cronapi.d.ts +2 -3
  99. package/script/src/dsl/http/versori/cronapi.d.ts.map +1 -1
  100. package/script/src/dsl/http/versori/cronapi.js +14 -15
  101. package/script/src/dsl/http/versori/kvapi/core/OpenAPI.js +1 -1
  102. package/script/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
  103. package/script/src/dsl/http/versori/webhookmiddleware.js +69 -38
  104. package/script/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
  105. package/script/src/dsl/triggers/WebhookTrigger.js +3 -1
  106. package/script/src/internal/InternalAuth.d.ts +0 -1
  107. package/script/src/internal/InternalAuth.d.ts.map +1 -1
  108. package/script/src/internal/InternalAuth.js +0 -13
  109. package/script/src/internal/constants.d.ts +3 -1
  110. package/script/src/internal/constants.d.ts.map +1 -1
  111. package/script/src/internal/constants.js +5 -2
  112. package/script/src/internal/supervisor.d.ts +25 -0
  113. package/script/src/internal/supervisor.d.ts.map +1 -0
  114. package/script/src/internal/supervisor.js +163 -0
  115. package/script/src/interpreter/durable/DurableInterpreter.d.ts +8 -2
  116. package/script/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
  117. package/script/src/interpreter/durable/DurableInterpreter.js +85 -20
  118. package/script/src/interpreter/durable/ObservableCompiler.d.ts +6 -1
  119. package/script/src/interpreter/durable/ObservableCompiler.d.ts.map +1 -1
  120. package/script/src/interpreter/durable/Queue.js +1 -1
  121. package/script/src/interpreter/durable/compilers/catch.d.ts.map +1 -1
  122. package/script/src/interpreter/durable/compilers/catch.js +1 -0
  123. package/script/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
  124. package/script/src/interpreter/durable/compilers/fn.js +19 -4
  125. package/script/src/interpreter/durable/compilers/http.d.ts.map +1 -1
  126. package/script/src/interpreter/durable/compilers/http.js +40 -7
  127. package/script/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
  128. package/script/src/interpreter/durable/compilers/schedule.js +2 -1
  129. package/script/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
  130. package/script/src/interpreter/durable/compilers/webhook.js +14 -4
  131. package/script/src/interpreter/memory/MemoryInterpreter.d.ts +7 -1
  132. package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
  133. package/script/src/interpreter/memory/MemoryInterpreter.js +78 -13
  134. package/script/src/interpreter/memory/ObservableCompiler.d.ts +6 -1
  135. package/script/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
  136. package/script/src/interpreter/memory/compilers/catch.d.ts.map +1 -1
  137. package/script/src/interpreter/memory/compilers/catch.js +1 -0
  138. package/script/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
  139. package/script/src/interpreter/memory/compilers/fn.js +19 -16
  140. package/script/src/interpreter/memory/compilers/http.d.ts.map +1 -1
  141. package/script/src/interpreter/memory/compilers/http.js +39 -6
  142. package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
  143. package/script/src/interpreter/memory/compilers/schedule.js +2 -1
  144. package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
  145. package/script/src/interpreter/memory/compilers/webhook.js +15 -4
  146. package/script/src/issues/Issues.js +1 -1
  147. package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
  148. package/script/src/kv/nats/NatsKeyValueProvider.js +2 -2
  149. package/script/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
  150. package/script/src/kv/sdk/SDKKeyValueProvider.js +3 -3
  151. package/script/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
  152. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts +0 -35
  153. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts.map +0 -1
  154. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.js +0 -113
  155. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
  156. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
  157. package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -13
  158. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
  159. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
  160. package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -2
  161. package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +0 -40
  162. package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +0 -1
  163. package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.js +0 -82
  164. package/esm/src/connection/CredentialsProvider.d.ts +0 -17
  165. package/esm/src/connection/CredentialsProvider.d.ts.map +0 -1
  166. package/esm/src/connection/CredentialsProvider.js +0 -63
  167. package/esm/src/credentials/CredentialsProvider.d.ts +0 -49
  168. package/esm/src/credentials/CredentialsProvider.d.ts.map +0 -1
  169. package/esm/src/credentials/CredentialsProvider.js +0 -102
  170. package/esm/src/dsl/http/versori/constants.d.ts +0 -20
  171. package/esm/src/dsl/http/versori/constants.d.ts.map +0 -1
  172. package/esm/src/dsl/http/versori/constants.js +0 -37
  173. package/esm/src/internal/cli.d.ts +0 -2
  174. package/esm/src/internal/cli.d.ts.map +0 -1
  175. package/esm/src/internal/cli.js +0 -32
  176. package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts +0 -35
  177. package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts.map +0 -1
  178. package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.js +0 -119
  179. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
  180. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
  181. package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -16
  182. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
  183. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
  184. package/script/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -3
  185. package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +0 -40
  186. package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +0 -1
  187. package/script/deps/jsr.io/@std/encoding/1.0.10/base64.js +0 -86
  188. package/script/src/connection/CredentialsProvider.d.ts +0 -17
  189. package/script/src/connection/CredentialsProvider.d.ts.map +0 -1
  190. package/script/src/connection/CredentialsProvider.js +0 -67
  191. package/script/src/credentials/CredentialsProvider.d.ts +0 -49
  192. package/script/src/credentials/CredentialsProvider.d.ts.map +0 -1
  193. package/script/src/credentials/CredentialsProvider.js +0 -106
  194. package/script/src/dsl/http/versori/constants.d.ts +0 -20
  195. package/script/src/dsl/http/versori/constants.d.ts.map +0 -1
  196. package/script/src/dsl/http/versori/constants.js +0 -40
  197. package/script/src/internal/cli.d.ts +0 -2
  198. package/script/src/internal/cli.d.ts.map +0 -1
  199. package/script/src/internal/cli.js +0 -35
@@ -1,35 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,119 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2025 the Deno authors. MIT license.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.rAlphabet = exports.alphabet = exports.padding = void 0;
5
- exports.calcSizeBase64 = calcSizeBase64;
6
- exports.encode = encode;
7
- exports.decode = decode;
8
- exports.padding = "=".charCodeAt(0);
9
- exports.alphabet = {
10
- base64: new TextEncoder()
11
- .encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),
12
- base64url: new TextEncoder()
13
- .encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),
14
- };
15
- exports.rAlphabet = {
16
- base64: new Uint8Array(128).fill(64), // alphabet.base64.length
17
- base64url: new Uint8Array(128).fill(64),
18
- };
19
- exports.alphabet.base64
20
- .forEach((byte, i) => exports.rAlphabet.base64[byte] = i);
21
- exports.alphabet.base64url
22
- .forEach((byte, i) => exports.rAlphabet.base64url[byte] = i);
23
- /**
24
- * Calculate the output size needed to encode a given input size for
25
- * {@linkcode encodeIntoBase64}.
26
- *
27
- * @param originalSize The size of the input buffer.
28
- * @returns The size of the output buffer.
29
- *
30
- * @example Basic Usage
31
- * ```ts
32
- * import { assertEquals } from "@std/assert";
33
- * import { calcSizeBase64 } from "@std/encoding/unstable-base64";
34
- *
35
- * assertEquals(calcSizeBase64(1), 4);
36
- * ```
37
- */
38
- function calcSizeBase64(originalSize) {
39
- return ((originalSize + 2) / 3 | 0) * 4;
40
- }
41
- function encode(buffer, i, o, alphabet, padding) {
42
- i += 2;
43
- for (; i < buffer.length; i += 3) {
44
- const x = (buffer[i - 2] << 16) | (buffer[i - 1] << 8) | buffer[i];
45
- buffer[o++] = alphabet[x >> 18];
46
- buffer[o++] = alphabet[x >> 12 & 0x3F];
47
- buffer[o++] = alphabet[x >> 6 & 0x3F];
48
- buffer[o++] = alphabet[x & 0x3F];
49
- }
50
- switch (i) {
51
- case buffer.length + 1: {
52
- const x = buffer[i - 2] << 16;
53
- buffer[o++] = alphabet[x >> 18];
54
- buffer[o++] = alphabet[x >> 12 & 0x3F];
55
- buffer[o++] = padding;
56
- buffer[o++] = padding;
57
- break;
58
- }
59
- case buffer.length: {
60
- const x = (buffer[i - 2] << 16) | (buffer[i - 1] << 8);
61
- buffer[o++] = alphabet[x >> 18];
62
- buffer[o++] = alphabet[x >> 12 & 0x3F];
63
- buffer[o++] = alphabet[x >> 6 & 0x3F];
64
- buffer[o++] = padding;
65
- break;
66
- }
67
- }
68
- return o;
69
- }
70
- function decode(buffer, i, o, alphabet, padding) {
71
- for (let x = buffer.length - 2; x < buffer.length; ++x) {
72
- if (buffer[x] === padding) {
73
- for (let y = x + 1; y < buffer.length; ++y) {
74
- if (buffer[y] !== padding) {
75
- throw new TypeError(`Cannot decode input as base64: Invalid character (${String.fromCharCode(buffer[y])})`);
76
- }
77
- }
78
- buffer = buffer.subarray(0, x);
79
- break;
80
- }
81
- }
82
- if ((buffer.length - o) % 4 === 1) {
83
- 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`);
84
- }
85
- i += 3;
86
- for (; i < buffer.length; i += 4) {
87
- const x = (getByte(buffer[i - 3], alphabet) << 18) |
88
- (getByte(buffer[i - 2], alphabet) << 12) |
89
- (getByte(buffer[i - 1], alphabet) << 6) |
90
- getByte(buffer[i], alphabet);
91
- buffer[o++] = x >> 16;
92
- buffer[o++] = x >> 8 & 0xFF;
93
- buffer[o++] = x & 0xFF;
94
- }
95
- switch (i) {
96
- case buffer.length + 1: {
97
- const x = (getByte(buffer[i - 3], alphabet) << 18) |
98
- (getByte(buffer[i - 2], alphabet) << 12);
99
- buffer[o++] = x >> 16;
100
- break;
101
- }
102
- case buffer.length: {
103
- const x = (getByte(buffer[i - 3], alphabet) << 18) |
104
- (getByte(buffer[i - 2], alphabet) << 12) |
105
- (getByte(buffer[i - 1], alphabet) << 6);
106
- buffer[o++] = x >> 16;
107
- buffer[o++] = x >> 8 & 0xFF;
108
- break;
109
- }
110
- }
111
- return o;
112
- }
113
- function getByte(char, alphabet) {
114
- const byte = alphabet[char] ?? 64;
115
- if (byte === 64) { // alphabet.Base64.length
116
- throw new TypeError(`Cannot decode input as base64: Invalid character (${String.fromCharCode(char)})`);
117
- }
118
- return byte;
119
- }
@@ -1,4 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,16 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2025 the Deno authors. MIT license.
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.detach = detach;
5
- function detach(buffer, maxSize) {
6
- const originalSize = buffer.length;
7
- if (buffer.byteOffset) {
8
- const b = new Uint8Array(buffer.buffer);
9
- b.set(buffer);
10
- buffer = b.subarray(0, originalSize);
11
- }
12
- // deno-lint-ignore no-explicit-any
13
- buffer = new Uint8Array(buffer.buffer.transfer(maxSize));
14
- buffer.set(buffer.subarray(0, originalSize), maxSize - originalSize);
15
- return [buffer, maxSize - originalSize];
16
- }
@@ -1,9 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2025 the Deno authors. MIT license.
3
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,40 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,86 +0,0 @@
1
- "use strict";
2
- // Copyright 2018-2025 the Deno authors. MIT license.
3
- // This module is browser compatible.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.encodeBase64 = encodeBase64;
6
- exports.decodeBase64 = decodeBase64;
7
- /**
8
- * Utilities for
9
- * {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4 | base64}
10
- * encoding and decoding.
11
- *
12
- * ```ts
13
- * import {
14
- * encodeBase64,
15
- * decodeBase64,
16
- * } from "@std/encoding/base64";
17
- * import { assertEquals } from "@std/assert";
18
- *
19
- * const foobar = new TextEncoder().encode("foobar");
20
- *
21
- * assertEquals(encodeBase64(foobar), "Zm9vYmFy");
22
- * assertEquals(decodeBase64("Zm9vYmFy"), foobar);
23
- * ```
24
- *
25
- * @module
26
- */
27
- const _common64_js_1 = require("./_common64.js");
28
- const _common_detach_js_1 = require("./_common_detach.js");
29
- const padding = "=".charCodeAt(0);
30
- const alphabet = new TextEncoder()
31
- .encode("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
32
- const rAlphabet = new Uint8Array(128).fill(64); // alphabet.length
33
- alphabet.forEach((byte, i) => rAlphabet[byte] = i);
34
- /**
35
- * Converts data into a base64-encoded string.
36
- *
37
- * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
38
- *
39
- * @param data The data to encode.
40
- * @returns The base64-encoded string.
41
- *
42
- * @example Usage
43
- * ```ts
44
- * import { encodeBase64 } from "@std/encoding/base64";
45
- * import { assertEquals } from "@std/assert";
46
- *
47
- * assertEquals(encodeBase64("foobar"), "Zm9vYmFy");
48
- * ```
49
- */
50
- function encodeBase64(data) {
51
- if (typeof data === "string") {
52
- data = new TextEncoder().encode(data);
53
- }
54
- else if (data instanceof ArrayBuffer)
55
- data = new Uint8Array(data).slice();
56
- else
57
- data = data.slice();
58
- const [output, i] = (0, _common_detach_js_1.detach)(data, (0, _common64_js_1.calcSizeBase64)(data.length));
59
- (0, _common64_js_1.encode)(output, i, 0, alphabet, padding);
60
- return new TextDecoder().decode(output);
61
- }
62
- /**
63
- * Decodes a base64-encoded string.
64
- *
65
- * @see {@link https://www.rfc-editor.org/rfc/rfc4648.html#section-4}
66
- *
67
- * @param b64 The base64-encoded string to decode.
68
- * @returns The decoded data.
69
- *
70
- * @example Usage
71
- * ```ts
72
- * import { decodeBase64 } from "@std/encoding/base64";
73
- * import { assertEquals } from "@std/assert";
74
- *
75
- * assertEquals(
76
- * decodeBase64("Zm9vYmFy"),
77
- * new TextEncoder().encode("foobar")
78
- * );
79
- * ```
80
- */
81
- function decodeBase64(b64) {
82
- const output = new TextEncoder().encode(b64);
83
- // deno-lint-ignore no-explicit-any
84
- return new Uint8Array(output.buffer
85
- .transfer((0, _common64_js_1.decode)(output, 0, 0, rAlphabet, padding)));
86
- }
@@ -1,17 +0,0 @@
1
- import { Client } from '@connectrpc/connect';
2
- import { CredentialsProvider } from '../credentials/CredentialsProvider.js';
3
- import { credentialv1alpha1, oauth1v1, tokensv1 } from '../services/credentials/mod.js';
4
- export declare class CredentialsProviderImpl implements CredentialsProvider {
5
- private readonly credentials;
6
- private readonly tokens;
7
- private readonly oauth1;
8
- constructor(credentials: Client<typeof credentialv1alpha1.CredentialService>, tokens: Client<typeof tokensv1.TokenService>, oauth1: Client<typeof oauth1v1.AuthorizationService>);
9
- getRaw(name: string, _activationId?: string): Promise<Uint8Array>;
10
- getAccessToken(name: string, forceRefresh?: boolean, _activationId?: string): Promise<{
11
- accessToken: string;
12
- tokenType: string;
13
- expiry: Date | undefined;
14
- }>;
15
- getOAuth1Metadata(name: string, _activationId?: string): Promise<oauth1v1.GetAuthorizationMetadataResponse>;
16
- }
17
- //# sourceMappingURL=CredentialsProvider.d.ts.map
@@ -1 +0,0 @@
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,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAExF,qBAAa,uBAAwB,YAAW,mBAAmB;IAE3D,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,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;IAInE,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IASjE,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,MAAM;;;;;IAY3E,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM;CAO/D"}
@@ -1,67 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2025 Versori Group Inc
4
- *
5
- * Use of this software is governed by the Business Source License 1.1
6
- * included in the LICENSE file at the root of this repository.
7
- *
8
- * Change Date: 2029-01-01
9
- * Change License: Apache License, Version 2.0
10
- *
11
- * As of the Change Date, in accordance with the Business Source License,
12
- * use of this software will be governed by the Apache License, Version 2.0.
13
- */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.CredentialsProviderImpl = void 0;
16
- const protobuf_1 = require("@bufbuild/protobuf");
17
- const wkt_1 = require("@bufbuild/protobuf/wkt");
18
- const mod_js_1 = require("../services/credentials/mod.js");
19
- class CredentialsProviderImpl {
20
- constructor(credentials, tokens, oauth1) {
21
- Object.defineProperty(this, "credentials", {
22
- enumerable: true,
23
- configurable: true,
24
- writable: true,
25
- value: credentials
26
- });
27
- Object.defineProperty(this, "tokens", {
28
- enumerable: true,
29
- configurable: true,
30
- writable: true,
31
- value: tokens
32
- });
33
- Object.defineProperty(this, "oauth1", {
34
- enumerable: true,
35
- configurable: true,
36
- writable: true,
37
- value: oauth1
38
- });
39
- }
40
- async getRaw(name, _activationId) {
41
- const response = await this.credentials.get({ id: name, organisationId: '' });
42
- if (!response.credential) {
43
- throw new Error(`Failed to get credential: ${name}`);
44
- }
45
- const rawData = (0, protobuf_1.create)(mod_js_1.credentialv1alpha1.CredentialDataRawSchema, response.credential.data);
46
- return rawData.raw;
47
- }
48
- async getAccessToken(name, forceRefresh, _activationId) {
49
- const response = await this.tokens.getToken({ credentialId: name, forceRefresh: forceRefresh || false });
50
- if (!response.token) {
51
- throw new Error(`Failed to get token for credential: ${name}`);
52
- }
53
- return {
54
- accessToken: response.token.accessToken,
55
- tokenType: response.token.tokenType,
56
- expiry: response.token.expiry ? new Date((0, wkt_1.timestampMs)(response.token.expiry)) : undefined,
57
- };
58
- }
59
- async getOAuth1Metadata(name, _activationId) {
60
- const response = await this.oauth1.getAuthorizationMetadata({ credentialId: name });
61
- if (!response) {
62
- throw new Error(`Failed to get OAuth1 metadata for credential: ${name}`);
63
- }
64
- return response;
65
- }
66
- }
67
- exports.CredentialsProviderImpl = CredentialsProviderImpl;
@@ -1,49 +0,0 @@
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
@@ -1 +0,0 @@
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,CAAC,KAAK,CAAC,CAAC;IAElB,iBAAiB,CACb,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAC,CAAC;CACzD;AAED,MAAM,MAAM,cAAc,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IAClC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;IACxD,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC9E,eAAe,CACX,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;IAC1C,iBAAiB,CACb,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,gBAAgB,CAAC,OAAO,kBAAkB,CAAC,+BAA+B,CAAC,GACrF,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;CAC7C;AAED;;;;;;;GAOG;AACH,qBAAa,uBAAwB,YAAW,qBAAqB;IAE7D,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,cAAc;gBADd,MAAM,EAAE,MAAM,CAAC,OAAO,kBAAkB,CAAC,iBAAiB,CAAC,EAC3D,cAAc,EAAE,MAAM;IAIrC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC;IAUvD,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC;IAoB7E,eAAe,CACjB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC;IAwBnC,iBAAiB,CACnB,EAAE,EAAE,MAAM,EACV,OAAO,EAAE,gBAAgB,CAAC,OAAO,kBAAkB,CAAC,+BAA+B,CAAC,GACrF,OAAO,CAAC,kBAAkB,CAAC,UAAU,CAAC;CAyB5C"}
@@ -1,106 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2025 Versori Group Inc
4
- *
5
- * Use of this software is governed by the Business Source License 1.1
6
- * included in the LICENSE file at the root of this repository.
7
- *
8
- * Change Date: 2029-01-01
9
- * Change License: Apache License, Version 2.0
10
- *
11
- * As of the Change Date, in accordance with the Business Source License,
12
- * use of this software will be governed by the Apache License, Version 2.0.
13
- */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.CredentialsProviderImpl = void 0;
16
- const protobuf_1 = require("@bufbuild/protobuf");
17
- const base64_js_1 = require("../../deps/jsr.io/@std/encoding/1.0.10/base64.js");
18
- const mod_js_1 = require("../services/credentials/mod.js");
19
- /**
20
- * CredentialsProviderV2 is the latest version of the CredentialsProvider interface and provides more capabilities for
21
- * interacting with the credentials service.
22
- *
23
- * THIS IS A WORK IN PROGRESS - WE SHOULD STILL USE THE V1 INTERFACE FOR NOW.
24
- *
25
- * No idea if this approach is a good idea, happy to change it if there's a better way.
26
- */
27
- class CredentialsProviderImpl {
28
- constructor(client, organisationId) {
29
- Object.defineProperty(this, "client", {
30
- enumerable: true,
31
- configurable: true,
32
- writable: true,
33
- value: client
34
- });
35
- Object.defineProperty(this, "organisationId", {
36
- enumerable: true,
37
- configurable: true,
38
- writable: true,
39
- value: organisationId
40
- });
41
- }
42
- async get(id) {
43
- const response = await this.client.get({ id, organisationId: this.organisationId });
44
- if (!response.credential) {
45
- throw new Error('Failed to get credential, response was undefined');
46
- }
47
- return response.credential;
48
- }
49
- async updateApiKey(id, key) {
50
- const rawMsg = (0, protobuf_1.create)(mod_js_1.credentialv1alpha1.CredentialDataRawSchema, {
51
- raw: new TextEncoder().encode((0, base64_js_1.encodeBase64)(key)),
52
- });
53
- const response = await this.client.update({
54
- id,
55
- organisationId: this.organisationId,
56
- data: {
57
- raw: rawMsg.raw,
58
- },
59
- });
60
- if (!response.credential) {
61
- throw new Error('Failed to update API key credential, response was undefined');
62
- }
63
- return response.credential;
64
- }
65
- async updateBasicAuth(id, username, password) {
66
- const basicAuthMsg = (0, protobuf_1.create)(mod_js_1.credentialv1alpha1.CredentialDataBasicAuthSchema, {
67
- username,
68
- password,
69
- });
70
- const data = {
71
- username: new TextEncoder().encode((0, base64_js_1.encodeBase64)(basicAuthMsg.username)),
72
- password: new TextEncoder().encode((0, base64_js_1.encodeBase64)(basicAuthMsg.password)),
73
- };
74
- const response = await this.client.update({
75
- id,
76
- organisationId: this.organisationId,
77
- data,
78
- });
79
- if (!response.credential) {
80
- throw new Error('Failed to update basic auth credential, response was undefined');
81
- }
82
- return response.credential;
83
- }
84
- async updateCertificate(id, payload) {
85
- const certificateMsg = (0, protobuf_1.create)(mod_js_1.credentialv1alpha1.CredentialDataCertificateSchema, {
86
- certificate: payload.certificate,
87
- key: payload.key,
88
- ca: payload.ca,
89
- });
90
- const data = {
91
- certificate: new TextEncoder().encode((0, base64_js_1.encodeBase64)(certificateMsg.certificate)),
92
- key: new TextEncoder().encode((0, base64_js_1.encodeBase64)(certificateMsg.key)),
93
- ca: new TextEncoder().encode((0, base64_js_1.encodeBase64)(certificateMsg.ca)),
94
- };
95
- const response = await this.client.update({
96
- id,
97
- organisationId: this.organisationId,
98
- data,
99
- });
100
- if (!response.credential) {
101
- throw new Error('Failed to update certificate credential, response was undefined');
102
- }
103
- return response.credential;
104
- }
105
- }
106
- exports.CredentialsProviderImpl = CredentialsProviderImpl;
@@ -1,20 +0,0 @@
1
- export declare const envVarOrgId = "RUN_ORGANISATION_ID";
2
- export declare const envVarEnvId = "RUN_ENVIRONMENT_ID";
3
- export declare const envVarEnvironmentName = "RUN_ENVIRONMENT";
4
- export declare const envVarProjectId = "RUN_SERVICE_ID";
5
- export declare const envVarOrgSlug = "RUN_ORGANISATION_SLUG";
6
- export declare const envVarPlatformApiBaseURL = "RUN_PLATFORM_API_INTERNAL_URL";
7
- export declare const envVarCronApiBaseURL = "RUN_CRON_API_INTERNAL_URL";
8
- export declare const envVarSDKApiBaseURL = "RUN_SDK_API_URL";
9
- export declare const envVarSelfRefURL = "RUN_SELF_REF_URL";
10
- export declare const envVarCredsBaseURL = "RUN_CREDENTIALS_SERVICE_INTERNAL_URL";
11
- export declare const envVarOtelTracesURL = "RUN_OTEL_TRACES_URL";
12
- export declare const envVarVersion = "RUN_SERVICE_VERSION";
13
- export declare const envVarConfigFile = "RUN_CONFIG_FILE";
14
- export declare const envVarClientId = "RUN_CLIENT_ID";
15
- export declare const envVarClientSecret = "RUN_CLIENT_SECRET";
16
- export declare const envVarTokenEndpoint = "RUN_TOKEN_ENDPOINT";
17
- export declare const envVarInternalToken = "RUN_INTERNAL_TOKEN";
18
- export declare const envVarLocalRun = "RUN_LOCAL";
19
- export declare const cronPort = 3001;
20
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/constants.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,WAAW,wBAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAChD,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AACvD,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAChD,eAAO,MAAM,aAAa,0BAA0B,CAAC;AACrD,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AACxE,eAAO,MAAM,oBAAoB,8BAA8B,CAAC;AAChE,eAAO,MAAM,mBAAmB,oBAAoB,CAAC;AACrD,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AACzE,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD,eAAO,MAAM,aAAa,wBAAwB,CAAC;AAEnD,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAGlD,eAAO,MAAM,cAAc,kBAAkB,CAAC;AAC9C,eAAO,MAAM,kBAAkB,sBAAsB,CAAC;AACtD,eAAO,MAAM,mBAAmB,uBAAuB,CAAC;AACxD,eAAO,MAAM,mBAAmB,uBAAuB,CAAC;AAGxD,eAAO,MAAM,cAAc,cAAc,CAAC;AAG1C,eAAO,MAAM,QAAQ,OAAO,CAAC"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- /*
3
- * Copyright (c) 2025 Versori Group Inc
4
- *
5
- * Use of this software is governed by the Business Source License 1.1
6
- * included in the LICENSE file at the root of this repository.
7
- *
8
- * Change Date: 2029-01-01
9
- * Change License: Apache License, Version 2.0
10
- *
11
- * As of the Change Date, in accordance with the Business Source License,
12
- * use of this software will be governed by the Apache License, Version 2.0.
13
- */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.cronPort = exports.envVarLocalRun = exports.envVarInternalToken = exports.envVarTokenEndpoint = exports.envVarClientSecret = exports.envVarClientId = exports.envVarConfigFile = exports.envVarVersion = exports.envVarOtelTracesURL = exports.envVarCredsBaseURL = exports.envVarSelfRefURL = exports.envVarSDKApiBaseURL = exports.envVarCronApiBaseURL = exports.envVarPlatformApiBaseURL = exports.envVarOrgSlug = exports.envVarProjectId = exports.envVarEnvironmentName = exports.envVarEnvId = exports.envVarOrgId = void 0;
16
- //TODO(@teo): remove this file, it is implemented in the src/internal/constants.ts directory now.
17
- // This file contains constants used in the Versori DSL HTTP client.
18
- exports.envVarOrgId = 'RUN_ORGANISATION_ID';
19
- exports.envVarEnvId = 'RUN_ENVIRONMENT_ID';
20
- exports.envVarEnvironmentName = 'RUN_ENVIRONMENT';
21
- exports.envVarProjectId = 'RUN_SERVICE_ID';
22
- exports.envVarOrgSlug = 'RUN_ORGANISATION_SLUG';
23
- exports.envVarPlatformApiBaseURL = 'RUN_PLATFORM_API_INTERNAL_URL';
24
- exports.envVarCronApiBaseURL = 'RUN_CRON_API_INTERNAL_URL';
25
- exports.envVarSDKApiBaseURL = 'RUN_SDK_API_URL';
26
- exports.envVarSelfRefURL = 'RUN_SELF_REF_URL';
27
- exports.envVarCredsBaseURL = 'RUN_CREDENTIALS_SERVICE_INTERNAL_URL';
28
- exports.envVarOtelTracesURL = 'RUN_OTEL_TRACES_URL';
29
- exports.envVarVersion = 'RUN_SERVICE_VERSION';
30
- // The following environment variables are used for the config file
31
- exports.envVarConfigFile = 'RUN_CONFIG_FILE';
32
- // The following environment variables are used for internal authentication
33
- exports.envVarClientId = 'RUN_CLIENT_ID';
34
- exports.envVarClientSecret = 'RUN_CLIENT_SECRET';
35
- exports.envVarTokenEndpoint = 'RUN_TOKEN_ENDPOINT';
36
- exports.envVarInternalToken = 'RUN_INTERNAL_TOKEN';
37
- // The following are for running locally
38
- exports.envVarLocalRun = 'RUN_LOCAL';
39
- // please no changerino
40
- exports.cronPort = 3001; // The port on which the cron API communicates with the service
@@ -1,2 +0,0 @@
1
- export declare function getVersoriCookie(): string;
2
- //# sourceMappingURL=cli.d.ts.map