@dbos-inc/dbos-sdk 0.8.45-preview → 0.8.46-preview

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) 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/cloudutils.d.ts +7 -0
  20. package/dist/packages/dbos-cloud/cloudutils.d.ts.map +1 -1
  21. package/dist/packages/dbos-cloud/cloudutils.js +44 -3
  22. package/dist/packages/dbos-cloud/cloudutils.js.map +1 -1
  23. package/dist/packages/dbos-cloud/login.d.ts.map +1 -1
  24. package/dist/packages/dbos-cloud/login.js +3 -4
  25. package/dist/packages/dbos-cloud/login.js.map +1 -1
  26. package/dist/packages/dbos-cloud/register.d.ts.map +1 -1
  27. package/dist/packages/dbos-cloud/register.js +1 -2
  28. package/dist/packages/dbos-cloud/register.js.map +1 -1
  29. package/dist/packages/dbos-cloud/userdb.d.ts.map +1 -1
  30. package/dist/packages/dbos-cloud/userdb.js +3 -4
  31. package/dist/packages/dbos-cloud/userdb.js.map +1 -1
  32. package/dist/src/context.d.ts +1 -0
  33. package/dist/src/context.d.ts.map +1 -1
  34. package/dist/src/httpServer/server.d.ts +2 -1
  35. package/dist/src/httpServer/server.d.ts.map +1 -1
  36. package/dist/src/testing/testing_runtime.d.ts +2 -1
  37. package/dist/src/testing/testing_runtime.d.ts.map +1 -1
  38. package/dist/src/utils.d.ts +0 -1
  39. package/dist/src/utils.d.ts.map +1 -1
  40. package/dist/src/utils.js +3 -12
  41. package/dist/src/utils.js.map +1 -1
  42. package/dist/tsconfig.build.tsbuildinfo +1 -1
  43. package/package.json +1 -1
  44. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.d.ts.map +1 -1
  45. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.js +1 -2
  46. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/delete-app.js.map +1 -1
  47. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.d.ts.map +1 -1
  48. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.js +5 -7
  49. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/deploy-app-code.js.map +1 -1
  50. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.d.ts.map +1 -1
  51. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.js +1 -2
  52. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/get-app-logs.js.map +1 -1
  53. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.d.ts.map +1 -1
  54. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.js +1 -2
  55. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/list-apps.js.map +1 -1
  56. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.d.ts.map +1 -1
  57. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.js +1 -2
  58. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/register-app.js.map +1 -1
  59. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.d.ts.map +1 -1
  60. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.js +1 -2
  61. package/packages/dbos-cloud/dist/packages/dbos-cloud/applications/update-app.js.map +1 -1
  62. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.d.ts +7 -0
  63. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.d.ts.map +1 -1
  64. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.js +44 -3
  65. package/packages/dbos-cloud/dist/packages/dbos-cloud/cloudutils.js.map +1 -1
  66. package/packages/dbos-cloud/dist/packages/dbos-cloud/login.d.ts.map +1 -1
  67. package/packages/dbos-cloud/dist/packages/dbos-cloud/login.js +3 -4
  68. package/packages/dbos-cloud/dist/packages/dbos-cloud/login.js.map +1 -1
  69. package/packages/dbos-cloud/dist/packages/dbos-cloud/register.d.ts.map +1 -1
  70. package/packages/dbos-cloud/dist/packages/dbos-cloud/register.js +1 -2
  71. package/packages/dbos-cloud/dist/packages/dbos-cloud/register.js.map +1 -1
  72. package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.d.ts.map +1 -1
  73. package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.js +3 -4
  74. package/packages/dbos-cloud/dist/packages/dbos-cloud/userdb.js.map +1 -1
  75. package/packages/dbos-cloud/dist/src/utils.d.ts +0 -1
  76. package/packages/dbos-cloud/dist/src/utils.d.ts.map +1 -1
  77. package/packages/dbos-cloud/dist/src/utils.js +3 -12
  78. package/packages/dbos-cloud/dist/src/utils.js.map +1 -1
  79. package/packages/dbos-cloud/package.json +1 -1
  80. package/packages/dbos-openapi/package.json +1 -1
  81. package/packages/dbos-cloud/dist/schemas/system_db_schema.d.ts +0 -34
  82. package/packages/dbos-cloud/dist/schemas/system_db_schema.d.ts.map +0 -1
  83. package/packages/dbos-cloud/dist/schemas/system_db_schema.js +0 -77
  84. package/packages/dbos-cloud/dist/schemas/system_db_schema.js.map +0 -1
  85. package/packages/dbos-cloud/dist/schemas/user_db_schema.d.ts +0 -11
  86. package/packages/dbos-cloud/dist/schemas/user_db_schema.d.ts.map +0 -1
  87. package/packages/dbos-cloud/dist/schemas/user_db_schema.js +0 -16
  88. package/packages/dbos-cloud/dist/schemas/user_db_schema.js.map +0 -1
  89. package/packages/dbos-cloud/dist/src/communicator.d.ts +0 -25
  90. package/packages/dbos-cloud/dist/src/communicator.d.ts.map +0 -1
  91. package/packages/dbos-cloud/dist/src/communicator.js +0 -26
  92. package/packages/dbos-cloud/dist/src/communicator.js.map +0 -1
  93. package/packages/dbos-cloud/dist/src/context.d.ts +0 -64
  94. package/packages/dbos-cloud/dist/src/context.d.ts.map +0 -1
  95. package/packages/dbos-cloud/dist/src/context.js +0 -96
  96. package/packages/dbos-cloud/dist/src/context.js.map +0 -1
  97. package/packages/dbos-cloud/dist/src/data_validation.d.ts +0 -3
  98. package/packages/dbos-cloud/dist/src/data_validation.d.ts.map +0 -1
  99. package/packages/dbos-cloud/dist/src/data_validation.js +0 -168
  100. package/packages/dbos-cloud/dist/src/data_validation.js.map +0 -1
  101. package/packages/dbos-cloud/dist/src/dbos-executor.d.ts +0 -102
  102. package/packages/dbos-cloud/dist/src/dbos-executor.d.ts.map +0 -1
  103. package/packages/dbos-cloud/dist/src/dbos-executor.js +0 -631
  104. package/packages/dbos-cloud/dist/src/dbos-executor.js.map +0 -1
  105. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.d.ts +0 -3
  106. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.d.ts.map +0 -1
  107. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.js +0 -13
  108. package/packages/dbos-cloud/dist/src/dbos-runtime/applicationVersion.js.map +0 -1
  109. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.d.ts +0 -8
  110. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.d.ts.map +0 -1
  111. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.js +0 -61
  112. package/packages/dbos-cloud/dist/src/dbos-runtime/cli.js.map +0 -1
  113. package/packages/dbos-cloud/dist/src/dbos-runtime/config.d.ts +0 -29
  114. package/packages/dbos-cloud/dist/src/dbos-runtime/config.d.ts.map +0 -1
  115. package/packages/dbos-cloud/dist/src/dbos-runtime/config.js +0 -111
  116. package/packages/dbos-cloud/dist/src/dbos-runtime/config.js.map +0 -1
  117. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.d.ts +0 -4
  118. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.d.ts.map +0 -1
  119. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.js +0 -21
  120. package/packages/dbos-cloud/dist/src/dbos-runtime/debug.js.map +0 -1
  121. package/packages/dbos-cloud/dist/src/dbos-runtime/init.d.ts +0 -7
  122. package/packages/dbos-cloud/dist/src/dbos-runtime/init.d.ts.map +0 -1
  123. package/packages/dbos-cloud/dist/src/dbos-runtime/init.js +0 -51
  124. package/packages/dbos-cloud/dist/src/dbos-runtime/init.js.map +0 -1
  125. package/packages/dbos-cloud/dist/src/dbos-runtime/migrate.d.ts +0 -3
  126. package/packages/dbos-cloud/dist/src/dbos-runtime/migrate.d.ts.map +0 -1
  127. package/packages/dbos-cloud/dist/src/dbos-runtime/migrate.js +0 -175
  128. package/packages/dbos-cloud/dist/src/dbos-runtime/migrate.js.map +0 -1
  129. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.d.ts +0 -28
  130. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.d.ts.map +0 -1
  131. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.js +0 -95
  132. package/packages/dbos-cloud/dist/src/dbos-runtime/runtime.js.map +0 -1
  133. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.d.ts +0 -38
  134. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.d.ts.map +0 -1
  135. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.js +0 -211
  136. package/packages/dbos-cloud/dist/src/debugger/debug_workflow.js.map +0 -1
  137. package/packages/dbos-cloud/dist/src/decorators.d.ts +0 -118
  138. package/packages/dbos-cloud/dist/src/decorators.d.ts.map +0 -1
  139. package/packages/dbos-cloud/dist/src/decorators.js +0 -467
  140. package/packages/dbos-cloud/dist/src/decorators.js.map +0 -1
  141. package/packages/dbos-cloud/dist/src/error.d.ts +0 -47
  142. package/packages/dbos-cloud/dist/src/error.d.ts.map +0 -1
  143. package/packages/dbos-cloud/dist/src/error.js +0 -171
  144. package/packages/dbos-cloud/dist/src/error.js.map +0 -1
  145. package/packages/dbos-cloud/dist/src/httpServer/handler.d.ts +0 -54
  146. package/packages/dbos-cloud/dist/src/httpServer/handler.d.ts.map +0 -1
  147. package/packages/dbos-cloud/dist/src/httpServer/handler.js +0 -175
  148. package/packages/dbos-cloud/dist/src/httpServer/handler.js.map +0 -1
  149. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.d.ts +0 -11
  150. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.d.ts.map +0 -1
  151. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.js +0 -19
  152. package/packages/dbos-cloud/dist/src/httpServer/handlerTypes.js.map +0 -1
  153. package/packages/dbos-cloud/dist/src/httpServer/middleware.d.ts +0 -56
  154. package/packages/dbos-cloud/dist/src/httpServer/middleware.d.ts.map +0 -1
  155. package/packages/dbos-cloud/dist/src/httpServer/middleware.js +0 -57
  156. package/packages/dbos-cloud/dist/src/httpServer/middleware.js.map +0 -1
  157. package/packages/dbos-cloud/dist/src/httpServer/server.d.ts +0 -45
  158. package/packages/dbos-cloud/dist/src/httpServer/server.d.ts.map +0 -1
  159. package/packages/dbos-cloud/dist/src/httpServer/server.js +0 -253
  160. package/packages/dbos-cloud/dist/src/httpServer/server.js.map +0 -1
  161. package/packages/dbos-cloud/dist/src/system_database.d.ts +0 -91
  162. package/packages/dbos-cloud/dist/src/system_database.d.ts.map +0 -1
  163. package/packages/dbos-cloud/dist/src/system_database.js +0 -462
  164. package/packages/dbos-cloud/dist/src/system_database.js.map +0 -1
  165. package/packages/dbos-cloud/dist/src/telemetry/collector.d.ts +0 -16
  166. package/packages/dbos-cloud/dist/src/telemetry/collector.d.ts.map +0 -1
  167. package/packages/dbos-cloud/dist/src/telemetry/collector.js +0 -65
  168. package/packages/dbos-cloud/dist/src/telemetry/collector.js.map +0 -1
  169. package/packages/dbos-cloud/dist/src/telemetry/exporters.d.ts +0 -15
  170. package/packages/dbos-cloud/dist/src/telemetry/exporters.d.ts.map +0 -1
  171. package/packages/dbos-cloud/dist/src/telemetry/exporters.js +0 -59
  172. package/packages/dbos-cloud/dist/src/telemetry/exporters.js.map +0 -1
  173. package/packages/dbos-cloud/dist/src/telemetry/index.d.ts +0 -11
  174. package/packages/dbos-cloud/dist/src/telemetry/index.d.ts.map +0 -1
  175. package/packages/dbos-cloud/dist/src/telemetry/index.js +0 -19
  176. package/packages/dbos-cloud/dist/src/telemetry/index.js.map +0 -1
  177. package/packages/dbos-cloud/dist/src/telemetry/logs.d.ts +0 -47
  178. package/packages/dbos-cloud/dist/src/telemetry/logs.d.ts.map +0 -1
  179. package/packages/dbos-cloud/dist/src/telemetry/logs.js +0 -195
  180. package/packages/dbos-cloud/dist/src/telemetry/logs.js.map +0 -1
  181. package/packages/dbos-cloud/dist/src/telemetry/traces.d.ts +0 -14
  182. package/packages/dbos-cloud/dist/src/telemetry/traces.d.ts.map +0 -1
  183. package/packages/dbos-cloud/dist/src/telemetry/traces.js +0 -52
  184. package/packages/dbos-cloud/dist/src/telemetry/traces.js.map +0 -1
  185. package/packages/dbos-cloud/dist/src/transaction.d.ts +0 -29
  186. package/packages/dbos-cloud/dist/src/transaction.d.ts.map +0 -1
  187. package/packages/dbos-cloud/dist/src/transaction.js +0 -27
  188. package/packages/dbos-cloud/dist/src/transaction.js.map +0 -1
  189. package/packages/dbos-cloud/dist/src/user_database.d.ts +0 -132
  190. package/packages/dbos-cloud/dist/src/user_database.d.ts.map +0 -1
  191. package/packages/dbos-cloud/dist/src/user_database.js +0 -332
  192. package/packages/dbos-cloud/dist/src/user_database.js.map +0 -1
  193. package/packages/dbos-cloud/dist/src/workflow.d.ts +0 -195
  194. package/packages/dbos-cloud/dist/src/workflow.d.ts.map +0 -1
  195. package/packages/dbos-cloud/dist/src/workflow.js +0 -498
  196. package/packages/dbos-cloud/dist/src/workflow.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"user_database.d.ts","sourceRoot":"","sources":["../../../../src/user_database.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAoC,MAAM,IAAI,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,OAAO,IAAI,gBAAgB,CAAC;IAG5B,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE,EAAE,mBAAmB,EAAE,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAE3I,aAAa,CAAC,CAAC,SAAS,kBAAkB,EAAE,CAAC,EAAE,CAAC,SAAS,OAAO,EAAE,EAAE,aAAa,EAAE,iBAAiB,CAAC,CAAC,EAAE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YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGlC"}
@@ -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,GAAV,UAAU,CAAY;QACzC,IAAI,CAAC,IAAI,GAAG,IAAI,SAAI,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,YAAqB,KAAK;QACnC,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,mCAAkB,CAAC,CAAC;YAC1C,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,6BAAY,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IACxB,CAAC;IAED,OAAO;QACL,OAAO,wBAAgB,CAAC,MAAM,CAAC;IACjC,CAAC;IAED,KAAK,CAAC,WAAW,CAAyB,GAAkC,EAAE,MAAyB,EAAE,GAAG,IAAO;QACjH,MAAM,MAAM,GAAe,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QACrD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,IAAI,KAAK,CAAC;YAC1C,MAAM,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K,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACxC,CAAC;IAED,2BAA2B,CAAC,KAAc;QACxC,OAAO,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC;IACtD,CAAC;IAED,kBAAkB,CAAC,KAAc;QAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QAC7C,OAAO,GAAG,KAAK,OAAO,CAAC;IACzB,CAAC;IAED,4DAA4D;IAC5D,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAC5E,CAAC;IACD,4DAA4D;IAC5D,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;CACF;AAtFD,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,CA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