@dbos-inc/dbos-sdk 0.10.5-preview.g32e0b301f4 → 0.10.7-preview
Sign up to get free protection for your applications and to get access to all the features.
- package/dbos-config.schema.json +3 -6
- package/dbos-test-config.yaml +2 -2
- package/dist/packages/dbos-cloud/applications/delete-app.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/delete-app.js +4 -5
- package/dist/packages/dbos-cloud/applications/delete-app.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/deploy-app-code.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/deploy-app-code.js +5 -4
- package/dist/packages/dbos-cloud/applications/deploy-app-code.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/get-app-info.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/get-app-info.js +4 -4
- package/dist/packages/dbos-cloud/applications/get-app-info.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/get-app-logs.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/get-app-logs.js +4 -4
- package/dist/packages/dbos-cloud/applications/get-app-logs.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/list-apps.js +1 -1
- package/dist/packages/dbos-cloud/applications/list-apps.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/register-app.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/register-app.js +4 -5
- package/dist/packages/dbos-cloud/applications/register-app.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/update-app.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/update-app.js +4 -5
- package/dist/packages/dbos-cloud/applications/update-app.js.map +1 -1
- package/dist/packages/dbos-cloud/cli.js +45 -28
- package/dist/packages/dbos-cloud/cli.js.map +1 -1
- package/dist/packages/dbos-cloud/cloudutils.d.ts +2 -0
- package/dist/packages/dbos-cloud/cloudutils.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/cloudutils.js +20 -1
- package/dist/packages/dbos-cloud/cloudutils.js.map +1 -1
- package/dist/packages/dbos-cloud/register.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/register.js +7 -1
- package/dist/packages/dbos-cloud/register.js.map +1 -1
- package/dist/src/dbos-executor.d.ts +0 -1
- package/dist/src/dbos-executor.d.ts.map +1 -1
- package/dist/src/dbos-executor.js.map +1 -1
- package/dist/src/dbos-runtime/config.d.ts +2 -3
- package/dist/src/dbos-runtime/config.d.ts.map +1 -1
- package/dist/src/dbos-runtime/config.js +5 -3
- package/dist/src/dbos-runtime/config.js.map +1 -1
- package/dist/src/dbos-runtime/migrate.js +8 -8
- package/dist/src/dbos-runtime/migrate.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/examples/hello/dbos-config.yaml +2 -2
- package/package.json +1 -1
package/dbos-config.schema.json
CHANGED
@@ -28,7 +28,7 @@
|
|
28
28
|
"type": "number",
|
29
29
|
"description": "The number of milliseconds the system waits before timing out when connecting to the application database"
|
30
30
|
},
|
31
|
-
"
|
31
|
+
"app_db_name": {
|
32
32
|
"type": "string",
|
33
33
|
"description": "The name of the application database"
|
34
34
|
},
|
@@ -36,10 +36,7 @@
|
|
36
36
|
"type": "string",
|
37
37
|
"description": "If using SSL/TLS to securely connect to a database, path to an SSL root certificate file"
|
38
38
|
},
|
39
|
-
"
|
40
|
-
"type": "string"
|
41
|
-
},
|
42
|
-
"user_dbclient": {
|
39
|
+
"app_db_client": {
|
43
40
|
"type": "string",
|
44
41
|
"description": "Specify the database client to use to connect to the application database",
|
45
42
|
"enum": [
|
@@ -63,7 +60,7 @@
|
|
63
60
|
"port",
|
64
61
|
"username",
|
65
62
|
"password",
|
66
|
-
"
|
63
|
+
"app_db_name"
|
67
64
|
]
|
68
65
|
},
|
69
66
|
"telemetry": {
|
package/dbos-test-config.yaml
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"delete-app.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/delete-app.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"delete-app.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/delete-app.ts"],"names":[],"mappings":"AAGA,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA+B7D"}
|
@@ -6,15 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.deleteApp = void 0;
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
8
8
|
const cloudutils_1 = require("../cloudutils");
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
10
9
|
async function deleteApp(host) {
|
11
10
|
const logger = (0, cloudutils_1.getLogger)();
|
12
11
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
13
12
|
const bearerToken = "Bearer " + userCredentials.token;
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
const appName = (0, cloudutils_1.retrieveApplicationName)(logger);
|
14
|
+
if (appName === null) {
|
15
|
+
return 1;
|
16
|
+
}
|
18
17
|
logger.info(`Deleting application: ${appName}`);
|
19
18
|
try {
|
20
19
|
await axios_1.default.delete(`https://${host}/v1alpha1/${userCredentials.userName}/applications/${appName}`, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"delete-app.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/delete-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,
|
1
|
+
{"version":3,"file":"delete-app.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/delete-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,8CAAkI;AAE3H,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,MAAM,MAAM,GAAG,IAAA,sBAAS,GAAE,CAAA;IAC1B,MAAM,eAAe,GAAG,IAAA,gCAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,MAAM,OAAO,GAAG,IAAA,oCAAuB,EAAC,MAAM,CAAC,CAAC;IAChD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,yBAAyB,OAAO,EAAE,CAAC,CAAA;IAE/C,IAAI,CAAC;QACH,MAAM,eAAK,CAAC,MAAM,CAAC,WAAW,IAAI,aAAa,eAAe,CAAC,QAAQ,iBAAiB,OAAO,EAAE,EAAE;YACjG,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;IACX,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,UAAU,GAAG,gCAAgC,OAAO,EAAE,CAAC;QAC7D,MAAM,UAAU,GAAG,CAAe,CAAC;QACnC,IAAI,IAAA,oCAAuB,EAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC;YACvD,IAAA,4BAAe,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAC1C,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,KAAK,CAAC,GAAG,UAAU,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AA/BD,8BA+BC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deploy-app-code.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/deploy-app-code.ts"],"names":[],"mappings":"AAcA,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,
|
1
|
+
{"version":3,"file":"deploy-app-code.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/deploy-app-code.ts"],"names":[],"mappings":"AAcA,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAsGlF"}
|
@@ -14,9 +14,10 @@ async function deployAppCode(host, docker) {
|
|
14
14
|
const logger = (0, cloudutils_1.getLogger)();
|
15
15
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
16
16
|
const bearerToken = "Bearer " + userCredentials.token;
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
const appName = (0, cloudutils_1.retrieveApplicationName)(logger);
|
18
|
+
if (appName === null) {
|
19
|
+
return 1;
|
20
|
+
}
|
20
21
|
logger.info(`Loaded application name from package.json: ${appName}`);
|
21
22
|
(0, cloudutils_1.createDirectory)(deployDirectoryName);
|
22
23
|
// Verify that package-lock.json exists
|
@@ -126,7 +127,7 @@ RUN apt update
|
|
126
127
|
RUN apt install -y zip
|
127
128
|
WORKDIR /app
|
128
129
|
COPY . .
|
129
|
-
RUN npm install
|
130
|
+
RUN npm clean-install
|
130
131
|
RUN npm run build
|
131
132
|
RUN npm prune --omit=dev
|
132
133
|
RUN zip -ry ${appName}.zip ./* -x "${appName}.zip" -x "${deployDirectoryName}/*" > /dev/null
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"deploy-app-code.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/deploy-app-code.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,iDAAyC;AACzC,2BAA+C;AAC/C,
|
1
|
+
{"version":3,"file":"deploy-app-code.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/deploy-app-code.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,iDAAyC;AACzC,2BAA+C;AAC/C,8CAAwM;AACxM,gDAAwB;AAGxB,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAOnC,KAAK,UAAU,aAAa,CAAC,IAAY,EAAE,MAAe;IAC/D,MAAM,MAAM,GAAG,IAAA,sBAAS,GAAE,CAAA;IAC1B,MA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mBAAmB,IAAI,OAAO,MAAM,CAAC,CAAC;QACjG,gCAAgC;QAChC,IAAA,wBAAQ,EAAC,eAAe,aAAa,EAAE,CAAC,CAAC;QACzC,IAAA,wBAAQ,EAAC,aAAa,aAAa,EAAE,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,CAAC,KAAK,CAAC,+BAA+B,OAAO,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QAChF,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-app-info.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/get-app-info.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"get-app-info.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/get-app-info.ts"],"names":[],"mappings":"AAIA,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CA0C7E"}
|
@@ -6,14 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getAppInfo = void 0;
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
8
8
|
const cloudutils_1 = require("../cloudutils");
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
10
9
|
async function getAppInfo(host, json) {
|
11
10
|
const logger = (0, cloudutils_1.getLogger)();
|
12
11
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
13
12
|
const bearerToken = "Bearer " + userCredentials.token;
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
const appName = (0, cloudutils_1.retrieveApplicationName)(logger, json);
|
14
|
+
if (appName === null) {
|
15
|
+
return 1;
|
16
|
+
}
|
17
17
|
if (!json) {
|
18
18
|
logger.info(`Retrieving info for application: ${appName}`);
|
19
19
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-app-info.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/get-app-info.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA2C;AAC3C,
|
1
|
+
{"version":3,"file":"get-app-info.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/get-app-info.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA2C;AAC3C,8CAAkI;AAG3H,KAAK,UAAU,UAAU,CAAC,IAAY,EAAE,IAAa;IAC1D,MAAM,MAAM,GAAG,IAAA,sBAAS,GAAE,CAAC;IAC3B,MAAM,eAAe,GAAG,IAAA,gCAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,MAAM,OAAO,GAAG,IAAA,oCAAuB,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACtD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,CAAC,IAAI,CAAC,oCAAoC,OAAO,EAAE,CAAC,CAAA;IAC5D,CAAC;IAED,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,eAAK,CAAC,GAAG,CAAC,WAAW,IAAI,aAAa,eAAe,CAAC,QAAQ,iBAAiB,OAAO,EAAE,EAAE;YAC1G,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,WAAW;aAC3B;SACF,CAAC,CAAC;QACH,MAAM,GAAG,GAAG,GAAG,CAAC,IAAmB,CAAA;QACnC,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACnC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,qBAAqB,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;YAC7C,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;YAC7B,OAAO,CAAC,GAAG,CAAC,2BAA2B,GAAG,CAAC,oBAAoB,EAAE,CAAC,CAAC;YACnE,OAAO,CAAC,GAAG,CAAC,8BAA8B,GAAG,CAAC,uBAAuB,EAAE,CAAC,CAAC;YACzE,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;YACrC,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;QACzC,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,UAAU,GAAG,2CAA2C,OAAO,EAAE,CAAC;QACxE,MAAM,UAAU,GAAG,CAAe,CAAC;QACnC,IAAI,IAAA,oCAAuB,EAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC;YACvD,IAAA,4BAAe,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAC1C,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,KAAK,CAAC,GAAG,UAAU,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AA1CD,gCA0CC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-app-logs.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/get-app-logs.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"get-app-logs.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/get-app-logs.ts"],"names":[],"mappings":"AAGA,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAyC5E"}
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getAppLogs = void 0;
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
8
8
|
const cloudutils_1 = require("../cloudutils");
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
10
9
|
async function getAppLogs(host, last) {
|
11
10
|
if (last != undefined && (isNaN(last) || last <= 0)) {
|
12
11
|
throw new Error('The --last parmameter must be an integer greater than 0');
|
@@ -17,9 +16,10 @@ async function getAppLogs(host, last) {
|
|
17
16
|
const logger = (0, cloudutils_1.getLogger)();
|
18
17
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
19
18
|
const bearerToken = "Bearer " + userCredentials.token;
|
20
|
-
|
21
|
-
|
22
|
-
|
19
|
+
const appName = (0, cloudutils_1.retrieveApplicationName)(logger);
|
20
|
+
if (appName === null) {
|
21
|
+
return 1;
|
22
|
+
}
|
23
23
|
logger.info(`Retrieving logs for application: ${appName}`);
|
24
24
|
try {
|
25
25
|
const res = await axios_1.default.get(`https://${host}/v1alpha1/${userCredentials.userName}/logs/applications/${appName}?last=${last}`, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"get-app-logs.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/get-app-logs.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA2C;AAC3C,
|
1
|
+
{"version":3,"file":"get-app-logs.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/get-app-logs.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA2C;AAC3C,8CAAkI;AAE3H,KAAK,UAAU,UAAU,CAAC,IAAY,EAAE,IAAY;IACzD,IAAI,IAAI,IAAI,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAC;IAC7E,CAAC;IACD,IAAI,IAAI,IAAI,SAAS,EAAE,CAAC;QACtB,IAAI,GAAG,CAAC,CAAA,CAAM,8DAA8D;IAC9E,CAAC;I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CAAC,OAAO,EAAE,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAzCD,gCAyCC"}
|
@@ -29,7 +29,7 @@ async function listApps(host, json) {
|
|
29
29
|
applications.forEach(app => {
|
30
30
|
console.log(`Application Name: ${app.Name}`);
|
31
31
|
console.log(`ID: ${app.ID}`);
|
32
|
-
console.log(`Postgres Instance Name: ${app.
|
32
|
+
console.log(`Postgres Instance Name: ${app.PostgresInstanceName}`);
|
33
33
|
console.log(`Application Database Name: ${app.ApplicationDatabaseName}`);
|
34
34
|
console.log(`Status: ${app.Status}`);
|
35
35
|
console.log(`Version: ${app.Version}`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"list-apps.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/list-apps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,8CAAyG;AAGlG,KAAK,UAAU,QAAQ,CAAC,IAAY,EAAE,IAAa;IACxD,MAAM,MAAM,GAAG,IAAA,sBAAS,GAAE,CAAC;IAC3B,MAAM,eAAe,GAAG,IAAA,gCAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,eAAK,CAAC,GAAG,CAC1B,WAAW,IAAI,aAAa,eAAe,CAAC,QAAQ,eAAe,EACnE;YACE,OAAO,EAAE;gBACP,aAAa,EAAE,WAAW;aAC3B;SACF,CACF,CAAC;QACF,MAAM,YAAY,GAAkB,IAAI,CAAC,IAAqB,CAAC;QAC/D,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,MAAM,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;YACrC,OAAO,CAAC,CAAC;QACX,CAAC;QACD,IAAI,IAAI,EAAE,CAAC;YACT,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SA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mappings":"
|
1
|
+
{"version":3,"file":"register-app.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/register-app.ts"],"names":[],"mappings":"AAGA,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAuC/E"}
|
@@ -6,15 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.registerApp = void 0;
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
8
8
|
const cloudutils_1 = require("../cloudutils");
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
10
9
|
async function registerApp(dbname, host) {
|
11
10
|
const logger = (0, cloudutils_1.getLogger)();
|
12
11
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
13
12
|
const bearerToken = "Bearer " + userCredentials.token;
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
const appName = (0, cloudutils_1.retrieveApplicationName)(logger);
|
14
|
+
if (appName === null) {
|
15
|
+
return 1;
|
16
|
+
}
|
18
17
|
logger.info(`Registering application: ${appName}`);
|
19
18
|
try {
|
20
19
|
const register = await axios_1.default.put(`https://${host}/v1alpha1/${userCredentials.userName}/applications`, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"register-app.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/register-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,
|
1
|
+
{"version":3,"file":"register-app.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/register-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,8CAAkI;AAE3H,KAAK,UAAU,WAAW,CAAC,MAAc,EAAE,IAAY;IAC5D,MAAM,MAAM,GAAG,IAAA,sBAAS,GAAE,CAAC;IAC3B,MAAM,eAAe,GAAG,IAAA,gCAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAA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loud/applications/update-app.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"update-app.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/update-app.ts"],"names":[],"mappings":"AAIA,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAsC7D"}
|
@@ -6,15 +6,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.updateApp = void 0;
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
8
8
|
const cloudutils_1 = require("../cloudutils");
|
9
|
-
const node_path_1 = __importDefault(require("node:path"));
|
10
9
|
async function updateApp(host) {
|
11
10
|
const logger = (0, cloudutils_1.getLogger)();
|
12
11
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
13
12
|
const bearerToken = "Bearer " + userCredentials.token;
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
const appName = (0, cloudutils_1.retrieveApplicationName)(logger);
|
14
|
+
if (appName === null) {
|
15
|
+
return 1;
|
16
|
+
}
|
18
17
|
logger.info(`Updating application: ${appName}`);
|
19
18
|
try {
|
20
19
|
logger.info(`Updating application ${appName}`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"update-app.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/update-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,
|
1
|
+
{"version":3,"file":"update-app.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/update-app.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,8CAAkI;AAG3H,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,MAAM,MAAM,GAAI,IAAA,sBAAS,GAAE,CAAC;IAC5B,MAAM,eAAe,GAAG,IAAA,gCAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,MAAM,OAAO,GAAG,IAAA,oCAAuB,EAAC,MAAM,CAAC,CAAC;IAChD,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,OAAO,CAAC,CAAC;IACX,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,yBAAyB,OAAO,EAAE,CAAC,CAAA;IAE/C,IAAI,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,MAAM,eAAK,CAAC,KAAK,CAC9B,WAAW,IAAI,aAAa,eAAe,CAAC,QAAQ,iBAAiB,OAAO,EAAE,EAC9E;YACE,IAAI,EAAE,OAAO;SACd,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,CAAC;IACX,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,UAAU,GAAG,8BAA8B,CAAC;QAClD,MAAM,UAAU,GAAG,CAAe,CAAC;QACnC,IAAI,IAAA,oCAAuB,EAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC;YACvD,IAAA,4BAAe,EAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAC1C,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,KAAK,CAAC,GAAG,UAAU,KAAM,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;AACH,CAAC;AAtCD,8BAsCC"}
|
@@ -26,36 +26,48 @@ program
|
|
26
26
|
});
|
27
27
|
program
|
28
28
|
.command('register')
|
29
|
-
.description('Register a user
|
29
|
+
.description('Register a user with DBOS cloud')
|
30
30
|
.requiredOption('-u, --username <string>', 'Username')
|
31
31
|
.action(async (options) => {
|
32
32
|
const exitCode = await (0, register_1.registerUser)(options.username, cloudutils_1.DBOSCloudHost);
|
33
33
|
process.exit(exitCode);
|
34
34
|
});
|
35
|
+
program
|
36
|
+
.command('logout')
|
37
|
+
.description('Log out of DBOS cloud')
|
38
|
+
.action(() => {
|
39
|
+
if ((0, cloudutils_1.credentialsExist)()) {
|
40
|
+
(0, cloudutils_1.deleteCredentials)();
|
41
|
+
}
|
42
|
+
process.exit(0);
|
43
|
+
});
|
35
44
|
/////////////////////////////
|
36
45
|
/* APPLICATIONS MANAGEMENT */
|
37
46
|
/////////////////////////////
|
38
47
|
const applicationCommands = program
|
39
|
-
.command('
|
48
|
+
.command('application')
|
49
|
+
.alias('applications')
|
50
|
+
.alias('app')
|
51
|
+
.alias('apps')
|
40
52
|
.description('Manage your DBOS applications');
|
41
53
|
applicationCommands
|
42
54
|
.command('register')
|
43
|
-
.description('Register
|
44
|
-
.requiredOption('-d, --database <string>', 'Specify
|
55
|
+
.description('Register this application')
|
56
|
+
.requiredOption('-d, --database <string>', 'Specify a Postgres database instance for this application')
|
45
57
|
.action(async (options) => {
|
46
58
|
const exitCode = await (0, applications_1.registerApp)(options.database, cloudutils_1.DBOSCloudHost);
|
47
59
|
process.exit(exitCode);
|
48
60
|
});
|
49
61
|
applicationCommands
|
50
62
|
.command('update')
|
51
|
-
.description('Update
|
63
|
+
.description('Update this application')
|
52
64
|
.action(async () => {
|
53
65
|
const exitCode = await (0, applications_1.updateApp)(cloudutils_1.DBOSCloudHost);
|
54
66
|
process.exit(exitCode);
|
55
67
|
});
|
56
68
|
applicationCommands
|
57
69
|
.command('deploy')
|
58
|
-
.description('Deploy
|
70
|
+
.description('Deploy this application to the cloud')
|
59
71
|
.option('--no-docker', 'Build the code locally without using Docker')
|
60
72
|
.action(async (options) => {
|
61
73
|
const exitCode = await (0, applications_1.deployAppCode)(cloudutils_1.DBOSCloudHost, options.docker);
|
@@ -63,22 +75,22 @@ applicationCommands
|
|
63
75
|
});
|
64
76
|
applicationCommands
|
65
77
|
.command('delete')
|
66
|
-
.description('Delete
|
78
|
+
.description('Delete this application')
|
67
79
|
.action(async () => {
|
68
80
|
const exitCode = await (0, applications_1.deleteApp)(cloudutils_1.DBOSCloudHost);
|
69
81
|
process.exit(exitCode);
|
70
82
|
});
|
71
83
|
applicationCommands
|
72
84
|
.command('list')
|
73
|
-
.description('List all
|
85
|
+
.description('List all applications')
|
74
86
|
.option('--json', 'Emit JSON output')
|
75
87
|
.action(async (options) => {
|
76
88
|
const exitCode = await (0, applications_1.listApps)(cloudutils_1.DBOSCloudHost, options.json);
|
77
89
|
process.exit(exitCode);
|
78
90
|
});
|
79
91
|
applicationCommands
|
80
|
-
.command('
|
81
|
-
.description(
|
92
|
+
.command('status')
|
93
|
+
.description("Retrieve this application's status")
|
82
94
|
.option('--json', 'Emit JSON output')
|
83
95
|
.action(async (options) => {
|
84
96
|
const exitCode = await (0, get_app_info_1.getAppInfo)(cloudutils_1.DBOSCloudHost, options.json);
|
@@ -86,46 +98,51 @@ applicationCommands
|
|
86
98
|
});
|
87
99
|
applicationCommands
|
88
100
|
.command('logs')
|
89
|
-
.description(
|
101
|
+
.description("Print this application's logs")
|
90
102
|
.option('-l, --last <integer>', 'How far back to query, in seconds from current time. By default, we retrieve all data', parseInt)
|
91
103
|
.action(async (options) => {
|
92
104
|
const exitCode = await (0, applications_1.getAppLogs)(cloudutils_1.DBOSCloudHost, options.last);
|
93
105
|
process.exit(exitCode);
|
94
106
|
});
|
95
|
-
|
96
|
-
/*
|
97
|
-
|
98
|
-
const
|
99
|
-
.command('
|
100
|
-
.
|
101
|
-
|
102
|
-
.
|
103
|
-
|
107
|
+
//////////////////////////////////
|
108
|
+
/* DATABASE INSTANCE MANAGEMENT */
|
109
|
+
//////////////////////////////////
|
110
|
+
const databaseCommands = program
|
111
|
+
.command('database')
|
112
|
+
.alias('databases')
|
113
|
+
.alias('db')
|
114
|
+
.description('Manage Postgres database instances');
|
115
|
+
databaseCommands
|
116
|
+
.command('provision')
|
117
|
+
.description("Provision a Postgres database instance")
|
118
|
+
.argument('<string>', 'database instance name')
|
104
119
|
.requiredOption('-a, --admin <string>', 'Specify the admin user')
|
105
120
|
.requiredOption('-W, --password <string>', 'Specify the admin password')
|
106
|
-
.option('-s, --sync', 'make synchronous call', true)
|
107
121
|
.action((async (dbname, options) => {
|
108
|
-
const exitCode = await (0, userdb_1.createUserDb)(cloudutils_1.DBOSCloudHost, dbname, options.admin, options.password,
|
122
|
+
const exitCode = await (0, userdb_1.createUserDb)(cloudutils_1.DBOSCloudHost, dbname, options.admin, options.password, true);
|
109
123
|
process.exit(exitCode);
|
110
124
|
}));
|
111
|
-
|
125
|
+
databaseCommands
|
112
126
|
.command('status')
|
113
|
-
.
|
127
|
+
.description("Retrieve the status of a Postgres database instance")
|
128
|
+
.argument('<string>', 'database instance name')
|
114
129
|
.option('--json', 'Emit JSON output')
|
115
130
|
.action((async (dbname, options) => {
|
116
131
|
const exitCode = await (0, userdb_1.getUserDb)(cloudutils_1.DBOSCloudHost, dbname, options.json);
|
117
132
|
process.exit(exitCode);
|
118
133
|
}));
|
119
|
-
|
134
|
+
databaseCommands
|
120
135
|
.command('list')
|
136
|
+
.description("List all your Postgres database instances")
|
121
137
|
.option('--json', 'Emit JSON output')
|
122
138
|
.action((async (options) => {
|
123
139
|
const exitCode = await (0, userdb_1.listUserDB)(cloudutils_1.DBOSCloudHost, options.json);
|
124
140
|
process.exit(exitCode);
|
125
141
|
}));
|
126
|
-
|
127
|
-
.command('
|
128
|
-
.
|
142
|
+
databaseCommands
|
143
|
+
.command('destroy')
|
144
|
+
.description("Destroy a Postgres database instance")
|
145
|
+
.argument('<string>', 'database instance name')
|
129
146
|
.action((async (dbname) => {
|
130
147
|
const exitCode = await (0, userdb_1.deleteUserDb)(cloudutils_1.DBOSCloudHost, dbname);
|
131
148
|
process.exit(exitCode);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../packages/dbos-cloud/cli.ts"],"names":[],"mappings":";;;AAEA,iDAOwB;AACxB,yCAAoC;AACpC,mCAAgC;AAChC,yCAA0C;AAC1C,qCAA6E;AAC7E,
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../packages/dbos-cloud/cli.ts"],"names":[],"mappings":";;;AAEA,iDAOwB;AACxB,yCAAoC;AACpC,mCAAgC;AAChC,yCAA0C;AAC1C,qCAA6E;AAC7E,6CAAkF;AAClF,8DAAyD;AAEzD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,8DAA8D;AAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAwB,CAAC;AAC5E,OAAO;IACL,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAE/B,qBAAqB;AACrB,qBAAqB;AACrB,qBAAqB;AAErB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,sBAAsB,CAAC;KACnC,cAAc,CAAC,yBAAyB,EAAE,UAAU,CAAC;KACrD,MAAM,CAAC,KAAK,EAAE,OAA6B,EAAE,EAAE;IAC9C,MAAM,QAAQ,GAAG,MAAM,IAAA,aAAK,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,UAAU,CAAC;KACnB,WAAW,CAAC,iCAAiC,CAAC;KAC9C,cAAc,CAAC,yBAAyB,EAAE,UAAU,CAAC;KACrD,MAAM,CAAC,KAAK,EAAE,OAA4B,EAAE,EAAE;IAC7C,MAAM,QAAQ,GAAG,MAAM,IAAA,uBAAY,EAAC,OAAO,CAAC,QAAQ,EAAE,0BAAa,CAAC,CAAC;IACrE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC;AAEH,OAAO;KACN,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AG,MAAM,IAAA,kBAAS,EAAC,0BAAa,EAAE,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IACrE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC,CAAA;AAEH,gBAAgB;KACf,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,2CAA2C,CAAC;KACxD,MAAM,CAAC,QAAQ,EAAE,kBAAkB,CAAC;KACpC,MAAM,CAAC,CAAC,KAAK,EAAE,OAAyB,EAAE,EAAE;IAC3C,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAU,EAAC,0BAAa,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9D,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC,CAAA;AAEL,gBAAgB;KACb,OAAO,CAAC,SAAS,CAAC;KAClB,WAAW,CAAC,sCAAsC,CAAC;KACnD,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC;KAC9C,MAAM,CAAC,CAAC,KAAK,EAAE,MAAc,EAAE,EAAE;IAChC,MAAM,QAAQ,GAAG,MAAM,IAAA,qBAAY,EAAC,0BAAa,EAAE,MAAM,CAAC,CAAA;IAC1D,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,CAAC;IAClC,OAAO,CAAC,UAAU,EAAE,CAAC;AACvB,CAAC"}
|
@@ -8,9 +8,11 @@ export interface DBOSCloudCredentials {
|
|
8
8
|
export declare const dbosConfigFilePath = "dbos-config.yaml";
|
9
9
|
export declare const DBOSCloudHost: string;
|
10
10
|
export declare const dbosEnvPath = ".dbos";
|
11
|
+
export declare function retrieveApplicationName(logger: Logger, silent?: boolean): string | null;
|
11
12
|
export declare function getLogger(): Logger;
|
12
13
|
export declare function getCloudCredentials(): DBOSCloudCredentials;
|
13
14
|
export declare function credentialsExist(): boolean;
|
15
|
+
export declare function deleteCredentials(): void;
|
14
16
|
export declare function runCommand(command: string, args?: string[]): Promise<number>;
|
15
17
|
export declare function readFileSync(path: string, encoding?: BufferEncoding): string | Buffer;
|
16
18
|
export declare const sleep: (ms: number) => Promise<unknown>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cloudutils.d.ts","sourceRoot":"","sources":["../../../packages/dbos-cloud/cloudutils.ts"],"names":[],"mappings":";AAEA,OAAO,EAAoC,MAAM,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"cloudutils.d.ts","sourceRoot":"","sources":["../../../packages/dbos-cloud/cloudutils.ts"],"names":[],"mappings":";AAEA,OAAO,EAAoC,MAAM,EAAE,MAAM,SAAS,CAAC;AAEnE,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAInC,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AACrD,eAAO,MAAM,aAAa,QAA8C,CAAC;AACzE,eAAO,MAAM,WAAW,UAAU,CAAC;AAEnC,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,GAAE,OAAe,GAAG,MAAM,GAAG,IAAI,CAY9F;AAGD,wBAAgB,SAAS,IAAI,MAAM,CASlC;AA+BD,wBAAgB,mBAAmB,IAAI,oBAAoB,CAgB1D;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED,wBAAgB,iBAAiB,SAEhC;AAGD,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBhF;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,cAAuB,GAAG,MAAM,GAAG,MAAM,CAa7F;AAED,eAAO,MAAM,KAAK,OAAQ,MAAM,qBAA0C,CAAC;AAE3E,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;AAGrC,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEhE;AAED,UAAU,qBAAqB;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,qBAAqB,CAKlF;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,QAI3D"}
|
@@ -3,14 +3,29 @@ 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.handleAPIErrors = exports.isCloudAPIErrorResponse = exports.createDirectory = exports.sleep = exports.readFileSync = exports.runCommand = exports.credentialsExist = exports.getCloudCredentials = exports.getLogger = exports.dbosEnvPath = exports.DBOSCloudHost = exports.dbosConfigFilePath = void 0;
|
6
|
+
exports.handleAPIErrors = exports.isCloudAPIErrorResponse = exports.createDirectory = exports.sleep = exports.readFileSync = exports.runCommand = exports.deleteCredentials = exports.credentialsExist = exports.getCloudCredentials = exports.getLogger = exports.retrieveApplicationName = exports.dbosEnvPath = exports.DBOSCloudHost = exports.dbosConfigFilePath = void 0;
|
7
7
|
const child_process_1 = require("child_process");
|
8
8
|
const winston_1 = require("winston");
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
10
10
|
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
11
|
+
const node_path_1 = __importDefault(require("node:path"));
|
11
12
|
exports.dbosConfigFilePath = "dbos-config.yaml";
|
12
13
|
exports.DBOSCloudHost = process.env.DBOS_DOMAIN || "cloud.dbos.dev";
|
13
14
|
exports.dbosEnvPath = ".dbos";
|
15
|
+
function retrieveApplicationName(logger, silent = false) {
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
17
|
+
const packageJson = require(node_path_1.default.join(process.cwd(), 'package.json'));
|
18
|
+
const appName = packageJson.name;
|
19
|
+
if (appName === undefined) {
|
20
|
+
logger.error("Error: cannot find a valid package.json file. Please run this command in an application root directory.");
|
21
|
+
return null;
|
22
|
+
}
|
23
|
+
if (!silent) {
|
24
|
+
logger.info(`Loaded application name from package.json: ${appName}`);
|
25
|
+
}
|
26
|
+
return appName;
|
27
|
+
}
|
28
|
+
exports.retrieveApplicationName = retrieveApplicationName;
|
14
29
|
// FIXME: we should have a global instance of the logger created in cli.ts
|
15
30
|
function getLogger() {
|
16
31
|
const winstonTransports = [];
|
@@ -65,6 +80,10 @@ function credentialsExist() {
|
|
65
80
|
return fs_1.default.existsSync(`./${exports.dbosEnvPath}/credentials`);
|
66
81
|
}
|
67
82
|
exports.credentialsExist = credentialsExist;
|
83
|
+
function deleteCredentials() {
|
84
|
+
fs_1.default.unlinkSync(`./${exports.dbosEnvPath}/credentials`);
|
85
|
+
}
|
86
|
+
exports.deleteCredentials = deleteCredentials;
|
68
87
|
// Run a command, streaming its output to stdout
|
69
88
|
function runCommand(command, args = []) {
|
70
89
|
return new Promise((resolve, reject) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cloudutils.js","sourceRoot":"","sources":["../../../packages/dbos-cloud/cloudutils.ts"],"names":[],"mappings":";;;;;;AACA,iDAAoD;AACpD,qCAAmE;AACnE,4CAAoB;AAEpB,gEAA+B;
|
1
|
+
{"version":3,"file":"cloud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AC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACjD,CAAC;AAFD,0CAEC;AAQD,SAAgB,uBAAuB,CAAC,GAAY;IAClD,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI;QAC5C,SAAS,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,SAAS,CAAC,KAAK,QAAQ;QACtD,YAAY,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,YAAY,CAAC,KAAK,QAAQ;QAC5D,WAAW,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,WAAW,CAAC,KAAK,QAAQ,CAAC;AAC/D,CAAC;AALD,0DAKC;AAED,SAAgB,eAAe,CAAC,KAAa,EAAE,CAAa;IAC1D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,IAAI,GAA0B,CAAC,CAAC,QAAQ,EAAE,IAA6B,CAAC;IAC9E,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,KAAK,KAAK,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;AACjE,CAAC;AAJD,0CAIC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../packages/dbos-cloud/register.ts"],"names":[],"mappings":"AAUA,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../packages/dbos-cloud/register.ts"],"names":[],"mappings":"AAUA,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA2DlF"}
|
@@ -31,7 +31,13 @@ async function registerUser(username, host) {
|
|
31
31
|
}
|
32
32
|
else {
|
33
33
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
34
|
-
|
34
|
+
if (userCredentials.userName !== username) {
|
35
|
+
logger.error(`You are trying to register ${username}, but are currently logged in as ${userCredentials.userName}. Please run "npx dbos-cloud logout".`);
|
36
|
+
return 1;
|
37
|
+
}
|
38
|
+
else {
|
39
|
+
logger.info(`You are currently logged in as ${userCredentials.userName}. Registering ${userCredentials.userName} with DBOS Cloud...`);
|
40
|
+
}
|
35
41
|
}
|
36
42
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
37
43
|
const bearerToken = "Bearer " + userCredentials.token;
|