@dbos-inc/dbos-enterprise 5.3.1-preview → 5.4.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 (62) hide show
  1. package/README.md +4 -4
  2. package/dist/src/auto_upgrade.d.ts +39 -0
  3. package/dist/src/auto_upgrade.d.ts.map +1 -0
  4. package/dist/src/auto_upgrade.js +229 -0
  5. package/dist/src/auto_upgrade.js.map +1 -0
  6. package/dist/src/cockroach.d.ts +10 -0
  7. package/dist/src/cockroach.d.ts.map +1 -0
  8. package/dist/src/cockroach.js +28 -0
  9. package/dist/src/cockroach.js.map +1 -0
  10. package/dist/src/conductor/conductor.d.ts +42 -0
  11. package/dist/src/conductor/conductor.d.ts.map +1 -0
  12. package/dist/src/conductor/conductor.js +978 -0
  13. package/dist/src/conductor/conductor.js.map +1 -0
  14. package/dist/src/conductor/protocol.d.ts +618 -0
  15. package/dist/src/conductor/protocol.d.ts.map +1 -0
  16. package/dist/src/conductor/protocol.js +514 -0
  17. package/dist/src/conductor/protocol.js.map +1 -0
  18. package/dist/src/export.d.ts +19 -0
  19. package/dist/src/export.d.ts.map +1 -0
  20. package/dist/src/export.js +184 -0
  21. package/dist/src/export.js.map +1 -0
  22. package/dist/src/fork.d.ts +18 -0
  23. package/dist/src/fork.d.ts.map +1 -0
  24. package/dist/src/fork.js +71 -0
  25. package/dist/src/fork.js.map +1 -0
  26. package/dist/src/index.d.ts +10 -1
  27. package/dist/src/index.d.ts.map +1 -1
  28. package/dist/src/index.js +14 -3
  29. package/dist/src/index.js.map +1 -1
  30. package/dist/src/locks.d.ts +20 -0
  31. package/dist/src/locks.d.ts.map +1 -0
  32. package/dist/src/locks.js +47 -0
  33. package/dist/src/locks.js.map +1 -0
  34. package/dist/src/observability.d.ts +90 -0
  35. package/dist/src/observability.d.ts.map +1 -0
  36. package/dist/src/observability.js +398 -0
  37. package/dist/src/observability.js.map +1 -0
  38. package/dist/src/retention.d.ts +31 -0
  39. package/dist/src/retention.d.ts.map +1 -0
  40. package/dist/src/retention.js +408 -0
  41. package/dist/src/retention.js.map +1 -0
  42. package/dist/src/sharding/index.d.ts +9 -0
  43. package/dist/src/sharding/index.d.ts.map +1 -0
  44. package/dist/src/sharding/index.js +13 -0
  45. package/dist/src/sharding/index.js.map +1 -0
  46. package/dist/src/sharding/migrations.d.ts +20 -0
  47. package/dist/src/sharding/migrations.d.ts.map +1 -0
  48. package/dist/src/sharding/migrations.js +486 -0
  49. package/dist/src/sharding/migrations.js.map +1 -0
  50. package/dist/src/sharding/schema.d.ts +9 -0
  51. package/dist/src/sharding/schema.d.ts.map +1 -0
  52. package/dist/src/sharding/schema.js +12 -0
  53. package/dist/src/sharding/schema.js.map +1 -0
  54. package/dist/src/sharding/sys_db.d.ts +101 -0
  55. package/dist/src/sharding/sys_db.d.ts.map +1 -0
  56. package/dist/src/sharding/sys_db.js +717 -0
  57. package/dist/src/sharding/sys_db.js.map +1 -0
  58. package/package.json +14 -6
  59. package/dist/src/scratch.d.ts +0 -9
  60. package/dist/src/scratch.d.ts.map +0 -1
  61. package/dist/src/scratch.js +0 -15
  62. package/dist/src/scratch.js.map +0 -1
