@dbos-inc/dbos-sdk 0.7.18-preview

Sign up to get free protection for your applications and to get access to all the features.
Files changed (203) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -0
  3. package/dbos-config.schema.json +121 -0
  4. package/dbos-test-config.yaml +16 -0
  5. package/dist/schemas/system_db_schema.d.ts +34 -0
  6. package/dist/schemas/system_db_schema.d.ts.map +1 -0
  7. package/dist/schemas/system_db_schema.js +75 -0
  8. package/dist/schemas/system_db_schema.js.map +1 -0
  9. package/dist/schemas/user_db_schema.d.ts +11 -0
  10. package/dist/schemas/user_db_schema.d.ts.map +1 -0
  11. package/dist/schemas/user_db_schema.js +16 -0
  12. package/dist/schemas/user_db_schema.js.map +1 -0
  13. package/dist/src/cloud-cli/applications/configure.d.ts +2 -0
  14. package/dist/src/cloud-cli/applications/configure.d.ts.map +1 -0
  15. package/dist/src/cloud-cli/applications/configure.js +57 -0
  16. package/dist/src/cloud-cli/applications/configure.js.map +1 -0
  17. package/dist/src/cloud-cli/applications/delete-app.d.ts +2 -0
  18. package/dist/src/cloud-cli/applications/delete-app.d.ts.map +1 -0
  19. package/dist/src/cloud-cli/applications/delete-app.js +36 -0
  20. package/dist/src/cloud-cli/applications/delete-app.js.map +1 -0
  21. package/dist/src/cloud-cli/applications/deploy-app-code.d.ts +2 -0
  22. package/dist/src/cloud-cli/applications/deploy-app-code.d.ts.map +1 -0
  23. package/dist/src/cloud-cli/applications/deploy-app-code.js +64 -0
  24. package/dist/src/cloud-cli/applications/deploy-app-code.js.map +1 -0
  25. package/dist/src/cloud-cli/applications/get-app-logs.d.ts +2 -0
  26. package/dist/src/cloud-cli/applications/get-app-logs.d.ts.map +1 -0
  27. package/dist/src/cloud-cli/applications/get-app-logs.js +37 -0
  28. package/dist/src/cloud-cli/applications/get-app-logs.js.map +1 -0
  29. package/dist/src/cloud-cli/applications/index.d.ts +8 -0
  30. package/dist/src/cloud-cli/applications/index.d.ts.map +1 -0
  31. package/dist/src/cloud-cli/applications/index.js +18 -0
  32. package/dist/src/cloud-cli/applications/index.js.map +1 -0
  33. package/dist/src/cloud-cli/applications/list-apps.d.ts +2 -0
  34. package/dist/src/cloud-cli/applications/list-apps.d.ts.map +1 -0
  35. package/dist/src/cloud-cli/applications/list-apps.js +45 -0
  36. package/dist/src/cloud-cli/applications/list-apps.js.map +1 -0
  37. package/dist/src/cloud-cli/applications/register-app.d.ts +2 -0
  38. package/dist/src/cloud-cli/applications/register-app.d.ts.map +1 -0
  39. package/dist/src/cloud-cli/applications/register-app.js +41 -0
  40. package/dist/src/cloud-cli/applications/register-app.js.map +1 -0
  41. package/dist/src/cloud-cli/applications/types.d.ts +7 -0
  42. package/dist/src/cloud-cli/applications/types.d.ts.map +1 -0
  43. package/dist/src/cloud-cli/applications/types.js +3 -0
  44. package/dist/src/cloud-cli/applications/types.js.map +1 -0
  45. package/dist/src/cloud-cli/applications/update-app.d.ts +2 -0
  46. package/dist/src/cloud-cli/applications/update-app.d.ts.map +1 -0
  47. package/dist/src/cloud-cli/applications/update-app.js +42 -0
  48. package/dist/src/cloud-cli/applications/update-app.js.map +1 -0
  49. package/dist/src/cloud-cli/cli.d.ts +3 -0
  50. package/dist/src/cloud-cli/cli.d.ts.map +1 -0
  51. package/dist/src/cloud-cli/cli.js +148 -0
  52. package/dist/src/cloud-cli/cli.js.map +1 -0
  53. package/dist/src/cloud-cli/login.d.ts +7 -0
  54. package/dist/src/cloud-cli/login.d.ts.map +1 -0
  55. package/dist/src/cloud-cli/login.js +40 -0
  56. package/dist/src/cloud-cli/login.js.map +1 -0
  57. package/dist/src/cloud-cli/register.d.ts +2 -0
  58. package/dist/src/cloud-cli/register.d.ts.map +1 -0
  59. package/dist/src/cloud-cli/register.js +35 -0
  60. package/dist/src/cloud-cli/register.js.map +1 -0
  61. package/dist/src/cloud-cli/userdb.d.ts +4 -0
  62. package/dist/src/cloud-cli/userdb.d.ts.map +1 -0
  63. package/dist/src/cloud-cli/userdb.js +149 -0
  64. package/dist/src/cloud-cli/userdb.js.map +1 -0
  65. package/dist/src/cloud-cli/utils.d.ts +3 -0
  66. package/dist/src/cloud-cli/utils.d.ts.map +1 -0
  67. package/dist/src/cloud-cli/utils.js +17 -0
  68. package/dist/src/cloud-cli/utils.js.map +1 -0
  69. package/dist/src/communicator.d.ts +24 -0
  70. package/dist/src/communicator.d.ts.map +1 -0
  71. package/dist/src/communicator.js +26 -0
  72. package/dist/src/communicator.js.map +1 -0
  73. package/dist/src/context.d.ts +60 -0
  74. package/dist/src/context.d.ts.map +1 -0
  75. package/dist/src/context.js +94 -0
  76. package/dist/src/context.js.map +1 -0
  77. package/dist/src/data_validation.d.ts +3 -0
  78. package/dist/src/data_validation.d.ts.map +1 -0
  79. package/dist/src/data_validation.js +168 -0
  80. package/dist/src/data_validation.js.map +1 -0
  81. package/dist/src/dbos-executor.d.ts +79 -0
  82. package/dist/src/dbos-executor.d.ts.map +1 -0
  83. package/dist/src/dbos-executor.js +408 -0
  84. package/dist/src/dbos-executor.js.map +1 -0
  85. package/dist/src/dbos-runtime/TypeParser.d.ts +33 -0
  86. package/dist/src/dbos-runtime/TypeParser.d.ts.map +1 -0
  87. package/dist/src/dbos-runtime/TypeParser.js +104 -0
  88. package/dist/src/dbos-runtime/TypeParser.js.map +1 -0
  89. package/dist/src/dbos-runtime/applicationVersion.d.ts +3 -0
  90. package/dist/src/dbos-runtime/applicationVersion.d.ts.map +1 -0
  91. package/dist/src/dbos-runtime/applicationVersion.js +13 -0
  92. package/dist/src/dbos-runtime/applicationVersion.js.map +1 -0
  93. package/dist/src/dbos-runtime/cli.d.ts +8 -0
  94. package/dist/src/dbos-runtime/cli.d.ts.map +1 -0
  95. package/dist/src/dbos-runtime/cli.js +52 -0
  96. package/dist/src/dbos-runtime/cli.js.map +1 -0
  97. package/dist/src/dbos-runtime/config.d.ts +28 -0
  98. package/dist/src/dbos-runtime/config.d.ts.map +1 -0
  99. package/dist/src/dbos-runtime/config.js +111 -0
  100. package/dist/src/dbos-runtime/config.js.map +1 -0
  101. package/dist/src/dbos-runtime/init.d.ts +7 -0
  102. package/dist/src/dbos-runtime/init.d.ts.map +1 -0
  103. package/dist/src/dbos-runtime/init.js +51 -0
  104. package/dist/src/dbos-runtime/init.js.map +1 -0
  105. package/dist/src/dbos-runtime/openApi.d.ts +35 -0
  106. package/dist/src/dbos-runtime/openApi.d.ts.map +1 -0
  107. package/dist/src/dbos-runtime/openApi.js +595 -0
  108. package/dist/src/dbos-runtime/openApi.js.map +1 -0
  109. package/dist/src/dbos-runtime/runtime.d.ts +28 -0
  110. package/dist/src/dbos-runtime/runtime.d.ts.map +1 -0
  111. package/dist/src/dbos-runtime/runtime.js +96 -0
  112. package/dist/src/dbos-runtime/runtime.js.map +1 -0
  113. package/dist/src/dbos-runtime/tsDiagUtil.d.ts +16 -0
  114. package/dist/src/dbos-runtime/tsDiagUtil.d.ts.map +1 -0
  115. package/dist/src/dbos-runtime/tsDiagUtil.js +72 -0
  116. package/dist/src/dbos-runtime/tsDiagUtil.js.map +1 -0
  117. package/dist/src/decorators.d.ts +118 -0
  118. package/dist/src/decorators.d.ts.map +1 -0
  119. package/dist/src/decorators.js +467 -0
  120. package/dist/src/decorators.js.map +1 -0
  121. package/dist/src/error.d.ts +44 -0
  122. package/dist/src/error.d.ts.map +1 -0
  123. package/dist/src/error.js +164 -0
  124. package/dist/src/error.js.map +1 -0
  125. package/dist/src/httpServer/handler.d.ts +62 -0
  126. package/dist/src/httpServer/handler.d.ts.map +1 -0
  127. package/dist/src/httpServer/handler.js +168 -0
  128. package/dist/src/httpServer/handler.js.map +1 -0
  129. package/dist/src/httpServer/middleware.d.ts +56 -0
  130. package/dist/src/httpServer/middleware.d.ts.map +1 -0
  131. package/dist/src/httpServer/middleware.js +57 -0
  132. package/dist/src/httpServer/middleware.js.map +1 -0
  133. package/dist/src/httpServer/server.d.ts +40 -0
  134. package/dist/src/httpServer/server.d.ts.map +1 -0
  135. package/dist/src/httpServer/server.js +231 -0
  136. package/dist/src/httpServer/server.js.map +1 -0
  137. package/dist/src/index.d.ts +12 -0
  138. package/dist/src/index.d.ts.map +1 -0
  139. package/dist/src/index.js +75 -0
  140. package/dist/src/index.js.map +1 -0
  141. package/dist/src/provenance/provenance_daemon.d.ts +34 -0
  142. package/dist/src/provenance/provenance_daemon.d.ts.map +1 -0
  143. package/dist/src/provenance/provenance_daemon.js +86 -0
  144. package/dist/src/provenance/provenance_daemon.js.map +1 -0
  145. package/dist/src/system_database.d.ts +69 -0
  146. package/dist/src/system_database.d.ts.map +1 -0
  147. package/dist/src/system_database.js +384 -0
  148. package/dist/src/system_database.js.map +1 -0
  149. package/dist/src/telemetry/collector.d.ts +17 -0
  150. package/dist/src/telemetry/collector.d.ts.map +1 -0
  151. package/dist/src/telemetry/collector.js +77 -0
  152. package/dist/src/telemetry/collector.js.map +1 -0
  153. package/dist/src/telemetry/exporters.d.ts +29 -0
  154. package/dist/src/telemetry/exporters.d.ts.map +1 -0
  155. package/dist/src/telemetry/exporters.js +186 -0
  156. package/dist/src/telemetry/exporters.js.map +1 -0
  157. package/dist/src/telemetry/index.d.ts +7 -0
  158. package/dist/src/telemetry/index.d.ts.map +1 -0
  159. package/dist/src/telemetry/index.js +3 -0
  160. package/dist/src/telemetry/index.js.map +1 -0
  161. package/dist/src/telemetry/logs.d.ts +25 -0
  162. package/dist/src/telemetry/logs.d.ts.map +1 -0
  163. package/dist/src/telemetry/logs.js +91 -0
  164. package/dist/src/telemetry/logs.js.map +1 -0
  165. package/dist/src/telemetry/signals.d.ts +30 -0
  166. package/dist/src/telemetry/signals.d.ts.map +1 -0
  167. package/dist/src/telemetry/signals.js +11 -0
  168. package/dist/src/telemetry/signals.js.map +1 -0
  169. package/dist/src/telemetry/traces.d.ts +17 -0
  170. package/dist/src/telemetry/traces.d.ts.map +1 -0
  171. package/dist/src/telemetry/traces.js +76 -0
  172. package/dist/src/telemetry/traces.js.map +1 -0
  173. package/dist/src/testing/testing_runtime.d.ts +76 -0
  174. package/dist/src/testing/testing_runtime.d.ts.map +1 -0
  175. package/dist/src/testing/testing_runtime.js +147 -0
  176. package/dist/src/testing/testing_runtime.js.map +1 -0
  177. package/dist/src/transaction.d.ts +28 -0
  178. package/dist/src/transaction.d.ts.map +1 -0
  179. package/dist/src/transaction.js +27 -0
  180. package/dist/src/transaction.js.map +1 -0
  181. package/dist/src/user_database.d.ts +132 -0
  182. package/dist/src/user_database.d.ts.map +1 -0
  183. package/dist/src/user_database.js +324 -0
  184. package/dist/src/user_database.js.map +1 -0
  185. package/dist/src/utils.d.ts +6 -0
  186. package/dist/src/utils.d.ts.map +1 -0
  187. package/dist/src/utils.js +35 -0
  188. package/dist/src/utils.js.map +1 -0
  189. package/dist/src/workflow.d.ts +179 -0
  190. package/dist/src/workflow.d.ts.map +1 -0
  191. package/dist/src/workflow.js +446 -0
  192. package/dist/src/workflow.js.map +1 -0
  193. package/examples/hello/README.md +41 -0
  194. package/examples/hello/dbos-config.yaml +15 -0
  195. package/examples/hello/jest.config.js +8 -0
  196. package/examples/hello/knexfile.ts +23 -0
  197. package/examples/hello/migrations/create_dbos_hello_tables.ts +12 -0
  198. package/examples/hello/package.json +21 -0
  199. package/examples/hello/src/operations.test.ts +38 -0
  200. package/examples/hello/src/operations.ts +21 -0
  201. package/examples/hello/start_postgres_docker.sh +23 -0
  202. package/examples/hello/tsconfig.json +24 -0
  203. package/package.json +78 -0
