@versori/run 0.1.0-alpha.9 → 0.2.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/_dnt.shims.d.ts +1 -5
- package/esm/_dnt.shims.d.ts.map +1 -1
- package/esm/_dnt.shims.js +1 -5
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts +1 -2
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts.map +1 -1
- package/esm/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.js +6 -7
- package/esm/deps/jsr.io/@std/fs/1.0.16/exists.d.ts +1 -0
- package/esm/deps/jsr.io/@std/fs/1.0.16/exists.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/fs/1.0.16/exists.js +10 -12
- package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +0 -21
- package/esm/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts +2 -3
- package/esm/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/log/0.224.14/file_handler.js +1 -2
- package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +6 -8
- package/esm/src/context/Context.d.ts +14 -4
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/Context.js +16 -10
- package/esm/src/context/ContextProvider.d.ts +3 -4
- package/esm/src/context/ContextProvider.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.js +5 -5
- package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.js +2 -3
- package/esm/src/dsl/http/versori/internalauth.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/internalauth.js +5 -6
- package/esm/src/dsl/http/versori/platformapi.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/platformapi.js +3 -4
- package/esm/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/roundtripper.js +5 -6
- package/esm/src/dsl/tasks/HttpTask.d.ts +1 -1
- package/esm/src/dsl/tasks/HttpTask.d.ts.map +1 -1
- package/esm/src/dsl/tasks/HttpTask.js +1 -1
- package/esm/src/dsl/triggers/WebhookTrigger.d.ts +45 -3
- package/esm/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/esm/src/dsl/triggers/WebhookTrigger.js +10 -6
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +6 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +76 -7
- package/esm/src/interpreter/memory/compilers/schedule.js +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.js +132 -25
- package/esm/src/kv/nats/NatsKeyValueProvider.d.ts +0 -1
- package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/esm/src/kv/nats/NatsKeyValueProvider.js +7 -8
- package/package.json +3 -6
- package/script/_dnt.shims.d.ts +1 -5
- package/script/_dnt.shims.d.ts.map +1 -1
- package/script/_dnt.shims.js +2 -7
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts +1 -2
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.d.ts.map +1 -1
- package/script/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.js +9 -33
- package/script/deps/jsr.io/@std/fs/1.0.16/exists.d.ts +1 -0
- package/script/deps/jsr.io/@std/fs/1.0.16/exists.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/fs/1.0.16/exists.js +10 -35
- package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts +0 -21
- package/script/deps/jsr.io/@std/log/0.224.14/base_handler.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts +2 -3
- package/script/deps/jsr.io/@std/log/0.224.14/file_handler.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/log/0.224.14/file_handler.js +1 -25
- package/script/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +6 -31
- package/script/src/context/Context.d.ts +14 -4
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/Context.js +16 -10
- package/script/src/context/ContextProvider.d.ts +3 -4
- package/script/src/context/ContextProvider.d.ts.map +1 -1
- package/script/src/context/ContextProvider.js +5 -5
- package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.js +2 -26
- package/script/src/dsl/http/versori/internalauth.d.ts.map +1 -1
- package/script/src/dsl/http/versori/internalauth.js +5 -29
- package/script/src/dsl/http/versori/platformapi.d.ts.map +1 -1
- package/script/src/dsl/http/versori/platformapi.js +3 -27
- package/script/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/script/src/dsl/http/versori/roundtripper.js +5 -29
- package/script/src/dsl/tasks/HttpTask.d.ts +1 -1
- package/script/src/dsl/tasks/HttpTask.d.ts.map +1 -1
- package/script/src/dsl/tasks/HttpTask.js +1 -1
- package/script/src/dsl/triggers/WebhookTrigger.d.ts +45 -3
- package/script/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/script/src/dsl/triggers/WebhookTrigger.js +10 -6
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +6 -1
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +76 -30
- package/script/src/interpreter/memory/compilers/schedule.js +1 -1
- package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/webhook.js +135 -25
- package/script/src/kv/nats/NatsKeyValueProvider.d.ts +0 -1
- package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/script/src/kv/nats/NatsKeyValueProvider.js +7 -31
package/esm/_dnt.shims.d.ts
CHANGED
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export { Deno } from "@deno/shim-deno";
|
|
3
|
-
export declare const dntGlobalThis: Omit<typeof globalThis, "Deno"> & {
|
|
4
|
-
Deno: typeof Deno;
|
|
5
|
-
};
|
|
1
|
+
export declare const dntGlobalThis: Omit<typeof globalThis, never>;
|
|
6
2
|
//# sourceMappingURL=_dnt.shims.d.ts.map
|
package/esm/_dnt.shims.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,gCAA2C,CAAC"}
|
package/esm/_dnt.shims.js
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export { Deno } from "@deno/shim-deno";
|
|
3
|
-
const dntGlobals = {
|
|
4
|
-
Deno,
|
|
5
|
-
};
|
|
1
|
+
const dntGlobals = {};
|
|
6
2
|
export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
|
|
7
3
|
function createMergeProxy(baseObj, extObj) {
|
|
8
4
|
return new Proxy(baseObj, {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as dntShim from "../../../../../../_dnt.shims.js";
|
|
2
1
|
import type { ConnectionOptions, ServerInfo, Transport } from "../../../nats-core/3.0.2/src/internal_mod.js";
|
|
3
2
|
export declare class DenoTransport implements Transport {
|
|
4
3
|
version: string;
|
|
@@ -20,7 +19,7 @@ export declare class DenoTransport implements Transport {
|
|
|
20
19
|
}, options: ConnectionOptions): Promise<void>;
|
|
21
20
|
get isClosed(): boolean;
|
|
22
21
|
peekInfo(): Promise<ServerInfo>;
|
|
23
|
-
loadTlsOptions(hostname: string): Promise<
|
|
22
|
+
loadTlsOptions(hostname: string): Promise<Deno.StartTlsOptions>;
|
|
24
23
|
startTLS(hostname: string): Promise<void>;
|
|
25
24
|
[Symbol.asyncIterator](): AsyncIterableIterator<Uint8Array>;
|
|
26
25
|
maybeWriteFrame(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deno_transport.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deno_transport.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@nats-io/transport-deno/3.0.2/src/deno_transport.ts"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EACV,iBAAiB,EAEjB,UAAU,EAEV,SAAS,EACV,MAAM,8CAA8C,CAAC;AAUtD,qBAAa,aAAc,YAAW,SAAS;IAC7C,OAAO,EAAE,MAAM,CAAW;IAC1B,IAAI,EAAE,MAAM,CAAQ;IACpB,UAAU,CAAC,EAAE,KAAK,CAAC;IACnB,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,GAAG,CAAa;IACxB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,kBAAkB,CAAsC;IAChE,OAAO,CAAC,IAAI,CAA+B;IAC3C,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,YAAY,CAAuB;;IAQrC,OAAO,CACX,EAAE,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EACvD,OAAO,EAAE,iBAAiB;IA4C5B,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAEK,QAAQ,IAAI,OAAO,CAAC,UAAU,CAAC;IAgC/B,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC;IAoB/D,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAcxC,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,qBAAqB,CAAC,UAAU,CAAC;IA2BlE,eAAe,IAAI,IAAI;IAuBvB,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAU7B,WAAW,IAAI,OAAO;IAItB,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjC,UAAU;IAKJ,OAAO,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,QAAQ,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAyC1D,MAAM,IAAI,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC;IAI/B,OAAO;CAGR;AAED,wBAAsB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAelE"}
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
* See the License for the specific language governing permissions and
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
import * as dntShim from "../../../../../../_dnt.shims.js";
|
|
16
15
|
import { checkOptions, checkUnsupportedOption, DataBuffer, deferred, Empty, errors, extractProtocolMessage, INFO, render, } from "../../../nats-core/3.0.2/src/internal_mod.js";
|
|
17
16
|
import { writeAll } from "../../../../@std/io/0.225.2/mod.js";
|
|
18
17
|
import { version } from "./version.js";
|
|
@@ -103,12 +102,12 @@ export class DenoTransport {
|
|
|
103
102
|
hostname: hp.hostname,
|
|
104
103
|
port: hp.port,
|
|
105
104
|
};
|
|
106
|
-
this.conn = await
|
|
105
|
+
this.conn = await Deno.connectTls(ctls);
|
|
107
106
|
this.encrypted = true;
|
|
108
107
|
// do nothing yet.
|
|
109
108
|
}
|
|
110
109
|
else {
|
|
111
|
-
this.conn = await
|
|
110
|
+
this.conn = await Deno.connect(hp);
|
|
112
111
|
}
|
|
113
112
|
if (this.done) {
|
|
114
113
|
this.conn.close();
|
|
@@ -180,14 +179,14 @@ export class DenoTransport {
|
|
|
180
179
|
checkUnsupportedOption("tls.keyFile", tls.keyFile);
|
|
181
180
|
const sto = { hostname };
|
|
182
181
|
if (tls.caFile) {
|
|
183
|
-
const ca = await
|
|
182
|
+
const ca = await Deno.readTextFile(tls.caFile);
|
|
184
183
|
sto.caCerts = [ca];
|
|
185
184
|
}
|
|
186
185
|
return sto;
|
|
187
186
|
}
|
|
188
187
|
async startTLS(hostname) {
|
|
189
188
|
const sto = await (this.loadTlsOptions(hostname));
|
|
190
|
-
this.conn = await
|
|
189
|
+
this.conn = await Deno.startTls(
|
|
191
190
|
//@ts-ignore: just the conn
|
|
192
191
|
this.conn, sto);
|
|
193
192
|
// this is necessary because the startTls process doesn't
|
|
@@ -312,8 +311,8 @@ export class DenoTransport {
|
|
|
312
311
|
}
|
|
313
312
|
}
|
|
314
313
|
export async function denoResolveHost(s) {
|
|
315
|
-
const a =
|
|
316
|
-
const aaaa =
|
|
314
|
+
const a = Deno.resolveDns(s, "A");
|
|
315
|
+
const aaaa = Deno.resolveDns(s, "AAAA");
|
|
317
316
|
const ips = [];
|
|
318
317
|
const w = await Promise.allSettled([a, aaaa]);
|
|
319
318
|
if (w[0].status === "fulfilled") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.16/exists.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.16/exists.ts"],"names":[],"mappings":"AAEA,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AACH,wBAAsB,MAAM,CAC1B,IAAI,EAAE,MAAM,GAAG,GAAG,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,OAAO,CAAC,CAsClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,GAAG,GAAG,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAqCT"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
2
|
-
/** Options for {@linkcode exists} and {@linkcode existsSync.} */
|
|
3
|
-
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
4
2
|
/**
|
|
5
3
|
* Asynchronously test whether or not the given path exists by checking with
|
|
6
4
|
* the file system.
|
|
@@ -100,7 +98,7 @@ import * as dntShim from "../../../../../_dnt.shims.js";
|
|
|
100
98
|
*/
|
|
101
99
|
export async function exists(path, options) {
|
|
102
100
|
try {
|
|
103
|
-
const stat = await
|
|
101
|
+
const stat = await Deno.stat(path);
|
|
104
102
|
if (options &&
|
|
105
103
|
(options.isReadable || options.isDirectory || options.isFile)) {
|
|
106
104
|
if (options.isDirectory && options.isFile) {
|
|
@@ -117,11 +115,11 @@ export async function exists(path, options) {
|
|
|
117
115
|
return true;
|
|
118
116
|
}
|
|
119
117
|
catch (error) {
|
|
120
|
-
if (error instanceof
|
|
118
|
+
if (error instanceof Deno.errors.NotFound) {
|
|
121
119
|
return false;
|
|
122
120
|
}
|
|
123
|
-
if (error instanceof
|
|
124
|
-
if ((await
|
|
121
|
+
if (error instanceof Deno.errors.PermissionDenied) {
|
|
122
|
+
if ((await Deno.permissions.query({ name: "read", path })).state ===
|
|
125
123
|
"granted") {
|
|
126
124
|
// --allow-read not missing
|
|
127
125
|
return !options?.isReadable; // PermissionDenied was raised by file system, so the item exists, but can't be read
|
|
@@ -228,7 +226,7 @@ export async function exists(path, options) {
|
|
|
228
226
|
*/
|
|
229
227
|
export function existsSync(path, options) {
|
|
230
228
|
try {
|
|
231
|
-
const stat =
|
|
229
|
+
const stat = Deno.statSync(path);
|
|
232
230
|
if (options &&
|
|
233
231
|
(options.isReadable || options.isDirectory || options.isFile)) {
|
|
234
232
|
if (options.isDirectory && options.isFile) {
|
|
@@ -245,11 +243,11 @@ export function existsSync(path, options) {
|
|
|
245
243
|
return true;
|
|
246
244
|
}
|
|
247
245
|
catch (error) {
|
|
248
|
-
if (error instanceof
|
|
246
|
+
if (error instanceof Deno.errors.NotFound) {
|
|
249
247
|
return false;
|
|
250
248
|
}
|
|
251
|
-
if (error instanceof
|
|
252
|
-
if (
|
|
249
|
+
if (error instanceof Deno.errors.PermissionDenied) {
|
|
250
|
+
if (Deno.permissions.querySync({ name: "read", path }).state === "granted") {
|
|
253
251
|
// --allow-read not missing
|
|
254
252
|
return !options?.isReadable; // PermissionDenied was raised by file system, so the item exists, but can't be read
|
|
255
253
|
}
|
|
@@ -261,10 +259,10 @@ function fileIsReadable(stat) {
|
|
|
261
259
|
if (stat.mode === null) {
|
|
262
260
|
return true; // Exclusive on Non-POSIX systems
|
|
263
261
|
}
|
|
264
|
-
else if (
|
|
262
|
+
else if (Deno.uid() === stat.uid) {
|
|
265
263
|
return (stat.mode & 0o400) === 0o400; // User is owner and can read?
|
|
266
264
|
}
|
|
267
|
-
else if (
|
|
265
|
+
else if (Deno.gid() === stat.gid) {
|
|
268
266
|
return (stat.mode & 0o040) === 0o040; // User group is owner and can read?
|
|
269
267
|
}
|
|
270
268
|
return (stat.mode & 0o004) === 0o004; // Others can read?
|
|
@@ -301,26 +301,5 @@ export declare abstract class BaseHandler {
|
|
|
301
301
|
* ```
|
|
302
302
|
*/
|
|
303
303
|
destroy(): void;
|
|
304
|
-
/**
|
|
305
|
-
* Automatically disposes of the handler when instantiated with the `using`
|
|
306
|
-
* keyword by calling the {@linkcode BaseHandler.destroy} method.
|
|
307
|
-
*
|
|
308
|
-
* @example Usage
|
|
309
|
-
* ```ts
|
|
310
|
-
* import { BaseHandler } from "@std/log/base-handler";
|
|
311
|
-
* import { LogRecord } from "@std/log/logger";
|
|
312
|
-
* import { assertInstanceOf } from "@std/assert/instance-of";
|
|
313
|
-
*
|
|
314
|
-
* class MyHandler extends BaseHandler {
|
|
315
|
-
* log(msg: string) {
|
|
316
|
-
* console.log(msg);
|
|
317
|
-
* }
|
|
318
|
-
* }
|
|
319
|
-
*
|
|
320
|
-
* using handler = new MyHandler("INFO");
|
|
321
|
-
* assertInstanceOf(handler, BaseHandler);
|
|
322
|
-
* ```
|
|
323
|
-
*/
|
|
324
|
-
[Symbol.dispose](): void;
|
|
325
304
|
}
|
|
326
305
|
//# sourceMappingURL=base_handler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base_handler.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/log/0.224.14/base_handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,SAAS,EACd,KAAK,QAAQ,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,YAAY,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,SAAS,KAAK,MAAM,CAAC;AAIjE,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IACjC,2CAA2C;IAC3C,SAAS,CAA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ecord } from "./logger.js";
|
|
4
3
|
import { BaseHandler, type BaseHandlerOptions } from "./base_handler.js";
|
|
@@ -56,7 +55,7 @@ export declare class FileHandler extends BaseHandler {
|
|
|
56
55
|
*
|
|
57
56
|
* @private
|
|
58
57
|
*/
|
|
59
|
-
[fileSymbol]:
|
|
58
|
+
[fileSymbol]: Deno.FsFile | undefined;
|
|
60
59
|
/** Buffer used to write to file.
|
|
61
60
|
*
|
|
62
61
|
* @private
|
|
@@ -85,7 +84,7 @@ export declare class FileHandler extends BaseHandler {
|
|
|
85
84
|
*
|
|
86
85
|
* @private
|
|
87
86
|
*/
|
|
88
|
-
[openOptionsSymbol]:
|
|
87
|
+
[openOptionsSymbol]: Deno.OpenOptions;
|
|
89
88
|
/**
|
|
90
89
|
* Text encoder.
|
|
91
90
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file_handler.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/log/0.224.14/file_handler.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"file_handler.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/log/0.224.14/file_handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEzE,OAAO,EACL,SAAS,EACT,aAAa,EACb,cAAc,EACd,UAAU,EACV,UAAU,EACV,iBAAiB,EACjB,aAAa,EACd,MAAM,4BAA4B,CAAC;AAEpC,sFAAsF;AACtF,MAAM,MAAM,OAAO,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEtC,2CAA2C;AAC3C,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;IAC5D;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;;;;;;;OAWG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,WAAY,SAAQ,WAAW;;IAC1C;;;OAGG;IACH,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IACtC;;;OAGG;IACH,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC;IACxB;;;;OAIG;IACH,CAAC,aAAa,CAAC,SAAK;IACpB;;;;OAIG;IACH,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACzB;;;;OAIG;IACH,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC;IACtC;;;;OAIG;IACH,CAAC,aAAa,CAAC,EAAE,WAAW,CAAqB;IAKjD;;;;;OAKG;gBACS,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,kBAAkB;IAe7D;;;;;;;;;;;OAWG;IACM,KAAK;IAUd;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACM,MAAM,CAAC,SAAS,EAAE,SAAS;IASpC;;;;;;;;;;;;;;;;;;OAkBG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM;IAaf;;;;;;;;;;;;;;;;OAgBG;IACH,KAAK;IAgBL;;;;;;;;;;;;;;OAcG;IACM,OAAO;CAMjB"}
|
|
@@ -5,7 +5,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _FileHandler_instances, _FileHandler_unloadCallback, _FileHandler_resetBuffer, _a, _b, _c, _d, _e, _f, _g;
|
|
7
7
|
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
8
|
-
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
9
8
|
import { LogLevels } from "./levels.js";
|
|
10
9
|
import { BaseHandler } from "./base_handler.js";
|
|
11
10
|
import { writeAllSync } from "../../io/0.225.2/write_all.js";
|
|
@@ -142,7 +141,7 @@ export class FileHandler extends BaseHandler {
|
|
|
142
141
|
* ```
|
|
143
142
|
*/
|
|
144
143
|
setup() {
|
|
145
|
-
this[fileSymbol] =
|
|
144
|
+
this[fileSymbol] = Deno.openSync(this[filenameSymbol], this[openOptionsSymbol]);
|
|
146
145
|
__classPrivateFieldGet(this, _FileHandler_instances, "m", _FileHandler_resetBuffer).call(this);
|
|
147
146
|
addEventListener("unload", __classPrivateFieldGet(this, _FileHandler_unloadCallback, "f"));
|
|
148
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rotating_file_handler.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rotating_file_handler.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AASzE,UAAU,0BAA2B,SAAQ,kBAAkB;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;;gBAKtC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,0BAA0B;IAM5D,KAAK;IAyCL,GAAG,CAAC,GAAG,EAAE,MAAM;IAaxB,cAAc;CAkBf"}
|
|
@@ -10,8 +10,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
11
|
};
|
|
12
12
|
var _RotatingFileHandler_maxBytes, _RotatingFileHandler_maxBackupCount, _RotatingFileHandler_currentFileSize;
|
|
13
|
-
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
14
|
-
import * as dntShim from "../../../../../_dnt.shims.js";
|
|
15
13
|
import { existsSync } from "../../fs/1.0.16/exists.js";
|
|
16
14
|
import { FileHandler } from "./file_handler.js";
|
|
17
15
|
import { encoderSymbol, filenameSymbol, fileSymbol, modeSymbol, openOptionsSymbol, } from "./_file_handler_symbols.js";
|
|
@@ -77,10 +75,10 @@ export class RotatingFileHandler extends FileHandler {
|
|
|
77
75
|
// log file, but old backups
|
|
78
76
|
for (let i = 1; i <= __classPrivateFieldGet(this, _RotatingFileHandler_maxBackupCount, "f"); i++) {
|
|
79
77
|
try {
|
|
80
|
-
|
|
78
|
+
Deno.removeSync(this[filenameSymbol] + "." + i);
|
|
81
79
|
}
|
|
82
80
|
catch (error) {
|
|
83
|
-
if (!(error instanceof
|
|
81
|
+
if (!(error instanceof Deno.errors.NotFound)) {
|
|
84
82
|
throw error;
|
|
85
83
|
}
|
|
86
84
|
}
|
|
@@ -91,13 +89,13 @@ export class RotatingFileHandler extends FileHandler {
|
|
|
91
89
|
for (let i = 1; i <= __classPrivateFieldGet(this, _RotatingFileHandler_maxBackupCount, "f"); i++) {
|
|
92
90
|
if (existsSync(this[filenameSymbol] + "." + i)) {
|
|
93
91
|
this.destroy();
|
|
94
|
-
throw new
|
|
92
|
+
throw new Deno.errors.AlreadyExists("Backup log file " + this[filenameSymbol] + "." + i +
|
|
95
93
|
" already exists");
|
|
96
94
|
}
|
|
97
95
|
}
|
|
98
96
|
}
|
|
99
97
|
else {
|
|
100
|
-
__classPrivateFieldSet(this, _RotatingFileHandler_currentFileSize, (
|
|
98
|
+
__classPrivateFieldSet(this, _RotatingFileHandler_currentFileSize, (Deno.statSync(this[filenameSymbol])).size, "f");
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
101
|
log(msg) {
|
|
@@ -116,10 +114,10 @@ export class RotatingFileHandler extends FileHandler {
|
|
|
116
114
|
const source = this[filenameSymbol] + (i === 0 ? "" : "." + i);
|
|
117
115
|
const dest = this[filenameSymbol] + "." + (i + 1);
|
|
118
116
|
if (existsSync(source)) {
|
|
119
|
-
|
|
117
|
+
Deno.renameSync(source, dest);
|
|
120
118
|
}
|
|
121
119
|
}
|
|
122
|
-
this[fileSymbol] =
|
|
120
|
+
this[fileSymbol] = Deno.openSync(this[filenameSymbol], this[openOptionsSymbol]);
|
|
123
121
|
}
|
|
124
122
|
}
|
|
125
123
|
_RotatingFileHandler_maxBytes = new WeakMap(), _RotatingFileHandler_maxBackupCount = new WeakMap(), _RotatingFileHandler_currentFileSize = new WeakMap();
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Activation } from '../dsl/http/types.js';
|
|
2
2
|
import { KeyValue, KeyValueProvider, KeyValueScope } from '../kv/KeyValue.js';
|
|
3
3
|
import { Logger } from '../observability/logging/Logger.js';
|
|
4
|
+
export type OnSuccessFn = (ctx: Context<any>) => void;
|
|
5
|
+
export type OnErrorFn = (ctx: Context<any>) => void;
|
|
6
|
+
export type ContextOptions = {
|
|
7
|
+
activation?: Activation;
|
|
8
|
+
onSuccess?: OnSuccessFn;
|
|
9
|
+
onError?: OnErrorFn;
|
|
10
|
+
};
|
|
4
11
|
export interface Context<D> {
|
|
5
12
|
log: Logger;
|
|
6
13
|
executionId: string;
|
|
@@ -15,23 +22,26 @@ export interface Context<D> {
|
|
|
15
22
|
}
|
|
16
23
|
export interface InternalContext<D, Index = void> extends Context<D> {
|
|
17
24
|
withData<D2>(data: D2): InternalContext<D2, Index>;
|
|
18
|
-
withActivation(activation: Activation
|
|
25
|
+
withActivation(activation: Activation): InternalContext<D, Index>;
|
|
19
26
|
setIndex(idx: number): InternalContext<D, number>;
|
|
20
27
|
idx: Index;
|
|
28
|
+
readonly activation: Activation | undefined;
|
|
21
29
|
readonly kvp: KeyValueProvider;
|
|
30
|
+
readonly options: ContextOptions;
|
|
22
31
|
destroy(scope: KeyValueScope): Promise<void>;
|
|
23
32
|
}
|
|
24
33
|
export declare class ContextImpl<D, Index = void> implements InternalContext<D, Index> {
|
|
25
34
|
log: Logger;
|
|
26
35
|
executionId: string;
|
|
27
36
|
startTime: Date;
|
|
28
|
-
activation?: Activation | undefined;
|
|
29
37
|
data: D;
|
|
30
38
|
idx: Index;
|
|
31
39
|
readonly kvp: KeyValueProvider;
|
|
32
|
-
|
|
40
|
+
readonly options: ContextOptions;
|
|
41
|
+
constructor(log: Logger, kvp: KeyValueProvider, executionId: string, startTime: Date, data: D, options?: ContextOptions);
|
|
42
|
+
get activation(): Activation | undefined;
|
|
33
43
|
setIndex(idx: number): InternalContext<D, number>;
|
|
34
|
-
withActivation(activation: Activation
|
|
44
|
+
withActivation(activation: Activation): InternalContext<D, Index>;
|
|
35
45
|
withData<D2>(data: D2): InternalContext<D2, Index>;
|
|
36
46
|
openKv(scope?: KeyValueScope): KeyValue;
|
|
37
47
|
destroy(scope: KeyValueScope): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/src/context/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAE5D,MAAM,WAAW,OAAO,CAAC,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,IAAI,EAAE,CAAC,CAAC;IAER;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,QAAQ,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EAAE,IAAI,EAAE,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,KAAK,CAAC;IAWlD,MAAM,CAAC,KAAK,GAAE,aAA2B,GAAG,QAAQ;IAepD,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAc/C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export class ContextImpl {
|
|
2
|
-
constructor(log, kvp, executionId, startTime, data,
|
|
2
|
+
constructor(log, kvp, executionId, startTime, data, options = {}) {
|
|
3
3
|
Object.defineProperty(this, "log", {
|
|
4
4
|
enumerable: true,
|
|
5
5
|
configurable: true,
|
|
@@ -18,25 +18,25 @@ export class ContextImpl {
|
|
|
18
18
|
writable: true,
|
|
19
19
|
value: void 0
|
|
20
20
|
});
|
|
21
|
-
Object.defineProperty(this, "
|
|
21
|
+
Object.defineProperty(this, "data", {
|
|
22
22
|
enumerable: true,
|
|
23
23
|
configurable: true,
|
|
24
24
|
writable: true,
|
|
25
25
|
value: void 0
|
|
26
26
|
});
|
|
27
|
-
Object.defineProperty(this, "
|
|
27
|
+
Object.defineProperty(this, "idx", {
|
|
28
28
|
enumerable: true,
|
|
29
29
|
configurable: true,
|
|
30
30
|
writable: true,
|
|
31
31
|
value: void 0
|
|
32
32
|
});
|
|
33
|
-
Object.defineProperty(this, "
|
|
33
|
+
Object.defineProperty(this, "kvp", {
|
|
34
34
|
enumerable: true,
|
|
35
35
|
configurable: true,
|
|
36
36
|
writable: true,
|
|
37
37
|
value: void 0
|
|
38
38
|
});
|
|
39
|
-
Object.defineProperty(this, "
|
|
39
|
+
Object.defineProperty(this, "options", {
|
|
40
40
|
enumerable: true,
|
|
41
41
|
configurable: true,
|
|
42
42
|
writable: true,
|
|
@@ -45,25 +45,31 @@ export class ContextImpl {
|
|
|
45
45
|
this.log = log;
|
|
46
46
|
this.executionId = executionId;
|
|
47
47
|
this.startTime = startTime;
|
|
48
|
-
this.activation = activation;
|
|
49
48
|
this.data = data;
|
|
50
49
|
this.idx = void 0;
|
|
51
50
|
this.kvp = kvp;
|
|
51
|
+
this.options = options;
|
|
52
|
+
}
|
|
53
|
+
get activation() {
|
|
54
|
+
return this.options.activation;
|
|
52
55
|
}
|
|
53
56
|
setIndex(idx) {
|
|
54
|
-
const next = new ContextImpl(this.log, this.kvp, this.executionId, this.startTime, this.data, this.
|
|
57
|
+
const next = new ContextImpl(this.log, this.kvp, this.executionId, this.startTime, this.data, this.options);
|
|
55
58
|
next.idx = idx;
|
|
56
59
|
return next;
|
|
57
60
|
}
|
|
58
61
|
withActivation(activation) {
|
|
59
62
|
// Essentially makes activation immutable once set
|
|
60
63
|
if (this.activation) {
|
|
61
|
-
|
|
64
|
+
throw new Error('Activation is already set');
|
|
62
65
|
}
|
|
63
|
-
return new ContextImpl(this.log, this.kvp, this.executionId, this.startTime, this.data,
|
|
66
|
+
return new ContextImpl(this.log, this.kvp, this.executionId, this.startTime, this.data, {
|
|
67
|
+
...this.options,
|
|
68
|
+
activation,
|
|
69
|
+
});
|
|
64
70
|
}
|
|
65
71
|
withData(data) {
|
|
66
|
-
return new ContextImpl(this.log, this.kvp, this.executionId, this.startTime, data, this.
|
|
72
|
+
return new ContextImpl(this.log, this.kvp, this.executionId, this.startTime, data, this.options);
|
|
67
73
|
}
|
|
68
74
|
openKv(scope = ':project:') {
|
|
69
75
|
if (scope === ':execution:') {
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { KeyValueProvider } from '../kv/KeyValue.js';
|
|
2
2
|
import { Logger } from '../observability/logging/Logger.js';
|
|
3
|
-
import { Context, InternalContext } from './Context.js';
|
|
4
|
-
import { Activation } from '../dsl/http/types.js';
|
|
3
|
+
import { Context, ContextOptions, InternalContext } from './Context.js';
|
|
5
4
|
export interface ContextProvider {
|
|
6
|
-
create<D>(data: D,
|
|
5
|
+
create<D>(data: D, options?: ContextOptions): InternalContext<D, void>;
|
|
7
6
|
destroy(ctx: Context<any>): Promise<void>;
|
|
8
7
|
}
|
|
9
8
|
export declare class ContextProviderImpl implements ContextProvider {
|
|
10
9
|
log: Logger;
|
|
11
10
|
kvp: KeyValueProvider;
|
|
12
11
|
constructor(log: Logger, kvp: KeyValueProvider);
|
|
13
|
-
create<D>(data: D,
|
|
12
|
+
create<D>(data: D, options?: ContextOptions): InternalContext<D, void>;
|
|
14
13
|
destroy(ctx: Context<any>): Promise<void>;
|
|
15
14
|
}
|
|
16
15
|
//# sourceMappingURL=ContextProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../../../src/src/context/ContextProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAe,
|
|
1
|
+
{"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../../../src/src/context/ContextProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAe,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAGrF,MAAM,WAAW,eAAe;IAC5B,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACvE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED,qBAAa,mBAAoB,YAAW,eAAe;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,gBAAgB,CAAC;gBAEV,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB;IAK9C,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,GAAE,cAAmB,GAAG,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC;IAe1E,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAM5C"}
|
|
@@ -17,16 +17,16 @@ export class ContextProviderImpl {
|
|
|
17
17
|
this.log = log;
|
|
18
18
|
this.kvp = kvp;
|
|
19
19
|
}
|
|
20
|
-
create(data,
|
|
20
|
+
create(data, options = {}) {
|
|
21
21
|
const executionId = ulid();
|
|
22
22
|
let logger = this.log.child({ executionId });
|
|
23
|
-
if (activation) {
|
|
23
|
+
if (options.activation) {
|
|
24
24
|
logger = logger.child({
|
|
25
|
-
activationId: activation.id,
|
|
26
|
-
externalUserId: activation.user.externalId,
|
|
25
|
+
activationId: options.activation.id,
|
|
26
|
+
externalUserId: options.activation.user.externalId,
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
|
-
return new ContextImpl(logger, this.kvp, executionId, new Date(), data,
|
|
29
|
+
return new ContextImpl(logger, this.kvp, executionId, new Date(), data, options);
|
|
30
30
|
}
|
|
31
31
|
destroy(ctx) {
|
|
32
32
|
return this.kvp.destroy({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configloader.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/configloader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configloader.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/configloader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/C;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CAUrD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
1
|
import { envVarConfigFile } from './constants.js';
|
|
3
2
|
/**
|
|
4
3
|
* Loads the Versori SDK configuration from a JSON file.
|
|
@@ -11,10 +10,10 @@ import { envVarConfigFile } from './constants.js';
|
|
|
11
10
|
*/
|
|
12
11
|
export function LoadConfigFromFile() {
|
|
13
12
|
// Get the config file name from the environment variable
|
|
14
|
-
const configFileName =
|
|
13
|
+
const configFileName = Deno.env.get(envVarConfigFile);
|
|
15
14
|
if (!configFileName) {
|
|
16
15
|
throw new Error(`Environment variable ${envVarConfigFile} is not set`);
|
|
17
16
|
}
|
|
18
|
-
const cfg = JSON.parse(
|
|
17
|
+
const cfg = JSON.parse(Deno.readTextFileSync(configFileName));
|
|
19
18
|
return cfg;
|
|
20
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internalauth.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/internalauth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"internalauth.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/internalauth.ts"],"names":[],"mappings":"AAEA,qBAAa,YAAY;IACrB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAS;IAE9B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,SAAS,CAAS;;IA2BpB,QAAQ;CAsBjB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
1
|
import { envVarClientId, envVarClientSecret, envVarInternalToken, envVarTokenEndpoint } from './constants.js';
|
|
3
2
|
export class InternalAuth {
|
|
4
3
|
constructor() {
|
|
@@ -32,13 +31,13 @@ export class InternalAuth {
|
|
|
32
31
|
writable: true,
|
|
33
32
|
value: void 0
|
|
34
33
|
});
|
|
35
|
-
this.clientId =
|
|
36
|
-
this.clientSecret =
|
|
37
|
-
this.tokenEndpoint =
|
|
34
|
+
this.clientId = Deno.env.get(envVarClientId) || '';
|
|
35
|
+
this.clientSecret = Deno.env.get(envVarClientSecret) || '';
|
|
36
|
+
this.tokenEndpoint = Deno.env.get(envVarTokenEndpoint) || '';
|
|
38
37
|
this.accessToken = '';
|
|
39
38
|
this.expiresAt = 0;
|
|
40
|
-
if (
|
|
41
|
-
this.accessToken =
|
|
39
|
+
if (Deno.env.get(envVarInternalToken)) {
|
|
40
|
+
this.accessToken = Deno.env.get(envVarInternalToken) || '';
|
|
42
41
|
this.expiresAt = Date.now() + 365 * 24 * 60 * 60 * 1000; // expires in 1 year
|
|
43
42
|
console.log(`Using static token provided by ${envVarInternalToken}`);
|
|
44
43
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platformapi.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/platformapi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"platformapi.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/platformapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAIzE,qBAAa,iBAAkB,YAAW,kBAAkB;IACxD,OAAO,CAAC,OAAO,CAAS;IAExB,OAAO,CAAC,KAAK,CAAS;IAEtB,OAAO,CAAC,KAAK,CAAS;IAEtB,OAAO,CAAC,YAAY,CAAe;gBAG/B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM;IAQjB,MAAM,CAAC,OAAO,IAAI,iBAAiB;IAY7B,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAiBnE,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAmBzD,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAmBpE,uBAAuB,CACzB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACrB,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;IAmB5B,eAAe,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;CAkBjD"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as dntShim from "../../../../_dnt.shims.js";
|
|
2
1
|
import { envVarEnvId, envVarOrgId, envVarPlatformApiBaseURL } from './constants.js';
|
|
3
2
|
import { InternalAuth } from './internalauth.js';
|
|
4
3
|
export class PlatformAPIClient {
|
|
@@ -33,9 +32,9 @@ export class PlatformAPIClient {
|
|
|
33
32
|
this.internalAuth = new InternalAuth();
|
|
34
33
|
}
|
|
35
34
|
static fromEnv() {
|
|
36
|
-
const baseUrl =
|
|
37
|
-
const orgId =
|
|
38
|
-
const envId =
|
|
35
|
+
const baseUrl = Deno.env.get(envVarPlatformApiBaseURL);
|
|
36
|
+
const orgId = Deno.env.get(envVarOrgId);
|
|
37
|
+
const envId = Deno.env.get(envVarEnvId);
|
|
39
38
|
if (!baseUrl || !orgId || !envId) {
|
|
40
39
|
throw new Error('Missing required environment variables');
|
|
41
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roundtripper.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/roundtripper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"roundtripper.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/roundtripper.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,cAAc,EACd,mBAAmB,EAEtB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AASlE,MAAM,MAAM,kBAAkB,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IAClE,OAAO,CAAC,WAAW,CAA0B;IAE7C,OAAO,CAAC,iBAAiB,CAAoB;IAE7C,OAAO,CAAC,UAAU,CAAmB;IAErC,OAAO,CAAC,GAAG,CAAS;IAEpB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAK7B;gBAGE,WAAW,EAAE,uBAAuB,EACpC,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM;IAQlB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,0BAA0B;IA0B3D,OAAO,CAAC,iBAAiB;IAczB,OAAO,CAAC,aAAa;IAsBf,MAAM,CACR,QAAQ,EAAE,MAAM,EAChB,EAAE,GAAE,OAAO,KAAwB,GACpC,OAAO,CAAC,OAAO,KAAK,GAAG,SAAS,CAAC;IA4B9B,aAAa,CACf,YAAY,EAAE,MAAM,EACpB,EAAE,GAAE,OAAO,KAAwB,GACpC,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IA4CtC,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,aAAa;YAUP,aAAa;YAoDb,gBAAgB;YAmChB,kBAAkB;YAiClB,aAAa;CAkD9B"}
|