@dbos-inc/dbos-sdk 0.7.25-preview → 0.8.12-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.map +1 -1
- package/dist/src/cloud-cli/applications/configure.js +12 -2
- 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 +19 -7
- 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 +2 -0
- package/dist/src/cloud-cli/userdb.d.ts.map +1 -1
- package/dist/src/cloud-cli/userdb.js +102 -8
- package/dist/src/cloud-cli/userdb.js.map +1 -1
- package/dist/src/communicator.d.ts +3 -2
- package/dist/src/communicator.d.ts.map +1 -1
- package/dist/src/communicator.js.map +1 -1
- package/dist/src/context.d.ts +3 -3
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js +8 -8
- package/dist/src/context.js.map +1 -1
- package/dist/src/dbos-executor.d.ts +19 -7
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js +186 -67
- 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 +3 -0
- 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 +2 -2
- package/dist/src/dbos-runtime/runtime.d.ts.map +1 -1
- package/dist/src/dbos-runtime/runtime.js +20 -21
- package/dist/src/dbos-runtime/runtime.js.map +1 -1
- package/dist/src/debugger/debug_workflow.d.ts +8 -8
- package/dist/src/debugger/debug_workflow.d.ts.map +1 -1
- package/dist/src/debugger/debug_workflow.js +107 -36
- package/dist/src/debugger/debug_workflow.js.map +1 -1
- package/dist/src/httpServer/handler.d.ts +1 -1
- package/dist/src/httpServer/handler.d.ts.map +1 -1
- package/dist/src/httpServer/handler.js +14 -14
- package/dist/src/httpServer/handler.js.map +1 -1
- package/dist/src/httpServer/server.d.ts +4 -4
- package/dist/src/httpServer/server.d.ts.map +1 -1
- package/dist/src/httpServer/server.js +17 -17
- package/dist/src/httpServer/server.js.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 +22 -9
- package/dist/src/system_database.d.ts.map +1 -1
- package/dist/src/system_database.js +44 -42
- 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.d.ts.map +1 -1
- package/dist/src/testing/testing_runtime.js +8 -2
- package/dist/src/testing/testing_runtime.js.map +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 +16 -1
- package/dist/src/workflow.d.ts.map +1 -1
- package/dist/src/workflow.js +103 -61
- 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 +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
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/configure.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/configure.ts"],"names":[],"mappings":"AAQA,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBA4D5E"}
|
@@ -10,8 +10,9 @@ const yaml_1 = __importDefault(require("yaml"));
|
|
10
10
|
const logs_1 = require("../../telemetry/logs");
|
11
11
|
const utils_1 = require("../utils");
|
12
12
|
const config_1 = require("../../dbos-runtime/config");
|
13
|
+
const child_process_1 = require("child_process");
|
13
14
|
async function configureApp(host, port, dbName) {
|
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
|
// call cloud and get hostname and port
|
@@ -40,9 +41,18 @@ async function configureApp(host, port, dbName) {
|
|
40
41
|
logger.error(`failed to parse ${config_1.dbosConfigFilePath}`);
|
41
42
|
return;
|
42
43
|
}
|
44
|
+
try {
|
45
|
+
// Should we just download and keep the file in the dir instead of downloading everytime ??
|
46
|
+
(0, child_process_1.execSync)("wget https://truststore.pki.rds.amazonaws.com/us-east-1/us-east-1-bundle.pem -O us-east-1-bundle.pem");
|
47
|
+
}
|
48
|
+
catch (e) {
|
49
|
+
logger.error(e.message);
|
50
|
+
logger.error("Error downloading RDS certificate bundle. Try downloading it manually from AWS.");
|
51
|
+
}
|
43
52
|
// update hostname and port
|
44
53
|
configFile.database.hostname = userdbHostname;
|
45
54
|
configFile.database.port = userdbPort;
|
55
|
+
configFile.database.ssl_ca = "us-east-1-bundle.pem";
|
46
56
|
// save the file
|
47
57
|
try {
|
48
58
|
fs_1.default.writeFileSync(`${config_1.dbosConfigFilePath}`, yaml_1.default.stringify(configFile));
|
@@ -51,7 +61,7 @@ async function configureApp(host, port, dbName) {
|
|
51
61
|
logger.error(`failed to write ${config_1.dbosConfigFilePath}: ${e.message}`);
|
52
62
|
return;
|
53
63
|
}
|
54
|
-
logger.info(
|
64
|
+
logger.info(`Successfully configured user database at ${userdbHostname}:${userdbPort}.`);
|
55
65
|
}
|
56
66
|
exports.configureApp = configureApp;
|
57
67
|
//# sourceMappingURL=configure.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/configure.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAoB;AACpB,gDAAwB;AACxB,+
|
1
|
+
{"version":3,"file":"configure.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/configure.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAoB;AACpB,gDAAwB;AACxB,+CAAoD;AACpD,oCAA+C;AAC/C,sDAA2F;AAC3F,iDAAyC;AAElC,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,IAAY,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,2BAA2B;IAC3B,UAAU,CAAC,QAAQ,CAAC,QAAQ,GAAG,cAAc,CAAA;IAC7C,UAAU,CAAC,QAAQ,CAAC,IAAI,GAAG,UAAU,CAAA;IACrC,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,sBAAsB,CAAA;IAEnD,gBAAgB;IAChB,IAAI;QACF,YAAE,CAAC,aAAa,CAAC,GAAG,2BAAkB,EAAE,EAAE,cAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;KACvE;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,KAAK,CAAC,mBAAmB,2BAAkB,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QAC/E,OAAO;KACR;IAED,MAAM,CAAC,IAAI,CAAC,4CAA4C,cAAc,IAAI,UAAU,GAAG,CAAC,CAAA;AAE5F,CAAC;AA5DD,oCA4DC"}
|
@@ -8,7 +8,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const logs_1 = require("../../telemetry/logs");
|
9
9
|
const utils_1 = require("../utils");
|
10
10
|
async function deleteApp(appName, host, port) {
|
11
|
-
const logger =
|
11
|
+
const logger = new logs_1.GlobalLogger();
|
12
12
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
13
13
|
const bearerToken = "Bearer " + userCredentials.token;
|
14
14
|
try {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"delete-app.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/delete-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+
|
1
|
+
{"version":3,"file":"delete-app.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/delete-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAAoD;AACpD,oCAA+C;AAExC,KAAK,UAAU,SAAS,CAAC,OAAe,EAAE,IAAY,EAAE,IAAY;IACzE,MAAM,MAAM,GAAG,IAAI,mBAAY,EAAE,CAAC;IAClC,MAAM,eAAe,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,IAAI;QACF,MAAM,eAAK,CAAC,MAAM,CAAC,UAAU,IAAI,IAAI,IAAI,IAAI,eAAe,CAAC,QAAQ,gBAAgB,OAAO,EAAE,EAAE;YAC9F,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,WAAW;aAC3B;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,qCAAqC,OAAO,EAAE,CAAC,CAAC;QAC5D,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;AAxBD,8BAwBC"}
|
@@ -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,CA+DhG"}
|
@@ -14,7 +14,7 @@ const utils_2 = require("../../utils");
|
|
14
14
|
const config_1 = require("../../dbos-runtime/config");
|
15
15
|
const deployDirectoryName = "dbos_deploy";
|
16
16
|
async function deployAppCode(appName, host, port) {
|
17
|
-
const logger =
|
17
|
+
const logger = new logs_1.GlobalLogger();
|
18
18
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
19
19
|
const bearerToken = "Bearer " + userCredentials.token;
|
20
20
|
try {
|
@@ -27,6 +27,14 @@ async function deployAppCode(appName, host, port) {
|
|
27
27
|
// Parse version from config file. If missing, use current epoch
|
28
28
|
const version = configFile.version ?? Date.now().toString();
|
29
29
|
configFile.version = version;
|
30
|
+
// Inject OTel export configuration
|
31
|
+
if (!configFile.telemetry) {
|
32
|
+
configFile.telemetry = {};
|
33
|
+
}
|
34
|
+
configFile.telemetry.OTLPExporter = {
|
35
|
+
logsEndpoint: "http://otel-collector:4318/v1/logs",
|
36
|
+
tracesEndpoint: "http://otel-collector:4318/v1/traces",
|
37
|
+
};
|
30
38
|
try {
|
31
39
|
fs_1.default.writeFileSync(`${deployDirectoryName}/${config_1.dbosConfigFilePath}`, yaml_1.default.stringify(configFile));
|
32
40
|
}
|
@@ -34,7 +42,7 @@ async function deployAppCode(appName, host, port) {
|
|
34
42
|
logger.error(`failed to write ${config_1.dbosConfigFilePath}: ${e.message}`);
|
35
43
|
return 1;
|
36
44
|
}
|
37
|
-
(0, child_process_1.execSync)(`npm prune --
|
45
|
+
(0, child_process_1.execSync)(`npm prune --omit=dev node_modules/* `);
|
38
46
|
(0, child_process_1.execSync)(`zip -ry ${deployDirectoryName}/${appName}.zip ./* -x ${deployDirectoryName}/* ${config_1.dbosConfigFilePath} > /dev/null`);
|
39
47
|
(0, child_process_1.execSync)(`zip -j ${deployDirectoryName}/${appName}.zip ${deployDirectoryName}/${config_1.dbosConfigFilePath} > /dev/null`);
|
40
48
|
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,+
|
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,+CAAoD;AACpD,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,IAAI,mBAAY,EAAE,CAAC;IAClC,MAAM,eAAe,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,IAAI;QACF,IAAA,uBAAe,EAAC,mBAAmB,CAAC,CAAC;QAErC,MAAM,UAAU,GAA2B,IAAA,uBAAc,EAAC,2BAAkB,CAAC,CAAC;QAC9E,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,CAAC,KAAK,CAAC,mBAAmB,2BAAkB,EAAE,CAAC,CAAC;YACtD,OAAO,CAAC,CAAC;SACV;QAED,gEAAgE;QAChE,MAAM,OAAO,GAAW,UAAU,CAAC,OAAO,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;QACpE,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;QAE7B,mCAAmC;QACnC,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE;YACzB,UAAU,CAAC,SAAS,GAAG,EAAE,CAAC;SAC3B;QACD,UAAU,CAAC,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AAO,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;AA/DD,sCA+DC"}
|
@@ -8,7 +8,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const logs_1 = require("../../telemetry/logs");
|
9
9
|
const utils_1 = require("../utils");
|
10
10
|
async function getAppLogs(appName, host, port) {
|
11
|
-
const logger =
|
11
|
+
const logger = new logs_1.GlobalLogger();
|
12
12
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
13
13
|
const bearerToken = "Bearer " + userCredentials.token;
|
14
14
|
try {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-app-logs.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/get-app-logs.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+
|
1
|
+
{"version":3,"file":"get-app-logs.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/get-app-logs.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAAoD;AACpD,oCAA+C;AAExC,KAAK,UAAU,UAAU,CAAC,OAAe,EAAE,IAAY,EAAE,IAAY;IAC1E,MAAM,MAAM,GAAG,IAAI,mBAAY,EAAE,CAAC;IAClC,MAAM,eAAe,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,IAAI;QACF,MAAM,GAAG,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,UAAU,IAAI,IAAI,IAAI,IAAI,eAAe,CAAC,QAAQ,qBAAqB,OAAO,EAAE,EAAE;YAC5G,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,WAAW;aAC3B;SACF,CAAC,CAAC;QAEH,MAAM,CAAC,IAAI,CAAC,+CAA+C,OAAO,EAAE,CAAC,CAAC;QACtE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACrB,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,0CAA0C,OAAO,KAAK,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YACvF,OAAO,CAAC,CAAC;SACV;aAAM;YACL,MAAM,CAAC,KAAK,CAAC,0CAA0C,OAAO,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3F,OAAO,CAAC,CAAC;SACV;KACF;AACH,CAAC;AAzBD,gCAyBC"}
|
@@ -8,7 +8,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const logs_1 = require("../../telemetry/logs");
|
9
9
|
const utils_1 = require("../utils");
|
10
10
|
async function listApps(host, port) {
|
11
|
-
const logger =
|
11
|
+
const logger = new logs_1.GlobalLogger();
|
12
12
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
13
13
|
const bearerToken = "Bearer " + userCredentials.token;
|
14
14
|
try {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"list-apps.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/list-apps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+
|
1
|
+
{"version":3,"file":"list-apps.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/list-apps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAAoD;AACpD,oCAA+C;AAGxC,KAAK,UAAU,QAAQ,CAAC,IAAY,EAAE,IAAY;IACvD,MAAM,MAAM,GAAG,IAAI,mBAAY,EAAE,CAAC;IAClC,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mCC"}
|
@@ -8,7 +8,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const logs_1 = require("../../telemetry/logs");
|
9
9
|
const utils_1 = require("../utils");
|
10
10
|
async function registerApp(appName, host, port, machines) {
|
11
|
-
const logger =
|
11
|
+
const logger = new logs_1.GlobalLogger();
|
12
12
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
13
13
|
const bearerToken = "Bearer " + userCredentials.token;
|
14
14
|
try {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"register-app.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/register-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+
|
1
|
+
{"version":3,"file":"register-app.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/register-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAAoD;AACpD,oCAA+C;AAExC,KAAK,UAAU,WAAW,CAAC,OAAe,EAAE,IAAY,EAAE,IAAY,EAAE,QAAgB;IAC7F,MAAM,MAAM,GAAG,IAAI,mBAAY,EAAE,CAAC;IAClC,MAAM,eAAe,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,UAAU,IAAI,IAAI,IAAI,IAAI,eAAe,CAAC,QAAQ,cAAc,EAChE;YACE,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,QAAQ;SAClB,EACD;YACE,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,WAAW;aAC3B;SACF,CACF,CAAC;QACF,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAc,CAAC;QACrC,MAAM,CAAC,IAAI,CAAC,4BAA4B,OAAO,EAAE,CAAC,CAAC;QACnD,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,QAAQ,IAAI,EAAE,CAAC,CAAC;QACtC,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,kCAAkC,OAAO,KAAK,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;YAC/E,OAAO,CAAC,CAAC;SACV;aAAM;YACL,MAAM,CAAC,KAAK,CAAC,kCAAkC,OAAO,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;YACnF,OAAO,CAAC,CAAC;SACV;KACF;AACH,CAAC;AAhCD,kCAgCC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"update-app.d.ts","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/update-app.ts"],"names":[],"mappings":"AAKA,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,
|
1
|
+
{"version":3,"file":"update-app.d.ts","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/update-app.ts"],"names":[],"mappings":"AAKA,wBAAsB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAkC9G"}
|
@@ -8,7 +8,7 @@ const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const logs_1 = require("../../telemetry/logs");
|
9
9
|
const utils_1 = require("../utils");
|
10
10
|
async function updateApp(appName, host, port, machines) {
|
11
|
-
const logger =
|
11
|
+
const logger = new logs_1.GlobalLogger();
|
12
12
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
13
13
|
const bearerToken = "Bearer " + userCredentials.token;
|
14
14
|
try {
|
@@ -33,7 +33,8 @@ async function updateApp(appName, host, port, machines) {
|
|
33
33
|
return 1;
|
34
34
|
}
|
35
35
|
else {
|
36
|
-
|
36
|
+
e.message = `failed to update application ${appName}: ${e.message}`;
|
37
|
+
logger.error(e);
|
37
38
|
return 1;
|
38
39
|
}
|
39
40
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"update-app.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/update-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+
|
1
|
+
{"version":3,"file":"update-app.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/update-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAAoD;AACpD,oCAA+C;AAGxC,KAAK,UAAU,SAAS,CAAC,OAAe,EAAE,IAAY,EAAE,IAAY,EAAE,QAAgB;IAC3F,MAAM,MAAM,GAAI,IAAI,mBAAY,EAAE,CAAC;IACnC,MAAM,eAAe,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,IAAI;QACF,MAAM,CAAC,IAAI,CAAC,wBAAwB,OAAO,OAAO,QAAQ,WAAW,CAAC,CAAC;QACvE,MAAM,MAAM,GAAG,MAAM,eAAK,CAAC,KAAK,CAC9B,UAAU,IAAI,IAAI,IAAI,IAAI,eAAe,CAAC,QAAQ,gBAAgB,OAAO,EAAE,EAC3E;YACE,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,QAAQ;SAClB,EACD;YACE,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,WAAW;aAC3B;SACF,CACF,CAAC;QACF,MAAM,WAAW,GAAgB,MAAM,CAAC,IAAmB,CAAC;QAC5D,MAAM,CAAC,IAAI,CAAC,yBAAyB,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC5I,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;YACJ,CAAW,CAAC,OAAO,GAAG,gCAAgC,OAAO,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC;YAC1F,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAChB,OAAO,CAAC,CAAC;SACV;KACF;AACH,CAAC;AAlCD,8BAkCC"}
|
@@ -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,MA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E,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;AACtD,CAAC,CAAC,CAAC,CAAA;AAEL,cAAc;KACX,OAAO,CAAC,SAAS,CAAC;KAClB,MAAM,CAAC,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 +1 @@
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/cloud-cli/login.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,YAAY,qCAAqC,CAAA;AAC9D,eAAO,MAAM,mBAAmB,mBAAmB,CAAA;AAEnD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AA8CD,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/cloud-cli/login.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,WAAW,UAAU,CAAC;AACnC,eAAO,MAAM,YAAY,qCAAqC,CAAA;AAC9D,eAAO,MAAM,mBAAmB,mBAAmB,CAAA;AAEnD,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AA8CD,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4D7D"}
|
@@ -39,7 +39,7 @@ async function verifyToken(token) {
|
|
39
39
|
});
|
40
40
|
}
|
41
41
|
async function login(username) {
|
42
|
-
const logger =
|
42
|
+
const logger = new logs_1.GlobalLogger();
|
43
43
|
logger.info(`Logging in!`);
|
44
44
|
const deviceCodeRequest = {
|
45
45
|
method: 'POST',
|
@@ -53,7 +53,8 @@ async function login(username) {
|
|
53
53
|
deviceCodeResponse = response.data;
|
54
54
|
}
|
55
55
|
catch (e) {
|
56
|
-
|
56
|
+
e.message = `failed to log in: ${e.message}`;
|
57
|
+
logger.error(e);
|
57
58
|
}
|
58
59
|
if (!deviceCodeResponse) {
|
59
60
|
return 1;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/cloud-cli/login.ts"],"names":[],"mappings":";;;;;;AAAA,
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/cloud-cli/login.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAiD;AACjD,kDAA0B;AAC1B,oCAAiC;AACjC,gEAA+C;AAC/C,wDAAkC;AAClC,iDAAyC;AACzC,4CAAoB;AAEP,QAAA,WAAW,GAAG,OAAO,CAAC;AACtB,QAAA,YAAY,GAAG,kCAAkC,CAAA;AACjD,QAAA,mBAAmB,GAAG,gBAAgB,CAAA;AAsBnD,MAAM,MAAM,GAAG,IAAA,kBAAU,EAAC;IACxB,OAAO,EAAE,qDAAqD;CAC/D,CAAC,CAAC;AAEH,KAAK,UAAU,aAAa,CAAC,GAAW;IACtC,MAAM,GAAG,GAAG,MAAM,MAAM,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CAAC,CAAC;KACV;IAED,MAAM,WAAW,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;IAC9C,MAAM,WAAW,GAAyB;QACxC,KAAK,EAAE,aAAa,CAAC,YAAY;QACjC,QAAQ,EAAE,QAAQ;KACnB,CAAC;IACF,IAAA,wBAAQ,EAAC,YAAY,mBAAW,EAAE,CAAC,CAAC;IACpC,YAAE,CAAC,aAAa,CAAC,GAAG,mBAAW,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,CAAC;IACrF,MAAM,CAAC,IAAI,CAAC,mCAAmC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;IACvE,MAAM,CAAC,IAAI,CAAC,uCAAuC,mBAAW,cAAc,CAAC,CAAC;IAC9E,OAAO,CAAC,CAAC;AACX,CAAC;AA5DD,sBA4DC"}
|
@@ -11,7 +11,7 @@ async function registerUser(username, host, port) {
|
|
11
11
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
12
12
|
const bearerToken = "Bearer " + userCredentials.token;
|
13
13
|
const userName = userCredentials.userName;
|
14
|
-
const logger =
|
14
|
+
const logger = new logs_1.GlobalLogger();
|
15
15
|
try {
|
16
16
|
// First, register the user.
|
17
17
|
const register = await axios_1.default.put(`http://${host}:${port}/user`, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/cloud-cli/register.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,
|
1
|
+
{"version":3,"file":"register.js","sourceRoot":"","sources":["../../../src/cloud-cli/register.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAiD;AACjD,mCAA8C;AAEvC,KAAK,UAAU,YAAY,CAAC,QAAgB,EAAE,IAAY,EAAE,IAAY;IAC7E,MAAM,eAAe,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IACtD,MAAM,QAAQ,GAAG,eAAe,CAAC,QAAQ,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,mBAAY,EAAE,CAAC;IAClC,IAAI;QACF,4BAA4B;QAC5B,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,GAAG,CAC9B,UAAU,IAAI,IAAI,IAAI,OAAO,EAC7B;YACE,IAAI,EAAE,QAAQ;SACf,EACD;YACE,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,WAAW;aAC3B;SACF,CACF,CAAC;QACF,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAc,CAAC;QACzC,MAAM,CAAC,IAAI,CAAC,mBAAmB,QAAQ,WAAW,QAAQ,EAAE,CAAC,CAAC;KAC/D;IAAC,OAAO,CAAC,EAAE;QACV,IAAI,eAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;YACvC,MAAM,CAAC,KAAK,CAAC,2BAA2B,QAAQ,KAAK,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;SACzE;aAAM;YACL,MAAM,CAAC,KAAK,CAAC,2BAA2B,QAAQ,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;SAC9E;QACD,OAAO,CAAC,CAAC;KACV;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AA9BD,oCA8BC"}
|
@@ -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,CAoEhC;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
|
-
const logger =
|
14
|
+
const logger = new logs_1.GlobalLogger();
|
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,
|
@@ -59,7 +61,7 @@ async function createUserDb(host, port, dbName, adminName, adminPassword, sync)
|
|
59
61
|
}
|
60
62
|
exports.createUserDb = createUserDb;
|
61
63
|
async function deleteUserDb(host, port, dbName, sync) {
|
62
|
-
const logger =
|
64
|
+
const logger = new logs_1.GlobalLogger();
|
63
65
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
64
66
|
const bearerToken = "Bearer " + userCredentials.token;
|
65
67
|
try {
|
@@ -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,
|
@@ -111,7 +113,7 @@ async function deleteUserDb(host, port, dbName, sync) {
|
|
111
113
|
}
|
112
114
|
exports.deleteUserDb = deleteUserDb;
|
113
115
|
async function getUserDb(host, port, dbName) {
|
114
|
-
const logger =
|
116
|
+
const logger = new logs_1.GlobalLogger();
|
115
117
|
try {
|
116
118
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
117
119
|
const res = await getDb(host, port, dbName);
|
@@ -127,6 +129,98 @@ async function getUserDb(host, port, dbName) {
|
|
127
129
|
}
|
128
130
|
}
|
129
131
|
exports.getUserDb = getUserDb;
|
132
|
+
function migrate() {
|
133
|
+
const logger = new logs_1.GlobalLogger();
|
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 = `PGPASSWORD=${configFile.database.password} createdb -h ${configFile.database.hostname} -p ${configFile.database.port} ${userdbname} -U ${configFile.database.username} -ew ${userdbname}`;
|
148
|
+
logger.info(cmd);
|
149
|
+
try {
|
150
|
+
const createDBCommandOutput = (0, child_process_1.execSync)(cmd).toString();
|
151
|
+
logger.info(createDBCommandOutput);
|
152
|
+
}
|
153
|
+
catch (e) {
|
154
|
+
if (e instanceof Error && !e.message.includes(`database "${userdbname}" already exists`)) {
|
155
|
+
logger.error(`Error creating database: ${e.message}`);
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
let dbType = configFile.database.user_dbclient;
|
160
|
+
if (dbType === undefined) {
|
161
|
+
dbType = "knex";
|
162
|
+
}
|
163
|
+
const migratecommands = configFile.database.migrate;
|
164
|
+
try {
|
165
|
+
migratecommands?.forEach((cmd) => {
|
166
|
+
const command = "npx " + dbType + " " + cmd;
|
167
|
+
logger.info("Executing " + command);
|
168
|
+
const migrateCommandOutput = (0, child_process_1.execSync)(command).toString();
|
169
|
+
logger.info(migrateCommandOutput);
|
170
|
+
});
|
171
|
+
}
|
172
|
+
catch (e) {
|
173
|
+
logger.error("Error running migration. Check database and if necessary, run npx dbos-cloud userdb rollback.");
|
174
|
+
if (e instanceof Error) {
|
175
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
176
|
+
const stderr = e.stderr;
|
177
|
+
if (stderr && Buffer.isBuffer(stderr) && stderr.length > 0) {
|
178
|
+
logger.error(`Standard Error: ${stderr.toString().trim()}`);
|
179
|
+
}
|
180
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
181
|
+
const stdout = e.stdout;
|
182
|
+
if (stdout && Buffer.isBuffer(stdout) && stdout.length > 0) {
|
183
|
+
logger.error(`Standard Output: ${stdout.toString().trim()}`);
|
184
|
+
}
|
185
|
+
if (e.message) {
|
186
|
+
logger.error(e.message);
|
187
|
+
}
|
188
|
+
}
|
189
|
+
else {
|
190
|
+
logger.error(e);
|
191
|
+
}
|
192
|
+
return 1;
|
193
|
+
}
|
194
|
+
return 0;
|
195
|
+
}
|
196
|
+
exports.migrate = migrate;
|
197
|
+
function rollbackmigration() {
|
198
|
+
const logger = new logs_1.GlobalLogger();
|
199
|
+
// read the yaml file
|
200
|
+
const configFile = (0, config_1.loadConfigFile)(config_1.dbosConfigFilePath);
|
201
|
+
if (!configFile) {
|
202
|
+
logger.error(`failed to parse ${config_1.dbosConfigFilePath}`);
|
203
|
+
return 1;
|
204
|
+
}
|
205
|
+
let dbType = configFile.database.user_dbclient;
|
206
|
+
if (dbType == undefined) {
|
207
|
+
dbType = "knex";
|
208
|
+
}
|
209
|
+
const rollbackcommands = configFile.database.rollback;
|
210
|
+
try {
|
211
|
+
rollbackcommands?.forEach((cmd) => {
|
212
|
+
const command = "npx " + dbType + " " + cmd;
|
213
|
+
logger.info("Executing " + command);
|
214
|
+
(0, child_process_1.execSync)(command);
|
215
|
+
});
|
216
|
+
}
|
217
|
+
catch (e) {
|
218
|
+
logger.error("Error rolling back migration. ");
|
219
|
+
return 1;
|
220
|
+
}
|
221
|
+
return 0;
|
222
|
+
}
|
223
|
+
exports.rollbackmigration = rollbackmigration;
|
130
224
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any
|
131
225
|
async function getDb(host, port, dbName) {
|
132
226
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
@@ -143,7 +237,7 @@ async function getDb(host, port, dbName) {
|
|
143
237
|
return res.data;
|
144
238
|
}
|
145
239
|
else {
|
146
|
-
return {
|
240
|
+
return { Status: "notfound" };
|
147
241
|
}
|
148
242
|
}
|
149
243
|
//# 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;AAElC,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,CAAC;IAEtD,IAAI;QACF,MAAM,eAAK,CAAC,IA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E;QACV,MAAM,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAC/C,OAAO,CAAC,CAAC;KACV;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AA5BD,8CA4BC;AAED,mGAAmG;AACnG,KAAK,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"}
|
@@ -1,7 +1,8 @@
|
|
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
|
+
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
|