@dbos-inc/dbos-sdk 0.8.45-preview.g56ba028de5 → 0.8.46-preview
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/packages/dbos-cloud/applications/delete-app.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/delete-app.js +1 -2
- package/dist/packages/dbos-cloud/applications/delete-app.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/deploy-app-code.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/deploy-app-code.js +5 -7
- package/dist/packages/dbos-cloud/applications/deploy-app-code.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/get-app-logs.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/get-app-logs.js +1 -2
- package/dist/packages/dbos-cloud/applications/get-app-logs.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/list-apps.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/list-apps.js +1 -2
- package/dist/packages/dbos-cloud/applications/list-apps.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/register-app.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/register-app.js +1 -2
- package/dist/packages/dbos-cloud/applications/register-app.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/update-app.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/update-app.js +1 -2
- package/dist/packages/dbos-cloud/applications/update-app.js.map +1 -1
- package/dist/packages/dbos-cloud/cli.js +0 -12
- package/dist/packages/dbos-cloud/cli.js.map +1 -1
- package/dist/packages/dbos-cloud/cloudutils.d.ts +7 -0
- package/dist/packages/dbos-cloud/cloudutils.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/cloudutils.js +44 -3
- package/dist/packages/dbos-cloud/cloudutils.js.map +1 -1
- package/dist/packages/dbos-cloud/login.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/login.js +3 -4
- package/dist/packages/dbos-cloud/login.js.map +1 -1
- package/dist/packages/dbos-cloud/register.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/register.js +1 -2
- package/dist/packages/dbos-cloud/register.js.map +1 -1
- package/dist/packages/dbos-cloud/userdb.d.ts +0 -2
- package/dist/packages/dbos-cloud/userdb.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/userdb.js +4 -177
- package/dist/packages/dbos-cloud/userdb.js.map +1 -1
- package/dist/src/context.d.ts +1 -0
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/dbos-runtime/cli.d.ts.map +1 -1
- package/dist/src/dbos-runtime/cli.js +14 -0
- package/dist/src/dbos-runtime/cli.js.map +1 -1
- package/dist/src/dbos-runtime/migrate.d.ts +3 -0
- package/dist/src/dbos-runtime/migrate.d.ts.map +1 -0
- package/dist/src/dbos-runtime/migrate.js +175 -0
- package/dist/src/dbos-runtime/migrate.js.map +1 -0
- package/dist/src/httpServer/server.d.ts +2 -1
- package/dist/src/httpServer/server.d.ts.map +1 -1
- package/dist/src/system_database.d.ts +2 -0
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +26 -11
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/testing/testing_runtime.d.ts +2 -1
- package/dist/src/testing/testing_runtime.d.ts.map +1 -1
- package/dist/src/utils.d.ts +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +20 -4
- package/dist/src/utils.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/examples/hello/start_postgres_docker.sh +1 -1
- package/migrations/20240123182943_schema.js +8 -0
- package/migrations/20240123183021_tables.js +48 -0
- package/migrations/20240123183025_indexes.js +14 -0
- package/migrations/20240123183030_triggers.js +39 -0
- package/package.json +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.js +5 -7
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cli.js +0 -12
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cli.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.d.ts +7 -0
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.js +44 -3
- package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/login.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/login.js +3 -4
- package/packages/dbos-cloud/dist/packages/dbos-cloud/login.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/register.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/register.js +1 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/register.js.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.d.ts +0 -2
- package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.js +4 -177
- package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.js.map +1 -1
- package/packages/dbos-cloud/dist/src/utils.d.ts +1 -1
- package/packages/dbos-cloud/dist/src/utils.d.ts.map +1 -1
- package/packages/dbos-cloud/dist/src/utils.js +20 -4
- package/packages/dbos-cloud/dist/src/utils.js.map +1 -1
- package/packages/dbos-cloud/package.json +1 -1
- package/packages/dbos-openapi/package.json +1 -1
- package/packages/dbos-cloud/dist/schemas/system_db_schema.d.ts +0 -34
- package/packages/dbos-cloud/dist/schemas/system_db_schema.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/schemas/system_db_schema.js +0 -77
- package/packages/dbos-cloud/dist/schemas/system_db_schema.js.map +0 -1
- package/packages/dbos-cloud/dist/schemas/user_db_schema.d.ts +0 -11
- package/packages/dbos-cloud/dist/schemas/user_db_schema.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/schemas/user_db_schema.js +0 -16
- package/packages/dbos-cloud/dist/schemas/user_db_schema.js.map +0 -1
- package/packages/dbos-cloud/dist/src/communicator.d.ts +0 -25
- package/packages/dbos-cloud/dist/src/communicator.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/communicator.js +0 -26
- package/packages/dbos-cloud/dist/src/communicator.js.map +0 -1
- package/packages/dbos-cloud/dist/src/context.d.ts +0 -64
- package/packages/dbos-cloud/dist/src/context.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/context.js +0 -96
- package/packages/dbos-cloud/dist/src/context.js.map +0 -1
- package/packages/dbos-cloud/dist/src/data_validation.d.ts +0 -3
- package/packages/dbos-cloud/dist/src/data_validation.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/data_validation.js +0 -168
- package/packages/dbos-cloud/dist/src/data_validation.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-executor.d.ts +0 -102
- package/packages/dbos-cloud/dist/src/dbos-executor.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-executor.js +0 -631
- package/packages/dbos-cloud/dist/src/dbos-executor.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.d.ts +0 -3
- package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.js +0 -13
- package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/cli.d.ts +0 -8
- package/packages/dbos-cloud/dist/src/dbos-runtime/cli.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/cli.js +0 -47
- package/packages/dbos-cloud/dist/src/dbos-runtime/cli.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/config.d.ts +0 -29
- package/packages/dbos-cloud/dist/src/dbos-runtime/config.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/config.js +0 -111
- package/packages/dbos-cloud/dist/src/dbos-runtime/config.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/debug.d.ts +0 -4
- package/packages/dbos-cloud/dist/src/dbos-runtime/debug.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/debug.js +0 -21
- package/packages/dbos-cloud/dist/src/dbos-runtime/debug.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/init.d.ts +0 -7
- package/packages/dbos-cloud/dist/src/dbos-runtime/init.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/init.js +0 -51
- package/packages/dbos-cloud/dist/src/dbos-runtime/init.js.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.d.ts +0 -28
- package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.js +0 -95
- package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.js.map +0 -1
- package/packages/dbos-cloud/dist/src/debugger/debug_workflow.d.ts +0 -38
- package/packages/dbos-cloud/dist/src/debugger/debug_workflow.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/debugger/debug_workflow.js +0 -211
- package/packages/dbos-cloud/dist/src/debugger/debug_workflow.js.map +0 -1
- package/packages/dbos-cloud/dist/src/decorators.d.ts +0 -118
- package/packages/dbos-cloud/dist/src/decorators.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/decorators.js +0 -467
- package/packages/dbos-cloud/dist/src/decorators.js.map +0 -1
- package/packages/dbos-cloud/dist/src/error.d.ts +0 -47
- package/packages/dbos-cloud/dist/src/error.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/error.js +0 -171
- package/packages/dbos-cloud/dist/src/error.js.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/handler.d.ts +0 -54
- package/packages/dbos-cloud/dist/src/httpServer/handler.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/handler.js +0 -175
- package/packages/dbos-cloud/dist/src/httpServer/handler.js.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.d.ts +0 -11
- package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.js +0 -19
- package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.js.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/middleware.d.ts +0 -56
- package/packages/dbos-cloud/dist/src/httpServer/middleware.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/middleware.js +0 -57
- package/packages/dbos-cloud/dist/src/httpServer/middleware.js.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/server.d.ts +0 -45
- package/packages/dbos-cloud/dist/src/httpServer/server.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/httpServer/server.js +0 -253
- package/packages/dbos-cloud/dist/src/httpServer/server.js.map +0 -1
- package/packages/dbos-cloud/dist/src/system_database.d.ts +0 -89
- package/packages/dbos-cloud/dist/src/system_database.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/system_database.js +0 -447
- package/packages/dbos-cloud/dist/src/system_database.js.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/collector.d.ts +0 -16
- package/packages/dbos-cloud/dist/src/telemetry/collector.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/collector.js +0 -65
- package/packages/dbos-cloud/dist/src/telemetry/collector.js.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/exporters.d.ts +0 -15
- package/packages/dbos-cloud/dist/src/telemetry/exporters.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/exporters.js +0 -59
- package/packages/dbos-cloud/dist/src/telemetry/exporters.js.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/index.d.ts +0 -11
- package/packages/dbos-cloud/dist/src/telemetry/index.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/index.js +0 -19
- package/packages/dbos-cloud/dist/src/telemetry/index.js.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/logs.d.ts +0 -47
- package/packages/dbos-cloud/dist/src/telemetry/logs.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/logs.js +0 -195
- package/packages/dbos-cloud/dist/src/telemetry/logs.js.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/traces.d.ts +0 -14
- package/packages/dbos-cloud/dist/src/telemetry/traces.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/telemetry/traces.js +0 -52
- package/packages/dbos-cloud/dist/src/telemetry/traces.js.map +0 -1
- package/packages/dbos-cloud/dist/src/transaction.d.ts +0 -29
- package/packages/dbos-cloud/dist/src/transaction.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/transaction.js +0 -27
- package/packages/dbos-cloud/dist/src/transaction.js.map +0 -1
- package/packages/dbos-cloud/dist/src/user_database.d.ts +0 -132
- package/packages/dbos-cloud/dist/src/user_database.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/user_database.js +0 -332
- package/packages/dbos-cloud/dist/src/user_database.js.map +0 -1
- package/packages/dbos-cloud/dist/src/workflow.d.ts +0 -195
- package/packages/dbos-cloud/dist/src/workflow.d.ts.map +0 -1
- package/packages/dbos-cloud/dist/src/workflow.js +0 -498
- package/packages/dbos-cloud/dist/src/workflow.js.map +0 -1
@@ -1,211 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.WorkflowContextDebug = void 0;
|
4
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
5
|
-
const dbos_executor_1 = require("../dbos-executor");
|
6
|
-
const transaction_1 = require("../transaction");
|
7
|
-
const error_1 = require("../error");
|
8
|
-
const serialize_error_1 = require("serialize-error");
|
9
|
-
const context_1 = require("../context");
|
10
|
-
const decorators_1 = require("../decorators");
|
11
|
-
/**
|
12
|
-
* Context used for debugging a workflow
|
13
|
-
*/
|
14
|
-
class WorkflowContextDebug extends context_1.DBOSContextImpl {
|
15
|
-
workflowConfig;
|
16
|
-
functionID = 0;
|
17
|
-
#dbosExec;
|
18
|
-
isTempWorkflow;
|
19
|
-
constructor(dbosExec, parentCtx, workflowUUID, workflowConfig, workflowName) {
|
20
|
-
const span = dbosExec.tracer.startSpan(workflowName, {
|
21
|
-
operationUUID: workflowUUID,
|
22
|
-
operationType: dbos_executor_1.OperationType.WORKFLOW,
|
23
|
-
authenticatedUser: parentCtx?.authenticatedUser ?? "",
|
24
|
-
authenticatedRoles: parentCtx?.authenticatedRoles ?? [],
|
25
|
-
assumedRole: parentCtx?.assumedRole ?? "",
|
26
|
-
}, parentCtx?.span);
|
27
|
-
super(workflowName, span, dbosExec.logger, parentCtx);
|
28
|
-
this.workflowConfig = workflowConfig;
|
29
|
-
this.workflowUUID = workflowUUID;
|
30
|
-
this.#dbosExec = dbosExec;
|
31
|
-
this.isTempWorkflow = dbos_executor_1.DBOSExecutor.tempWorkflowName === workflowName;
|
32
|
-
if (dbosExec.config.application) {
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
34
|
-
this.applicationConfig = dbosExec.config.application;
|
35
|
-
}
|
36
|
-
}
|
37
|
-
functionIDGetIncrement() {
|
38
|
-
return this.functionID++;
|
39
|
-
}
|
40
|
-
invoke(object) {
|
41
|
-
const ops = (0, decorators_1.getRegisteredOperations)(object);
|
42
|
-
const proxy = {};
|
43
|
-
for (const op of ops) {
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
45
|
-
proxy[op.name] = op.txnConfig
|
46
|
-
? // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
47
|
-
(...args) => this.transaction(op.registeredFunction, ...args)
|
48
|
-
: op.commConfig
|
49
|
-
? // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
50
|
-
(...args) => this.external(op.registeredFunction, ...args)
|
51
|
-
: undefined;
|
52
|
-
}
|
53
|
-
return proxy;
|
54
|
-
}
|
55
|
-
async checkExecution(client, funcID) {
|
56
|
-
// Note: we read the recorded snapshot and transaction ID!
|
57
|
-
const query = "SELECT output, error, txn_snapshot, txn_id FROM dbos.transaction_outputs WHERE workflow_uuid=$1 AND function_id=$2";
|
58
|
-
const rows = await this.#dbosExec.userDatabase.queryWithClient(client, query, this.workflowUUID, funcID);
|
59
|
-
if (rows.length === 0 || rows.length > 1) {
|
60
|
-
this.logger.error("Unexpected! This should never happen during debug. Returned rows: " + rows.toString() + `. WorkflowUUID ${this.workflowUUID}, function ID ${funcID}`);
|
61
|
-
throw new error_1.DBOSDebuggerError(`This should never happen during debug. Returned ${rows.length} rows: ` + rows.toString());
|
62
|
-
}
|
63
|
-
if (JSON.parse(rows[0].error) != null) {
|
64
|
-
throw (0, serialize_error_1.deserializeError)(JSON.parse(rows[0].error)); // We don't replay errors.
|
65
|
-
}
|
66
|
-
const res = {
|
67
|
-
output: JSON.parse(rows[0].output),
|
68
|
-
txn_snapshot: rows[0].txn_snapshot,
|
69
|
-
txn_id: rows[0].txn_id,
|
70
|
-
};
|
71
|
-
// Send a signal to the debug proxy.
|
72
|
-
// TODO: use the real command once the proxy is fully implemented.
|
73
|
-
await this.#dbosExec.userDatabase.queryWithClient(client, `--proxy:${res.txn_id ?? ''}:${res.txn_snapshot}`);
|
74
|
-
return res;
|
75
|
-
}
|
76
|
-
/**
|
77
|
-
* Execute a transactional function in debug mode.
|
78
|
-
* It connects to a debug proxy and everything should be read-only.
|
79
|
-
*/
|
80
|
-
async transaction(txn, ...args) {
|
81
|
-
const txnInfo = this.#dbosExec.transactionInfoMap.get(txn.name);
|
82
|
-
if (txnInfo === undefined) {
|
83
|
-
throw new error_1.DBOSDebuggerError(`Transaction ${txn.name} not registered!`);
|
84
|
-
}
|
85
|
-
// const readOnly = true; // TODO: eventually, this transaction must be read-only.
|
86
|
-
const funcID = this.functionIDGetIncrement();
|
87
|
-
const span = this.#dbosExec.tracer.startSpan(txn.name, {
|
88
|
-
operationUUID: this.workflowUUID,
|
89
|
-
operationType: dbos_executor_1.OperationType.TRANSACTION,
|
90
|
-
authenticatedUser: this.authenticatedUser,
|
91
|
-
authenticatedRoles: this.authenticatedRoles,
|
92
|
-
assumedRole: this.assumedRole,
|
93
|
-
readOnly: txnInfo.config.readOnly ?? false, // For now doing as in src/workflow.ts:272
|
94
|
-
isolationLevel: txnInfo.config.isolationLevel,
|
95
|
-
}, this.span);
|
96
|
-
let check;
|
97
|
-
const wrappedTransaction = async (client) => {
|
98
|
-
// Original result must exist during replay.
|
99
|
-
const tCtxt = new transaction_1.TransactionContextImpl(this.#dbosExec.userDatabase.getName(), client, this, span, this.#dbosExec.logger, funcID, txn.name);
|
100
|
-
check = await this.checkExecution(client, funcID);
|
101
|
-
// Execute the user's transaction.
|
102
|
-
const result = await txn(tCtxt, ...args);
|
103
|
-
return result;
|
104
|
-
};
|
105
|
-
const result = await this.#dbosExec.userDatabase.transaction(wrappedTransaction, txnInfo.config);
|
106
|
-
// If returned nothing and the recorded value is also null/undefined, we just return it
|
107
|
-
if (result === undefined && !check.output) {
|
108
|
-
return result;
|
109
|
-
}
|
110
|
-
if (JSON.stringify(check.output) !== JSON.stringify(result)) {
|
111
|
-
this.logger.error(`Detected different transaction output than the original one!\n Result: ${JSON.stringify(result)}\n Original: ${JSON.stringify(check.output)}`);
|
112
|
-
}
|
113
|
-
return check.output; // Always return the recorded result.
|
114
|
-
}
|
115
|
-
async external(commFn, ..._args) {
|
116
|
-
const commConfig = this.#dbosExec.communicatorInfoMap.get(commFn.name);
|
117
|
-
if (commConfig === undefined) {
|
118
|
-
throw new error_1.DBOSDebuggerError(`Communicator ${commFn.name} not registered!`);
|
119
|
-
}
|
120
|
-
const funcID = this.functionIDGetIncrement();
|
121
|
-
// FIXME: we do not create a span for the replay communicator. Do we want to?
|
122
|
-
// Original result must exist during replay.
|
123
|
-
const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, funcID);
|
124
|
-
if (check === dbos_executor_1.dbosNull) {
|
125
|
-
throw new error_1.DBOSDebuggerError(`Cannot find recorded communicator output for ${commFn.name}. Shouldn't happen in debug mode!`);
|
126
|
-
}
|
127
|
-
this.logger.debug("Use recorded communicator output.");
|
128
|
-
return check;
|
129
|
-
}
|
130
|
-
// Invoke the debugWorkflow() function instead.
|
131
|
-
async childWorkflow(wf, ...args) {
|
132
|
-
const funcId = this.functionIDGetIncrement();
|
133
|
-
const childUUID = this.workflowUUID + "-" + funcId;
|
134
|
-
return this.#dbosExec.debugWorkflow(wf, { parentCtx: this, workflowUUID: childUUID }, this.workflowUUID, funcId, ...args);
|
135
|
-
}
|
136
|
-
async send(_destinationUUID, _message, _topic) {
|
137
|
-
const functionID = this.functionIDGetIncrement();
|
138
|
-
// Original result must exist during replay.
|
139
|
-
const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, functionID);
|
140
|
-
if (check === dbos_executor_1.dbosNull) {
|
141
|
-
throw new error_1.DBOSDebuggerError(`Cannot find recorded send. Shouldn't happen in debug mode!`);
|
142
|
-
}
|
143
|
-
this.logger.debug("Use recorded send output.");
|
144
|
-
return;
|
145
|
-
}
|
146
|
-
async recv(_topic, _timeoutSeconds) {
|
147
|
-
const functionID = this.functionIDGetIncrement();
|
148
|
-
// Original result must exist during replay.
|
149
|
-
const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, functionID);
|
150
|
-
if (check === dbos_executor_1.dbosNull) {
|
151
|
-
throw new error_1.DBOSDebuggerError(`Cannot find recorded recv. Shouldn't happen in debug mode!`);
|
152
|
-
}
|
153
|
-
this.logger.debug("Use recorded recv output.");
|
154
|
-
return check;
|
155
|
-
}
|
156
|
-
async setEvent(_key, _value) {
|
157
|
-
const functionID = this.functionIDGetIncrement();
|
158
|
-
// Original result must exist during replay.
|
159
|
-
const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, functionID);
|
160
|
-
if (check === dbos_executor_1.dbosNull) {
|
161
|
-
throw new error_1.DBOSDebuggerError(`Cannot find recorded setEvent. Shouldn't happen in debug mode!`);
|
162
|
-
}
|
163
|
-
this.logger.debug("Use recorded setEvent output.");
|
164
|
-
}
|
165
|
-
async getEvent(_workflowUUID, _key, _timeoutSeconds) {
|
166
|
-
const functionID = this.functionIDGetIncrement();
|
167
|
-
// Original result must exist during replay.
|
168
|
-
const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, functionID);
|
169
|
-
if (check === dbos_executor_1.dbosNull) {
|
170
|
-
throw new error_1.DBOSDebuggerError(`Cannot find recorded getEvent. Shouldn't happen in debug mode!`);
|
171
|
-
}
|
172
|
-
this.logger.debug("Use recorded getEvent output.");
|
173
|
-
return check;
|
174
|
-
}
|
175
|
-
retrieveWorkflow(targetUUID) {
|
176
|
-
// TODO: write a proper test for this.
|
177
|
-
const functionID = this.functionIDGetIncrement();
|
178
|
-
return new RetrievedHandleDebug(this.#dbosExec.systemDatabase, targetUUID, this.workflowUUID, functionID);
|
179
|
-
}
|
180
|
-
}
|
181
|
-
exports.WorkflowContextDebug = WorkflowContextDebug;
|
182
|
-
/**
|
183
|
-
* The handle returned when retrieving a workflow with Debug workflow's retrieve
|
184
|
-
*/
|
185
|
-
class RetrievedHandleDebug {
|
186
|
-
systemDatabase;
|
187
|
-
workflowUUID;
|
188
|
-
callerUUID;
|
189
|
-
callerFunctionID;
|
190
|
-
constructor(systemDatabase, workflowUUID, callerUUID, callerFunctionID) {
|
191
|
-
this.systemDatabase = systemDatabase;
|
192
|
-
this.workflowUUID = workflowUUID;
|
193
|
-
this.callerUUID = callerUUID;
|
194
|
-
this.callerFunctionID = callerFunctionID;
|
195
|
-
}
|
196
|
-
getWorkflowUUID() {
|
197
|
-
return this.workflowUUID;
|
198
|
-
}
|
199
|
-
async getStatus() {
|
200
|
-
// Must use original result.
|
201
|
-
const check = await this.systemDatabase.checkOperationOutput(this.callerUUID, this.callerFunctionID);
|
202
|
-
if (check === dbos_executor_1.dbosNull) {
|
203
|
-
throw new error_1.DBOSDebuggerError(`Cannot find recorded workflow status. Shouldn't happen in debug mode!`);
|
204
|
-
}
|
205
|
-
return check;
|
206
|
-
}
|
207
|
-
async getResult() {
|
208
|
-
return await this.systemDatabase.getWorkflowResult(this.workflowUUID);
|
209
|
-
}
|
210
|
-
}
|
211
|
-
//# sourceMappingURL=debug_workflow.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"debug_workflow.js","sourceRoot":"","sources":["../../../../../src/debugger/debug_workflow.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,oDAAmF;AAEnF,gDAAqE;AAErE,oCAA4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AwB,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAC9J,IAAI,KAAK,KAAK,wBAAQ,EAAE,CAAC;YACvB,MAAM,IAAI,yBAAiB,CAAC,uEAAuE,CAAC,CAAC;QACvG,CAAC;QACD,OAAO,KAA8B,CAAC;IACxC,CAAC;IAED,KAAK,CAAC,SAAS;QACb,OAAO,MAAM,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAI,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3E,CAAC;CACF"}
|
@@ -1,118 +0,0 @@
|
|
1
|
-
import "reflect-metadata";
|
2
|
-
import { TransactionConfig, TransactionContext } from "./transaction";
|
3
|
-
import { WorkflowConfig, WorkflowContext } from "./workflow";
|
4
|
-
import { DBOSContext, InitContext } from "./context";
|
5
|
-
import { CommunicatorConfig, CommunicatorContext } from "./communicator";
|
6
|
-
/**
|
7
|
-
* Any column type column can be.
|
8
|
-
*/
|
9
|
-
export type DBOSFieldType = "integer" | "double" | "decimal" | "timestamp" | "text" | "varchar" | "boolean" | "uuid" | "json";
|
10
|
-
export declare class DBOSDataType {
|
11
|
-
dataType: DBOSFieldType;
|
12
|
-
length: number;
|
13
|
-
precision: number;
|
14
|
-
scale: number;
|
15
|
-
/** Varchar has length */
|
16
|
-
static varchar(length: number): DBOSDataType;
|
17
|
-
/** Some decimal has precision / scale (as opposed to floating point decimal) */
|
18
|
-
static decimal(precision: number, scale: number): DBOSDataType;
|
19
|
-
/** Take type from reflect metadata */
|
20
|
-
static fromArg(arg: Function): DBOSDataType;
|
21
|
-
formatAsString(): string;
|
22
|
-
}
|
23
|
-
export declare enum LogMasks {
|
24
|
-
NONE = "NONE",
|
25
|
-
HASH = "HASH",
|
26
|
-
SKIP = "SKIP"
|
27
|
-
}
|
28
|
-
export declare enum ArgRequiredOptions {
|
29
|
-
REQUIRED = "REQUIRED",
|
30
|
-
OPTIONAL = "OPTIONAL",
|
31
|
-
DEFAULT = "DEFAULT"
|
32
|
-
}
|
33
|
-
export declare class MethodParameter {
|
34
|
-
name: string;
|
35
|
-
required: ArgRequiredOptions;
|
36
|
-
validate: boolean;
|
37
|
-
logMask: LogMasks;
|
38
|
-
argType: Function;
|
39
|
-
dataType: DBOSDataType;
|
40
|
-
index: number;
|
41
|
-
constructor(idx: number, at: Function);
|
42
|
-
}
|
43
|
-
export interface RegistrationDefaults {
|
44
|
-
name: string;
|
45
|
-
requiredRole: string[] | undefined;
|
46
|
-
defaultArgRequired: ArgRequiredOptions;
|
47
|
-
}
|
48
|
-
export interface MethodRegistrationBase {
|
49
|
-
name: string;
|
50
|
-
args: MethodParameter[];
|
51
|
-
defaults?: RegistrationDefaults;
|
52
|
-
getRequiredRoles(): string[];
|
53
|
-
workflowConfig?: WorkflowConfig;
|
54
|
-
txnConfig?: TransactionConfig;
|
55
|
-
commConfig?: CommunicatorConfig;
|
56
|
-
registeredFunction: Function | undefined;
|
57
|
-
invoke(pthis: unknown, args: unknown[]): unknown;
|
58
|
-
}
|
59
|
-
export declare class MethodRegistration<This, Args extends unknown[], Return> implements MethodRegistrationBase {
|
60
|
-
defaults?: RegistrationDefaults | undefined;
|
61
|
-
name: string;
|
62
|
-
requiredRole: string[] | undefined;
|
63
|
-
args: MethodParameter[];
|
64
|
-
constructor(origFunc: (this: This, ...args: Args) => Promise<Return>);
|
65
|
-
debug: boolean;
|
66
|
-
needInitialized: boolean;
|
67
|
-
origFunction: (this: This, ...args: Args) => Promise<Return>;
|
68
|
-
registeredFunction: ((this: This, ...args: Args) => Promise<Return>) | undefined;
|
69
|
-
workflowConfig?: WorkflowConfig;
|
70
|
-
txnConfig?: TransactionConfig;
|
71
|
-
commConfig?: CommunicatorConfig;
|
72
|
-
init: boolean;
|
73
|
-
invoke(pthis: This, args: Args): Promise<Return>;
|
74
|
-
getRequiredRoles(): string[];
|
75
|
-
}
|
76
|
-
export declare class ClassRegistration<CT extends {
|
77
|
-
new (...args: unknown[]): object;
|
78
|
-
}> implements RegistrationDefaults {
|
79
|
-
name: string;
|
80
|
-
requiredRole: string[] | undefined;
|
81
|
-
defaultArgRequired: ArgRequiredOptions;
|
82
|
-
needsInitialized: boolean;
|
83
|
-
ormEntities: Function[];
|
84
|
-
ctor: CT;
|
85
|
-
constructor(ctor: CT);
|
86
|
-
}
|
87
|
-
export declare function getRegisteredOperations(target: object): ReadonlyArray<MethodRegistrationBase>;
|
88
|
-
export declare function getOrCreateMethodArgsRegistration(target: object, propertyKey: string | symbol): MethodParameter[];
|
89
|
-
export declare function registerAndWrapFunction<This, Args extends unknown[], Return>(target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<(this: This, ...args: Args) => Promise<Return>>): {
|
90
|
-
descriptor: TypedPropertyDescriptor<(this: This, ...args: Args) => Promise<Return>>;
|
91
|
-
registration: MethodRegistration<This, Args, Return>;
|
92
|
-
};
|
93
|
-
export declare function getOrCreateClassRegistration<CT extends {
|
94
|
-
new (...args: unknown[]): object;
|
95
|
-
}>(ctor: CT): ClassRegistration<CT>;
|
96
|
-
export declare function ArgRequired(target: object, propertyKey: string | symbol, parameterIndex: number): void;
|
97
|
-
export declare function ArgOptional(target: object, propertyKey: string | symbol, parameterIndex: number): void;
|
98
|
-
export declare function SkipLogging(target: object, propertyKey: string | symbol, parameterIndex: number): void;
|
99
|
-
export declare function LogMask(mask: LogMasks): (target: object, propertyKey: string | symbol, parameterIndex: number) => void;
|
100
|
-
export declare function ArgName(name: string): (target: object, propertyKey: string | symbol, parameterIndex: number) => void;
|
101
|
-
export declare function ArgDate(): (target: object, propertyKey: string | symbol, parameterIndex: number) => void;
|
102
|
-
export declare function ArgVarchar(length: number): (target: object, propertyKey: string | symbol, parameterIndex: number) => void;
|
103
|
-
export declare function DefaultRequiredRole(anyOf: string[]): <T extends new (...args: unknown[]) => object>(ctor: T) => void;
|
104
|
-
export declare function DefaultArgRequired<T extends {
|
105
|
-
new (...args: unknown[]): object;
|
106
|
-
}>(ctor: T): void;
|
107
|
-
export declare function DefaultArgOptional<T extends {
|
108
|
-
new (...args: unknown[]): object;
|
109
|
-
}>(ctor: T): void;
|
110
|
-
export declare function Debug(): <This, Ctx extends DBOSContext, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: Ctx, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: Ctx, ...args: Args) => Promise<Return>>;
|
111
|
-
export declare function RequiredRole(anyOf: string[]): <This, Ctx extends DBOSContext, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: Ctx, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: Ctx, ...args: Args) => Promise<Return>>;
|
112
|
-
export declare function Workflow(config?: WorkflowConfig): <This, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: WorkflowContext, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: WorkflowContext, ...args: Args) => Promise<Return>>;
|
113
|
-
export declare function Transaction(config?: TransactionConfig): <This, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: TransactionContext<any>, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: TransactionContext<any>, ...args: Args) => Promise<Return>>;
|
114
|
-
export declare function Communicator(config?: CommunicatorConfig): <This, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: CommunicatorContext, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: CommunicatorContext, ...args: Args) => Promise<Return>>;
|
115
|
-
export declare function OrmEntities(entities: Function[]): <T extends new (...args: unknown[]) => object>(ctor: T) => void;
|
116
|
-
export declare function DBOSInitializer(): <This, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: InitContext, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: InitContext, ...args: Args) => Promise<Return>>;
|
117
|
-
export declare function DBOSDeploy(): <This, Args extends unknown[], Return>(target: object, propertyKey: string, inDescriptor: TypedPropertyDescriptor<(this: This, ctx: InitContext, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ctx: InitContext, ...args: Args) => Promise<Return>>;
|
118
|
-
//# sourceMappingURL=decorators.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../../src/decorators.ts"],"names":[],"mappings":"AAEA,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAmB,WAAW,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAIzE;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9H,qBAAa,YAAY;IACvB,QAAQ,EAAE,aAAa,CAAU;IACjC,MAAM,EAAE,MAAM,CAAM;IACpB,SAAS,EAAE,MAAM,CAAM;IACvB,KAAK,EAAE,MAAM,CAAM;IAEnB,yBAAyB;IACzB,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM;IAO7B,gFAAgF;IAChF,MAAM,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAS/C,sCAAsC;IAEtC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,QAAQ;IAkB5B,cAAc,IAAI,MAAM;CAczB;AAqBD,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,IAAI,SAAS;I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