@solidactions/sdk 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +28 -4
  2. package/dist/src/adminserver.d.ts +0 -2
  3. package/dist/src/adminserver.d.ts.map +1 -1
  4. package/dist/src/adminserver.js +17 -7
  5. package/dist/src/adminserver.js.map +1 -1
  6. package/dist/src/authdecorators.js +1 -2
  7. package/dist/src/authdecorators.js.map +1 -1
  8. package/dist/src/cli/cli.js +0 -0
  9. package/dist/src/conductor/conductor.d.ts +0 -1
  10. package/dist/src/conductor/conductor.d.ts.map +1 -1
  11. package/dist/src/conductor/conductor.js +17 -7
  12. package/dist/src/conductor/conductor.js.map +1 -1
  13. package/dist/src/config.js +11 -11
  14. package/dist/src/config.js.map +1 -1
  15. package/dist/src/context.d.ts +0 -2
  16. package/dist/src/context.d.ts.map +1 -1
  17. package/dist/src/context.js +8 -9
  18. package/dist/src/context.js.map +1 -1
  19. package/dist/src/database_utils.js +3 -4
  20. package/dist/src/database_utils.js.map +1 -1
  21. package/dist/src/debugpoint.js +5 -5
  22. package/dist/src/debugpoint.js.map +1 -1
  23. package/dist/src/decorators.d.ts.map +1 -1
  24. package/dist/src/decorators.js +35 -35
  25. package/dist/src/decorators.js.map +1 -1
  26. package/dist/src/error.d.ts +2 -2
  27. package/dist/src/error.d.ts.map +1 -1
  28. package/dist/src/error.js +3 -3
  29. package/dist/src/error.js.map +1 -1
  30. package/dist/src/http_client.d.ts +7 -1
  31. package/dist/src/http_client.d.ts.map +1 -1
  32. package/dist/src/http_client.js +17 -6
  33. package/dist/src/http_client.js.map +1 -1
  34. package/dist/src/http_system_database.d.ts +1 -0
  35. package/dist/src/http_system_database.d.ts.map +1 -1
  36. package/dist/src/http_system_database.js +11 -1
  37. package/dist/src/http_system_database.js.map +1 -1
  38. package/dist/src/index.js +17 -7
  39. package/dist/src/index.js.map +1 -1
  40. package/dist/src/serialization.d.ts.map +1 -1
  41. package/dist/src/serialization.js +7 -7
  42. package/dist/src/serialization.js.map +1 -1
  43. package/dist/src/solidactions-executor.js +17 -7
  44. package/dist/src/solidactions-executor.js.map +1 -1
  45. package/dist/src/solidactions.d.ts +23 -3
  46. package/dist/src/solidactions.d.ts.map +1 -1
  47. package/dist/src/solidactions.js +30 -4
  48. package/dist/src/solidactions.js.map +1 -1
  49. package/dist/src/system_database.d.ts +1 -0
  50. package/dist/src/system_database.d.ts.map +1 -1
  51. package/dist/src/system_database.js.map +1 -1
  52. package/dist/src/telemetry/collector.d.ts.map +1 -1
  53. package/dist/src/telemetry/logs.d.ts.map +1 -1
  54. package/dist/src/telemetry/traces.js +5 -5
  55. package/dist/src/telemetry/traces.js.map +1 -1
  56. package/dist/src/testing/index.d.ts +13 -0
  57. package/dist/src/testing/index.d.ts.map +1 -0
  58. package/dist/src/testing/index.js +19 -0
  59. package/dist/src/testing/index.js.map +1 -0
  60. package/dist/src/testing/mock_server.d.ts +134 -0
  61. package/dist/src/testing/mock_server.d.ts.map +1 -0
  62. package/dist/src/testing/mock_server.js +613 -0
  63. package/dist/src/testing/mock_server.js.map +1 -0
  64. package/dist/src/utils.d.ts +0 -1
  65. package/dist/src/utils.d.ts.map +1 -1
  66. package/dist/src/utils.js +8 -8
  67. package/dist/src/utils.js.map +1 -1
  68. package/dist/src/workflow.d.ts +1 -1
  69. package/dist/src/workflow.d.ts.map +1 -1
  70. package/dist/src/workflow.js +2 -2
  71. package/dist/src/workflow.js.map +1 -1
  72. package/dist/src/workflow_management.js +7 -8
  73. package/dist/src/workflow_management.js.map +1 -1
  74. package/dist/tsconfig.tsbuildinfo +1 -1
  75. package/docs/sdk-reference.md +1207 -0
  76. package/package.json +6 -1
  77. package/.claude/settings.local.json +0 -7
  78. package/dist/dbos-config.schema.json +0 -132
  79. package/dist/src/cli/commands.d.ts +0 -3
  80. package/dist/src/cli/commands.d.ts.map +0 -1
  81. package/dist/src/cli/commands.js +0 -46
  82. package/dist/src/cli/commands.js.map +0 -1
  83. package/dist/src/datasource.d.ts +0 -109
  84. package/dist/src/datasource.d.ts.map +0 -1
  85. package/dist/src/datasource.js +0 -204
  86. package/dist/src/datasource.js.map +0 -1
  87. package/dist/src/dbos-executor.d.ts +0 -189
  88. package/dist/src/dbos-executor.d.ts.map +0 -1
  89. package/dist/src/dbos-executor.js +0 -817
  90. package/dist/src/dbos-executor.js.map +0 -1
  91. package/dist/src/dbos.d.ts +0 -519
  92. package/dist/src/dbos.d.ts.map +0 -1
  93. package/dist/src/dbos.js +0 -1282
  94. package/dist/src/dbos.js.map +0 -1
  95. package/dist/src/debouncer.d.ts +0 -33
  96. package/dist/src/debouncer.d.ts.map +0 -1
  97. package/dist/src/debouncer.js +0 -170
  98. package/dist/src/debouncer.js.map +0 -1
  99. package/dist/src/scheduler/crontab.d.ts +0 -14
  100. package/dist/src/scheduler/crontab.d.ts.map +0 -1
  101. package/dist/src/scheduler/crontab.js +0 -308
  102. package/dist/src/scheduler/crontab.js.map +0 -1
  103. package/dist/src/scheduler/scheduler.d.ts +0 -41
  104. package/dist/src/scheduler/scheduler.d.ts.map +0 -1
  105. package/dist/src/scheduler/scheduler.js +0 -165
  106. package/dist/src/scheduler/scheduler.js.map +0 -1
  107. package/dist/src/wfqueue.d.ts +0 -64
  108. package/dist/src/wfqueue.d.ts.map +0 -1
  109. package/dist/src/wfqueue.js +0 -147
  110. package/dist/src/wfqueue.js.map +0 -1
  111. package/docs/api-schema.md +0 -1441
  112. package/docs/migration-guide.md +0 -460
  113. package/docs/phase-14-changes.md +0 -156
  114. package/docs/solidsteps-ai-prompt.md +0 -534
  115. package/solidactions-ai-prompt.md +0 -1504
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidactions/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "SolidActions SDK - Durable workflow execution framework",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -37,6 +37,11 @@
37
37
  "import": "./dist/src/index.js",
