@versori/run 0.0.1-alpha.6 → 0.1.0-alpha.8
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.5 → esm/deps/jsr.io/@std/fmt/1.0.6}/colors.d.ts.map +1 -1
- package/esm/deps/jsr.io/@std/fs/{1.0.13 → 1.0.15}/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 +6 -1
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/Context.js +17 -3
- package/esm/src/context/ContextProvider.d.ts +3 -2
- package/esm/src/context/ContextProvider.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.js +2 -2
- package/esm/src/dsl/http/default.d.ts.map +1 -1
- package/esm/src/dsl/http/default.js +3 -1
- package/esm/src/dsl/http/types.d.ts +122 -16
- package/esm/src/dsl/http/types.d.ts.map +1 -1
- package/esm/src/dsl/http/types.js +6 -2
- package/esm/src/dsl/http/versori/configloader.d.ts +2 -2
- package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.js +9 -3
- package/esm/src/dsl/http/versori/constants.d.ts +10 -0
- package/esm/src/dsl/http/versori/constants.d.ts.map +1 -0
- package/esm/src/dsl/http/versori/constants.js +12 -0
- package/esm/src/dsl/http/versori/internalauth.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/internalauth.js +10 -9
- package/esm/src/dsl/http/versori/platformapi.d.ts +14 -0
- package/esm/src/dsl/http/versori/platformapi.d.ts.map +1 -0
- package/esm/src/dsl/http/versori/platformapi.js +91 -0
- package/esm/src/dsl/http/versori/roundtripper.d.ts +13 -6
- package/esm/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/roundtripper.js +171 -53
- package/esm/src/dsl/tasks/HttpTask.d.ts +18 -2
- package/esm/src/dsl/tasks/HttpTask.d.ts.map +1 -1
- package/esm/src/dsl/tasks/HttpTask.js +82 -0
- package/esm/src/dsl/triggers/ScheduleTrigger.d.ts +6 -2
- package/esm/src/dsl/triggers/ScheduleTrigger.d.ts.map +1 -1
- package/esm/src/dsl/triggers/ScheduleTrigger.js +10 -3
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +1 -0
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +12 -3
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts +2 -1
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/background.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/background.js +4 -2
- package/esm/src/interpreter/memory/compilers/http.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/http.js +6 -12
- package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/schedule.js +32 -6
- package/esm/src/interpreter/memory/compilers/serial.js +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.js +20 -4
- package/package.json +2 -1
- package/{esm/deps/jsr.io/@std/fmt/1.0.5 → script/deps/jsr.io/@std/fmt/1.0.6}/colors.d.ts.map +1 -1
- package/script/deps/jsr.io/@std/fs/{1.0.13 → 1.0.15}/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 +6 -1
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/Context.js +17 -3
- package/script/src/context/ContextProvider.d.ts +3 -2
- package/script/src/context/ContextProvider.d.ts.map +1 -1
- package/script/src/context/ContextProvider.js +2 -2
- package/script/src/dsl/http/default.d.ts.map +1 -1
- package/script/src/dsl/http/default.js +3 -1
- package/script/src/dsl/http/types.d.ts +122 -16
- package/script/src/dsl/http/types.d.ts.map +1 -1
- package/script/src/dsl/http/types.js +7 -1
- package/script/src/dsl/http/versori/configloader.d.ts +2 -2
- package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.js +10 -4
- package/script/src/dsl/http/versori/constants.d.ts +10 -0
- package/script/src/dsl/http/versori/constants.d.ts.map +1 -0
- package/script/src/dsl/http/versori/constants.js +15 -0
- package/script/src/dsl/http/versori/internalauth.d.ts.map +1 -1
- package/script/src/dsl/http/versori/internalauth.js +10 -9
- package/script/src/dsl/http/versori/platformapi.d.ts +14 -0
- package/script/src/dsl/http/versori/platformapi.d.ts.map +1 -0
- package/script/src/dsl/http/versori/platformapi.js +118 -0
- package/script/src/dsl/http/versori/roundtripper.d.ts +13 -6
- package/script/src/dsl/http/versori/roundtripper.d.ts.map +1 -1
- package/script/src/dsl/http/versori/roundtripper.js +170 -53
- package/script/src/dsl/tasks/HttpTask.d.ts +18 -2
- package/script/src/dsl/tasks/HttpTask.d.ts.map +1 -1
- package/script/src/dsl/tasks/HttpTask.js +84 -1
- package/script/src/dsl/triggers/ScheduleTrigger.d.ts +6 -2
- package/script/src/dsl/triggers/ScheduleTrigger.d.ts.map +1 -1
- package/script/src/dsl/triggers/ScheduleTrigger.js +10 -3
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +1 -0
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +12 -3
- package/script/src/interpreter/memory/ObservableCompiler.d.ts +2 -1
- package/script/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/background.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/background.js +3 -1
- package/script/src/interpreter/memory/compilers/http.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/http.js +5 -11
- package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/schedule.js +32 -6
- package/script/src/interpreter/memory/compilers/serial.js +1 -1
- package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/webhook.js +20 -4
- package/esm/src/dsl/http/versori/connectapi.d.ts +0 -11
- package/esm/src/dsl/http/versori/connectapi.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/connectapi.js +0 -57
- package/script/src/dsl/http/versori/connectapi.d.ts +0 -11
- package/script/src/dsl/http/versori/connectapi.d.ts.map +0 -1
- package/script/src/dsl/http/versori/connectapi.js +0 -61
- /package/esm/deps/jsr.io/@std/fmt/{1.0.5 → 1.0.6}/colors.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/fmt/{1.0.5 → 1.0.6}/colors.js +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.13 → 1.0.15}/exists.d.ts +0 -0
- /package/esm/deps/jsr.io/@std/fs/{1.0.13 → 1.0.15}/exists.js +0 -0
- /package/script/deps/jsr.io/@std/fmt/{1.0.5 → 1.0.6}/colors.d.ts +0 -0
- /package/script/deps/jsr.io/@std/fmt/{1.0.5 → 1.0.6}/colors.js +0 -0
- /package/script/deps/jsr.io/@std/fs/{1.0.13 → 1.0.15}/exists.d.ts +0 -0
- /package/script/deps/jsr.io/@std/fs/{1.0.13 → 1.0.15}/exists.js +0 -0
|
@@ -5,13 +5,14 @@ import { ContextOperatorFunction, TaskCompiler, TriggerCompiler } from './compil
|
|
|
5
5
|
import { Trigger } from '../../dsl/Trigger.js';
|
|
6
6
|
import { ContextProvider } from '../../context/ContextProvider.js';
|
|
7
7
|
import { ContextImpl } from '../../context/Context.js';
|
|
8
|
-
import { RoundTripperFactory } from '../../dsl/http/types.js';
|
|
8
|
+
import { ConnectionProvider, RoundTripperFactory } from '../../dsl/http/types.js';
|
|
9
9
|
import { Router } from 'express';
|
|
10
10
|
export type CompilerContext = {
|
|
11
11
|
compiler: ObservableCompiler;
|
|
12
12
|
log: Logger;
|
|
13
13
|
contextProvider: ContextProvider;
|
|
14
14
|
roundTripperFactory: RoundTripperFactory;
|
|
15
|
+
connectionProvider: ConnectionProvider;
|
|
15
16
|
router: Router;
|
|
16
17
|
};
|
|
17
18
|
export type CompilerFunc<In = any, Out = any, T extends Task<In, Out> = Task<In, Out>> = (ctx: CompilerContext, task: T) => OperatorFunction<In, Out>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObservableCompiler.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/memory/ObservableCompiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,IAAI,EAAY,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAO/D,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE9F,OAAO,EAAE,OAAO,EAAe,MAAM,sBAAsB,CAAC;AAG5D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"ObservableCompiler.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/memory/ObservableCompiler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,EAAE,IAAI,EAAY,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAO/D,OAAO,EAAE,uBAAuB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE9F,OAAO,EAAE,OAAO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,MAAM,EAAE,WAAW,GACpB,UAAU,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAerC,YAAY,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,SAAS,IAAI,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,QAAQ,EAAE,YAAY,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAKjF,eAAe,CAAC,GAAG,EAAE,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC;CAIjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/background.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAA2B,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"background.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/background.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAA2B,YAAY,EAAE,MAAM,YAAY,CAAC;AA0CnE,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAG/E,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { asyncScheduler, catchError, connect, EMPTY, ignoreElements, map, merge, mergeMap, of, subscribeOn, tap } from 'rxjs';
|
|
1
|
+
import { asyncScheduler, catchError, connect, EMPTY, ignoreElements, map, merge, mergeMap, of, subscribeOn, tap, } from 'rxjs';
|
|
2
2
|
import { BackgroundTask } from '../../../dsl/tasks/BackgroundTask.js';
|
|
3
3
|
function compileBackground(ctx, task) {
|
|
4
4
|
const base = ctx.compiler.compileTask(ctx, task._base);
|
|
5
5
|
return (src) => src.pipe(connect((shared$) => merge(shared$.pipe(mergeMap((ctx) => base(of(ctx)).pipe(subscribeOn(asyncScheduler), tap({
|
|
6
|
-
next: (ctx) => ctx.log.debug('Background task emitted a value', {
|
|
6
|
+
next: (ctx) => ctx.log.debug('Background task emitted a value', {
|
|
7
|
+
data: ctx.data,
|
|
8
|
+
}),
|
|
7
9
|
complete: () => ctx.log.debug('Background task completed'),
|
|
8
10
|
}), catchError((error) => {
|
|
9
11
|
ctx.log.error('Error in background task', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/http.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/http.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,EAA2B,YAAY,EAAE,MAAM,YAAY,CAAC;AAkCnE,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAG5E,CAAC"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import { mergeMap } from 'rxjs';
|
|
2
2
|
import { tap } from 'rxjs/operators';
|
|
3
|
-
import { HttpTaskImpl } from '../../../dsl/tasks/HttpTask.js';
|
|
3
|
+
import { HttpContextImpl, HttpTaskImpl } from '../../../dsl/tasks/HttpTask.js';
|
|
4
4
|
function compileHttp(ctx, task) {
|
|
5
|
-
const roundtripper = ctx.roundTripperFactory.create(task.opts.connection, fetch);
|
|
5
|
+
const roundtripper = ctx.roundTripperFactory.create(task.opts.connection, globalThis.fetch);
|
|
6
|
+
const dynamicFetcher = ctx.roundTripperFactory.createDynamic(task.opts.connection, globalThis.fetch);
|
|
6
7
|
return (src) => src.pipe(tap({
|
|
7
|
-
complete: () => ctx.log.debug('http.complete')
|
|
8
|
+
complete: () => ctx.log.debug('http.complete'),
|
|
8
9
|
}), mergeMap(async (ctx) => {
|
|
9
10
|
const _fetch = await roundtripper;
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
fetch: _fetch,
|
|
13
|
-
connectionVariables: {}, // TODO: Implement connection variables
|
|
14
|
-
pageParams: undefined,
|
|
15
|
-
nextPage: () => {
|
|
16
|
-
throw new Error('Pagination not yet implemented');
|
|
17
|
-
},
|
|
18
|
-
};
|
|
11
|
+
const _dynamicFetcher = await dynamicFetcher;
|
|
12
|
+
const httpContext = new HttpContextImpl(ctx, {}, _fetch, _dynamicFetcher);
|
|
19
13
|
const result = await task.fn(httpContext);
|
|
20
14
|
return ctx.withData(result);
|
|
21
15
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/schedule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/schedule.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AA6F7C,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,YAAY,EAAE,eAAe,CAG3E,CAAC"}
|
|
@@ -3,16 +3,42 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { ScheduleTrigger } from '../../../dsl/triggers/ScheduleTrigger.js';
|
|
4
4
|
function compileSchedule(ctx, trigger, signal) {
|
|
5
5
|
return new Observable((subscriber) => {
|
|
6
|
+
const client = ctx.connectionProvider;
|
|
6
7
|
const job = CronJob.from({
|
|
7
8
|
cronTime: trigger.schedule,
|
|
8
|
-
onTick: () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
onTick: async () => {
|
|
10
|
+
if (trigger.activationPredicate === undefined) {
|
|
11
|
+
const executionCtx = ctx.contextProvider.create({}, undefined);
|
|
12
|
+
try {
|
|
13
|
+
subscriber.next(executionCtx);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
executionCtx.log.error('execution error inside schedule', { error });
|
|
17
|
+
}
|
|
18
|
+
return;
|
|
12
19
|
}
|
|
13
|
-
|
|
14
|
-
|
|
20
|
+
const activations = await client.listActivations();
|
|
21
|
+
if (!activations || activations.length === 0) {
|
|
22
|
+
const executionCtx = ctx.contextProvider.create({}, undefined);
|
|
23
|
+
executionCtx.log.info('no activations found, continuing');
|
|
24
|
+
try {
|
|
25
|
+
subscriber.next(executionCtx);
|
|
26
|
+
}
|
|
27
|
+
catch (error) {
|
|
28
|
+
executionCtx.log.error('execution error inside schedule', { error });
|
|
29
|
+
}
|
|
30
|
+
return;
|
|
15
31
|
}
|
|
32
|
+
activations.forEach((activation) => {
|
|
33
|
+
const executionCtx = ctx.contextProvider.create({}, activation);
|
|
34
|
+
executionCtx.log.info('no activations found, continuing');
|
|
35
|
+
try {
|
|
36
|
+
subscriber.next(executionCtx);
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
executionCtx.log.error('execution error inside schedule', { error });
|
|
40
|
+
}
|
|
41
|
+
});
|
|
16
42
|
},
|
|
17
43
|
onComplete: () => {
|
|
18
44
|
if (subscriber.closed) {
|
|
@@ -4,7 +4,7 @@ function compileSerial(ctx, task) {
|
|
|
4
4
|
const baseOperator = ctx.compiler.compileTask(ctx, task._base);
|
|
5
5
|
const eachOperator = ctx.compiler.compileTask(ctx, task._each);
|
|
6
6
|
return (src) => src.pipe(tap({
|
|
7
|
-
complete: () => ctx.log.debug('serial.complete')
|
|
7
|
+
complete: () => ctx.log.debug('serial.complete'),
|
|
8
8
|
}), baseOperator, mergeMap((ctx) => {
|
|
9
9
|
const tasks = ctx.data.map((d, idx) => eachOperator(of(ctx.withData(d).setIndex(idx))));
|
|
10
10
|
return concat(...tasks).pipe(map((result) => result.data), toArray(), map((results) => ctx.withData(results)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/webhook.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/webhook.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAM7C,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,WAAW,EAAE,cAAc,CA6DxE,CAAC"}
|
|
@@ -10,10 +10,26 @@ export const webhookCompiler = {
|
|
|
10
10
|
}
|
|
11
11
|
// add the webhook endpoint to the router
|
|
12
12
|
ctx.log.info('webhook endpoint added:', { trigger });
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
ctx.
|
|
16
|
-
|
|
13
|
+
// endpoint for sans user because I'm not quite sure how the dynamic routing works
|
|
14
|
+
ctx.router.post(`/${trigger.id}`, (req, res) => {
|
|
15
|
+
const executionCtx = ctx.contextProvider.create(req.body, undefined);
|
|
16
|
+
try {
|
|
17
|
+
subscriber.next(executionCtx);
|
|
18
|
+
res.status(200).json({ status: "accepted" });
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
22
|
+
executionCtx.log.error('webhook execution error', { error });
|
|
23
|
+
res.status(500).json({ status: "error", message });
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
ctx.router.post(`/${trigger.id}/:activationId`, (req, res) => {
|
|
27
|
+
const activationId = req.params.activationId || undefined;
|
|
28
|
+
let activation = undefined;
|
|
29
|
+
if (activationId) {
|
|
30
|
+
activation = { id: activationId };
|
|
31
|
+
}
|
|
32
|
+
const executionCtx = ctx.contextProvider.create(req.body, activation);
|
|
17
33
|
try {
|
|
18
34
|
subscriber.next(executionCtx);
|
|
19
35
|
res.status(200).json({ status: "accepted" });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versori/run",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "v0.1.0-alpha.8",
|
|
4
4
|
"description": "Versori Run",
|
|
5
5
|
"homepage": "https://github.com/versori/versori-run#readme",
|
|
6
6
|
"repository": {
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@connectrpc/connect-node": "^2.0.1",
|
|
29
29
|
"cron": "3.5.0",
|
|
30
30
|
"express": "^4.18.3",
|
|
31
|
+
"lru-cache": "^11.0.2",
|
|
31
32
|
"rxjs": "^7.8.1",
|
|
32
33
|
"@deno/shim-deno": "~0.18.0"
|
|
33
34
|
},
|
package/{esm/deps/jsr.io/@std/fmt/1.0.5 → script/deps/jsr.io/@std/fmt/1.0.6}/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.6/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;I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AAG,EAAE,MAAM,GAAG,MAAM,CAEjD;AAcD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;;;;;;;;;;;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.15/exists.ts"],"names":[],"mappings":"AAKA,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.6/colors.js");
|
|
20
20
|
const base_handler_js_1 = require("./base_handler.js");
|
|
21
21
|
function applyColors(msg, level) {
|
|
22
22
|
switch (level) {
|
|
@@ -38,7 +38,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
38
38
|
exports.RotatingFileHandler = void 0;
|
|
39
39
|
// Copyright 2018-2025 the Deno authors. MIT license.
|
|
40
40
|
const dntShim = __importStar(require("../../../../../_dnt.shims.js"));
|
|
41
|
-
const exists_js_1 = require("../../fs/1.0.
|
|
41
|
+
const exists_js_1 = require("../../fs/1.0.15/exists.js");
|
|
42
42
|
const file_handler_js_1 = require("./file_handler.js");
|
|
43
43
|
const _file_handler_symbols_js_1 = require("./_file_handler_symbols.js");
|
|
44
44
|
/**
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { Activation } from '../dsl/http/types.js';
|
|
1
2
|
import { Logger } from '../observability/logging/Logger.js';
|
|
2
3
|
export interface Context<D> {
|
|
3
4
|
log: Logger;
|
|
4
5
|
executionId: string;
|
|
5
6
|
startTime: Date;
|
|
7
|
+
activation?: Activation;
|
|
6
8
|
data: D;
|
|
7
9
|
}
|
|
8
10
|
export interface InternalContext<D, Index = void> extends Context<D> {
|
|
9
11
|
withData<D2>(data: D2): InternalContext<D2, Index>;
|
|
12
|
+
withActivation(activation: Activation | undefined): InternalContext<D, Index>;
|
|
10
13
|
setIndex(idx: number): InternalContext<D, number>;
|
|
11
14
|
idx: Index;
|
|
12
15
|
}
|
|
@@ -14,10 +17,12 @@ export declare class ContextImpl<D, Index = void> implements InternalContext<D,
|
|
|
14
17
|
log: Logger;
|
|
15
18
|
executionId: string;
|
|
16
19
|
startTime: Date;
|
|
20
|
+
activation?: Activation | undefined;
|
|
17
21
|
data: D;
|
|
18
22
|
idx: Index;
|
|
19
|
-
constructor(log: Logger, executionId: string, startTime: Date, data: D);
|
|
23
|
+
constructor(log: Logger, executionId: string, startTime: Date, data: D, activation?: Activation | undefined);
|
|
20
24
|
setIndex(idx: number): InternalContext<D, number>;
|
|
25
|
+
withActivation(activation: Activation | undefined): InternalContext<D, Index>;
|
|
21
26
|
withData<D2>(data: D2): InternalContext<D2, Index>;
|
|
22
27
|
}
|
|
23
28
|
//# 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,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,IAAI,EAAE,CAAC,CAAC;CACX;AAED,MAAM,WAAW,eAAe,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI,CAAE,SAAQ,OAAO,CAAC,CAAC,CAAC;IAChE,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACnD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;I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CAAE,YAAW,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC;IAC1E,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,IAAI,CAAC;IAChB,UAAU,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC;IAER,GAAG,EAAE,KAAK,CAAC;gBAEC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,GAAE,UAAU,GAAG,SAAqB;IAStH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC,EAAE,MAAM,CAAC;IAOjD,cAAc,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC;IAS7E,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,EAAE,GAAG,eAAe,CAAC,EAAE,EAAE,KAAK,CAAC;CAGrD"}
|
|
@@ -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, executionId, startTime, data) {
|
|
5
|
+
constructor(log, executionId, startTime, data, activation = undefined) {
|
|
6
6
|
Object.defineProperty(this, "log", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
configurable: true,
|
|
@@ -21,6 +21,12 @@ class ContextImpl {
|
|
|
21
21
|
writable: true,
|
|
22
22
|
value: void 0
|
|
23
23
|
});
|
|
24
|
+
Object.defineProperty(this, "activation", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
24
30
|
Object.defineProperty(this, "data", {
|
|
25
31
|
enumerable: true,
|
|
26
32
|
configurable: true,
|
|
@@ -36,16 +42,24 @@ class ContextImpl {
|
|
|
36
42
|
this.log = log;
|
|
37
43
|
this.executionId = executionId;
|
|
38
44
|
this.startTime = startTime;
|
|
45
|
+
this.activation = activation;
|
|
39
46
|
this.data = data;
|
|
40
47
|
this.idx = void 0;
|
|
41
48
|
}
|
|
42
49
|
setIndex(idx) {
|
|
43
|
-
const next = new ContextImpl(this.log, this.executionId, this.startTime, this.data);
|
|
50
|
+
const next = new ContextImpl(this.log, this.executionId, this.startTime, this.data, this.activation);
|
|
44
51
|
next.idx = idx;
|
|
45
52
|
return next;
|
|
46
53
|
}
|
|
54
|
+
withActivation(activation) {
|
|
55
|
+
// Essentially makes activation immutable once set
|
|
56
|
+
if (this.activation) {
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
return new ContextImpl(this.log, this.executionId, this.startTime, this.data, activation);
|
|
60
|
+
}
|
|
47
61
|
withData(data) {
|
|
48
|
-
return new ContextImpl(this.log, this.executionId, this.startTime, data);
|
|
62
|
+
return new ContextImpl(this.log, this.executionId, this.startTime, data, this.activation);
|
|
49
63
|
}
|
|
50
64
|
}
|
|
51
65
|
exports.ContextImpl = ContextImpl;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Logger } from '../observability/logging/Logger.js';
|
|
2
2
|
import { InternalContext } from './Context.js';
|
|
3
|
+
import { Activation } from '../dsl/http/types.js';
|
|
3
4
|
export interface ContextProvider {
|
|
4
|
-
create<D>(data: D): InternalContext<D, void>;
|
|
5
|
+
create<D>(data: D, activation: Activation | undefined): InternalContext<D, void>;
|
|
5
6
|
}
|
|
6
7
|
export declare class ContextProviderImpl implements ContextProvider {
|
|
7
8
|
log: Logger;
|
|
8
9
|
constructor(log: Logger);
|
|
9
|
-
create<D>(data: D): InternalContext<D, void>;
|
|
10
|
+
create<D>(data: D, activation?: Activation | undefined): InternalContext<D, void>;
|
|
10
11
|
}
|
|
11
12
|
//# 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,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,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,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAe,eAAe,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,MAAM,WAAW,eAAe;IAC5B,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;CACpF;AAED,qBAAa,mBAAoB,YAAW,eAAe;IACvD,GAAG,EAAE,MAAM,CAAC;gBAEA,GAAG,EAAE,MAAM;IAIvB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,UAAU,GAAE,UAAU,GAAG,SAAqB,GAAG,eAAe,CAAC,CAAC,EAAE,IAAI,CAAC;CAK/F"}
|
|
@@ -13,9 +13,9 @@ class ContextProviderImpl {
|
|
|
13
13
|
});
|
|
14
14
|
this.log = log;
|
|
15
15
|
}
|
|
16
|
-
create(data) {
|
|
16
|
+
create(data, activation = undefined) {
|
|
17
17
|
const executionId = (0, mod_js_1.ulid)();
|
|
18
|
-
return new Context_js_1.ContextImpl(this.log.child({ executionId }), executionId, new Date(), data);
|
|
18
|
+
return new Context_js_1.ContextImpl(this.log.child({ executionId }), executionId, new Date(), data, activation);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.ContextProviderImpl = ContextProviderImpl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjE;;;;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;
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/default.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjE;;;;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;CAKvF"}
|
|
@@ -23,7 +23,9 @@ class DefaultRoundTripperFactory {
|
|
|
23
23
|
return fn;
|
|
24
24
|
}
|
|
25
25
|
async createDynamic(templateName, fn) {
|
|
26
|
-
|
|
26
|
+
return async (userId, input, init) => {
|
|
27
|
+
return fetch(input, init);
|
|
28
|
+
};
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
exports.DefaultRoundTripperFactory = DefaultRoundTripperFactory;
|
|
@@ -1,14 +1,120 @@
|
|
|
1
|
-
export
|
|
2
|
-
getUserId(): string | undefined;
|
|
3
|
-
}
|
|
4
|
-
export type DynamicFetcher = (ctx: DynamicContext, input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
1
|
+
export type DynamicFetcher = (userId: string, input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
5
2
|
export interface RoundTripperFactory {
|
|
6
3
|
create(connName: string, fn: typeof fetch): Promise<typeof fetch>;
|
|
7
4
|
createDynamic(templateName: string, fn: typeof fetch): Promise<DynamicFetcher>;
|
|
8
5
|
}
|
|
6
|
+
export declare function wrapDynamicFetcher(fetcher: DynamicFetcher, userId: string): typeof fetch;
|
|
7
|
+
export interface ConnectionProvider {
|
|
8
|
+
getStaticConnection(cnxId: string): Promise<Connection | undefined>;
|
|
9
|
+
getEndUserConnection(templateId: string, userId: string): Promise<Connection | undefined>;
|
|
10
|
+
listActivations(): Promise<Activation[]>;
|
|
11
|
+
}
|
|
12
|
+
export type User = {
|
|
13
|
+
id: string;
|
|
14
|
+
createdAt: string;
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
displayName: string;
|
|
17
|
+
externalId: string;
|
|
18
|
+
organisationId: string;
|
|
19
|
+
};
|
|
20
|
+
export type Activation = {
|
|
21
|
+
id: string;
|
|
22
|
+
user: User;
|
|
23
|
+
};
|
|
24
|
+
export type AuthSchemeType = 'none' | 'api-key' | 'basic-auth' | 'oauth2' | 'hmac' | 'jwt-bearer' | 'custom-function' | 'certificate' | 'oauth1';
|
|
9
25
|
export type AuthSchemeConfig = {
|
|
10
|
-
|
|
11
|
-
|
|
26
|
+
type: AuthSchemeType;
|
|
27
|
+
none?: AuthSchemeConfigNone;
|
|
28
|
+
apiKey?: AuthSchemeConfigApiKey;
|
|
29
|
+
basicAuth?: AuthSchemeConfigBasicAuth;
|
|
30
|
+
oauth2?: AuthSchemeConfigOAuth2;
|
|
31
|
+
oauth1?: AuthSchemeConfigOAuth1;
|
|
32
|
+
hmac?: AuthSchemeConfigHMAC;
|
|
33
|
+
certificate?: AuthSchemeConfigCertificate;
|
|
34
|
+
};
|
|
35
|
+
type AuthSchemeConfigBase = {
|
|
36
|
+
id: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
export type AuthSchemeConfigNone = AuthSchemeConfigBase & {
|
|
40
|
+
schemeType: 'none';
|
|
41
|
+
};
|
|
42
|
+
export type AuthSchemeConfigBasicAuth = AuthSchemeConfigBase & {
|
|
43
|
+
schemeType: 'basic-auth';
|
|
44
|
+
};
|
|
45
|
+
export type AuthSchemeConfigApiKey = AuthSchemeConfigBase & {
|
|
46
|
+
schemeType: 'api-key';
|
|
47
|
+
in: 'query' | 'header' | 'cookie';
|
|
48
|
+
name: string;
|
|
49
|
+
};
|
|
50
|
+
type OAuth2Scope = {
|
|
51
|
+
name: string;
|
|
52
|
+
description: string;
|
|
53
|
+
};
|
|
54
|
+
type OAuth2GrantAuthCode = {
|
|
55
|
+
credentialId: string;
|
|
56
|
+
organisationId: string;
|
|
57
|
+
clientId: string;
|
|
58
|
+
clientSecret: string;
|
|
59
|
+
};
|
|
60
|
+
type OAuth2GrantClientCredentials = {};
|
|
61
|
+
type OAuth2GrantPassword = {
|
|
62
|
+
credentialId: string;
|
|
63
|
+
organisationId: string;
|
|
64
|
+
clientId: string;
|
|
65
|
+
clientSecret: string;
|
|
66
|
+
};
|
|
67
|
+
type OAuth2Grant = {
|
|
68
|
+
type: 'authorizationCode' | 'clientCredentials' | 'password';
|
|
69
|
+
authorizationCode?: OAuth2GrantAuthCode;
|
|
70
|
+
clientCredentials?: OAuth2GrantClientCredentials;
|
|
71
|
+
password?: OAuth2GrantPassword;
|
|
72
|
+
};
|
|
73
|
+
export type AuthSchemeConfigOAuth2 = AuthSchemeConfigBase & {
|
|
74
|
+
schemeType: 'oauth2';
|
|
75
|
+
authorizeUrl: string;
|
|
76
|
+
tokenUrl: string;
|
|
77
|
+
scopes: OAuth2Scope[];
|
|
78
|
+
defaultScopes: string[];
|
|
79
|
+
additionalAuthorizeParams: string;
|
|
80
|
+
additionalTokenParams: string;
|
|
81
|
+
mltsEnabled: boolean;
|
|
82
|
+
mltsCredentialId: string;
|
|
83
|
+
grant: OAuth2Grant;
|
|
84
|
+
};
|
|
85
|
+
export type DigestInput = 'body' | 'url';
|
|
86
|
+
export type AuthSchemeConfigHMAC = AuthSchemeConfigBase & {
|
|
87
|
+
schemeType: 'hmac';
|
|
88
|
+
name: string;
|
|
89
|
+
in: 'query' | 'header' | 'cookie';
|
|
90
|
+
algorithm: 'sha1' | 'sha256' | 'sha512';
|
|
91
|
+
digestInputs: DigestInput[];
|
|
92
|
+
};
|
|
93
|
+
type ParameterConfig = {
|
|
94
|
+
parameterName: string;
|
|
95
|
+
targetName: string;
|
|
96
|
+
location: 'LOCATION_IGNORE' | 'LOCATION_QUERY' | 'LOCATION_HEADER' | 'LOCATION_BODY' | 'LOCATION_ENDPOINT' | 'LOCAITON_HEADER_PARAMETER';
|
|
97
|
+
usages: 'USAGE_UNKNOWN' | 'USAGE_TEMP_CREDENTIAL_ENDPOINT' | 'USAGE_TOKEN_REQUEST_ENDPOINT';
|
|
98
|
+
required: boolean;
|
|
99
|
+
modifiable: boolean;
|
|
100
|
+
};
|
|
101
|
+
type Endpoint = {
|
|
102
|
+
url: string;
|
|
103
|
+
additionalParamConfigs: ParameterConfig[];
|
|
104
|
+
parameterTransmission: 'AUTH_STYLE_AUTHORIZATION_HEADER' | 'AUTH_STYLE_QUERY' | 'AUTH_STYLE_FORM';
|
|
105
|
+
};
|
|
106
|
+
export type AuthSchemeConfigOAuth1 = AuthSchemeConfigBase & {
|
|
107
|
+
consumerKey: string;
|
|
108
|
+
consumerSecret: string;
|
|
109
|
+
schemeType: 'oauth1';
|
|
110
|
+
tempCredentialEndpoint: Endpoint;
|
|
111
|
+
resourceOwnerAuthorizationEndpoint: Endpoint;
|
|
112
|
+
tokenEndpoint: Endpoint;
|
|
113
|
+
signatureMethod: string;
|
|
114
|
+
credentialId: string;
|
|
115
|
+
};
|
|
116
|
+
export type AuthSchemeConfigCertificate = AuthSchemeConfigBase & {
|
|
117
|
+
schemeType: 'certificate';
|
|
12
118
|
};
|
|
13
119
|
export type Credential = {
|
|
14
120
|
data: Record<string, string>;
|
|
@@ -24,14 +130,13 @@ export type ConnectionCredential = {
|
|
|
24
130
|
};
|
|
25
131
|
export type Connection = {
|
|
26
132
|
createdAt: string;
|
|
27
|
-
credentials:
|
|
28
|
-
action: ConnectionCredential[];
|
|
29
|
-
trigger: ConnectionCredential[];
|
|
30
|
-
};
|
|
133
|
+
credentials: ConnectionCredential[];
|
|
31
134
|
id: string;
|
|
32
135
|
name: string;
|
|
136
|
+
templateId: string;
|
|
137
|
+
dynamic: boolean;
|
|
33
138
|
updatedAt: string;
|
|
34
|
-
|
|
139
|
+
baseUrl: string;
|
|
35
140
|
};
|
|
36
141
|
export type System = {
|
|
37
142
|
documentationUrl: string;
|
|
@@ -41,13 +146,14 @@ export type System = {
|
|
|
41
146
|
[key: string]: any;
|
|
42
147
|
};
|
|
43
148
|
};
|
|
44
|
-
export type
|
|
45
|
-
|
|
149
|
+
export type CnxMap = {
|
|
150
|
+
templateId?: string;
|
|
151
|
+
connId?: string;
|
|
152
|
+
dynamic?: boolean;
|
|
46
153
|
name: string;
|
|
47
|
-
authSchemeConfig: AuthSchemeConfig;
|
|
48
154
|
};
|
|
49
155
|
export type VersoriSDKConfig = {
|
|
50
|
-
|
|
51
|
-
connections: Connection[];
|
|
156
|
+
mappings: CnxMap[];
|
|
52
157
|
};
|
|
158
|
+
export {};
|
|
53
159
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/src/dsl/http/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IA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AC;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,3 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
;
|
|
3
|
+
exports.wrapDynamicFetcher = wrapDynamicFetcher;
|
|
4
|
+
// this function might be better being a method on DynamicFetcher or something like that
|
|
5
|
+
function wrapDynamicFetcher(fetcher, userId) {
|
|
6
|
+
return (input, init) => {
|
|
7
|
+
return fetcher(userId, input, init);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -2,11 +2,11 @@ import { VersoriSDKConfig } from '../types.js';
|
|
|
2
2
|
/**
|
|
3
3
|
* Loads the Versori SDK configuration from a JSON file.
|
|
4
4
|
*
|
|
5
|
-
* This function reads the
|
|
5
|
+
* This function reads the config file synchronously and parses its content
|
|
6
6
|
* into a `VersoriSDKConfig` object. This assumes the config file is in the root where
|
|
7
7
|
* the application is run.
|
|
8
8
|
*
|
|
9
9
|
* @returns {VersoriSDKConfig} The parsed configuration object.
|
|
10
10
|
*/
|
|
11
|
-
export declare function
|
|
11
|
+
export declare function LoadConfigFromFile(): VersoriSDKConfig;
|
|
12
12
|
//# 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":"AACA,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":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/C;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,CAUrD"}
|