@dbos-inc/dbos-sdk 0.7.35 → 0.8.14-preview
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/cloud-cli/applications/configure.d.ts +1 -1
- package/dist/src/cloud-cli/applications/configure.d.ts.map +1 -1
- package/dist/src/cloud-cli/applications/configure.js +35 -28
- package/dist/src/cloud-cli/applications/configure.js.map +1 -1
- package/dist/src/cloud-cli/applications/delete-app.js +1 -1
- package/dist/src/cloud-cli/applications/delete-app.js.map +1 -1
- package/dist/src/cloud-cli/applications/deploy-app-code.d.ts.map +1 -1
- package/dist/src/cloud-cli/applications/deploy-app-code.js +10 -2
- package/dist/src/cloud-cli/applications/deploy-app-code.js.map +1 -1
- package/dist/src/cloud-cli/applications/get-app-logs.js +1 -1
- package/dist/src/cloud-cli/applications/get-app-logs.js.map +1 -1
- package/dist/src/cloud-cli/applications/list-apps.js +1 -1
- package/dist/src/cloud-cli/applications/list-apps.js.map +1 -1
- package/dist/src/cloud-cli/applications/register-app.js +1 -1
- package/dist/src/cloud-cli/applications/register-app.js.map +1 -1
- package/dist/src/cloud-cli/applications/update-app.d.ts.map +1 -1
- package/dist/src/cloud-cli/applications/update-app.js +3 -2
- package/dist/src/cloud-cli/applications/update-app.js.map +1 -1
- package/dist/src/cloud-cli/cli.js +6 -6
- package/dist/src/cloud-cli/cli.js.map +1 -1
- package/dist/src/cloud-cli/login.d.ts.map +1 -1
- package/dist/src/cloud-cli/login.js +3 -2
- package/dist/src/cloud-cli/login.js.map +1 -1
- package/dist/src/cloud-cli/register.js +1 -1
- package/dist/src/cloud-cli/register.js.map +1 -1
- package/dist/src/cloud-cli/userdb.d.ts +10 -2
- package/dist/src/cloud-cli/userdb.d.ts.map +1 -1
- package/dist/src/cloud-cli/userdb.js +63 -100
- package/dist/src/cloud-cli/userdb.js.map +1 -1
- package/dist/src/communicator.d.ts +1 -1
- package/dist/src/communicator.d.ts.map +1 -1
- package/dist/src/context.d.ts +1 -1
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js +1 -1
- package/dist/src/context.js.map +1 -1
- package/dist/src/dbos-executor.d.ts +18 -7
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +155 -52
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos-runtime/cli.d.ts +0 -1
- package/dist/src/dbos-runtime/cli.d.ts.map +1 -1
- package/dist/src/dbos-runtime/cli.js +14 -2
- package/dist/src/dbos-runtime/cli.js.map +1 -1
- package/dist/src/dbos-runtime/config.d.ts +0 -1
- package/dist/src/dbos-runtime/config.d.ts.map +1 -1
- package/dist/src/dbos-runtime/config.js +0 -1
- package/dist/src/dbos-runtime/config.js.map +1 -1
- package/dist/src/dbos-runtime/debug.d.ts +4 -0
- package/dist/src/dbos-runtime/debug.d.ts.map +1 -0
- package/dist/src/dbos-runtime/debug.js +23 -0
- package/dist/src/dbos-runtime/debug.js.map +1 -0
- package/dist/src/dbos-runtime/runtime.d.ts +1 -1
- package/dist/src/dbos-runtime/runtime.d.ts.map +1 -1
- package/dist/src/dbos-runtime/runtime.js +13 -14
- package/dist/src/dbos-runtime/runtime.js.map +1 -1
- package/dist/src/debugger/debug_workflow.js +6 -6
- package/dist/src/debugger/debug_workflow.js.map +1 -1
- package/dist/src/httpServer/server.d.ts +1 -1
- package/dist/src/httpServer/server.d.ts.map +1 -1
- package/dist/src/{dbos-runtime → staticAnalysis}/TypeParser.d.ts +4 -0
- package/dist/src/staticAnalysis/TypeParser.d.ts.map +1 -0
- package/dist/src/{dbos-runtime → staticAnalysis}/TypeParser.js +34 -1
- package/dist/src/staticAnalysis/TypeParser.js.map +1 -0
- package/dist/src/{dbos-runtime → staticAnalysis}/openApi.d.ts.map +1 -1
- package/dist/src/{dbos-runtime → staticAnalysis}/openApi.js +1 -31
- package/dist/src/staticAnalysis/openApi.js.map +1 -0
- package/dist/src/staticAnalysis/tsDiagUtil.d.ts.map +1 -0
- package/dist/src/staticAnalysis/tsDiagUtil.js.map +1 -0
- package/dist/src/system_database.d.ts +20 -9
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +36 -41
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/telemetry/collector.d.ts +5 -5
- package/dist/src/telemetry/collector.d.ts.map +1 -1
- package/dist/src/telemetry/collector.js +5 -17
- package/dist/src/telemetry/collector.js.map +1 -1
- package/dist/src/telemetry/exporters.d.ts +11 -24
- package/dist/src/telemetry/exporters.d.ts.map +1 -1
- package/dist/src/telemetry/exporters.js +42 -129
- package/dist/src/telemetry/exporters.js.map +1 -1
- package/dist/src/telemetry/index.d.ts +6 -2
- package/dist/src/telemetry/index.d.ts.map +1 -1
- package/dist/src/telemetry/index.js +16 -0
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/logs.d.ts +35 -11
- package/dist/src/telemetry/logs.d.ts.map +1 -1
- package/dist/src/telemetry/logs.js +158 -53
- package/dist/src/telemetry/logs.js.map +1 -1
- package/dist/src/telemetry/traces.d.ts +1 -6
- package/dist/src/telemetry/traces.d.ts.map +1 -1
- package/dist/src/telemetry/traces.js +2 -34
- package/dist/src/telemetry/traces.js.map +1 -1
- package/dist/src/testing/testing_runtime.d.ts +1 -1
- package/dist/src/testing/testing_runtime.js +1 -1
- package/dist/src/transaction.d.ts +1 -1
- package/dist/src/transaction.d.ts.map +1 -1
- package/dist/src/workflow.d.ts +2 -0
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js +18 -13
- package/dist/src/workflow.js.map +1 -1
- package/examples/hello/dbos-config.yaml +0 -1
- package/package.json +3 -2
- package/dist/src/dbos-runtime/TypeParser.d.ts.map +0 -1
- package/dist/src/dbos-runtime/TypeParser.js.map +0 -1
- package/dist/src/dbos-runtime/openApi.js.map +0 -1
- package/dist/src/dbos-runtime/tsDiagUtil.d.ts.map +0 -1
- package/dist/src/dbos-runtime/tsDiagUtil.js.map +0 -1
- package/dist/src/telemetry/signals.d.ts +0 -20
- package/dist/src/telemetry/signals.d.ts.map +0 -1
- package/dist/src/telemetry/signals.js +0 -11
- package/dist/src/telemetry/signals.js.map +0 -1
- /package/dist/src/{dbos-runtime → staticAnalysis}/openApi.d.ts +0 -0
- /package/dist/src/{dbos-runtime → staticAnalysis}/tsDiagUtil.d.ts +0 -0
- /package/dist/src/{dbos-runtime → staticAnalysis}/tsDiagUtil.js +0 -0
@@ -3,15 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.
|
6
|
+
exports.getUserDBInfo = exports.rollbackMigration = exports.migrate = exports.getUserDb = exports.deleteUserDb = exports.createUserDb = void 0;
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
8
8
|
const logs_1 = require("../telemetry/logs");
|
9
9
|
const utils_1 = require("./utils");
|
10
10
|
const utils_2 = require("../utils");
|
11
11
|
const config_1 = require("../dbos-runtime/config");
|
12
12
|
const child_process_1 = require("child_process");
|
13
|
+
const user_database_1 = require("../user_database");
|
13
14
|
async function createUserDb(host, port, dbName, adminName, adminPassword, sync) {
|
14
|
-
const logger =
|
15
|
+
const logger = new logs_1.GlobalLogger();
|
15
16
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
16
17
|
const bearerToken = "Bearer " + userCredentials.token;
|
17
18
|
try {
|
@@ -24,30 +25,12 @@ async function createUserDb(host, port, dbName, adminName, adminPassword, sync)
|
|
24
25
|
logger.info(`Successfully started creating database: ${dbName}`);
|
25
26
|
if (sync) {
|
26
27
|
let status = "";
|
27
|
-
let data;
|
28
28
|
while (status != "available") {
|
29
|
-
await (0, utils_2.sleep)(
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
logger.info(data);
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
35
|
-
status = data.Status;
|
29
|
+
await (0, utils_2.sleep)(30000);
|
30
|
+
const userDBInfo = await getUserDBInfo(host, port, dbName);
|
31
|
+
logger.info(userDBInfo);
|
32
|
+
status = userDBInfo.Status;
|
36
33
|
}
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
38
|
-
const dbhostname = data.HostName;
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
40
|
-
const dbport = data.Port;
|
41
|
-
// Update the clouddb info record
|
42
|
-
logger.info("Saving db state to cloud db");
|
43
|
-
await axios_1.default.put(`http://${host}:${port}/${userCredentials.userName}/databases/userdb/info`,
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
45
|
-
{ DBName: dbName, Status: status, HostName: dbhostname, Port: dbport }, {
|
46
|
-
headers: {
|
47
|
-
"Content-Type": "application/json",
|
48
|
-
Authorization: bearerToken,
|
49
|
-
},
|
50
|
-
});
|
51
34
|
}
|
52
35
|
}
|
53
36
|
catch (e) {
|
@@ -60,8 +43,8 @@ async function createUserDb(host, port, dbName, adminName, adminPassword, sync)
|
|
60
43
|
}
|
61
44
|
}
|
62
45
|
exports.createUserDb = createUserDb;
|
63
|
-
async function deleteUserDb(host, port, dbName
|
64
|
-
const logger =
|
46
|
+
async function deleteUserDb(host, port, dbName) {
|
47
|
+
const logger = new logs_1.GlobalLogger();
|
65
48
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
66
49
|
const bearerToken = "Bearer " + userCredentials.token;
|
67
50
|
try {
|
@@ -71,36 +54,7 @@ async function deleteUserDb(host, port, dbName, sync) {
|
|
71
54
|
Authorization: bearerToken,
|
72
55
|
},
|
73
56
|
});
|
74
|
-
logger.info(`
|
75
|
-
if (sync) {
|
76
|
-
let status = "deleting";
|
77
|
-
while (status == "deleting") {
|
78
|
-
await (0, utils_2.sleep)(60000);
|
79
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
80
|
-
let data;
|
81
|
-
try {
|
82
|
-
// HACK to exit gracefully because the get throws an exception on 500
|
83
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
84
|
-
data = await getDb(host, port, dbName);
|
85
|
-
}
|
86
|
-
catch (e) {
|
87
|
-
logger.info(`Deleted database: ${dbName}`);
|
88
|
-
break;
|
89
|
-
}
|
90
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
91
|
-
logger.info(data);
|
92
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
93
|
-
status = data.Status;
|
94
|
-
}
|
95
|
-
// Update the clouddb info record
|
96
|
-
logger.info("Saving db state to cloud db");
|
97
|
-
await axios_1.default.put(`http://${host}:${port}/${userCredentials.userName}/databases/userdb/info`, { Name: dbName, Status: "deleted", HostName: "", Port: 0 }, {
|
98
|
-
headers: {
|
99
|
-
"Content-Type": "application/json",
|
100
|
-
Authorization: bearerToken,
|
101
|
-
},
|
102
|
-
});
|
103
|
-
}
|
57
|
+
logger.info(`Database deleted: ${dbName}`);
|
104
58
|
}
|
105
59
|
catch (e) {
|
106
60
|
if (axios_1.default.isAxiosError(e) && e.response) {
|
@@ -113,11 +67,10 @@ async function deleteUserDb(host, port, dbName, sync) {
|
|
113
67
|
}
|
114
68
|
exports.deleteUserDb = deleteUserDb;
|
115
69
|
async function getUserDb(host, port, dbName) {
|
116
|
-
const logger =
|
70
|
+
const logger = new logs_1.GlobalLogger();
|
117
71
|
try {
|
118
|
-
|
119
|
-
|
120
|
-
logger.info(res);
|
72
|
+
const userDBInfo = await getUserDBInfo(host, port, dbName);
|
73
|
+
logger.info(userDBInfo);
|
121
74
|
}
|
122
75
|
catch (e) {
|
123
76
|
if (axios_1.default.isAxiosError(e) && e.response) {
|
@@ -130,51 +83,68 @@ async function getUserDb(host, port, dbName) {
|
|
130
83
|
}
|
131
84
|
exports.getUserDb = getUserDb;
|
132
85
|
function migrate() {
|
133
|
-
const logger =
|
134
|
-
//
|
86
|
+
const logger = new logs_1.GlobalLogger();
|
87
|
+
// Read the configuration YAML file
|
135
88
|
const configFile = (0, config_1.loadConfigFile)(config_1.dbosConfigFilePath);
|
136
89
|
if (!configFile) {
|
137
|
-
logger.error(`
|
90
|
+
logger.error(`Failed to parse ${config_1.dbosConfigFilePath}`);
|
138
91
|
return 1;
|
139
92
|
}
|
140
|
-
|
141
|
-
if
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
const cmd = `createdb -h ${configFile.database.hostname} -p ${configFile.database.port} ${userdbname} -U ${configFile.database.username} -w ${configFile.database.password} -e`;
|
148
|
-
logger.info(cmd);
|
149
|
-
try {
|
150
|
-
(0, child_process_1.execSync)(cmd);
|
93
|
+
const userDBName = configFile.database.user_database;
|
94
|
+
logger.info(`Creating database ${userDBName} if it does not already exist`);
|
95
|
+
const createDB = `PGPASSWORD=${configFile.database.password} createdb -h ${configFile.database.hostname} -p ${configFile.database.port} ${userDBName} -U ${configFile.database.username} -ew ${userDBName}`;
|
96
|
+
try {
|
97
|
+
const createDBOutput = (0, child_process_1.execSync)(createDB).toString();
|
98
|
+
if (createDBOutput.includes(`database "${userDBName}" already exists`)) {
|
99
|
+
logger.info(`Database ${userDBName} already exists`);
|
151
100
|
}
|
152
|
-
|
153
|
-
logger.
|
154
|
-
return 1;
|
101
|
+
else {
|
102
|
+
logger.info(createDBOutput);
|
155
103
|
}
|
156
104
|
}
|
157
|
-
|
158
|
-
|
159
|
-
|
105
|
+
catch (e) {
|
106
|
+
if (e instanceof Error) {
|
107
|
+
logger.error(`Error creating database: ${e.message}`);
|
108
|
+
}
|
160
109
|
}
|
161
|
-
const
|
110
|
+
const dbType = configFile.database.user_dbclient || user_database_1.UserDatabaseName.KNEX;
|
111
|
+
const migrationScript = `node_modules/.bin/${dbType}`;
|
112
|
+
const migrationCommands = configFile.database.migrate;
|
162
113
|
try {
|
163
|
-
|
164
|
-
const command =
|
165
|
-
logger.info(
|
166
|
-
(0, child_process_1.execSync)(command);
|
114
|
+
migrationCommands?.forEach((cmd) => {
|
115
|
+
const command = `node ${migrationScript} ${cmd}`;
|
116
|
+
logger.info(`Executing migration command: ${command}`);
|
117
|
+
const migrateCommandOutput = (0, child_process_1.execSync)(command).toString();
|
118
|
+
logger.info(migrateCommandOutput);
|
167
119
|
});
|
168
120
|
}
|
169
121
|
catch (e) {
|
170
|
-
logger.error("Error running migration
|
122
|
+
logger.error("Error running migration");
|
123
|
+
if (e instanceof Error) {
|
124
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
125
|
+
const stderr = e.stderr;
|
126
|
+
if (stderr && Buffer.isBuffer(stderr) && stderr.length > 0) {
|
127
|
+
logger.error(`Standard Error: ${stderr.toString().trim()}`);
|
128
|
+
}
|
129
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
130
|
+
const stdout = e.stdout;
|
131
|
+
if (stdout && Buffer.isBuffer(stdout) && stdout.length > 0) {
|
132
|
+
logger.error(`Standard Output: ${stdout.toString().trim()}`);
|
133
|
+
}
|
134
|
+
if (e.message) {
|
135
|
+
logger.error(e.message);
|
136
|
+
}
|
137
|
+
}
|
138
|
+
else {
|
139
|
+
logger.error(e);
|
140
|
+
}
|
171
141
|
return 1;
|
172
142
|
}
|
173
143
|
return 0;
|
174
144
|
}
|
175
145
|
exports.migrate = migrate;
|
176
|
-
function
|
177
|
-
const logger =
|
146
|
+
function rollbackMigration() {
|
147
|
+
const logger = new logs_1.GlobalLogger();
|
178
148
|
// read the yaml file
|
179
149
|
const configFile = (0, config_1.loadConfigFile)(config_1.dbosConfigFilePath);
|
180
150
|
if (!configFile) {
|
@@ -199,24 +169,17 @@ function rollbackmigration() {
|
|
199
169
|
}
|
200
170
|
return 0;
|
201
171
|
}
|
202
|
-
exports.
|
203
|
-
|
204
|
-
async function getDb(host, port, dbName) {
|
172
|
+
exports.rollbackMigration = rollbackMigration;
|
173
|
+
async function getUserDBInfo(host, port, dbName) {
|
205
174
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
206
175
|
const bearerToken = "Bearer " + userCredentials.token;
|
207
|
-
const res = await axios_1.default.get(`http://${host}:${port}/${userCredentials.userName}/databases/userdb/${dbName}`, {
|
176
|
+
const res = await axios_1.default.get(`http://${host}:${port}/${userCredentials.userName}/databases/userdb/info/${dbName}`, {
|
208
177
|
headers: {
|
209
178
|
"Content-Type": "application/json",
|
210
179
|
Authorization: bearerToken,
|
211
180
|
},
|
212
181
|
});
|
213
|
-
|
214
|
-
if (res.status == axios_1.default.HttpStatusCode.Ok) {
|
215
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
216
|
-
return res.data;
|
217
|
-
}
|
218
|
-
else {
|
219
|
-
return { Status: "notfound" };
|
220
|
-
}
|
182
|
+
return res.data;
|
221
183
|
}
|
184
|
+
exports.getUserDBInfo = getUserDBInfo;
|
222
185
|
//# sourceMappingURL=userdb.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"userdb.js","sourceRoot":"","sources":["../../../src/cloud-cli/userdb.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,
|
1
|
+
{"version":3,"file":"userdb.js","sourceRoot":"","sources":["../../../src/cloud-cli/userdb.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAiD;AACjD,mCAA8C;AAC9C,oCAAiC;AACjC,mDAAwF;AACxF,iDAAyC;AACzC,oDAAoD;AAU7C,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,IAAY,EAAE,MAAc,EAAE,SAAiB,EAAE,aAAqB,EAAE,IAAa;IACpI,MAAM,MAAM,GAAG,IAAI,mBAAY,EAAE,CAAC;IAClC,MAAM,eAAe,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK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I,eAAe,CAAC,QAAQ,0BAA0B,MAAM,EAAE,EAAE;QAChH,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,WAAW;SAC3B;KACF,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC,IAAsB,CAAC;AACpC,CAAC;AAZD,sCAYC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Span } from "@opentelemetry/sdk-trace-base";
|
2
|
-
import {
|
2
|
+
import { GlobalLogger as Logger } from "./telemetry/logs";
|
3
3
|
import { WorkflowContextImpl } from "./workflow";
|
4
4
|
import { DBOSContext, DBOSContextImpl } from "./context";
|
5
5
|
import { WorkflowContextDebug } from "./debugger/debug_workflow";
|
@@ -1 +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,
|
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,YAAY,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAGjE,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;IACzF,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,GAAG,oBAAoB,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM;CAYtK"}
|
package/dist/src/context.d.ts
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
/// <reference types="node" />
|
2
2
|
/// <reference types="node" />
|
3
3
|
import { Span } from "@opentelemetry/sdk-trace-base";
|
4
|
-
import {
|
4
|
+
import { GlobalLogger as Logger, Logger as DBOSLogger } from "./telemetry/logs";
|
5
5
|
import { IncomingHttpHeaders } from "http";
|
6
6
|
import { ParsedUrlQuery } from "querystring";
|
7
7
|
import { DBOSExecutor } from "./dbos-executor";
|
@@ -1 +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,
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,C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AG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC;CAmB9C"}
|
package/dist/src/context.js
CHANGED
@@ -16,7 +16,6 @@ class DBOSContextImpl {
|
|
16
16
|
constructor(operationName, span, logger, parentCtx) {
|
17
17
|
this.operationName = operationName;
|
18
18
|
this.span = span;
|
19
|
-
this.logger = new logs_1.Logger(logger, this);
|
20
19
|
if (parentCtx) {
|
21
20
|
this.request = parentCtx.request;
|
22
21
|
this.authenticatedUser = parentCtx.authenticatedUser;
|
@@ -24,6 +23,7 @@ class DBOSContextImpl {
|
|
24
23
|
this.assumedRole = parentCtx.assumedRole;
|
25
24
|
this.workflowUUID = parentCtx.workflowUUID;
|
26
25
|
}
|
26
|
+
this.logger = new logs_1.Logger(logger, this);
|
27
27
|
}
|
28
28
|
/*** Application configuration ***/
|
29
29
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
package/dist/src/context.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":";;;AACA,
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":";;;AACA,2CAAgF;AAChF,mCAAkC;AAKlC,mCAAiD;AA8BjD,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,SAAS,EAAE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;QAC9B,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC,YAAY,CAAC;QAC1C,mEAAmE;QACnE,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,WAAW,CAAC;IACjD,CAAC;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,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QACzD,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"}
|
@@ -4,7 +4,7 @@ import { Transaction, TransactionConfig } from './transaction';
|
|
4
4
|
import { CommunicatorConfig, Communicator } from './communicator';
|
5
5
|
import { TelemetryCollector } from './telemetry/collector';
|
6
6
|
import { Tracer } from './telemetry/traces';
|
7
|
-
import {
|
7
|
+
import { GlobalLogger as Logger } from './telemetry/logs';
|
8
8
|
import { TelemetryConfig } from './telemetry';
|
9
9
|
import { PoolConfig } from 'pg';
|
10
10
|
import { SystemDatabase } from './system_database';
|
@@ -13,6 +13,7 @@ import { MethodRegistrationBase } from './decorators';
|
|
13
13
|
export interface DBOSNull {
|
14
14
|
}
|
15
15
|
export declare const dbosNull: DBOSNull;
|
16
|
+
export declare const DBOSExecutorIDHeader = "dbos-executor-id";
|
16
17
|
export interface DBOSConfig {
|
17
18
|
readonly poolConfig: PoolConfig;
|
18
19
|
readonly userDbclient?: UserDatabaseName;
|
@@ -23,20 +24,28 @@ export interface DBOSConfig {
|
|
23
24
|
readonly dbClientMetadata?: any;
|
24
25
|
readonly debugProxy?: string;
|
25
26
|
}
|
26
|
-
interface WorkflowInfo
|
27
|
-
workflow: Workflow<
|
27
|
+
interface WorkflowInfo {
|
28
|
+
workflow: Workflow<any, any>;
|
28
29
|
config: WorkflowConfig;
|
29
30
|
}
|
31
|
+
interface TransactionInfo {
|
32
|
+
transaction: Transaction<any, any>;
|
33
|
+
config: TransactionConfig;
|
34
|
+
}
|
35
|
+
interface CommunicatorInfo {
|
36
|
+
communicator: Communicator<any, any>;
|
37
|
+
config: CommunicatorConfig;
|
38
|
+
}
|
30
39
|
export declare class DBOSExecutor {
|
31
40
|
#private;
|
32
41
|
readonly config: DBOSConfig;
|
33
42
|
initialized: boolean;
|
34
43
|
userDatabase: UserDatabase;
|
35
44
|
readonly systemDatabase: SystemDatabase;
|
36
|
-
readonly tempWorkflowName = "temp_workflow";
|
37
|
-
readonly workflowInfoMap: Map<string, WorkflowInfo
|
38
|
-
readonly
|
39
|
-
readonly
|
45
|
+
static readonly tempWorkflowName = "temp_workflow";
|
46
|
+
readonly workflowInfoMap: Map<string, WorkflowInfo>;
|
47
|
+
readonly transactionInfoMap: Map<string, TransactionInfo>;
|
48
|
+
readonly communicatorInfoMap: Map<string, CommunicatorInfo>;
|
40
49
|
readonly registeredOperations: Array<MethodRegistrationBase>;
|
41
50
|
readonly pendingWorkflowMap: Map<string, Promise<unknown>>;
|
42
51
|
readonly pendingAsyncWrites: Map<string, Promise<unknown>>;
|
@@ -45,6 +54,7 @@ export declare class DBOSExecutor {
|
|
45
54
|
readonly flushBufferID: NodeJS.Timeout;
|
46
55
|
static readonly defaultNotificationTimeoutSec = 60;
|
47
56
|
readonly debugMode: boolean;
|
57
|
+
static systemDBSchemaName: string;
|
48
58
|
readonly logger: Logger;
|
49
59
|
readonly tracer: Tracer;
|
50
60
|
entities: Function[];
|
@@ -74,6 +84,7 @@ export declare class DBOSExecutor {
|
|
74
84
|
* It runs to completion all pending workflows that were executing when the previous executor failed.
|
75
85
|
*/
|
76
86
|
recoverPendingWorkflows(executorIDs?: string[]): Promise<WorkflowHandle<any>[]>;
|
87
|
+
executeWorkflowUUID(workflowUUID: string): Promise<WorkflowHandle<unknown>>;
|
77
88
|
/**
|
78
89
|
* Periodically flush the workflow output buffer to the system database.
|
79
90
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dbos-executor.d.ts","sourceRoot":"","sources":["../../src/dbos-executor.ts"],"names":[],"mappings":";AAQA,OAAO,EAEL,QAAQ,EACR,cAAc,EAEd,cAAc,EACd,cAAc,
|
1
|
+
{"version":3,"file":"dbos-executor.d.ts","sourceRoot":"","sources":["../../src/dbos-executor.ts"],"names":[],"mappings":";AAQA,OAAO,EAEL,QAAQ,EACR,cAAc,EAEd,cAAc,EACd,cAAc,EAKf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAkB,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,YAAY,IAAI,MAAM,EAAE,MAAM,kBAA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