@versori/run 0.6.0-alpha.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/deps/jsr.io/@std/fmt/1.0.10/colors.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/fmt/{1.0.9 → 1.0.10}/colors.js +2 -2
- package/esm/deps/jsr.io/@std/log/0.224.14/console_handler.js +1 -1
- package/esm/src/connection/internal/CredentialHolder.js +1 -1
- package/esm/src/connection/internal/FetchBuilder.d.ts +2 -9
- package/esm/src/connection/internal/FetchBuilder.d.ts.map +1 -1
- package/esm/src/connection/internal/FetchBuilder.js +3 -124
- package/esm/src/context/Context.d.ts +0 -5
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/Context.js +3 -6
- package/esm/src/context/VanillaContext.d.ts.map +1 -1
- package/esm/src/context/VanillaContext.js +3 -0
- package/esm/src/context/WorkflowClient.d.ts +1 -0
- package/esm/src/context/WorkflowClient.d.ts.map +1 -1
- package/esm/src/context/WorkflowClient.js +3 -0
- package/esm/src/dsl/Workflow.d.ts.map +1 -1
- package/esm/src/dsl/Workflow.js +0 -2
- package/esm/src/dsl/http/types.d.ts +0 -2
- package/esm/src/dsl/http/types.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/configloader.js +1 -1
- package/esm/src/dsl/http/versori/constants.d.ts +21 -0
- package/esm/src/dsl/http/versori/constants.d.ts.map +1 -0
- package/esm/src/dsl/http/versori/constants.js +38 -0
- package/esm/src/dsl/http/versori/cronapi.d.ts +3 -2
- package/esm/src/dsl/http/versori/cronapi.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/cronapi.js +15 -14
- package/esm/src/dsl/http/versori/kvapi/core/OpenAPI.js +1 -1
- package/esm/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/esm/src/dsl/triggers/WebhookTrigger.js +1 -3
- package/esm/src/internal/constants.d.ts +0 -3
- package/esm/src/internal/constants.d.ts.map +1 -1
- package/esm/src/internal/constants.js +0 -3
- package/esm/src/interpreter/durable/DurableInterpreter.d.ts +2 -9
- package/esm/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/durable/DurableInterpreter.js +13 -57
- package/esm/src/interpreter/durable/ObservableCompiler.d.ts +1 -6
- package/esm/src/interpreter/durable/ObservableCompiler.d.ts.map +1 -1
- package/esm/src/interpreter/durable/Queue.d.ts +3 -0
- package/esm/src/interpreter/durable/Queue.d.ts.map +1 -1
- package/esm/src/interpreter/durable/Queue.js +1 -1
- package/esm/src/interpreter/durable/compilers/catch.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/catch.js +1 -3
- package/esm/src/interpreter/durable/compilers/durableworkflow.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/durableworkflow.js +21 -6
- package/esm/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/fn.js +6 -29
- package/esm/src/interpreter/durable/compilers/http.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/http.js +11 -45
- package/esm/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/schedule.js +3 -4
- package/esm/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/webhook.js +0 -2
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +1 -8
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +12 -56
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts +1 -6
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/catch.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/catch.js +0 -5
- package/esm/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/fn.js +18 -29
- package/esm/src/interpreter/memory/compilers/http.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/http.js +10 -44
- package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/schedule.js +4 -61
- package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.js +3 -9
- package/esm/src/interpreter/vanilla/VanillaInterpreter.d.ts +0 -1
- package/esm/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/vanilla/VanillaInterpreter.js +6 -30
- package/esm/src/interpreter/vanilla/compilers/durableworkflow.d.ts.map +1 -1
- package/esm/src/interpreter/vanilla/compilers/durableworkflow.js +12 -2
- package/esm/src/interpreter/vanilla/compilers/schedule.js +1 -1
- package/esm/src/issues/Issues.d.ts.map +1 -1
- package/esm/src/issues/Issues.js +1 -6
- package/esm/src/kv/KeyValue.d.ts +7 -3
- package/esm/src/kv/KeyValue.d.ts.map +1 -1
- package/esm/src/kv/fingerprintExternalUserId.d.ts +6 -0
- package/esm/src/kv/fingerprintExternalUserId.d.ts.map +1 -0
- package/esm/src/kv/fingerprintExternalUserId.js +20 -0
- package/esm/src/kv/memory/MemoryKeyValueProvider.d.ts +4 -0
- package/esm/src/kv/memory/MemoryKeyValueProvider.d.ts.map +1 -1
- package/esm/src/kv/memory/MemoryKeyValueProvider.js +50 -0
- package/esm/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/esm/src/kv/nats/NatsKeyValueProvider.js +14 -0
- package/esm/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
- package/esm/src/kv/sdk/SDKKeyValueProvider.js +12 -0
- package/esm/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/esm/src/observability/mod.d.ts +1 -0
- package/esm/src/observability/mod.d.ts.map +1 -1
- package/esm/src/observability/mod.js +1 -0
- package/esm/src/observability/tracePropagation.d.ts +23 -0
- package/esm/src/observability/tracePropagation.d.ts.map +1 -0
- package/esm/src/observability/tracePropagation.js +39 -0
- package/package.json +1 -3
- package/script/deps/jsr.io/@std/fmt/1.0.10/colors.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/fmt/{1.0.9 → 1.0.10}/colors.js +2 -2
- package/script/deps/jsr.io/@std/log/0.224.14/console_handler.js +1 -1
- package/script/src/connection/internal/CredentialHolder.js +1 -1
- package/script/src/connection/internal/FetchBuilder.d.ts +2 -9
- package/script/src/connection/internal/FetchBuilder.d.ts.map +1 -1
- package/script/src/connection/internal/FetchBuilder.js +3 -147
- package/script/src/context/Context.d.ts +0 -5
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/Context.js +3 -6
- package/script/src/context/VanillaContext.d.ts.map +1 -1
- package/script/src/context/VanillaContext.js +3 -0
- package/script/src/context/WorkflowClient.d.ts +1 -0
- package/script/src/context/WorkflowClient.d.ts.map +1 -1
- package/script/src/context/WorkflowClient.js +3 -0
- package/script/src/dsl/Workflow.d.ts.map +1 -1
- package/script/src/dsl/Workflow.js +0 -2
- package/script/src/dsl/http/types.d.ts +0 -2
- package/script/src/dsl/http/types.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.d.ts.map +1 -1
- package/script/src/dsl/http/versori/configloader.js +1 -1
- package/script/src/dsl/http/versori/constants.d.ts +21 -0
- package/script/src/dsl/http/versori/constants.d.ts.map +1 -0
- package/script/src/dsl/http/versori/constants.js +41 -0
- package/script/src/dsl/http/versori/cronapi.d.ts +3 -2
- package/script/src/dsl/http/versori/cronapi.d.ts.map +1 -1
- package/script/src/dsl/http/versori/cronapi.js +15 -14
- package/script/src/dsl/http/versori/kvapi/core/OpenAPI.js +1 -1
- package/script/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/script/src/dsl/triggers/WebhookTrigger.js +1 -3
- package/script/src/internal/constants.d.ts +0 -3
- package/script/src/internal/constants.d.ts.map +1 -1
- package/script/src/internal/constants.js +1 -4
- package/script/src/interpreter/durable/DurableInterpreter.d.ts +2 -9
- package/script/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/durable/DurableInterpreter.js +18 -62
- package/script/src/interpreter/durable/ObservableCompiler.d.ts +1 -6
- package/script/src/interpreter/durable/ObservableCompiler.d.ts.map +1 -1
- package/script/src/interpreter/durable/Queue.d.ts +3 -0
- package/script/src/interpreter/durable/Queue.d.ts.map +1 -1
- package/script/src/interpreter/durable/Queue.js +1 -1
- package/script/src/interpreter/durable/compilers/catch.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/catch.js +1 -3
- package/script/src/interpreter/durable/compilers/durableworkflow.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/durableworkflow.js +21 -6
- package/script/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/fn.js +5 -28
- package/script/src/interpreter/durable/compilers/http.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/http.js +11 -45
- package/script/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/schedule.js +3 -4
- package/script/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/webhook.js +0 -2
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +1 -8
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +11 -55
- package/script/src/interpreter/memory/ObservableCompiler.d.ts +1 -6
- package/script/src/interpreter/memory/ObservableCompiler.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/catch.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/catch.js +0 -5
- package/script/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/fn.js +17 -28
- package/script/src/interpreter/memory/compilers/http.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/http.js +10 -44
- package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/schedule.js +4 -61
- package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/webhook.js +3 -9
- package/script/src/interpreter/vanilla/VanillaInterpreter.d.ts +0 -1
- package/script/src/interpreter/vanilla/VanillaInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/vanilla/VanillaInterpreter.js +6 -30
- package/script/src/interpreter/vanilla/compilers/durableworkflow.d.ts.map +1 -1
- package/script/src/interpreter/vanilla/compilers/durableworkflow.js +12 -2
- package/script/src/interpreter/vanilla/compilers/schedule.js +1 -1
- package/script/src/issues/Issues.d.ts.map +1 -1
- package/script/src/issues/Issues.js +1 -6
- package/script/src/kv/KeyValue.d.ts +7 -3
- package/script/src/kv/KeyValue.d.ts.map +1 -1
- package/script/src/kv/fingerprintExternalUserId.d.ts +6 -0
- package/script/src/kv/fingerprintExternalUserId.d.ts.map +1 -0
- package/script/src/kv/fingerprintExternalUserId.js +23 -0
- package/script/src/kv/memory/MemoryKeyValueProvider.d.ts +4 -0
- package/script/src/kv/memory/MemoryKeyValueProvider.d.ts.map +1 -1
- package/script/src/kv/memory/MemoryKeyValueProvider.js +50 -0
- package/script/src/kv/nats/NatsKeyValueProvider.d.ts.map +1 -1
- package/script/src/kv/nats/NatsKeyValueProvider.js +14 -0
- package/script/src/kv/sdk/SDKKeyValueProvider.d.ts.map +1 -1
- package/script/src/kv/sdk/SDKKeyValueProvider.js +12 -0
- package/script/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/script/src/observability/mod.d.ts +1 -0
- package/script/src/observability/mod.d.ts.map +1 -1
- package/script/src/observability/mod.js +1 -0
- package/script/src/observability/tracePropagation.d.ts +23 -0
- package/script/src/observability/tracePropagation.d.ts.map +1 -0
- package/script/src/observability/tracePropagation.js +46 -0
- package/esm/deps/jsr.io/@std/fmt/1.0.9/colors.d.ts.map +0 -1
- package/esm/src/internal/supervisor.d.ts +0 -23
- package/esm/src/internal/supervisor.d.ts.map +0 -1
- package/esm/src/internal/supervisor.js +0 -267
- package/script/deps/jsr.io/@std/fmt/1.0.9/colors.d.ts.map +0 -1
- package/script/src/internal/supervisor.d.ts +0 -23
- package/script/src/internal/supervisor.d.ts.map +0 -1
- package/script/src/internal/supervisor.js +0 -275
- /package/esm/deps/jsr.io/@std/fmt/{1.0.9 → 1.0.10}/colors.d.ts +0 -0
- /package/script/deps/jsr.io/@std/fmt/{1.0.9 → 1.0.10}/colors.d.ts +0 -0
|
@@ -1,43 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2025 Versori Group Inc
|
|
4
|
+
*
|
|
5
|
+
* Use of this software is governed by the Business Source License 1.1
|
|
6
|
+
* included in the LICENSE file at the root of this repository.
|
|
7
|
+
*
|
|
8
|
+
* Change Date: 2029-01-01
|
|
9
|
+
* Change License: Apache License, Version 2.0
|
|
10
|
+
*
|
|
11
|
+
* As of the Change Date, in accordance with the Business Source License,
|
|
12
|
+
* use of this software will be governed by the Apache License, Version 2.0.
|
|
13
|
+
*/
|
|
2
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
15
|
exports.fnCompiler = void 0;
|
|
4
16
|
const rxjs_1 = require("rxjs");
|
|
5
17
|
const FnTask_js_1 = require("../../../dsl/tasks/FnTask.js");
|
|
6
|
-
const supervisor_js_1 = require("../../../internal/supervisor.js");
|
|
7
18
|
function compileFn(compilerCtx, task) {
|
|
8
|
-
return (src) => src.pipe((0, rxjs_1.
|
|
19
|
+
return (src) => src.pipe((0, rxjs_1.tap)({
|
|
20
|
+
complete: () => compilerCtx.log.debug('fn.complete'),
|
|
21
|
+
}), (0, rxjs_1.mergeMap)(async (ctx) => {
|
|
9
22
|
return await compilerCtx.tracer.startActiveSpan(`fn-${task.id}`, async (span) => {
|
|
10
|
-
ctx = await (0, supervisor_js_1.sendTaskStartEvent)(task.id, ctx, span);
|
|
11
23
|
span.setAttribute('task.id', task.id);
|
|
12
|
-
span.setAttribute('type', 'task');
|
|
13
|
-
span.setAttribute('task.type', 'fn');
|
|
14
24
|
span.setAttribute('execution.id', ctx.executionId);
|
|
15
|
-
span.setAttribute('workflow.id', ctx.options.workflowId || 'unknown-workflow');
|
|
16
25
|
try {
|
|
17
|
-
let result;
|
|
18
|
-
const spanContext = span.spanContext();
|
|
19
|
-
const ctxWithLogger = ctx.withLogger(ctx.log.child({ spanId: spanContext.spanId, traceId: spanContext.traceId }));
|
|
20
26
|
if (typeof ctx.idx === 'number') {
|
|
21
|
-
|
|
27
|
+
return ctx.withData(await task._fn(ctx, ctx.idx));
|
|
22
28
|
}
|
|
23
|
-
|
|
24
|
-
result = ctx.withData(await task._fn(ctxWithLogger));
|
|
25
|
-
}
|
|
26
|
-
if (supervisor_js_1.enabled) {
|
|
27
|
-
span.setAttribute('response.body', JSON.stringify(result.data));
|
|
28
|
-
}
|
|
29
|
-
span.setAttribute('status', 'pass');
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
if (error instanceof Error) {
|
|
34
|
-
span.setAttribute('status', 'fail');
|
|
35
|
-
span.recordException(error);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
span.recordException(new Error(String(error)));
|
|
39
|
-
}
|
|
40
|
-
throw error;
|
|
29
|
+
return ctx.withData(await task._fn(ctx));
|
|
41
30
|
}
|
|
42
31
|
finally {
|
|
43
32
|
span.end();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/http.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAmB,YAAY,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/http.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAmB,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAE/E,OAAO,EAA2B,YAAY,EAAE,MAAM,YAAY,CAAC;AAqFnE,eAAO,MAAM,YAAY,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAG5E,CAAC"}
|
|
@@ -14,32 +14,19 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.httpCompiler = void 0;
|
|
16
16
|
const rxjs_1 = require("rxjs");
|
|
17
|
+
const operators_1 = require("rxjs/operators");
|
|
17
18
|
const DynamicFetchFactory_js_1 = require("../../../connection/DynamicFetchFactory.js");
|
|
18
|
-
const FetchBuilder_js_1 = require("../../../connection/internal/FetchBuilder.js");
|
|
19
19
|
const StaticFetchFactory_js_1 = require("../../../connection/StaticFetchFactory.js");
|
|
20
20
|
const HttpTask_js_1 = require("../../../dsl/tasks/HttpTask.js");
|
|
21
|
-
const supervisor_js_1 = require("../../../internal/supervisor.js");
|
|
22
21
|
function compileHttp(compilerCtx, task) {
|
|
23
22
|
const cnxMap = compilerCtx.configReader.getCnxMapping(task.opts.connection);
|
|
24
23
|
let fetchFactory;
|
|
25
24
|
if (!cnxMap) {
|
|
26
|
-
compilerCtx.log.
|
|
27
|
-
|
|
28
|
-
// missing connection map and we are in supervised mode, so we use the fake fetcher
|
|
29
|
-
fetchFactory = Promise.resolve(new StaticFetchFactory_js_1.StaticFetchFactory(new FetchBuilder_js_1.FetchBuilder(globalThis.fetch, { name: task.opts.connection }).buildSupervisedFetch()));
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
// missing connection map and not in supervised mode, so we use global fetch
|
|
33
|
-
fetchFactory = Promise.resolve(new StaticFetchFactory_js_1.StaticFetchFactory(globalThis.fetch));
|
|
34
|
-
}
|
|
25
|
+
compilerCtx.log.error(`Connection ${task.opts.connection} not found, using default fetch with no credentials`);
|
|
26
|
+
fetchFactory = Promise.resolve(new StaticFetchFactory_js_1.StaticFetchFactory(globalThis.fetch));
|
|
35
27
|
}
|
|
36
28
|
else if (cnxMap.dynamic) {
|
|
37
|
-
|
|
38
|
-
fetchFactory = Promise.resolve(new StaticFetchFactory_js_1.StaticFetchFactory(new FetchBuilder_js_1.FetchBuilder(globalThis.fetch, { name: task.opts.connection }).buildSupervisedFetch()));
|
|
39
|
-
}
|
|
40
|
-
else {
|
|
41
|
-
fetchFactory = Promise.resolve(new DynamicFetchFactory_js_1.DynamicFetchFactory(compilerCtx.cnxFactory, compilerCtx.platformApi, compilerCtx.organisationId, cnxMap.templateId));
|
|
42
|
-
}
|
|
29
|
+
fetchFactory = Promise.resolve(new DynamicFetchFactory_js_1.DynamicFetchFactory(compilerCtx.cnxFactory, compilerCtx.platformApi, compilerCtx.organisationId, cnxMap.templateId));
|
|
43
30
|
}
|
|
44
31
|
else {
|
|
45
32
|
fetchFactory = compilerCtx.platformApi.getConnection({
|
|
@@ -49,21 +36,8 @@ function compileHttp(compilerCtx, task) {
|
|
|
49
36
|
},
|
|
50
37
|
throwOnError: true,
|
|
51
38
|
})
|
|
52
|
-
.then(({ data }) =>
|
|
53
|
-
|
|
54
|
-
// use the fake fetcher that calls the supervisor to generate a mock reponse
|
|
55
|
-
return new StaticFetchFactory_js_1.StaticFetchFactory(new FetchBuilder_js_1.FetchBuilder(globalThis.fetch, data).buildSupervisedFetch());
|
|
56
|
-
}
|
|
57
|
-
return Promise.all([compilerCtx.cnxFactory.fetcher(data), data.baseUrl ?? ''])
|
|
58
|
-
.then(([fetcher, baseUrl]) => new StaticFetchFactory_js_1.StaticFetchFactory(fetcher, baseUrl));
|
|
59
|
-
})
|
|
60
|
-
.catch((err) => {
|
|
61
|
-
compilerCtx.log.error(`Failed to get connection ${task.opts.connection}`, err);
|
|
62
|
-
if (supervisor_js_1.enabled) {
|
|
63
|
-
return new StaticFetchFactory_js_1.StaticFetchFactory(new FetchBuilder_js_1.FetchBuilder(globalThis.fetch, { name: task.opts.connection }).build());
|
|
64
|
-
}
|
|
65
|
-
throw err;
|
|
66
|
-
});
|
|
39
|
+
.then(({ data }) => Promise.all([compilerCtx.cnxFactory.fetcher(data), data.baseUrl ?? '']))
|
|
40
|
+
.then(([fetcher, baseUrl]) => new StaticFetchFactory_js_1.StaticFetchFactory(fetcher, baseUrl));
|
|
67
41
|
}
|
|
68
42
|
async function http(ctx) {
|
|
69
43
|
const [fetch, baseUrl] = await fetchFactory.then((ff) => Promise.all([ff.fetcher(ctx), ff.baseUrl(ctx)]));
|
|
@@ -71,27 +45,19 @@ function compileHttp(compilerCtx, task) {
|
|
|
71
45
|
const result = await task.fn(httpContext);
|
|
72
46
|
return ctx.withData(result);
|
|
73
47
|
}
|
|
74
|
-
return (src) => src.pipe((0,
|
|
48
|
+
return (src) => src.pipe((0, operators_1.tap)({
|
|
49
|
+
complete: () => compilerCtx.log.debug('http.complete'),
|
|
50
|
+
}), (0, rxjs_1.mergeMap)((ctx) => {
|
|
75
51
|
return compilerCtx.tracer.startActiveSpan(`http-${task.id}`, async (span) => {
|
|
76
|
-
ctx = await (0, supervisor_js_1.sendTaskStartEvent)(task.id, ctx, span);
|
|
77
52
|
span.setAttribute('task.id', task.id);
|
|
78
53
|
span.setAttribute('task.type', 'http');
|
|
79
|
-
span.setAttribute('type', 'task');
|
|
80
54
|
span.setAttribute('execution.id', ctx.executionId);
|
|
81
55
|
span.setAttribute('connection.name', task.opts.connection);
|
|
82
|
-
span.setAttribute('workflow.id', ctx.options.workflowId || 'unknown-workflow');
|
|
83
|
-
const spanContext = span.spanContext();
|
|
84
56
|
try {
|
|
85
|
-
|
|
86
|
-
if (supervisor_js_1.enabled) {
|
|
87
|
-
span.setAttribute('response.body', JSON.stringify(newCtx.data));
|
|
88
|
-
}
|
|
89
|
-
span.setAttribute('status', 'pass');
|
|
90
|
-
return newCtx;
|
|
57
|
+
return await http(ctx);
|
|
91
58
|
}
|
|
92
59
|
catch (error) {
|
|
93
60
|
if (error instanceof Error) {
|
|
94
|
-
span.setAttribute('status', 'fail');
|
|
95
61
|
span.recordException(error);
|
|
96
62
|
}
|
|
97
63
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/schedule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schedule.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/schedule.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEzF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAyI7C,eAAO,MAAM,gBAAgB,EAAE,eAAe,CAAC,YAAY,EAAE,eAAe,CAG3E,CAAC"}
|
|
@@ -14,9 +14,8 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.scheduleCompiler = void 0;
|
|
16
16
|
const rxjs_1 = require("rxjs");
|
|
17
|
+
const constants_js_1 = require("../../../dsl/http/versori/constants.js");
|
|
17
18
|
const ScheduleTrigger_js_1 = require("../../../dsl/triggers/ScheduleTrigger.js");
|
|
18
|
-
const constants_js_1 = require("../../../internal/constants.js");
|
|
19
|
-
const supervisor_js_1 = require("../../../internal/supervisor.js");
|
|
20
19
|
function compileSchedule(ctx, trigger, signal) {
|
|
21
20
|
return new rxjs_1.Observable((subscriber) => {
|
|
22
21
|
// Add HTTP endpoint for manual triggering
|
|
@@ -29,43 +28,8 @@ function compileSchedule(ctx, trigger, signal) {
|
|
|
29
28
|
const orgId = Deno.env.get(constants_js_1.envVarOrgId) || 'example-org';
|
|
30
29
|
const client = ctx.platformApi;
|
|
31
30
|
ctx.cronRegistry.set(trigger.id, trigger.schedule);
|
|
32
|
-
async function handleSchedule(
|
|
31
|
+
async function handleSchedule(_req, res, span) {
|
|
33
32
|
try {
|
|
34
|
-
// run for a single activation
|
|
35
|
-
const activationId = req.params.activationId;
|
|
36
|
-
if (activationId) {
|
|
37
|
-
const { data: activation } = await client.getActivation({
|
|
38
|
-
path: {
|
|
39
|
-
organisation_id: ctx.organisationId,
|
|
40
|
-
environment_id: environmentId,
|
|
41
|
-
activation_id: activationId,
|
|
42
|
-
},
|
|
43
|
-
throwOnError: false,
|
|
44
|
-
});
|
|
45
|
-
if (!activation) {
|
|
46
|
-
res.status(412).json({
|
|
47
|
-
status: 'error',
|
|
48
|
-
message: `No activation found for ID: ${activationId}`,
|
|
49
|
-
});
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
const executionCtx = ctx.contextProvider.create(activation, {}, { workflowId: trigger.id });
|
|
53
|
-
span.setAttribute('execution.id', executionCtx.executionId);
|
|
54
|
-
await (0, supervisor_js_1.sendTaskStartEvent)(trigger.id, executionCtx, span);
|
|
55
|
-
try {
|
|
56
|
-
ctx.log.info(`Running schedule ${trigger.id} for activation ${activationId}`);
|
|
57
|
-
subscriber.next(executionCtx);
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
executionCtx.log.error('execution error inside schedule', { error });
|
|
61
|
-
}
|
|
62
|
-
res.status(200).json({
|
|
63
|
-
status: 'triggered',
|
|
64
|
-
executionId: executionCtx.executionId,
|
|
65
|
-
});
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
// run for static activation only
|
|
69
33
|
if (trigger.activationPredicate === undefined) {
|
|
70
34
|
const { data: activation } = await client.listActivations({
|
|
71
35
|
path: {
|
|
@@ -84,9 +48,8 @@ function compileSchedule(ctx, trigger, signal) {
|
|
|
84
48
|
});
|
|
85
49
|
return;
|
|
86
50
|
}
|
|
87
|
-
const executionCtx = ctx.contextProvider.create(activation[0], {}
|
|
51
|
+
const executionCtx = ctx.contextProvider.create(activation[0], {});
|
|
88
52
|
span.setAttribute('execution.id', executionCtx.executionId);
|
|
89
|
-
await (0, supervisor_js_1.sendTaskStartEvent)(trigger.id, executionCtx, span);
|
|
90
53
|
try {
|
|
91
54
|
subscriber.next(executionCtx);
|
|
92
55
|
}
|
|
@@ -99,7 +62,6 @@ function compileSchedule(ctx, trigger, signal) {
|
|
|
99
62
|
});
|
|
100
63
|
return;
|
|
101
64
|
}
|
|
102
|
-
// run for all activations
|
|
103
65
|
const { data: activations } = await client.listActivations({
|
|
104
66
|
path: {
|
|
105
67
|
organisation_id: ctx.organisationId,
|
|
@@ -118,9 +80,8 @@ function compileSchedule(ctx, trigger, signal) {
|
|
|
118
80
|
return;
|
|
119
81
|
}
|
|
120
82
|
activations.forEach((activation) => {
|
|
121
|
-
const executionCtx = ctx.contextProvider.create(activation, {}
|
|
83
|
+
const executionCtx = ctx.contextProvider.create(activation, {});
|
|
122
84
|
try {
|
|
123
|
-
ctx.log.info(`Running schedule ${trigger.id} for activation ${activation.id}`);
|
|
124
85
|
subscriber.next(executionCtx);
|
|
125
86
|
}
|
|
126
87
|
catch (error) {
|
|
@@ -138,29 +99,11 @@ function compileSchedule(ctx, trigger, signal) {
|
|
|
138
99
|
await ctx.tracer.startActiveSpan(`schedule-${trigger.id}`, async (span) => {
|
|
139
100
|
span.setAttribute('task.id', trigger.id);
|
|
140
101
|
span.setAttribute('task.type', 'schedule');
|
|
141
|
-
span.setAttribute('type', 'task');
|
|
142
|
-
span.setAttribute('schedule', trigger.schedule);
|
|
143
|
-
span.setAttribute('project.id', projectId);
|
|
144
|
-
span.setAttribute('environment.id', environmentId);
|
|
145
|
-
span.setAttribute('environment.name', environmentName);
|
|
146
|
-
span.setAttribute('org.id', orgId);
|
|
147
|
-
span.setAttribute('workflow.id', trigger.id);
|
|
148
|
-
await handleSchedule(req, res, span);
|
|
149
|
-
span.end();
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
ctx.cronRouter.post(`/cron/${trigger.id}/activations/:activationId`, async (req, res) => {
|
|
153
|
-
await ctx.tracer.startActiveSpan(`schedule-${trigger.id}`, async (span) => {
|
|
154
|
-
span.setAttribute('task.id', trigger.id);
|
|
155
|
-
span.setAttribute('activation.id', req.params.activationId);
|
|
156
|
-
span.setAttribute('task.type', 'schedule');
|
|
157
|
-
span.setAttribute('type', 'task');
|
|
158
102
|
span.setAttribute('schedule', trigger.schedule);
|
|
159
103
|
span.setAttribute('project.id', projectId);
|
|
160
104
|
span.setAttribute('environment.id', environmentId);
|
|
161
105
|
span.setAttribute('environment.name', environmentName);
|
|
162
106
|
span.setAttribute('org.id', orgId);
|
|
163
|
-
span.setAttribute('workflow.id', trigger.id);
|
|
164
107
|
await handleSchedule(req, res, span);
|
|
165
108
|
span.end();
|
|
166
109
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/webhook.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/memory/compilers/webhook.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AAGtF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAuD7C,eAAO,MAAM,eAAe,EAAE,eAAe,CAAC,WAAW,EAAE,cAAc,CA0SxE,CAAC"}
|
|
@@ -24,7 +24,6 @@ const rxjs_1 = require("rxjs");
|
|
|
24
24
|
const webhookmiddleware_js_1 = require("../../../dsl/http/versori/webhookmiddleware.js");
|
|
25
25
|
const WebhookTrigger_js_1 = require("../../../dsl/triggers/WebhookTrigger.js");
|
|
26
26
|
const constants_js_1 = require("../../../internal/constants.js");
|
|
27
|
-
const supervisor_js_1 = require("../../../internal/supervisor.js");
|
|
28
27
|
const xml2jsDefaults = {
|
|
29
28
|
explicitArray: false,
|
|
30
29
|
normalize: false,
|
|
@@ -91,7 +90,6 @@ exports.webhookCompiler = {
|
|
|
91
90
|
onError = trigger.options.response.onError;
|
|
92
91
|
}
|
|
93
92
|
const ctxOptionsFn = (req, res) => ({
|
|
94
|
-
workflowId: trigger.id,
|
|
95
93
|
onSuccess: (ctx) => {
|
|
96
94
|
if (isSync) {
|
|
97
95
|
sendResponse(res, onSuccess(ctx));
|
|
@@ -112,7 +110,6 @@ exports.webhookCompiler = {
|
|
|
112
110
|
else {
|
|
113
111
|
routeMiddleware.push(express_1.default.raw({ type: '*/*', limit: '50mb' }));
|
|
114
112
|
}
|
|
115
|
-
ctx.webhookRegistry.set(trigger.id, { method, path: `/${trigger.id}`, options: trigger.options });
|
|
116
113
|
return new rxjs_1.Observable((subscriber) => {
|
|
117
114
|
if (!ctx.webhookRouter) {
|
|
118
115
|
throw new Error('Router not available in compiler context');
|
|
@@ -138,13 +135,12 @@ exports.webhookCompiler = {
|
|
|
138
135
|
cfgReader: ctx.configReader,
|
|
139
136
|
log: ctx.log,
|
|
140
137
|
}), async (req, res) => {
|
|
141
|
-
await ctx.tracer.startActiveSpan(`webhook-${trigger.id}`,
|
|
138
|
+
await ctx.tracer.startActiveSpan(`webhook-${trigger.id}`, (span) => {
|
|
142
139
|
span.setAttribute('task.id', trigger.id);
|
|
143
140
|
span.setAttribute('task.type', 'webhook');
|
|
144
141
|
const staticActivation = res.locals.activation;
|
|
145
142
|
const executionCtx = ctx.contextProvider.create(staticActivation, req.body, ctxOptionsFn(req, res));
|
|
146
143
|
span.setAttribute('execution.id', executionCtx.executionId);
|
|
147
|
-
await (0, supervisor_js_1.sendTaskStartEvent)(trigger.id, executionCtx, span);
|
|
148
144
|
try {
|
|
149
145
|
subscriber.next(executionCtx);
|
|
150
146
|
if (isAsync) {
|
|
@@ -175,7 +171,7 @@ exports.webhookCompiler = {
|
|
|
175
171
|
cfgReader: ctx.configReader,
|
|
176
172
|
log: ctx.log,
|
|
177
173
|
}), async (req, res) => {
|
|
178
|
-
await ctx.tracer.startActiveSpan(`webhook-${trigger.id}`,
|
|
174
|
+
await ctx.tracer.startActiveSpan(`webhook-${trigger.id}`, (span) => {
|
|
179
175
|
span.setAttribute('task.id', trigger.id);
|
|
180
176
|
span.setAttribute('task.type', 'webhook');
|
|
181
177
|
span.setAttribute('user.id', req.params.userId);
|
|
@@ -196,7 +192,6 @@ exports.webhookCompiler = {
|
|
|
196
192
|
}
|
|
197
193
|
const executionCtx = ctx.contextProvider.create(activation, req.body, ctxOptionsFn(req, res));
|
|
198
194
|
span.setAttribute('execution.id', executionCtx.executionId);
|
|
199
|
-
await (0, supervisor_js_1.sendTaskStartEvent)(trigger.id, executionCtx, span);
|
|
200
195
|
const errors = [];
|
|
201
196
|
try {
|
|
202
197
|
subscriber.next(executionCtx);
|
|
@@ -232,7 +227,7 @@ exports.webhookCompiler = {
|
|
|
232
227
|
cfgReader: ctx.configReader,
|
|
233
228
|
log: ctx.log,
|
|
234
229
|
}), async (req, res) => {
|
|
235
|
-
await ctx.tracer.startActiveSpan(`webhook-${trigger.id}`,
|
|
230
|
+
await ctx.tracer.startActiveSpan(`webhook-${trigger.id}`, (span) => {
|
|
236
231
|
span.setAttribute('task.id', trigger.id);
|
|
237
232
|
span.setAttribute('task.type', 'webhook');
|
|
238
233
|
span.setAttribute('activation.id', req.params.activationId);
|
|
@@ -251,7 +246,6 @@ exports.webhookCompiler = {
|
|
|
251
246
|
}
|
|
252
247
|
const activationCtx = ctx.contextProvider.create(activation, req.body, ctxOptionsFn(req, res));
|
|
253
248
|
span.setAttribute('execution.id', activationCtx.executionId);
|
|
254
|
-
await (0, supervisor_js_1.sendTaskStartEvent)(trigger.id, activationCtx, span);
|
|
255
249
|
try {
|
|
256
250
|
subscriber.next(activationCtx);
|
|
257
251
|
if (isAsync) {
|
|
@@ -86,7 +86,6 @@ export declare class VanillaInterpreter {
|
|
|
86
86
|
private cronServer?;
|
|
87
87
|
private shutdownServer?;
|
|
88
88
|
private isShuttingDown;
|
|
89
|
-
private wfRegistration;
|
|
90
89
|
constructor(log: Logger, compiler: ObservableCompiler, contextProvider: ContextProvider, webhookRouter: Router, cronRouter: Router, cronRegistry: Map<string, string>, cnxFetchFactory: DefaultConnectionFactory, cronProvider: CronProvider, tracer: Tracer, cfgReader: ConfigReader, queueProvider: QueueAPI, otelSDK?: NodeSDK | undefined);
|
|
91
90
|
static newInstance(options?: VanillaInterpreterOptions): Promise<VanillaInterpreter>;
|
|
92
91
|
register<O>(workflow: Workflow<O>, options?: VanillaInterpreterOptions): Registration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VanillaInterpreter.d.ts","sourceRoot":"","sources":["../../../../src/src/interpreter/vanilla/VanillaInterpreter.ts"],"names":[],"mappings":"AAaA,OAAsB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG3D,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAgB,EAAqB,MAAM,EAAE,MAAM,SAAS,CAAC;AAE7D,OAAO,EAA+B,UAAU,EAAM,YAAY,EAAO,MAAM,MAAM,CAAC;AACtF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAarE,OAAO,EAAE,QAAQ,EAAgB,MAAM,uBAAuB,CAAC;AAM/D,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAa,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAA0B,MAAM,yBAAyB,CAAC;AAErF;;;GAGG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACpC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAE9B;;OAEG;IACH,eAAe,CAAC,EAAE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OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAlB7B,OAAO,CAAC,mBAAmB,CAA2B;IACtD,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,UAAU,CAAC,CAAS;IAC5B,OAAO,CAAC,cAAc,CAAC,CAAa;IACpC,OAAO,CAAC,cAAc,CAAS;gBAGV,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,kBAAkB,EAC5B,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,eAAe,EAAE,wBAAwB,EACzC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,YAAY,EACvB,aAAa,EAAE,QAAQ,EACvB,OAAO,CAAC,EAAE,OAAO,YAAA;WASzB,WAAW,CAAC,OAAO,GAAE,yBAA8B,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA6F9F,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,yBAAyB;IAsDtE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAoMtB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CASxB"}
|
|
@@ -25,8 +25,7 @@ const rxjs_1 = require("rxjs");
|
|
|
25
25
|
const VanillaConnectionFactory_js_1 = require("../../connection/VanillaConnectionFactory.js");
|
|
26
26
|
const VanillaContext_js_1 = require("../../context/VanillaContext.js");
|
|
27
27
|
const configloader_js_1 = require("../../dsl/http/versori/configloader.js");
|
|
28
|
-
const constants_js_1 = require("../../
|
|
29
|
-
const supervisor_js_1 = require("../../internal/supervisor.js");
|
|
28
|
+
const constants_js_1 = require("../../dsl/http/versori/constants.js");
|
|
30
29
|
const cronapi_js_1 = require("../../dsl/http/versori/cronapi.js");
|
|
31
30
|
const Workflow_js_1 = require("../../dsl/Workflow.js");
|
|
32
31
|
const Issues_js_1 = require("../../issues/Issues.js");
|
|
@@ -35,8 +34,8 @@ const SDKKeyValueProvider_js_1 = require("../../kv/sdk/SDKKeyValueProvider.js");
|
|
|
35
34
|
const ConsoleLogger_js_1 = require("../../observability/logging/ConsoleLogger.js");
|
|
36
35
|
const Queue_js_1 = require("../durable/Queue.js");
|
|
37
36
|
const ObservableCompiler_js_1 = require("./ObservableCompiler.js");
|
|
38
|
-
function getKVProvider() {
|
|
39
|
-
if (
|
|
37
|
+
function getKVProvider(runLocal) {
|
|
38
|
+
if (runLocal) {
|
|
40
39
|
return Promise.resolve(new MemoryKeyValueProvider_js_1.MemoryKeyValueProvider());
|
|
41
40
|
}
|
|
42
41
|
return SDKKeyValueProvider_js_1.SDKKeyValueProvider.fromEnv();
|
|
@@ -168,13 +167,6 @@ class VanillaInterpreter {
|
|
|
168
167
|
writable: true,
|
|
169
168
|
value: false
|
|
170
169
|
});
|
|
171
|
-
// Workflow registration promises only used when supervisor is enabled
|
|
172
|
-
Object.defineProperty(this, "wfRegistration", {
|
|
173
|
-
enumerable: true,
|
|
174
|
-
configurable: true,
|
|
175
|
-
writable: true,
|
|
176
|
-
value: []
|
|
177
|
-
});
|
|
178
170
|
if (typeof this.log === 'undefined') {
|
|
179
171
|
throw new Error('VanillaInterpreter should not be instantiated directly. Use VanillaInterpreter.newInstance() instead.');
|
|
180
172
|
}
|
|
@@ -191,6 +183,7 @@ class VanillaInterpreter {
|
|
|
191
183
|
const otelTracesURL = Deno.env.get(constants_js_1.envVarOtelTracesURL);
|
|
192
184
|
let otelSDK;
|
|
193
185
|
const configReader = configloader_js_1.VersoriConfigReader.fromEnv(log);
|
|
186
|
+
const runLocal = Deno.env.get(constants_js_1.envVarLocalRun) === 'true';
|
|
194
187
|
await waitForReady(log);
|
|
195
188
|
// Do NOT change these attributes, they are used by the API to filter on
|
|
196
189
|
const resource = (0, resources_1.resourceFromAttributes)({
|
|
@@ -212,15 +205,6 @@ class VanillaInterpreter {
|
|
|
212
205
|
log.info('Starting OpenTelemetry SDK');
|
|
213
206
|
otelSDK.start();
|
|
214
207
|
}
|
|
215
|
-
else if (supervisor_js_1.enabled) {
|
|
216
|
-
otelSDK = new sdk_node_1.NodeSDK({
|
|
217
|
-
traceExporter: new supervisor_js_1.Fake(),
|
|
218
|
-
serviceName: serviceName,
|
|
219
|
-
resource: resource,
|
|
220
|
-
});
|
|
221
|
-
log.info('Starting Testing OpenTelemetry SDK');
|
|
222
|
-
otelSDK.start();
|
|
223
|
-
}
|
|
224
208
|
const tracer = api_1.default.trace.getTracer(serviceName, version);
|
|
225
209
|
const queueProvider = await Queue_js_1.QueueImpl.fromEnv(log);
|
|
226
210
|
const connectionFactory = new VanillaConnectionFactory_js_1.DefaultConnectionFactory();
|
|
@@ -228,7 +212,7 @@ class VanillaInterpreter {
|
|
|
228
212
|
if (options.contextProvider) {
|
|
229
213
|
return new VanillaInterpreter(log, compiler, options.contextProvider, express_1.default.Router(), express_1.default.Router(), new Map(), connectionFactory, cronapi_js_1.CronAPIClient.fromEnv(), tracer, configReader, queueProvider, otelSDK);
|
|
230
214
|
}
|
|
231
|
-
const kvp = await getKVProvider();
|
|
215
|
+
const kvp = await getKVProvider(runLocal);
|
|
232
216
|
const organisationId = Deno.env.get(constants_js_1.envVarOrgId) || 'development';
|
|
233
217
|
const environmentId = Deno.env.get(constants_js_1.envVarEnvId) || 'development';
|
|
234
218
|
const ctxProvider = new VanillaContext_js_1.VanillaContextProvider(log, kvp, organisationId, environmentId, issuesProvider, queueProvider);
|
|
@@ -271,12 +255,9 @@ class VanillaInterpreter {
|
|
|
271
255
|
},
|
|
272
256
|
};
|
|
273
257
|
this.registeredWorkflows.push(registration);
|
|
274
|
-
if (supervisor_js_1.enabled) {
|
|
275
|
-
this.wfRegistration.push((0, supervisor_js_1.registerWorkflow)(workflow));
|
|
276
|
-
}
|
|
277
258
|
return registration;
|
|
278
259
|
}
|
|
279
|
-
|
|
260
|
+
start() {
|
|
280
261
|
const port = Deno.env.get('PORT') || 3000;
|
|
281
262
|
const cronPort = Deno.env.get('CRON_PORT') || 3001;
|
|
282
263
|
const webhookApp = (0, express_1.default)();
|
|
@@ -385,7 +366,6 @@ class VanillaInterpreter {
|
|
|
385
366
|
if (this.cronServer) {
|
|
386
367
|
this.cronServer.close();
|
|
387
368
|
}
|
|
388
|
-
this.otelSDK?.shutdown();
|
|
389
369
|
for (const registration of this.registeredWorkflows) {
|
|
390
370
|
Deno.removeSignalListener('SIGINT', registration.sigintListener);
|
|
391
371
|
if (registration.subscription) {
|
|
@@ -398,10 +378,6 @@ class VanillaInterpreter {
|
|
|
398
378
|
}
|
|
399
379
|
};
|
|
400
380
|
Deno.addSignalListener('SIGINT', this.shutdownServer);
|
|
401
|
-
if (supervisor_js_1.enabled) {
|
|
402
|
-
await Promise.all(this.wfRegistration);
|
|
403
|
-
await (0, supervisor_js_1.signalReady)();
|
|
404
|
-
}
|
|
405
381
|
return new Promise((resolve) => {
|
|
406
382
|
let serversClosed = 0;
|
|
407
383
|
const totalServers = [this.webhookServer, this.cronServer].filter(Boolean).length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durableworkflow.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/vanilla/compilers/durableworkflow.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EACH,mBAAmB,EACnB,sBAAsB,EACzB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAqB,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"durableworkflow.d.ts","sourceRoot":"","sources":["../../../../../src/src/interpreter/vanilla/compilers/durableworkflow.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,OAAO,EACH,mBAAmB,EACnB,sBAAsB,EACzB,MAAM,yCAAyC,CAAC;AAEjD,OAAO,EAAqB,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAGpE,wBAAgB,sBAAsB,CAClC,GAAG,EAAE,sBAAsB,EAC3B,OAAO,EAAE,sBAAsB,EAC/B,MAAM,EAAE,WAAW,GACpB,UAAU,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,CA+HjD;AAED,eAAO,MAAM,uBAAuB,EAAE,eAAe,CAAC,mBAAmB,EAAE,sBAAsB,CAI5F,CAAC"}
|
|
@@ -18,6 +18,7 @@ const mod_js_1 = require("../../../../deps/jsr.io/@std/ulid/1.0.0/mod.js");
|
|
|
18
18
|
const rxjs_1 = require("rxjs");
|
|
19
19
|
const DurableTrigger_js_1 = require("../../../dsl/triggers/DurableTrigger.js");
|
|
20
20
|
const ObservableCompiler_js_1 = require("../ObservableCompiler.js");
|
|
21
|
+
const tracePropagation_js_1 = require("../../../observability/tracePropagation.js");
|
|
21
22
|
function compileDurableWorkflow(ctx, trigger, signal) {
|
|
22
23
|
return new rxjs_1.Observable((subscriber) => {
|
|
23
24
|
function cleanup() {
|
|
@@ -44,17 +45,26 @@ function compileDurableWorkflow(ctx, trigger, signal) {
|
|
|
44
45
|
continue;
|
|
45
46
|
}
|
|
46
47
|
for (const wf of wfs.workflows) {
|
|
47
|
-
|
|
48
|
+
// If the metadata carries a traceparent, extractTraceContext returns a
|
|
49
|
+
// context with the remote span as parent; otherwise it returns the
|
|
50
|
+
// current active context, which causes startActiveSpan to create a new
|
|
51
|
+
// root span (new trace). Either way the SDK does the right thing.
|
|
52
|
+
const parentCtx = (0, tracePropagation_js_1.extractTraceContext)(wf.metadata);
|
|
53
|
+
await ctx.tracer.startActiveSpan(`durableworkflow-${trigger.id}`, {}, parentCtx, (span) => {
|
|
48
54
|
span.setAttribute('task.id', trigger.id);
|
|
49
55
|
span.setAttribute('task.type', 'durableworkflow');
|
|
50
56
|
span.setAttribute('execution.id', wf.metadata?.executionId ?? '');
|
|
51
57
|
if (wf.metadata?.activationId) {
|
|
52
58
|
span.setAttribute('activation.id', wf.metadata.activationId);
|
|
53
59
|
}
|
|
60
|
+
if (wf.metadata?.traceparent) {
|
|
61
|
+
span.setAttribute('trace.continuation', true);
|
|
62
|
+
}
|
|
54
63
|
try {
|
|
55
64
|
const payload = wf.payload ? atob(wf.payload) : '{}';
|
|
56
65
|
const data = JSON.parse(payload);
|
|
57
|
-
const newContext = ctx.contextProvider
|
|
66
|
+
const newContext = ctx.contextProvider
|
|
67
|
+
.createWithExecutionId(ObservableCompiler_js_1.VanillaActivation, data, wf.metadata?.executionId ?? (0, mod_js_1.ulid)().toString(), {
|
|
58
68
|
workflow: wf,
|
|
59
69
|
onSuccess: (completedContext) => {
|
|
60
70
|
const opts = completedContext.options;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.scheduleCompiler = void 0;
|
|
16
16
|
const rxjs_1 = require("rxjs");
|
|
17
|
-
const constants_js_1 = require("../../../
|
|
17
|
+
const constants_js_1 = require("../../../dsl/http/versori/constants.js");
|
|
18
18
|
const ScheduleTrigger_js_1 = require("../../../dsl/triggers/ScheduleTrigger.js");
|
|
19
19
|
const ObservableCompiler_js_1 = require("../ObservableCompiler.js");
|
|
20
20
|
function compileSchedule(ctx, trigger, signal) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Issues.d.ts","sourceRoot":"","sources":["../../../src/src/issues/Issues.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Issues.d.ts","sourceRoot":"","sources":["../../../src/src/issues/Issues.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CA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AI,CAAC,CAAC;CAC7B;AAED,qBAAa,SAAU,YAAW,QAAQ;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IAExC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAS;IAClC,OAAO,CAAC,GAAG,CAAS;gBAER,GAAG,EAAE,MAAM;IA2BjB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAQpD,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;QACtC,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;KAC3B,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;YAWX,MAAM;CA2DvB;AAED,qBAAa,UAAW,YAAW,QAAQ;IACvC,WAAW,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1C,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE;QACnC,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,cAAc,CAAC,EAAE,MAAM,CAAC;KAC3B,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;CAG5B"}
|
|
@@ -14,8 +14,7 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.MockIssues = exports.IssueImpl = void 0;
|
|
16
16
|
const node_crypto_1 = require("node:crypto");
|
|
17
|
-
const constants_js_1 = require("../
|
|
18
|
-
const supervisor_js_1 = require("../internal/supervisor.js");
|
|
17
|
+
const constants_js_1 = require("../dsl/http/versori/constants.js");
|
|
19
18
|
class IssueImpl {
|
|
20
19
|
constructor(log) {
|
|
21
20
|
Object.defineProperty(this, "baseUrl", {
|
|
@@ -111,10 +110,6 @@ class IssueImpl {
|
|
|
111
110
|
issue.annotations['environmentId'] = this.environmentId;
|
|
112
111
|
issue.annotations['organisationId'] = this.organisationId;
|
|
113
112
|
try {
|
|
114
|
-
if (supervisor_js_1.enabled) {
|
|
115
|
-
this.log.info('Issue to be submitted', { issue: issue });
|
|
116
|
-
return Promise.resolve(null);
|
|
117
|
-
}
|
|
118
113
|
const response = await fetch(`${this.baseUrl}/v1/issues/submit`, {
|
|
119
114
|
method: 'POST',
|
|
120
115
|
headers: {
|
|
@@ -67,10 +67,13 @@ export interface KeyValue {
|
|
|
67
67
|
* KeyValueScope determines the visibility and lifetime of key-value data.
|
|
68
68
|
*
|
|
69
69
|
* - `:execution:` - Data scoped to a single workflow execution (deleted after execution completes).
|
|
70
|
-
* - `:project:` -
|
|
70
|
+
* - `:project:` - Contrary to the name this scopes the KV to the current activation, not the project.
|
|
71
|
+
* - `:workspace:` - Data scoped to the true project (shared across all activations within the project).
|
|
71
72
|
* - `:organization:` - Data scoped to the organization (shared across all projects).
|
|
73
|
+
* - `:user:` - Data scoped to the current user based on the external_id of the activation.
|
|
74
|
+
*
|
|
72
75
|
*/
|
|
73
|
-
export type KeyValueScope = ':execution:' | ':project:' | ':organization:';
|
|
76
|
+
export type KeyValueScope = ':execution:' | ':project:' | ':workspace:' | ':organization:' | ':user:';
|
|
74
77
|
/**
|
|
75
78
|
* KVOptionsExecution specifies options for opening an execution-scoped KV store.
|
|
76
79
|
*/
|
|
@@ -79,7 +82,7 @@ export type KVOptionsExecution = {
|
|
|
79
82
|
executionId: string;
|
|
80
83
|
};
|
|
81
84
|
/**
|
|
82
|
-
* KVOptionsNotExecution specifies options for opening project or
|
|
85
|
+
* KVOptionsNotExecution specifies options for opening project, workspace, organization, or user-scoped KV stores.
|
|
83
86
|
*/
|
|
84
87
|
export type KVOptionsNotExecution = {
|
|
85
88
|
scope: Exclude<KeyValueScope, ':execution:'>;
|
|
@@ -89,6 +92,7 @@ export type KVOptionsNotExecution = {
|
|
|
89
92
|
*/
|
|
90
93
|
export type KVOptions = (KVOptionsExecution | KVOptionsNotExecution) & {
|
|
91
94
|
activationId?: string;
|
|
95
|
+
externalUserId?: string;
|
|
92
96
|
};
|
|
93
97
|
/**
|
|
94
98
|
* DestroyOptions configures which KV store to destroy.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyValue.d.ts","sourceRoot":"","sources":["../../../src/src/kv/KeyValue.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEpG,KAAK,sBAAsB,CAAC,CAAC,IAAI;IAC7B,YAAY,CAAC,EAAE,CAAC,CAAC;IACjB,eAAe,CAAC,EAAE,KAAK,CAAC;CAC3B,CAAC;AAEF,KAAK,qBAAqB,CAAC,CAAC,IAAI;IAC5B,YAAY,EAAE,CAAC,CAAC;IAChB,eAAe,CAAC,EAAE,KAAK,CAAC;CAC3B,CAAC;AAEF,KAAK,mBAAmB,CAAC,CAAC,IAAI;IAC1B,eAAe,EAAE,IAAI,CAAC;CACzB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAClB,sBAAsB,CAAC,CAAC,CAAC,GACzB,qBAAqB,CAAC,CAAC,CAAC,GACxB,mBAAmB,CAAC,CAAC,CAAC,CAAC;AAE7B;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACrB;;;;;;;;OAQG;IACH,GAAG,CAAC,CAAC,GAAG,GAAG,EACP,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EACtB,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,GAC3D,OAAO,CAAC,CAAC,CAAC,CAAC;IACd,GAAG,CAAC,CA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E,MAAM,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,gBAAgB,GAAG,QAAQ,CAAC;AAEtG;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC7B,KAAK,EAAE,aAAa,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAChC,KAAK,EAAE,OAAO,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;CAChD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,kBAAkB,GAAG,qBAAqB,CAAC,GAAG;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;;;;OAKG;IACH,EAAE,CAAC,OAAO,EAAE,SAAS,GAAG,QAAQ,CAAC;IAEjC;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stable hex fingerprint of an external user id for KV path segments.
|
|
3
|
+
* Output is `[0-9a-f]{64}` so it satisfies backends that only allow `[a-zA-Z0-9_-]+` per segment.
|
|
4
|
+
*/
|
|
5
|
+
export declare function fingerprintExternalUserId(externalUserId: string): string;
|
|
6
|
+
//# sourceMappingURL=fingerprintExternalUserId.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fingerprintExternalUserId.d.ts","sourceRoot":"","sources":["../../../src/src/kv/fingerprintExternalUserId.ts"],"names":[],"mappings":"AAeA;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAExE"}
|