@dbos-inc/dbos-sdk 1.28.7-preview.gdb2d0f0508 → 1.29.83-preview.g0c5a5d6c8e
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/context.d.ts +36 -0
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js +104 -1
- package/dist/src/context.js.map +1 -1
- package/dist/src/data_validation.d.ts.map +1 -1
- package/dist/src/data_validation.js +6 -2
- package/dist/src/data_validation.js.map +1 -1
- package/dist/src/dbos-executor.d.ts +36 -20
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +309 -21
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos-runtime/runtime.d.ts +3 -8
- package/dist/src/dbos-runtime/runtime.d.ts.map +1 -1
- package/dist/src/dbos-runtime/runtime.js +7 -11
- package/dist/src/dbos-runtime/runtime.js.map +1 -1
- package/dist/src/dbos.d.ts +109 -0
- package/dist/src/dbos.d.ts.map +1 -0
- package/dist/src/dbos.js +551 -0
- package/dist/src/dbos.js.map +1 -0
- package/dist/src/debugger/debug_workflow.d.ts.map +1 -1
- package/dist/src/debugger/debug_workflow.js +5 -1
- package/dist/src/debugger/debug_workflow.js.map +1 -1
- package/dist/src/decorators.d.ts +11 -2
- package/dist/src/decorators.d.ts.map +1 -1
- package/dist/src/decorators.js +30 -8
- package/dist/src/decorators.js.map +1 -1
- package/dist/src/error.d.ts +6 -0
- package/dist/src/error.d.ts.map +1 -1
- package/dist/src/error.js +20 -2
- package/dist/src/error.js.map +1 -1
- package/dist/src/eventreceiver.d.ts +6 -2
- package/dist/src/eventreceiver.d.ts.map +1 -1
- package/dist/src/httpServer/handler.d.ts +0 -1
- package/dist/src/httpServer/handler.d.ts.map +1 -1
- package/dist/src/httpServer/handler.js +5 -13
- package/dist/src/httpServer/handler.js.map +1 -1
- package/dist/src/httpServer/middleware.d.ts +13 -2
- package/dist/src/httpServer/middleware.d.ts.map +1 -1
- package/dist/src/httpServer/middleware.js +101 -1
- package/dist/src/httpServer/middleware.js.map +1 -1
- package/dist/src/httpServer/server.d.ts +3 -2
- package/dist/src/httpServer/server.d.ts.map +1 -1
- package/dist/src/httpServer/server.js +40 -30
- package/dist/src/httpServer/server.js.map +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/procedure.d.ts +1 -0
- package/dist/src/procedure.d.ts.map +1 -1
- package/dist/src/procedure.js.map +1 -1
- package/dist/src/scheduler/scheduler.d.ts.map +1 -1
- package/dist/src/scheduler/scheduler.js +3 -1
- package/dist/src/scheduler/scheduler.js.map +1 -1
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/telemetry/logs.d.ts +11 -5
- package/dist/src/telemetry/logs.d.ts.map +1 -1
- package/dist/src/telemetry/logs.js +8 -11
- package/dist/src/telemetry/logs.js.map +1 -1
- package/dist/src/testing/testing_runtime.d.ts.map +1 -1
- package/dist/src/testing/testing_runtime.js +10 -4
- package/dist/src/testing/testing_runtime.js.map +1 -1
- package/dist/src/user_database.d.ts +1 -1
- package/dist/src/user_database.d.ts.map +1 -1
- package/dist/src/wfqueue.d.ts.map +1 -1
- package/dist/src/wfqueue.js +17 -2
- package/dist/src/wfqueue.js.map +1 -1
- package/dist/src/workflow.d.ts +7 -6
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js +10 -187
- package/dist/src/workflow.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -1
package/dist/src/dbos.js
ADDED
@@ -0,0 +1,551 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.DBOS = void 0;
|
4
|
+
const context_1 = require("./context");
|
5
|
+
const dbos_executor_1 = require("./dbos-executor");
|
6
|
+
const logs_1 = require("./telemetry/logs");
|
7
|
+
const error_1 = require("./error");
|
8
|
+
const config_1 = require("./dbos-runtime/config");
|
9
|
+
const scheduler_1 = require("./scheduler/scheduler");
|
10
|
+
const decorators_1 = require("./decorators");
|
11
|
+
const utils_1 = require("./utils");
|
12
|
+
const server_1 = require("./httpServer/server");
|
13
|
+
const middleware_1 = require("./httpServer/middleware");
|
14
|
+
const wfqueue_1 = require("./wfqueue");
|
15
|
+
class DBOS {
|
16
|
+
///////
|
17
|
+
// Lifecycle
|
18
|
+
///////
|
19
|
+
static adminServer = undefined;
|
20
|
+
static setConfig(config, runtimeConfig) {
|
21
|
+
DBOS.dbosConfig = config;
|
22
|
+
DBOS.runtimeConfig = runtimeConfig;
|
23
|
+
}
|
24
|
+
static async launch(httpApps) {
|
25
|
+
// Do nothing is DBOS is already initialized
|
26
|
+
if (dbos_executor_1.DBOSExecutor.globalInstance)
|
27
|
+
return;
|
28
|
+
// Initialize the DBOS executor
|
29
|
+
if (!DBOS.dbosConfig) {
|
30
|
+
const [dbosConfig, runtimeConfig] = (0, config_1.parseConfigFile)();
|
31
|
+
DBOS.dbosConfig = dbosConfig;
|
32
|
+
DBOS.runtimeConfig = runtimeConfig;
|
33
|
+
}
|
34
|
+
dbos_executor_1.DBOSExecutor.globalInstance = new dbos_executor_1.DBOSExecutor(DBOS.dbosConfig);
|
35
|
+
const executor = dbos_executor_1.DBOSExecutor.globalInstance;
|
36
|
+
await executor.init();
|
37
|
+
dbos_executor_1.DBOSExecutor.globalInstance.scheduler = new scheduler_1.DBOSScheduler(dbos_executor_1.DBOSExecutor.globalInstance);
|
38
|
+
dbos_executor_1.DBOSExecutor.globalInstance.scheduler.initScheduler();
|
39
|
+
dbos_executor_1.DBOSExecutor.globalInstance.wfqEnded = wfqueue_1.wfQueueRunner.dispatchLoop(dbos_executor_1.DBOSExecutor.globalInstance);
|
40
|
+
for (const evtRcvr of dbos_executor_1.DBOSExecutor.globalInstance.eventReceivers) {
|
41
|
+
await evtRcvr.initialize(dbos_executor_1.DBOSExecutor.globalInstance);
|
42
|
+
}
|
43
|
+
// Start the DBOS admin server
|
44
|
+
const logger = DBOS.logger;
|
45
|
+
if (DBOS.runtimeConfig) {
|
46
|
+
const adminApp = server_1.DBOSHttpServer.setupAdminApp(executor);
|
47
|
+
await server_1.DBOSHttpServer.checkPortAvailabilityIPv4Ipv6(DBOS.runtimeConfig.admin_port, logger);
|
48
|
+
DBOS.adminServer = adminApp.listen(DBOS.runtimeConfig.admin_port, () => {
|
49
|
+
this.logger.info(`DBOS Admin Server is running at http://localhost:${DBOS.runtimeConfig?.admin_port}`);
|
50
|
+
});
|
51
|
+
}
|
52
|
+
if (httpApps) {
|
53
|
+
if (httpApps.koaApp) {
|
54
|
+
DBOS.logger.info("Setting up Koa tracing middleware");
|
55
|
+
httpApps.koaApp.use(middleware_1.koaTracingMiddleware);
|
56
|
+
}
|
57
|
+
if (httpApps.expressApp) {
|
58
|
+
DBOS.logger.info("Setting up Express tracing middleware");
|
59
|
+
httpApps.expressApp.use(middleware_1.expressTracingMiddleware);
|
60
|
+
}
|
61
|
+
if (httpApps.fastifyApp) {
|
62
|
+
// Fastify can use express or middie under the hood, for middlewares.
|
63
|
+
// Middie happens to have the same semantic than express.
|
64
|
+
// See https://fastify.dev/docs/latest/Reference/Middleware/
|
65
|
+
DBOS.logger.info("Setting up Fastify tracing middleware");
|
66
|
+
httpApps.fastifyApp.use(middleware_1.expressTracingMiddleware);
|
67
|
+
}
|
68
|
+
if (httpApps.nestApp) {
|
69
|
+
// Nest.kj can use express or fastify under the hood. With fastify, Nest.js uses middie.
|
70
|
+
DBOS.logger.info("Setting up NestJS tracing middleware");
|
71
|
+
httpApps.nestApp.use(middleware_1.expressTracingMiddleware);
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
static async shutdown() {
|
76
|
+
// Stop the admin server
|
77
|
+
if (DBOS.adminServer) {
|
78
|
+
DBOS.adminServer.close();
|
79
|
+
DBOS.adminServer = undefined;
|
80
|
+
}
|
81
|
+
// Stop the executor
|
82
|
+
if (dbos_executor_1.DBOSExecutor.globalInstance) {
|
83
|
+
await dbos_executor_1.DBOSExecutor.globalInstance.deactivateEventReceivers();
|
84
|
+
await dbos_executor_1.DBOSExecutor.globalInstance.destroy();
|
85
|
+
dbos_executor_1.DBOSExecutor.globalInstance = undefined;
|
86
|
+
}
|
87
|
+
}
|
88
|
+
static get executor() {
|
89
|
+
if (!dbos_executor_1.DBOSExecutor.globalInstance) {
|
90
|
+
throw new error_1.DBOSExecutorNotInitializedError();
|
91
|
+
}
|
92
|
+
return dbos_executor_1.DBOSExecutor.globalInstance;
|
93
|
+
}
|
94
|
+
//////
|
95
|
+
// Globals
|
96
|
+
//////
|
97
|
+
static globalLogger;
|
98
|
+
static dbosConfig;
|
99
|
+
static runtimeConfig = undefined;
|
100
|
+
static invokeWrappers = new Map();
|
101
|
+
//////
|
102
|
+
// Context
|
103
|
+
//////
|
104
|
+
static get logger() {
|
105
|
+
const ctx = (0, context_1.getCurrentDBOSContext)();
|
106
|
+
if (ctx)
|
107
|
+
return ctx.logger;
|
108
|
+
const executor = DBOS.executor;
|
109
|
+
if (executor)
|
110
|
+
return executor.logger;
|
111
|
+
return new logs_1.GlobalLogger();
|
112
|
+
}
|
113
|
+
static get span() {
|
114
|
+
const ctx = (0, context_1.getCurrentDBOSContext)();
|
115
|
+
if (ctx)
|
116
|
+
return ctx.span;
|
117
|
+
return undefined;
|
118
|
+
}
|
119
|
+
static get request() {
|
120
|
+
return (0, context_1.getCurrentDBOSContext)()?.request;
|
121
|
+
}
|
122
|
+
static get workflowID() {
|
123
|
+
return (0, context_1.getCurrentDBOSContext)()?.workflowUUID;
|
124
|
+
}
|
125
|
+
static get authenticatedUser() {
|
126
|
+
return (0, context_1.getCurrentDBOSContext)()?.authenticatedUser ?? "";
|
127
|
+
}
|
128
|
+
static get authenticatedRoles() {
|
129
|
+
return (0, context_1.getCurrentDBOSContext)()?.authenticatedRoles ?? [];
|
130
|
+
}
|
131
|
+
static get assumedRole() {
|
132
|
+
return (0, context_1.getCurrentDBOSContext)()?.assumedRole ?? "";
|
133
|
+
}
|
134
|
+
static isInTransaction() {
|
135
|
+
return (0, context_1.getCurrentContextStore)()?.curTxFunctionId !== undefined;
|
136
|
+
}
|
137
|
+
static isInStep() {
|
138
|
+
return (0, context_1.getCurrentContextStore)()?.curStepFunctionId !== undefined;
|
139
|
+
}
|
140
|
+
static isWithinWorkflow() {
|
141
|
+
return (0, context_1.getCurrentContextStore)()?.workflowId !== undefined;
|
142
|
+
}
|
143
|
+
static isInWorkflow() {
|
144
|
+
return DBOS.isWithinWorkflow() && !DBOS.isInTransaction() && !DBOS.isInStep();
|
145
|
+
}
|
146
|
+
// TODO CTX parent workflow ID
|
147
|
+
// sql session (various forms)
|
148
|
+
static get sqlClient() {
|
149
|
+
if (!DBOS.isInTransaction())
|
150
|
+
throw new error_1.DBOSInvalidWorkflowTransitionError();
|
151
|
+
const ctx = (0, context_1.assertCurrentDBOSContext)();
|
152
|
+
return ctx.client;
|
153
|
+
}
|
154
|
+
static get pgClient() {
|
155
|
+
const client = DBOS.sqlClient;
|
156
|
+
// TODO CTX check!
|
157
|
+
return client;
|
158
|
+
}
|
159
|
+
static get knexClient() {
|
160
|
+
const client = DBOS.sqlClient;
|
161
|
+
// TODO CTX check!
|
162
|
+
return client;
|
163
|
+
}
|
164
|
+
static get prismaClient() {
|
165
|
+
const client = DBOS.sqlClient;
|
166
|
+
// TODO CTX check!
|
167
|
+
return client;
|
168
|
+
}
|
169
|
+
static get typeORMClient() {
|
170
|
+
const client = DBOS.sqlClient;
|
171
|
+
// TODO CTX check!
|
172
|
+
return client;
|
173
|
+
}
|
174
|
+
static get drizzleClient() {
|
175
|
+
const client = DBOS.sqlClient;
|
176
|
+
// TODO CTX check!
|
177
|
+
return client;
|
178
|
+
}
|
179
|
+
static getConfig(key, defaultValue) {
|
180
|
+
const ctx = (0, context_1.getCurrentDBOSContext)();
|
181
|
+
if (ctx && defaultValue)
|
182
|
+
return ctx.getConfig(key, defaultValue);
|
183
|
+
if (ctx)
|
184
|
+
return ctx.getConfig(key);
|
185
|
+
if (DBOS.executor)
|
186
|
+
return DBOS.executor.getConfig(key, defaultValue);
|
187
|
+
return defaultValue;
|
188
|
+
}
|
189
|
+
//////
|
190
|
+
// Workflow and other operations
|
191
|
+
//////
|
192
|
+
static getWorkflowStatus(workflowID) {
|
193
|
+
return DBOS.executor.getWorkflowStatus(workflowID);
|
194
|
+
}
|
195
|
+
static retrieveWorkflow(workflowID) {
|
196
|
+
return DBOS.executor.retrieveWorkflow(workflowID);
|
197
|
+
}
|
198
|
+
static async getWorkflows(input) {
|
199
|
+
return await DBOS.executor.getWorkflows(input);
|
200
|
+
}
|
201
|
+
static async getWorkflowQueue(input) {
|
202
|
+
return await DBOS.executor.getWorkflowQueue(input);
|
203
|
+
}
|
204
|
+
static async sleepms(durationMS) {
|
205
|
+
if (DBOS.isWithinWorkflow()) {
|
206
|
+
if (DBOS.isInTransaction() || DBOS.isInStep()) {
|
207
|
+
throw new error_1.DBOSInvalidWorkflowTransitionError();
|
208
|
+
}
|
209
|
+
return (0, context_1.getCurrentDBOSContext)().sleepms(durationMS);
|
210
|
+
}
|
211
|
+
await (0, utils_1.sleepms)(durationMS);
|
212
|
+
}
|
213
|
+
static async sleep(durationSec) {
|
214
|
+
return this.sleepms(durationSec * 1000);
|
215
|
+
}
|
216
|
+
static async withNextWorkflowID(wfid, callback) {
|
217
|
+
const pctx = (0, context_1.getCurrentContextStore)();
|
218
|
+
if (pctx) {
|
219
|
+
const pcwfid = pctx.idAssignedForNextWorkflow;
|
220
|
+
try {
|
221
|
+
pctx.idAssignedForNextWorkflow = wfid;
|
222
|
+
return callback();
|
223
|
+
}
|
224
|
+
finally {
|
225
|
+
pctx.idAssignedForNextWorkflow = pcwfid;
|
226
|
+
}
|
227
|
+
}
|
228
|
+
else {
|
229
|
+
return (0, context_1.runWithTopContext)({ idAssignedForNextWorkflow: wfid }, callback);
|
230
|
+
}
|
231
|
+
}
|
232
|
+
static async withTracedContext(span, request, callback) {
|
233
|
+
const pctx = (0, context_1.getCurrentContextStore)();
|
234
|
+
if (pctx) {
|
235
|
+
pctx.span = span;
|
236
|
+
pctx.request = request;
|
237
|
+
return callback();
|
238
|
+
}
|
239
|
+
else {
|
240
|
+
return (0, context_1.runWithTopContext)({ span, request }, callback);
|
241
|
+
}
|
242
|
+
}
|
243
|
+
static async withAuthedContext(authedUser, authedRoles, callback) {
|
244
|
+
const pctx = (0, context_1.getCurrentContextStore)();
|
245
|
+
if (pctx) {
|
246
|
+
pctx.authenticatedUser = authedUser;
|
247
|
+
pctx.authenticatedRoles = authedRoles;
|
248
|
+
return callback();
|
249
|
+
}
|
250
|
+
else {
|
251
|
+
return (0, context_1.runWithTopContext)({ authenticatedUser: authedUser, authenticatedRoles: authedRoles }, callback);
|
252
|
+
}
|
253
|
+
}
|
254
|
+
static async withWorkflowQueue(wfq, callback) {
|
255
|
+
const pctx = (0, context_1.getCurrentContextStore)();
|
256
|
+
if (pctx) {
|
257
|
+
const pcwfq = pctx.queueAssignedForWorkflows;
|
258
|
+
try {
|
259
|
+
pctx.queueAssignedForWorkflows = wfq;
|
260
|
+
return callback();
|
261
|
+
}
|
262
|
+
finally {
|
263
|
+
pctx.queueAssignedForWorkflows = pcwfq;
|
264
|
+
}
|
265
|
+
}
|
266
|
+
else {
|
267
|
+
return (0, context_1.runWithTopContext)({ queueAssignedForWorkflows: wfq }, callback);
|
268
|
+
}
|
269
|
+
}
|
270
|
+
static startWorkflow(target) {
|
271
|
+
if (typeof target === 'function') {
|
272
|
+
return DBOS.proxyInvokeWF(target, null);
|
273
|
+
}
|
274
|
+
else {
|
275
|
+
return DBOS.proxyInvokeWF(target, target);
|
276
|
+
}
|
277
|
+
}
|
278
|
+
static proxyInvokeWF(object, configuredInstance) {
|
279
|
+
const ops = (0, decorators_1.getRegisteredOperations)(object);
|
280
|
+
const proxy = {};
|
281
|
+
const pctx = (0, context_1.getCurrentContextStore)();
|
282
|
+
let wfId = pctx?.idAssignedForNextWorkflow;
|
283
|
+
// If this is called from within a workflow, this is a child workflow,
|
284
|
+
// For OAOO, we will need a consistent ID formed from the parent WF and call number
|
285
|
+
if (DBOS.isWithinWorkflow()) {
|
286
|
+
const wfctx = (0, context_1.assertCurrentWorkflowContext)();
|
287
|
+
const funcId = wfctx.functionIDGetIncrement();
|
288
|
+
wfId = wfId || (wfctx.workflowUUID + "-" + funcId);
|
289
|
+
const params = {
|
290
|
+
workflowUUID: wfId,
|
291
|
+
parentCtx: wfctx,
|
292
|
+
configuredInstance,
|
293
|
+
queueName: pctx?.queueAssignedForWorkflows
|
294
|
+
};
|
295
|
+
for (const op of ops) {
|
296
|
+
proxy[op.name] = op.workflowConfig
|
297
|
+
? (...args) => dbos_executor_1.DBOSExecutor.globalInstance.internalWorkflow(op.registeredFunction, params, wfctx.workflowUUID, funcId, ...args)
|
298
|
+
: undefined;
|
299
|
+
}
|
300
|
+
return proxy;
|
301
|
+
}
|
302
|
+
const wfParams = {
|
303
|
+
workflowUUID: wfId,
|
304
|
+
queueName: pctx?.queueAssignedForWorkflows,
|
305
|
+
configuredInstance,
|
306
|
+
};
|
307
|
+
for (const op of ops) {
|
308
|
+
proxy[op.name] = op.workflowConfig
|
309
|
+
? (...args) => DBOS.executor.workflow(op.registeredFunction, wfParams, ...args)
|
310
|
+
: undefined;
|
311
|
+
}
|
312
|
+
// TODO CTX - should we put helpful errors for any function that may have "compiled" but is not a workflow?
|
313
|
+
return proxy;
|
314
|
+
}
|
315
|
+
static invoke(object) {
|
316
|
+
const wfctx = (0, context_1.assertCurrentWorkflowContext)();
|
317
|
+
if (typeof object === 'function') {
|
318
|
+
const ops = (0, decorators_1.getRegisteredOperations)(object);
|
319
|
+
const proxy = {};
|
320
|
+
for (const op of ops) {
|
321
|
+
proxy[op.name] = op.txnConfig
|
322
|
+
? (...args) => dbos_executor_1.DBOSExecutor.globalInstance.callTransactionFunction(op.registeredFunction, null, wfctx, ...args)
|
323
|
+
: op.commConfig
|
324
|
+
? (...args) => dbos_executor_1.DBOSExecutor.globalInstance.callStepFunction(op.registeredFunction, null, wfctx, ...args)
|
325
|
+
: op.procConfig
|
326
|
+
? (...args) => wfctx.procedure(op.registeredFunction, ...args)
|
327
|
+
: undefined;
|
328
|
+
}
|
329
|
+
return proxy;
|
330
|
+
}
|
331
|
+
else {
|
332
|
+
const targetInst = object;
|
333
|
+
const ops = (0, decorators_1.getRegisteredOperations)(targetInst);
|
334
|
+
const proxy = {};
|
335
|
+
for (const op of ops) {
|
336
|
+
proxy[op.name] = op.txnConfig
|
337
|
+
? (...args) => dbos_executor_1.DBOSExecutor.globalInstance.callTransactionFunction(op.registeredFunction, targetInst, wfctx, ...args)
|
338
|
+
: op.commConfig
|
339
|
+
? (...args) => dbos_executor_1.DBOSExecutor.globalInstance.callStepFunction(op.registeredFunction, targetInst, wfctx, ...args)
|
340
|
+
: undefined;
|
341
|
+
}
|
342
|
+
return proxy;
|
343
|
+
}
|
344
|
+
}
|
345
|
+
static async send(destinationID, message, topic) {
|
346
|
+
if (DBOS.isWithinWorkflow()) {
|
347
|
+
if (!DBOS.isInWorkflow()) {
|
348
|
+
throw new error_1.DBOSInvalidWorkflowTransitionError();
|
349
|
+
}
|
350
|
+
return (0, context_1.getCurrentDBOSContext)().send(destinationID, message, topic);
|
351
|
+
}
|
352
|
+
return DBOS.executor.send(destinationID, message, topic);
|
353
|
+
}
|
354
|
+
static async recv(topic, timeoutSeconds) {
|
355
|
+
if (DBOS.isWithinWorkflow()) {
|
356
|
+
if (!DBOS.isInWorkflow()) {
|
357
|
+
throw new error_1.DBOSInvalidWorkflowTransitionError();
|
358
|
+
}
|
359
|
+
return (0, context_1.getCurrentDBOSContext)().recv(topic, timeoutSeconds);
|
360
|
+
}
|
361
|
+
throw new error_1.DBOSInvalidWorkflowTransitionError(); // Only workflows can recv
|
362
|
+
}
|
363
|
+
static async setEvent(key, value) {
|
364
|
+
if (DBOS.isWithinWorkflow()) {
|
365
|
+
if (!DBOS.isInWorkflow()) {
|
366
|
+
throw new error_1.DBOSInvalidWorkflowTransitionError();
|
367
|
+
}
|
368
|
+
return (0, context_1.getCurrentDBOSContext)().setEvent(key, value);
|
369
|
+
}
|
370
|
+
throw new error_1.DBOSInvalidWorkflowTransitionError(); // Only workflows can set event
|
371
|
+
}
|
372
|
+
static async getEvent(workflowID, key, timeoutSeconds) {
|
373
|
+
if (DBOS.isWithinWorkflow()) {
|
374
|
+
if (!DBOS.isInWorkflow()) {
|
375
|
+
throw new error_1.DBOSInvalidWorkflowTransitionError();
|
376
|
+
}
|
377
|
+
return (0, context_1.getCurrentDBOSContext)().getEvent(workflowID, key, timeoutSeconds);
|
378
|
+
}
|
379
|
+
return DBOS.executor.getEvent(workflowID, key, timeoutSeconds);
|
380
|
+
}
|
381
|
+
//////
|
382
|
+
// Decorators
|
383
|
+
//////
|
384
|
+
static scheduled(schedulerConfig) {
|
385
|
+
function scheddec(target, propertyKey, inDescriptor) {
|
386
|
+
const { descriptor, registration } = (0, decorators_1.registerAndWrapContextFreeFunction)(target, propertyKey, inDescriptor);
|
387
|
+
const schedRegistration = registration;
|
388
|
+
schedRegistration.schedulerConfig = schedulerConfig;
|
389
|
+
return descriptor;
|
390
|
+
}
|
391
|
+
return scheddec;
|
392
|
+
}
|
393
|
+
static workflow(config = {}) {
|
394
|
+
function decorator(target, propertyKey, inDescriptor) {
|
395
|
+
const { descriptor, registration } = (0, decorators_1.registerAndWrapContextFreeFunction)(target, propertyKey, inDescriptor);
|
396
|
+
registration.workflowConfig = config;
|
397
|
+
const invokeWrapper = async function (...rawArgs) {
|
398
|
+
const pctx = (0, context_1.getCurrentContextStore)();
|
399
|
+
let inst = undefined;
|
400
|
+
if (typeof this === 'function') {
|
401
|
+
// This is static
|
402
|
+
}
|
403
|
+
else {
|
404
|
+
inst = this;
|
405
|
+
if (!("name" in inst)) {
|
406
|
+
throw new error_1.DBOSInvalidWorkflowTransitionError();
|
407
|
+
}
|
408
|
+
}
|
409
|
+
let wfId = pctx?.idAssignedForNextWorkflow;
|
410
|
+
// If this is called from within a workflow, this is a child workflow,
|
411
|
+
// For OAOO, we will need a consistent ID formed from the parent WF and call number
|
412
|
+
if (DBOS.isWithinWorkflow()) {
|
413
|
+
const wfctx = (0, context_1.assertCurrentWorkflowContext)();
|
414
|
+
const funcId = wfctx.functionIDGetIncrement();
|
415
|
+
wfId = wfId || (wfctx.workflowUUID + "-" + funcId);
|
416
|
+
const params = {
|
417
|
+
workflowUUID: wfId,
|
418
|
+
parentCtx: wfctx,
|
419
|
+
configuredInstance: inst,
|
420
|
+
queueName: pctx?.queueAssignedForWorkflows
|
421
|
+
};
|
422
|
+
const cwfh = await dbos_executor_1.DBOSExecutor.globalInstance.internalWorkflow(registration.registeredFunction, params, wfctx.workflowUUID, funcId, ...rawArgs);
|
423
|
+
return await cwfh.getResult();
|
424
|
+
}
|
425
|
+
const wfParams = {
|
426
|
+
workflowUUID: wfId,
|
427
|
+
queueName: pctx?.queueAssignedForWorkflows,
|
428
|
+
configuredInstance: inst
|
429
|
+
};
|
430
|
+
if (pctx) {
|
431
|
+
pctx.idAssignedForNextWorkflow = undefined;
|
432
|
+
}
|
433
|
+
const handle = await DBOS.executor.workflow(registration.registeredFunction, wfParams, ...rawArgs);
|
434
|
+
return await handle.getResult();
|
435
|
+
};
|
436
|
+
descriptor.value = invokeWrapper;
|
437
|
+
registration.wrappedFunction = invokeWrapper;
|
438
|
+
Object.defineProperty(invokeWrapper, "name", {
|
439
|
+
value: registration.name,
|
440
|
+
});
|
441
|
+
(0, decorators_1.registerFunctionWrapper)(invokeWrapper, registration);
|
442
|
+
// TODO CTX this should not be in here already, or if it is we need to do something different...
|
443
|
+
DBOS.invokeWrappers.set(invokeWrapper, registration.registeredFunction);
|
444
|
+
return descriptor;
|
445
|
+
}
|
446
|
+
return decorator;
|
447
|
+
}
|
448
|
+
static transaction(config = {}) {
|
449
|
+
function decorator(target, propertyKey, inDescriptor) {
|
450
|
+
const { descriptor, registration } = (0, decorators_1.registerAndWrapContextFreeFunction)(target, propertyKey, inDescriptor);
|
451
|
+
registration.txnConfig = config;
|
452
|
+
const invokeWrapper = async function (...rawArgs) {
|
453
|
+
let inst = undefined;
|
454
|
+
if (typeof this === 'function') {
|
455
|
+
// This is static
|
456
|
+
}
|
457
|
+
else {
|
458
|
+
inst = this;
|
459
|
+
if (!("name" in inst)) {
|
460
|
+
throw new error_1.DBOSInvalidWorkflowTransitionError();
|
461
|
+
}
|
462
|
+
}
|
463
|
+
if (DBOS.isWithinWorkflow()) {
|
464
|
+
const wfctx = (0, context_1.assertCurrentWorkflowContext)();
|
465
|
+
return await dbos_executor_1.DBOSExecutor.globalInstance.callTransactionFunction(registration.registeredFunction, inst ?? null, wfctx, ...rawArgs);
|
466
|
+
}
|
467
|
+
const wfParams = {
|
468
|
+
configuredInstance: inst
|
469
|
+
};
|
470
|
+
return await DBOS.executor.transaction(registration.registeredFunction, wfParams, ...rawArgs);
|
471
|
+
};
|
472
|
+
descriptor.value = invokeWrapper;
|
473
|
+
registration.wrappedFunction = invokeWrapper;
|
474
|
+
Object.defineProperty(invokeWrapper, "name", {
|
475
|
+
value: registration.name,
|
476
|
+
});
|
477
|
+
return descriptor;
|
478
|
+
}
|
479
|
+
return decorator;
|
480
|
+
}
|
481
|
+
static step(config = {}) {
|
482
|
+
function decorator(target, propertyKey, inDescriptor) {
|
483
|
+
const { descriptor, registration } = (0, decorators_1.registerAndWrapContextFreeFunction)(target, propertyKey, inDescriptor);
|
484
|
+
registration.commConfig = config;
|
485
|
+
const invokeWrapper = async function (...rawArgs) {
|
486
|
+
let inst = undefined;
|
487
|
+
if (typeof this === 'function') {
|
488
|
+
// This is static
|
489
|
+
}
|
490
|
+
else {
|
491
|
+
inst = this;
|
492
|
+
if (!("name" in inst)) {
|
493
|
+
throw new error_1.DBOSInvalidWorkflowTransitionError();
|
494
|
+
}
|
495
|
+
}
|
496
|
+
if (DBOS.isWithinWorkflow()) {
|
497
|
+
const wfctx = (0, context_1.assertCurrentWorkflowContext)();
|
498
|
+
return await dbos_executor_1.DBOSExecutor.globalInstance.callStepFunction(registration.registeredFunction, inst ?? null, wfctx, ...rawArgs);
|
499
|
+
}
|
500
|
+
const wfParams = {
|
501
|
+
configuredInstance: inst
|
502
|
+
};
|
503
|
+
return await DBOS.executor.external(registration.registeredFunction, wfParams, ...rawArgs);
|
504
|
+
};
|
505
|
+
descriptor.value = invokeWrapper;
|
506
|
+
registration.wrappedFunction = invokeWrapper;
|
507
|
+
Object.defineProperty(invokeWrapper, "name", {
|
508
|
+
value: registration.name,
|
509
|
+
});
|
510
|
+
return descriptor;
|
511
|
+
}
|
512
|
+
return decorator;
|
513
|
+
}
|
514
|
+
static defaultRequiredRole(anyOf) {
|
515
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
516
|
+
function clsdec(ctor) {
|
517
|
+
const clsreg = (0, decorators_1.getOrCreateClassRegistration)(ctor);
|
518
|
+
clsreg.requiredRole = anyOf;
|
519
|
+
}
|
520
|
+
return clsdec;
|
521
|
+
}
|
522
|
+
static requiredRole(anyOf) {
|
523
|
+
function apidec(target, propertyKey, inDescriptor) {
|
524
|
+
const { descriptor, registration } = (0, decorators_1.registerAndWrapContextFreeFunction)(target, propertyKey, inDescriptor);
|
525
|
+
registration.requiredRole = anyOf;
|
526
|
+
return descriptor;
|
527
|
+
}
|
528
|
+
return apidec;
|
529
|
+
}
|
530
|
+
/////
|
531
|
+
// Registration, etc
|
532
|
+
/////
|
533
|
+
// Function registration
|
534
|
+
static registerAndWrapContextFreeFunction(target, propertyKey, descriptor) {
|
535
|
+
return (0, decorators_1.registerAndWrapContextFreeFunction)(target, propertyKey, descriptor);
|
536
|
+
}
|
537
|
+
static async executeWorkflowById(workflowId, startNewWorkflow = false) {
|
538
|
+
if (!dbos_executor_1.DBOSExecutor.globalInstance) {
|
539
|
+
throw new error_1.DBOSExecutorNotInitializedError();
|
540
|
+
}
|
541
|
+
return dbos_executor_1.DBOSExecutor.globalInstance.executeWorkflowUUID(workflowId, startNewWorkflow);
|
542
|
+
}
|
543
|
+
static async recoverPendingWorkflows(executorIDs = ["local"]) {
|
544
|
+
if (!dbos_executor_1.DBOSExecutor.globalInstance) {
|
545
|
+
throw new error_1.DBOSExecutorNotInitializedError();
|
546
|
+
}
|
547
|
+
return dbos_executor_1.DBOSExecutor.globalInstance.recoverPendingWorkflows(executorIDs);
|
548
|
+
}
|
549
|
+
}
|
550
|
+
exports.DBOS = DBOS;
|
551
|
+
//# sourceMappingURL=dbos.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"dbos.js","sourceRoot":"","sources":["../../src/dbos.ts"],"names":[],"mappings":";;;AACA,uCAOmB;AACnB,mDAAmF;AAWnF,2CAAyD;AACzD,mCAA8F;AAC9F,kDAAwD;AAExD,qDAAiH;AACjH,6CAAsK;AACtK,mCAAkC;AAClC,gDAAqD;AACrD,wDAAyF;AAczF,uCAA0C;AA6D1C,MAAa,IAAI;IACf,OAAO;IACP,YAAY;IACZ,OAAO;IACP,MAAM,CAAC,WAAW,GAAuB,SAAS,CAAC;IAEnD,MAAM,CAAC,SAAS,CAAC,MAAkB,EAAE,aAAiC;QACpE,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAuB;QACzC,4CAA4C;QAC5C,IAAI,4BAAY,CAAC,cAAc;YAAE,OAAO;QAExC,+BAA+B;QAC/B,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAoC,IAAA,wBAAe,GAAE,CAAC;YACvF,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;YAC7B,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACrC,CAAC;QACD,4BAAY,CAAC,cAAc,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAChE,MAAM,QA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AAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,cAAwB,CAAC,OAAO,CAAC;QACpE,IAAI,CAAC,4BAAY,CAAC,cAAc,EAAE,CAAC;YACjC,MAAM,IAAI,uCAA+B,EAAE,CAAC;QAC9C,CAAC;QACD,OAAO,4BAAY,CAAC,cAAc,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;IAC1E,CAAC;;AAjqBH,oBAqqBC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"debug_workflow.d.ts","sourceRoot":"","sources":["../../../src/debugger/debug_workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,MAAM,kBAAkB,CAAC;AAEnF,OAAO,EAAkB,WAAW,EAA0B,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,eAAe,
|
1
|
+
{"version":3,"file":"debug_workflow.d.ts","sourceRoot":"","sources":["../../../src/debugger/debug_workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,MAAM,kBAAkB,CAAC;AAEnF,OAAO,EAAkB,WAAW,EAA0B,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAIvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAA6B,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAA2B,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,gBAAgB,EAAE,QAAQ,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAC;AACtJ,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD,OAAO,EAAE,eAAe,EAA8B,MAAM,cAAc,CAA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EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;IAI7F,IAAI,CAAC,CAAC,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAY1F,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAc7F,QAAQ,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAUnD,QAAQ,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAa/G,gBAAgB,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC;IAMpD,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKjC,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGtC"}
|
@@ -137,7 +137,11 @@ class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
|
137
137
|
return check.output;
|
138
138
|
}
|
139
139
|
// If we have a proxy, then execute the user's transaction.
|
140
|
-
|
140
|
+
let cresult;
|
141
|
+
await (0, context_1.runWithTransactionContext)(tCtxt, async () => {
|
142
|
+
cresult = await txn.call(clsinst, tCtxt, ...args);
|
143
|
+
});
|
144
|
+
const result = cresult;
|
141
145
|
return result;
|
142
146
|
};
|
143
147
|
let result;
|