@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.
- package/esm/src/connection/DirectConnectionFactory.d.ts +3 -5
- package/esm/src/connection/DirectConnectionFactory.d.ts.map +1 -1
- package/esm/src/connection/DirectConnectionFactory.js +0 -5
- package/esm/src/connection/internal/CredentialHolder.d.ts.map +1 -1
- package/esm/src/connection/internal/CredentialHolder.js +1 -1
- package/esm/src/connection/internal/FetchBuilder.d.ts +9 -2
- package/esm/src/connection/internal/FetchBuilder.d.ts.map +1 -1
- package/esm/src/connection/internal/FetchBuilder.js +120 -4
- package/esm/src/connection/internal/OutboundConnectionFactory.d.ts.map +1 -1
- package/esm/src/connection/internal/OutboundConnectionFactory.js +2 -2
- package/esm/src/context/Context.d.ts +1 -0
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/Context.js +3 -0
- package/esm/src/context/ContextProvider.d.ts +1 -1
- package/esm/src/context/ContextProvider.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.js +1 -1
- package/esm/src/dsl/Workflow.d.ts.map +1 -1
- package/esm/src/dsl/Workflow.js +2 -0
- package/esm/src/dsl/http/types.d.ts +2 -0
- package/esm/src/dsl/http/types.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.js +1 -1
- package/esm/src/dsl/http/versori/cronapi.d.ts +2 -3
- package/esm/src/dsl/http/versori/cronapi.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/cronapi.js +14 -15
- package/esm/src/dsl/http/versori/kvapi/core/OpenAPI.js +1 -1
- package/esm/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/webhookmiddleware.js +69 -38
- package/esm/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/esm/src/dsl/triggers/WebhookTrigger.js +3 -1
- package/esm/src/internal/InternalAuth.d.ts +0 -1
- package/esm/src/internal/InternalAuth.d.ts.map +1 -1
- package/esm/src/internal/InternalAuth.js +1 -14
- package/esm/src/internal/constants.d.ts +3 -1
- package/esm/src/internal/constants.d.ts.map +1 -1
- package/esm/src/internal/constants.js +4 -1
- package/esm/src/internal/supervisor.d.ts +25 -0
- package/esm/src/internal/supervisor.d.ts.map +1 -0
- package/esm/src/internal/supervisor.js +156 -0
- package/esm/src/interpreter/durable/DurableInterpreter.d.ts +8 -2
- package/esm/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/durable/DurableInterpreter.js +80 -15
- package/esm/src/interpreter/durable/ObservableCompiler.d.ts +6 -1
- package/esm/src/interpreter/durable/ObservableCompiler.d.ts.map +1 -1
- package/esm/src/interpreter/durable/Queue.js +1 -1
- package/esm/src/interpreter/durable/compilers/catch.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/catch.js +1 -0
- package/esm/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/fn.js +19 -4
- package/esm/src/interpreter/durable/compilers/http.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/http.js +40 -7
- package/esm/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/schedule.js +2 -1
- package/esm/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/webhook.js +14 -4
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +7 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +79 -14
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts +6 -1
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/catch.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/catch.js +1 -0
- package/esm/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/fn.js +19 -16
- package/esm/src/interpreter/memory/compilers/http.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/http.js +39 -6
- package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/schedule.js +2 -1
- package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.js +15 -4
- package/esm/src/issues/Issues.js +1 -1
- package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/esm/src/kv/nats/NatsKeyValueProvider.js +2 -2
- package/esm/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
- package/esm/src/kv/sdk/SDKKeyValueProvider.js +3 -3
- package/esm/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/package.json +3 -1
- package/script/src/connection/DirectConnectionFactory.d.ts +3 -5
- package/script/src/connection/DirectConnectionFactory.d.ts.map +1 -1
- package/script/src/connection/DirectConnectionFactory.js +0 -5
- package/script/src/connection/internal/CredentialHolder.d.ts.map +1 -1
- package/script/src/connection/internal/CredentialHolder.js +1 -1
- package/script/src/connection/internal/FetchBuilder.d.ts +9 -2
- package/script/src/connection/internal/FetchBuilder.d.ts.map +1 -1
- package/script/src/connection/internal/FetchBuilder.js +143 -4
- package/script/src/connection/internal/OutboundConnectionFactory.d.ts.map +1 -1
- package/script/src/connection/internal/OutboundConnectionFactory.js +2 -2
- package/script/src/context/Context.d.ts +1 -0
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/Context.js +3 -0
- package/script/src/context/ContextProvider.d.ts +1 -1
- package/script/src/context/ContextProvider.d.ts.map +1 -1
- package/script/src/context/ContextProvider.js +1 -1
- package/script/src/dsl/Workflow.d.ts.map +1 -1
- package/script/src/dsl/Workflow.js +2 -0
- package/script/src/dsl/http/types.d.ts +2 -0
- package/script/src/dsl/http/types.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.js +1 -1
- package/script/src/dsl/http/versori/cronapi.d.ts +2 -3
- package/script/src/dsl/http/versori/cronapi.d.ts.map +1 -1
- package/script/src/dsl/http/versori/cronapi.js +14 -15
- package/script/src/dsl/http/versori/kvapi/core/OpenAPI.js +1 -1
- package/script/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
- package/script/src/dsl/http/versori/webhookmiddleware.js +69 -38
- package/script/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/script/src/dsl/triggers/WebhookTrigger.js +3 -1
- package/script/src/internal/InternalAuth.d.ts +0 -1
- package/script/src/internal/InternalAuth.d.ts.map +1 -1
- package/script/src/internal/InternalAuth.js +0 -13
- package/script/src/internal/constants.d.ts +3 -1
- package/script/src/internal/constants.d.ts.map +1 -1
- package/script/src/internal/constants.js +5 -2
- package/script/src/internal/supervisor.d.ts +25 -0
- package/script/src/internal/supervisor.d.ts.map +1 -0
- package/script/src/internal/supervisor.js +163 -0
- package/script/src/interpreter/durable/DurableInterpreter.d.ts +8 -2
- package/script/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/durable/DurableInterpreter.js +85 -20
- package/script/src/interpreter/durable/ObservableCompiler.d.ts +6 -1
- package/script/src/interpreter/durable/ObservableCompiler.d.ts.map +1 -1
- package/script/src/interpreter/durable/Queue.js +1 -1
- package/script/src/interpreter/durable/compilers/catch.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/catch.js +1 -0
- package/script/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/fn.js +19 -4
- package/script/src/interpreter/durable/compilers/http.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/http.js +40 -7
- package/script/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/schedule.js +2 -1
- package/script/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/webhook.js +14 -4
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +7 -1
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +78 -13
- package/script/src/interpreter/memory/ObservableCompiler.d.ts +6 -1
- package/script/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/catch.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/catch.js +1 -0
- package/script/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/fn.js +19 -16
- package/script/src/interpreter/memory/compilers/http.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/http.js +39 -6
- package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/schedule.js +2 -1
- package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/webhook.js +15 -4
- package/script/src/issues/Issues.js +1 -1
- package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/script/src/kv/nats/NatsKeyValueProvider.js +2 -2
- package/script/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
- package/script/src/kv/sdk/SDKKeyValueProvider.js +3 -3
- package/script/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts +0 -35
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common64.js +0 -113
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -13
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -2
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +0 -40
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/encoding/1.0.10/base64.js +0 -82
- package/esm/src/connection/CredentialsProvider.d.ts +0 -17
- package/esm/src/connection/CredentialsProvider.d.ts.map +0 -1
- package/esm/src/connection/CredentialsProvider.js +0 -63
- package/esm/src/credentials/CredentialsProvider.d.ts +0 -49
- package/esm/src/credentials/CredentialsProvider.d.ts.map +0 -1
- package/esm/src/credentials/CredentialsProvider.js +0 -102
- package/esm/src/dsl/http/versori/constants.d.ts +0 -20
- package/esm/src/dsl/http/versori/constants.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/constants.js +0 -37
- package/esm/src/internal/cli.d.ts +0 -2
- package/esm/src/internal/cli.d.ts.map +0 -1
- package/esm/src/internal/cli.js +0 -32
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts +0 -35
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common64.js +0 -119
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts +0 -4
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/_common_detach.js +0 -16
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts +0 -9
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/_types.js +0 -3
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts +0 -40
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.d.ts.map +0 -1
- package/script/deps/jsr.io/@std/encoding/1.0.10/base64.js +0 -86
- package/script/src/connection/CredentialsProvider.d.ts +0 -17
- package/script/src/connection/CredentialsProvider.d.ts.map +0 -1
- package/script/src/connection/CredentialsProvider.js +0 -67
- package/script/src/credentials/CredentialsProvider.d.ts +0 -49
- package/script/src/credentials/CredentialsProvider.d.ts.map +0 -1
- package/script/src/credentials/CredentialsProvider.js +0 -106
- package/script/src/dsl/http/versori/constants.d.ts +0 -20
- package/script/src/dsl/http/versori/constants.d.ts.map +0 -1
- package/script/src/dsl/http/versori/constants.js +0 -40
- package/script/src/internal/cli.d.ts +0 -2
- package/script/src/internal/cli.d.ts.map +0 -1
- package/script/src/internal/cli.js +0 -35
|
@@ -1,113 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -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,13 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -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,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,82 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -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,63 +0,0 @@
|
|
|
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 { credentialv1alpha1 } from '../services/credentials/mod.js';
|
|
16
|
-
export class CredentialsProviderImpl {
|
|
17
|
-
constructor(credentials, tokens, oauth1) {
|
|
18
|
-
Object.defineProperty(this, "credentials", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
configurable: true,
|
|
21
|
-
writable: true,
|
|
22
|
-
value: credentials
|
|
23
|
-
});
|
|
24
|
-
Object.defineProperty(this, "tokens", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
configurable: true,
|
|
27
|
-
writable: true,
|
|
28
|
-
value: tokens
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(this, "oauth1", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
configurable: true,
|
|
33
|
-
writable: true,
|
|
34
|
-
value: oauth1
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
async getRaw(name, _activationId) {
|
|
38
|
-
const response = await this.credentials.get({ id: name, organisationId: '' });
|
|
39
|
-
if (!response.credential) {
|
|
40
|
-
throw new Error(`Failed to get credential: ${name}`);
|
|
41
|
-
}
|
|
42
|
-
const rawData = create(credentialv1alpha1.CredentialDataRawSchema, response.credential.data);
|
|
43
|
-
return rawData.raw;
|
|
44
|
-
}
|
|
45
|
-
async getAccessToken(name, forceRefresh, _activationId) {
|
|
46
|
-
const response = await this.tokens.getToken({ credentialId: name, forceRefresh: forceRefresh || false });
|
|
47
|
-
if (!response.token) {
|
|
48
|
-
throw new Error(`Failed to get token for credential: ${name}`);
|
|
49
|
-
}
|
|
50
|
-
return {
|
|
51
|
-
accessToken: response.token.accessToken,
|
|
52
|
-
tokenType: response.token.tokenType,
|
|
53
|
-
expiry: response.token.expiry ? new Date(timestampMs(response.token.expiry)) : undefined,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
async getOAuth1Metadata(name, _activationId) {
|
|
57
|
-
const response = await this.oauth1.getAuthorizationMetadata({ credentialId: name });
|
|
58
|
-
if (!response) {
|
|
59
|
-
throw new Error(`Failed to get OAuth1 metadata for credential: ${name}`);
|
|
60
|
-
}
|
|
61
|
-
return response;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -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,102 +0,0 @@
|
|
|
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 { encodeBase64 } from '../../deps/jsr.io/@std/encoding/1.0.10/base64.js';
|
|
15
|
-
import { credentialv1alpha1 } from '../services/credentials/mod.js';
|
|
16
|
-
/**
|
|
17
|
-
* CredentialsProviderV2 is the latest version of the CredentialsProvider interface and provides more capabilities for
|
|
18
|
-
* interacting with the credentials service.
|
|
19
|
-
*
|
|
20
|
-
* THIS IS A WORK IN PROGRESS - WE SHOULD STILL USE THE V1 INTERFACE FOR NOW.
|
|
21
|
-
*
|
|
22
|
-
* No idea if this approach is a good idea, happy to change it if there's a better way.
|
|
23
|
-
*/
|
|
24
|
-
export class CredentialsProviderImpl {
|
|
25
|
-
constructor(client, organisationId) {
|
|
26
|
-
Object.defineProperty(this, "client", {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
configurable: true,
|
|
29
|
-
writable: true,
|
|
30
|
-
value: client
|
|
31
|
-
});
|
|
32
|
-
Object.defineProperty(this, "organisationId", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
configurable: true,
|
|
35
|
-
writable: true,
|
|
36
|
-
value: organisationId
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
async get(id) {
|
|
40
|
-
const response = await this.client.get({ id, organisationId: this.organisationId });
|
|
41
|
-
if (!response.credential) {
|
|
42
|
-
throw new Error('Failed to get credential, response was undefined');
|
|
43
|
-
}
|
|
44
|
-
return response.credential;
|
|
45
|
-
}
|
|
46
|
-
async updateApiKey(id, key) {
|
|
47
|
-
const rawMsg = create(credentialv1alpha1.CredentialDataRawSchema, {
|
|
48
|
-
raw: new TextEncoder().encode(encodeBase64(key)),
|
|
49
|
-
});
|
|
50
|
-
const response = await this.client.update({
|
|
51
|
-
id,
|
|
52
|
-
organisationId: this.organisationId,
|
|
53
|
-
data: {
|
|
54
|
-
raw: rawMsg.raw,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
if (!response.credential) {
|
|
58
|
-
throw new Error('Failed to update API key credential, response was undefined');
|
|
59
|
-
}
|
|
60
|
-
return response.credential;
|
|
61
|
-
}
|
|
62
|
-
async updateBasicAuth(id, username, password) {
|
|
63
|
-
const basicAuthMsg = create(credentialv1alpha1.CredentialDataBasicAuthSchema, {
|
|
64
|
-
username,
|
|
65
|
-
password,
|
|
66
|
-
});
|
|
67
|
-
const data = {
|
|
68
|
-
username: new TextEncoder().encode(encodeBase64(basicAuthMsg.username)),
|
|
69
|
-
password: new TextEncoder().encode(encodeBase64(basicAuthMsg.password)),
|
|
70
|
-
};
|
|
71
|
-
const response = await this.client.update({
|
|
72
|
-
id,
|
|
73
|
-
organisationId: this.organisationId,
|
|
74
|
-
data,
|
|
75
|
-
});
|
|
76
|
-
if (!response.credential) {
|
|
77
|
-
throw new Error('Failed to update basic auth credential, response was undefined');
|
|
78
|
-
}
|
|
79
|
-
return response.credential;
|
|
80
|
-
}
|
|
81
|
-
async updateCertificate(id, payload) {
|
|
82
|
-
const certificateMsg = create(credentialv1alpha1.CredentialDataCertificateSchema, {
|
|
83
|
-
certificate: payload.certificate,
|
|
84
|
-
key: payload.key,
|
|
85
|
-
ca: payload.ca,
|
|
86
|
-
});
|
|
87
|
-
const data = {
|
|
88
|
-
certificate: new TextEncoder().encode(encodeBase64(certificateMsg.certificate)),
|
|
89
|
-
key: new TextEncoder().encode(encodeBase64(certificateMsg.key)),
|
|
90
|
-
ca: new TextEncoder().encode(encodeBase64(certificateMsg.ca)),
|
|
91
|
-
};
|
|
92
|
-
const response = await this.client.update({
|
|
93
|
-
id,
|
|
94
|
-
organisationId: this.organisationId,
|
|
95
|
-
data,
|
|
96
|
-
});
|
|
97
|
-
if (!response.credential) {
|
|
98
|
-
throw new Error('Failed to update certificate credential, response was undefined');
|
|
99
|
-
}
|
|
100
|
-
return response.credential;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
@@ -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,37 +0,0 @@
|
|
|
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
|
-
//TODO(@teo): remove this file, it is implemented in the src/internal/constants.ts directory now.
|
|
14
|
-
// This file contains constants used in the Versori DSL HTTP client.
|
|
15
|
-
export const envVarOrgId = 'RUN_ORGANISATION_ID';
|
|
16
|
-
export const envVarEnvId = 'RUN_ENVIRONMENT_ID';
|
|
17
|
-
export const envVarEnvironmentName = 'RUN_ENVIRONMENT';
|
|
18
|
-
export const envVarProjectId = 'RUN_SERVICE_ID';
|
|
19
|
-
export const envVarOrgSlug = 'RUN_ORGANISATION_SLUG';
|
|
20
|
-
export const envVarPlatformApiBaseURL = 'RUN_PLATFORM_API_INTERNAL_URL';
|
|
21
|
-
export const envVarCronApiBaseURL = 'RUN_CRON_API_INTERNAL_URL';
|
|
22
|
-
export const envVarSDKApiBaseURL = 'RUN_SDK_API_URL';
|
|
23
|
-
export const envVarSelfRefURL = 'RUN_SELF_REF_URL';
|
|
24
|
-
export const envVarCredsBaseURL = 'RUN_CREDENTIALS_SERVICE_INTERNAL_URL';
|
|
25
|
-
export const envVarOtelTracesURL = 'RUN_OTEL_TRACES_URL';
|
|
26
|
-
export const envVarVersion = 'RUN_SERVICE_VERSION';
|
|
27
|
-
// The following environment variables are used for the config file
|
|
28
|
-
export const envVarConfigFile = 'RUN_CONFIG_FILE';
|
|
29
|
-
// The following environment variables are used for internal authentication
|
|
30
|
-
export const envVarClientId = 'RUN_CLIENT_ID';
|
|
31
|
-
export const envVarClientSecret = 'RUN_CLIENT_SECRET';
|
|
32
|
-
export const envVarTokenEndpoint = 'RUN_TOKEN_ENDPOINT';
|
|
33
|
-
export const envVarInternalToken = 'RUN_INTERNAL_TOKEN';
|
|
34
|
-
// The following are for running locally
|
|
35
|
-
export const envVarLocalRun = 'RUN_LOCAL';
|
|
36
|
-
// please no changerino
|
|
37
|
-
export const cronPort = 3001; // The port on which the cron API communicates with the service
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/src/internal/cli.ts"],"names":[],"mappings":"AA8BA,wBAAgB,gBAAgB,IAAI,MAAM,CAmBzC"}
|
package/esm/src/internal/cli.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
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
|
-
// This file contains functions that can read stuff generated by the Versori CLI. This is used when running locally.
|
|
14
|
-
import { homedir } from 'node:os';
|
|
15
|
-
const cookiesFileName = 'cookies.json';
|
|
16
|
-
const versoriCookieName = 'versori_sess';
|
|
17
|
-
export function getVersoriCookie() {
|
|
18
|
-
const cookiesFilePath = `${homedir()}/.config/versori/${cookiesFileName}`;
|
|
19
|
-
let cookiesFile;
|
|
20
|
-
try {
|
|
21
|
-
cookiesFile = JSON.parse(Deno.readTextFileSync(cookiesFilePath));
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
console.error('Error reading file, have you run the Versori CLI to log in?');
|
|
25
|
-
throw new Error(`Failed to read or parse cookies file at ${cookiesFilePath}: ${e}`);
|
|
26
|
-
}
|
|
27
|
-
const versoriCookie = cookiesFile.cookies.find((cookie) => cookie.Name === versoriCookieName);
|
|
28
|
-
if (!versoriCookie) {
|
|
29
|
-
throw new Error(`Cookie 'versori_sess' not found in ${cookiesFilePath}`);
|
|
30
|
-
}
|
|
31
|
-
return `${versoriCookieName}=${versoriCookie.Value}`;
|
|
32
|
-
}
|