@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.
Files changed (214) hide show
  1. package/dist/packages/dbos-cloud/applications/delete-app.d.ts.map +1 -1
  2. package/dist/packages/dbos-cloud/applications/delete-app.js +1 -2
  3. package/dist/packages/dbos-cloud/applications/delete-app.js.map +1 -1
  4. package/dist/packages/dbos-cloud/applications/deploy-app-code.d.ts.map +1 -1
  5. package/dist/packages/dbos-cloud/applications/deploy-app-code.js +5 -7
  6. package/dist/packages/dbos-cloud/applications/deploy-app-code.js.map +1 -1
  7. package/dist/packages/dbos-cloud/applications/get-app-logs.d.ts.map +1 -1
  8. package/dist/packages/dbos-cloud/applications/get-app-logs.js +1 -2
  9. package/dist/packages/dbos-cloud/applications/get-app-logs.js.map +1 -1
  10. package/dist/packages/dbos-cloud/applications/list-apps.d.ts.map +1 -1
  11. package/dist/packages/dbos-cloud/applications/list-apps.js +1 -2
  12. package/dist/packages/dbos-cloud/applications/list-apps.js.map +1 -1
  13. package/dist/packages/dbos-cloud/applications/register-app.d.ts.map +1 -1
  14. package/dist/packages/dbos-cloud/applications/register-app.js +1 -2
  15. package/dist/packages/dbos-cloud/applications/register-app.js.map +1 -1
  16. package/dist/packages/dbos-cloud/applications/update-app.d.ts.map +1 -1
  17. package/dist/packages/dbos-cloud/applications/update-app.js +1 -2
  18. package/dist/packages/dbos-cloud/applications/update-app.js.map +1 -1
  19. package/dist/packages/dbos-cloud/cli.js +0 -12
  20. package/dist/packages/dbos-cloud/cli.js.map +1 -1
  21. package/dist/packages/dbos-cloud/cloudutils.d.ts +7 -0
  22. package/dist/packages/dbos-cloud/cloudutils.d.ts.map +1 -1
  23. package/dist/packages/dbos-cloud/cloudutils.js +44 -3
  24. package/dist/packages/dbos-cloud/cloudutils.js.map +1 -1
  25. package/dist/packages/dbos-cloud/login.d.ts.map +1 -1
  26. package/dist/packages/dbos-cloud/login.js +3 -4
  27. package/dist/packages/dbos-cloud/login.js.map +1 -1
  28. package/dist/packages/dbos-cloud/register.d.ts.map +1 -1
  29. package/dist/packages/dbos-cloud/register.js +1 -2
  30. package/dist/packages/dbos-cloud/register.js.map +1 -1
  31. package/dist/packages/dbos-cloud/userdb.d.ts +0 -2
  32. package/dist/packages/dbos-cloud/userdb.d.ts.map +1 -1
  33. package/dist/packages/dbos-cloud/userdb.js +4 -177
  34. package/dist/packages/dbos-cloud/userdb.js.map +1 -1
  35. package/dist/src/context.d.ts +1 -0
  36. package/dist/src/context.d.ts.map +1 -1
  37. package/dist/src/dbos-runtime/cli.d.ts.map +1 -1
  38. package/dist/src/dbos-runtime/cli.js +14 -0
  39. package/dist/src/dbos-runtime/cli.js.map +1 -1
  40. package/dist/src/dbos-runtime/migrate.d.ts +3 -0
  41. package/dist/src/dbos-runtime/migrate.d.ts.map +1 -0
  42. package/dist/src/dbos-runtime/migrate.js +175 -0
  43. package/dist/src/dbos-runtime/migrate.js.map +1 -0
  44. package/dist/src/httpServer/server.d.ts +2 -1
  45. package/dist/src/httpServer/server.d.ts.map +1 -1
  46. package/dist/src/system_database.d.ts +2 -0
  47. package/dist/src/system_database.d.ts.map +1 -1
  48. package/dist/src/system_database.js +26 -11
  49. package/dist/src/system_database.js.map +1 -1
  50. package/dist/src/testing/testing_runtime.d.ts +2 -1
  51. package/dist/src/testing/testing_runtime.d.ts.map +1 -1
  52. package/dist/src/utils.d.ts +1 -1
  53. package/dist/src/utils.d.ts.map +1 -1
  54. package/dist/src/utils.js +20 -4
  55. package/dist/src/utils.js.map +1 -1
  56. package/dist/tsconfig.build.tsbuildinfo +1 -1
  57. package/examples/hello/start_postgres_docker.sh +1 -1
  58. package/migrations/20240123182943_schema.js +8 -0
  59. package/migrations/20240123183021_tables.js +48 -0
  60. package/migrations/20240123183025_indexes.js +14 -0
  61. package/migrations/20240123183030_triggers.js +39 -0
  62. package/package.json +1 -1
  63. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.d.ts.map +1 -1
  64. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.js +1 -2
  65. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.js.map +1 -1
  66. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.d.ts.map +1 -1
  67. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.js +5 -7
  68. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.js.map +1 -1
  69. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.d.ts.map +1 -1
  70. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.js +1 -2
  71. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.js.map +1 -1
  72. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.d.ts.map +1 -1
  73. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.js +1 -2
  74. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.js.map +1 -1
  75. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.d.ts.map +1 -1
  76. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.js +1 -2
  77. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.js.map +1 -1
  78. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.d.ts.map +1 -1
  79. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.js +1 -2
  80. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.js.map +1 -1
  81. package/packages/dbos-cloud/dist/packages/dbos-cloud/cli.js +0 -12
  82. package/packages/dbos-cloud/dist/packages/dbos-cloud/cli.js.map +1 -1
  83. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.d.ts +7 -0
  84. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.d.ts.map +1 -1
  85. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.js +44 -3
  86. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.js.map +1 -1
  87. package/packages/dbos-cloud/dist/packages/dbos-cloud/login.d.ts.map +1 -1
  88. package/packages/dbos-cloud/dist/packages/dbos-cloud/login.js +3 -4
  89. package/packages/dbos-cloud/dist/packages/dbos-cloud/login.js.map +1 -1
  90. package/packages/dbos-cloud/dist/packages/dbos-cloud/register.d.ts.map +1 -1
  91. package/packages/dbos-cloud/dist/packages/dbos-cloud/register.js +1 -2
  92. package/packages/dbos-cloud/dist/packages/dbos-cloud/register.js.map +1 -1
  93. package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.d.ts +0 -2
  94. package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.d.ts.map +1 -1
  95. package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.js +4 -177
  96. package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.js.map +1 -1
  97. package/packages/dbos-cloud/dist/src/utils.d.ts +1 -1
  98. package/packages/dbos-cloud/dist/src/utils.d.ts.map +1 -1
  99. package/packages/dbos-cloud/dist/src/utils.js +20 -4
  100. package/packages/dbos-cloud/dist/src/utils.js.map +1 -1
  101. package/packages/dbos-cloud/package.json +1 -1
  102. package/packages/dbos-openapi/package.json +1 -1
  103. package/packages/dbos-cloud/dist/schemas/system_db_schema.d.ts +0 -34
  104. package/packages/dbos-cloud/dist/schemas/system_db_schema.d.ts.map +0 -1
  105. package/packages/dbos-cloud/dist/schemas/system_db_schema.js +0 -77
  106. package/packages/dbos-cloud/dist/schemas/system_db_schema.js.map +0 -1
  107. package/packages/dbos-cloud/dist/schemas/user_db_schema.d.ts +0 -11
  108. package/packages/dbos-cloud/dist/schemas/user_db_schema.d.ts.map +0 -1
  109. package/packages/dbos-cloud/dist/schemas/user_db_schema.js +0 -16
  110. package/packages/dbos-cloud/dist/schemas/user_db_schema.js.map +0 -1
  111. package/packages/dbos-cloud/dist/src/communicator.d.ts +0 -25
  112. package/packages/dbos-cloud/dist/src/communicator.d.ts.map +0 -1
  113. package/packages/dbos-cloud/dist/src/communicator.js +0 -26
  114. package/packages/dbos-cloud/dist/src/communicator.js.map +0 -1
  115. package/packages/dbos-cloud/dist/src/context.d.ts +0 -64
  116. package/packages/dbos-cloud/dist/src/context.d.ts.map +0 -1
  117. package/packages/dbos-cloud/dist/src/context.js +0 -96
  118. package/packages/dbos-cloud/dist/src/context.js.map +0 -1
  119. package/packages/dbos-cloud/dist/src/data_validation.d.ts +0 -3
  120. package/packages/dbos-cloud/dist/src/data_validation.d.ts.map +0 -1
  121. package/packages/dbos-cloud/dist/src/data_validation.js +0 -168
  122. package/packages/dbos-cloud/dist/src/data_validation.js.map +0 -1
  123. package/packages/dbos-cloud/dist/src/dbos-executor.d.ts +0 -102
  124. package/packages/dbos-cloud/dist/src/dbos-executor.d.ts.map +0 -1
  125. package/packages/dbos-cloud/dist/src/dbos-executor.js +0 -631
  126. package/packages/dbos-cloud/dist/src/dbos-executor.js.map +0 -1
  127. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.d.ts +0 -3
  128. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.d.ts.map +0 -1
  129. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.js +0 -13
  130. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.js.map +0 -1
  131. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.d.ts +0 -8
  132. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.d.ts.map +0 -1
  133. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.js +0 -47
  134. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.js.map +0 -1
  135. package/packages/dbos-cloud/dist/src/dbos-runtime/config.d.ts +0 -29
  136. package/packages/dbos-cloud/dist/src/dbos-runtime/config.d.ts.map +0 -1
  137. package/packages/dbos-cloud/dist/src/dbos-runtime/config.js +0 -111
  138. package/packages/dbos-cloud/dist/src/dbos-runtime/config.js.map +0 -1
  139. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.d.ts +0 -4
  140. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.d.ts.map +0 -1
  141. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.js +0 -21
  142. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.js.map +0 -1
  143. package/packages/dbos-cloud/dist/src/dbos-runtime/init.d.ts +0 -7
  144. package/packages/dbos-cloud/dist/src/dbos-runtime/init.d.ts.map +0 -1
  145. package/packages/dbos-cloud/dist/src/dbos-runtime/init.js +0 -51
  146. package/packages/dbos-cloud/dist/src/dbos-runtime/init.js.map +0 -1
  147. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.d.ts +0 -28
  148. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.d.ts.map +0 -1
  149. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.js +0 -95
  150. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.js.map +0 -1
  151. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.d.ts +0 -38
  152. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.d.ts.map +0 -1
  153. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.js +0 -211
  154. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.js.map +0 -1
  155. package/packages/dbos-cloud/dist/src/decorators.d.ts +0 -118
  156. package/packages/dbos-cloud/dist/src/decorators.d.ts.map +0 -1
  157. package/packages/dbos-cloud/dist/src/decorators.js +0 -467
  158. package/packages/dbos-cloud/dist/src/decorators.js.map +0 -1
  159. package/packages/dbos-cloud/dist/src/error.d.ts +0 -47
  160. package/packages/dbos-cloud/dist/src/error.d.ts.map +0 -1
  161. package/packages/dbos-cloud/dist/src/error.js +0 -171
  162. package/packages/dbos-cloud/dist/src/error.js.map +0 -1
  163. package/packages/dbos-cloud/dist/src/httpServer/handler.d.ts +0 -54
  164. package/packages/dbos-cloud/dist/src/httpServer/handler.d.ts.map +0 -1
  165. package/packages/dbos-cloud/dist/src/httpServer/handler.js +0 -175
  166. package/packages/dbos-cloud/dist/src/httpServer/handler.js.map +0 -1
  167. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.d.ts +0 -11
  168. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.d.ts.map +0 -1
  169. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.js +0 -19
  170. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.js.map +0 -1
  171. package/packages/dbos-cloud/dist/src/httpServer/middleware.d.ts +0 -56
  172. package/packages/dbos-cloud/dist/src/httpServer/middleware.d.ts.map +0 -1
  173. package/packages/dbos-cloud/dist/src/httpServer/middleware.js +0 -57
  174. package/packages/dbos-cloud/dist/src/httpServer/middleware.js.map +0 -1
  175. package/packages/dbos-cloud/dist/src/httpServer/server.d.ts +0 -45
  176. package/packages/dbos-cloud/dist/src/httpServer/server.d.ts.map +0 -1
  177. package/packages/dbos-cloud/dist/src/httpServer/server.js +0 -253
  178. package/packages/dbos-cloud/dist/src/httpServer/server.js.map +0 -1
  179. package/packages/dbos-cloud/dist/src/system_database.d.ts +0 -89
  180. package/packages/dbos-cloud/dist/src/system_database.d.ts.map +0 -1
  181. package/packages/dbos-cloud/dist/src/system_database.js +0 -447
  182. package/packages/dbos-cloud/dist/src/system_database.js.map +0 -1
  183. package/packages/dbos-cloud/dist/src/telemetry/collector.d.ts +0 -16
  184. package/packages/dbos-cloud/dist/src/telemetry/collector.d.ts.map +0 -1
  185. package/packages/dbos-cloud/dist/src/telemetry/collector.js +0 -65
  186. package/packages/dbos-cloud/dist/src/telemetry/collector.js.map +0 -1
  187. package/packages/dbos-cloud/dist/src/telemetry/exporters.d.ts +0 -15
  188. package/packages/dbos-cloud/dist/src/telemetry/exporters.d.ts.map +0 -1
  189. package/packages/dbos-cloud/dist/src/telemetry/exporters.js +0 -59
  190. package/packages/dbos-cloud/dist/src/telemetry/exporters.js.map +0 -1
  191. package/packages/dbos-cloud/dist/src/telemetry/index.d.ts +0 -11
  192. package/packages/dbos-cloud/dist/src/telemetry/index.d.ts.map +0 -1
  193. package/packages/dbos-cloud/dist/src/telemetry/index.js +0 -19
  194. package/packages/dbos-cloud/dist/src/telemetry/index.js.map +0 -1
  195. package/packages/dbos-cloud/dist/src/telemetry/logs.d.ts +0 -47
  196. package/packages/dbos-cloud/dist/src/telemetry/logs.d.ts.map +0 -1
  197. package/packages/dbos-cloud/dist/src/telemetry/logs.js +0 -195
  198. package/packages/dbos-cloud/dist/src/telemetry/logs.js.map +0 -1
  199. package/packages/dbos-cloud/dist/src/telemetry/traces.d.ts +0 -14
  200. package/packages/dbos-cloud/dist/src/telemetry/traces.d.ts.map +0 -1
  201. package/packages/dbos-cloud/dist/src/telemetry/traces.js +0 -52
  202. package/packages/dbos-cloud/dist/src/telemetry/traces.js.map +0 -1
  203. package/packages/dbos-cloud/dist/src/transaction.d.ts +0 -29
  204. package/packages/dbos-cloud/dist/src/transaction.d.ts.map +0 -1
  205. package/packages/dbos-cloud/dist/src/transaction.js +0 -27
  206. package/packages/dbos-cloud/dist/src/transaction.js.map +0 -1
  207. package/packages/dbos-cloud/dist/src/user_database.d.ts +0 -132
  208. package/packages/dbos-cloud/dist/src/user_database.d.ts.map +0 -1
  209. package/packages/dbos-cloud/dist/src/user_database.js +0 -332
  210. package/packages/dbos-cloud/dist/src/user_database.js.map +0 -1
  211. package/packages/dbos-cloud/dist/src/workflow.d.ts +0 -195
  212. package/packages/dbos-cloud/dist/src/workflow.d.ts.map +0 -1
  213. package/packages/dbos-cloud/dist/src/workflow.js +0 -498
  214. package/packages/dbos-cloud/dist/src/workflow.js.map +0 -1
