@versori/run 0.2.0-alpha.1 → 0.2.0-alpha.11
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/{script/deps/jsr.io/@std/fmt/1.0.6 → esm/deps/jsr.io/@std/fmt/1.0.7}/colors.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/fs/{1.0.16 → 1.0.17}/exists.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/log/0.224.14/console_handler.js +1 -1
- package/esm/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +1 -1
- package/esm/src/context/Context.d.ts +7 -1
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/Context.js +30 -4
- package/esm/src/context/ContextProvider.d.ts +3 -1
- package/esm/src/context/ContextProvider.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.js +9 -2
- package/esm/src/dsl/http/default.d.ts +2 -0
- package/esm/src/dsl/http/default.d.ts.map +1 -1
- package/esm/src/dsl/http/default.js +10 -0
- package/esm/src/dsl/http/types.d.ts +13 -2
- package/esm/src/dsl/http/types.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/activation.d.ts +13 -0
- package/esm/src/dsl/http/versori/activation.d.ts.map +1 -0
- package/esm/src/dsl/http/versori/activation.js +65 -0
- package/esm/src/dsl/http/versori/constants.d.ts +5 -0
- package/esm/src/dsl/http/versori/constants.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/constants.js +5 -0
- package/esm/src/dsl/http/versori/contextcredentials.d.ts +10 -0
- package/esm/src/dsl/http/versori/contextcredentials.d.ts.map +1 -0
- package/esm/src/dsl/http/versori/contextcredentials.js +1 -0
- package/esm/src/dsl/http/versori/credentials/client.d.ts +4 -4
- package/esm/src/dsl/http/versori/credentials/client.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/credentials/client.js +8 -13
- package/esm/src/dsl/http/versori/credentials/credentials.d.ts +38 -0
- package/esm/src/dsl/http/versori/credentials/credentials.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/credentials/credentials.js +7 -8
- package/esm/src/dsl/http/versori/credentials/v1alpha1/common_pb.d.ts +31 -0
- package/esm/src/dsl/http/versori/credentials/v1alpha1/common_pb.d.ts.map +1 -0
- package/esm/src/dsl/http/versori/credentials/v1alpha1/common_pb.js +31 -0
- package/esm/src/dsl/http/versori/credentials/v1alpha1/credential_service_pb.d.ts +84 -0
- package/esm/src/dsl/http/versori/credentials/v1alpha1/credential_service_pb.d.ts.map +1 -0
- package/esm/src/dsl/http/versori/credentials/v1alpha1/credential_service_pb.js +128 -0
- package/esm/src/dsl/http/versori/cronapi.d.ts +10 -0
- package/esm/src/dsl/http/versori/cronapi.d.ts.map +1 -0
- package/esm/src/dsl/http/versori/cronapi.js +51 -0
- package/esm/src/dsl/http/versori/platformapi.d.ts +4 -1
- package/esm/src/dsl/http/versori/platformapi.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/platformapi.js +38 -6
- package/esm/src/dsl/http/versori/roundtripper.d.ts +11 -5
- package/esm/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/roundtripper.js +168 -75
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +4 -2
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +49 -10
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts +1 -0
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/schedule.js +18 -23
- package/esm/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/esm/src/observability/logging/ConsoleLogger.js +55 -10
- package/package.json +1 -1
- package/{esm/deps/jsr.io/@std/fmt/1.0.6 → script/deps/jsr.io/@std/fmt/1.0.7}/colors.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/fs/{1.0.16 → 1.0.17}/exists.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/log/0.224.14/console_handler.js +1 -1
- package/script/deps/jsr.io/@std/log/0.224.14/rotating_file_handler.js +1 -1
- package/script/src/context/Context.d.ts +7 -1
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/Context.js +30 -4
- package/script/src/context/ContextProvider.d.ts +3 -1
- package/script/src/context/ContextProvider.d.ts.map +1 -1
- package/script/src/context/ContextProvider.js +9 -2
- package/script/src/dsl/http/default.d.ts +2 -0
- package/script/src/dsl/http/default.d.ts.map +1 -1
- package/script/src/dsl/http/default.js +10 -0
- package/script/src/dsl/http/types.d.ts +13 -2
- package/script/src/dsl/http/types.d.ts.map +1 -1
- package/script/src/dsl/http/versori/activation.d.ts +13 -0
- package/script/src/dsl/http/versori/activation.d.ts.map +1 -0
- package/script/src/dsl/http/versori/activation.js +69 -0
- package/script/src/dsl/http/versori/constants.d.ts +5 -0
- package/script/src/dsl/http/versori/constants.d.ts.map +1 -1
- package/script/src/dsl/http/versori/constants.js +6 -1
- package/script/src/dsl/http/versori/contextcredentials.d.ts +10 -0
- package/script/src/dsl/http/versori/contextcredentials.d.ts.map +1 -0
- package/script/src/dsl/http/versori/contextcredentials.js +2 -0
- package/script/src/dsl/http/versori/credentials/client.d.ts +4 -4
- package/script/src/dsl/http/versori/credentials/client.d.ts.map +1 -1
- package/script/src/dsl/http/versori/credentials/client.js +7 -10
- package/script/src/dsl/http/versori/credentials/credentials.d.ts +38 -0
- package/script/src/dsl/http/versori/credentials/credentials.d.ts.map +1 -1
- package/script/src/dsl/http/versori/credentials/credentials.js +8 -8
- package/script/src/dsl/http/versori/credentials/v1alpha1/common_pb.d.ts +31 -0
- package/script/src/dsl/http/versori/credentials/v1alpha1/common_pb.d.ts.map +1 -0
- package/script/src/dsl/http/versori/credentials/v1alpha1/common_pb.js +34 -0
- package/script/src/dsl/http/versori/credentials/v1alpha1/credential_service_pb.d.ts +84 -0
- package/script/src/dsl/http/versori/credentials/v1alpha1/credential_service_pb.d.ts.map +1 -0
- package/script/src/dsl/http/versori/credentials/v1alpha1/credential_service_pb.js +131 -0
- package/script/src/dsl/http/versori/cronapi.d.ts +10 -0
- package/script/src/dsl/http/versori/cronapi.d.ts.map +1 -0
- package/script/src/dsl/http/versori/cronapi.js +55 -0
- package/script/src/dsl/http/versori/platformapi.d.ts +4 -1
- package/script/src/dsl/http/versori/platformapi.d.ts.map +1 -1
- package/script/src/dsl/http/versori/platformapi.js +38 -6
- package/script/src/dsl/http/versori/roundtripper.d.ts +11 -5
- package/script/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/script/src/dsl/http/versori/roundtripper.js +170 -77
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +4 -2
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +48 -9
- package/script/src/interpreter/memory/ObservableCompiler.d.ts +1 -0
- package/script/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/schedule.js +18 -23
- package/script/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/script/src/observability/logging/ConsoleLogger.js +55 -10
- /package/esm/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.7}/colors.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.7}/colors.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.16 → 1.0.17}/exists.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.16 → 1.0.17}/exists.js +0 -0
- /package/script/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.7}/colors.d.ts +0 -0
- /package/script/deps/jsr.io/@std/fmt/{1.0.6 → 1.0.7}/colors.js +0 -0
- /package/script/deps/jsr.io/@std/fs/{1.0.16 → 1.0.17}/exists.d.ts +0 -0
- /package/script/deps/jsr.io/@std/fs/{1.0.16 → 1.0.17}/exists.js +0 -0
|
@@ -1,4 +1,36 @@
|
|
|
1
1
|
import * as log from '../../../deps/jsr.io/@std/log/0.224.14/mod.js';
|
|
2
|
+
function valueOfUnknown(obj, idx) {
|
|
3
|
+
switch (typeof obj) {
|
|
4
|
+
case 'object':
|
|
5
|
+
if (obj instanceof Object) {
|
|
6
|
+
const valueOf = obj.valueOf();
|
|
7
|
+
if (typeof valueOf === 'object' && !Array.isArray(valueOf)) {
|
|
8
|
+
return valueOf;
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
[`arg${idx}`]: obj,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
if (obj === null) {
|
|
15
|
+
return {
|
|
16
|
+
[`arg${idx}`]: null,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return obj;
|
|
20
|
+
case 'undefined':
|
|
21
|
+
return {
|
|
22
|
+
[`arg${idx}`]: undefined,
|
|
23
|
+
};
|
|
24
|
+
case 'function':
|
|
25
|
+
return {
|
|
26
|
+
[`arg${idx}`]: obj.valueOf(),
|
|
27
|
+
};
|
|
28
|
+
default:
|
|
29
|
+
return {
|
|
30
|
+
[`arg${idx}`]: obj,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
2
34
|
log.setup({
|
|
3
35
|
handlers: {
|
|
4
36
|
default: new log.ConsoleHandler('DEBUG', {
|
|
@@ -8,16 +40,29 @@ log.setup({
|
|
|
8
40
|
// - args are rendered as a nested object named `args`.
|
|
9
41
|
//
|
|
10
42
|
// This implementation uses ISO 8601 time and flattens the args object.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
...
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
43
|
+
try {
|
|
44
|
+
return JSON.stringify({
|
|
45
|
+
level: record.levelName,
|
|
46
|
+
time: record.datetime.toISOString(),
|
|
47
|
+
...(record.loggerName ? { name: record.loggerName } : {}),
|
|
48
|
+
msg: record.msg,
|
|
49
|
+
...(Array.isArray(record.args)
|
|
50
|
+
? (record.args.reduce((acc, next, idx) => ({
|
|
51
|
+
...acc,
|
|
52
|
+
...(valueOfUnknown(next, idx)),
|
|
53
|
+
}), {}))
|
|
54
|
+
: {}),
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
return JSON.stringify({
|
|
59
|
+
level: record.levelName,
|
|
60
|
+
time: record.datetime.toISOString(),
|
|
61
|
+
...(record.loggerName ? { name: record.loggerName } : {}),
|
|
62
|
+
msg: record.msg,
|
|
63
|
+
LOG_ERROR: `Failed to render args: ${err instanceof Error ? err.message : err}`,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
21
66
|
},
|
|
22
67
|
}),
|
|
23
68
|
},
|
package/package.json
CHANGED
package/{esm/deps/jsr.io/@std/fmt/1.0.6 → script/deps/jsr.io/@std/fmt/1.0.7}/colors.d.ts.map
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fmt/1.0.
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fmt/1.0.7/colors.ts"],"names":[],"mappings":"AAoEA,qEAAqE;AACrE,MAAM,WAAW,GAAG;IAClB,0BAA0B;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,4BAA4B;IAC5B,CAAC,EAAE,MAAM,CAAC;IACV,2BAA2B;IAC3B,CAAC,EAAE,MAAM,CAAC;CACX;AAID;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,QAM7C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAEzC;AA0BD;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEzC;AAED;;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;;;;;;;;;GAeG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAuB9D;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,GAAG,MAAM,CAuBhE;AAWD;;;;;;;;;;;;GAYG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.
|
|
1
|
+
{"version":3,"file":"exists.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/fs/1.0.17/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"}
|
|
@@ -16,7 +16,7 @@ exports.ConsoleHandler = void 0;
|
|
|
16
16
|
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
17
17
|
// This module is browser compatible.
|
|
18
18
|
const levels_js_1 = require("./levels.js");
|
|
19
|
-
const colors_js_1 = require("../../fmt/1.0.
|
|
19
|
+
const colors_js_1 = require("../../fmt/1.0.7/colors.js");
|
|
20
20
|
const base_handler_js_1 = require("./base_handler.js");
|
|
21
21
|
function applyColors(msg, level) {
|
|
22
22
|
switch (level) {
|
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
13
|
var _RotatingFileHandler_maxBytes, _RotatingFileHandler_maxBackupCount, _RotatingFileHandler_currentFileSize;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.RotatingFileHandler = void 0;
|
|
16
|
-
const exists_js_1 = require("../../fs/1.0.
|
|
16
|
+
const exists_js_1 = require("../../fs/1.0.17/exists.js");
|
|
17
17
|
const file_handler_js_1 = require("./file_handler.js");
|
|
18
18
|
const _file_handler_symbols_js_1 = require("./_file_handler_symbols.js");
|
|
19
19
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
+
import { Credentials } from '../dsl/http/versori/contextcredentials.js';
|
|
4
5
|
export type OnSuccessFn = (ctx: Context<any>) => void;
|
|
5
6
|
export type OnErrorFn = (ctx: Context<any>) => void;
|
|
6
7
|
export type ContextOptions = {
|
|
@@ -19,6 +20,7 @@ export interface Context<D> {
|
|
|
19
20
|
* @param scope
|
|
20
21
|
*/
|
|
21
22
|
openKv(scope?: KeyValueScope): KeyValue;
|
|
23
|
+
credentials(): Credentials;
|
|
22
24
|
}
|
|
23
25
|
export interface InternalContext<D, Index = void> extends Context<D> {
|
|
24
26
|
withData<D2>(data: D2): InternalContext<D2, Index>;
|
|
@@ -35,15 +37,19 @@ export declare class ContextImpl<D, Index = void> implements InternalContext<D,
|
|
|
35
37
|
executionId: string;
|
|
36
38
|
startTime: Date;
|
|
37
39
|
data: D;
|
|
40
|
+
private creds;
|
|
38
41
|
idx: Index;
|
|
39
42
|
readonly kvp: KeyValueProvider;
|
|
40
43
|
readonly options: ContextOptions;
|
|
41
|
-
constructor(log: Logger, kvp: KeyValueProvider, executionId: string, startTime: Date, data: D, options?: ContextOptions);
|
|
44
|
+
constructor(log: Logger, kvp: KeyValueProvider, creds: Credentials, executionId: string, startTime: Date, data: D, options?: ContextOptions);
|
|
42
45
|
get activation(): Activation | undefined;
|
|
43
46
|
setIndex(idx: number): InternalContext<D, number>;
|
|
44
47
|
withActivation(activation: Activation): InternalContext<D, Index>;
|
|
45
48
|
withData<D2>(data: D2): InternalContext<D2, Index>;
|
|
46
49
|
openKv(scope?: KeyValueScope): KeyValue;
|
|
50
|
+
credentials(): Credentials;
|
|
47
51
|
destroy(scope: KeyValueScope): Promise<void>;
|
|
52
|
+
[Symbol.toPrimitive](): Record<string, unknown>;
|
|
53
|
+
toJSON(): Record<string, unknown>;
|
|
48
54
|
}
|
|
49
55
|
//# sourceMappingURL=Context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/src/context/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;
|
|
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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,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAS/C,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAGpC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ContextImpl = void 0;
|
|
4
4
|
class ContextImpl {
|
|
5
|
-
constructor(log, kvp, executionId, startTime, data, options = {}) {
|
|
5
|
+
constructor(log, kvp, creds, executionId, startTime, data, options = {}) {
|
|
6
6
|
Object.defineProperty(this, "log", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
configurable: true,
|
|
@@ -27,6 +27,12 @@ class ContextImpl {
|
|
|
27
27
|
writable: true,
|
|
28
28
|
value: void 0
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(this, "creds", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: void 0
|
|
35
|
+
});
|
|
30
36
|
Object.defineProperty(this, "idx", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
configurable: true,
|
|
@@ -47,17 +53,23 @@ class ContextImpl {
|
|
|
47
53
|
});
|
|
48
54
|
this.log = log;
|
|
49
55
|
this.executionId = executionId;
|
|
56
|
+
this.creds = creds;
|
|
50
57
|
this.startTime = startTime;
|
|
51
58
|
this.data = data;
|
|
52
59
|
this.idx = void 0;
|
|
53
60
|
this.kvp = kvp;
|
|
54
61
|
this.options = options;
|
|
62
|
+
// all methods on ContextImpl which are exposed via the Context interface need to be bound
|
|
63
|
+
// so that destructuring the context object doesn't break the binding of the methods to the
|
|
64
|
+
// correct instance.
|
|
65
|
+
this.openKv = this.openKv.bind(this);
|
|
66
|
+
this.credentials = this.credentials.bind(this);
|
|
55
67
|
}
|
|
56
68
|
get activation() {
|
|
57
69
|
return this.options.activation;
|
|
58
70
|
}
|
|
59
71
|
setIndex(idx) {
|
|
60
|
-
const next = new ContextImpl(this.log, this.kvp, this.executionId, this.startTime, this.data, this.options);
|
|
72
|
+
const next = new ContextImpl(this.log, this.kvp, this.creds, this.executionId, this.startTime, this.data, this.options);
|
|
61
73
|
next.idx = idx;
|
|
62
74
|
return next;
|
|
63
75
|
}
|
|
@@ -66,13 +78,13 @@ class ContextImpl {
|
|
|
66
78
|
if (this.activation) {
|
|
67
79
|
throw new Error('Activation is already set');
|
|
68
80
|
}
|
|
69
|
-
return new ContextImpl(this.log, this.kvp, this.executionId, this.startTime, this.data, {
|
|
81
|
+
return new ContextImpl(this.log, this.kvp, this.creds, this.executionId, this.startTime, this.data, {
|
|
70
82
|
...this.options,
|
|
71
83
|
activation,
|
|
72
84
|
});
|
|
73
85
|
}
|
|
74
86
|
withData(data) {
|
|
75
|
-
return new ContextImpl(this.log, this.kvp, this.executionId, this.startTime, data, this.options);
|
|
87
|
+
return new ContextImpl(this.log, this.kvp, this.creds, this.executionId, this.startTime, data, this.options);
|
|
76
88
|
}
|
|
77
89
|
openKv(scope = ':project:') {
|
|
78
90
|
if (scope === ':execution:') {
|
|
@@ -87,6 +99,9 @@ class ContextImpl {
|
|
|
87
99
|
activationId: this.activation?.id,
|
|
88
100
|
});
|
|
89
101
|
}
|
|
102
|
+
credentials() {
|
|
103
|
+
return this.creds;
|
|
104
|
+
}
|
|
90
105
|
destroy(scope) {
|
|
91
106
|
if (scope === ':execution:') {
|
|
92
107
|
return this.kvp.destroy({
|
|
@@ -100,5 +115,16 @@ class ContextImpl {
|
|
|
100
115
|
activationId: this.activation?.id,
|
|
101
116
|
});
|
|
102
117
|
}
|
|
118
|
+
[Symbol.toPrimitive]() {
|
|
119
|
+
return {
|
|
120
|
+
startTime: this.startTime,
|
|
121
|
+
executionId: this.executionId,
|
|
122
|
+
activation: this.activation,
|
|
123
|
+
data: this.data,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
toJSON() {
|
|
127
|
+
return this[Symbol.toPrimitive]();
|
|
128
|
+
}
|
|
103
129
|
}
|
|
104
130
|
exports.ContextImpl = ContextImpl;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { KeyValueProvider } from '../kv/KeyValue.js';
|
|
2
2
|
import { Logger } from '../observability/logging/Logger.js';
|
|
3
3
|
import { Context, ContextOptions, InternalContext } from './Context.js';
|
|
4
|
+
import { Credentials } from '../dsl/http/versori/contextcredentials.js';
|
|
4
5
|
export interface ContextProvider {
|
|
5
6
|
create<D>(data: D, options?: ContextOptions): InternalContext<D, void>;
|
|
6
7
|
destroy(ctx: Context<any>): Promise<void>;
|
|
@@ -8,7 +9,8 @@ export interface ContextProvider {
|
|
|
8
9
|
export declare class ContextProviderImpl implements ContextProvider {
|
|
9
10
|
log: Logger;
|
|
10
11
|
kvp: KeyValueProvider;
|
|
11
|
-
|
|
12
|
+
creds: Credentials;
|
|
13
|
+
constructor(log: Logger, kvp: KeyValueProvider, creds: Credentials);
|
|
12
14
|
create<D>(data: D, options?: ContextOptions): InternalContext<D, void>;
|
|
13
15
|
destroy(ctx: Context<any>): Promise<void>;
|
|
14
16
|
}
|
|
@@ -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,cAAc,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;
|
|
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;AACrF,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAExE,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;IACtB,KAAK,EAAE,WAAW,CAAC;gBAEP,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW;IAMlE,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,GAAE,cAAmB,GAAG,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC;IAe1E,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAM5C"}
|
|
@@ -4,7 +4,7 @@ exports.ContextProviderImpl = void 0;
|
|
|
4
4
|
const mod_js_1 = require("../../deps/jsr.io/@std/ulid/1.0.0/mod.js");
|
|
5
5
|
const Context_js_1 = require("./Context.js");
|
|
6
6
|
class ContextProviderImpl {
|
|
7
|
-
constructor(log, kvp) {
|
|
7
|
+
constructor(log, kvp, creds) {
|
|
8
8
|
Object.defineProperty(this, "log", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
configurable: true,
|
|
@@ -17,8 +17,15 @@ class ContextProviderImpl {
|
|
|
17
17
|
writable: true,
|
|
18
18
|
value: void 0
|
|
19
19
|
});
|
|
20
|
+
Object.defineProperty(this, "creds", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
configurable: true,
|
|
23
|
+
writable: true,
|
|
24
|
+
value: void 0
|
|
25
|
+
});
|
|
20
26
|
this.log = log;
|
|
21
27
|
this.kvp = kvp;
|
|
28
|
+
this.creds = creds;
|
|
22
29
|
}
|
|
23
30
|
create(data, options = {}) {
|
|
24
31
|
const executionId = (0, mod_js_1.ulid)();
|
|
@@ -29,7 +36,7 @@ class ContextProviderImpl {
|
|
|
29
36
|
externalUserId: options.activation.user.externalId,
|
|
30
37
|
});
|
|
31
38
|
}
|
|
32
|
-
return new Context_js_1.ContextImpl(logger, this.kvp, executionId, new Date(), data, options);
|
|
39
|
+
return new Context_js_1.ContextImpl(logger, this.kvp, this.creds, executionId, new Date(), data, options);
|
|
33
40
|
}
|
|
34
41
|
destroy(ctx) {
|
|
35
42
|
return this.kvp.destroy({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DynamicFetcher, RoundTripperFactory } from './types.js';
|
|
2
|
+
import { Credentials } from './versori/contextcredentials.js';
|
|
2
3
|
/**
|
|
3
4
|
* A factory class for creating a default round tripper.
|
|
4
5
|
* This class is used to provide a default implementation for initializing
|
|
@@ -19,5 +20,6 @@ export declare class DefaultRoundTripperFactory implements RoundTripperFactory {
|
|
|
19
20
|
*/
|
|
20
21
|
create(connName: string, fn?: typeof fetch): Promise<typeof fetch>;
|
|
21
22
|
createDynamic(templateName: string, fn: typeof fetch): Promise<DynamicFetcher>;
|
|
23
|
+
credentials(): Credentials;
|
|
22
24
|
}
|
|
23
25
|
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D;;;;GAIG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IAClE;;OAEG;;IAGH;;;;;;;OAOG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAE,OAAO,KAAa,GAAG,OAAO,CAAC,OAAO,KAAK,CAAC;IAIzE,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC;IAMpF,WAAW,IAAI,WAAW;CAU7B"}
|
|
@@ -27,5 +27,15 @@ class DefaultRoundTripperFactory {
|
|
|
27
27
|
return fetch(input, init);
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
+
credentials() {
|
|
31
|
+
return {
|
|
32
|
+
getRaw: () => Promise.resolve(new ArrayBuffer(0)),
|
|
33
|
+
getAccessToken: () => Promise.resolve({
|
|
34
|
+
accessToken: '',
|
|
35
|
+
tokenType: '',
|
|
36
|
+
expiry: undefined,
|
|
37
|
+
}),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
30
40
|
}
|
|
31
41
|
exports.DefaultRoundTripperFactory = DefaultRoundTripperFactory;
|
|
@@ -10,6 +10,15 @@ export interface ConnectionProvider {
|
|
|
10
10
|
getActivationConnection(templateId: string, activationId: string): Promise<Connection | undefined>;
|
|
11
11
|
getActivation(activationId: string): Promise<Activation | undefined>;
|
|
12
12
|
listActivations(): Promise<Activation[]>;
|
|
13
|
+
updateDynamicVariable(activationId: string, name: string, value: unknown): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export type CronConfig = {
|
|
16
|
+
name: string;
|
|
17
|
+
schedule: string;
|
|
18
|
+
url: string;
|
|
19
|
+
};
|
|
20
|
+
export interface CronProvider {
|
|
21
|
+
updateCrons(crons: Map<string, string>): Promise<void>;
|
|
13
22
|
}
|
|
14
23
|
export type User = {
|
|
15
24
|
id: string;
|
|
@@ -19,10 +28,12 @@ export type User = {
|
|
|
19
28
|
externalId: string;
|
|
20
29
|
organisationId: string;
|
|
21
30
|
};
|
|
22
|
-
export
|
|
31
|
+
export interface Activation {
|
|
23
32
|
id: string;
|
|
24
33
|
user: User;
|
|
25
|
-
|
|
34
|
+
getVariable(name: string): unknown;
|
|
35
|
+
setVariable(name: string, value: unknown): Promise<void>;
|
|
36
|
+
}
|
|
26
37
|
export type AuthSchemeType = 'none' | 'api-key' | 'basic-auth' | 'oauth2' | 'hmac' | 'jwt-bearer' | 'custom-function' | 'certificate' | 'oauth1';
|
|
27
38
|
export type AuthSchemeConfig = {
|
|
28
39
|
type: AuthSchemeType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEzH,MAAM,WAAW,mBAAmB;IAChC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,KAAK,GAAG,OAAO,CAAC,OAAO,KAAK,GAAG,SAAS,CAAC,CAAC;IAC9E,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,KAAK,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;CAC9F;AAGD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,KAAK,CAIhG;AAED,MAAM,WAAW,kBAAkB;IAC/B,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IACpE,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAC1D,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,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;CACL,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Logger } from '../../../observability/logging/Logger.js';
|
|
2
|
+
import { Activation, ConnectionProvider, User } from '../types.js';
|
|
3
|
+
export declare class ActivationImpl implements Activation {
|
|
4
|
+
id: string;
|
|
5
|
+
user: User;
|
|
6
|
+
private variables?;
|
|
7
|
+
private connectionProvider;
|
|
8
|
+
private log;
|
|
9
|
+
constructor(id: string, user: User, connectionProvider: ConnectionProvider, log: Logger, variables: Record<string, unknown>);
|
|
10
|
+
getVariable(name: string): unknown;
|
|
11
|
+
setVariable(name: string, value: unknown): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=activation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activation.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/activation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnE,qBAAa,cAAe,YAAW,UAAU;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,IAAI,CAAC;IAElB,OAAO,CAAC,SAAS,CAAC,CAA0B;IAC5C,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,GAAG,CAAS;gBAGhB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,IAAI,EACV,kBAAkB,EAAE,kBAAkB,EACtC,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAWtC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAQ5B,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAkBjE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActivationImpl = void 0;
|
|
4
|
+
class ActivationImpl {
|
|
5
|
+
constructor(id, user, connectionProvider, log, variables) {
|
|
6
|
+
Object.defineProperty(this, "id", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: void 0
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(this, "user", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: void 0
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(this, "variables", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: void 0
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(this, "connectionProvider", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(this, "log", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: void 0
|
|
35
|
+
});
|
|
36
|
+
this.id = id;
|
|
37
|
+
this.user = user;
|
|
38
|
+
this.connectionProvider = connectionProvider;
|
|
39
|
+
this.variables = variables;
|
|
40
|
+
this.log = log.child({
|
|
41
|
+
activationId: id,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
getVariable(name) {
|
|
45
|
+
if (!this.variables) {
|
|
46
|
+
this.log.error(`No variables found for activation`);
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
return this.variables[name];
|
|
50
|
+
}
|
|
51
|
+
async setVariable(name, value) {
|
|
52
|
+
if (!this.variables) {
|
|
53
|
+
this.log.error(`No variables found for activation`);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
await this.connectionProvider.updateDynamicVariable(this.id, name, value);
|
|
58
|
+
}
|
|
59
|
+
catch (err) {
|
|
60
|
+
this.log.error(`Failed to set variable`, {
|
|
61
|
+
error: err,
|
|
62
|
+
variableName: name,
|
|
63
|
+
});
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this.variables[name] = value;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.ActivationImpl = ActivationImpl;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
export declare const envVarOrgId = "RUN_ORGANISATION_ID";
|
|
2
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";
|
|
3
6
|
export declare const envVarPlatformApiBaseURL = "RUN_PLATFORM_API_INTERNAL_URL";
|
|
7
|
+
export declare const envVarCronApiBaseURL = "RUN_CRON_API_INTERNAL_URL";
|
|
8
|
+
export declare const envVarSelfRefURL = "RUN_SELF_REF_URL";
|
|
4
9
|
export declare const envVarCredsBaseURL = "RUN_CREDENTIALS_SERVICE_INTERNAL_URL";
|
|
5
10
|
export declare const envVarConfigFile = "RUN_CONFIG_FILE";
|
|
6
11
|
export declare const envVarClientId = "RUN_CLIENT_ID";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/constants.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,wBAAwB,CAAC;AACjD,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAChD,eAAO,MAAM,wBAAwB,kCAAkC,CAAC;AACxE,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AAGzE,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"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/constants.ts"],"names":[],"mappings":"AACA,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,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,kBAAkB,yCAAyC,CAAC;AAGzE,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"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.envVarInternalToken = exports.envVarTokenEndpoint = exports.envVarClientSecret = exports.envVarClientId = exports.envVarConfigFile = exports.envVarCredsBaseURL = exports.envVarPlatformApiBaseURL = exports.envVarEnvId = exports.envVarOrgId = void 0;
|
|
3
|
+
exports.envVarInternalToken = exports.envVarTokenEndpoint = exports.envVarClientSecret = exports.envVarClientId = exports.envVarConfigFile = exports.envVarCredsBaseURL = exports.envVarSelfRefURL = exports.envVarCronApiBaseURL = exports.envVarPlatformApiBaseURL = exports.envVarOrgSlug = exports.envVarProjectId = exports.envVarEnvironmentName = exports.envVarEnvId = exports.envVarOrgId = void 0;
|
|
4
4
|
// This file contains constants used in the Versori DSL HTTP client.
|
|
5
5
|
exports.envVarOrgId = 'RUN_ORGANISATION_ID';
|
|
6
6
|
exports.envVarEnvId = 'RUN_ENVIRONMENT_ID';
|
|
7
|
+
exports.envVarEnvironmentName = 'RUN_ENVIRONMENT';
|
|
8
|
+
exports.envVarProjectId = 'RUN_SERVICE_ID';
|
|
9
|
+
exports.envVarOrgSlug = 'RUN_ORGANISATION_SLUG';
|
|
7
10
|
exports.envVarPlatformApiBaseURL = 'RUN_PLATFORM_API_INTERNAL_URL';
|
|
11
|
+
exports.envVarCronApiBaseURL = 'RUN_CRON_API_INTERNAL_URL';
|
|
12
|
+
exports.envVarSelfRefURL = 'RUN_SELF_REF_URL';
|
|
8
13
|
exports.envVarCredsBaseURL = 'RUN_CREDENTIALS_SERVICE_INTERNAL_URL';
|
|
9
14
|
// The following environment variables are used for the config file
|
|
10
15
|
exports.envVarConfigFile = 'RUN_CONFIG_FILE';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type Token = {
|
|
2
|
+
accessToken: string;
|
|
3
|
+
tokenType: string;
|
|
4
|
+
expiry?: Date;
|
|
5
|
+
};
|
|
6
|
+
export interface Credentials {
|
|
7
|
+
getRaw(name: string): Promise<ArrayBuffer>;
|
|
8
|
+
getAccessToken(name: string): Promise<Token>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=contextcredentials.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contextcredentials.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/contextcredentials.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,IAAI,CAAC;CACjB,CAAA;AAED,MAAM,WAAW,WAAW;IACxB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IAC3C,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAChD"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { GetAccessTokenResponse } from './oauth2/v1/token_service_pb.js';
|
|
2
1
|
import { GetTokenResponse } from './tokens/v1/token_service_pb.js';
|
|
2
|
+
import { GetCredentialResponse } from './v1alpha1/credential_service_pb.js';
|
|
3
3
|
export declare class VersoriCredentialClient {
|
|
4
|
-
private oauth2Client;
|
|
5
4
|
private TokenService;
|
|
5
|
+
private credentialsClient;
|
|
6
6
|
constructor(credsBaseUrl: string);
|
|
7
|
-
getToken(credId: string): Promise<GetTokenResponse>;
|
|
8
|
-
|
|
7
|
+
getToken(credId: string, forceRefresh?: boolean): Promise<GetTokenResponse>;
|
|
8
|
+
getRaw(credId: string): Promise<GetCredentialResponse>;
|
|
9
9
|
}
|
|
10
10
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/src/dsl/http/versori/credentials/client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/src/dsl/http/versori/credentials/client.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAGnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,qBAAa,uBAAuB;IAEhC,OAAO,CAAC,YAAY,CAAc;IAClC,OAAO,CAAC,iBAAiB,CAAoB;gBAEjC,YAAY,EAAE,MAAM;IAKhC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,GAAE,OAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAIlF,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAGzD"}
|
|
@@ -3,30 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VersoriCredentialClient = void 0;
|
|
4
4
|
const credentials_js_1 = require("./credentials.js");
|
|
5
5
|
class VersoriCredentialClient {
|
|
6
|
-
// private CredentialService: CredentialService;
|
|
7
|
-
// need to add custom function service
|
|
8
6
|
constructor(credsBaseUrl) {
|
|
9
|
-
Object.defineProperty(this, "
|
|
7
|
+
Object.defineProperty(this, "TokenService", {
|
|
10
8
|
enumerable: true,
|
|
11
9
|
configurable: true,
|
|
12
10
|
writable: true,
|
|
13
11
|
value: void 0
|
|
14
12
|
});
|
|
15
|
-
Object.defineProperty(this, "
|
|
13
|
+
Object.defineProperty(this, "credentialsClient", {
|
|
16
14
|
enumerable: true,
|
|
17
15
|
configurable: true,
|
|
18
16
|
writable: true,
|
|
19
17
|
value: void 0
|
|
20
18
|
});
|
|
21
|
-
this.oauth2Client = (0, credentials_js_1.createOAuth2TokenService)(credsBaseUrl);
|
|
22
19
|
this.TokenService = (0, credentials_js_1.createTokenClient)(credsBaseUrl);
|
|
23
|
-
|
|
20
|
+
this.credentialsClient = (0, credentials_js_1.createCredentialsClient)(credsBaseUrl);
|
|
24
21
|
}
|
|
25
|
-
getToken(credId) {
|
|
26
|
-
return this.TokenService.getToken({ credentialId: credId });
|
|
22
|
+
getToken(credId, forceRefresh = false) {
|
|
23
|
+
return this.TokenService.getToken({ credentialId: credId, forceRefresh });
|
|
27
24
|
}
|
|
28
|
-
|
|
29
|
-
return this.
|
|
25
|
+
getRaw(credId) {
|
|
26
|
+
return this.credentialsClient.get({ id: credId, showRedacted: true });
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
exports.VersoriCredentialClient = VersoriCredentialClient;
|