@versori/run 0.4.7 → 0.5.0-alpha.2
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/connection/internal/CredentialHolder.d.ts.map +1 -1
- package/esm/src/connection/internal/CredentialHolder.js +1 -1
- package/esm/src/connection/internal/FetchBuilder.d.ts +9 -2
- package/esm/src/connection/internal/FetchBuilder.d.ts.map +1 -1
- package/esm/src/connection/internal/FetchBuilder.js +120 -4
- package/esm/src/connection/internal/OutboundConnectionFactory.d.ts.map +1 -1
- package/esm/src/connection/internal/OutboundConnectionFactory.js +2 -2
- package/esm/src/context/Context.d.ts +1 -0
- package/esm/src/context/Context.d.ts.map +1 -1
- package/esm/src/context/Context.js +3 -0
- package/esm/src/context/ContextProvider.d.ts +1 -1
- package/esm/src/context/ContextProvider.d.ts.map +1 -1
- package/esm/src/context/ContextProvider.js +2 -1
- package/esm/src/dsl/Workflow.d.ts.map +1 -1
- package/esm/src/dsl/Workflow.js +2 -0
- package/esm/src/dsl/http/types.d.ts +2 -0
- 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/cronapi.d.ts +2 -3
- package/esm/src/dsl/http/versori/cronapi.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/cronapi.js +14 -15
- package/esm/src/dsl/http/versori/kvapi/core/OpenAPI.js +1 -1
- package/esm/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/webhookmiddleware.js +77 -38
- package/esm/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/esm/src/dsl/triggers/WebhookTrigger.js +3 -1
- package/esm/src/internal/InternalAuth.d.ts +0 -1
- package/esm/src/internal/InternalAuth.d.ts.map +1 -1
- package/esm/src/internal/InternalAuth.js +1 -14
- package/esm/src/internal/constants.d.ts +3 -1
- package/esm/src/internal/constants.d.ts.map +1 -1
- package/esm/src/internal/constants.js +4 -1
- package/esm/src/internal/supervisor.d.ts +27 -0
- package/esm/src/internal/supervisor.d.ts.map +1 -0
- package/esm/src/internal/supervisor.js +179 -0
- package/esm/src/interpreter/durable/DurableInterpreter.d.ts +8 -2
- package/esm/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/durable/DurableInterpreter.js +44 -13
- package/esm/src/interpreter/durable/ObservableCompiler.d.ts +6 -1
- package/esm/src/interpreter/durable/ObservableCompiler.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 +6 -7
- package/esm/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/fn.js +19 -4
- package/esm/src/interpreter/durable/compilers/http.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/http.js +40 -7
- package/esm/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/schedule.js +2 -1
- package/esm/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/durable/compilers/webhook.js +14 -4
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts +7 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/esm/src/interpreter/memory/MemoryInterpreter.js +43 -12
- package/esm/src/interpreter/memory/ObservableCompiler.d.ts +6 -1
- 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 +8 -7
- package/esm/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/fn.js +20 -16
- package/esm/src/interpreter/memory/compilers/http.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/http.js +40 -6
- package/esm/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/schedule.js +4 -1
- package/esm/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/esm/src/interpreter/memory/compilers/webhook.js +22 -7
- package/esm/src/issues/Issues.js +1 -1
- package/esm/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/package.json +3 -1
- package/script/src/connection/internal/CredentialHolder.d.ts.map +1 -1
- package/script/src/connection/internal/CredentialHolder.js +1 -1
- package/script/src/connection/internal/FetchBuilder.d.ts +9 -2
- package/script/src/connection/internal/FetchBuilder.d.ts.map +1 -1
- package/script/src/connection/internal/FetchBuilder.js +143 -4
- package/script/src/connection/internal/OutboundConnectionFactory.d.ts.map +1 -1
- package/script/src/connection/internal/OutboundConnectionFactory.js +2 -2
- package/script/src/context/Context.d.ts +1 -0
- package/script/src/context/Context.d.ts.map +1 -1
- package/script/src/context/Context.js +3 -0
- package/script/src/context/ContextProvider.d.ts +1 -1
- package/script/src/context/ContextProvider.d.ts.map +1 -1
- package/script/src/context/ContextProvider.js +2 -1
- package/script/src/dsl/Workflow.d.ts.map +1 -1
- package/script/src/dsl/Workflow.js +2 -0
- package/script/src/dsl/http/types.d.ts +2 -0
- 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/cronapi.d.ts +2 -3
- package/script/src/dsl/http/versori/cronapi.d.ts.map +1 -1
- package/script/src/dsl/http/versori/cronapi.js +14 -15
- package/script/src/dsl/http/versori/kvapi/core/OpenAPI.js +1 -1
- package/script/src/dsl/http/versori/webhookmiddleware.d.ts.map +1 -1
- package/script/src/dsl/http/versori/webhookmiddleware.js +77 -38
- package/script/src/dsl/triggers/WebhookTrigger.d.ts.map +1 -1
- package/script/src/dsl/triggers/WebhookTrigger.js +3 -1
- package/script/src/internal/InternalAuth.d.ts +0 -1
- package/script/src/internal/InternalAuth.d.ts.map +1 -1
- package/script/src/internal/InternalAuth.js +0 -13
- package/script/src/internal/constants.d.ts +3 -1
- package/script/src/internal/constants.d.ts.map +1 -1
- package/script/src/internal/constants.js +5 -2
- package/script/src/internal/supervisor.d.ts +27 -0
- package/script/src/internal/supervisor.d.ts.map +1 -0
- package/script/src/internal/supervisor.js +187 -0
- package/script/src/interpreter/durable/DurableInterpreter.d.ts +8 -2
- package/script/src/interpreter/durable/DurableInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/durable/DurableInterpreter.js +49 -18
- package/script/src/interpreter/durable/ObservableCompiler.d.ts +6 -1
- package/script/src/interpreter/durable/ObservableCompiler.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 +6 -7
- package/script/src/interpreter/durable/compilers/fn.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/fn.js +19 -4
- package/script/src/interpreter/durable/compilers/http.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/http.js +40 -7
- package/script/src/interpreter/durable/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/schedule.js +2 -1
- package/script/src/interpreter/durable/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/durable/compilers/webhook.js +14 -4
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts +7 -1
- package/script/src/interpreter/memory/MemoryInterpreter.d.ts.map +1 -1
- package/script/src/interpreter/memory/MemoryInterpreter.js +42 -11
- package/script/src/interpreter/memory/ObservableCompiler.d.ts +6 -1
- 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 +8 -7
- package/script/src/interpreter/memory/compilers/fn.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/fn.js +20 -16
- package/script/src/interpreter/memory/compilers/http.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/http.js +40 -6
- package/script/src/interpreter/memory/compilers/schedule.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/schedule.js +4 -1
- package/script/src/interpreter/memory/compilers/webhook.d.ts.map +1 -1
- package/script/src/interpreter/memory/compilers/webhook.js +22 -7
- package/script/src/issues/Issues.js +1 -1
- package/script/src/observability/logging/ConsoleLogger.d.ts.map +1 -1
- package/esm/src/dsl/http/versori/constants.d.ts +0 -20
- package/esm/src/dsl/http/versori/constants.d.ts.map +0 -1
- package/esm/src/dsl/http/versori/constants.js +0 -37
- package/esm/src/internal/cli.d.ts +0 -2
- package/esm/src/internal/cli.d.ts.map +0 -1
- package/esm/src/internal/cli.js +0 -32
- package/script/src/dsl/http/versori/constants.d.ts +0 -20
- package/script/src/dsl/http/versori/constants.d.ts.map +0 -1
- package/script/src/dsl/http/versori/constants.js +0 -40
- package/script/src/internal/cli.d.ts +0 -2
- package/script/src/internal/cli.d.ts.map +0 -1
- package/script/src/internal/cli.js +0 -35
|
@@ -11,6 +11,29 @@
|
|
|
11
11
|
* As of the Change Date, in accordance with the Business Source License,
|
|
12
12
|
* use of this software will be governed by the Apache License, Version 2.0.
|
|
13
13
|
*/
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
14
37
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
15
38
|
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
16
39
|
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
@@ -22,10 +45,12 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
22
45
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
23
46
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
24
47
|
};
|
|
25
|
-
var _FetchBuilder_base, _FetchBuilder_cnx;
|
|
48
|
+
var _FetchBuilder_base, _FetchBuilder_cnx, _FetchBuilder_tracer;
|
|
26
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
50
|
exports.FetchBuilder = void 0;
|
|
51
|
+
const api_1 = __importStar(require("@opentelemetry/api"));
|
|
28
52
|
const helpers_js_1 = require("../../dsl/http/versori/helpers.js");
|
|
53
|
+
const supervisor_js_1 = require("../../internal/supervisor.js");
|
|
29
54
|
/**
|
|
30
55
|
* FetchBuilder is used to build a fetch function which can be composed by multiple middlewares for
|
|
31
56
|
* modifying the request/response and makes the implementation of {@link ConnectionFetchFactory}
|
|
@@ -41,9 +66,17 @@ class FetchBuilder {
|
|
|
41
66
|
});
|
|
42
67
|
_FetchBuilder_base.set(this, void 0);
|
|
43
68
|
_FetchBuilder_cnx.set(this, void 0);
|
|
69
|
+
_FetchBuilder_tracer.set(this, void 0);
|
|
44
70
|
__classPrivateFieldSet(this, _FetchBuilder_base, fetch, "f");
|
|
45
71
|
__classPrivateFieldSet(this, _FetchBuilder_cnx, cnx, "f");
|
|
46
|
-
this
|
|
72
|
+
__classPrivateFieldSet(this, _FetchBuilder_tracer, api_1.default.trace.getTracer('fetch-builder', '1.0.0'), "f");
|
|
73
|
+
if (cnx.baseUrl) {
|
|
74
|
+
this.middlewares = [changeRequestbaseURLMiddleware(cnx)];
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
this.middlewares = [];
|
|
78
|
+
}
|
|
79
|
+
this.supervisedFetch = this.supervisedFetch.bind(this);
|
|
47
80
|
}
|
|
48
81
|
use(fn) {
|
|
49
82
|
this.middlewares.push(fn);
|
|
@@ -55,11 +88,100 @@ class FetchBuilder {
|
|
|
55
88
|
// order they were added
|
|
56
89
|
fetch = this.middlewares[i](fetch);
|
|
57
90
|
}
|
|
58
|
-
|
|
91
|
+
// Wrap the final fetch with OpenTelemetry tracing
|
|
92
|
+
return this.wrapWithTracing(fetch, false);
|
|
93
|
+
}
|
|
94
|
+
buildSupervisedFetch() {
|
|
95
|
+
return this.supervisedFetch();
|
|
96
|
+
}
|
|
97
|
+
// during testing the user can choose to use a real connection or AI mock.
|
|
98
|
+
// so in supervised mode this function is used instead of the normal build() function.
|
|
99
|
+
// and it will make the desition on using mock or real at runtime at the cost of performance
|
|
100
|
+
supervisedFetch() {
|
|
101
|
+
return (input, init) => {
|
|
102
|
+
let fetch = (input, init) => {
|
|
103
|
+
return (0, supervisor_js_1.mockAPIRequest)(input, __classPrivateFieldGet(this, _FetchBuilder_cnx, "f"), init);
|
|
104
|
+
};
|
|
105
|
+
for (let i = this.middlewares.length - 1; i >= 0; i--) {
|
|
106
|
+
// apply middlewares in reverse order so that the actual middleware executes in the
|
|
107
|
+
// order they were added
|
|
108
|
+
fetch = this.middlewares[i](fetch);
|
|
109
|
+
}
|
|
110
|
+
const traced = this.wrapWithTracing(fetch, true);
|
|
111
|
+
return traced(input, init);
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
wrapWithTracing(fetch, mock) {
|
|
115
|
+
const connectionId = __classPrivateFieldGet(this, _FetchBuilder_cnx, "f")?.id || '';
|
|
116
|
+
const connectionName = __classPrivateFieldGet(this, _FetchBuilder_cnx, "f")?.name || '';
|
|
117
|
+
return (input, init) => {
|
|
118
|
+
const url = getUrl(input);
|
|
119
|
+
return __classPrivateFieldGet(this, _FetchBuilder_tracer, "f").startActiveSpan(`fetch ${url}`, async (span) => {
|
|
120
|
+
// Set span attributes
|
|
121
|
+
span.setAttribute('http.url', url);
|
|
122
|
+
span.setAttribute('type', 'fetch');
|
|
123
|
+
span.setAttribute('connection.id', connectionId);
|
|
124
|
+
span.setAttribute('connection.name', connectionName);
|
|
125
|
+
span.setAttribute('isMocked', mock);
|
|
126
|
+
if (init?.method) {
|
|
127
|
+
span.setAttribute('http.method', init.method);
|
|
128
|
+
}
|
|
129
|
+
try {
|
|
130
|
+
const response = await fetch(input, init);
|
|
131
|
+
if (supervisor_js_1.enabled) {
|
|
132
|
+
// when we are in supervisor mode, we need to store the response body in the span attribute
|
|
133
|
+
// this will be shown the end-user in some UI in the future(the future is now)
|
|
134
|
+
const body = await response.clone().arrayBuffer();
|
|
135
|
+
// if response is text/* or json we store the body as a string, otherwise we store it as a base64 string
|
|
136
|
+
const contentType = response.headers.get('Content-Type');
|
|
137
|
+
span.setAttribute('response.content_type', contentType || '');
|
|
138
|
+
if (contentType && (contentType.startsWith('text/') || contentType.startsWith('application/json'))) {
|
|
139
|
+
span.setAttribute('response.body', new TextDecoder().decode(body));
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
span.setAttribute('response.body', btoa(String.fromCharCode(...new Uint8Array(body))));
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
// Record response status
|
|
146
|
+
span.setAttribute('http.status_code', response.status);
|
|
147
|
+
if (response.status >= 400) {
|
|
148
|
+
span.setStatus({
|
|
149
|
+
code: api_1.SpanStatusCode.ERROR,
|
|
150
|
+
message: `HTTP ${response.status}`,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
span.setStatus({ code: api_1.SpanStatusCode.OK });
|
|
155
|
+
}
|
|
156
|
+
return response;
|
|
157
|
+
}
|
|
158
|
+
catch (error) {
|
|
159
|
+
// Record exception
|
|
160
|
+
if (error instanceof Error) {
|
|
161
|
+
span.recordException(error);
|
|
162
|
+
span.setStatus({
|
|
163
|
+
code: api_1.SpanStatusCode.ERROR,
|
|
164
|
+
message: error.message,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
span.recordException(new Error(String(error)));
|
|
169
|
+
span.setStatus({
|
|
170
|
+
code: api_1.SpanStatusCode.ERROR,
|
|
171
|
+
message: String(error),
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
176
|
+
finally {
|
|
177
|
+
span.end();
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
};
|
|
59
181
|
}
|
|
60
182
|
}
|
|
61
183
|
exports.FetchBuilder = FetchBuilder;
|
|
62
|
-
_FetchBuilder_base = new WeakMap(), _FetchBuilder_cnx = new WeakMap();
|
|
184
|
+
_FetchBuilder_base = new WeakMap(), _FetchBuilder_cnx = new WeakMap(), _FetchBuilder_tracer = new WeakMap();
|
|
63
185
|
function changeBaseUrl(pathname, conn) {
|
|
64
186
|
const connBaseURL = conn.baseUrl;
|
|
65
187
|
// if the connection has no baseUrl set, but the pathname is a valid URL, return it as is
|
|
@@ -103,3 +225,20 @@ function changeRequestbaseURLMiddleware(conn) {
|
|
|
103
225
|
};
|
|
104
226
|
};
|
|
105
227
|
}
|
|
228
|
+
function getUrl(input) {
|
|
229
|
+
// Extract URL for span naming
|
|
230
|
+
let url;
|
|
231
|
+
if (typeof input === 'string') {
|
|
232
|
+
url = input;
|
|
233
|
+
}
|
|
234
|
+
else if (input instanceof URL) {
|
|
235
|
+
url = input.toString();
|
|
236
|
+
}
|
|
237
|
+
else if (input instanceof Request) {
|
|
238
|
+
url = input.url;
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
url = 'unknown';
|
|
242
|
+
}
|
|
243
|
+
return url;
|
|
244
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OutboundConnectionFactory.d.ts","sourceRoot":"","sources":["../../../../src/src/connection/internal/OutboundConnectionFactory.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"OutboundConnectionFactory.d.ts","sourceRoot":"","sources":["../../../../src/src/connection/internal/OutboundConnectionFactory.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC3F,OAAO,EAGH,UAAU,EAGb,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,SAAS,EAAsB,MAAM,aAAa,CAAC;AAG5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,qBAAa,yBAAyB;IAI9B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAP3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAuC;gBAGxC,iBAAiB,EAAE,iBAAiB,EACpC,WAAW,EAAE,MAAM,CAAC,OAAO,kBAAkB,CAAC,iBAAiB,CAAC,EAChE,MAAM,EAAE,MAAM,CAAC,OAAO,QAAQ,CAAC,YAAY,CAAC,EAC5C,MAAM,EAAE,MAAM,CAAC,OAAO,QAAQ,CAAC,oBAAoB,CAAC,EACpD,MAAM,EAAE,MAAM;IAKnC,OAAO,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;YAkB9B,YAAY;IAmB1B,OAAO,CAAC,eAAe;YAiDT,0BAA0B;YAwB1B,qBAAqB;IA4DnC,OAAO,CAAC,2BAA2B;IAuBnC,OAAO,CAAC,0BAA0B;IAkDlC,OAAO,CAAC,2BAA2B;YA0BrB,wBAAwB;YAoCxB,qBAAqB;IAmCnC,OAAO,CAAC,8BAA8B;IAsBtC,OAAO,CAAC,2BAA2B;YA2ErB,wBAAwB;YAmCxB,qBAAqB;IAiDnC,OAAO,CAAC,kCAAkC;CAsB7C"}
|
|
@@ -17,11 +17,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.OutboundConnectionFactory = void 0;
|
|
19
19
|
const lru_cache_1 = require("lru-cache");
|
|
20
|
+
const node_crypto_1 = require("node:crypto");
|
|
21
|
+
const oauth_1_0a_1 = __importDefault(require("oauth-1.0a"));
|
|
20
22
|
const isTokenValid_js_1 = require("../../services/credentials/isTokenValid.js");
|
|
21
23
|
const CredentialHolder_js_1 = require("./CredentialHolder.js");
|
|
22
24
|
const FetchBuilder_js_1 = require("./FetchBuilder.js");
|
|
23
|
-
const oauth_1_0a_1 = __importDefault(require("oauth-1.0a"));
|
|
24
|
-
const node_crypto_1 = require("node:crypto");
|
|
25
25
|
class OutboundConnectionFactory {
|
|
26
26
|
constructor(httpClientFactory, credentials, tokens, oauth1, logger) {
|
|
27
27
|
Object.defineProperty(this, "httpClientFactory", {
|
|
@@ -122,6 +122,7 @@ export declare class ContextImpl<D, Index = void> implements Context<D> {
|
|
|
122
122
|
get workflowId(): string | undefined;
|
|
123
123
|
setIndex(idx: number): ContextImpl<D, number>;
|
|
124
124
|
withData<D2>(data: D2): ContextImpl<D2, Index>;
|
|
125
|
+
withLogger(log: Logger): ContextImpl<D, Index>;
|
|
125
126
|
openKv(scope?: KeyValueScope): KeyValue;
|
|
126
127
|
request(): express.Request | undefined;
|
|
127
128
|
start(group: string, opts: WorkflowOpts): Promise<AsyncWorkflow>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../../src/src/context/Context.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,KAAK,OAAO,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AACtD,MAAM,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;AAEpD,MAAM,MAAM,cAAc,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,CAAC,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,OAAO,CAAC,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF;;;;GAIG;AACH,MAAM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AAE,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAgCtE,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IAO3F,WAAW,IAAI,mBAAmB;IAUlC,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAe5C,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;CAQlD"}
|
|
@@ -114,6 +114,9 @@ class ContextImpl {
|
|
|
114
114
|
withData(data) {
|
|
115
115
|
return new ContextImpl(this.log, this.kvp, __classPrivateFieldGet(this, _ContextImpl_creds, "f"), this.executionId, this.startTime, data, __classPrivateFieldGet(this, _ContextImpl_activation, "f"), __classPrivateFieldGet(this, _ContextImpl_issues, "f"), this.queue, this.options);
|
|
116
116
|
}
|
|
117
|
+
withLogger(log) {
|
|
118
|
+
return new ContextImpl(log, this.kvp, __classPrivateFieldGet(this, _ContextImpl_creds, "f"), this.executionId, this.startTime, this.data, __classPrivateFieldGet(this, _ContextImpl_activation, "f"), __classPrivateFieldGet(this, _ContextImpl_issues, "f"), this.queue, this.options);
|
|
119
|
+
}
|
|
117
120
|
openKv(scope = ':project:') {
|
|
118
121
|
if (scope === ':execution:') {
|
|
119
122
|
return this.kvp.kv({
|
|
@@ -3,8 +3,8 @@ import { QueueAPI } from '../interpreter/durable/Queue.js';
|
|
|
3
3
|
import { IssueAPI } from '../issues/Issues.js';
|
|
4
4
|
import { KeyValueProvider } from '../kv/KeyValue.js';
|
|
5
5
|
import { Logger } from '../observability/logging/Logger.js';
|
|
6
|
-
import { Context, ContextImpl, ContextOptions } from './Context.js';
|
|
7
6
|
import { Activation, PlatformApi } from '../services/platform/mod.js';
|
|
7
|
+
import { Context, ContextImpl, ContextOptions } from './Context.js';
|
|
8
8
|
export interface ContextProvider {
|
|
9
9
|
create<D>(activation: Activation, data: D, options?: ContextOptions): ContextImpl<D, void>;
|
|
10
10
|
destroy(ctx: Context<any>): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../../../src/src/context/ContextProvider.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ContextProvider.d.ts","sourceRoot":"","sources":["../../../src/src/context/ContextProvider.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEpE,MAAM,WAAW,eAAe;IAC5B,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3F,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C;AAED,qBAAa,mBAAoB,YAAW,eAAe;IAWnD,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa;IAZlC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,gBAAgB,CAAC;IACtB,KAAK,EAAE,mBAAmB,CAAC;IAC3B,MAAM,EAAE,QAAQ,CAAC;IACjB,KAAK,CAAC,EAAE,QAAQ,CAAC;gBAGb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,gBAAgB,EACrB,KAAK,EAAE,mBAAmB,EACT,WAAW,EAAE,WAAW,EACxB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,MAAM,EACtC,MAAM,EAAE,QAAQ,EAChB,KAAK,GAAE,QAAQ,GAAG,SAAqB;IAS3C,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,GAAE,cAAmB,GAAG,WAAW,CAAC,CAAC,CAAC;IAiCxF,OAAO,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1C"}
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.ContextProviderImpl = void 0;
|
|
16
16
|
const mod_js_1 = require("../../deps/jsr.io/@std/ulid/1.0.0/mod.js");
|
|
17
|
-
const Context_js_1 = require("./Context.js");
|
|
18
17
|
const ActivationImpl_js_1 = require("./ActivationImpl.js");
|
|
18
|
+
const Context_js_1 = require("./Context.js");
|
|
19
19
|
class ContextProviderImpl {
|
|
20
20
|
constructor(log, kvp, creds, platformApi, organisationId, environmentId, issues, queue = undefined) {
|
|
21
21
|
Object.defineProperty(this, "platformApi", {
|
|
@@ -74,6 +74,7 @@ class ContextProviderImpl {
|
|
|
74
74
|
}
|
|
75
75
|
create(activation, data, options = {}) {
|
|
76
76
|
const executionId = (0, mod_js_1.ulid)();
|
|
77
|
+
console.log('Creating context for activation', activation);
|
|
77
78
|
const logger = this.log.child({
|
|
78
79
|
executionId,
|
|
79
80
|
activationId: activation.id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Workflow.d.ts","sourceRoot":"","sources":["../../../src/src/dsl/Workflow.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IACvB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE9C;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;CACvC;
|
|
1
|
+
{"version":3,"file":"Workflow.d.ts","sourceRoot":"","sources":["../../../src/src/dsl/Workflow.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;;;GAMG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IACvB;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE9C;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;CACvC;AAGD,qBAAa,YAAY,CAAC,CAAC,EAAE,CAAC,CAAE,YAAW,QAAQ,CAAC,CAAC,CAAC;IAClD,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAEL,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;IAQjD,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC;IAI7C,KAAK,CAAC,EAAE,EAAE,KAAK,EAAE,GAAG,GAAG,QAAQ,CAAC,EAAE,CAAC;CAGtC"}
|
|
@@ -218,11 +218,13 @@ export type StaticCnxMap = {
|
|
|
218
218
|
name: string;
|
|
219
219
|
dynamic: false;
|
|
220
220
|
connId: string;
|
|
221
|
+
mockWithAI: boolean;
|
|
221
222
|
};
|
|
222
223
|
export type DynamicCnxMap = {
|
|
223
224
|
name: string;
|
|
224
225
|
dynamic: true;
|
|
225
226
|
templateId: string;
|
|
227
|
+
mockWithAI: boolean;
|
|
226
228
|
};
|
|
227
229
|
export type CnxMap = StaticCnxMap | DynamicCnxMap;
|
|
228
230
|
export type VersoriSDKConfig = {
|
|
@@ -1 +1 @@
|
|
|
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,CACzB,UAAU,EAAE,UAAU,EACtB,KAAK,EAAE,WAAW,GAAG,GAAG,EACxB,IAAI,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB,MAAM,MAAM,cAAc,GAAG,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;AAEvE,MAAM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M,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,YAAY,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,YAAY,GAAG,aAAa,CAAC;AAElD,MAAM,MAAM,gBAAgB,GAAG;IAC3B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configloader.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/configloader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configloader.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/configloader.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAE,MAAM,EAAE,YAAY,EAA+B,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGlG;;;;;;;;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;CAa9C"}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.VersoriConfigReader = void 0;
|
|
16
16
|
exports.LoadConfigFromFile = LoadConfigFromFile;
|
|
17
|
-
const constants_js_1 = require("
|
|
17
|
+
const constants_js_1 = require("../../../internal/constants.js");
|
|
18
18
|
//TODO(@teo): remove this file, it is implemented in the src/config directory now.
|
|
19
19
|
/**
|
|
20
20
|
* Loads the Versori SDK configuration from a JSON file.
|
|
@@ -5,11 +5,10 @@ type Cron = {
|
|
|
5
5
|
url: string;
|
|
6
6
|
};
|
|
7
7
|
export declare class CronAPIClient implements CronProvider {
|
|
8
|
-
private baseUrl
|
|
8
|
+
private baseUrl?;
|
|
9
9
|
private envId;
|
|
10
10
|
private integrationUrl;
|
|
11
|
-
|
|
12
|
-
constructor(baseUrl: string, envId: string, integrationUrl: string);
|
|
11
|
+
constructor(envId: string, integrationUrl: string, baseUrl?: string);
|
|
13
12
|
static fromEnv(): CronAPIClient;
|
|
14
13
|
static addDefaultCronPort(url: string): string;
|
|
15
14
|
makeCronPath(name: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cronapi.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/cronapi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cronapi.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/cronapi.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,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,CAAC,CAAS;IACzB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,cAAc,CAAS;gBAEnB,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;IAMnE,MAAM,CAAC,OAAO,IAAI,aAAa;IAkB/B,MAAM,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAU9C,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAM5B,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAgC5D,UAAU,CAAC,KAAK,EAAE,IAAI,EAAE;CAsB3B"}
|
|
@@ -13,9 +13,10 @@
|
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.CronAPIClient = void 0;
|
|
16
|
-
const constants_js_1 = require("
|
|
16
|
+
const constants_js_1 = require("../../../internal/constants.js");
|
|
17
|
+
const supervisor_js_1 = require("../../../internal/supervisor.js");
|
|
17
18
|
class CronAPIClient {
|
|
18
|
-
constructor(
|
|
19
|
+
constructor(envId, integrationUrl, baseUrl) {
|
|
19
20
|
Object.defineProperty(this, "baseUrl", {
|
|
20
21
|
enumerable: true,
|
|
21
22
|
configurable: true,
|
|
@@ -34,30 +35,22 @@ class CronAPIClient {
|
|
|
34
35
|
writable: true,
|
|
35
36
|
value: void 0
|
|
36
37
|
});
|
|
37
|
-
Object.defineProperty(this, "runLocal", {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
configurable: true,
|
|
40
|
-
writable: true,
|
|
41
|
-
value: void 0
|
|
42
|
-
});
|
|
43
38
|
this.baseUrl = baseUrl;
|
|
44
39
|
this.envId = envId;
|
|
45
40
|
this.integrationUrl = integrationUrl;
|
|
46
|
-
this.runLocal = Deno.env.get(constants_js_1.envVarLocalRun) === 'true';
|
|
47
41
|
}
|
|
48
42
|
static fromEnv() {
|
|
49
|
-
const baseUrl = Deno.env.get(constants_js_1.envVarCronApiBaseURL)
|
|
50
|
-
'http://cron-api.platform.svc.cluster.local';
|
|
43
|
+
const baseUrl = Deno.env.get(constants_js_1.envVarCronApiBaseURL);
|
|
51
44
|
const envId = Deno.env.get(constants_js_1.envVarEnvId);
|
|
52
45
|
const projectId = Deno.env.get(constants_js_1.envVarProjectId);
|
|
53
46
|
const orgSlug = Deno.env.get(constants_js_1.envVarOrgSlug);
|
|
54
47
|
const envName = Deno.env.get(constants_js_1.envVarEnvironmentName);
|
|
55
|
-
if (!
|
|
48
|
+
if (!envId || !projectId || !orgSlug || !envName) {
|
|
56
49
|
throw new Error('Missing required environment variables');
|
|
57
50
|
}
|
|
58
51
|
const integrationUrl = Deno.env.get(constants_js_1.envVarSelfRefURL) ||
|
|
59
52
|
`http://svc-${projectId.toLowerCase()}-${envName.toLowerCase()}.sb-${orgSlug.toLowerCase()}.svc.cluster.local:${constants_js_1.cronPort}`;
|
|
60
|
-
return new CronAPIClient(
|
|
53
|
+
return new CronAPIClient(envId, this.addDefaultCronPort(integrationUrl), baseUrl);
|
|
61
54
|
}
|
|
62
55
|
// Check if the URL has a port, if not, add the default cron port.
|
|
63
56
|
static addDefaultCronPort(url) {
|
|
@@ -78,7 +71,13 @@ class CronAPIClient {
|
|
|
78
71
|
schedule,
|
|
79
72
|
url: this.makeCronPath(name),
|
|
80
73
|
}));
|
|
81
|
-
if (
|
|
74
|
+
if (supervisor_js_1.enabled) {
|
|
75
|
+
// if we are in supervised mode we don't want to do run crons automatically
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (!this.baseUrl) {
|
|
79
|
+
// we are no in supervised mode and there is no base URL
|
|
80
|
+
// run for local dev
|
|
82
81
|
this.runLocalFn(cronsArray);
|
|
83
82
|
return;
|
|
84
83
|
}
|
|
@@ -97,7 +96,7 @@ class CronAPIClient {
|
|
|
97
96
|
if (crons.length === 0) {
|
|
98
97
|
return;
|
|
99
98
|
}
|
|
100
|
-
const cronPort = Deno.env.get(
|
|
99
|
+
const cronPort = Deno.env.get(constants_js_1.envCronPort) || '3001';
|
|
101
100
|
console.log('----------------------------------------');
|
|
102
101
|
console.log('Running in local mode, your scheduler workflows will not trigger automatically.');
|
|
103
102
|
console.log('Instead you can trigger them by sending a request to the following URLs:');
|
|
@@ -16,7 +16,7 @@ exports.OpenAPI = void 0;
|
|
|
16
16
|
/* istanbul ignore file */
|
|
17
17
|
/* tslint:disable */
|
|
18
18
|
/* eslint-disable */
|
|
19
|
-
const constants_js_1 = require("
|
|
19
|
+
const constants_js_1 = require("../../../../../internal/constants.js");
|
|
20
20
|
exports.OpenAPI = {
|
|
21
21
|
BASE: Deno.env.get(constants_js_1.envVarSDKApiBaseURL) || 'http://localhost:8902',
|
|
22
22
|
VERSION: '1.0.0',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webhookmiddleware.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/webhookmiddleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webhookmiddleware.d.ts","sourceRoot":"","sources":["../../../../../src/src/dsl/http/versori/webhookmiddleware.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AACvD,OAAO,EAAc,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,MAAM,2BAA2B,GAAG;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,WAAW,CAAC;IACzB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,SAAS,EAAE,YAAY,CAAC;IACxB,GAAG,EAAE,MAAM,CAAC;CACf,CAAC;AAmCF,wBAAgB,6BAA6B,CACzC,IAAI,EAAE,2BAA2B,GAClC,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAsGpE;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,CAyEpE;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,CA2FpE"}
|
|
@@ -15,6 +15,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.createStaticWebhookMiddleware = createStaticWebhookMiddleware;
|
|
16
16
|
exports.createActIdDynamicWebhookMiddleware = createActIdDynamicWebhookMiddleware;
|
|
17
17
|
exports.createUserIdDynamicWebhookMiddleware = createUserIdDynamicWebhookMiddleware;
|
|
18
|
+
const mod_js_1 = require("../../../../deps/jsr.io/@std/ulid/1.0.0/mod.js");
|
|
19
|
+
const supervisor_js_1 = require("../../../internal/supervisor.js");
|
|
18
20
|
// TODO: this gets called for every request for all endpoints, can we cache this?
|
|
19
21
|
async function getStaticActivation(opts) {
|
|
20
22
|
const { data: activations } = await opts.platformApi.listActivations({
|
|
@@ -43,15 +45,39 @@ async function getStaticActivation(opts) {
|
|
|
43
45
|
}
|
|
44
46
|
// TODO: Refactor this so we don't have like three different middlewares for static and dynamic webhooks
|
|
45
47
|
function createStaticWebhookMiddleware(opts) {
|
|
48
|
+
const staticMiddleware = async (_req, res, next) => {
|
|
49
|
+
try {
|
|
50
|
+
res.locals.activation = await getStaticActivation(opts);
|
|
51
|
+
console.log("activation", res.locals.activation);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
// when working in mocks users might not be connected so there might not be an activation
|
|
55
|
+
if (supervisor_js_1.enabled) {
|
|
56
|
+
res.locals.activation = {
|
|
57
|
+
id: (0, mod_js_1.ulid)(), // random ulid used for testing
|
|
58
|
+
user: {
|
|
59
|
+
externalId: '__ai_mock_testing__',
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
next();
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
opts.log.error('Failed to get static activation', { error: err });
|
|
66
|
+
res.status(500).json({ error: 'Failed to get static activation' });
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
next();
|
|
70
|
+
};
|
|
46
71
|
if (opts.connName === undefined) {
|
|
47
72
|
opts.log.warn(`No connection ID found for webhook, accepting any requests which is unsecure!`, { webhookId: opts.id });
|
|
48
|
-
return
|
|
49
|
-
res.locals.activation = await getStaticActivation(opts);
|
|
50
|
-
next();
|
|
51
|
-
};
|
|
73
|
+
return staticMiddleware;
|
|
52
74
|
}
|
|
53
75
|
// TODO(@teo): move db access to outside of the middleware??? (genuine question - not instruction)
|
|
54
76
|
return async (req, res, next) => {
|
|
77
|
+
if (supervisor_js_1.enabled) {
|
|
78
|
+
opts.log.warn("Disabling webhook auth in test mode.");
|
|
79
|
+
return staticMiddleware(req, res, next);
|
|
80
|
+
}
|
|
55
81
|
if (!opts.connName) {
|
|
56
82
|
// This is mainly for type safety, but we should never reach this point
|
|
57
83
|
opts.log.error('Connection name is not defined for webhook middleware');
|
|
@@ -94,23 +120,31 @@ function createStaticWebhookMiddleware(opts) {
|
|
|
94
120
|
};
|
|
95
121
|
}
|
|
96
122
|
function createActIdDynamicWebhookMiddleware(opts) {
|
|
123
|
+
const staticMiddleware = async (_req, res, next) => {
|
|
124
|
+
try {
|
|
125
|
+
res.locals.activation = await getStaticActivation(opts);
|
|
126
|
+
}
|
|
127
|
+
catch (err) {
|
|
128
|
+
if (supervisor_js_1.enabled) {
|
|
129
|
+
res.locals.activation = {};
|
|
130
|
+
next();
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
opts.log.error('Failed to get static activation', { error: err });
|
|
134
|
+
res.status(500).json({ error: 'Failed to get static activation' });
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
next();
|
|
138
|
+
};
|
|
97
139
|
if (!opts.connName) {
|
|
98
140
|
opts.log.warn(`No template ID found for webhook, accepting any requests which is unsecure!`, { webhookId: opts.id });
|
|
99
|
-
return
|
|
100
|
-
const activationId = req.params.activationId;
|
|
101
|
-
const activation = await opts.platformApi.getActivation({
|
|
102
|
-
path: {
|
|
103
|
-
organisation_id: opts.organisationId,
|
|
104
|
-
environment_id: opts.environmentId,
|
|
105
|
-
activation_id: activationId,
|
|
106
|
-
},
|
|
107
|
-
throwOnError: true,
|
|
108
|
-
});
|
|
109
|
-
res.locals.activation = activation;
|
|
110
|
-
next();
|
|
111
|
-
};
|
|
141
|
+
return staticMiddleware;
|
|
112
142
|
}
|
|
113
143
|
return async (req, res, next) => {
|
|
144
|
+
if (supervisor_js_1.enabled) {
|
|
145
|
+
opts.log.warn("Disabling webhook out in test mode.");
|
|
146
|
+
return staticMiddleware(req, res, next);
|
|
147
|
+
}
|
|
114
148
|
if (!opts.connName) {
|
|
115
149
|
// This is mainly for type safety, but we should never reach this point
|
|
116
150
|
opts.log.error('Connection name is not defined for webhook middleware');
|
|
@@ -145,31 +179,36 @@ function createActIdDynamicWebhookMiddleware(opts) {
|
|
|
145
179
|
};
|
|
146
180
|
}
|
|
147
181
|
function createUserIdDynamicWebhookMiddleware(opts) {
|
|
182
|
+
const staticMiddleware = async (req, res, next) => {
|
|
183
|
+
const userId = req.params.userId;
|
|
184
|
+
const { data: activations } = await opts.platformApi.listUserActivations({
|
|
185
|
+
path: {
|
|
186
|
+
organisation_id: opts.organisationId,
|
|
187
|
+
environment_id: opts.environmentId,
|
|
188
|
+
external_user_id: userId,
|
|
189
|
+
},
|
|
190
|
+
throwOnError: true,
|
|
191
|
+
});
|
|
192
|
+
if (activations.length === 0) {
|
|
193
|
+
opts.log.error(`No activations found for user: ${userId}`);
|
|
194
|
+
res.status(401).json({ error: 'Unauthorised' });
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (activations.length > 1) {
|
|
198
|
+
opts.log.warn(`Multiple activations found for user: ${userId}, using the first one: ${activations[0].id}`);
|
|
199
|
+
}
|
|
200
|
+
res.locals.activation = activations[0];
|
|
201
|
+
next();
|
|
202
|
+
};
|
|
148
203
|
if (!opts.connName) {
|
|
149
204
|
opts.log.warn(`No template ID found for webhook, accepting any requests which is unsecure!`, { webhookId: opts.id });
|
|
150
|
-
return
|
|
151
|
-
const userId = req.params.userId;
|
|
152
|
-
const { data: activations } = await opts.platformApi.listUserActivations({
|
|
153
|
-
path: {
|
|
154
|
-
organisation_id: opts.organisationId,
|
|
155
|
-
environment_id: opts.environmentId,
|
|
156
|
-
external_user_id: userId,
|
|
157
|
-
},
|
|
158
|
-
throwOnError: true,
|
|
159
|
-
});
|
|
160
|
-
if (activations.length === 0) {
|
|
161
|
-
opts.log.error(`No activations found for user: ${userId}`);
|
|
162
|
-
res.status(401).json({ error: 'Unauthorised' });
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
if (activations.length > 1) {
|
|
166
|
-
opts.log.warn(`Multiple activations found for user: ${userId}, using the first one: ${activations[0].id}`);
|
|
167
|
-
}
|
|
168
|
-
res.locals.activation = activations[0];
|
|
169
|
-
next();
|
|
170
|
-
};
|
|
205
|
+
return staticMiddleware;
|
|
171
206
|
}
|
|
172
207
|
return async (req, res, next) => {
|
|
208
|
+
if (supervisor_js_1.enabled) {
|
|
209
|
+
opts.log.warn("Disabling webhook auth in test mode.");
|
|
210
|
+
return staticMiddleware(req, res, next);
|
|
211
|
+
}
|
|
173
212
|
if (!opts.connName) {
|
|
174
213
|
// This is mainly for type safety, but we should never reach this point
|
|
175
214
|
opts.log.error('Connection name is not defined for webhook middleware');
|