@dbos-inc/dbos-sdk 4.28.14-preview → 5.0.2
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.
- package/CONTRIBUTING.md +38 -5
- package/README.md +9 -9
- package/dbos-config.schema.json +2 -49
- package/dist/dbos-config.schema.json +2 -49
- package/dist/schemas/system_db_schema.d.ts +0 -12
- package/dist/schemas/system_db_schema.d.ts.map +1 -1
- package/dist/schemas/system_db_schema.js.map +1 -1
- package/dist/src/cli/cli.d.ts +1 -3
- package/dist/src/cli/cli.d.ts.map +1 -1
- package/dist/src/cli/cli.js +9 -36
- package/dist/src/cli/cli.js.map +1 -1
- package/dist/src/client.d.ts +6 -88
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +10 -52
- package/dist/src/client.js.map +1 -1
- package/dist/src/conductor/conductor.d.ts +0 -1
- package/dist/src/conductor/conductor.d.ts.map +1 -1
- package/dist/src/conductor/conductor.js +3 -21
- package/dist/src/conductor/conductor.js.map +1 -1
- package/dist/src/conductor/protocol.d.ts +60 -135
- package/dist/src/conductor/protocol.d.ts.map +1 -1
- package/dist/src/conductor/protocol.js +1 -348
- package/dist/src/conductor/protocol.js.map +1 -1
- package/dist/src/config.d.ts +2 -11
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +17 -68
- package/dist/src/config.js.map +1 -1
- package/dist/src/context.d.ts +0 -5
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js +0 -3
- package/dist/src/context.js.map +1 -1
- package/dist/src/datasource.d.ts +2 -4
- package/dist/src/datasource.d.ts.map +1 -1
- package/dist/src/datasource.js +11 -19
- package/dist/src/datasource.js.map +1 -1
- package/dist/src/dbos-executor.d.ts +9 -21
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +16 -37
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos.d.ts +9 -20
- package/dist/src/dbos.d.ts.map +1 -1
- package/dist/src/dbos.js +58 -75
- package/dist/src/dbos.js.map +1 -1
- package/dist/src/debouncer.d.ts.map +1 -1
- package/dist/src/debouncer.js +11 -15
- package/dist/src/debouncer.js.map +1 -1
- package/dist/src/debugpoint.d.ts +0 -15
- package/dist/src/debugpoint.d.ts.map +1 -1
- package/dist/src/debugpoint.js +6 -38
- package/dist/src/debugpoint.js.map +1 -1
- package/dist/src/decorators.d.ts +3 -26
- package/dist/src/decorators.d.ts.map +1 -1
- package/dist/src/decorators.js +28 -72
- package/dist/src/decorators.js.map +1 -1
- package/dist/src/enqueue_options.d.ts +1 -1
- package/dist/src/enqueue_workflow.js +2 -2
- package/dist/src/enqueue_workflow.js.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/scheduler/crontab.d.ts +0 -1
- package/dist/src/scheduler/crontab.d.ts.map +1 -1
- package/dist/src/scheduler/crontab.js +1 -2
- package/dist/src/scheduler/crontab.js.map +1 -1
- package/dist/src/serialization.d.ts.map +1 -1
- package/dist/src/serialization.js +0 -4
- package/dist/src/serialization.js.map +1 -1
- package/dist/src/sysdb_migrations/migration_runner.d.ts +1 -5
- package/dist/src/sysdb_migrations/migration_runner.d.ts.map +1 -1
- package/dist/src/sysdb_migrations/migration_runner.js +11 -30
- package/dist/src/sysdb_migrations/migration_runner.js.map +1 -1
- package/dist/src/system_database.d.ts +3 -13
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +3 -20
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/telemetry/logs.d.ts +0 -1
- package/dist/src/telemetry/logs.d.ts.map +1 -1
- package/dist/src/telemetry/logs.js +0 -4
- package/dist/src/telemetry/logs.js.map +1 -1
- package/dist/src/telemetry/traces.d.ts +2 -3
- package/dist/src/telemetry/traces.d.ts.map +1 -1
- package/dist/src/telemetry/traces.js +3 -16
- package/dist/src/telemetry/traces.js.map +1 -1
- package/dist/src/utils.d.ts +0 -5
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +2 -17
- package/dist/src/utils.js.map +1 -1
- package/dist/src/workflow.d.ts +6 -21
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js +11 -38
- package/dist/src/workflow.js.map +1 -1
- package/dist/src/workflow_management.d.ts.map +1 -1
- package/dist/src/workflow_management.js +5 -6
- package/dist/src/workflow_management.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -3
|
@@ -693,9 +693,6 @@ class SystemDatabase {
|
|
|
693
693
|
client.release();
|
|
694
694
|
}
|
|
695
695
|
}
|
|
696
|
-
getSerializer() {
|
|
697
|
-
return this.serializer;
|
|
698
|
-
}
|
|
699
696
|
// ==================== Application Ownership ====================
|
|
700
697
|
/**
|
|
701
698
|
* A predicate matching rows owned by these applications plus unclaimed ones, which belong to
|
|
@@ -1260,7 +1257,7 @@ class SystemDatabase {
|
|
|
1260
1257
|
}
|
|
1261
1258
|
// Insert a patchmarker
|
|
1262
1259
|
const dn = Date.now();
|
|
1263
|
-
await this.pool.query(`INSERT INTO ${this.schemaName}.operation_outputs
|
|
1260
|
+
await this.pool.query(`INSERT INTO "${this.schemaName}".operation_outputs
|
|
1264
1261
|
(workflow_uuid, function_id, output, error, function_name, child_workflow_id, started_at_epoch_ms, completed_at_epoch_ms, application_name, retention_timestamp)
|
|
1265
1262
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, (EXTRACT(EPOCH FROM now()) * 1000)::bigint)
|
|
1266
1263
|
ON CONFLICT DO NOTHING;`, [workflowID, functionID, null, null, patchName, null, dn, dn, this.appName ?? null]);
|
|
@@ -1942,11 +1939,9 @@ class SystemDatabase {
|
|
|
1942
1939
|
}
|
|
1943
1940
|
if (this.workflowEventsMap.map.size > 0) {
|
|
1944
1941
|
this.logger.warn('Workflow events map is not empty - shutdown is not clean.');
|
|
1945
|
-
//throw new Error('Workflow events map is not empty - shutdown is not clean.');
|
|
1946
1942
|
}
|
|
1947
1943
|
if (this.notificationsMap.map.size > 0) {
|
|
1948
1944
|
this.logger.warn('Message notification map is not empty - shutdown is not clean.');
|
|
1949
|
-
//throw new Error('Message notification map is not empty - shutdown is not clean.');
|
|
1950
1945
|
}
|
|
1951
1946
|
}
|
|
1952
1947
|
/**
|
|
@@ -1962,11 +1957,6 @@ class SystemDatabase {
|
|
|
1962
1957
|
}
|
|
1963
1958
|
return this.pollLimiter.runExclusive(query);
|
|
1964
1959
|
}
|
|
1965
|
-
/**
|
|
1966
|
-
* Cancellation check for use inside polling wait loops: the status read runs
|
|
1967
|
-
* under the polling limiter so it counts against the same concurrency budget
|
|
1968
|
-
* as the rest of the loop's reads.
|
|
1969
|
-
*/
|
|
1970
1960
|
/** Cancellation check for polling waits: goes through the limiter so readers cannot starve the pool. */
|
|
1971
1961
|
async checkIfCanceledLimited(workflowID) {
|
|
1972
1962
|
await this.#pollWithLimiter(() => this.#checkIfCanceled(this.pool, workflowID));
|
|
@@ -3178,13 +3168,6 @@ class SystemDatabase {
|
|
|
3178
3168
|
// Unset scopes to this application, as on every other observability query.
|
|
3179
3169
|
whereClauses.push(this.#observabilityFilter('application_name', input.applicationName, params));
|
|
3180
3170
|
paramIdx = params.length + 1;
|
|
3181
|
-
// Only workflows that are actively enqueued.
|
|
3182
|
-
if (input.queuesOnly) {
|
|
3183
|
-
whereClauses.push(`queue_name IS NOT NULL`);
|
|
3184
|
-
whereClauses.push(`status IN ($${paramIdx}, $${paramIdx + 1}, $${paramIdx + 2})`);
|
|
3185
|
-
params.push(workflow_1.StatusString.ENQUEUED, workflow_1.StatusString.PENDING, workflow_1.StatusString.DELAYED);
|
|
3186
|
-
paramIdx += 3;
|
|
3187
|
-
}
|
|
3188
3171
|
if (input.wasForkedFrom !== undefined) {
|
|
3189
3172
|
whereClauses.push(`was_forked_from = $${paramIdx}`);
|
|
3190
3173
|
params.push(input.wasForkedFrom);
|
|
@@ -4356,13 +4339,13 @@ class SystemDatabase {
|
|
|
4356
4339
|
const result = await client.query(`UPDATE "${this.schemaName}".workflow_status ${setClause} ${whereClause}`, args);
|
|
4357
4340
|
const throwOnFailure = options.throwOnFailure ?? true;
|
|
4358
4341
|
if (throwOnFailure && result.rowCount !== 1) {
|
|
4359
|
-
throw new error_1.
|
|
4342
|
+
throw new error_1.DBOSNonExistentWorkflowError(`Attempt to record transition of nonexistent workflow ${workflowID}`);
|
|
4360
4343
|
}
|
|
4361
4344
|
return result.rowCount ?? 0;
|
|
4362
4345
|
}
|
|
4363
4346
|
async recordOperationResultInternal(client, workflowID, functionID, functionName, checkConflict, startTimeEpochMs, endTimeEpochMs, options = {}) {
|
|
4364
4347
|
try {
|
|
4365
|
-
const out = await client.query(`INSERT INTO ${this.schemaName}.operation_outputs
|
|
4348
|
+
const out = await client.query(`INSERT INTO "${this.schemaName}".operation_outputs
|
|
4366
4349
|
(workflow_uuid, function_id, output, error, function_name, child_workflow_id, started_at_epoch_ms, completed_at_epoch_ms, serialization, application_name, retention_timestamp)
|
|
4367
4350
|
VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, (EXTRACT(EPOCH FROM now()) * 1000)::bigint)
|
|
4368
4351
|
ON CONFLICT (workflow_uuid, function_id) DO UPDATE
|