@dbos-inc/dbos-sdk 0.9.15-preview.g3106cba55d → 0.9.16-preview
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/packages/dbos-cloud/applications/get-app-info.d.ts +2 -0
- package/dist/packages/dbos-cloud/applications/get-app-info.d.ts.map +1 -0
- package/dist/packages/dbos-cloud/applications/get-app-info.js +54 -0
- package/dist/packages/dbos-cloud/applications/get-app-info.js.map +1 -0
- package/dist/packages/dbos-cloud/applications/list-apps.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/applications/list-apps.js +2 -1
- package/dist/packages/dbos-cloud/applications/list-apps.js.map +1 -1
- package/dist/packages/dbos-cloud/applications/types.d.ts +2 -1
- package/dist/packages/dbos-cloud/applications/types.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/cli.js +16 -0
- package/dist/packages/dbos-cloud/cli.js.map +1 -1
- package/dist/packages/dbos-cloud/cloudutils.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/cloudutils.js +18 -1
- package/dist/packages/dbos-cloud/cloudutils.js.map +1 -1
- package/dist/packages/dbos-cloud/userdb.d.ts +3 -1
- package/dist/packages/dbos-cloud/userdb.d.ts.map +1 -1
- package/dist/packages/dbos-cloud/userdb.js +42 -4
- package/dist/packages/dbos-cloud/userdb.js.map +1 -1
- package/dist/src/dbos-runtime/migrate.d.ts.map +1 -1
- package/dist/src/dbos-runtime/migrate.js +12 -5
- package/dist/src/dbos-runtime/migrate.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/examples/hello/start_postgres_docker.sh +1 -0
- package/package.json +1 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"get-app-info.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/get-app-info.ts"],"names":[],"mappings":"AAKA,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAyC7E"}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.getAppInfo = void 0;
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
8
|
+
const cloudutils_1 = require("../cloudutils");
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
10
|
+
async function getAppInfo(host, json) {
|
11
|
+
const logger = (0, cloudutils_1.getLogger)();
|
12
|
+
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
13
|
+
const bearerToken = "Bearer " + userCredentials.token;
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
15
|
+
const packageJson = require(node_path_1.default.join(process.cwd(), 'package.json'));
|
16
|
+
const appName = packageJson.name;
|
17
|
+
if (!json) {
|
18
|
+
logger.info(`Retrieving info for application: ${appName}`);
|
19
|
+
}
|
20
|
+
try {
|
21
|
+
const res = await axios_1.default.get(`https://${host}/${userCredentials.userName}/application/${appName}`, {
|
22
|
+
headers: {
|
23
|
+
"Content-Type": "application/json",
|
24
|
+
Authorization: bearerToken,
|
25
|
+
}
|
26
|
+
});
|
27
|
+
const app = res.data;
|
28
|
+
if (json) {
|
29
|
+
console.log(JSON.stringify(app));
|
30
|
+
}
|
31
|
+
else {
|
32
|
+
console.log(`Application Name: ${app.Name}`);
|
33
|
+
console.log(`ID: ${app.ID}`);
|
34
|
+
console.log(`Postgres Instance Name: ${app.PostgresInstanceName}`);
|
35
|
+
console.log(`Application Database Name: ${app.ApplicationDatabaseName}`);
|
36
|
+
console.log(`Status: ${app.Status}`);
|
37
|
+
console.log(`Version: ${app.Version}`);
|
38
|
+
}
|
39
|
+
return 0;
|
40
|
+
}
|
41
|
+
catch (e) {
|
42
|
+
const errorLabel = `Failed to retrieve info for application ${appName}`;
|
43
|
+
const axiosError = e;
|
44
|
+
if ((0, cloudutils_1.isCloudAPIErrorResponse)(axiosError.response?.data)) {
|
45
|
+
(0, cloudutils_1.handleAPIErrors)(errorLabel, axiosError);
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
logger.error(`${errorLabel}: ${e.message}`);
|
49
|
+
}
|
50
|
+
return 1;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
exports.getAppInfo = getAppInfo;
|
54
|
+
//# sourceMappingURL=get-app-info.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"get-app-info.js","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/get-app-info.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA2C;AAC3C,8CAAyG;AACzG,0DAA6B;AAGtB,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,8DAA8D;IAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,mBAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAqB,CAAC;IAC1F,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC;IACjC,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,IAAI,eAAe,CAAC,QAAQ,gBAAgB,OAAO,EAAE,EAAE;YAChG,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,OA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AC,
|
1
|
+
{"version":3,"file":"list-apps.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/list-apps.ts"],"names":[],"mappings":"AAIA,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CA4C3E"}
|
@@ -29,7 +29,8 @@ 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(`
|
32
|
+
console.log(`Postgres Instance Name: ${app.ApplicationDatabaseName}`);
|
33
|
+
console.log(`Application Database Name: ${app.ApplicationDatabaseName}`);
|
33
34
|
console.log(`Status: ${app.Status}`);
|
34
35
|
console.log(`Version: ${app.Version}`);
|
35
36
|
console.log('-------------------------');
|
@@ -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,IAAI,eAAe,CAAC,QAAQ,cAAc,EACzD;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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 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../packages/dbos-cloud/applications/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uBAAuB,EAAE,MAAM,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
@@ -7,6 +7,7 @@ const login_1 = require("./login");
|
|
7
7
|
const register_1 = require("./register");
|
8
8
|
const userdb_1 = require("./userdb");
|
9
9
|
const cloudutils_1 = require("./cloudutils");
|
10
|
+
const get_app_info_1 = require("./applications/get-app-info");
|
10
11
|
const program = new commander_1.Command();
|
11
12
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
12
13
|
const packageJson = require('../../../package.json');
|
@@ -75,6 +76,14 @@ applicationCommands
|
|
75
76
|
const exitCode = await (0, applications_1.listApps)(cloudutils_1.DBOSCloudHost, options.json);
|
76
77
|
process.exit(exitCode);
|
77
78
|
});
|
79
|
+
applicationCommands
|
80
|
+
.command('get')
|
81
|
+
.description('Get application info')
|
82
|
+
.option('--json', 'Emit JSON output')
|
83
|
+
.action(async (options) => {
|
84
|
+
const exitCode = await (0, get_app_info_1.getAppInfo)(cloudutils_1.DBOSCloudHost, options.json);
|
85
|
+
process.exit(exitCode);
|
86
|
+
});
|
78
87
|
applicationCommands
|
79
88
|
.command('logs')
|
80
89
|
.description('Print the microVM logs of a deployed application')
|
@@ -107,6 +116,13 @@ userdbCommands
|
|
107
116
|
const exitCode = await (0, userdb_1.getUserDb)(cloudutils_1.DBOSCloudHost, dbname, options.json);
|
108
117
|
process.exit(exitCode);
|
109
118
|
}));
|
119
|
+
userdbCommands
|
120
|
+
.command('list')
|
121
|
+
.option('--json', 'Emit JSON output')
|
122
|
+
.action((async (options) => {
|
123
|
+
const exitCode = await (0, userdb_1.listUserDB)(cloudutils_1.DBOSCloudHost, options.json);
|
124
|
+
process.exit(exitCode);
|
125
|
+
}));
|
110
126
|
userdbCommands
|
111
127
|
.command('delete')
|
112
128
|
.argument('<string>', 'database name')
|
@@ -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,
|
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,6CAA6C;AAC7C,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,CA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E,OAAO,CAAC,IAAI,CAAC,CAAA;IACrE,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACzB,CAAC,CAAC,CAAC,CAAA;AAEH,cAAc;KACb,OAAO,CAAC,MAAM,CAAC;KACf,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,cAAc;KACX,OAAO,CAAC,QAAQ,CAAC;KACjB,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;KACrC,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"}
|
@@ -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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1 = require("child_process");
|
8
8
|
const winston_1 = require("winston");
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
10
|
+
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
10
11
|
exports.dbosConfigFilePath = "dbos-config.yaml";
|
11
12
|
exports.DBOSCloudHost = process.env.DBOS_DOMAIN || "cloud.dbos.dev";
|
12
13
|
exports.dbosEnvPath = ".dbos";
|
@@ -31,6 +32,17 @@ const consoleFormat = winston_1.format.combine(winston_1.format.errors({ stack:
|
|
31
32
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
32
33
|
return `${ts} [${level}]: ${messageString} ${stack ? "\n" + formattedStack : ""}`;
|
33
34
|
}));
|
35
|
+
function isTokenExpired(token) {
|
36
|
+
try {
|
37
|
+
const { exp } = jsonwebtoken_1.default.decode(token);
|
38
|
+
if (!exp)
|
39
|
+
return false;
|
40
|
+
return Date.now() >= exp * 1000;
|
41
|
+
}
|
42
|
+
catch (error) {
|
43
|
+
return true;
|
44
|
+
}
|
45
|
+
}
|
34
46
|
function getCloudCredentials() {
|
35
47
|
const logger = getLogger();
|
36
48
|
if (!credentialsExist()) {
|
@@ -38,10 +50,15 @@ function getCloudCredentials() {
|
|
38
50
|
process.exit(1);
|
39
51
|
}
|
40
52
|
const userCredentials = JSON.parse(fs_1.default.readFileSync(`./${exports.dbosEnvPath}/credentials`).toString("utf-8"));
|
41
|
-
|
53
|
+
const credentials = {
|
42
54
|
userName: userCredentials.userName,
|
43
55
|
token: userCredentials.token.replace(/\r|\n/g, ""), // Trim the trailing /r /n.
|
44
56
|
};
|
57
|
+
if (isTokenExpired(credentials.token)) {
|
58
|
+
logger.error("Error: Login expired. Please log in again with 'npx dbos-cloud login -u <username>'");
|
59
|
+
process.exit(1);
|
60
|
+
}
|
61
|
+
return credentials;
|
45
62
|
}
|
46
63
|
exports.getCloudCredentials = getCloudCredentials;
|
47
64
|
function credentialsExist() {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cloudutils.js","sourceRoot":"","sources":["../../../packages/dbos-cloud/cloudutils.ts"],"names":[],"mappings":";;;;;;AACA,iDAAoD;AACpD,qCAAmE;AACnE,4CAAoB;
|
1
|
+
{"version":3,"file":"cloudutils.js","sourceRoot":"","sources":["../../../packages/dbos-cloud/cloudutils.ts"],"names":[],"mappings":";;;;;;AACA,iDAAoD;AACpD,qCAAmE;AACnE,4CAAoB;AAEpB,gEAA+B;AAOlB,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;AACxC,QAAA,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,gBAAgB,CAAC;AAC5D,QAAA,WAAW,GAAG,OAAO,CAAC;AAEnC,0EAA0E;AAC1E,SAAgB,SAAS;IACvB,MAAM,iBAAiB,GAAsB,EAAE,CAAC;IAChD,iBAAiB,CAAC,IAAI,CACpB,IAAI,oBAAU,CAAC,OAAO,CAAC;QACrB,MAAM,EAAE,aAAa;QACrB,KAAK,EAAG,MAAM;KACf,CAAC,CACH,CAAC;IACF,OAAO,IAAA,sBAAY,EAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,CAAC,CAAC;AACzD,CAAC;AATD,8BASC;AAED,MAAM,aAAa,GAAG,gBAAM,CAAC,OAAO,CAClC,gBAAM,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAC9B,gBAAM,CAAC,SAAS,EAAE,EAClB,gBAAM,CAAC,QAAQ,EAAE,EACjB,gBAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE;IACrB,mEAAmE;IACnE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAClD,kJAAkJ;IAClJ,MAAM,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACpD,kJAAkJ;IAClJ,MAAM,cAAc,G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S,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,11 +1,13 @@
|
|
1
1
|
export interface UserDBInstance {
|
2
|
-
readonly
|
2
|
+
readonly PostgresInstanceName: string;
|
3
3
|
readonly Status: string;
|
4
4
|
readonly HostName: string;
|
5
5
|
readonly Port: number;
|
6
|
+
readonly AdminUsername: string;
|
6
7
|
}
|
7
8
|
export declare function createUserDb(host: string, dbName: string, adminName: string, adminPassword: string, sync: boolean): Promise<1 | 0>;
|
8
9
|
export declare function deleteUserDb(host: string, dbName: string): Promise<1 | 0>;
|
9
10
|
export declare function getUserDb(host: string, dbName: string, json: boolean): Promise<1 | 0>;
|
11
|
+
export declare function listUserDB(host: string, json: boolean): Promise<1 | 0>;
|
10
12
|
export declare function getUserDBInfo(host: string, dbName: string): Promise<UserDBInstance>;
|
11
13
|
//# sourceMappingURL=userdb.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"userdb.d.ts","sourceRoot":"","sources":["../../../packages/dbos-cloud/userdb.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,
|
1
|
+
{"version":3,"file":"userdb.d.ts","sourceRoot":"","sources":["../../../packages/dbos-cloud/userdb.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,kBAuCvH;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAwB9D;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,kBAyB1E;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,kBAqC3D;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAYzF"}
|
@@ -3,7 +3,7 @@ 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.getUserDBInfo = exports.getUserDb = exports.deleteUserDb = exports.createUserDb = void 0;
|
6
|
+
exports.getUserDBInfo = exports.listUserDB = exports.getUserDb = exports.deleteUserDb = exports.createUserDb = void 0;
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
8
8
|
const cloudutils_1 = require("./cloudutils");
|
9
9
|
const utils_1 = require("../../src/utils");
|
@@ -78,11 +78,11 @@ async function getUserDb(host, dbName, json) {
|
|
78
78
|
console.log(JSON.stringify(userDBInfo));
|
79
79
|
}
|
80
80
|
else {
|
81
|
-
|
82
|
-
console.log(`DB Name: ${userDBInfo.DBName}`);
|
81
|
+
console.log(`Postgres Instance Name: ${userDBInfo.PostgresInstanceName}`);
|
83
82
|
console.log(`Status: ${userDBInfo.Status}`);
|
84
83
|
console.log(`Host Name: ${userDBInfo.HostName}`);
|
85
84
|
console.log(`Port: ${userDBInfo.Port}`);
|
85
|
+
console.log(`Admin Username: ${userDBInfo.AdminUsername}`);
|
86
86
|
}
|
87
87
|
return 0;
|
88
88
|
}
|
@@ -99,6 +99,45 @@ async function getUserDb(host, dbName, json) {
|
|
99
99
|
}
|
100
100
|
}
|
101
101
|
exports.getUserDb = getUserDb;
|
102
|
+
async function listUserDB(host, json) {
|
103
|
+
const logger = (0, cloudutils_1.getLogger)();
|
104
|
+
try {
|
105
|
+
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
106
|
+
const bearerToken = "Bearer " + userCredentials.token;
|
107
|
+
const res = await axios_1.default.get(`https://${host}/${userCredentials.userName}/databases`, {
|
108
|
+
headers: {
|
109
|
+
"Content-Type": "application/json",
|
110
|
+
Authorization: bearerToken,
|
111
|
+
},
|
112
|
+
});
|
113
|
+
const userDBs = res.data;
|
114
|
+
if (json) {
|
115
|
+
console.log(JSON.stringify(userDBs));
|
116
|
+
}
|
117
|
+
else {
|
118
|
+
userDBs.forEach(userDBInfo => {
|
119
|
+
console.log(`Postgres Instance Name: ${userDBInfo.PostgresInstanceName}`);
|
120
|
+
console.log(`Status: ${userDBInfo.Status}`);
|
121
|
+
console.log(`Host Name: ${userDBInfo.HostName}`);
|
122
|
+
console.log(`Port: ${userDBInfo.Port}`);
|
123
|
+
console.log(`Admin Username: ${userDBInfo.AdminUsername}`);
|
124
|
+
});
|
125
|
+
}
|
126
|
+
return 0;
|
127
|
+
}
|
128
|
+
catch (e) {
|
129
|
+
const errorLabel = `Failed to retrieve info`;
|
130
|
+
const axiosError = e;
|
131
|
+
if ((0, cloudutils_1.isCloudAPIErrorResponse)(axiosError.response?.data)) {
|
132
|
+
(0, cloudutils_1.handleAPIErrors)(errorLabel, axiosError);
|
133
|
+
}
|
134
|
+
else {
|
135
|
+
logger.error(`${errorLabel}: ${e.message}`);
|
136
|
+
}
|
137
|
+
return 1;
|
138
|
+
}
|
139
|
+
}
|
140
|
+
exports.listUserDB = listUserDB;
|
102
141
|
async function getUserDBInfo(host, dbName) {
|
103
142
|
const userCredentials = (0, cloudutils_1.getCloudCredentials)();
|
104
143
|
const bearerToken = "Bearer " + userCredentials.token;
|
@@ -108,7 +147,6 @@ async function getUserDBInfo(host, dbName) {
|
|
108
147
|
Authorization: bearerToken,
|
109
148
|
},
|
110
149
|
});
|
111
|
-
// TODO: this needs a type guard
|
112
150
|
return res.data;
|
113
151
|
}
|
114
152
|
exports.getUserDBInfo = getUserDBInfo;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"userdb.js","sourceRoot":"","sources":["../../../packages/dbos-cloud/userdb.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,6CAAwG;AACxG,2CAAwC;
|
1
|
+
{"version":3,"file":"userdb.js","sourceRoot":"","sources":["../../../packages/dbos-cloud/userdb.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0C;AAC1C,6CAAwG;AACxG,2CAAwC;AAUjC,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,MAAc,EAAE,SAAiB,EAAE,aAAqB,EAAE,IAAa;IACtH,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,eAAK,CAAC,IAAI,CACd,WAAW,IAAI,IAAI,eAAe,CAAC,QAAQ,mBAAmB,EAC9D,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,IAAI,EAAE,CAAC;YACT,IAAI,MAAM,GAAG,EAAE,CAAC;YAChB,OAAO,MAAM,IAAI,WAAW,IAAI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"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/migrate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAMtC,wBAAsB,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,kBA4EzE;AAED,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,oBAwBrF;AAGD,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,kBAoBnF"}
|
@@ -19,6 +19,9 @@ async function migrate(configFile, logger) {
|
|
19
19
|
connectionTimeoutMillis: configFile.database.connectionTimeoutMillis || 3000,
|
20
20
|
database: "postgres",
|
21
21
|
};
|
22
|
+
if (configFile.database.ssl_ca) {
|
23
|
+
postgresConfig.ssl = { ca: [(0, utils_1.readFileSync)(configFile.database.ssl_ca)], rejectUnauthorized: true };
|
24
|
+
}
|
22
25
|
const postgresClient = new pg_1.Client(postgresConfig);
|
23
26
|
try {
|
24
27
|
await postgresClient.connect();
|
@@ -31,6 +34,7 @@ async function migrate(configFile, logger) {
|
|
31
34
|
else {
|
32
35
|
logger.error(e);
|
33
36
|
}
|
37
|
+
return 1;
|
34
38
|
}
|
35
39
|
finally {
|
36
40
|
await postgresClient.end();
|
@@ -79,11 +83,12 @@ async function migrate(configFile, logger) {
|
|
79
83
|
}
|
80
84
|
return 1;
|
81
85
|
}
|
86
|
+
logger.info("Migration successful!");
|
82
87
|
return 0;
|
83
88
|
}
|
84
89
|
exports.migrate = migrate;
|
85
90
|
async function checkDatabaseExists(configFile, logger) {
|
86
|
-
const
|
91
|
+
const pgUserConfig = {
|
87
92
|
host: configFile.database.hostname,
|
88
93
|
port: configFile.database.port,
|
89
94
|
user: configFile.database.username,
|
@@ -91,7 +96,10 @@ async function checkDatabaseExists(configFile, logger) {
|
|
91
96
|
connectionTimeoutMillis: configFile.database.connectionTimeoutMillis || 3000,
|
92
97
|
database: configFile.database.user_database,
|
93
98
|
};
|
94
|
-
|
99
|
+
if (configFile.database.ssl_ca) {
|
100
|
+
pgUserConfig.ssl = { ca: [(0, utils_1.readFileSync)(configFile.database.ssl_ca)], rejectUnauthorized: true };
|
101
|
+
}
|
102
|
+
const pgUserClient = new pg_1.Client(pgUserConfig);
|
95
103
|
try {
|
96
104
|
await pgUserClient.connect(); // Try to establish a connection
|
97
105
|
logger.info(`Database ${configFile.database.user_database} exists!`);
|
@@ -116,9 +124,8 @@ async function rollbackMigration(configFile, logger) {
|
|
116
124
|
const rollbackcommands = configFile.database.rollback;
|
117
125
|
try {
|
118
126
|
rollbackcommands?.forEach((cmd) => {
|
119
|
-
|
120
|
-
|
121
|
-
(0, child_process_1.execSync)(command);
|
127
|
+
logger.info("Executing " + cmd);
|
128
|
+
(0, child_process_1.execSync)(cmd);
|
122
129
|
});
|
123
130
|
}
|
124
131
|
catch (e) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../src/dbos-runtime/migrate.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC,4CAAiD;
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../src/dbos-runtime/migrate.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC,4CAAiD;AAEjD,oCAAwC;AACxC,2BAAwC;AACxC,iEAA6F;AAC7F,wDAA2E;AAEpE,KAAK,UAAU,OAAO,CAAC,UAAsB,EAAE,MAAoB;IACxE,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,aAAa,CAAC;IACrD,MAAM,CAAC,IAAI,CAAC,yCAAyC,UAAU,uBAAuB,CAAC,CAAC;IAExF,IAAI,CAAC,CAAC,MAAM,mB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