@@ -0,0 +1,184 @@
1
+ // Copyright (c) 2026 DBOS, Inc. All rights reserved.
2
+ //
3
+ // This file is part of Transact Enterprise, proprietary software licensed under the
4
+ // DBOS Conductor Software License: https://www.dbos.dev/conductor-license
5
+ // You may not use, copy, modify, or distribute this file except as that license permits.
6
+ // Disabling or circumventing the entitlement checks in @dbos-inc/dbos-sdk's src/enterprise.ts
7
+ // that gate it is a material breach of that license.
8
+ "use strict";
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.importWorkflow = exports.exportWorkflow = void 0;
11
+ const error_1 = require("@dbos-inc/dbos-sdk/internal/error");
12
+ function refuseSharded(sysdb, operation) {
13
+ if (sysdb.sharded) {
14
+ throw new error_1.DBOSError(`Workflow ${operation} is not supported on a sharded system database`);
15
+ }
16
+ }
17
+ async function exportWorkflow(sysdb, workflowID, exportChildren = false) {
18
+ refuseSharded(sysdb, 'export');
19
+ const workflowIDs = [workflowID];
20
+ if (exportChildren) {
21
+ workflowIDs.push(...(await sysdb.getWorkflowChildren(workflowID)));
22
+ }
23
+ const exportedWorkflows = [];
24
+ const client = await sysdb.connect();
25
+ try {
26
+ for (const wfID of workflowIDs) {
27
+ const statusResult = await client.query(`SELECT
28
+ ws.workflow_uuid, ws.status, ws.name, ws.authenticated_user, ws.assumed_role,
29
+ ws.authenticated_roles,
30
+ COALESCE(wo.output, ws.output) AS output, COALESCE(wo.error, ws.error) AS error,
31
+ ws.executor_id,
32
+ ws.created_at, ws.updated_at, ws.application_version, ws.application_id,
33
+ ws.class_name, ws.config_name, ws.recovery_attempts, ws.queue_name,
34
+ ws.workflow_timeout_ms, ws.workflow_deadline_epoch_ms, ws.started_at_epoch_ms,
35
+ ws.deduplication_id, COALESCE(wi.inputs, ws.inputs) AS inputs,
36
+ ws.priority, ws.queue_partition_key, ws.forked_from,
37
+ ws.parent_workflow_id, ws.serialization, ws.delay_until_epoch_ms,
38
+ ws.was_forked_from, ws.rate_limited, ws.completed_at, ws.attributes, ws.schedule_name,
39
+ ws.debounce_deadline_epoch_ms, ws.is_debounced, ws.application_name
40
+ FROM "${sysdb.schemaName}".workflow_status ws
41
+ LEFT JOIN "${sysdb.schemaName}".workflow_input wi ON wi.workflow_uuid = ws.workflow_uuid
42
+ LEFT JOIN "${sysdb.schemaName}".workflow_output wo ON wo.workflow_uuid = ws.workflow_uuid
43
+ WHERE ws.workflow_uuid = $1`, [wfID]);
44
+ if (statusResult.rows.length === 0) {
45
+ throw new error_1.DBOSNonExistentWorkflowError(`Workflow ${wfID} does not exist`);
46
+ }
47
+ const workflowStatus = statusResult.rows[0];
48
+ const outputsResult = await client.query(`SELECT
49
+ workflow_uuid, function_id, function_name, output, error,
50
+ child_workflow_id, started_at_epoch_ms, completed_at_epoch_ms,
51
+ serialization, application_name
52
+ FROM "${sysdb.schemaName}".operation_outputs
53
+ WHERE workflow_uuid = $1`, [wfID]);
54
+ const eventsResult = await client.query(`SELECT workflow_uuid, key, value, serialization
55
+ FROM "${sysdb.schemaName}".workflow_events
56
+ WHERE workflow_uuid = $1`, [wfID]);
57
+ const historyResult = await client.query(`SELECT workflow_uuid, function_id, key, value, serialization
58
+ FROM "${sysdb.schemaName}".workflow_events_history
59
+ WHERE workflow_uuid = $1`, [wfID]);
60
+ const streamsResult = await client.query(`SELECT workflow_uuid, key, value, "offset", function_id, serialization
61
+ FROM "${sysdb.schemaName}".streams
62
+ WHERE workflow_uuid = $1`, [wfID]);
63
+ exportedWorkflows.push({
64
+ workflow_status: workflowStatus,
65
+ operation_outputs: outputsResult.rows,
66
+ workflow_events: eventsResult.rows,
67
+ workflow_events_history: historyResult.rows,
68
+ streams: streamsResult.rows,
69
+ });
70
+ }
71
+ }
72
+ finally {
73
+ client.release();
74
+ }
75
+ return exportedWorkflows;
76
+ }
77
+ exports.exportWorkflow = exportWorkflow;
78
+ async function importWorkflow(sysdb, workflows) {
79
+ refuseSharded(sysdb, 'import');
80
+ const client = await sysdb.connect();
81
+ try {
82
+ await client.query('BEGIN');
83
+ for (const workflow of workflows) {
84
+ const status = workflow.workflow_status;
85
+ await client.query(`INSERT INTO "${sysdb.schemaName}".workflow_status (
86
+ workflow_uuid, status, name, authenticated_user, assumed_role,
87
+ authenticated_roles, output, error, executor_id,
88
+ created_at, updated_at, application_version, application_id,
89
+ class_name, config_name, recovery_attempts, queue_name,
90
+ workflow_timeout_ms, workflow_deadline_epoch_ms, started_at_epoch_ms,
91
+ deduplication_id, inputs, priority, queue_partition_key, forked_from,
92
+ parent_workflow_id, serialization, delay_until_epoch_ms,
93
+ was_forked_from, rate_limited, completed_at, attributes, schedule_name,
94
+ debounce_deadline_epoch_ms, is_debounced, application_name
95
+ ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30, $31, $32, $33, $34, $35, $36)`, [
96
+ status.workflow_uuid,
97
+ status.status,
98
+ status.name,
99
+ status.authenticated_user,
100
+ status.assumed_role,
101
+ status.authenticated_roles,
102
+ null,
103
+ null,
104
+ status.executor_id,
105
+ status.created_at,
106
+ status.updated_at,
107
+ status.application_version,
108
+ status.application_id,
109
+ status.class_name,
110
+ status.config_name,
111
+ status.recovery_attempts,
112
+ status.queue_name,
113
+ status.workflow_timeout_ms,
114
+ status.workflow_deadline_epoch_ms,
115
+ status.started_at_epoch_ms,
116
+ status.deduplication_id,
117
+ null,
118
+ status.priority,
119
+ status.queue_partition_key,
120
+ status.forked_from,
121
+ status.parent_workflow_id,
122
+ status.serialization,
123
+ status.delay_until_epoch_ms ?? null,
124
+ status.was_forked_from ?? false,
125
+ status.rate_limited ?? false,
126
+ status.completed_at ?? null,
127
+ status.attributes ? JSON.stringify(status.attributes) : null,
128
+ status.schedule_name ?? null,
129
+ status.debounce_deadline_epoch_ms ?? null,
130
+ status.is_debounced ?? false,
131
+ status.application_name ?? null,
132
+ ]);
133
+ await client.query(`INSERT INTO "${sysdb.schemaName}".workflow_input (workflow_uuid, inputs, retention_timestamp)
134
+ VALUES ($1, $2, (EXTRACT(EPOCH FROM now()) * 1000)::bigint)`, [status.workflow_uuid, status.inputs]);
135
+ if (status.output !== null || status.error !== null) {
136
+ await client.query(`INSERT INTO "${sysdb.schemaName}".workflow_output (workflow_uuid, output, error, retention_timestamp)
137
+ VALUES ($1, $2, $3, (EXTRACT(EPOCH FROM now()) * 1000)::bigint)`, [status.workflow_uuid, status.output, status.error]);
138
+ }
139
+ for (const output of workflow.operation_outputs) {
140
+ await client.query(`INSERT INTO "${sysdb.schemaName}".operation_outputs (
141
+ workflow_uuid, function_id, function_name, output, error,
142
+ child_workflow_id, started_at_epoch_ms, completed_at_epoch_ms,
143
+ serialization, application_name, retention_timestamp
144
+ ) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, (EXTRACT(EPOCH FROM now()) * 1000)::bigint)`, [
145
+ output.workflow_uuid,
146
+ output.function_id,
147
+ output.function_name,
148
+ output.output,
149
+ output.error,
150
+ output.child_workflow_id,
151
+ output.started_at_epoch_ms,
152
+ output.completed_at_epoch_ms,
153
+ output.serialization,
154
+ output.application_name ?? null,
155
+ ]);
156
+ }
157
+ for (const event of workflow.workflow_events) {
158
+ await client.query(`INSERT INTO "${sysdb.schemaName}".workflow_events (
159
+ workflow_uuid, key, value, serialization
160
+ ) VALUES ($1, $2, $3, $4)`, [event.workflow_uuid, event.key, event.value, event.serialization]);
161
+ }
162
+ for (const history of workflow.workflow_events_history) {
163
+ await client.query(`INSERT INTO "${sysdb.schemaName}".workflow_events_history (
164
+ workflow_uuid, function_id, key, value, serialization
165
+ ) VALUES ($1, $2, $3, $4, $5)`, [history.workflow_uuid, history.function_id, history.key, history.value, history.serialization]);
166
+ }
167
+ for (const stream of workflow.streams) {
168
+ await client.query(`INSERT INTO "${sysdb.schemaName}".streams (
169
+ workflow_uuid, key, value, "offset", function_id, serialization
170
+ ) VALUES ($1, $2, $3, $4, $5, $6)`, [stream.workflow_uuid, stream.key, stream.value, stream.offset, stream.function_id, stream.serialization]);
171
+ }
172
+ }
173
+ await client.query('COMMIT');
174
+ }
175
+ catch (error) {
176
+ await client.query('ROLLBACK');
177
+ throw error;
178
+ }
179
+ finally {
180
+ client.release();
181
+ }
182
+ }
183
+ exports.importWorkflow = importWorkflow;
184
+ //# sourceMappingURL=export.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.js","sourceRoot":"","sources":["../../src/export.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,6DAA4F;AAmB5F,SAAS,aAAa,CAAC,KAAqB,EAAE,SAAiB;IAE7D,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAClB,MAAM,IAAI,iBAAS,CAAC,YAAY,SAAS,gDAAgD,CAAC,CAAC;IAC7F,CAAC;AACH,CAAC;AAEM,KAAK,UAAU,cAAc,CACl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C,WAAW,EAAE,MAAM,CAAC,aAAa,CAAC,CAC1G,CAAC;YACJ,CAAC;QACH,CAAC;QAED,MAAM,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC/B,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,OAAO,EAAE,CAAC;IACnB,CAAC;AACH,CAAC;AA7ID,wCA6IC"}
@@ -0,0 +1,18 @@
1
+ // Copyright (c) 2026 DBOS, Inc. All rights reserved.
2
+ //
3
+ // This file is part of Transact Enterprise, proprietary software licensed under the
4
+ // DBOS Conductor Software License: https://www.dbos.dev/conductor-license
5
+ // You may not use, copy, modify, or distribute this file except as that license permits.
6
+ // Disabling or circumventing the entitlement checks in @dbos-inc/dbos-sdk's src/enterprise.ts
7
+ // that gate it is a material breach of that license.
8
+ import type { SystemDatabase } from '@dbos-inc/dbos-sdk/internal/system_database';
9
+ export declare function forkFromFailure(sysdb: SystemDatabase, workflowIDs: string[], options?: {
10
+ applicationVersion?: string;
11
+ queueName?: string;
12
+ queuePartitionKey?: string;
13
+ fromLastFailure?: boolean;
14
+ fromLastStep?: boolean;
15
+ fromStep?: number;
16
+ fromStepName?: string;
17
+ }): Promise<string[]>;
18
+ //# sourceMappingURL=fork.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fork.d.ts","sourceRoot":"","sources":["../../src/fork.ts"],"names":[],"mappings":";;;;;;;AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAElF,wBAAsB,eAAe,CACnC,KAAK,EAAE,cAAc,EACrB,WAAW,EAAE,MAAM,EAAE,EACrB,OAAO,GAAE;IACP,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CAClB,GACL,OAAO,CAAC,MAAM,EAAE,CAAC,CA6DnB"}
@@ -0,0 +1,71 @@
1
+ // Copyright (c) 2026 DBOS, Inc. All rights reserved.
2
+ //
3
+ // This file is part of Transact Enterprise, proprietary software licensed under the
4
+ // DBOS Conductor Software License: https://www.dbos.dev/conductor-license
5
+ // You may not use, copy, modify, or distribute this file except as that license permits.
6
+ // Disabling or circumventing the entitlement checks in @dbos-inc/dbos-sdk's src/enterprise.ts
7
+ // that gate it is a material breach of that license.
8
+ "use strict";
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.forkFromFailure = void 0;
11
+ const node_crypto_1 = require("node:crypto");
12
+ const error_1 = require("@dbos-inc/dbos-sdk/internal/error");
13
+ async function forkFromFailure(sysdb, workflowIDs, options = {}) {
14
+ if (sysdb.sharded) {
15
+ throw new error_1.DBOSError('Fork from failure is not supported on a sharded system database');
16
+ }
17
+ const modes = [
18
+ options.fromLastFailure ?? false,
19
+ options.fromLastStep ?? false,
20
+ options.fromStep !== undefined,
21
+ options.fromStepName !== undefined,
22
+ ].filter(Boolean).length;
23
+ if (modes !== 1) {
24
+ throw new Error('Exactly one of fromLastFailure, fromLastStep, fromStep, or fromStepName must be specified');
25
+ }
26
+ let startSteps;
27
+ if (options.fromStep !== undefined) {
28
+ startSteps = Array(workflowIDs.length).fill(options.fromStep);
29
+ }
30
+ else {
31
+ let query;
32
+ const params = [workflowIDs];
33
+ if (options.fromLastFailure) {
34
+ query = `SELECT workflow_uuid,
35
+ COALESCE(
36
+ MAX(function_id) FILTER (WHERE error IS NOT NULL),
37
+ MAX(function_id)
38
+ ) AS start_step
39
+ FROM "${sysdb.schemaName}".operation_outputs
40
+ WHERE workflow_uuid = ANY($1)
41
+ GROUP BY workflow_uuid`;
42
+ }
43
+ else if (options.fromLastStep) {
44
+ query = `SELECT workflow_uuid, MAX(function_id) AS start_step
45
+ FROM "${sysdb.schemaName}".operation_outputs
46
+ WHERE workflow_uuid = ANY($1)
47
+ GROUP BY workflow_uuid`;
48
+ }
49
+ else {
50
+ query = `SELECT workflow_uuid, MAX(function_id) AS start_step
51
+ FROM "${sysdb.schemaName}".operation_outputs
52
+ WHERE workflow_uuid = ANY($1) AND function_name = $2
53
+ GROUP BY workflow_uuid`;
54
+ params.push(options.fromStepName);
55
+ }
56
+ const result = await sysdb.pool.query(query, params);
57
+ const startStepByID = new Map(result.rows.map((r) => [r.workflow_uuid, Number(r.start_step)]));
58
+ if (options.fromStepName !== undefined) {
59
+ for (const wid of workflowIDs) {
60
+ if (!startStepByID.has(wid)) {
61
+ throw new Error(`Workflow ${wid} has no step named '${options.fromStepName}'`);
62
+ }
63
+ }
64
+ }
65
+ startSteps = workflowIDs.map((wid) => startStepByID.get(wid) ?? 0);
66
+ }
67
+ const forkedIDs = workflowIDs.map(() => (0, node_crypto_1.randomUUID)());
68
+ return sysdb.bulkForkWorkflows(workflowIDs, forkedIDs, startSteps, options);
69
+ }
70
+ exports.forkFromFailure = forkFromFailure;
71
+ //# sourceMappingURL=fork.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fork.js","sourceRoot":"","sources":["../../src/fork.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,6CAAyC;AACzC,6DAA8D;AAGvD,KAAK,UAAU,eAAe,CACnC,KAAqB,EACrB,WAAqB,EACrB,UAQI,EAAE;IAEN,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QAElB,MAAM,IAAI,iBAAS,CAAC,iEAAiE,CAAC,CAAC;IACzF,CAAC;IACD,MAAM,KAAK,GAAG;QACZ,OAAO,CAAC,eAAe,IAAI,KAAK;QAChC,OAAO,CAAC,YAAY,IAAI,KAAK;QAC7B,OAAO,CAAC,QAAQ,KAAK,SAAS;QAC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CAAC;gBAC9B,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;oBAC5B,MAAM,IAAI,KAAK,CAAC,YAAY,GAAG,uBAAuB,OAAO,CAAC,YAAY,GAAG,CAAC,CAAC;gBACjF,CAAC;YACH,CAAC;QACH,CAAC;QAED,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,IAAA,wBAAU,GAAE,CAAC,CAAC;IACtD,OAAO,KAAK,CAAC,iBAAiB,CAAC,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;AAC9E,CAAC;AAzED,0CAyEC"}
@@ -1,2 +1,11 @@
1
- export { describeExecutor, ExecutorInfo } from './scratch';
1
+ // Copyright (c) 2026 DBOS, Inc. All rights reserved.
2
+ //
3
+ // This file is part of Transact Enterprise, proprietary software licensed under the
4
+ // DBOS Conductor Software License: https://www.dbos.dev/conductor-license
5
+ // You may not use, copy, modify, or distribute this file except as that license permits.
6
+ // Disabling or circumventing the entitlement checks in @dbos-inc/dbos-sdk's src/enterprise.ts
7
+ // that gate it is a material breach of that license.
8
+ export { AutoUpgradePass } from './auto_upgrade';
9
+ export { ConductorWebsocket } from './conductor/conductor';
10
+ export { ShardedSystemDatabase } from './sharding';
2
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC"}
package/dist/src/index.js CHANGED
@@ -1,6 +1,17 @@
1
+ // Copyright (c) 2026 DBOS, Inc. All rights reserved.
2
+ //
3
+ // This file is part of Transact Enterprise, proprietary software licensed under the
4
+ // DBOS Conductor Software License: https://www.dbos.dev/conductor-license
5
+ // You may not use, copy, modify, or distribute this file except as that license permits.
6
+ // Disabling or circumventing the entitlement checks in @dbos-inc/dbos-sdk's src/enterprise.ts
7
+ // that gate it is a material breach of that license.
1
8
  "use strict";
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.describeExecutor = void 0;
4
- var scratch_1 = require("./scratch");
5
- Object.defineProperty(exports, "describeExecutor", { enumerable: true, get: function () { return scratch_1.describeExecutor; } });
10
+ exports.ShardedSystemDatabase = exports.ConductorWebsocket = exports.AutoUpgradePass = void 0;
11
+ var auto_upgrade_1 = require("./auto_upgrade");
12
+ Object.defineProperty(exports, "AutoUpgradePass", { enumerable: true, get: function () { return auto_upgrade_1.AutoUpgradePass; } });
13
+ var conductor_1 = require("./conductor/conductor");
14
+ Object.defineProperty(exports, "ConductorWebsocket", { enumerable: true, get: function () { return conductor_1.ConductorWebsocket; } });
15
+ var sharding_1 = require("./sharding");
16
+ Object.defineProperty(exports, "ShardedSystemDatabase", { enumerable: true, get: function () { return sharding_1.ShardedSystemDatabase; } });
6
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAAlD,2GAAA,gBAAgB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,+CAAiD;AAAxC,+GAAA,eAAe,OAAA;AACxB,mDAA2D;AAAlD,+GAAA,kBAAkB,OAAA;AAC3B,uCAAmD;AAA1C,iHAAA,qBAAqB,OAAA"}
@@ -0,0 +1,20 @@
1
+ // Copyright (c) 2026 DBOS, Inc. All rights reserved.
2
+ //
3
+ // This file is part of Transact Enterprise, proprietary software licensed under the
4
+ // DBOS Conductor Software License: https://www.dbos.dev/conductor-license
5
+ // You may not use, copy, modify, or distribute this file except as that license permits.
6
+ // Disabling or circumventing the entitlement checks in @dbos-inc/dbos-sdk's src/enterprise.ts
7
+ // that gate it is a material breach of that license.
8
+ import type { PoolClient } from 'pg';
9
+ import type { GlobalLogger } from '@dbos-inc/dbos-sdk/internal/telemetry/logs';
10
+ export declare function lockKey(name: string): bigint;
11
+ export interface AdvisoryLock {
12
+ readonly acquired: boolean;
13
+ release(): Promise<boolean>;
14
+ }
15
+ export declare function tryAdvisoryLock(client: PoolClient, key: bigint, options: {
16
+ name: string;
17
+ discard: boolean;
18
+ logger: GlobalLogger;
19
+ }): Promise<AdvisoryLock>;
20
+ //# sourceMappingURL=locks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locks.d.ts","sourceRoot":"","sources":["../../src/locks.ts"],"names":[],"mappings":";;;;;;;AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAG/E,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE5C;AAGD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAE3B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC7B;AAGD,wBAAsB,eAAe,CACnC,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,MAAM,EACX,OAAO,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,YAAY,CAAA;CAAE,GAChE,OAAO,CAAC,YAAY,CAAC,CAsCvB"}
@@ -0,0 +1,47 @@
1
+ // Copyright (c) 2026 DBOS, Inc. All rights reserved.
2
+ //
3
+ // This file is part of Transact Enterprise, proprietary software licensed under the
4
+ // DBOS Conductor Software License: https://www.dbos.dev/conductor-license
5
+ // You may not use, copy, modify, or distribute this file except as that license permits.
6
+ // Disabling or circumventing the entitlement checks in @dbos-inc/dbos-sdk's src/enterprise.ts
7
+ // that gate it is a material breach of that license.
8
+ "use strict";
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.tryAdvisoryLock = exports.lockKey = void 0;
11
+ const system_database_1 = require("@dbos-inc/dbos-sdk/internal/system_database");
12
+ function lockKey(name) {
13
+ return (0, system_database_1.advisoryLockKey)(name);
14
+ }
15
+ exports.lockKey = lockKey;
16
+ async function tryAdvisoryLock(client, key, options) {
17
+ const { rows } = await client.query('SELECT pg_try_advisory_lock($1) AS granted', [
18
+ key.toString(),
19
+ ]);
20
+ const granted = rows.map((row) => row.granted === true);
21
+ const acquired = granted.length > 0 && granted.every((g) => g);
22
+ const { name, discard, logger } = options;
23
+ return {
24
+ acquired,
25
+ release: async () => {
26
+ let closeSession = discard;
27
+ try {
28
+ if (granted.some((g) => g)) {
29
+ const { rows: released } = await client.query('SELECT pg_advisory_unlock($1) AS released', [key.toString()]);
30
+ if (acquired && !released.every((row) => row.released === true)) {
31
+ logger.warn(`Could not release the ${name} lock: this session no longer holds it. ` +
32
+ `${name.charAt(0).toUpperCase()}${name.slice(1)} will not proceed until the lock is released, ` +
33
+ 'which happens when the holding backend closes. A transaction-pooling proxy in front of ' +
34
+ 'Postgres causes this; run DBOS through a session-pooled or direct connection.');
35
+ }
36
+ }
37
+ }
38
+ catch (e) {
39
+ logger.warn(`Could not release the ${name} lock; closing its session instead: ${String(e)}`);
40
+ closeSession = true;
41
+ }
42
+ return closeSession;
43
+ },
44
+ };
45
+ }
46
+ exports.tryAdvisoryLock = tryAdvisoryLock;
47
+ //# sourceMappingURL=locks.js.map
@@ -0,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AAC,IAAI,CACT,yBAAyB,IAAI,0CAA0C;4BACrE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,gDAAgD;4BAC/F,yFAAyF;4BACzF,+EAA+E,CAClF,CAAC;oBACJ,CAAC;gBACH,CAAC;YACH,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBAEX,MAAM,CAAC,IAAI,CAAC,yBAAyB,IAAI,uCAAuC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC7F,YAAY,GAAG,IAAI,CAAC;YACtB,CAAC;YACD,OAAO,YAAY,CAAC;QACtB,CAAC;KACF,CAAC;AACJ,CAAC;AA1CD,0CA0CC"}
@@ -0,0 +1,90 @@
1
+ // Copyright (c) 2026 DBOS, Inc. All rights reserved.
2
+ //
3
+ // This file is part of Transact Enterprise, proprietary software licensed under the
4
+ // DBOS Conductor Software License: https://www.dbos.dev/conductor-license
5
+ // You may not use, copy, modify, or distribute this file except as that license permits.
6
+ // Disabling or circumventing the entitlement checks in @dbos-inc/dbos-sdk's src/enterprise.ts
7
+ // that gate it is a material breach of that license.
8
+ import { type SystemDatabase } from '@dbos-inc/dbos-sdk/internal/system_database';
9
+ export interface MetricData {
10
+ metricType: string;
11
+ metricName: string;
12
+ value: number;
13
+ }
14
+ export interface GetStepAggregatesInput {
15
+ groupByFunctionName?: boolean;
16
+ groupByStatus?: boolean;
17
+ selectCount?: boolean;
18
+ selectMaxDurationMs?: boolean;
19
+ timeBucketSizeMs?: number;
20
+ status?: string[];
21
+ functionName?: string[];
22
+ workflowIdPrefix?: string[];
23
+ completedAfter?: string;
24
+ completedBefore?: string;
25
+ applicationName?: string[];
26
+ }
27
+ export interface GetWorkflowAggregatesInput {
28
+ groupByStatus?: boolean;
29
+ groupByName?: boolean;
30
+ groupByQueueName?: boolean;
31
+ groupByExecutorId?: boolean;
32
+ groupByApplicationVersion?: boolean;
33
+ groupByApplicationName?: boolean;
34
+ selectCount?: boolean;
35
+ selectMinCreatedAt?: boolean;
36
+ selectMaxQueueWaitMs?: boolean;
37
+ selectMaxTotalLatencyMs?: boolean;
38
+ timeBucketSizeMs?: number;
39
+ status?: string[];
40
+ startTime?: string;
41
+ endTime?: string;
42
+ completedAfter?: string;
43
+ completedBefore?: string;
44
+ dequeuedAfter?: string;
45
+ dequeuedBefore?: string;
46
+ name?: string[];
47
+ appVersion?: string[];
48
+ executorId?: string[];
49
+ queueName?: string[];
50
+ workflowIdPrefix?: string[];
51
+ workflowIDs?: string[];
52
+ authenticatedUser?: string[];
53
+ forkedFrom?: string[];
54
+ wasForkedFrom?: boolean;
55
+ isFork?: boolean;
56
+ parentWorkflowID?: string[];
57
+ hasParent?: boolean;
58
+ attributes?: Record<string, unknown>;
59
+ scheduleName?: string[];
60
+ applicationName?: string[];
61
+ }
62
+ export interface StepAggregateRow {
63
+ group: Record<string, string | null>;
64
+ count: number | null;
65
+ maxDurationMs: number | null;
66
+ }
67
+ export interface WorkflowAggregateRow {
68
+ group: Record<string, string | null>;
69
+ count: number | null;
70
+ minCreatedAt: number | null;
71
+ maxQueueWaitMs: number | null;
72
+ maxTotalLatencyMs: number | null;
73
+ }
74
+ export interface GetPendingWorkflowsOutput {
75
+ workflowUUID: string;
76
+ shardKey?: string;
77
+ }
78
+ export declare function getPendingWorkflows(sysdb: SystemDatabase, executorID: string, appVersion: string): Promise<GetPendingWorkflowsOutput[]>;
79
+ export declare function getAllEvents(sysdb: SystemDatabase, workflowID: string): Promise<Record<string, unknown>>;
80
+ export declare function getAllNotifications(sysdb: SystemDatabase, workflowID: string): Promise<{
81
+ topic: string | null;
82
+ message: unknown;
83
+ createdAtEpochMs: number;
84
+ consumed: boolean;
85
+ }[]>;
86
+ export declare function getAllStreamEntries(sysdb: SystemDatabase, workflowID: string): Promise<Record<string, unknown[]>>;
87
+ export declare function getWorkflowAggregates(sysdb: SystemDatabase, input: GetWorkflowAggregatesInput): Promise<WorkflowAggregateRow[]>;
88
+ export declare function getStepAggregates(sysdb: SystemDatabase, input: GetStepAggregatesInput): Promise<StepAggregateRow[]>;
89
+ export declare function getMetrics(sysdb: SystemDatabase, startTime: string, endTime: string, applicationName?: string[]): Promise<MetricData[]>;
90
+ //# sourceMappingURL=observability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"observability.d.ts","sourceRoot":"","sources":["../../src/observability.ts"],"names":[],"mappings":";;;;;;;AAIA,OAAO,EAAuC,KAAK,cAAc,EAAE,MAAM,6CAA6C,CAAC;AAGvH,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,0BAA0B;IACzC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;I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