@@ -0,0 +1,3 @@
1
+ import { DBOSCloudCredentials } from "./login";
2
+ export declare function getCloudCredentials(): DBOSCloudCredentials;
3
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/cloud-cli/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAe,MAAM,SAAS,CAAC;AAG5D,wBAAgB,mBAAmB,IAAI,oBAAoB,CAM1D"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getCloudCredentials = void 0;
7
+ const login_1 = require("./login");
8
+ const fs_1 = __importDefault(require("fs"));
9
+ function getCloudCredentials() {
10
+ const userCredentials = JSON.parse(fs_1.default.readFileSync(`./${login_1.dbosEnvPath}/credentials`).toString("utf-8"));
11
+ return {
12
+ userName: userCredentials.userName,
13
+ token: userCredentials.token.replace(/\r|\n/g, ""), // Trim the trailing /r /n.
14
+ };
15
+ }
16
+ exports.getCloudCredentials = getCloudCredentials;
17
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/cloud-cli/utils.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA4D;AAC5D,4CAAoB;AAEpB,SAAgB,mBAAmB;IACjC,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,KAAK,mBAAW,cAAc,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAyB,CAAC;IAC9H,OAAO;QACL,QAAQ,EAAE,eAAe,CAAC,QAAQ;QAClC,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,2BAA2B;KAChF,CAAC;AACJ,CAAC;AAND,kDAMC"}
@@ -0,0 +1,24 @@
1
+ import { Span } from "@opentelemetry/sdk-trace-base";
2
+ import { WinstonLogger as Logger } from "./telemetry/logs";
3
+ import { WorkflowContextImpl } from "./workflow";
4
+ import { DBOSContext, DBOSContextImpl } from "./context";
5
+ export type Communicator<T extends any[], R> = (ctxt: CommunicatorContext, ...args: T) => Promise<R>;
6
+ export interface CommunicatorConfig {
7
+ retriesAllowed?: boolean;
8
+ intervalSeconds?: number;
9
+ maxAttempts?: number;
10
+ backoffRate?: number;
11
+ }
12
+ export interface CommunicatorContext extends DBOSContext {
13
+ readonly retriesAllowed: boolean;
14
+ readonly maxAttempts: number;
15
+ }
16
+ export declare class CommunicatorContextImpl extends DBOSContextImpl implements CommunicatorContext {
17
+ readonly functionID: number;
18
+ readonly retriesAllowed: boolean;
19
+ readonly intervalSeconds: number;
20
+ readonly maxAttempts: number;
21
+ readonly backoffRate: number;
22
+ constructor(workflowContext: WorkflowContextImpl, functionID: number, span: Span, logger: Logger, params: CommunicatorConfig, commName: string);
23
+ }
24
+ //# sourceMappingURL=communicator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"communicator.d.ts","sourceRoot":"","sources":["../../src/communicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAGzD,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,EAAE,GAAG,IAAI,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AAErG,MAAM,WAAW,kBAAkB;IACjC,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAoB,SAAQ,WAAW;IAEtD,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,qBAAa,uBAAwB,SAAQ,eAAgB,YAAW,mBAAmB;IAEzF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBAGjB,eAAe,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM;CAY/I"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommunicatorContextImpl = void 0;
4
+ const context_1 = require("./context");
5
+ class CommunicatorContextImpl extends context_1.DBOSContextImpl {
6
+ functionID;
7
+ retriesAllowed;
8
+ intervalSeconds;
9
+ maxAttempts;
10
+ backoffRate;
11
+ // TODO: Validate the parameters.
12
+ constructor(workflowContext, functionID, span, logger, params, commName) {
13
+ super(commName, span, logger, workflowContext);
14
+ this.functionID = functionID;
15
+ this.retriesAllowed = params.retriesAllowed ?? true;
16
+ this.intervalSeconds = params.intervalSeconds ?? 1;
17
+ this.maxAttempts = params.maxAttempts ?? 3;
18
+ this.backoffRate = params.backoffRate ?? 2;
19
+ if (workflowContext.applicationConfig) {
20
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
21
+ this.applicationConfig = workflowContext.applicationConfig;
22
+ }
23
+ }
24
+ }
25
+ exports.CommunicatorContextImpl = CommunicatorContextImpl;
26
+ //# sourceMappingURL=communicator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"communicator.js","sourceRoot":"","sources":["../../src/communicator.ts"],"names":[],"mappings":";;;AAGA,uCAAyD;AAkBzD,MAAa,uBAAwB,SAAQ,yBAAe;IAEjD,UAAU,CAAS;IACnB,cAAc,CAAU;IACxB,eAAe,CAAS;IACxB,WAAW,CAAS;IACpB,WAAW,CAAS;IAE7B,iCAAiC;IACjC,YAAY,eAAoC,EAAE,UAAkB,EAAE,IAAU,EAAE,MAAc,EAAE,MAA0B,EAAE,QAAgB;QAC5I,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC;QACpD,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;QAC3C,IAAI,eAAe,CAAC,iBAAiB,EAAE;YACrC,mEAAmE;YAClE,IAAI,CAAC,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC;SAC7D;IACH,CAAC;CACF;AArBD,0DAqBC"}
@@ -0,0 +1,60 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { Span } from "@opentelemetry/sdk-trace-base";
4
+ import { WinstonLogger as Logger, Logger as DBOSLogger } from "./telemetry/logs";
5
+ import { IncomingHttpHeaders } from "http";
6
+ import { ParsedUrlQuery } from "querystring";
7
+ import { DBOSExecutor } from "./dbos-executor";
8
+ export interface HTTPRequest {
9
+ readonly headers?: IncomingHttpHeaders;
10
+ readonly rawHeaders?: string[];
11
+ readonly params?: unknown;
12
+ readonly body?: unknown;
13
+ readonly rawBody?: string;
14
+ readonly query?: ParsedUrlQuery;
15
+ readonly querystring?: string;
16
+ readonly url?: string;
17
+ readonly ip?: string;
18
+ }
19
+ export interface DBOSContext {
20
+ readonly request: HTTPRequest;
21
+ readonly workflowUUID: string;
22
+ readonly authenticatedUser: string;
23
+ readonly authenticatedRoles: string[];
24
+ readonly assumedRole: string;
25
+ readonly logger: DBOSLogger;
26
+ readonly span: Span;
27
+ getConfig<T>(key: string): T | undefined;
28
+ getConfig<T>(key: string, defaultValue: T): T;
29
+ }
30
+ export declare class DBOSContextImpl implements DBOSContext {
31
+ readonly operationName: string;
32
+ readonly span: Span;
33
+ request: HTTPRequest;
34
+ authenticatedUser: string;
35
+ authenticatedRoles: string[];
36
+ assumedRole: string;
37
+ workflowUUID: string;
38
+ readonly logger: DBOSLogger;
39
+ constructor(operationName: string, span: Span, logger: Logger, parentCtx?: DBOSContextImpl);
40
+ /*** Application configuration ***/
41
+ applicationConfig?: any;
42
+ getConfig<T>(key: string): T | undefined;
43
+ getConfig<T>(key: string, defaultValue: T): T;
44
+ }
45
+ /**
46
+ * TODO : move logger and application, getConfig to a BaseContext which is at the root of all contexts
47
+ */
48
+ export declare class InitContext {
49
+ readonly wfe: DBOSExecutor;
50
+ readonly logger: Logger;
51
+ private userDatabase;
52
+ private application;
53
+ constructor(wfe: DBOSExecutor);
54
+ createUserSchema(): Promise<void>;
55
+ dropUserSchema(): Promise<void>;
56
+ queryUserDB<R>(sql: string, ...params: unknown[]): Promise<R[]>;
57
+ getConfig<T>(key: string): T | undefined;
58
+ getConfig<T>(key: string, defaultValue: T): T;
59
+ }
60
+ //# sourceMappingURL=context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EA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AAE,SAAS,CAAC,EAAE,eAAe;IAW5G,mCAAmC;IAEnC,iBAAiB,CAAC,EAAE,GAAG,CAAC;IACxB,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IACxC,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC;CAmB9C;AAGD;;GAEG;AACH,qBAAa,WAAW;IASV,QAAQ,CAAC,GAAG,EAAE,YAAY;IAPtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAGxB,OAAO,CAAC,YAAY,CAAe;IAEnC,OAAO,CAAC,WAAW,CAAM;gBAEJ,GAAG,EAAE,YAAY;IAOtC,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAK/D,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IACxC,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC;CAmB9C"}
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InitContext = exports.DBOSContextImpl = void 0;
4
+ const logs_1 = require("./telemetry/logs");
5
+ const lodash_1 = require("lodash");
6
+ const error_1 = require("./error");
7
+ class DBOSContextImpl {
8
+ operationName;
9
+ span;
10
+ request = {}; // Raw incoming HTTP request.
11
+ authenticatedUser = ""; // The user that has been authenticated
12
+ authenticatedRoles = []; // All roles the user has according to authentication
13
+ assumedRole = ""; // Role in use - that user has and provided authorization to current function
14
+ workflowUUID = ""; // Workflow UUID. Empty for HandlerContexts.
15
+ logger; // Wrapper around the global logger for this context.
16
+ constructor(operationName, span, logger, parentCtx) {
17
+ this.operationName = operationName;
18
+ this.span = span;
19
+ this.logger = new logs_1.Logger(logger, this);
20
+ if (parentCtx) {
21
+ this.request = parentCtx.request;
22
+ this.authenticatedUser = parentCtx.authenticatedUser;
23
+ this.authenticatedRoles = parentCtx.authenticatedRoles;
24
+ this.assumedRole = parentCtx.assumedRole;
25
+ this.workflowUUID = parentCtx.workflowUUID;
26
+ }
27
+ }
28
+ /*** Application configuration ***/
29
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ applicationConfig;
31
+ getConfig(key, defaultValue) {
32
+ // If there is no application config at all, or the key is missing, return the default value or undefined.
33
+ if (!this.applicationConfig || !(0, lodash_1.has)(this.applicationConfig, key)) {
34
+ if (defaultValue) {
35
+ return defaultValue;
36
+ }
37
+ return undefined;
38
+ }
39
+ // If the key is found and the default value is provided, check whether the value is of the same type.
40
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
41
+ const value = (0, lodash_1.get)(this.applicationConfig, key);
42
+ if (defaultValue && typeof value !== typeof defaultValue) {
43
+ throw new error_1.DBOSConfigKeyTypeError(key, typeof defaultValue, typeof value);
44
+ }
45
+ return value;
46
+ }
47
+ }
48
+ exports.DBOSContextImpl = DBOSContextImpl;
49
+ /**
50
+ * TODO : move logger and application, getConfig to a BaseContext which is at the root of all contexts
51
+ */
52
+ class InitContext {
53
+ wfe;
54
+ logger;
55
+ // All private Not exposed
56
+ userDatabase;
57
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
+ application;
59
+ constructor(wfe) {
60
+ this.wfe = wfe;
61
+ this.logger = wfe.logger;
62
+ this.userDatabase = wfe.userDatabase;
63
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
64
+ this.application = wfe.config.application;
65
+ }
66
+ createUserSchema() {
67
+ return this.userDatabase.createSchema();
68
+ }
69
+ dropUserSchema() {
70
+ return this.userDatabase.dropSchema();
71
+ }
72
+ queryUserDB(sql, ...params) {
73
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
74
+ return this.userDatabase.query(sql, ...params);
75
+ }
76
+ getConfig(key, defaultValue) {
77
+ // If there is no application config at all, or the key is missing, return the default value or undefined.
78
+ if (!this.application || !(0, lodash_1.has)(this.application, key)) {
79
+ if (defaultValue) {
80
+ return defaultValue;
81
+ }
82
+ return undefined;
83
+ }
84
+ // If the key is found and the default value is provided, check whether the value is of the same type.
85
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
86
+ const value = (0, lodash_1.get)(this.wfe.config.application, key);
87
+ if (defaultValue && typeof value !== typeof defaultValue) {
88
+ throw new error_1.DBOSConfigKeyTypeError(key, typeof defaultValue, typeof value);
89
+ }
90
+ return value;
91
+ }
92
+ }
93
+ exports.InitContext = InitContext;
94
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":";;;AACA,2CAAiF;AACjF,mCAAkC;AAKlC,mCAAiD;AA6BjD,MAAa,eAAe;IAQL;IAAgC;IAPrD,OAAO,GAAgB,EAAE,CAAC,CAAU,6BAA6B;IACjE,iBAAiB,GAAW,EAAE,CAAC,CAAK,uCAAuC;IAC3E,kBAAkB,GAAa,EAAE,CAAC,CAAE,qDAAqD;IACzF,WAAW,GAAW,EAAE,CAAC,CAAW,6EAA6E;IACjH,YAAY,GAAW,EAAE,CAAC,CAAU,4CAA4C;IACvE,MAAM,CAAa,CAAM,qDAAqD;IAEvF,YAAqB,aAAqB,EAAW,IAAU,EAAE,MAAc,EAAE,SAA2B;QAAvF,kBAAa,GAAb,aAAa,CAAQ;QAAW,SAAI,GAAJ,IAAI,CAAM;QAC7D,IAAI,CAAC,MAAM,GAAG,IAAI,aAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC3C,IAAI,SAAS,EAAE;YACb,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;YACjC,IAA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C;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,CAAC;IAC1C,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;IACxC,CAAC;IAED,WAAW,CAAI,GAAW,EAAE,GAAG,MAAiB;QAC9C,iEAAiE;QACjE,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,CAAC;IACjD,CAAC;IAID,SAAS,CAAI,GAAW,EAAE,YAAgB;QACxC,0GAA0G;QAC1G,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAA,YAAG,EAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,EAAE;YACpD,IAAI,YAAY,EAAE;gBAChB,OAAO,YAAY,CAAC;aACrB;YACD,OAAO,SAAS,CAAC;SAClB;QAED,sGAAsG;QACtG,mEAAmE;QACnE,MAAM,KAAK,GAAG,IAAA,YAAG,EAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QACpD,IAAI,YAAY,IAAI,OAAO,KAAK,KAAK,OAAO,YAAY,EAAE;YACxD,MAAM,IAAI,8BAAsB,CAAC,GAAG,EAAE,OAAO,YAAY,EAAE,OAAO,KAAK,CAAC,CAAC;SAC1E;QAED,OAAO,KAAU,CAAC;IACpB,CAAC;CACF;AAjDD,kCAiDC"}
@@ -0,0 +1,3 @@
1
+ import { MethodRegistrationBase } from "./decorators";
2
+ export declare function validateMethodArgs<Args extends unknown[]>(methReg: MethodRegistrationBase, args: Args): Args;
3
+ //# sourceMappingURL=data_validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data_validation.d.ts","sourceRoot":"","sources":["../../src/data_validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAsB,MAAM,cAAc,CAAC;AAI1E,wBAAgB,kBAAkB,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,OAAO,EAAE,sBAAsB,EAAE,IAAI,EAAE,IAAI,QA4KrG"}
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateMethodArgs = void 0;
4
+ const decorators_1 = require("./decorators");
5
+ const error_1 = require("./error");
6
+ function validateMethodArgs(methReg, args) {
7
+ let opCtx = undefined;
8
+ const validationError = (msg) => {
9
+ const err = new error_1.DBOSDataValidationError(msg);
10
+ opCtx?.span.addEvent("DataValidationError", { message: err.message });
11
+ return err;
12
+ };
13
+ // Input validation
14
+ methReg.args.forEach((argDescriptor, idx) => {
15
+ if (idx === 0) {
16
+ // Context, may find a more robust way.
17
+ opCtx = args[idx];
18
+ return;
19
+ }
20
+ // Do we have an arg at all
21
+ if (idx >= args.length) {
22
+ if (argDescriptor.required === decorators_1.ArgRequiredOptions.REQUIRED ||
23
+ argDescriptor.required === decorators_1.ArgRequiredOptions.DEFAULT && methReg.defaults?.defaultArgRequired === decorators_1.ArgRequiredOptions.REQUIRED) {
24
+ throw validationError(`Insufficient number of arguments calling ${methReg.name} - ${args.length}/${methReg.args.length}`);
25
+ }
26
+ return;
27
+ }
28
+ let argValue = args[idx];
29
+ // So... there is such a thing as "undefined", and another thing called "null"
30
+ // We will fold this to "undefined" for our APIs. It's just a rule of ours.
31
+ if (argValue === null) {
32
+ argValue = undefined;
33
+ args[idx] = undefined;
34
+ }
35
+ if (argValue === undefined && (argDescriptor.required === decorators_1.ArgRequiredOptions.REQUIRED ||
36
+ (argDescriptor.required === decorators_1.ArgRequiredOptions.DEFAULT && methReg.defaults?.defaultArgRequired === decorators_1.ArgRequiredOptions.REQUIRED))) {
37
+ throw validationError(`Missing required argument ${argDescriptor.name} of ${methReg.name}`);
38
+ }
39
+ if (argValue === undefined) {
40
+ return;
41
+ }
42
+ if (argValue instanceof String) {
43
+ argValue = argValue.toString();
44
+ args[idx] = argValue;
45
+ }
46
+ if (argValue instanceof Boolean) {
47
+ argValue = argValue.valueOf();
48
+ args[idx] = argValue;
49
+ }
50
+ if (argValue instanceof Number) {
51
+ argValue = argValue.valueOf();
52
+ args[idx] = argValue;
53
+ }
54
+ if (argValue instanceof BigInt) { // ES2020+
55
+ argValue = argValue.valueOf();
56
+ args[idx] = argValue;
57
+ }
58
+ // Maybe look into https://www.npmjs.com/package/validator
59
+ // We could support emails and other validations too with something like that...
60
+ if (argDescriptor.dataType.dataType === 'text' || argDescriptor.dataType.dataType === 'varchar') {
61
+ if ((typeof argValue !== 'string')) {
62
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' and should be a string`);
63
+ }
64
+ if (argDescriptor.dataType.length > 0) {
65
+ if (argValue.length > argDescriptor.dataType.length) {
66
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' with maximum length ${argDescriptor.dataType.length} but has length ${argValue.length}`);
67
+ }
68
+ }
69
+ }
70
+ if (argDescriptor.dataType.dataType === 'boolean') {
71
+ if (typeof argValue !== 'boolean') {
72
+ if (typeof argValue == 'number') {
73
+ if (argValue === 0 || argValue === 1) {
74
+ argValue = (argValue != 0 ? true : false);
75
+ args[idx] = argValue;
76
+ }
77
+ else {
78
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' and may be a number (0 or 1) convertible to boolean, but was ${argValue}.`);
79
+ }
80
+ }
81
+ else if (typeof argValue == 'string') {
82
+ if (argValue.toLowerCase() === 't' || argValue.toLowerCase() === 'true' || argValue === '1') {
83
+ argValue = true;
84
+ args[idx] = argValue;
85
+ }
86
+ else if (argValue.toLowerCase() === 'f' || argValue.toLowerCase() === 'false' || argValue === '0') {
87
+ argValue = false;
88
+ args[idx] = argValue;
89
+ }
90
+ else {
91
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' and may be a string convertible to boolean, but was ${argValue}.`);
92
+ }
93
+ }
94
+ else {
95
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' and should be a boolean`);
96
+ }
97
+ }
98
+ }
99
+ if (argDescriptor.dataType.dataType === 'decimal') {
100
+ // Range check precision and scale... wishing there was a bigdecimal
101
+ // Floats don't really permit us to check the scale.
102
+ if (typeof argValue !== 'number') {
103
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' and should be a number`);
104
+ }
105
+ let prec = argDescriptor.dataType.precision;
106
+ if (prec > 0) {
107
+ if (argDescriptor.dataType.scale > 0) {
108
+ prec = prec - argDescriptor.dataType.scale;
109
+ }
110
+ if (Math.abs(argValue) >= Math.exp(prec)) {
111
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is out of range for type '${argDescriptor.dataType.formatAsString()}`);
112
+ }
113
+ }
114
+ }
115
+ if (argDescriptor.dataType.dataType === 'double' || argDescriptor.dataType.dataType === 'integer') {
116
+ if (typeof argValue !== 'number') {
117
+ if (typeof argValue === 'string') {
118
+ const n = parseFloat(argValue);
119
+ if (isNaN(n)) {
120
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' and should be a number`);
121
+ }
122
+ argValue = n;
123
+ args[idx] = argValue;
124
+ }
125
+ else if (typeof argValue === 'bigint') {
126
+ // Hum, maybe we should allow bigint as a type, number won't even do 64-bit.
127
+ argValue = Number(argValue).valueOf();
128
+ args[idx] = argValue;
129
+ }
130
+ else {
131
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' and should be a number`);
132
+ }
133
+ }
134
+ if (argDescriptor.dataType.dataType === 'integer') {
135
+ if (!Number.isInteger(argValue)) {
136
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' but has a fractional part`);
137
+ }
138
+ }
139
+ }
140
+ if (argDescriptor.dataType.dataType === 'timestamp') {
141
+ if (!(argValue instanceof Date)) {
142
+ if (typeof argValue == 'string') {
143
+ const d = Date.parse(argValue);
144
+ if (isNaN(d)) {
145
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' but is a string that will not parse as Date`);
146
+ }
147
+ argValue = new Date(d);
148
+ args[idx] = argValue;
149
+ }
150
+ else {
151
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' but is not a date or time`);
152
+ }
153
+ }
154
+ }
155
+ if (argDescriptor.dataType.dataType === 'uuid') {
156
+ // This validation is loose. A tighter one would be:
157
+ // /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/
158
+ // That matches UUID version 1-5.
159
+ if (!/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.test(String(argValue))) {
160
+ throw validationError(`Argument ${argDescriptor.name} of ${methReg.name} is marked as type '${argDescriptor.dataType.dataType}' but is not a valid UUID`);
161
+ }
162
+ }
163
+ // JSON can be anything. We can validate it against a schema at some later version...
164
+ });
165
+ return args;
166
+ }
167
+ exports.validateMethodArgs = validateMethodArgs;
168
+ //# sourceMappingURL=data_validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data_validation.js","sourceRoot":"","sources":["../../src/data_validation.ts"],"names":[],"mappings":";;;AAAA,6CAA0E;AAE1E,mCAAkD;AAElD,SAAgB,kBAAkB,CAAyB,OAA+B,EAAE,IAAU;IAElG,IAAI,KAAK,GAAiC,SAAS,CAAC;IAEpD,MAAM,eAAe,GAAG,CAAC,GAAU,EAAE,EAAE;QACnC,MAAM,GAAG,GAAG,IAAI,+BAAuB,CAAC,GAAG,CAAC,CAAC;QAC7C,KAAK,EAAE,I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AAE;wBACZ,MAAM,eAAe,CAAC,YAAY,aAAa,CAAC,IAAI,OAAO,OAAO,CAAC,IAAI,uBAAuB,aAAa,CAAC,QAAQ,CAAC,QAAQ,+CAA+C,CAAC,CAAC;qBAC/K;oBACD,QAAQ,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;oBACvB,IAAI,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;iBACtB;qBACI;oBACH,MAAM,eAAe,CAAC,YAAY,aAAa,CAAC,IAAI,OAAO,OAAO,CAAC,IAAI,uBAAuB,aAAa,CAAC,QAAQ,CAAC,QAAQ,6BAA6B,CAAC,CAAC;iBAC7J;aACF;SACF;QACD,IAAI,aAAa,CAAC,QAAQ,CAAC,QAAQ,KAAK,MAAM,EAAE;YAC9C,qDAAqD;YACrD,+FAA+F;YAC/F,iCAAiC;YACjC,IAAI,CAAC,+EAA+E,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE;gBAC3G,MAAM,eAAe,CAAC,YAAY,aAAa,CAAC,IAAI,OAAO,OAAO,CAAC,IAAI,uBAAuB,aAAa,CAAC,QAAQ,CAAC,QAAQ,2BAA2B,CAAC,CAAC;aAC3J;SACF;QACD,sFAAsF;IAC1F,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AAChB,CAAC;AA5KD,gDA4KC"}
@@ -0,0 +1,79 @@
1
+ /// <reference types="node" />
2
+ import { Workflow, WorkflowConfig, WorkflowHandle, WorkflowParams } from './workflow';
3
+ import { Transaction, TransactionConfig } from './transaction';
4
+ import { CommunicatorConfig, Communicator } from './communicator';
5
+ import { TelemetryCollector } from './telemetry/collector';
6
+ import { Tracer } from './telemetry/traces';
7
+ import { WinstonLogger as Logger } from './telemetry/logs';
8
+ import { TelemetryConfig } from './telemetry';
9
+ import { PoolConfig } from 'pg';
10
+ import { SystemDatabase } from './system_database';
11
+ import { UserDatabase, UserDatabaseName } from './user_database';
12
+ import { MethodRegistrationBase } from './decorators';
13
+ export interface DBOSNull {
14
+ }
15
+ export declare const dbosNull: DBOSNull;
16
+ export interface DBOSConfig {
17
+ readonly poolConfig: PoolConfig;
18
+ readonly userDbclient?: UserDatabaseName;
19
+ readonly telemetry?: TelemetryConfig;
20
+ readonly system_database: string;
21
+ readonly observability_database?: string;
22
+ readonly application?: any;
23
+ readonly dbClientMetadata?: any;
24
+ }
25
+ interface WorkflowInfo<T extends any[], R> {
26
+ workflow: Workflow<T, R>;
27
+ config: WorkflowConfig;
28
+ }
29
+ export declare class DBOSExecutor {
30
+ #private;
31
+ readonly config: DBOSConfig;
32
+ initialized: boolean;
33
+ userDatabase: UserDatabase;
34
+ readonly systemDatabase: SystemDatabase;
35
+ readonly tempWorkflowName = "temp_workflow";
36
+ readonly workflowInfoMap: Map<string, WorkflowInfo<any, any>>;
37
+ readonly transactionConfigMap: Map<string, TransactionConfig>;
38
+ readonly communicatorConfigMap: Map<string, CommunicatorConfig>;
39
+ readonly topicConfigMap: Map<string, string[]>;
40
+ readonly registeredOperations: Array<MethodRegistrationBase>;
41
+ readonly initialEpochTimeMs: number;
42
+ readonly pendingWorkflowMap: Map<string, Promise<unknown>>;
43
+ readonly telemetryCollector: TelemetryCollector;
44
+ readonly flushBufferIntervalMs: number;
45
+ readonly flushBufferID: NodeJS.Timeout;
46
+ static readonly defaultNotificationTimeoutSec = 60;
47
+ readonly logger: Logger;
48
+ readonly tracer: Tracer;
49
+ entities: Function[];
50
+ constructor(config: DBOSConfig, systemDatabase?: SystemDatabase);
51
+ configureDbClient(): void;
52
+ init(...classes: object[]): Promise<void>;
53
+ destroy(): Promise<void>;
54
+ workflow<T extends any[], R>(wf: Workflow<T, R>, params: WorkflowParams, ...args: T): Promise<WorkflowHandle<R>>;
55
+ internalWorkflow<T extends any[], R>(wf: Workflow<T, R>, params: WorkflowParams, callerUUID?: string, callerFunctionID?: number, ...args: T): Promise<WorkflowHandle<R>>;
56
+ transaction<T extends any[], R>(txn: Transaction<T, R>, params: WorkflowParams, ...args: T): Promise<R>;
57
+ external<T extends any[], R>(commFn: Communicator<T, R>, params: WorkflowParams, ...args: T): Promise<R>;
58
+ send<T extends NonNullable<any>>(destinationUUID: string, message: T, topic?: string, idempotencyKey?: string): Promise<void>;
59
+ /**
60
+ * Wait for a workflow to emit an event, then return its value.
61
+ */
62
+ getEvent<T extends NonNullable<any>>(workflowUUID: string, key: string, timeoutSeconds?: number): Promise<T | null>;
63
+ /**
64
+ * Retrieve a handle for a workflow UUID.
65
+ */
66
+ retrieveWorkflow<R>(workflowUUID: string): WorkflowHandle<R>;
67
+ /**
68
+ * A recovery process that by default runs during executor init time.
69
+ * It runs to completion all pending workflows that were executing when the previous executor failed.
70
+ */
71
+ recoverPendingWorkflows(executorIDs?: string[]): Promise<WorkflowHandle<any>[]>;
72
+ /**
73
+ * Periodically flush the workflow output buffer to the system database.
74
+ */
75
+ flushWorkflowStatusBuffer(): Promise<void>;
76
+ logRegisteredHTTPUrls(): void;
77
+ }
78
+ export {};
79
+ //# sourceMappingURL=dbos-executor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dbos-executor.d.ts","sourceRoot":"","sources":["../../src/dbos-executor.ts"],"names":[],"mappings":";AAOA,OAAO,EAEL,QAAQ,EACR,cAAc,EAEd,cAAc,EACd,cAAc,EAIf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAElE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAsB,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,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