@versori/run 0.2.8 → 0.2.9
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/context/Context.d.ts +4 -4
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.d.ts +3 -3
- package/esm/src/context/ContextProvider.d.ts.map +1 -1
- package/esm/src/dsl/http/default.d.ts +4 -4
- package/esm/src/dsl/http/default.d.ts.map +1 -1
- package/esm/src/dsl/http/default.js +3 -3
- package/esm/src/dsl/http/types.d.ts +8 -2
- package/esm/src/dsl/http/types.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.d.ts +10 -1
- package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.js +37 -0
- package/esm/src/dsl/http/versori/constants.d.ts +1 -0
- package/esm/src/dsl/http/versori/constants.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/constants.js +2 -0
- package/esm/src/dsl/http/versori/contextcredentials.d.ts +0 -4
- package/esm/src/dsl/http/versori/contextcredentials.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/cronapi.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/cronapi.js +2 -2
- package/esm/src/dsl/http/versori/proxyroundtripper.d.ts +5 -7
- package/esm/src/dsl/http/versori/proxyroundtripper.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/proxyroundtripper.js +10 -24
- package/esm/src/dsl/http/versori/roundtripper.d.ts +5 -7
- package/esm/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/roundtripper.js +11 -24
- package/esm/src/dsl/http/versori/webhookmiddleware.d.ts +16 -0
- package/esm/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -0
- package/esm/src/dsl/http/versori/webhookmiddleware.js +197 -0
- package/esm/src/dsl/tasks/HttpTask.d.ts +3 -3
- 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 +1 -0
- package/esm/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +7 -4
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +70 -20
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts +4 -2
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/schedule.js +2 -2
- package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.js +38 -12
- package/esm/src/observability/logging/ConsoleLogger.d.ts +1 -0
- package/esm/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/esm/src/observability/logging/ConsoleLogger.js +7 -0
- package/esm/src/observability/logging/Logger.d.ts +2 -1
- package/esm/src/observability/logging/Logger.d.ts.map +1 -1
- package/package.json +1 -1
- package/script/src/context/Context.d.ts +4 -4
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/ContextProvider.d.ts +3 -3
- package/script/src/context/ContextProvider.d.ts.map +1 -1
- package/script/src/dsl/http/default.d.ts +4 -4
- package/script/src/dsl/http/default.d.ts.map +1 -1
- package/script/src/dsl/http/default.js +3 -3
- package/script/src/dsl/http/types.d.ts +8 -2
- package/script/src/dsl/http/types.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.d.ts +10 -1
- package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.js +39 -0
- package/script/src/dsl/http/versori/constants.d.ts +1 -0
- package/script/src/dsl/http/versori/constants.d.ts.map +1 -1
- package/script/src/dsl/http/versori/constants.js +3 -1
- package/script/src/dsl/http/versori/contextcredentials.d.ts +0 -4
- package/script/src/dsl/http/versori/contextcredentials.d.ts.map +1 -1
- package/script/src/dsl/http/versori/cronapi.d.ts.map +1 -1
- package/script/src/dsl/http/versori/cronapi.js +1 -1
- package/script/src/dsl/http/versori/proxyroundtripper.d.ts +5 -7
- package/script/src/dsl/http/versori/proxyroundtripper.d.ts.map +1 -1
- package/script/src/dsl/http/versori/proxyroundtripper.js +9 -23
- package/script/src/dsl/http/versori/roundtripper.d.ts +5 -7
- package/script/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/script/src/dsl/http/versori/roundtripper.js +10 -23
- package/script/src/dsl/http/versori/webhookmiddleware.d.ts +16 -0
- package/script/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -0
- package/script/src/dsl/http/versori/webhookmiddleware.js +202 -0
- package/script/src/dsl/tasks/HttpTask.d.ts +3 -3
- 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 +1 -0
- package/script/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +7 -4
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +70 -20
- package/script/src/interpreter/memory/ObservableCompiler.d.ts +4 -2
- package/script/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/schedule.js +2 -2
- package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/webhook.js +38 -12
- package/script/src/observability/logging/ConsoleLogger.d.ts +1 -0
- package/script/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/script/src/observability/logging/ConsoleLogger.js +7 -0
- package/script/src/observability/logging/Logger.d.ts +2 -1
- package/script/src/observability/logging/Logger.d.ts.map +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Activation } from '../dsl/http/types.js';
|
|
2
|
-
import {
|
|
2
|
+
import { CredentialsProvider } from '../dsl/http/versori/contextcredentials.js';
|
|
3
3
|
import { KeyValue, KeyValueProvider, KeyValueScope } from '../kv/KeyValue.js';
|
|
4
4
|
import { Logger } from '../observability/logging/Logger.js';
|
|
5
5
|
export type OnSuccessFn = (ctx: Context<any>) => void;
|
|
@@ -20,7 +20,7 @@ export interface Context<D> {
|
|
|
20
20
|
* @param scope
|
|
21
21
|
*/
|
|
22
22
|
openKv(scope?: KeyValueScope): KeyValue;
|
|
23
|
-
credentials():
|
|
23
|
+
credentials(): CredentialsProvider;
|
|
24
24
|
}
|
|
25
25
|
export declare class ContextImpl<D, Index = void> implements Context<D> {
|
|
26
26
|
#private;
|
|
@@ -31,13 +31,13 @@ export declare class ContextImpl<D, Index = void> implements Context<D> {
|
|
|
31
31
|
idx: Index;
|
|
32
32
|
readonly kvp: KeyValueProvider;
|
|
33
33
|
readonly options: ContextOptions;
|
|
34
|
-
constructor(log: Logger, kvp: KeyValueProvider, creds:
|
|
34
|
+
constructor(log: Logger, kvp: KeyValueProvider, creds: CredentialsProvider, executionId: string, startTime: Date, data: D, options?: ContextOptions);
|
|
35
35
|
get activation(): Activation | undefined;
|
|
36
36
|
setIndex(idx: number): ContextImpl<D, number>;
|
|
37
37
|
withActivation(activation: Activation): ContextImpl<D, Index>;
|
|
38
38
|
withData<D2>(data: D2): ContextImpl<D2, Index>;
|
|
39
39
|
openKv(scope?: KeyValueScope): KeyValue;
|
|
40
|
-
credentials():
|
|
40
|
+
credentials(): CredentialsProvider;
|
|
41
41
|
destroy(scope: KeyValueScope): Promise<void>;
|
|
42
42
|
[Symbol.toPrimitive](): Record<string, unknown>;
|
|
43
43
|
}
|
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src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AG,EAAE,KAAK,CAAC;IAEX,QAAQ,CAAC,GAAG,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;gBAI7B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE,mBAAmB,EAC1B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,IAAI,EACf,IAAI,EAAE,CAAC,EACP,OAAO,GAAE,cAAmB;IAmBhC,IAAI,UAAU,IAAI,UAAU,GAAG,SAAS,CAEvC;IAED,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,EAAE,MAAM,CAAC;IAe7C,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC;IAoB7D,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,WAAW,CAAC,EAAE,EAAE,KAAK,CAAC;IAY9C,MAAM,CAAC,KAAK,GAAE,aAA2B,GAAG,QAAQ;IAepD,WAAW,IAAI,mBAAmB;IAQlC,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5C,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAQlD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { KeyValueProvider } from '../kv/KeyValue.js';
|
|
2
2
|
import { Logger } from '../observability/logging/Logger.js';
|
|
3
3
|
import { Context, ContextImpl, ContextOptions } from './Context.js';
|
|
4
|
-
import {
|
|
4
|
+
import { CredentialsProvider } from '../dsl/http/versori/contextcredentials.js';
|
|
5
5
|
export interface ContextProvider {
|
|
6
6
|
create<D>(data: D, options?: ContextOptions): ContextImpl<D, void>;
|
|
7
7
|
destroy(ctx: Context<any>): Promise<void>;
|
|
@@ -9,8 +9,8 @@ export interface ContextProvider {
|
|
|
9
9
|
export declare class ContextProviderImpl implements ContextProvider {
|
|
10
10
|
log: Logger;
|
|
11
11
|
kvp: KeyValueProvider;
|
|
12
|
-
creds:
|
|
13
|
-
constructor(log: Logger, kvp: KeyValueProvider, creds:
|
|
12
|
+
creds: CredentialsProvider;
|
|
13
|
+
constructor(log: Logger, kvp: KeyValueProvider, creds: CredentialsProvider);
|
|
14
14
|
create<D>(data: D, options?: ContextOptions): ContextImpl<D>;
|
|
15
15
|
destroy(ctx: Context<any>): Promise<void>;
|
|
16
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,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,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,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAEhF,MAAM,WAAW,eAAe;IAC5B,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IACnE,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,mBAAmB,CAAC;gBAEf,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,mBAAmB;IAM1E,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,GAAE,cAAmB,GAAG,WAAW,CAAC,CAAC,CAAC;IAehE,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAM5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DynamicFetcher, RoundTripperFactory } from './types.js';
|
|
2
|
-
import {
|
|
2
|
+
import { CredentialsProvider } from './versori/contextcredentials.js';
|
|
3
3
|
/**
|
|
4
4
|
* A factory class for creating a default round tripper.
|
|
5
5
|
* This class is used to provide a default implementation for initializing
|
|
@@ -18,8 +18,8 @@ export declare class DefaultRoundTripperFactory implements RoundTripperFactory {
|
|
|
18
18
|
* @param fn - The fetch function to be used. Defaults to the global fetch function.
|
|
19
19
|
* @returns A promise that resolves to the fetch function.
|
|
20
20
|
*/
|
|
21
|
-
create(
|
|
22
|
-
createDynamic(
|
|
23
|
-
credentials():
|
|
21
|
+
create(_connName: string): Promise<typeof fetch>;
|
|
22
|
+
createDynamic(_templateName: string): Promise<DynamicFetcher>;
|
|
23
|
+
credentials(): CredentialsProvider;
|
|
24
24
|
}
|
|
25
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;AAC7E,OAAO,EAAE,
|
|
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,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE;;;;GAIG;AACH,qBAAa,0BAA2B,YAAW,mBAAmB;IAClE;;OAEG;;IAIH;;;;;;;OAOG;IACG,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,KAAK,CAAC;IAIhD,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAMnE,WAAW,IAAI,mBAAmB;CAUrC"}
|
|
@@ -17,11 +17,11 @@ export class DefaultRoundTripperFactory {
|
|
|
17
17
|
* @param fn - The fetch function to be used. Defaults to the global fetch function.
|
|
18
18
|
* @returns A promise that resolves to the fetch function.
|
|
19
19
|
*/
|
|
20
|
-
async create(
|
|
20
|
+
async create(_connName) {
|
|
21
21
|
return globalThis.fetch;
|
|
22
22
|
}
|
|
23
|
-
async createDynamic(
|
|
24
|
-
return async (
|
|
23
|
+
async createDynamic(_templateName) {
|
|
24
|
+
return async (_activation, input, init) => {
|
|
25
25
|
return globalThis.fetch(input, init);
|
|
26
26
|
};
|
|
27
27
|
}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CredentialsProvider } from './versori/contextcredentials.js';
|
|
2
2
|
export type DynamicFetcher = (activation: Activation, input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
3
3
|
export interface RoundTripperFactory {
|
|
4
4
|
create(connName: string): Promise<typeof fetch | undefined>;
|
|
5
5
|
createDynamic(templateName: string): Promise<DynamicFetcher | undefined>;
|
|
6
|
-
credentials():
|
|
6
|
+
credentials(): CredentialsProvider;
|
|
7
7
|
}
|
|
8
8
|
export declare function wrapDynamicFetcher(fetcher: DynamicFetcher, activation: Activation): typeof fetch;
|
|
9
|
+
export interface ConfigReader {
|
|
10
|
+
getCnxMapping(name: string): CnxMap | undefined;
|
|
11
|
+
getConnectionID(connName: string): string;
|
|
12
|
+
getTemplateID(templateName: string): string;
|
|
13
|
+
}
|
|
9
14
|
export interface ConnectionProvider {
|
|
10
15
|
getStaticConnection(cnxId: string): Promise<Connection | undefined>;
|
|
11
16
|
getUserActivations(userId: string): Promise<Activation[]>;
|
|
@@ -105,6 +110,7 @@ export type AuthSchemeConfigHMAC = AuthSchemeConfigBase & {
|
|
|
105
110
|
in: 'query' | 'header' | 'cookie';
|
|
106
111
|
algorithm: 'sha1' | 'sha256' | 'sha512';
|
|
107
112
|
digestInputs: DigestInput[];
|
|
113
|
+
encoding: 'hex' | 'base64' | 'base64url';
|
|
108
114
|
};
|
|
109
115
|
type ParameterConfig = {
|
|
110
116
|
parameterName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAEtE,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,GAAG,OAAO,CAAC,OAAO,KAAK,GAAG,SAAS,CAAC,CAAC;IAC5D,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;IACzE,WAAW,IAAI,mBAAmB,CAAC;CACtC;AAGD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,GAAG,OAAO,KAAK,CAIhG;AAED,MAAM,WAAW,YAAY;IACzB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;IACX,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAC/B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,UAAU,EAAE,UAAU,CAAC;IACvB,EAAE,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,oBAAoB,EAAE,CAAC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE;QACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC;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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Logger } from '../../../observability/mod.js';
|
|
2
|
+
import { CnxMap, ConfigReader, VersoriSDKConfig } from '../types.js';
|
|
2
3
|
/**
|
|
3
4
|
* Loads the Versori SDK configuration from a JSON file.
|
|
4
5
|
*
|
|
@@ -9,4 +10,12 @@ import { VersoriSDKConfig } from '../types.js';
|
|
|
9
10
|
* @returns {VersoriSDKConfig} The parsed configuration object.
|
|
10
11
|
*/
|
|
11
12
|
export declare function LoadConfigFromFile(): VersoriSDKConfig;
|
|
13
|
+
export declare class VersoriConfigReader implements ConfigReader {
|
|
14
|
+
private versoriCfg;
|
|
15
|
+
constructor(cfg: VersoriSDKConfig);
|
|
16
|
+
static fromEnv(log: Logger): VersoriConfigReader;
|
|
17
|
+
getCnxMapping(name: string): CnxMap | undefined;
|
|
18
|
+
getConnectionID(connName: string): string;
|
|
19
|
+
getTemplateID(templateName: string): string;
|
|
20
|
+
}
|
|
12
21
|
//# sourceMappingURL=configloader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
1
|
+
{"version":3,"file":"configloader.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/configloader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAIrE;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CAUrD;AAED,qBAAa,mBAAoB,YAAW,YAAY;IACpD,OAAO,CAAC,UAAU,CAAmB;gBAEzB,GAAG,EAAE,gBAAgB;IAIjC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,mBAAmB;IAShD,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAI/C,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAczC,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM;CAW9C"}
|
|
@@ -17,3 +17,40 @@ export function LoadConfigFromFile() {
|
|
|
17
17
|
const cfg = JSON.parse(Deno.readTextFileSync(configFileName));
|
|
18
18
|
return cfg;
|
|
19
19
|
}
|
|
20
|
+
export class VersoriConfigReader {
|
|
21
|
+
constructor(cfg) {
|
|
22
|
+
Object.defineProperty(this, "versoriCfg", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
writable: true,
|
|
26
|
+
value: void 0
|
|
27
|
+
});
|
|
28
|
+
this.versoriCfg = cfg;
|
|
29
|
+
}
|
|
30
|
+
static fromEnv(log) {
|
|
31
|
+
const versoriCfg = LoadConfigFromFile();
|
|
32
|
+
if (!versoriCfg) {
|
|
33
|
+
log.error('Failed to load Versori SDK configuration');
|
|
34
|
+
throw new Error('Failed to load Versori SDK configuration');
|
|
35
|
+
}
|
|
36
|
+
return new VersoriConfigReader(versoriCfg);
|
|
37
|
+
}
|
|
38
|
+
getCnxMapping(name) {
|
|
39
|
+
return this.versoriCfg.mappings.find((c) => c.name.toLowerCase() === name.toLowerCase());
|
|
40
|
+
}
|
|
41
|
+
getConnectionID(connName) {
|
|
42
|
+
const conn = this.versoriCfg.mappings.find((c) => (c.dynamic === undefined || c.dynamic === false) &&
|
|
43
|
+
c.name.toLowerCase() === connName.toLowerCase());
|
|
44
|
+
if (!conn || !conn.connId) {
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
return conn.connId;
|
|
48
|
+
}
|
|
49
|
+
getTemplateID(templateName) {
|
|
50
|
+
const template = this.versoriCfg.mappings.find((c) => c.dynamic && c.name.toLowerCase() === templateName.toLowerCase());
|
|
51
|
+
if (!template || !template.templateId) {
|
|
52
|
+
return '';
|
|
53
|
+
}
|
|
54
|
+
return template.templateId;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -15,4 +15,5 @@ export declare const envVarClientSecret = "RUN_CLIENT_SECRET";
|
|
|
15
15
|
export declare const envVarTokenEndpoint = "RUN_TOKEN_ENDPOINT";
|
|
16
16
|
export declare const envVarInternalToken = "RUN_INTERNAL_TOKEN";
|
|
17
17
|
export declare const envVarLocalRun = "RUN_LOCAL";
|
|
18
|
+
export declare const cronPort = 3001;
|
|
18
19
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -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,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;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"}
|
|
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;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;AAI1C,eAAO,MAAM,QAAQ,OAAO,CAAC"}
|
|
@@ -19,3 +19,5 @@ export const envVarTokenEndpoint = 'RUN_TOKEN_ENDPOINT';
|
|
|
19
19
|
export const envVarInternalToken = 'RUN_INTERNAL_TOKEN';
|
|
20
20
|
// The following are for running locally
|
|
21
21
|
export const envVarLocalRun = 'RUN_LOCAL';
|
|
22
|
+
// please no changerino
|
|
23
|
+
export const cronPort = 3001; // The port on which the cron API communicates with the service
|
|
@@ -3,10 +3,6 @@ export type Token = {
|
|
|
3
3
|
tokenType: string;
|
|
4
4
|
expiry?: Date;
|
|
5
5
|
};
|
|
6
|
-
export interface Credentials {
|
|
7
|
-
getRaw(name: string): Promise<Uint8Array>;
|
|
8
|
-
getAccessToken(name: string, forceRefresh?: boolean): Promise<Token>;
|
|
9
|
-
}
|
|
10
6
|
export interface CredentialsProvider {
|
|
11
7
|
getRaw(name: string, activationId?: string): Promise<Uint8Array>;
|
|
12
8
|
getAccessToken(name: string, forceRefresh?: boolean, activationId?: string): Promise<Token>;
|
|
@@ -1 +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,CAAC;AAEF,MAAM,WAAW,
|
|
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,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAChC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEjE,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CAC/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cronapi.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/cronapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"cronapi.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/cronapi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAY3C,KAAK,IAAI,GAAG;IACR,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,qBAAa,aAAc,YAAW,YAAY;IAC9C,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAU;gBAEd,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;IAOlE,MAAM,CAAC,OAAO,IAAI,aAAa;IAmBzB,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB5D,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE;CAoB3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { envVarEnvId, envVarCronApiBaseURL, envVarProjectId, envVarOrgSlug, envVarEnvironmentName, envVarSelfRefURL, envVarLocalRun, } from './constants.js';
|
|
1
|
+
import { envVarEnvId, envVarCronApiBaseURL, envVarProjectId, envVarOrgSlug, envVarEnvironmentName, envVarSelfRefURL, cronPort, envVarLocalRun, } from './constants.js';
|
|
2
2
|
export class CronAPIClient {
|
|
3
3
|
constructor(baseUrl, envId, integrationUrl) {
|
|
4
4
|
Object.defineProperty(this, "baseUrl", {
|
|
@@ -40,7 +40,7 @@ export class CronAPIClient {
|
|
|
40
40
|
throw new Error('Missing required environment variables');
|
|
41
41
|
}
|
|
42
42
|
const integrationUrl = Deno.env.get(envVarSelfRefURL) ||
|
|
43
|
-
`http://svc-${projectId.toLowerCase()}-${envName.toLowerCase()}.sb-${orgSlug.toLowerCase()}.svc.cluster.local`;
|
|
43
|
+
`http://svc-${projectId.toLowerCase()}-${envName.toLowerCase()}.sb-${orgSlug.toLowerCase()}.svc.cluster.local:${cronPort}`;
|
|
44
44
|
return new CronAPIClient(baseUrl, envId, integrationUrl);
|
|
45
45
|
}
|
|
46
46
|
async updateCrons(crons) {
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import { DynamicFetcher, RoundTripperFactory } from '../types.js';
|
|
1
|
+
import { ConfigReader, DynamicFetcher, RoundTripperFactory } from '../types.js';
|
|
2
2
|
import { PlatformAPIClient } from './platformapi.js';
|
|
3
3
|
import { Logger } from '../../../observability/mod.js';
|
|
4
|
-
import {
|
|
4
|
+
import { CredentialsProvider } from './contextcredentials.js';
|
|
5
5
|
export declare class ProxyRoundTripper implements RoundTripperFactory {
|
|
6
6
|
private platformApiBaseUrl;
|
|
7
|
-
private
|
|
7
|
+
private cfgReader;
|
|
8
8
|
private platformApiClient;
|
|
9
9
|
private internalAuth;
|
|
10
10
|
private log;
|
|
11
|
-
constructor(log: Logger, platformApiBaseUrl: string, platformApiClient: PlatformAPIClient);
|
|
11
|
+
constructor(log: Logger, platformApiBaseUrl: string, platformApiClient: PlatformAPIClient, cfgReader: ConfigReader);
|
|
12
12
|
static fromEnv(log: Logger): ProxyRoundTripper;
|
|
13
|
-
private getConnectionID;
|
|
14
|
-
private getTemplateID;
|
|
15
13
|
private makeProxyUrlString;
|
|
16
14
|
private makeProxyInput;
|
|
17
15
|
private makeProxyInit;
|
|
18
16
|
create(connName: string): Promise<typeof fetch | undefined>;
|
|
19
17
|
createDynamic(templateName: string): Promise<DynamicFetcher | undefined>;
|
|
20
|
-
credentials():
|
|
18
|
+
credentials(): CredentialsProvider;
|
|
21
19
|
}
|
|
22
20
|
//# sourceMappingURL=proxyroundtripper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxyroundtripper.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/proxyroundtripper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,cAAc,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"proxyroundtripper.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/proxyroundtripper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE5F,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAGvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAK9D,qBAAa,iBAAkB,YAAW,mBAAmB;IACzD,OAAO,CAAC,kBAAkB,CAAS;IAEnC,OAAO,CAAC,SAAS,CAAe;IAEhC,OAAO,CAAC,iBAAiB,CAAoB;IAE7C,OAAO,CAAC,YAAY,CAAe;IAEnC,OAAO,CAAC,GAAG,CAAS;gBAGhB,GAAG,EAAE,MAAM,EACX,kBAAkB,EAAE,MAAM,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,SAAS,EAAE,YAAY;IAS3B,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB;IA0B9C,OAAO,CAAC,kBAAkB;IAY1B,OAAO,CAAC,cAAc;YA6BR,aAAa;IA4B3B,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,KAAK,GAAG,SAAS,CAAC;IAoB3D,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAqCxE,WAAW,IAAI,mBAAmB;CAcrC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VersoriConfigReader } from './configloader.js';
|
|
2
2
|
import { PlatformAPIClient } from './platformapi.js';
|
|
3
3
|
import { envVarEnvId, envVarOrgId, envVarPlatformApiBaseURL } from './constants.js';
|
|
4
4
|
import { isValidURL } from './helpers.js';
|
|
@@ -6,14 +6,14 @@ import { InternalAuth } from './internalauth.js';
|
|
|
6
6
|
// ProxyRoundTripper is a factory for creating roundtrippers that use the Versori Platform API proxy endpoints.
|
|
7
7
|
// this should allow code from the platform to be run locally.
|
|
8
8
|
export class ProxyRoundTripper {
|
|
9
|
-
constructor(log, platformApiBaseUrl, platformApiClient) {
|
|
9
|
+
constructor(log, platformApiBaseUrl, platformApiClient, cfgReader) {
|
|
10
10
|
Object.defineProperty(this, "platformApiBaseUrl", {
|
|
11
11
|
enumerable: true,
|
|
12
12
|
configurable: true,
|
|
13
13
|
writable: true,
|
|
14
14
|
value: void 0
|
|
15
15
|
});
|
|
16
|
-
Object.defineProperty(this, "
|
|
16
|
+
Object.defineProperty(this, "cfgReader", {
|
|
17
17
|
enumerable: true,
|
|
18
18
|
configurable: true,
|
|
19
19
|
writable: true,
|
|
@@ -37,7 +37,7 @@ export class ProxyRoundTripper {
|
|
|
37
37
|
writable: true,
|
|
38
38
|
value: void 0
|
|
39
39
|
});
|
|
40
|
-
this.
|
|
40
|
+
this.cfgReader = cfgReader;
|
|
41
41
|
this.log = log;
|
|
42
42
|
this.platformApiBaseUrl = platformApiBaseUrl;
|
|
43
43
|
this.platformApiClient = platformApiClient;
|
|
@@ -47,6 +47,7 @@ export class ProxyRoundTripper {
|
|
|
47
47
|
const baseUrl = Deno.env.get(envVarPlatformApiBaseURL);
|
|
48
48
|
const orgId = Deno.env.get(envVarOrgId);
|
|
49
49
|
const envId = Deno.env.get(envVarEnvId);
|
|
50
|
+
const cfgReader = VersoriConfigReader.fromEnv(log);
|
|
50
51
|
if (!baseUrl || !orgId || !envId) {
|
|
51
52
|
const missingVars = [];
|
|
52
53
|
if (!baseUrl)
|
|
@@ -58,22 +59,7 @@ export class ProxyRoundTripper {
|
|
|
58
59
|
log.error(`Missing required environment variables: ${missingVars.join(', ')}`);
|
|
59
60
|
throw new Error('Missing required environment variables: ' + missingVars.join(', '));
|
|
60
61
|
}
|
|
61
|
-
return new ProxyRoundTripper(log, baseUrl, new PlatformAPIClient(baseUrl, orgId, envId, log));
|
|
62
|
-
}
|
|
63
|
-
getConnectionID(connName) {
|
|
64
|
-
const conn = this.versoriCfg.mappings.find((c) => (c.dynamic === undefined || c.dynamic === false) &&
|
|
65
|
-
c.name.toLowerCase() === connName.toLowerCase());
|
|
66
|
-
if (!conn || !conn.connId) {
|
|
67
|
-
return '';
|
|
68
|
-
}
|
|
69
|
-
return conn.connId;
|
|
70
|
-
}
|
|
71
|
-
getTemplateID(templateName) {
|
|
72
|
-
const template = this.versoriCfg.mappings.find((c) => c.dynamic && c.name.toLowerCase() === templateName.toLowerCase());
|
|
73
|
-
if (!template || !template.templateId) {
|
|
74
|
-
return '';
|
|
75
|
-
}
|
|
76
|
-
return template.templateId;
|
|
62
|
+
return new ProxyRoundTripper(log, baseUrl, new PlatformAPIClient(baseUrl, orgId, envId, log), cfgReader);
|
|
77
63
|
}
|
|
78
64
|
makeProxyUrlString(url, cnxId) {
|
|
79
65
|
if (isValidURL(url)) {
|
|
@@ -134,7 +120,7 @@ export class ProxyRoundTripper {
|
|
|
134
120
|
return init;
|
|
135
121
|
}
|
|
136
122
|
create(connName) {
|
|
137
|
-
const cnxId = this.getConnectionID(connName);
|
|
123
|
+
const cnxId = this.cfgReader.getConnectionID(connName);
|
|
138
124
|
if (!cnxId) {
|
|
139
125
|
this.log.error(`Connection ${connName} not found in configuration`);
|
|
140
126
|
return Promise.resolve(undefined);
|
|
@@ -148,7 +134,7 @@ export class ProxyRoundTripper {
|
|
|
148
134
|
return Promise.resolve(_fn);
|
|
149
135
|
}
|
|
150
136
|
createDynamic(templateName) {
|
|
151
|
-
const template = this.getTemplateID(templateName);
|
|
137
|
+
const template = this.cfgReader.getTemplateID(templateName);
|
|
152
138
|
if (!template) {
|
|
153
139
|
this.log.error(`Template ${templateName} not found in configuration, could be a static connection`);
|
|
154
140
|
return Promise.resolve(undefined);
|
|
@@ -168,10 +154,10 @@ export class ProxyRoundTripper {
|
|
|
168
154
|
}
|
|
169
155
|
credentials() {
|
|
170
156
|
return {
|
|
171
|
-
getRaw: (_name) => {
|
|
157
|
+
getRaw: (_name, _actId) => {
|
|
172
158
|
return Promise.reject(new Error('Not implemented, getRaw is not supported in proxy mode'));
|
|
173
159
|
},
|
|
174
|
-
getAccessToken: (_name, _forceRefresh) => {
|
|
160
|
+
getAccessToken: (_name, _forceRefresh, _actId) => {
|
|
175
161
|
return Promise.reject(new Error('Not implemented, getAccessToken is not supported in proxy mode'));
|
|
176
162
|
},
|
|
177
163
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tracer } from '@opentelemetry/api';
|
|
2
2
|
import { Logger } from '../../../observability/logging/Logger.js';
|
|
3
|
-
import { DynamicFetcher, RoundTripperFactory } from '../types.js';
|
|
4
|
-
import {
|
|
3
|
+
import { ConfigReader, DynamicFetcher, RoundTripperFactory } from '../types.js';
|
|
4
|
+
import { CredentialsProvider, Token } from './contextcredentials.js';
|
|
5
5
|
import { VersoriCredentialClient } from './credentials/mod.js';
|
|
6
6
|
import { PlatformAPIClient } from './platformapi.js';
|
|
7
7
|
/**
|
|
@@ -19,23 +19,21 @@ export declare class VersoriCredentialsFactory implements RoundTripperFactory {
|
|
|
19
19
|
private tokenClient;
|
|
20
20
|
private credsBaseURL;
|
|
21
21
|
private platformAPIClient;
|
|
22
|
-
private
|
|
22
|
+
private cfgReader;
|
|
23
23
|
private log;
|
|
24
24
|
private tracer;
|
|
25
25
|
private readonly defaultDynamic;
|
|
26
|
-
constructor(credsClient: VersoriCredentialClient, credsBaseURL: string, platformAPIClient: PlatformAPIClient, logger: Logger, tracer: Tracer);
|
|
26
|
+
constructor(credsClient: VersoriCredentialClient, credsBaseURL: string, platformAPIClient: PlatformAPIClient, logger: Logger, tracer: Tracer, cfgReader: ConfigReader);
|
|
27
27
|
static fromEnv(logger: Logger, tracer: Tracer): VersoriCredentialsFactory;
|
|
28
28
|
private changeRequestInit;
|
|
29
29
|
private changeBaseUrl;
|
|
30
30
|
create(connName: string): Promise<typeof fetch | undefined>;
|
|
31
31
|
createDynamic(templateName: string): Promise<DynamicFetcher | undefined>;
|
|
32
32
|
private traceFetch;
|
|
33
|
-
credentials():
|
|
33
|
+
credentials(): CredentialsProvider;
|
|
34
34
|
getTokenByName(name: string, forceRefresh?: boolean, activationId?: string): Promise<Token>;
|
|
35
35
|
getRawByName(name: string, activationId?: string): Promise<Uint8Array>;
|
|
36
36
|
private getCredentialIDFromName;
|
|
37
|
-
private getConnectionID;
|
|
38
|
-
private getTemplateID;
|
|
39
37
|
private apiKeyFetcher;
|
|
40
38
|
private basicAuthFetcher;
|
|
41
39
|
private bearerTokenFetcher;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roundtripper.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/roundtripper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAElE,OAAO,
|
|
1
|
+
{"version":3,"file":"roundtripper.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/roundtripper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AAElE,OAAO,EAEH,YAAY,EAEZ,cAAc,EACd,mBAAmB,EACtB,MAAM,aAAa,CAAC;AAQrB,OAAO,EAAE,mBAAmB,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAGrD;;;;;;;;;;GAUG;AACH,qBAAa,yBAA0B,YAAW,mBAAmB;IACjE,OAAO,CAAC,WAAW,CAA0B;IAC7C,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,iBAAiB,CAAoB;IAE7C,OAAO,CAAC,SAAS,CAAe;IAEhC,OAAO,CAAC,GAAG,CAAS;IAEpB,OAAO,CAAC,MAAM,CAAS;IAEvB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAK7B;gBAGE,WAAW,EAAE,uBAAuB,EACpC,YAAY,EAAE,MAAM,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY;IAe3B,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,yBAAyB;IAoCzE,OAAO,CAAC,iBAAiB;IAezB,OAAO,CAAC,aAAa;IAwBrB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,KAAK,GAAG,SAAS,CAAC;IAqC3D,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;IAgDxE,OAAO,CAAC,UAAU;IAqClB,WAAW,IAAI,mBAAmB;IAO5B,cAAc,CAChB,IAAI,EAAE,MAAM,EACZ,YAAY,UAAQ,EACpB,YAAY,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,KAAK,CAAC;IAiBX,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;YAqB9D,uBAAuB;IAoDrC,OAAO,CAAC,aAAa;YAoDP,gBAAgB;YAmChB,kBAAkB;YAiClB,aAAa;YAwEb,QAAQ;CA0BzB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Code, ConnectError } from '@connectrpc/connect';
|
|
2
2
|
import { ConsoleLogger } from '../../../observability/mod.js';
|
|
3
|
-
import {
|
|
3
|
+
import { VersoriConfigReader } from './configloader.js';
|
|
4
4
|
import { envVarCredsBaseURL, envVarEnvId, envVarOrgId, envVarPlatformApiBaseURL, } from './constants.js';
|
|
5
5
|
import { VersoriCredentialClient } from './credentials/mod.js';
|
|
6
6
|
import { PlatformAPIClient } from './platformapi.js';
|
|
@@ -17,7 +17,7 @@ import { isValidURL } from './helpers.js';
|
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
19
|
export class VersoriCredentialsFactory {
|
|
20
|
-
constructor(credsClient, credsBaseURL, platformAPIClient, logger, tracer) {
|
|
20
|
+
constructor(credsClient, credsBaseURL, platformAPIClient, logger, tracer, cfgReader) {
|
|
21
21
|
Object.defineProperty(this, "tokenClient", {
|
|
22
22
|
enumerable: true,
|
|
23
23
|
configurable: true,
|
|
@@ -36,7 +36,7 @@ export class VersoriCredentialsFactory {
|
|
|
36
36
|
writable: true,
|
|
37
37
|
value: void 0
|
|
38
38
|
});
|
|
39
|
-
Object.defineProperty(this, "
|
|
39
|
+
Object.defineProperty(this, "cfgReader", {
|
|
40
40
|
enumerable: true,
|
|
41
41
|
configurable: true,
|
|
42
42
|
writable: true,
|
|
@@ -68,7 +68,7 @@ export class VersoriCredentialsFactory {
|
|
|
68
68
|
this.tokenClient = credsClient;
|
|
69
69
|
this.credsBaseURL = credsBaseURL;
|
|
70
70
|
this.platformAPIClient = platformAPIClient;
|
|
71
|
-
this.
|
|
71
|
+
this.cfgReader = cfgReader;
|
|
72
72
|
this.log = logger;
|
|
73
73
|
this.tracer = tracer;
|
|
74
74
|
// lost 15 minutes because of this one
|
|
@@ -80,6 +80,7 @@ export class VersoriCredentialsFactory {
|
|
|
80
80
|
const platformApiBaseURL = Deno.env.get(envVarPlatformApiBaseURL);
|
|
81
81
|
const orgId = Deno.env.get(envVarOrgId);
|
|
82
82
|
const envId = Deno.env.get(envVarEnvId);
|
|
83
|
+
const cfgReader = VersoriConfigReader.fromEnv(logger);
|
|
83
84
|
if (!orgId || !envId || !platformApiBaseURL || !credsBaseURL) {
|
|
84
85
|
const missingVars = [];
|
|
85
86
|
if (!orgId)
|
|
@@ -95,7 +96,7 @@ export class VersoriCredentialsFactory {
|
|
|
95
96
|
const log = logger || new ConsoleLogger('debug');
|
|
96
97
|
const pAPIClient = new PlatformAPIClient(platformApiBaseURL, orgId, envId, log);
|
|
97
98
|
const tokenClient = new VersoriCredentialClient(credsBaseURL);
|
|
98
|
-
return new VersoriCredentialsFactory(tokenClient, credsBaseURL, pAPIClient, log, tracer);
|
|
99
|
+
return new VersoriCredentialsFactory(tokenClient, credsBaseURL, pAPIClient, log, tracer, cfgReader);
|
|
99
100
|
}
|
|
100
101
|
// takes the info and modifies the url using changeBaseUrl if necessary
|
|
101
102
|
// if a full valid URL is passed as a string, it will be returned as is
|
|
@@ -134,7 +135,7 @@ export class VersoriCredentialsFactory {
|
|
|
134
135
|
return newURL.toString();
|
|
135
136
|
}
|
|
136
137
|
create(connName) {
|
|
137
|
-
const cnxId = this.getConnectionID(connName);
|
|
138
|
+
const cnxId = this.cfgReader.getConnectionID(connName);
|
|
138
139
|
if (!cnxId) {
|
|
139
140
|
this.log.debug('Connection not found in config, could be a dynamic connection', {
|
|
140
141
|
connectionName: connName,
|
|
@@ -166,7 +167,7 @@ export class VersoriCredentialsFactory {
|
|
|
166
167
|
return Promise.resolve(_fn);
|
|
167
168
|
}
|
|
168
169
|
createDynamic(templateName) {
|
|
169
|
-
const template = this.getTemplateID(templateName);
|
|
170
|
+
const template = this.cfgReader.getTemplateID(templateName);
|
|
170
171
|
if (!template) {
|
|
171
172
|
this.log.debug('Template not found in config, could be a static connection', {
|
|
172
173
|
templateName: templateName,
|
|
@@ -262,7 +263,7 @@ export class VersoriCredentialsFactory {
|
|
|
262
263
|
}
|
|
263
264
|
async getCredentialIDFromName(name, activationId) {
|
|
264
265
|
// fin connection config from versori file
|
|
265
|
-
const conn = this.
|
|
266
|
+
const conn = this.cfgReader.getCnxMapping(name);
|
|
266
267
|
if (!conn) {
|
|
267
268
|
return '';
|
|
268
269
|
}
|
|
@@ -293,21 +294,6 @@ export class VersoriCredentialsFactory {
|
|
|
293
294
|
}
|
|
294
295
|
return staticConn.credentials[0].credential.id;
|
|
295
296
|
}
|
|
296
|
-
getConnectionID(connName) {
|
|
297
|
-
const conn = this.versoriCfg.mappings.find((c) => (c.dynamic === undefined || c.dynamic === false) &&
|
|
298
|
-
c.name.toLowerCase() === connName.toLowerCase());
|
|
299
|
-
if (!conn || !conn.connId) {
|
|
300
|
-
return '';
|
|
301
|
-
}
|
|
302
|
-
return conn.connId;
|
|
303
|
-
}
|
|
304
|
-
getTemplateID(templateName) {
|
|
305
|
-
const template = this.versoriCfg.mappings.find((c) => c.dynamic && c.name.toLowerCase() === templateName.toLowerCase());
|
|
306
|
-
if (!template || !template.templateId) {
|
|
307
|
-
return '';
|
|
308
|
-
}
|
|
309
|
-
return template.templateId;
|
|
310
|
-
}
|
|
311
297
|
apiKeyFetcher(conn, fn) {
|
|
312
298
|
const _fn = async (input, init) => {
|
|
313
299
|
const tokenResponse = await this.getToken(conn.credentials[0].credential.id);
|
|
@@ -477,7 +463,8 @@ export class VersoriCredentialsFactory {
|
|
|
477
463
|
catch (error) {
|
|
478
464
|
this.log.error('unable to get credential', { error });
|
|
479
465
|
if (error instanceof ConnectError) {
|
|
480
|
-
if (error.rawMessage.includes('connection error received: not a result of an error') &&
|
|
466
|
+
if (error.rawMessage.includes('connection error received: not a result of an error') &&
|
|
467
|
+
error.code === Code.Internal) {
|
|
481
468
|
this.log.info('Connection error received, attempting to reconnect');
|
|
482
469
|
this.tokenClient = new VersoriCredentialClient(this.credsBaseURL);
|
|
483
470
|
return await this.tokenClient.getToken(id);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NextFunction, Response, Request } from 'express';
|
|
2
|
+
import { CredentialsProvider } from './contextcredentials.js';
|
|
3
|
+
import { ConfigReader, ConnectionProvider } from '../types.js';
|
|
4
|
+
import { Logger } from '../../../observability/mod.js';
|
|
5
|
+
export type CreateWebhookMiddleWareOpts = {
|
|
6
|
+
id: string;
|
|
7
|
+
connName?: string;
|
|
8
|
+
credentials: CredentialsProvider;
|
|
9
|
+
cnxProvider: ConnectionProvider;
|
|
10
|
+
cfgReader: ConfigReader;
|
|
11
|
+
log: Logger;
|
|
12
|
+
};
|
|
13
|
+
export declare function createStaticWebhookMiddleware(opts: CreateWebhookMiddleWareOpts): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
14
|
+
export declare function createActIdDynamicWebhookMiddleware(opts: CreateWebhookMiddleWareOpts): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
15
|
+
export declare function createUserIdDynamicWebhookMiddleware(opts: CreateWebhookMiddleWareOpts): (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
16
|
+
//# sourceMappingURL=webhookmiddleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhookmiddleware.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/webhookmiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAwB,YAAY,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAErF,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAGvD,MAAM,MAAM,2BAA2B,GAAG;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,mBAAmB,CAAC;IACjC,WAAW,EAAE,kBAAkB,CAAC;IAChC,SAAS,EAAE,YAAY,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAIF,wBAAgB,6BAA6B,CACzC,IAAI,EAAE,2BAA2B,GAClC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CA8DpE;AAED,wBAAgB,mCAAmC,CAC/C,IAAI,EAAE,2BAA2B,GAClC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAiEpE;AAED,wBAAgB,oCAAoC,CAChD,IAAI,EAAE,2BAA2B,GAClC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAkFpE"}
|