@dbos-inc/dbos-sdk 0.8.45-preview.g56ba028de5 → 0.8.48-preview

Sign up to get free protection for your applications and to get access to all the features.
Files changed (246) 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-executor.d.ts +0 -1
  38. package/dist/src/dbos-executor.d.ts.map +1 -1
  39. package/dist/src/dbos-executor.js +4 -8
  40. package/dist/src/dbos-executor.js.map +1 -1
  41. package/dist/src/dbos-runtime/cli.d.ts.map +1 -1
  42. package/dist/src/dbos-runtime/cli.js +15 -2
  43. package/dist/src/dbos-runtime/cli.js.map +1 -1
  44. package/dist/src/dbos-runtime/migrate.d.ts +3 -0
  45. package/dist/src/dbos-runtime/migrate.d.ts.map +1 -0
  46. package/dist/src/dbos-runtime/migrate.js +175 -0
  47. package/dist/src/dbos-runtime/migrate.js.map +1 -0
  48. package/dist/src/dbos-runtime/runtime.d.ts +7 -9
  49. package/dist/src/dbos-runtime/runtime.d.ts.map +1 -1
  50. package/dist/src/dbos-runtime/runtime.js +35 -21
  51. package/dist/src/dbos-runtime/runtime.js.map +1 -1
  52. package/dist/src/httpServer/handler.d.ts.map +1 -1
  53. package/dist/src/httpServer/handler.js +3 -2
  54. package/dist/src/httpServer/handler.js.map +1 -1
  55. package/dist/src/httpServer/server.d.ts +10 -7
  56. package/dist/src/httpServer/server.d.ts.map +1 -1
  57. package/dist/src/httpServer/server.js +23 -29
  58. package/dist/src/httpServer/server.js.map +1 -1
  59. package/dist/src/index.d.ts +0 -1
  60. package/dist/src/index.d.ts.map +1 -1
  61. package/dist/src/index.js +1 -3
  62. package/dist/src/index.js.map +1 -1
  63. package/dist/src/system_database.d.ts +2 -0
  64. package/dist/src/system_database.d.ts.map +1 -1
  65. package/dist/src/system_database.js +31 -16
  66. package/dist/src/system_database.js.map +1 -1
  67. package/dist/src/telemetry/collector.d.ts.map +1 -1
  68. package/dist/src/telemetry/collector.js +1 -0
  69. package/dist/src/telemetry/collector.js.map +1 -1
  70. package/dist/src/telemetry/exporters.d.ts +2 -0
  71. package/dist/src/telemetry/exporters.d.ts.map +1 -1
  72. package/dist/src/telemetry/exporters.js +4 -0
  73. package/dist/src/telemetry/exporters.js.map +1 -1
  74. package/dist/src/telemetry/logs.d.ts.map +1 -1
  75. package/dist/src/telemetry/logs.js +15 -33
  76. package/dist/src/telemetry/logs.js.map +1 -1
  77. package/dist/src/telemetry/traces.js +2 -2
  78. package/dist/src/telemetry/traces.js.map +1 -1
  79. package/dist/src/testing/testing_runtime.d.ts +4 -1
  80. package/dist/src/testing/testing_runtime.d.ts.map +1 -1
  81. package/dist/src/testing/testing_runtime.js +6 -0
  82. package/dist/src/testing/testing_runtime.js.map +1 -1
  83. package/dist/src/utils.d.ts +1 -1
  84. package/dist/src/utils.d.ts.map +1 -1
  85. package/dist/src/utils.js +20 -4
  86. package/dist/src/utils.js.map +1 -1
  87. package/dist/tsconfig.build.tsbuildinfo +1 -1
  88. package/examples/hello/start_postgres_docker.sh +1 -1
  89. package/migrations/20240123182943_schema.js +8 -0
  90. package/migrations/20240123183021_tables.js +48 -0
  91. package/migrations/20240123183025_indexes.js +14 -0
  92. package/migrations/20240123183030_triggers.js +39 -0
  93. package/migrations/20240124015239_status_timestamp.js +22 -0
  94. package/package.json +1 -1
  95. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.d.ts.map +1 -1
  96. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.js +1 -2
  97. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.js.map +1 -1
  98. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.d.ts.map +1 -1
  99. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.js +5 -7
  100. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.js.map +1 -1
  101. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.d.ts.map +1 -1
  102. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.js +1 -2
  103. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.js.map +1 -1
  104. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.d.ts.map +1 -1
  105. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.js +1 -2
  106. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.js.map +1 -1
  107. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.d.ts.map +1 -1
  108. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.js +1 -2
  109. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.js.map +1 -1
  110. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.d.ts.map +1 -1
  111. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.js +1 -2
  112. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.js.map +1 -1
  113. package/packages/dbos-cloud/dist/packages/dbos-cloud/cli.js +0 -12
  114. package/packages/dbos-cloud/dist/packages/dbos-cloud/cli.js.map +1 -1
  115. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.d.ts +7 -0
  116. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.d.ts.map +1 -1
  117. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.js +44 -3
  118. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.js.map +1 -1
  119. package/packages/dbos-cloud/dist/packages/dbos-cloud/login.d.ts.map +1 -1
  120. package/packages/dbos-cloud/dist/packages/dbos-cloud/login.js +3 -4
  121. package/packages/dbos-cloud/dist/packages/dbos-cloud/login.js.map +1 -1
  122. package/packages/dbos-cloud/dist/packages/dbos-cloud/register.d.ts.map +1 -1
  123. package/packages/dbos-cloud/dist/packages/dbos-cloud/register.js +1 -2
  124. package/packages/dbos-cloud/dist/packages/dbos-cloud/register.js.map +1 -1
  125. package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.d.ts +0 -2
  126. package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.d.ts.map +1 -1
  127. package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.js +4 -177
  128. package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.js.map +1 -1
  129. package/packages/dbos-cloud/dist/src/utils.d.ts +1 -1
  130. package/packages/dbos-cloud/dist/src/utils.d.ts.map +1 -1
  131. package/packages/dbos-cloud/dist/src/utils.js +20 -4
  132. package/packages/dbos-cloud/dist/src/utils.js.map +1 -1
  133. package/packages/dbos-cloud/package.json +1 -1
  134. package/packages/dbos-openapi/package.json +1 -1
  135. package/packages/dbos-cloud/dist/schemas/system_db_schema.d.ts +0 -34
  136. package/packages/dbos-cloud/dist/schemas/system_db_schema.d.ts.map +0 -1
  137. package/packages/dbos-cloud/dist/schemas/system_db_schema.js +0 -77
  138. package/packages/dbos-cloud/dist/schemas/system_db_schema.js.map +0 -1
  139. package/packages/dbos-cloud/dist/schemas/user_db_schema.d.ts +0 -11
  140. package/packages/dbos-cloud/dist/schemas/user_db_schema.d.ts.map +0 -1
  141. package/packages/dbos-cloud/dist/schemas/user_db_schema.js +0 -16
  142. package/packages/dbos-cloud/dist/schemas/user_db_schema.js.map +0 -1
  143. package/packages/dbos-cloud/dist/src/communicator.d.ts +0 -25
  144. package/packages/dbos-cloud/dist/src/communicator.d.ts.map +0 -1
  145. package/packages/dbos-cloud/dist/src/communicator.js +0 -26
  146. package/packages/dbos-cloud/dist/src/communicator.js.map +0 -1
  147. package/packages/dbos-cloud/dist/src/context.d.ts +0 -64
  148. package/packages/dbos-cloud/dist/src/context.d.ts.map +0 -1
  149. package/packages/dbos-cloud/dist/src/context.js +0 -96
  150. package/packages/dbos-cloud/dist/src/context.js.map +0 -1
  151. package/packages/dbos-cloud/dist/src/data_validation.d.ts +0 -3
  152. package/packages/dbos-cloud/dist/src/data_validation.d.ts.map +0 -1
  153. package/packages/dbos-cloud/dist/src/data_validation.js +0 -168
  154. package/packages/dbos-cloud/dist/src/data_validation.js.map +0 -1
  155. package/packages/dbos-cloud/dist/src/dbos-executor.d.ts +0 -102
  156. package/packages/dbos-cloud/dist/src/dbos-executor.d.ts.map +0 -1
  157. package/packages/dbos-cloud/dist/src/dbos-executor.js +0 -631
  158. package/packages/dbos-cloud/dist/src/dbos-executor.js.map +0 -1
  159. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.d.ts +0 -3
  160. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.d.ts.map +0 -1
  161. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.js +0 -13
  162. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.js.map +0 -1
  163. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.d.ts +0 -8
  164. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.d.ts.map +0 -1
  165. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.js +0 -47
  166. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.js.map +0 -1
  167. package/packages/dbos-cloud/dist/src/dbos-runtime/config.d.ts +0 -29
  168. package/packages/dbos-cloud/dist/src/dbos-runtime/config.d.ts.map +0 -1
  169. package/packages/dbos-cloud/dist/src/dbos-runtime/config.js +0 -111
  170. package/packages/dbos-cloud/dist/src/dbos-runtime/config.js.map +0 -1
  171. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.d.ts +0 -4
  172. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.d.ts.map +0 -1
  173. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.js +0 -21
  174. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.js.map +0 -1
  175. package/packages/dbos-cloud/dist/src/dbos-runtime/init.d.ts +0 -7
  176. package/packages/dbos-cloud/dist/src/dbos-runtime/init.d.ts.map +0 -1
  177. package/packages/dbos-cloud/dist/src/dbos-runtime/init.js +0 -51
  178. package/packages/dbos-cloud/dist/src/dbos-runtime/init.js.map +0 -1
  179. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.d.ts +0 -28
  180. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.d.ts.map +0 -1
  181. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.js +0 -95
  182. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.js.map +0 -1
  183. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.d.ts +0 -38
  184. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.d.ts.map +0 -1
  185. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.js +0 -211
  186. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.js.map +0 -1
  187. package/packages/dbos-cloud/dist/src/decorators.d.ts +0 -118
  188. package/packages/dbos-cloud/dist/src/decorators.d.ts.map +0 -1
  189. package/packages/dbos-cloud/dist/src/decorators.js +0 -467
  190. package/packages/dbos-cloud/dist/src/decorators.js.map +0 -1
  191. package/packages/dbos-cloud/dist/src/error.d.ts +0 -47
  192. package/packages/dbos-cloud/dist/src/error.d.ts.map +0 -1
  193. package/packages/dbos-cloud/dist/src/error.js +0 -171
  194. package/packages/dbos-cloud/dist/src/error.js.map +0 -1
  195. package/packages/dbos-cloud/dist/src/httpServer/handler.d.ts +0 -54
  196. package/packages/dbos-cloud/dist/src/httpServer/handler.d.ts.map +0 -1
  197. package/packages/dbos-cloud/dist/src/httpServer/handler.js +0 -175
  198. package/packages/dbos-cloud/dist/src/httpServer/handler.js.map +0 -1
  199. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.d.ts +0 -11
  200. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.d.ts.map +0 -1
  201. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.js +0 -19
  202. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.js.map +0 -1
  203. package/packages/dbos-cloud/dist/src/httpServer/middleware.d.ts +0 -56
  204. package/packages/dbos-cloud/dist/src/httpServer/middleware.d.ts.map +0 -1
  205. package/packages/dbos-cloud/dist/src/httpServer/middleware.js +0 -57
  206. package/packages/dbos-cloud/dist/src/httpServer/middleware.js.map +0 -1
  207. package/packages/dbos-cloud/dist/src/httpServer/server.d.ts +0 -45
  208. package/packages/dbos-cloud/dist/src/httpServer/server.d.ts.map +0 -1
  209. package/packages/dbos-cloud/dist/src/httpServer/server.js +0 -253
  210. package/packages/dbos-cloud/dist/src/httpServer/server.js.map +0 -1
  211. package/packages/dbos-cloud/dist/src/system_database.d.ts +0 -89
  212. package/packages/dbos-cloud/dist/src/system_database.d.ts.map +0 -1
  213. package/packages/dbos-cloud/dist/src/system_database.js +0 -447
  214. package/packages/dbos-cloud/dist/src/system_database.js.map +0 -1
  215. package/packages/dbos-cloud/dist/src/telemetry/collector.d.ts +0 -16
  216. package/packages/dbos-cloud/dist/src/telemetry/collector.d.ts.map +0 -1
  217. package/packages/dbos-cloud/dist/src/telemetry/collector.js +0 -65
  218. package/packages/dbos-cloud/dist/src/telemetry/collector.js.map +0 -1
  219. package/packages/dbos-cloud/dist/src/telemetry/exporters.d.ts +0 -15
  220. package/packages/dbos-cloud/dist/src/telemetry/exporters.d.ts.map +0 -1
  221. package/packages/dbos-cloud/dist/src/telemetry/exporters.js +0 -59
  222. package/packages/dbos-cloud/dist/src/telemetry/exporters.js.map +0 -1
  223. package/packages/dbos-cloud/dist/src/telemetry/index.d.ts +0 -11
  224. package/packages/dbos-cloud/dist/src/telemetry/index.d.ts.map +0 -1
  225. package/packages/dbos-cloud/dist/src/telemetry/index.js +0 -19
  226. package/packages/dbos-cloud/dist/src/telemetry/index.js.map +0 -1
  227. package/packages/dbos-cloud/dist/src/telemetry/logs.d.ts +0 -47
  228. package/packages/dbos-cloud/dist/src/telemetry/logs.d.ts.map +0 -1
  229. package/packages/dbos-cloud/dist/src/telemetry/logs.js +0 -195
  230. package/packages/dbos-cloud/dist/src/telemetry/logs.js.map +0 -1
  231. package/packages/dbos-cloud/dist/src/telemetry/traces.d.ts +0 -14
  232. package/packages/dbos-cloud/dist/src/telemetry/traces.d.ts.map +0 -1
  233. package/packages/dbos-cloud/dist/src/telemetry/traces.js +0 -52
  234. package/packages/dbos-cloud/dist/src/telemetry/traces.js.map +0 -1
  235. package/packages/dbos-cloud/dist/src/transaction.d.ts +0 -29
  236. package/packages/dbos-cloud/dist/src/transaction.d.ts.map +0 -1
  237. package/packages/dbos-cloud/dist/src/transaction.js +0 -27
  238. package/packages/dbos-cloud/dist/src/transaction.js.map +0 -1
  239. package/packages/dbos-cloud/dist/src/user_database.d.ts +0 -132
  240. package/packages/dbos-cloud/dist/src/user_database.d.ts.map +0 -1
  241. package/packages/dbos-cloud/dist/src/user_database.js +0 -332
  242. package/packages/dbos-cloud/dist/src/user_database.js.map +0 -1
  243. package/packages/dbos-cloud/dist/src/workflow.d.ts +0 -195
  244. package/packages/dbos-cloud/dist/src/workflow.d.ts.map +0 -1
  245. package/packages/dbos-cloud/dist/src/workflow.js +0 -498
  246. package/packages/dbos-cloud/dist/src/workflow.js.map +0 -1
