@dbos-inc/dbos-sdk 0.7.21-preview → 0.7.35
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/cloud-cli/applications/deploy-app-code.d.ts.map +1 -1
- package/dist/src/cloud-cli/applications/deploy-app-code.js +1 -0
- package/dist/src/cloud-cli/applications/deploy-app-code.js.map +1 -1
- package/dist/src/cloud-cli/cli.js +19 -7
- package/dist/src/cloud-cli/cli.js.map +1 -1
- package/dist/src/cloud-cli/userdb.d.ts +2 -0
- package/dist/src/cloud-cli/userdb.d.ts.map +1 -1
- package/dist/src/cloud-cli/userdb.js +78 -5
- package/dist/src/cloud-cli/userdb.js.map +1 -1
- package/dist/src/communicator.d.ts +2 -1
- package/dist/src/communicator.d.ts.map +1 -1
- package/dist/src/communicator.js.map +1 -1
- package/dist/src/context.d.ts +3 -2
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js +7 -7
- package/dist/src/context.js.map +1 -1
- package/dist/src/dbos-executor.d.ts +7 -1
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +110 -35
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos-runtime/cli.d.ts +1 -0
- package/dist/src/dbos-runtime/cli.d.ts.map +1 -1
- package/dist/src/dbos-runtime/cli.js +1 -0
- package/dist/src/dbos-runtime/cli.js.map +1 -1
- package/dist/src/dbos-runtime/config.d.ts +3 -0
- package/dist/src/dbos-runtime/config.d.ts.map +1 -1
- package/dist/src/dbos-runtime/config.js +1 -0
- package/dist/src/dbos-runtime/config.js.map +1 -1
- 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 +9 -9
- package/dist/src/dbos-runtime/runtime.js.map +1 -1
- package/dist/src/debugger/debug_workflow.d.ts +38 -0
- package/dist/src/debugger/debug_workflow.d.ts.map +1 -0
- package/dist/src/debugger/debug_workflow.js +192 -0
- package/dist/src/debugger/debug_workflow.js.map +1 -0
- package/dist/src/error.d.ts +3 -0
- package/dist/src/error.d.ts.map +1 -1
- package/dist/src/error.js +8 -1
- package/dist/src/error.js.map +1 -1
- package/dist/src/httpServer/handler.d.ts +2 -1
- package/dist/src/httpServer/handler.d.ts.map +1 -1
- package/dist/src/httpServer/handler.js +27 -15
- package/dist/src/httpServer/handler.js.map +1 -1
- package/dist/src/httpServer/server.d.ts +3 -3
- package/dist/src/httpServer/server.d.ts.map +1 -1
- package/dist/src/httpServer/server.js +19 -17
- package/dist/src/httpServer/server.js.map +1 -1
- package/dist/src/system_database.d.ts +2 -0
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +9 -2
- package/dist/src/system_database.js.map +1 -1
- package/dist/src/telemetry/collector.d.ts +2 -2
- package/dist/src/telemetry/collector.d.ts.map +1 -1
- package/dist/src/telemetry/collector.js.map +1 -1
- package/dist/src/telemetry/exporters.d.ts +5 -6
- package/dist/src/telemetry/exporters.d.ts.map +1 -1
- package/dist/src/telemetry/exporters.js +2 -42
- package/dist/src/telemetry/exporters.js.map +1 -1
- package/dist/src/telemetry/signals.d.ts +0 -10
- package/dist/src/telemetry/signals.d.ts.map +1 -1
- package/dist/src/telemetry/signals.js.map +1 -1
- package/dist/src/testing/testing_runtime.d.ts.map +1 -1
- package/dist/src/testing/testing_runtime.js +7 -1
- package/dist/src/testing/testing_runtime.js.map +1 -1
- package/dist/src/transaction.d.ts +2 -1
- package/dist/src/transaction.d.ts.map +1 -1
- package/dist/src/transaction.js.map +1 -1
- package/dist/src/workflow.d.ts +15 -2
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js +92 -56
- package/dist/src/workflow.js.map +1 -1
- package/examples/hello/README.md +1 -1
- package/examples/hello/dbos-config.yaml +3 -0
- package/package.json +2 -2
- package/dist/src/provenance/provenance_daemon.d.ts +0 -34
- package/dist/src/provenance/provenance_daemon.d.ts.map +0 -1
- package/dist/src/provenance/provenance_daemon.js +0 -86
- package/dist/src/provenance/provenance_daemon.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deploy-app-code.d.ts","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/deploy-app-code.ts"],"names":[],"mappings":"AAWA,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,
|
1
|
+
{"version":3,"file":"deploy-app-code.d.ts","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/deploy-app-code.ts"],"names":[],"mappings":"AAWA,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqDhG"}
|
@@ -34,6 +34,7 @@ async function deployAppCode(appName, host, port) {
|
|
34
34
|
logger.error(`failed to write ${config_1.dbosConfigFilePath}: ${e.message}`);
|
35
35
|
return 1;
|
36
36
|
}
|
37
|
+
(0, child_process_1.execSync)(`npm prune --production node_modules/* `);
|
37
38
|
(0, child_process_1.execSync)(`zip -ry ${deployDirectoryName}/${appName}.zip ./* -x ${deployDirectoryName}/* ${config_1.dbosConfigFilePath} > /dev/null`);
|
38
39
|
(0, child_process_1.execSync)(`zip -j ${deployDirectoryName}/${appName}.zip ${deployDirectoryName}/${config_1.dbosConfigFilePath} > /dev/null`);
|
39
40
|
const zipData = (0, utils_2.readFileSync)(`${deployDirectoryName}/${appName}.zip`, "base64");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deploy-app-code.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/deploy-app-code.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,iDAAyC;AACzC,4CAAoB;AACpB,+CAA0D;AAC1D,oCAA+C;AAC/C,uCAA4D;AAC5D,sDAA2F;AAE3F,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEnC,KAAK,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AU,IAAI,IAAI,IAAI,IAAI,eAAe,CAAC,QAAQ,gBAAgB,OAAO,EAAE,EAC1F;YACE,mBAAmB,EAAE,OAAO;YACnC,mBAAmB,EAAE,OAAO;SACtB,EACD;YACE,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,WAAW;aAC3B;SACF,CACF,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,yBAAyB,OAAO,iBAAiB,OAAO,EAAE,CAAC,CAAC;QACxE,OAAO,CAAC,CAAC;KACV;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,eAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;YACvC,MAAM,CAAC,KAAK,CAAC,gCAAgC,OAAO,KAAK,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7E,OAAO,CAAC,CAAC;SACV;aAAM;YACL,MAAM,CAAC,KAAK,CAAC,gCAAgC,OAAO,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;YACjF,OAAO,CAAC,CAAC;SACV;KACF;AACH,CAAC;
|
1
|
+
{"version":3,"file":"deploy-app-code.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/deploy-app-code.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gDAAwB;AACxB,iDAAyC;AACzC,4CAAoB;AACpB,+CAA0D;AAC1D,oCAA+C;AAC/C,uCAA4D;AAC5D,sDAA2F;AAE3F,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEnC,KAAK,UAAU,aAAa,CAAC,OAAe,EAAE,IAAY,EAAE,IAAY;IAC7E,MAAM,MAAM,GAAG,IAAA,yBAAkB,GAAE,CAAC;IACpC,MAAM,eAAe,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,IAAI;QACF,IAAA,uBAAe,EAAC,mBAA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AC3B;SACF,CACF,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,yBAAyB,OAAO,iBAAiB,OAAO,EAAE,CAAC,CAAC;QACxE,OAAO,CAAC,CAAC;KACV;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,eAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;YACvC,MAAM,CAAC,KAAK,CAAC,gCAAgC,OAAO,KAAK,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7E,OAAO,CAAC,CAAC;SACV;aAAM;YACL,MAAM,CAAC,KAAK,CAAC,gCAAgC,OAAO,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;YACjF,OAAO,CAAC,CAAC;SACV;KACF;AACH,CAAC;AArDD,sCAqDC"}
|
@@ -115,36 +115,48 @@ applicationCommands
|
|
115
115
|
//////////////////////////////
|
116
116
|
/* USER DATABASE MANAGEMENT */
|
117
117
|
//////////////////////////////
|
118
|
-
const
|
118
|
+
const userdbCommands = program
|
119
119
|
.command('userdb')
|
120
120
|
.description('Manage your databases')
|
121
121
|
.option('-h, --host <string>', 'Specify the host', DEFAULT_HOST)
|
122
122
|
.option('-p, --port <string>', 'Specify the port', DEFAULT_PORT);
|
123
|
-
|
123
|
+
userdbCommands
|
124
124
|
.command('create')
|
125
125
|
.argument('<string>', 'database name')
|
126
126
|
.option('-a, --admin <string>', 'Specify the admin user', 'postgres')
|
127
127
|
.option('-W, --password <string>', 'Specify the admin password', 'postgres')
|
128
128
|
.option('-s, --sync', 'make synchronous call', false)
|
129
129
|
.action((async (dbname, options) => {
|
130
|
-
const { host, port } =
|
130
|
+
const { host, port } = userdbCommands.opts();
|
131
131
|
await (0, userdb_1.createUserDb)(host, port, dbname, options.admin, options.password, options.sync);
|
132
132
|
}));
|
133
|
-
|
133
|
+
userdbCommands
|
134
134
|
.command('status')
|
135
135
|
.argument('<string>', 'database name')
|
136
136
|
.action((async (dbname) => {
|
137
|
-
const { host, port } =
|
137
|
+
const { host, port } = userdbCommands.opts();
|
138
138
|
await (0, userdb_1.getUserDb)(host, port, dbname);
|
139
139
|
}));
|
140
|
-
|
140
|
+
userdbCommands
|
141
141
|
.command('delete')
|
142
142
|
.argument('<string>', 'database name')
|
143
143
|
.option('-s, --sync', 'make synchronous call', false)
|
144
144
|
.action((async (dbname, options) => {
|
145
|
-
const { host, port } =
|
145
|
+
const { host, port } = userdbCommands.opts();
|
146
146
|
await (0, userdb_1.deleteUserDb)(host, port, dbname, options.sync);
|
147
147
|
}));
|
148
|
+
userdbCommands
|
149
|
+
.command('migrate')
|
150
|
+
.action((() => {
|
151
|
+
const exitCode = (0, userdb_1.migrate)();
|
152
|
+
process.exit(exitCode);
|
153
|
+
}));
|
154
|
+
userdbCommands
|
155
|
+
.command('rollbackmigration')
|
156
|
+
.action((() => {
|
157
|
+
const exitCode = (0, userdb_1.rollbackmigration)();
|
158
|
+
process.exit(exitCode);
|
159
|
+
}));
|
148
160
|
program.parse(process.argv);
|
149
161
|
// If no arguments provided, display help by default
|
150
162
|
if (!process.argv.slice(2).length) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/cloud-cli/cli.ts"],"names":[],"mappings":";;;AAEA,kDAQyB;AACzB,yCAAoC;AACpC,mCAAgC;AAChC,yCAA0C;AAC1C,
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/cloud-cli/cli.ts"],"names":[],"mappings":";;;AAEA,kDAQyB;AACzB,yCAAoC;AACpC,mCAAgC;AAChC,yCAA0C;AAC1C,qCAA6F;AAC7F,mCAA2C;AAE3C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,MAAM,YAAY,GAAG,WAAW,CAAA;AAChC,MAAM,YAAY,GAAG,MAAM,CAAA;AAE3B,8DAA8D;AAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAwB,CAAC;AAC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AC,CAAC,GAAG,EAAE;IACZ,MAAM,QAAQ,GAAG,IAAA,gBAAO,GAAE,CAAC;IAC3B,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC,CAAA;AAEL,cAAc;KACX,OAAO,CAAC,mBAAmB,CAAC;KAC5B,MAAM,CAAC,CAAC,GAAG,EAAE;IACZ,MAAM,QAAQ,GAAG,IAAA,0BAAiB,GAAE,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC,CAAA;AAEL,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5B,oDAAoD;AACpD,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;IACjC,OAAO,CAAC,UAAU,EAAE,CAAC;CACtB"}
|
@@ -1,4 +1,6 @@
|
|
1
1
|
export declare function createUserDb(host: string, port: string, dbName: string, adminName: string, adminPassword: string, sync: boolean): Promise<void>;
|
2
2
|
export declare function deleteUserDb(host: string, port: string, dbName: string, sync: boolean): Promise<void>;
|
3
3
|
export declare function getUserDb(host: string, port: string, dbName: string): Promise<void>;
|
4
|
+
export declare function migrate(): number;
|
5
|
+
export declare function rollbackmigration(): number;
|
4
6
|
//# sourceMappingURL=userdb.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"userdb.d.ts","sourceRoot":"","sources":["../../../src/cloud-cli/userdb.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"userdb.d.ts","sourceRoot":"","sources":["../../../src/cloud-cli/userdb.ts"],"names":[],"mappings":"AAOA,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,iBA0DrI;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,iBAsD3F;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAczE;AAED,wBAAgB,OAAO,IAAI,MAAM,CAgDhC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CA4B1C"}
|
@@ -3,17 +3,19 @@ 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.getUserDb = exports.deleteUserDb = exports.createUserDb = void 0;
|
6
|
+
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
|
+
const config_1 = require("../dbos-runtime/config");
|
12
|
+
const child_process_1 = require("child_process");
|
11
13
|
async function createUserDb(host, port, dbName, adminName, adminPassword, sync) {
|
12
14
|
const logger = (0, logs_1.createGlobalLogger)();
|
13
15
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
14
16
|
const bearerToken = "Bearer " + userCredentials.token;
|
15
17
|
try {
|
16
|
-
await axios_1.default.post(`http://${host}:${port}/${userCredentials.userName}/databases/userdb`, {
|
18
|
+
await axios_1.default.post(`http://${host}:${port}/${userCredentials.userName}/databases/userdb`, { Name: dbName, AdminName: adminName, AdminPassword: adminPassword }, {
|
17
19
|
headers: {
|
18
20
|
"Content-Type": "application/json",
|
19
21
|
Authorization: bearerToken,
|
@@ -40,7 +42,7 @@ async function createUserDb(host, port, dbName, adminName, adminPassword, sync)
|
|
40
42
|
logger.info("Saving db state to cloud db");
|
41
43
|
await axios_1.default.put(`http://${host}:${port}/${userCredentials.userName}/databases/userdb/info`,
|
42
44
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
43
|
-
{
|
45
|
+
{ DBName: dbName, Status: status, HostName: dbhostname, Port: dbport }, {
|
44
46
|
headers: {
|
45
47
|
"Content-Type": "application/json",
|
46
48
|
Authorization: bearerToken,
|
@@ -92,7 +94,7 @@ async function deleteUserDb(host, port, dbName, sync) {
|
|
92
94
|
}
|
93
95
|
// Update the clouddb info record
|
94
96
|
logger.info("Saving db state to cloud db");
|
95
|
-
await axios_1.default.put(`http://${host}:${port}/${userCredentials.userName}/databases/userdb/info`, {
|
97
|
+
await axios_1.default.put(`http://${host}:${port}/${userCredentials.userName}/databases/userdb/info`, { Name: dbName, Status: "deleted", HostName: "", Port: 0 }, {
|
96
98
|
headers: {
|
97
99
|
"Content-Type": "application/json",
|
98
100
|
Authorization: bearerToken,
|
@@ -127,6 +129,77 @@ async function getUserDb(host, port, dbName) {
|
|
127
129
|
}
|
128
130
|
}
|
129
131
|
exports.getUserDb = getUserDb;
|
132
|
+
function migrate() {
|
133
|
+
const logger = (0, logs_1.createGlobalLogger)();
|
134
|
+
// read the yaml file
|
135
|
+
const configFile = (0, config_1.loadConfigFile)(config_1.dbosConfigFilePath);
|
136
|
+
if (!configFile) {
|
137
|
+
logger.error(`failed to parse ${config_1.dbosConfigFilePath}`);
|
138
|
+
return 1;
|
139
|
+
}
|
140
|
+
let create_db = configFile.database.create_db;
|
141
|
+
if (create_db == undefined) {
|
142
|
+
create_db = false;
|
143
|
+
}
|
144
|
+
const userdbname = configFile.database.user_database;
|
145
|
+
if (create_db) {
|
146
|
+
logger.info(`Creating database ${userdbname}`);
|
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);
|
151
|
+
}
|
152
|
+
catch (e) {
|
153
|
+
logger.error("Database already exists or could not be created.");
|
154
|
+
return 1;
|
155
|
+
}
|
156
|
+
}
|
157
|
+
let dbType = configFile.database.user_dbclient;
|
158
|
+
if (dbType == undefined) {
|
159
|
+
dbType = "knex";
|
160
|
+
}
|
161
|
+
const migratecommands = configFile.database.migrate;
|
162
|
+
try {
|
163
|
+
migratecommands?.forEach((cmd) => {
|
164
|
+
const command = "npx " + dbType + " " + cmd;
|
165
|
+
logger.info("Executing " + command);
|
166
|
+
(0, child_process_1.execSync)(command);
|
167
|
+
});
|
168
|
+
}
|
169
|
+
catch (e) {
|
170
|
+
logger.error("Error running migration. Check database and if necessary, run npx dbos-cloud userdb rollback.");
|
171
|
+
return 1;
|
172
|
+
}
|
173
|
+
return 0;
|
174
|
+
}
|
175
|
+
exports.migrate = migrate;
|
176
|
+
function rollbackmigration() {
|
177
|
+
const logger = (0, logs_1.createGlobalLogger)();
|
178
|
+
// read the yaml file
|
179
|
+
const configFile = (0, config_1.loadConfigFile)(config_1.dbosConfigFilePath);
|
180
|
+
if (!configFile) {
|
181
|
+
logger.error(`failed to parse ${config_1.dbosConfigFilePath}`);
|
182
|
+
return 1;
|
183
|
+
}
|
184
|
+
let dbType = configFile.database.user_dbclient;
|
185
|
+
if (dbType == undefined) {
|
186
|
+
dbType = "knex";
|
187
|
+
}
|
188
|
+
const rollbackcommands = configFile.database.rollback;
|
189
|
+
try {
|
190
|
+
rollbackcommands?.forEach((cmd) => {
|
191
|
+
const command = "npx " + dbType + " " + cmd;
|
192
|
+
logger.info("Executing " + command);
|
193
|
+
(0, child_process_1.execSync)(command);
|
194
|
+
});
|
195
|
+
}
|
196
|
+
catch (e) {
|
197
|
+
logger.error("Error rolling back migration. ");
|
198
|
+
return 1;
|
199
|
+
}
|
200
|
+
return 0;
|
201
|
+
}
|
202
|
+
exports.rollbackmigration = rollbackmigration;
|
130
203
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any
|
131
204
|
async function getDb(host, port, dbName) {
|
132
205
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
@@ -143,7 +216,7 @@ async function getDb(host, port, dbName) {
|
|
143
216
|
return res.data;
|
144
217
|
}
|
145
218
|
else {
|
146
|
-
return {
|
219
|
+
return { Status: "notfound" };
|
147
220
|
}
|
148
221
|
}
|
149
222
|
//# sourceMappingURL=userdb.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"userdb.js","sourceRoot":"","sources":["../../../src/cloud-cli/userdb.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAuD;AACvD,mCAA8C;AAC9C,
|
1
|
+
{"version":3,"file":"userdb.js","sourceRoot":"","sources":["../../../src/cloud-cli/userdb.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAuD;AACvD,mCAA8C;AAC9C,oCAAiC;AACjC,mDAAwF;AACxF,iDAAyC;AAElC,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,IAAY,EAAE,MAAc,EAAE,SAAiB,EAAE,aAAqB,EAAE,IAAa;IACpI,MAAM,MAAM,GAAG,IAAA,yBAAkB,GAAE,CAAC;IACpC,MAAM,eAAe,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,IAAI;QACF,MAAM,eAAK,CAAC,IAAI,CACd,UAAU,IAAI,IAAI,IAAI,IAAI,eAAe,CAAC,QAAQ,mBAAmB,EACrE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,EACpE;YACE,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,WAAW;aAC3B;SACF,CACF,CAAC;QAEF,MAAM,CAAC,IAAI,CAAC,2CAA2C,MAAM,EAAE,CAAC,CAAC;QAEjE,IAAI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AAK,UAAU,KAAK,CAAC,IAAY,EAAE,IAAY,EAAE,MAAc;IAC7D,MAAM,eAAe,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,MAAM,GAAG,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,UAAU,IAAI,IAAI,IAAI,IAAI,eAAe,CAAC,QAAQ,qBAAqB,MAAM,EAAE,EAAE;QAC3G,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,WAAW;SAC3B;KACF,CAAC,CAAC;IAEH,6GAA6G;IAC7G,IAAI,GAAG,CAAC,MAAM,IAAI,eAAK,CAAC,cAAc,CAAC,EAAE,EAAE;QACzC,+DAA+D;QAC/D,OAAO,GAAG,CAAC,IAAI,CAAC;KACjB;SAAM;QACL,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;KAC/B;AACH,CAAC"}
|
@@ -2,6 +2,7 @@ import { Span } from "@opentelemetry/sdk-trace-base";
|
|
2
2
|
import { WinstonLogger as Logger } from "./telemetry/logs";
|
3
3
|
import { WorkflowContextImpl } from "./workflow";
|
4
4
|
import { DBOSContext, DBOSContextImpl } from "./context";
|
5
|
+
import { WorkflowContextDebug } from "./debugger/debug_workflow";
|
5
6
|
export type Communicator<T extends any[], R> = (ctxt: CommunicatorContext, ...args: T) => Promise<R>;
|
6
7
|
export interface CommunicatorConfig {
|
7
8
|
retriesAllowed?: boolean;
|
@@ -19,6 +20,6 @@ export declare class CommunicatorContextImpl extends DBOSContextImpl implements
|
|
19
20
|
readonly intervalSeconds: number;
|
20
21
|
readonly maxAttempts: number;
|
21
22
|
readonly backoffRate: number;
|
22
|
-
constructor(workflowContext: WorkflowContextImpl, functionID: number, span: Span, logger: Logger, params: CommunicatorConfig, commName: string);
|
23
|
+
constructor(workflowContext: WorkflowContextImpl | WorkflowContextDebug, functionID: number, span: Span, logger: Logger, params: CommunicatorConfig, commName: string);
|
23
24
|
}
|
24
25
|
//# sourceMappingURL=communicator.d.ts.map
|
@@ -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,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;
|
1
|
+
{"version":3,"file":"communicator.d.ts","sourceRoot":"","sources":["../../src/communicator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAC;AACrD,OAAO,EAAE,aAAa,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;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"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"communicator.js","sourceRoot":"","sources":["../../src/communicator.ts"],"names":[],"mappings":";;;AAGA,uCAAyD;
|
1
|
+
{"version":3,"file":"communicator.js","sourceRoot":"","sources":["../../src/communicator.ts"],"names":[],"mappings":";;;AAGA,uCAAyD;AAmBzD,MAAa,uBAAwB,SAAQ,yBAAe;IACjD,UAAU,CAAS;IACnB,cAAc,CAAU;IACxB,eAAe,CAAS;IACxB,WAAW,CAAS;IACpB,WAAW,CAAS;IAE7B,iCAAiC;IACjC,YAAY,eAA2D,EAAE,UAAkB,EAAE,IAAU,EAAE,MAAc,EAAE,MAA0B,EAAE,QAAgB;QACnK,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAC/C,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC;QACpD,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;QAC3C,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;QAC3C,IAAI,eAAe,CAAC,iBAAiB,EAAE;YACrC,mEAAmE;YACnE,IAAI,CAAC,iBAAiB,GAAG,eAAe,CAAC,iBAAiB,CAAC;SAC5D;IACH,CAAC;CACF;AApBD,0DAoBC"}
|
package/dist/src/context.d.ts
CHANGED
@@ -15,6 +15,7 @@ export interface HTTPRequest {
|
|
15
15
|
readonly querystring?: string;
|
16
16
|
readonly url?: string;
|
17
17
|
readonly ip?: string;
|
18
|
+
readonly requestID?: string;
|
18
19
|
}
|
19
20
|
export interface DBOSContext {
|
20
21
|
readonly request: HTTPRequest;
|
@@ -46,11 +47,11 @@ export declare class DBOSContextImpl implements DBOSContext {
|
|
46
47
|
* TODO : move logger and application, getConfig to a BaseContext which is at the root of all contexts
|
47
48
|
*/
|
48
49
|
export declare class InitContext {
|
49
|
-
readonly
|
50
|
+
readonly dbosExec: DBOSExecutor;
|
50
51
|
readonly logger: Logger;
|
51
52
|
private userDatabase;
|
52
53
|
private application;
|
53
|
-
constructor(
|
54
|
+
constructor(dbosExec: DBOSExecutor);
|
54
55
|
createUserSchema(): Promise<void>;
|
55
56
|
dropUserSchema(): Promise<void>;
|
56
57
|
queryUserDB<R>(sql: string, ...params: unknown[]): Promise<R[]>;
|
@@ -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,aAAa,IAAI,MAAM,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,mBAAmB,CAAC;IACvC,Q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GD;;GAEG;AACH,qBAAa,WAAW;IASV,QAAQ,CAAC,QAAQ,EAAE,YAAY;IAP3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAGxB,OAAO,CAAC,YAAY,CAAe;IAEnC,OAAO,CAAC,WAAW,CAAM;gBAEJ,QAAQ,EAAE,YAAY;IAO3C,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/B,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;IAK/D,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IACxC,SAAS,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC;CAmB9C"}
|
package/dist/src/context.js
CHANGED
@@ -50,18 +50,18 @@ exports.DBOSContextImpl = DBOSContextImpl;
|
|
50
50
|
* TODO : move logger and application, getConfig to a BaseContext which is at the root of all contexts
|
51
51
|
*/
|
52
52
|
class InitContext {
|
53
|
-
|
53
|
+
dbosExec;
|
54
54
|
logger;
|
55
55
|
// All private Not exposed
|
56
56
|
userDatabase;
|
57
57
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
58
58
|
application;
|
59
|
-
constructor(
|
60
|
-
this.
|
61
|
-
this.logger =
|
62
|
-
this.userDatabase =
|
59
|
+
constructor(dbosExec) {
|
60
|
+
this.dbosExec = dbosExec;
|
61
|
+
this.logger = dbosExec.logger;
|
62
|
+
this.userDatabase = dbosExec.userDatabase;
|
63
63
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
64
|
-
this.application =
|
64
|
+
this.application = dbosExec.config.application;
|
65
65
|
}
|
66
66
|
createUserSchema() {
|
67
67
|
return this.userDatabase.createSchema();
|
@@ -83,7 +83,7 @@ class InitContext {
|
|
83
83
|
}
|
84
84
|
// If the key is found and the default value is provided, check whether the value is of the same type.
|
85
85
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
86
|
-
const value = (0, lodash_1.get)(this.
|
86
|
+
const value = (0, lodash_1.get)(this.dbosExec.config.application, key);
|
87
87
|
if (defaultValue && typeof value !== typeof defaultValue) {
|
88
88
|
throw new error_1.DBOSConfigKeyTypeError(key, typeof defaultValue, typeof value);
|
89
89
|
}
|
package/dist/src/context.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":";;;AACA,2CAAiF;AACjF,mCAAkC;AAKlC,mCAAiD;
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/context.ts"],"names":[],"mappings":";;;AACA,2CAAiF;AACjF,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,CAAC,MAAM,GAAG,IAAI,aAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC3C,IAAI,SAAS,EAAE;YACb,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC;YACjC,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC,iBAAiB,CAAC;YACrD,IAAI,CAAC,kBAAkB,GAAG,SAAS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C;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"}
|
@@ -21,6 +21,7 @@ export interface DBOSConfig {
|
|
21
21
|
readonly observability_database?: string;
|
22
22
|
readonly application?: any;
|
23
23
|
readonly dbClientMetadata?: any;
|
24
|
+
readonly debugProxy?: string;
|
24
25
|
}
|
25
26
|
interface WorkflowInfo<T extends any[], R> {
|
26
27
|
workflow: Workflow<T, R>;
|
@@ -36,13 +37,14 @@ export declare class DBOSExecutor {
|
|
36
37
|
readonly workflowInfoMap: Map<string, WorkflowInfo<any, any>>;
|
37
38
|
readonly transactionConfigMap: Map<string, TransactionConfig>;
|
38
39
|
readonly communicatorConfigMap: Map<string, CommunicatorConfig>;
|
39
|
-
readonly topicConfigMap: Map<string, string[]>;
|
40
40
|
readonly registeredOperations: Array<MethodRegistrationBase>;
|
41
41
|
readonly pendingWorkflowMap: Map<string, Promise<unknown>>;
|
42
|
+
readonly pendingAsyncWrites: Map<string, Promise<unknown>>;
|
42
43
|
readonly telemetryCollector: TelemetryCollector;
|
43
44
|
readonly flushBufferIntervalMs: number;
|
44
45
|
readonly flushBufferID: NodeJS.Timeout;
|
45
46
|
static readonly defaultNotificationTimeoutSec = 60;
|
47
|
+
readonly debugMode: boolean;
|
46
48
|
readonly logger: Logger;
|
47
49
|
readonly tracer: Tracer;
|
48
50
|
entities: Function[];
|
@@ -52,6 +54,10 @@ export declare class DBOSExecutor {
|
|
52
54
|
destroy(): Promise<void>;
|
53
55
|
workflow<T extends any[], R>(wf: Workflow<T, R>, params: WorkflowParams, ...args: T): Promise<WorkflowHandle<R>>;
|
54
56
|
internalWorkflow<T extends any[], R>(wf: Workflow<T, R>, params: WorkflowParams, callerUUID?: string, callerFunctionID?: number, ...args: T): Promise<WorkflowHandle<R>>;
|
57
|
+
/**
|
58
|
+
* DEBUG MODE workflow execution, skipping all the recording
|
59
|
+
*/
|
60
|
+
debugWorkflow<T extends any[], R>(wf: Workflow<T, R>, params: WorkflowParams, callerUUID?: string, callerFunctionID?: number, ...args: T): Promise<WorkflowHandle<R>>;
|
55
61
|
transaction<T extends any[], R>(txn: Transaction<T, R>, params: WorkflowParams, ...args: T): Promise<R>;
|
56
62
|
external<T extends any[], R>(commFn: Communicator<T, R>, params: WorkflowParams, ...args: T): Promise<R>;
|
57
63
|
send<T extends NonNullable<any>>(destinationUUID: string, message: T, topic?: string, idempotencyKey?: string): Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dbos-executor.d.ts","sourceRoot":"","sources":["../../src/dbos-executor.ts"],"names":[],"mappings":";
|
1
|
+
{"version":3,"file":"dbos-executor.d.ts","sourceRoot":"","sources":["../../src/dbos-executor.ts"],"names":[],"mappings":";AAQA,OAAO,EAE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