38
38
  "require": "./dist/src/index.js",
39
39
  "types": "./dist/src/index.d.ts"
40
+ },
41
+ "./testing": {
42
+ "import": "./dist/src/testing/index.js",
43
+ "require": "./dist/src/testing/index.js",
44
+ "types": "./dist/src/testing/index.d.ts"
40
45
  }
41
46
  },
42
47
  "workspaces": [
@@ -1,7 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(git fetch:*)"
5
- ]
6
- }
7
- }
@@ -1,132 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "DBOS Config",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "properties": {
7
- "name": {
8
- "type": "string",
9
- "description": "The name of your application"
10
- },
11
- "language": {
12
- "type": "string",
13
- "description": "The language used in your application",
14
- "enum": ["node", "python"]
15
- },
16
- "database_url": {
17
- "type": "string",
18
- "description": "The URL of the application database"
19
- },
20
- "system_database_url": {
21
- "type": "string",
22
- "description": "The URL of the system database"
23
- },
24
- "system_database_schema_name": {
25
- "type": "string",
26
- "description": "The schema name for DBOS system tables (default: 'dbos')"
27
- },
28
- "database": {
29
- "type": "object",
30
- "additionalProperties": false,
31
- "properties": {
32
- "app_db_name": {
33
- "type": "string",
34
- "description": "The name of the application database. DEPRECATED: Use database_url instead",
35
- "deprecated": true
36
- },
37
- "migrate": {
38
- "type": "array",
39
- "items": {
40
- "type": "string"
41
- },
42
- "description": "Specify a list of user DB migration commands to run"
43
- }
44
- }
45
- },
46
- "telemetry": {
47
- "type": "object",
48
- "additionalProperties": false,
49
- "properties": {
50
- "logs": {
51
- "type": "object",
52
- "additionalProperties": false,
53
- "properties": {
54
- "addContextMetadata": {
55
- "type": "boolean",
56
- "description": "Adds contextual information, such as workflow UUID, to each log entry"
57
- },
58
- "logLevel": {
59
- "type": "string",
60
- "description": "A filter on what logs should be printed to the standard output"
61
- },
62
- "silent": {
63
- "type": "boolean",
64
- "description": "Silences the logger such that nothing is printed to the standard output"
65
- }
66
- }
67
- },
68
- "OTLPExporter": {
69
- "type": "object",
70
- "additionalProperties": false,
71
- "properties": {
72
- "logsEndpoint": {
73
- "anyOf": [
74
- {
75
- "type": "string"
76
- },
77
- {
78
- "type": "array",
79
- "items": {
80
- "type": "string"
81
- }
82
- }
83
- ],
84
- "description": "The URL of an OTLP collector to which to export logs"
85
- },
86
- "tracesEndpoint": {
87
- "anyOf": [
88
- {
89
- "type": "string"
90
- },
91
- {
92
- "type": "array",
93
- "items": {
94
- "type": "string"
95
- }
96
- }
97
- ],
98
- "description": "The URL of an OTLP collector to which to export traces"
99
- }
100
- }
101
- }
102
- }
103
- },
104
- "runtimeConfig": {
105
- "type": "object",
106
- "additionalProperties": false,
107
- "properties": {
108
- "admin_port": {
109
- "type": "number",
110
- "description": "The port number of the admin server (Default: 3001)"
111
- },
112
- "start": {
113
- "type": "array",
114
- "items": {
115
- "type": "string"
116
- },
117
- "description": "Commands to start the application"
118
- },
119
- "setup": {
120
- "type": "array",
121
- "items": {
122
- "type": "string"
123
- },
124
- "description": "Commands to setup the application execution environment"
125
- }
126
- }
127
- },
128
- "env": {
129
- "deprecated": true
130
- }
131
- }
132
- }
@@ -1,3 +0,0 @@
1
- import { GlobalLogger } from '../telemetry/logs';
2
- export declare function runCommand(command: string, logger: GlobalLogger): Promise<number>;
3
- //# sourceMappingURL=commands.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CA0CjF"}
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runCommand = void 0;
4
- const child_process_1 = require("child_process");
5
- // Run the "start" command provided by users in their dbos-config.yaml
6
- function runCommand(command, logger) {
7
- return new Promise((resolve, reject) => {
8
- // Split the command into the executable and its arguments
9
- const [executable, ...args] = command.split(' ');
10
- // Spawn a child process
11
- const child = (0, child_process_1.spawn)(executable, args, {
12
- stdio: 'inherit', // Forward stdin, stdout, stderr
13
- shell: true, // Use the shell to interpret the command
14
- });
15
- // Handle parent signals and forward to child
16
- const handleSignal = (signal) => {
17
- logger.debug(`Received ${signal}, forwarding to process...`);
18
- if (child.pid) {
19
- process.kill(child.pid, signal);
20
- }
21
- };
22
- process.on('SIGTERM', () => handleSignal('SIGTERM'));
23
- process.on('SIGINT', () => handleSignal('SIGINT'));
24
- // Cleanup when child exits
25
- child.on('exit', (code, signal) => {
26
- if (code === 0 || signal === 'SIGTERM' || signal === 'SIGINT') {
27
- logger.info(`Process exited successfully with code ${code ?? 'unknown'} or signal ${signal ?? 'unknown'}`);
28
- resolve(0);
29
- }
30
- else {
31
- const errorMsg = `Process exited with code ${code ?? 'unknown'} or signal ${signal ?? 'unknown'}`;
32
- logger.error(errorMsg);
33
- // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
34
- reject(code);
35
- }
36
- });
37
- // Must be caught by the caller
38
- child.on('error', (error) => {
39
- logger.error(`Failed to start process: ${error.message}`);
40
- // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
41
- reject(1);
42
- });
43
- });
44
- }
45
- exports.runCommand = runCommand;
46
- //# sourceMappingURL=commands.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../src/cli/commands.ts"],"names":[],"mappings":";;;AAAA,iDAAsC;AAGtC,sEAAsE;AACtE,SAAgB,UAAU,CAAC,OAAe,EAAE,MAAoB;IAC9D,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,0DAA0D;QAC1D,MAAM,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEjD,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C/B,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;YAC1B,MAAM,CAAC,KAAK,CAAC,4BAA4B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YAC1D,2EAA2E;YAC3E,MAAM,CAAC,CAAC,CAAC,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AA1CD,gCA0CC"}
@@ -1,109 +0,0 @@
1
- import { FunctionName } from './decorators';
2
- /**
3
- * This interface is to be used for implementers of transactional data sources
4
- * This is what gets registered for the transaction control framework
5
- */
6
- export interface DataSourceTransactionHandler {
7
- readonly name: string;
8
- readonly dsType: string;
9
- /**
10
- * Will be called by DBOS during launch.
11
- * This may be a no-op if the DS is initialized before telling DBOS about the DS at all.
12
- */
13
- initialize(): Promise<void>;
14
- /**
15
- * Will be called by DBOS during attempt at clean shutdown (generally in testing scenarios).
16
- */
17
- destroy(): Promise<void>;
18
- /**
19
- * Invoke a transaction function
20
- */
21
- invokeTransactionFunction<This, Args extends unknown[], Return>(config: unknown, target: This, func: (this: This, ...args: Args) => Promise<Return>, ...args: Args): Promise<Return>;
22
- }
23
- /**
24
- * This is the suggested interface guideline for presenting to the end user, but not
25
- * strictly required.
26
- */
27
- export interface DBOSDataSource<Config extends {
28
- name?: string;
29
- }> {
30
- readonly name: string;
31
- /**
32
- * Run the code transactionally within this data source
33
- * Implementers should strongly type the config
34
- * @param callback - Function to run within a transactional context
35
- * @param name - Step name to show in the system database, traces, etc.
36
- * @param config - Transaction configuration options
37
- */
38
- runTransaction<T>(callback: () => Promise<T>, config?: Config): Promise<T>;
39
- /**
40
- * Register function as DBOS transaction, to be called within the context
41
- * of a transaction on this data source.
42
- *
43
- * Providing a static version of this functionality is optional.
44
- *
45
- * @param func - Function to wrap
46
- * @param config - Transaction settings, including function `name`
47
- * @param target - Class name, or class ctor/prototype
48
- * @returns Wrapped function, to be called instead of `func`
49
- */
50
- registerTransaction<This, Args extends unknown[], Return>(func: (this: This, ...args: Args) => Promise<Return>, config?: Config & FunctionName): (this: This, ...args: Args) => Promise<Return>;
51
- /**
52
- * Produce a Stage 2 method decorator
53
- * @param config - Configuration to apply to the decorated method
54
- */
55
- transaction(config?: Config): <This, Args extends unknown[], Return>(target: object, propertyKey: string, descriptor: TypedPropertyDescriptor<(this: This, ...args: Args) => Promise<Return>>) => TypedPropertyDescriptor<(this: This, ...args: Args) => Promise<Return>>;
56
- }
57
- /**
58
- * This function is to be called by `DataSourceTransactionHandler` instances,
59
- * with bits of user code to be run as transactions.
60
- * 1. The DS validates the type of config and provides the name
61
- * 2. The transaction will be started inside here, with a durable sysdb checkpoint.
62
- * 3. The DS will in turn be called upon to run the callback in a transaction context
63
- * @param callback - User callback function
64
- * @param funcName - Function name, for recording in system DB
65
- * @param options - Data source name and configuration
66
- * @returns the return from `callback`
67
- */
68
- export declare function runTransaction<T>(callback: () => Promise<T>, funcName: string, options?: {
69
- dsName?: string;
70
- config?: unknown;
71
- }): Promise<T>;
72
- export declare function registerTransaction<This, Args extends unknown[], Return, Config extends FunctionName>(dsName: string, func: (this: This, ...args: Args) => Promise<Return>, config?: Config): (this: This, ...args: Args) => Promise<Return>;
73
- /**
74
- * Register a transactional data source, that helps DBOS provide
75
- * transactional access to user databases
76
- * @param name - Registered name for the data source
77
- * @param ds - Transactional data source provider
78
- */
79
- export declare function registerDataSource(ds: DataSourceTransactionHandler): void;
80
- /** Isolation typically supported by application databases */
81
- export declare const PGIsolationLevel: Readonly<{
82
- readonly ReadUncommitted: "READ UNCOMMITTED";
83
- readonly ReadCommitted: "READ COMMITTED";
84
- readonly RepeatableRead: "REPEATABLE READ";
85
- readonly Serializable: "SERIALIZABLE";
86
- }>;
87
- type ValuesOf<T> = T[keyof T];
88
- export type PGIsolationLevel = ValuesOf<typeof PGIsolationLevel>;
89
- /**
90
- * Configuration for Postgres-like transactions
91
- */
92
- export interface PGTransactionConfig {
93
- /** Isolation level to request from underlying app database */
94
- isolationLevel?: PGIsolationLevel;
95
- /** If set, request read-only transaction from underlying app database */
96
- readOnly?: boolean;
97
- }
98
- export interface CheckSchemaInstallationReturn {
99
- schema_exists: number;
100
- table_exists: number;
101
- }
102
- export declare function checkSchemaInstallationPG(schemaName?: string): string;
103
- export declare function createTransactionCompletionSchemaPG(schemaName?: string): string;
104
- export declare function createTransactionCompletionTablePG(schemaName?: string): string;
105
- export declare function isPGRetriableTransactionError(error: unknown): boolean;
106
- export declare function isPGKeyConflictError(error: unknown): boolean;
107
- export declare function isPGFailedSqlTransactionError(error: unknown): boolean;
108
- export { maskDatabaseUrl, getDatabaseNameFromUrl, deriveDatabaseUrl } from './database_utils';
109
- //# sourceMappingURL=datasource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/datasource.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,YAAY,EAKb,MAAM,cAAc,CAAC;AAItB;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5B;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB;;OAEG;IACH,yBAAyB,CAAC,IAAI,EAAE,IAAI,SAAS,OAAO,EAAE,EAAE,MAAM,EAC5D,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,IAAI,EACZ,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,EACpD,GAAG,IAAI,EAAE,IAAI,GACZ,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc,CAAC,MAAM,SAAS;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE;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AAE,sBAAsB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
@@ -1,204 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deriveDatabaseUrl = exports.getDatabaseNameFromUrl = exports.maskDatabaseUrl = exports.isPGFailedSqlTransactionError = exports.isPGKeyConflictError = exports.isPGRetriableTransactionError = exports.createTransactionCompletionTablePG = exports.createTransactionCompletionSchemaPG = exports.checkSchemaInstallationPG = exports.PGIsolationLevel = exports.registerDataSource = exports.registerTransaction = exports.runTransaction = void 0;
4
- const context_1 = require("./context");
5
- const dbos_1 = require("./dbos");
6
- const dbos_executor_1 = require("./dbos-executor");
7
- const decorators_1 = require("./decorators");
8
- const error_1 = require("./error");
9
- const traces_1 = require("./telemetry/traces");
10
- /// Calling into DBOS
11
- /**
12
- * This function is to be called by `DataSourceTransactionHandler` instances,
13
- * with bits of user code to be run as transactions.
14
- * 1. The DS validates the type of config and provides the name
15
- * 2. The transaction will be started inside here, with a durable sysdb checkpoint.
16
- * 3. The DS will in turn be called upon to run the callback in a transaction context
17
- * @param callback - User callback function
18
- * @param funcName - Function name, for recording in system DB
19
- * @param options - Data source name and configuration
20
- * @returns the return from `callback`
21
- */
22
- async function runTransaction(callback, funcName, options = {}) {
23
- (0, decorators_1.ensureDBOSIsLaunched)('transactions');
24
- const dsn = options.dsName ?? '<default>';
25
- const ds = (0, decorators_1.getTransactionalDataSource)(dsn);
26
- if (!dbos_1.DBOS.isWithinWorkflow()) {
27
- if ((0, context_1.getNextWFID)(undefined)) {
28
- throw new error_1.DBOSInvalidWorkflowTransitionError(`Invalid call to transaction '${funcName}' outside of a workflow; with directive to start a workflow.`);
29
- }
30
- return await (0, context_1.runWithDataSourceContext)(0, async () => {
31
- return await ds.invokeTransactionFunction(options.config ?? {}, undefined, callback);
32
- });
33
- }
34
- if (!dbos_1.DBOS.isInWorkflow()) {
35
- throw new error_1.DBOSInvalidWorkflowTransitionError(`Invalid call to \`${funcName}\` inside a \`step\`, \`transaction\`, or \`procedure\``);
36
- }
37
- const callnum = (0, context_1.functionIDGetIncrement)();
38
- const span = dbos_executor_1.DBOSExecutor.globalInstance.tracer.startSpan(funcName, {
39
- operationUUID: dbos_1.DBOS.workflowID,
40
- operationType: dbos_executor_1.OperationType.TRANSACTION,
41
- operationName: funcName,
42
- authenticatedUser: dbos_1.DBOS.authenticatedUser ?? '',
43
- assumedRole: dbos_1.DBOS.assumedRole ?? '',
44
- authenticatedRoles: dbos_1.DBOS.authenticatedRoles ?? [],
45
- // isolationLevel: txnInfo.config.isolationLevel, // TODO: Pluggable
46
- }, dbos_1.DBOS.span);
47
- try {
48
- const res = await (0, traces_1.runWithTrace)(span, async () => {
49
- return await dbos_executor_1.DBOSExecutor.globalInstance.runInternalStep(async () => {
50
- return await (0, context_1.runWithDataSourceContext)(callnum, async () => {
51
- return await ds.invokeTransactionFunction(options.config ?? {}, undefined, callback);
52
- });
53
- }, funcName,
54
- // we can be sure workflowID is set because of previous call to assertCurrentWorkflowContext
55
- dbos_1.DBOS.workflowID, callnum);
56
- });
57
- span.setStatus({ code: traces_1.SpanStatusCode.OK });
58
- dbos_executor_1.DBOSExecutor.globalInstance.tracer.endSpan(span);
59
- return res;
60
- }
61
- catch (err) {
62
- const e = err;
63
- span.setStatus({ code: traces_1.SpanStatusCode.ERROR, message: e.message });
64
- dbos_executor_1.DBOSExecutor.globalInstance.tracer.endSpan(span);
65
- throw err;
66
- }
67
- }
68
- exports.runTransaction = runTransaction;
69
- // Transaction wrapper
70
- function registerTransaction(dsName, func, config) {
71
- const dsn = dsName ?? '<default>';
72
- const funcName = config?.name ?? func.name;
73
- const reg = (0, decorators_1.wrapDBOSFunctionAndRegister)(config?.ctorOrProto, config?.className, funcName, funcName, func);
74
- const invokeWrapper = async function (...rawArgs) {
75
- (0, decorators_1.ensureDBOSIsLaunched)('transactions');
76
- const ds = (0, decorators_1.getTransactionalDataSource)(dsn);
77
- const callFunc = reg.registeredFunction ?? reg.origFunction;
78
- if (!dbos_1.DBOS.isWithinWorkflow()) {
79
- if ((0, context_1.getNextWFID)(undefined)) {
80
- throw new error_1.DBOSInvalidWorkflowTransitionError(`Call to transaction '${funcName}' made without starting workflow`);
81
- }
82
- return await (0, context_1.runWithDataSourceContext)(0, async () => {
83
- return await ds.invokeTransactionFunction(config, this, callFunc, ...rawArgs);
84
- });
85
- }
86
- if (dbos_1.DBOS.isInTransaction() || dbos_1.DBOS.isInStep()) {
87
- throw new error_1.DBOSInvalidWorkflowTransitionError('Invalid call to a `transaction` function from within a `step` or `transaction`');
88
- }
89
- const span = dbos_executor_1.DBOSExecutor.globalInstance.tracer.startSpan(funcName, {
90
- operationUUID: dbos_1.DBOS.workflowID,
91
- operationType: dbos_executor_1.OperationType.TRANSACTION,
92
- operationName: funcName,
93
- authenticatedUser: dbos_1.DBOS.authenticatedUser ?? '',
94
- assumedRole: dbos_1.DBOS.assumedRole ?? '',
95
- authenticatedRoles: dbos_1.DBOS.authenticatedRoles ?? [],
96
- // isolationLevel: txnInfo.config.isolationLevel, // TODO: Pluggable
97
- }, dbos_1.DBOS.span);
98
- const callnum = (0, context_1.functionIDGetIncrement)();
99
- try {
100
- const res = await (0, traces_1.runWithTrace)(span, async () => {
101
- return await dbos_executor_1.DBOSExecutor.globalInstance.runInternalStep(async () => {
102
- return await (0, context_1.runWithDataSourceContext)(callnum, async () => {
103
- return await ds.invokeTransactionFunction(config, this, callFunc, ...rawArgs);
104
- });
105
- }, funcName, dbos_1.DBOS.workflowID, callnum);
106
- });
107
- span.setStatus({ code: traces_1.SpanStatusCode.OK });
108
- dbos_executor_1.DBOSExecutor.globalInstance.tracer.endSpan(span);
109
- return res;
110
- }
111
- catch (err) {
112
- const e = err;
113
- span.setStatus({ code: traces_1.SpanStatusCode.ERROR, message: e.message });
114
- dbos_executor_1.DBOSExecutor.globalInstance.tracer.endSpan(span);
115
- throw err;
116
- }
117
- };
118
- (0, decorators_1.registerFunctionWrapper)(invokeWrapper, reg);
119
- Object.defineProperty(invokeWrapper, 'name', {
120
- value: funcName,
121
- });
122
- return invokeWrapper;
123
- }
124
- exports.registerTransaction = registerTransaction;
125
- /**
126
- * Register a transactional data source, that helps DBOS provide
127
- * transactional access to user databases
128
- * @param name - Registered name for the data source
129
- * @param ds - Transactional data source provider
130
- */
131
- function registerDataSource(ds) {
132
- (0, decorators_1.registerTransactionalDataSource)(ds.name, ds);
133
- }
134
- exports.registerDataSource = registerDataSource;
135
- /// Postgres helper routines
136
- /** Isolation typically supported by application databases */
137
- exports.PGIsolationLevel = Object.freeze({
138
- ReadUncommitted: 'READ UNCOMMITTED',
139
- ReadCommitted: 'READ COMMITTED',
140
- RepeatableRead: 'REPEATABLE READ',
141
- Serializable: 'SERIALIZABLE',
142
- });
143
- function checkSchemaInstallationPG(schemaName = 'dbos') {
144
- return `
145
- SELECT
146
- EXISTS (
147
- SELECT 1
148
- FROM information_schema.schemata
149
- WHERE schema_name = '${schemaName}'
150
- ) AS schema_exists,
151
- EXISTS (
152
- SELECT 1
153
- FROM information_schema.tables
154
- WHERE table_schema = '${schemaName}'
155
- AND table_name = 'transaction_completion'
156
- ) AS table_exists;
157
- `;
158
- }
159
- exports.checkSchemaInstallationPG = checkSchemaInstallationPG;
160
- function createTransactionCompletionSchemaPG(schemaName = 'dbos') {
161
- return `CREATE SCHEMA IF NOT EXISTS "${schemaName}";`;
162
- }
163
- exports.createTransactionCompletionSchemaPG = createTransactionCompletionSchemaPG;
164
- function createTransactionCompletionTablePG(schemaName = 'dbos') {
165
- return `
166
- CREATE TABLE IF NOT EXISTS "${schemaName}".transaction_completion (
167
- workflow_id TEXT NOT NULL,
168
- function_num INT NOT NULL,
169
- output TEXT,
170
- error TEXT,
171
- created_at BIGINT NOT NULL DEFAULT (EXTRACT(EPOCH FROM now())*1000)::bigint,
172
- PRIMARY KEY (workflow_id, function_num)
173
- );
174
- `;
175
- }
176
- exports.createTransactionCompletionTablePG = createTransactionCompletionTablePG;
177
- function getPGErrorCode(error) {
178
- return error && typeof error === 'object' && 'code' in error ? error.code : undefined;
179
- }
180
- function isPGRetriableTransactionError(error) {
181
- return getPGErrorCode(error) === '40001';
182
- }
183
- exports.isPGRetriableTransactionError = isPGRetriableTransactionError;
184
- function isPGKeyConflictError(error) {
185
- return getPGErrorCode(error) === '23505';
186
- }
187
- exports.isPGKeyConflictError = isPGKeyConflictError;
188
- function isPGFailedSqlTransactionError(error) {
189
- return getPGErrorCode(error) === '25P02';
190
- }
191
- exports.isPGFailedSqlTransactionError = isPGFailedSqlTransactionError;
192
- // URL utilities retained for configuration parsing
193
- var database_utils_1 = require("./database_utils");
194
- Object.defineProperty(exports, "maskDatabaseUrl", { enumerable: true, get: function () { return database_utils_1.maskDatabaseUrl; } });
195
- Object.defineProperty(exports, "getDatabaseNameFromUrl", { enumerable: true, get: function () { return database_utils_1.getDatabaseNameFromUrl; } });
196
- Object.defineProperty(exports, "deriveDatabaseUrl", { enumerable: true, get: function () { return database_utils_1.deriveDatabaseUrl; } });
197
- // Note: PostgreSQL-specific functions were removed in the HTTP SDK migration.
198
- // The following functions are no longer available:
199
- // - getPGClientConfig
200
- // - connectToPGDatabase
201
- // - connectToPGAndReportOutcome
202
- // - dropPGDatabase
203
- // - ensurePGDatabase
204
- //# sourceMappingURL=datasource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"datasource.js","sourceRoot":"","sources":["../../src/datasource.ts"],"names":[],"mappings":";;;AAAA,uCAA0F;AAC1F,iCAA8B;AAC9B,mDAA8D;AAC9D,6CAOsB;AACtB,mCAA6D;AAC7D,+CAAkE;AAyFlE,qBAAqB;AAErB;;;;;;;;;;GAUG;AACI,KAAK,UAAU,cAAc,CAClC,QAA0B,EAC1B,QAAgB,EAChB,UAAiD,EAAE;IAEnD,IAAA,iCAAoB,EAAC,cAAc,CAAC,CAAC;IACrC,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,IAAI,WAAW,CAAC;IAC1C,MAAM,EAAE,GAAG,IAAA,uCAA0B,EA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