@@ -1,332 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KnexUserDatabase = exports.TypeORMDatabase = exports.PrismaUserDatabase = exports.PGNodeUserDatabase = exports.UserDatabaseName = void 0;
4
- /* eslint-disable @typescript-eslint/no-explicit-any */
5
- const pg_1 = require("pg");
6
- const user_db_schema_1 = require("../schemas/user_db_schema");
7
- const transaction_1 = require("./transaction");
8
- exports.UserDatabaseName = {
9
- PGNODE: "pg-node",
10
- PRISMA: "prisma",
11
- TYPEORM: "typeorm",
12
- KNEX: "knex",
13
- };
14
- /**
15
- * node-postgres user data access interface
16
- */
17
- class PGNodeUserDatabase {
18
- poolConfig;
19
- pool;
20
- constructor(poolConfig) {
21
- this.poolConfig = poolConfig;
22
- this.pool = new pg_1.Pool(poolConfig);
23
- }
24
- async init(debugMode = false) {
25
- if (!debugMode) {
26
- await this.pool.query(user_db_schema_1.createUserDBSchema);
27
- await this.pool.query(user_db_schema_1.userDBSchema);
28
- }
29
- }
30
- async destroy() {
31
- await this.pool.end();
32
- }
33
- getName() {
34
- return exports.UserDatabaseName.PGNODE;
35
- }
36
- async transaction(txn, config, ...args) {
37
- const client = await this.pool.connect();
38
- try {
39
- const readOnly = config.readOnly ?? false;
40
- const isolationLevel = config.isolationLevel ?? transaction_1.IsolationLevel.Serializable;
41
- await client.query(`BEGIN ISOLATION LEVEL ${isolationLevel}`);
42
- if (readOnly) {
43
- await client.query(`SET TRANSACTION READ ONLY`);
44
- }
45
- const result = await txn(client, ...args);
46
- await client.query(`COMMIT`);
47
- return result;
48
- }
49
- catch (err) {
50
- await client.query(`ROLLBACK`);
51
- throw err;
52
- }
53
- finally {
54
- client.release();
55
- }
56
- }
57
- async queryFunction(func, ...args) {
58
- const client = await this.pool.connect();
59
- try {
60
- return func(client, ...args);
61
- }
62
- finally {
63
- client.release();
64
- }
65
- }
66
- async query(sql, ...params) {
67
- return this.pool.query(sql, params).then((value) => {
68
- return value.rows;
69
- });
70
- }
71
- async queryWithClient(client, sql, ...params) {
72
- const pgClient = client;
73
- return pgClient.query(sql, params).then((value) => {
74
- return value.rows;
75
- });
76
- }
77
- getPostgresErrorCode(error) {
78
- const dbErr = error;
79
- return dbErr.code ? dbErr.code : null;
80
- }
81
- isRetriableTransactionError(error) {
82
- if (!(error instanceof pg_1.DatabaseError)) {
83
- return false;
84
- }
85
- return this.getPostgresErrorCode(error) === "40001";
86
- }
87
- isKeyConflictError(error) {
88
- if (!(error instanceof pg_1.DatabaseError)) {
89
- return false;
90
- }
91
- const pge = this.getPostgresErrorCode(error);
92
- return pge === "23505";
93
- }
94
- // eslint-disable-next-line @typescript-eslint/require-await
95
- async createSchema() {
96
- throw new Error("createSchema() is not supported in PG user database.");
97
- }
98
- // eslint-disable-next-line @typescript-eslint/require-await
99
- async dropSchema() {
100
- throw new Error("dropSchema() is not supported in PG user database.");
101
- }
102
- }
103
- exports.PGNodeUserDatabase = PGNodeUserDatabase;
104
- const PrismaIsolationLevel = {
105
- ReadUncommitted: "ReadUncommitted",
106
- ReadCommitted: "ReadCommitted",
107
- RepeatableRead: "RepeatableRead",
108
- Serializable: "Serializable",
109
- };
110
- class PrismaUserDatabase {
111
- prisma;
112
- constructor(prisma) {
113
- this.prisma = prisma;
114
- }
115
- async init(debugMode = false) {
116
- if (!debugMode) {
117
- await this.prisma.$queryRawUnsafe(user_db_schema_1.createUserDBSchema);
118
- await this.prisma.$queryRawUnsafe(user_db_schema_1.userDBSchema);
119
- }
120
- }
121
- async destroy() {
122
- await this.prisma.$disconnect();
123
- }
124
- getName() {
125
- return exports.UserDatabaseName.PRISMA;
126
- }
127
- async transaction(transaction, config, ...args) {
128
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
129
- let isolationLevel;
130
- if (config.isolationLevel === transaction_1.IsolationLevel.ReadUncommitted) {
131
- isolationLevel = PrismaIsolationLevel.ReadUncommitted;
132
- }
133
- else if (config.isolationLevel === transaction_1.IsolationLevel.ReadCommitted) {
134
- isolationLevel = PrismaIsolationLevel.ReadCommitted;
135
- }
136
- else if (config.isolationLevel === transaction_1.IsolationLevel.RepeatableRead) {
137
- isolationLevel = PrismaIsolationLevel.RepeatableRead;
138
- }
139
- else {
140
- isolationLevel = PrismaIsolationLevel.Serializable;
141
- }
142
- const result = await this.prisma.$transaction(async (tx) => {
143
- return await transaction(tx, ...args);
144
- }, { isolationLevel: isolationLevel });
145
- return result;
146
- }
147
- async queryFunction(func, ...args) {
148
- return func(this.prisma, ...args);
149
- }
150
- async query(sql, ...params) {
151
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
152
- return this.prisma.$queryRawUnsafe(sql, ...params);
153
- }
154
- async queryWithClient(client, sql, ...params) {
155
- const prismaClient = client;
156
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
157
- return prismaClient.$queryRawUnsafe(sql, ...params);
158
- }
159
- getPostgresErrorCode(error) {
160
- const dbErr = error;
161
- return dbErr.meta ? dbErr.meta.code : null;
162
- }
163
- isRetriableTransactionError(error) {
164
- return this.getPostgresErrorCode(error) === "40001";
165
- }
166
- isKeyConflictError(error) {
167
- const pge = this.getPostgresErrorCode(error);
168
- return pge === "23505";
169
- }
170
- // eslint-disable-next-line @typescript-eslint/require-await
171
- async createSchema() {
172
- throw new Error("createSchema() is not supported in Prisma user database.");
173
- }
174
- // eslint-disable-next-line @typescript-eslint/require-await
175
- async dropSchema() {
176
- throw new Error("dropSchema() is not supported in Prisma user database.");
177
- }
178
- }
179
- exports.PrismaUserDatabase = PrismaUserDatabase;
180
- /**
181
- * TypeORM user data access interface
182
- */
183
- class TypeORMDatabase {
184
- ds;
185
- dataSource;
186
- constructor(ds) {
187
- this.ds = ds;
188
- this.dataSource = ds;
189
- }
190
- async init(debugMode = false) {
191
- if (!this.dataSource.isInitialized) {
192
- await this.dataSource.initialize(); // Need to initialize datasource even in debug mode.
193
- }
194
- if (!debugMode) {
195
- await this.dataSource.query(user_db_schema_1.createUserDBSchema);
196
- await this.dataSource.query(user_db_schema_1.userDBSchema);
197
- }
198
- }
199
- async destroy() {
200
- if (this.dataSource.isInitialized) {
201
- await this.dataSource.destroy();
202
- }
203
- }
204
- getName() {
205
- return exports.UserDatabaseName.TYPEORM;
206
- }
207
- async transaction(txn, config, ...args) {
208
- const isolationLevel = config.isolationLevel ?? transaction_1.IsolationLevel.Serializable;
209
- return this.dataSource.manager.transaction(isolationLevel, async (transactionEntityManager) => {
210
- const result = await txn(transactionEntityManager, ...args);
211
- return result;
212
- });
213
- }
214
- async queryFunction(func, ...args) {
215
- return func(this.dataSource.manager, ...args);
216
- }
217
- async query(sql, ...params) {
218
- return this.dataSource.manager.query(sql, params).then((value) => {
219
- return value;
220
- });
221
- }
222
- async queryWithClient(client, sql, ...params) {
223
- const tClient = client;
224
- return tClient.query(sql, params).then((value) => {
225
- return value;
226
- });
227
- }
228
- getPostgresErrorCode(error) {
229
- const typeormErr = error;
230
- if (typeormErr.driverError) {
231
- const dbErr = typeormErr.driverError;
232
- return dbErr.code ? dbErr.code : null;
233
- }
234
- else {
235
- return null;
236
- }
237
- }
238
- isRetriableTransactionError(error) {
239
- return this.getPostgresErrorCode(error) === "40001";
240
- }
241
- isKeyConflictError(error) {
242
- const pge = this.getPostgresErrorCode(error);
243
- return pge === "23505";
244
- }
245
- async createSchema() {
246
- return this.dataSource.synchronize();
247
- }
248
- async dropSchema() {
249
- return this.dataSource.dropDatabase();
250
- }
251
- }
252
- exports.TypeORMDatabase = TypeORMDatabase;
253
- /**
254
- * Knex user data access interface
255
- */
256
- class KnexUserDatabase {
257
- knex;
258
- constructor(knex) {
259
- this.knex = knex;
260
- }
261
- async init(debugMode = false) {
262
- if (!debugMode) {
263
- await this.knex.raw(user_db_schema_1.createUserDBSchema);
264
- await this.knex.raw(user_db_schema_1.userDBSchema);
265
- }
266
- }
267
- async destroy() {
268
- await this.knex.destroy();
269
- }
270
- getName() {
271
- return exports.UserDatabaseName.KNEX;
272
- }
273
- async transaction(transactionFunction, config, ...args) {
274
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
275
- let isolationLevel;
276
- if (config.isolationLevel === transaction_1.IsolationLevel.ReadUncommitted) {
277
- isolationLevel = "read uncommitted";
278
- }
279
- else if (config.isolationLevel === transaction_1.IsolationLevel.ReadCommitted) {
280
- isolationLevel = "read committed";
281
- }
282
- else if (config.isolationLevel === transaction_1.IsolationLevel.RepeatableRead) {
283
- isolationLevel = "repeatable read";
284
- }
285
- else {
286
- isolationLevel = "serializable";
287
- }
288
- const result = await this.knex.transaction(async (transactionClient) => {
289
- return await transactionFunction(transactionClient, ...args);
290
- }, { isolationLevel: isolationLevel, readOnly: config.readOnly ?? false });
291
- return result;
292
- }
293
- async queryFunction(func, ...args) {
294
- const result = await this.knex.transaction(async (transactionClient) => {
295
- return await func(transactionClient, ...args);
296
- }, { isolationLevel: "read committed", readOnly: true });
297
- return result;
298
- }
299
- async query(sql, ...params) {
300
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
301
- return this.queryWithClient(this.knex, sql, ...params);
302
- }
303
- async queryWithClient(client, sql, ...uparams) {
304
- const knexSql = sql.replace(/\$\d+/g, '?'); // Replace $1, $2... with ?
305
- let params = uparams;
306
- // eslint-disable-next-line @typescript-eslint/no-unsafe-return
307
- params = params.map(i => i === undefined ? null : i); // Set undefined parameters to null.
308
- const rows = await client.raw(knexSql, params);
309
- return rows.rows;
310
- }
311
- getPostgresErrorCode(error) {
312
- const dbErr = error;
313
- return dbErr.code ? dbErr.code : null;
314
- }
315
- isRetriableTransactionError(error) {
316
- return this.getPostgresErrorCode(error) === "40001";
317
- }
318
- isKeyConflictError(error) {
319
- const pge = this.getPostgresErrorCode(error);
320
- return pge === "23505";
321
- }
322
- // eslint-disable-next-line @typescript-eslint/require-await
323
- async createSchema() {
324
- throw new Error("createSchema() is not supported in Knex user database.");
325
- }
326
- // eslint-disable-next-line @typescript-eslint/require-await
327
- async dropSchema() {
328
- throw new Error("dropSchema() is not supported in Knex user database.");
329
- }
330
- }
331
- exports.KnexUserDatabase = KnexUserDatabase;
332
- //# sourceMappingURL=user_database.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"user_database.js","sourceRoot":"","sources":["../../../../src/user_database.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,2BAAoF;AACpF,8DAA6E;AAC7E,+CAAkE;AAmCrD,QAAA,gBAAgB,GAAG;IAC9B,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;CACJ,CAAC;AAGX;;GAEG;AACH,MAAa,kBAAkB;IAGR;IAFZ,IAAI,CAAO;IAEpB,YAAqB,UAAsB;QAAtB,eAAU,GA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D,4CAsFC"}
@@ -1,195 +0,0 @@
1
- import { DBOSExecutor } from "./dbos-executor";
2
- import { Transaction, TransactionContext } from "./transaction";
3
- import { Communicator, CommunicatorContext } from "./communicator";
4
- import { SystemDatabase } from "./system_database";
5
- import { UserDatabaseClient } from "./user_database";
6
- import { HTTPRequest, DBOSContext, DBOSContextImpl } from './context';
7
- export type Workflow<T extends any[], R> = (ctxt: WorkflowContext, ...args: T) => Promise<R>;
8
- export type TailParameters<T extends (arg: any, args: any[]) => any> = T extends (arg: any, ...args: infer P) => any ? P : never;
9
- type TxFunc = (ctxt: TransactionContext<any>, ...args: any[]) => Promise<any>;
10
- type CommFunc = (ctxt: CommunicatorContext, ...args: any[]) => Promise<any>;
11
- export type WFInvokeFuncs<T> = {
12
- [P in keyof T as T[P] extends TxFunc | CommFunc ? P : never]: T[P] extends TxFunc | CommFunc ? (...args: TailParameters<T[P]>) => ReturnType<T[P]> : never;
13
- };
14
- export interface WorkflowParams {
15
- workflowUUID?: string;
16
- parentCtx?: DBOSContextImpl;
17
- }
18
- export interface WorkflowConfig {
19
- }
20
- export interface WorkflowStatus {
21
- readonly status: string;
22
- readonly workflowName: string;
23
- readonly authenticatedUser: string;
24
- readonly assumedRole: string;
25
- readonly authenticatedRoles: string[];
26
- readonly request: HTTPRequest;
27
- }
28
- export interface PgTransactionId {
29
- txid: string;
30
- }
31
- export interface BufferedResult {
32
- output: unknown;
33
- txn_snapshot: string;
34
- }
35
- export declare const StatusString: {
36
- readonly PENDING: "PENDING";
37
- readonly SUCCESS: "SUCCESS";
38
- readonly ERROR: "ERROR";
39
- };
40
- export interface WorkflowContext extends DBOSContext {
41
- invoke<T extends object>(targetClass: T): WFInvokeFuncs<T>;
42
- childWorkflow<T extends any[], R>(wf: Workflow<T, R>, ...args: T): Promise<WorkflowHandle<R>>;
43
- send<T extends NonNullable<any>>(destinationUUID: string, message: T, topic?: string): Promise<void>;
44
- recv<T extends NonNullable<any>>(topic?: string, timeoutSeconds?: number): Promise<T | null>;
45
- setEvent<T extends NonNullable<any>>(key: string, value: T): Promise<void>;
46
- getEvent<T extends NonNullable<any>>(workflowUUID: string, key: string, timeoutSeconds?: number): Promise<T | null>;
47
- retrieveWorkflow<R>(workflowUUID: string): WorkflowHandle<R>;
48
- }
49
- export declare class WorkflowContextImpl extends DBOSContextImpl implements WorkflowContext {
50
- #private;
51
- readonly workflowConfig: WorkflowConfig;
52
- readonly presetUUID: boolean;
53
- functionID: number;
54
- readonly resultBuffer: Map<number, BufferedResult>;
55
- readonly isTempWorkflow: boolean;
56
- tempWfOperationType: string;
57
- tempWfOperationName: string;
58
- constructor(dbosExec: DBOSExecutor, parentCtx: DBOSContextImpl | undefined, workflowUUID: string, workflowConfig: WorkflowConfig, workflowName: string, presetUUID: boolean);
59
- functionIDGetIncrement(): number;
60
- /**
61
- * Retrieve the transaction snapshot information of the current transaction
62
- */
63
- retrieveSnapshot(client: UserDatabaseClient): Promise<string>;
64
- /**
65
- * Check if an operation has already executed in a workflow.
66
- * If it previously executed successfully, return its output.
67
- * If it previously executed and threw an error, throw that error.
68
- * Otherwise, return DBOSNull.
69
- * Also return the transaction snapshot information of this current transaction.
70
- */
71
- checkExecution<R>(client: UserDatabaseClient, funcID: number): Promise<BufferedResult>;
72
- /**
73
- * Write all entries in the workflow result buffer to the database.
74
- * If it encounters a primary key error, this indicates a concurrent execution with the same UUID, so throw an DBOSError.
75
- */
76
- flushResultBuffer(client: UserDatabaseClient): Promise<void>;
77
- /**
78
- * Buffer a placeholder value to guard an operation against concurrent executions with the same UUID.
79
- */
80
- guardOperation(funcID: number, txnSnapshot: string): void;
81
- /**
82
- * Write a guarded operation's output to the database.
83
- */
84
- recordGuardedOutput<R>(client: UserDatabaseClient, funcID: number, output: R): Promise<string>;
85
- /**
86
- * Write an unguarded operation's output to the database.
87
- */
88
- recordUnguardedOutput<R>(client: UserDatabaseClient, funcID: number, output: R): Promise<string>;
89
- /**
90
- * Record an error in a guarded operation to the database.
91
- */
92
- recordGuardedError(client: UserDatabaseClient, funcID: number, err: Error): Promise<void>;
93
- /**
94
- * Record an error in an unguarded operation to the database.
95
- */
96
- recordUnguardedError(client: UserDatabaseClient, funcID: number, err: Error): Promise<string>;
97
- /**
98
- * Invoke another workflow as its child workflow and return a workflow handle.
99
- * The child workflow is guaranteed to be executed exactly once, even if the workflow is retried with the same UUID.
100
- * 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.
101
- * We also pass in its own workflowUUID and function ID so the invoked handle is deterministic.
102
- */
103
- childWorkflow<T extends any[], R>(wf: Workflow<T, R>, ...args: T): Promise<WorkflowHandle<R>>;
104
- /**
105
- * Execute a transactional function.
106
- * The transaction is guaranteed to execute exactly once, even if the workflow is retried with the same UUID.
107
- * If the transaction encounters a Postgres serialization error, retry it.
108
- * If it encounters any other error, throw it.
109
- */
110
- transaction<T extends any[], R>(txn: Transaction<T, R>, ...args: T): Promise<R>;
111
- /**
112
- * Execute a communicator function.
113
- * If it encounters any error, retry according to its configured retry policy until the maximum number of attempts is reached, then throw an DBOSError.
114
- * The communicator may execute many times, but once it is complete, it will not re-execute.
115
- */
116
- external<T extends any[], R>(commFn: Communicator<T, R>, ...args: T): Promise<R>;
117
- /**
118
- * Send a message to a workflow identified by a UUID.
119
- * The message can optionally be tagged with a topic.
120
- */
121
- send<T extends NonNullable<any>>(destinationUUID: string, message: T, topic?: string): Promise<void>;
122
- /**
123
- * Consume and return the oldest unconsumed message sent to your UUID.
124
- * If a topic is specified, retrieve the oldest message tagged with that topic.
125
- * Otherwise, retrieve the oldest message with no topic.
126
- */
127
- recv<T extends NonNullable<any>>(topic?: string, timeoutSeconds?: number): Promise<T | null>;
128
- /**
129
- * Emit a workflow event, represented as a key-value pair.
130
- * Events are immutable once set.
131
- */
132
- setEvent<T extends NonNullable<any>>(key: string, value: T): Promise<void>;
133
- /**
134
- * Generate a proxy object for the provided class that wraps direct calls (i.e. OpClass.someMethod(param))
135
- * to use WorkflowContext.Transaction(OpClass.someMethod, param);
136
- */
137
- invoke<T extends object>(object: T): WFInvokeFuncs<T>;
138
- /**
139
- * Wait for a workflow to emit an event, then return its value.
140
- */
141
- getEvent<T extends NonNullable<any>>(targetUUID: string, key: string, timeoutSeconds?: number): Promise<T | null>;
142
- /**
143
- * Retrieve a handle for a workflow UUID.
144
- */
145
- retrieveWorkflow<R>(targetUUID: string): WorkflowHandle<R>;
146
- }
147
- /**
148
- * Object representing an active or completed workflow execution, identified by the workflow UUID.
149
- * Allows retrieval of information about the workflow.
150
- */
151
- export interface WorkflowHandle<R> {
152
- /**
153
- * Retrieve the workflow's status.
154
- * Statuses are updated asynchronously.
155
- */
156
- getStatus(): Promise<WorkflowStatus | null>;
157
- /**
158
- * Await workflow completion and return its result.
159
- */
160
- getResult(): Promise<R>;
161
- /**
162
- * Return the workflow's UUID.
163
- */
164
- getWorkflowUUID(): string;
165
- }
166
- /**
167
- * The handle returned when invoking a workflow with DBOSExecutor.workflow
168
- */
169
- export declare class InvokedHandle<R> implements WorkflowHandle<R> {
170
- readonly systemDatabase: SystemDatabase;
171
- readonly workflowPromise: Promise<R>;
172
- readonly workflowUUID: string;
173
- readonly workflowName: string;
174
- readonly callerUUID?: string | undefined;
175
- readonly callerFunctionID?: number | undefined;
176
- constructor(systemDatabase: SystemDatabase, workflowPromise: Promise<R>, workflowUUID: string, workflowName: string, callerUUID?: string | undefined, callerFunctionID?: number | undefined);
177
- getWorkflowUUID(): string;
178
- getStatus(): Promise<WorkflowStatus | null>;
179
- getResult(): Promise<R>;
180
- }
181
- /**
182
- * The handle returned when retrieving a workflow with DBOSExecutor.retrieve
183
- */
184
- export declare class RetrievedHandle<R> implements WorkflowHandle<R> {
185
- readonly systemDatabase: SystemDatabase;
186
- readonly workflowUUID: string;
187
- readonly callerUUID?: string | undefined;
188
- readonly callerFunctionID?: number | undefined;
189
- constructor(systemDatabase: SystemDatabase, workflowUUID: string, callerUUID?: string | undefined, callerFunctionID?: number | undefined);
190
- getWorkflowUUID(): string;
191
- getStatus(): Promise<WorkflowStatus | null>;
192
- getResult(): Promise<R>;
193
- }
194
- export {};
195
- //# sourceMappingURL=workflow.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../../../src/workflow.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqC,MAAM,iBAAiB,CAAC;AAElF,OAAO,EAAkB,WAAW,EAAE,kBAAkB,EAA0B,MAAM,eAAe,CAAC;AACxG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAA2B,MAAM,gBAAgB,CAAC;AAI5F,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAGtE,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAG7F,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC;AAGjI,KAAK,MAAM,GAAG,CAAC,IAAI,EAAE,kBAAkB,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAC9E,KAAK,QAAQ,GAAG,CAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAG5E,MAAM,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