@@ -1,498 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RetrievedHandle = exports.InvokedHandle = exports.WorkflowContextImpl = exports.StatusString = 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 communicator_1 = require("./communicator");
8
- const error_1 = require("./error");
9
- const serialize_error_1 = require("serialize-error");
10
- const utils_1 = require("./utils");
11
- const api_1 = require("@opentelemetry/api");
12
- const context_1 = require("./context");
13
- const decorators_1 = require("./decorators");
14
- exports.StatusString = {
15
- PENDING: "PENDING",
16
- SUCCESS: "SUCCESS",
17
- ERROR: "ERROR",
18
- };
19
- class WorkflowContextImpl extends context_1.DBOSContextImpl {
20
- workflowConfig;
21
- presetUUID;
22
- functionID = 0;
23
- #dbosExec;
24
- resultBuffer = new Map();
25
- isTempWorkflow;
26
- // For temporary workflows
27
- tempWfOperationType; // "transaction", "external", or "send"
28
- tempWfOperationName; // The name of that operation.
29
- constructor(dbosExec, parentCtx, workflowUUID, workflowConfig, workflowName, presetUUID) {
30
- const span = dbosExec.tracer.startSpan(workflowName, {
31
- status: exports.StatusString.PENDING,
32
- operationUUID: workflowUUID,
33
- operationType: dbos_executor_1.OperationType.WORKFLOW,
34
- authenticatedUser: parentCtx?.authenticatedUser ?? "",
35
- authenticatedRoles: parentCtx?.authenticatedRoles ?? [],
36
- assumedRole: parentCtx?.assumedRole ?? "",
37
- executorID: parentCtx?.executorID,
38
- });
39
- super(workflowName, span, dbosExec.logger, parentCtx);
40
- this.workflowConfig = workflowConfig;
41
- this.presetUUID = presetUUID;
42
- this.workflowUUID = workflowUUID;
43
- this.#dbosExec = dbosExec;
44
- this.isTempWorkflow = dbos_executor_1.DBOSExecutor.tempWorkflowName === workflowName;
45
- this.tempWfOperationType = "";
46
- this.tempWfOperationName = "";
47
- if (dbosExec.config.application) {
48
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
49
- this.applicationConfig = dbosExec.config.application;
50
- }
51
- }
52
- functionIDGetIncrement() {
53
- return this.functionID++;
54
- }
55
- /**
56
- * Retrieve the transaction snapshot information of the current transaction
57
- */
58
- async retrieveSnapshot(client) {
59
- const rows = await this.#dbosExec.userDatabase.queryWithClient(client, "SELECT pg_current_snapshot()::text as txn_snapshot;");
60
- return rows[0].txn_snapshot;
61
- }
62
- /**
63
- * Check if an operation has already executed in a workflow.
64
- * If it previously executed successfully, return its output.
65
- * If it previously executed and threw an error, throw that error.
66
- * Otherwise, return DBOSNull.
67
- * Also return the transaction snapshot information of this current transaction.
68
- */
69
- async checkExecution(client, funcID) {
70
- // Note: we read the current snapshot, not the recorded one!
71
- const rows = await this.#dbosExec.userDatabase.queryWithClient(client, "(SELECT output, error, txn_snapshot, true as recorded FROM dbos.transaction_outputs WHERE workflow_uuid=$1 AND function_id=$2 UNION ALL SELECT null as output, null as error, pg_current_snapshot()::text as txn_snapshot, false as recorded) ORDER BY recorded", this.workflowUUID, funcID);
72
- if (rows.length === 0 || rows.length > 2) {
73
- this.logger.error("Unexpected! This should never happen. Returned rows: " + rows.toString());
74
- throw new error_1.DBOSError("This should never happen. Returned rows: " + rows.toString());
75
- }
76
- const res = {
77
- output: dbos_executor_1.dbosNull,
78
- txn_snapshot: ""
79
- };
80
- // recorded=false row will be first because we used ORDER BY.
81
- res.txn_snapshot = rows[0].txn_snapshot;
82
- if (rows.length === 2) {
83
- if (JSON.parse(rows[1].error) !== null) {
84
- throw (0, serialize_error_1.deserializeError)(JSON.parse(rows[1].error));
85
- }
86
- else {
87
- res.output = JSON.parse(rows[1].output);
88
- }
89
- }
90
- return res;
91
- }
92
- /**
93
- * Write all entries in the workflow result buffer to the database.
94
- * If it encounters a primary key error, this indicates a concurrent execution with the same UUID, so throw an DBOSError.
95
- */
96
- async flushResultBuffer(client) {
97
- const funcIDs = Array.from(this.resultBuffer.keys());
98
- if (funcIDs.length === 0) {
99
- return;
100
- }
101
- funcIDs.sort();
102
- try {
103
- let sqlStmt = "INSERT INTO dbos.transaction_outputs (workflow_uuid, function_id, output, error, txn_id, txn_snapshot) VALUES ";
104
- let paramCnt = 1;
105
- const values = [];
106
- for (const funcID of funcIDs) {
107
- // Capture output and also transaction snapshot information.
108
- // Initially, no txn_id because no queries executed.
109
- const recorded = this.resultBuffer.get(funcID);
110
- const output = recorded.output;
111
- const txnSnapshot = recorded.txn_snapshot;
112
- if (paramCnt > 1) {
113
- sqlStmt += ", ";
114
- }
115
- sqlStmt += `($${paramCnt++}, $${paramCnt++}, $${paramCnt++}, $${paramCnt++}, null, $${paramCnt++})`;
116
- values.push(this.workflowUUID, funcID, JSON.stringify(output), JSON.stringify(null), txnSnapshot);
117
- }
118
- this.logger.debug(sqlStmt);
119
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
120
- await this.#dbosExec.userDatabase.queryWithClient(client, sqlStmt, ...values);
121
- }
122
- catch (error) {
123
- if (this.#dbosExec.userDatabase.isKeyConflictError(error)) {
124
- // Serialization and primary key conflict (Postgres).
125
- throw new error_1.DBOSWorkflowConflictUUIDError(this.workflowUUID);
126
- }
127
- else {
128
- throw error;
129
- }
130
- }
131
- }
132
- /**
133
- * Buffer a placeholder value to guard an operation against concurrent executions with the same UUID.
134
- */
135
- guardOperation(funcID, txnSnapshot) {
136
- const guardOutput = {
137
- output: null,
138
- txn_snapshot: txnSnapshot,
139
- };
140
- this.resultBuffer.set(funcID, guardOutput);
141
- }
142
- /**
143
- * Write a guarded operation's output to the database.
144
- */
145
- async recordGuardedOutput(client, funcID, output) {
146
- const serialOutput = JSON.stringify(output);
147
- const rows = await this.#dbosExec.userDatabase.queryWithClient(client, "UPDATE dbos.transaction_outputs SET output=$1, txn_id=(select pg_current_xact_id_if_assigned()::text) WHERE workflow_uuid=$2 AND function_id=$3 RETURNING txn_id;", serialOutput, this.workflowUUID, funcID);
148
- return rows[0].txn_id; // Must have a transaction ID because we inserted the guard before.
149
- }
150
- /**
151
- * Write an unguarded operation's output to the database.
152
- */
153
- async recordUnguardedOutput(client, funcID, output) {
154
- const serialOutput = JSON.stringify(output);
155
- const rows = await this.#dbosExec.userDatabase.queryWithClient(client, "INSERT INTO dbos.transaction_outputs (workflow_uuid, function_id, output, txn_id, txn_snapshot) VALUES ($1, $2, $3, (select pg_current_xact_id_if_assigned()::text), (select pg_current_snapshot()::text)) RETURNING txn_id;", this.workflowUUID, funcID, serialOutput);
156
- return rows[0].txn_id;
157
- }
158
- /**
159
- * Record an error in a guarded operation to the database.
160
- */
161
- async recordGuardedError(client, funcID, err) {
162
- const serialErr = JSON.stringify((0, serialize_error_1.serializeError)(err));
163
- await this.#dbosExec.userDatabase.queryWithClient(client, "UPDATE dbos.transaction_outputs SET error=$1 WHERE workflow_uuid=$2 AND function_id=$3;", serialErr, this.workflowUUID, funcID);
164
- }
165
- /**
166
- * Record an error in an unguarded operation to the database.
167
- */
168
- async recordUnguardedError(client, funcID, err) {
169
- const serialErr = JSON.stringify((0, serialize_error_1.serializeError)(err));
170
- const rows = await this.#dbosExec.userDatabase.queryWithClient(client, "INSERT INTO dbos.transaction_outputs (workflow_uuid, function_id, error, txn_id, txn_snapshot) VALUES ($1, $2, $3, (select pg_current_xact_id_if_assigned()::text), (select pg_current_snapshot()::text)) RETURNING txn_id;", this.workflowUUID, funcID, serialErr);
171
- return rows[0].txn_id;
172
- }
173
- /**
174
- * Invoke another workflow as its child workflow and return a workflow handle.
175
- * The child workflow is guaranteed to be executed exactly once, even if the workflow is retried with the same UUID.
176
- * We pass in itself as a parent context adn assign the child workflow with a deterministic UUID "this.workflowUUID-functionID", which appends a function ID to its own UUID.
177
- * We also pass in its own workflowUUID and function ID so the invoked handle is deterministic.
178
- */
179
- async childWorkflow(wf, ...args) {
180
- // Note: cannot use invoke for childWorkflow because of potential recursive types on the workflow itself.
181
- const funcId = this.functionIDGetIncrement();
182
- const childUUID = this.workflowUUID + "-" + funcId;
183
- return this.#dbosExec.internalWorkflow(wf, { parentCtx: this, workflowUUID: childUUID }, this.workflowUUID, funcId, ...args);
184
- }
185
- /**
186
- * Execute a transactional function.
187
- * The transaction is guaranteed to execute exactly once, even if the workflow is retried with the same UUID.
188
- * If the transaction encounters a Postgres serialization error, retry it.
189
- * If it encounters any other error, throw it.
190
- */
191
- async transaction(txn, ...args) {
192
- const txnInfo = this.#dbosExec.transactionInfoMap.get(txn.name);
193
- if (txnInfo === undefined) {
194
- throw new error_1.DBOSNotRegisteredError(txn.name);
195
- }
196
- const readOnly = txnInfo.config.readOnly ?? false;
197
- let retryWaitMillis = 1;
198
- const backoffFactor = 2;
199
- const funcId = this.functionIDGetIncrement();
200
- const span = this.#dbosExec.tracer.startSpan(txn.name, {
201
- operationUUID: this.workflowUUID,
202
- operationType: dbos_executor_1.OperationType.TRANSACTION,
203
- authenticatedUser: this.authenticatedUser,
204
- assumedRole: this.assumedRole,
205
- authenticatedRoles: this.authenticatedRoles,
206
- readOnly: readOnly,
207
- isolationLevel: txnInfo.config.isolationLevel,
208
- executorID: this.executorID,
209
- }, this.span);
210
- // eslint-disable-next-line no-constant-condition
211
- while (true) {
212
- const wrappedTransaction = async (client) => {
213
- const tCtxt = new transaction_1.TransactionContextImpl(this.#dbosExec.userDatabase.getName(), client, this, span, this.#dbosExec.logger, funcId, txn.name);
214
- // If the UUID is preset, it is possible this execution previously happened. Check, and return its original result if it did.
215
- // Note: It is possible to retrieve a generated ID from a workflow handle, run a concurrent execution, and cause trouble for yourself. We recommend against this.
216
- let txn_snapshot;
217
- if (this.presetUUID) {
218
- const check = await this.checkExecution(client, funcId);
219
- txn_snapshot = check.txn_snapshot;
220
- if (check.output !== dbos_executor_1.dbosNull) {
221
- tCtxt.span.setAttribute("cached", true);
222
- tCtxt.span.setStatus({ code: api_1.SpanStatusCode.OK });
223
- this.#dbosExec.tracer.endSpan(tCtxt.span);
224
- return check.output;
225
- }
226
- }
227
- else if (readOnly) {
228
- // Collect snapshot information for read-only transactions, if not already collected above
229
- txn_snapshot = await this.retrieveSnapshot(client);
230
- }
231
- // If the UUID is preset, set a guard to block concurrent executions with the same UUID.
232
- if (this.presetUUID) {
233
- this.guardOperation(funcId, txn_snapshot);
234
- }
235
- // For non-read-only transactions, flush the result buffer, including the guard if present.
236
- if (!readOnly) {
237
- await this.flushResultBuffer(client);
238
- }
239
- // Execute the user's transaction.
240
- const result = await txn(tCtxt, ...args);
241
- // Record the execution, commit, and return.
242
- if (readOnly) {
243
- // Buffer the output of read-only transactions instead of synchronously writing it.
244
- const guardOutput = {
245
- output: result,
246
- txn_snapshot: txn_snapshot,
247
- };
248
- this.resultBuffer.set(funcId, guardOutput);
249
- }
250
- else {
251
- // Synchronously record the output of write transactions and obtain the transaction ID.
252
- const pg_txn_id = this.presetUUID ? await this.recordGuardedOutput(client, funcId, result) : await this.recordUnguardedOutput(client, funcId, result);
253
- tCtxt.span.setAttribute("pg_txn_id", pg_txn_id);
254
- this.resultBuffer.clear();
255
- }
256
- return result;
257
- };
258
- try {
259
- const result = await this.#dbosExec.userDatabase.transaction(wrappedTransaction, txnInfo.config);
260
- span.setStatus({ code: api_1.SpanStatusCode.OK });
261
- return result;
262
- }
263
- catch (err) {
264
- if (this.#dbosExec.userDatabase.isRetriableTransactionError(err)) {
265
- // serialization_failure in PostgreSQL
266
- span.addEvent("TXN SERIALIZATION FAILURE", { retryWaitMillis });
267
- // Retry serialization failures.
268
- await (0, utils_1.sleep)(retryWaitMillis);
269
- retryWaitMillis *= backoffFactor;
270
- continue;
271
- }
272
- // Record and throw other errors.
273
- const e = err;
274
- await this.#dbosExec.userDatabase.transaction(async (client) => {
275
- await this.flushResultBuffer(client);
276
- this.presetUUID ? await this.recordGuardedError(client, funcId, e) : await this.recordUnguardedError(client, funcId, e);
277
- }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
278
- this.resultBuffer.clear();
279
- span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: e.message });
280
- throw err;
281
- }
282
- finally {
283
- this.#dbosExec.tracer.endSpan(span);
284
- }
285
- }
286
- }
287
- /**
288
- * Execute a communicator function.
289
- * If it encounters any error, retry according to its configured retry policy until the maximum number of attempts is reached, then throw an DBOSError.
290
- * The communicator may execute many times, but once it is complete, it will not re-execute.
291
- */
292
- async external(commFn, ...args) {
293
- const commInfo = this.#dbosExec.communicatorInfoMap.get(commFn.name);
294
- if (commInfo === undefined) {
295
- throw new error_1.DBOSNotRegisteredError(commFn.name);
296
- }
297
- const funcID = this.functionIDGetIncrement();
298
- const span = this.#dbosExec.tracer.startSpan(commFn.name, {
299
- operationUUID: this.workflowUUID,
300
- operationType: dbos_executor_1.OperationType.COMMUNICATOR,
301
- authenticatedUser: this.authenticatedUser,
302
- assumedRole: this.assumedRole,
303
- authenticatedRoles: this.authenticatedRoles,
304
- executorID: this.executorID,
305
- retriesAllowed: commInfo.config.retriesAllowed,
306
- intervalSeconds: commInfo.config.intervalSeconds,
307
- maxAttempts: commInfo.config.maxAttempts,
308
- backoffRate: commInfo.config.backoffRate,
309
- }, this.span);
310
- const ctxt = new communicator_1.CommunicatorContextImpl(this, funcID, span, this.#dbosExec.logger, commInfo.config, commFn.name);
311
- await this.#dbosExec.userDatabase.transaction(async (client) => {
312
- await this.flushResultBuffer(client);
313
- }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
314
- this.resultBuffer.clear();
315
- // Check if this execution previously happened, returning its original result if it did.
316
- const check = await this.#dbosExec.systemDatabase.checkOperationOutput(this.workflowUUID, ctxt.functionID);
317
- if (check !== dbos_executor_1.dbosNull) {
318
- ctxt.span.setAttribute("cached", true);
319
- ctxt.span.setStatus({ code: api_1.SpanStatusCode.OK });
320
- this.#dbosExec.tracer.endSpan(ctxt.span);
321
- return check;
322
- }
323
- // Execute the communicator function. If it throws an exception, retry with exponential backoff.
324
- // After reaching the maximum number of retries, throw an DBOSError.
325
- let result = dbos_executor_1.dbosNull;
326
- let err = dbos_executor_1.dbosNull;
327
- if (ctxt.retriesAllowed) {
328
- let numAttempts = 0;
329
- let intervalSeconds = ctxt.intervalSeconds;
330
- while (result === dbos_executor_1.dbosNull && numAttempts++ < ctxt.maxAttempts) {
331
- try {
332
- result = await commFn(ctxt, ...args);
333
- }
334
- catch (error) {
335
- if (numAttempts < ctxt.maxAttempts) {
336
- // Sleep for an interval, then increase the interval by backoffRate.
337
- await (0, utils_1.sleep)(intervalSeconds);
338
- intervalSeconds *= ctxt.backoffRate;
339
- }
340
- ctxt.span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: error.message });
341
- this.#dbosExec.tracer.endSpan(ctxt.span);
342
- }
343
- }
344
- }
345
- else {
346
- try {
347
- result = await commFn(ctxt, ...args);
348
- }
349
- catch (error) {
350
- err = error;
351
- ctxt.span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: error.message });
352
- this.#dbosExec.tracer.endSpan(ctxt.span);
353
- }
354
- }
355
- // `result` can only be dbosNull when the communicator timed out
356
- if (result === dbos_executor_1.dbosNull) {
357
- // Record the error, then throw it.
358
- err = err === dbos_executor_1.dbosNull ? new error_1.DBOSError("Communicator reached maximum retries.", 1) : err;
359
- await this.#dbosExec.systemDatabase.recordOperationError(this.workflowUUID, ctxt.functionID, err);
360
- ctxt.span.setStatus({ code: api_1.SpanStatusCode.ERROR, message: err.message });
361
- this.#dbosExec.tracer.endSpan(ctxt.span);
362
- throw err;
363
- }
364
- else {
365
- // Record the execution and return.
366
- await this.#dbosExec.systemDatabase.recordOperationOutput(this.workflowUUID, ctxt.functionID, result);
367
- ctxt.span.setStatus({ code: api_1.SpanStatusCode.OK });
368
- this.#dbosExec.tracer.endSpan(ctxt.span);
369
- return result;
370
- }
371
- }
372
- /**
373
- * Send a message to a workflow identified by a UUID.
374
- * The message can optionally be tagged with a topic.
375
- */
376
- async send(destinationUUID, message, topic) {
377
- const functionID = this.functionIDGetIncrement();
378
- await this.#dbosExec.userDatabase.transaction(async (client) => {
379
- await this.flushResultBuffer(client);
380
- }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
381
- this.resultBuffer.clear();
382
- await this.#dbosExec.systemDatabase.send(this.workflowUUID, functionID, destinationUUID, message, topic);
383
- }
384
- /**
385
- * Consume and return the oldest unconsumed message sent to your UUID.
386
- * If a topic is specified, retrieve the oldest message tagged with that topic.
387
- * Otherwise, retrieve the oldest message with no topic.
388
- */
389
- async recv(topic, timeoutSeconds = dbos_executor_1.DBOSExecutor.defaultNotificationTimeoutSec) {
390
- const functionID = this.functionIDGetIncrement();
391
- await this.#dbosExec.userDatabase.transaction(async (client) => {
392
- await this.flushResultBuffer(client);
393
- }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
394
- this.resultBuffer.clear();
395
- return this.#dbosExec.systemDatabase.recv(this.workflowUUID, functionID, topic, timeoutSeconds);
396
- }
397
- /**
398
- * Emit a workflow event, represented as a key-value pair.
399
- * Events are immutable once set.
400
- */
401
- async setEvent(key, value) {
402
- const functionID = this.functionIDGetIncrement();
403
- await this.#dbosExec.userDatabase.transaction(async (client) => {
404
- await this.flushResultBuffer(client);
405
- }, { isolationLevel: transaction_1.IsolationLevel.ReadCommitted });
406
- this.resultBuffer.clear();
407
- await this.#dbosExec.systemDatabase.setEvent(this.workflowUUID, functionID, key, value);
408
- }
409
- /**
410
- * Generate a proxy object for the provided class that wraps direct calls (i.e. OpClass.someMethod(param))
411
- * to use WorkflowContext.Transaction(OpClass.someMethod, param);
412
- */
413
- invoke(object) {
414
- const ops = (0, decorators_1.getRegisteredOperations)(object);
415
- const proxy = {};
416
- for (const op of ops) {
417
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
418
- proxy[op.name] = op.txnConfig
419
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
420
- ? (...args) => this.transaction(op.registeredFunction, ...args)
421
- : op.commConfig
422
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
423
- ? (...args) => this.external(op.registeredFunction, ...args)
424
- : undefined;
425
- }
426
- return proxy;
427
- }
428
- /**
429
- * Wait for a workflow to emit an event, then return its value.
430
- */
431
- getEvent(targetUUID, key, timeoutSeconds = dbos_executor_1.DBOSExecutor.defaultNotificationTimeoutSec) {
432
- const functionID = this.functionIDGetIncrement();
433
- return this.#dbosExec.systemDatabase.getEvent(targetUUID, key, timeoutSeconds, this.workflowUUID, functionID);
434
- }
435
- /**
436
- * Retrieve a handle for a workflow UUID.
437
- */
438
- retrieveWorkflow(targetUUID) {
439
- const functionID = this.functionIDGetIncrement();
440
- return new RetrievedHandle(this.#dbosExec.systemDatabase, targetUUID, this.workflowUUID, functionID);
441
- }
442
- }
443
- exports.WorkflowContextImpl = WorkflowContextImpl;
444
- /**
445
- * The handle returned when invoking a workflow with DBOSExecutor.workflow
446
- */
447
- class InvokedHandle {
448
- systemDatabase;
449
- workflowPromise;
450
- workflowUUID;
451
- workflowName;
452
- callerUUID;
453
- callerFunctionID;
454
- constructor(systemDatabase, workflowPromise, workflowUUID, workflowName, callerUUID, callerFunctionID) {
455
- this.systemDatabase = systemDatabase;
456
- this.workflowPromise = workflowPromise;
457
- this.workflowUUID = workflowUUID;
458
- this.workflowName = workflowName;
459
- this.callerUUID = callerUUID;
460
- this.callerFunctionID = callerFunctionID;
461
- }
462
- getWorkflowUUID() {
463
- return this.workflowUUID;
464
- }
465
- async getStatus() {
466
- return this.systemDatabase.getWorkflowStatus(this.workflowUUID, this.callerUUID, this.callerFunctionID);
467
- }
468
- async getResult() {
469
- return this.workflowPromise;
470
- }
471
- }
472
- exports.InvokedHandle = InvokedHandle;
473
- /**
474
- * The handle returned when retrieving a workflow with DBOSExecutor.retrieve
475
- */
476
- class RetrievedHandle {
477
- systemDatabase;
478
- workflowUUID;
479
- callerUUID;
480
- callerFunctionID;
481
- constructor(systemDatabase, workflowUUID, callerUUID, callerFunctionID) {
482
- this.systemDatabase = systemDatabase;
483
- this.workflowUUID = workflowUUID;
484
- this.callerUUID = callerUUID;
485
- this.callerFunctionID = callerFunctionID;
486
- }
487
- getWorkflowUUID() {
488
- return this.workflowUUID;
489
- }
490
- async getStatus() {
491
- return await this.systemDatabase.getWorkflowStatus(this.workflowUUID, this.callerUUID, this.callerFunctionID);
492
- }
493
- async getResult() {
494
- return await this.systemDatabase.getWorkflowResult(this.workflowUUID);
495
- }
496
- }
497
- exports.RetrievedHandle = RetrievedHandle;
498
- //# sourceMappingURL=workflow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../../../src/workflow.ts"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