@dbos-inc/dbos-sdk 0.8.12-preview → 0.8.14-preview
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/cloud-cli/applications/configure.d.ts +1 -1
- package/dist/src/cloud-cli/applications/configure.d.ts.map +1 -1
- package/dist/src/cloud-cli/applications/configure.js +27 -30
- package/dist/src/cloud-cli/applications/configure.js.map +1 -1
- package/dist/src/cloud-cli/cli.js +6 -6
- package/dist/src/cloud-cli/cli.js.map +1 -1
- package/dist/src/cloud-cli/userdb.d.ts +10 -2
- package/dist/src/cloud-cli/userdb.d.ts.map +1 -1
- package/dist/src/cloud-cli/userdb.js +38 -96
- package/dist/src/cloud-cli/userdb.js.map +1 -1
- package/dist/src/dbos-runtime/config.d.ts +0 -1
- package/dist/src/dbos-runtime/config.d.ts.map +1 -1
- package/dist/src/dbos-runtime/config.js.map +1 -1
- package/examples/hello/dbos-config.yaml +0 -1
- package/package.json +1 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare function configureApp(host: string, port: string, dbName: string): Promise<
|
1
|
+
export declare function configureApp(host: string, port: string, dbName: string): Promise<number>;
|
2
2
|
//# sourceMappingURL=configure.d.ts.map
|
@@ -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":"AAOA,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAsD9F"}
|
@@ -8,60 +8,57 @@ const axios_1 = __importDefault(require("axios"));
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
9
9
|
const yaml_1 = __importDefault(require("yaml"));
|
10
10
|
const logs_1 = require("../../telemetry/logs");
|
11
|
-
const utils_1 = require("../utils");
|
12
11
|
const config_1 = require("../../dbos-runtime/config");
|
13
|
-
const
|
12
|
+
const userdb_1 = require("../userdb");
|
14
13
|
async function configureApp(host, port, dbName) {
|
15
14
|
const logger = new logs_1.GlobalLogger();
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
},
|
24
|
-
});
|
25
|
-
// if status is not available or no hostname/port print error and exit
|
26
|
-
if (res.status != 200) {
|
27
|
-
logger.error("Error getting info for ${dbName} error: ${res.data}.");
|
28
|
-
return;
|
15
|
+
let userDBInfo;
|
16
|
+
try {
|
17
|
+
userDBInfo = await (0, userdb_1.getUserDBInfo)(host, port, dbName);
|
18
|
+
}
|
19
|
+
catch (e) {
|
20
|
+
logger.error(`error getting DB Info: ${e.message}`);
|
21
|
+
return 1;
|
29
22
|
}
|
30
|
-
|
31
|
-
const
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
33
|
-
const userdbPort = res.data.Port;
|
23
|
+
const userdbHostname = userDBInfo.HostName;
|
24
|
+
const userdbPort = userDBInfo.Port;
|
34
25
|
if (userdbHostname == "" || userdbPort == 0) {
|
35
|
-
logger.error(
|
36
|
-
return;
|
26
|
+
logger.error(`HostName: ${userdbHostname} Port: ${userdbPort} not available.`);
|
27
|
+
return 1;
|
37
28
|
}
|
38
|
-
//
|
29
|
+
// Parse the config file
|
39
30
|
const configFile = (0, config_1.loadConfigFile)(config_1.dbosConfigFilePath);
|
40
31
|
if (!configFile) {
|
41
32
|
logger.error(`failed to parse ${config_1.dbosConfigFilePath}`);
|
42
|
-
return;
|
33
|
+
return 1;
|
43
34
|
}
|
35
|
+
const certificateURL = "https://truststore.pki.rds.amazonaws.com/us-east-1/us-east-1-bundle.pem";
|
36
|
+
const certificateFile = "us-east-1-bundle.pem";
|
44
37
|
try {
|
45
|
-
|
46
|
-
|
38
|
+
const certificate = await axios_1.default.get(certificateURL, {
|
39
|
+
responseType: 'arraybuffer'
|
40
|
+
});
|
41
|
+
fs_1.default.writeFileSync(certificateFile, certificate.data);
|
47
42
|
}
|
48
43
|
catch (e) {
|
49
|
-
logger.error(e.message);
|
50
44
|
logger.error("Error downloading RDS certificate bundle. Try downloading it manually from AWS.");
|
45
|
+
logger.error(e.message);
|
46
|
+
return 1;
|
51
47
|
}
|
52
|
-
//
|
48
|
+
// Update database hostname and port
|
53
49
|
configFile.database.hostname = userdbHostname;
|
54
50
|
configFile.database.port = userdbPort;
|
55
|
-
configFile.database.ssl_ca =
|
56
|
-
//
|
51
|
+
configFile.database.ssl_ca = certificateFile;
|
52
|
+
// Save the updated config file
|
57
53
|
try {
|
58
54
|
fs_1.default.writeFileSync(`${config_1.dbosConfigFilePath}`, yaml_1.default.stringify(configFile));
|
59
55
|
}
|
60
56
|
catch (e) {
|
61
57
|
logger.error(`failed to write ${config_1.dbosConfigFilePath}: ${e.message}`);
|
62
|
-
return;
|
58
|
+
return 1;
|
63
59
|
}
|
64
60
|
logger.info(`Successfully configured user database at ${userdbHostname}:${userdbPort}.`);
|
61
|
+
return 0;
|
65
62
|
}
|
66
63
|
exports.configureApp = configureApp;
|
67
64
|
//# 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,+CAAoD;AACpD,
|
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,sDAA2F;AAC3F,sCAA0D;AAEnD,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,IAAY,EAAE,MAAc;IACzE,MAAM,MAAM,GAAG,IAAI,mBAAY,EAAE,CAAC;IAElC,IAAI,UAAsC,CAAC;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AAC,IAAI,GAAG,UAAU,CAAA;IACrC,UAAU,CAAC,QAAQ,CAAC,MAAM,GAAG,eAAe,CAAA;IAE5C,+BAA+B;IAC/B,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,CAAC,CAAC;KACV;IAED,MAAM,CAAC,IAAI,CAAC,4CAA4C,cAAc,IAAI,UAAU,GAAG,CAAC,CAAA;IACxF,OAAO,CAAC,CAAA;AACZ,CAAC;AAtDD,oCAsDC"}
|
@@ -110,7 +110,8 @@ applicationCommands
|
|
110
110
|
.option('-d, --dbname <string>', 'Specify the name of an already setup RDS user databases')
|
111
111
|
.action(async (options) => {
|
112
112
|
const { host, port } = applicationCommands.opts();
|
113
|
-
await (0, applications_1.configureApp)(host, port, options.dbname);
|
113
|
+
const exitCode = await (0, applications_1.configureApp)(host, port, options.dbname);
|
114
|
+
process.exit(exitCode);
|
114
115
|
});
|
115
116
|
//////////////////////////////
|
116
117
|
/* USER DATABASE MANAGEMENT */
|
@@ -125,7 +126,7 @@ userdbCommands
|
|
125
126
|
.argument('<string>', 'database name')
|
126
127
|
.option('-a, --admin <string>', 'Specify the admin user', 'postgres')
|
127
128
|
.option('-W, --password <string>', 'Specify the admin password', 'postgres')
|
128
|
-
.option('-s, --sync', 'make synchronous call',
|
129
|
+
.option('-s, --sync', 'make synchronous call', true)
|
129
130
|
.action((async (dbname, options) => {
|
130
131
|
const { host, port } = userdbCommands.opts();
|
131
132
|
await (0, userdb_1.createUserDb)(host, port, dbname, options.admin, options.password, options.sync);
|
@@ -140,10 +141,9 @@ userdbCommands
|
|
140
141
|
userdbCommands
|
141
142
|
.command('delete')
|
142
143
|
.argument('<string>', 'database name')
|
143
|
-
.
|
144
|
-
.action((async (dbname, options) => {
|
144
|
+
.action((async (dbname) => {
|
145
145
|
const { host, port } = userdbCommands.opts();
|
146
|
-
await (0, userdb_1.deleteUserDb)(host, port, dbname
|
146
|
+
await (0, userdb_1.deleteUserDb)(host, port, dbname);
|
147
147
|
}));
|
148
148
|
userdbCommands
|
149
149
|
.command('migrate')
|
@@ -154,7 +154,7 @@ userdbCommands
|
|
154
154
|
userdbCommands
|
155
155
|
.command('rollbackmigration')
|
156
156
|
.action((() => {
|
157
|
-
const exitCode = (0, userdb_1.
|
157
|
+
const exitCode = (0, userdb_1.rollbackMigration)();
|
158
158
|
process.exit(exitCode);
|
159
159
|
}));
|
160
160
|
program.parse(process.argv);
|
@@ -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,qCAA6F;AAC7F,mCAA2C;AAE3C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,MAAM,YAAY,GAAG,WAAW,CAAA;AAChC,MAAM,YAAY,GAAG,MAAM,CAAA;AAE3B,8DAA8D;AAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,uBAAuB,CAAwB,CAAC;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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AAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE;IACjC,OAAO,CAAC,UAAU,EAAE,CAAC;CACtB"}
|
@@ -1,6 +1,14 @@
|
|
1
|
+
export interface UserDBInstance {
|
2
|
+
readonly DBName: string;
|
3
|
+
readonly UserID: string;
|
4
|
+
readonly Status: string;
|
5
|
+
readonly HostName: string;
|
6
|
+
readonly Port: number;
|
7
|
+
}
|
1
8
|
export declare function createUserDb(host: string, port: string, dbName: string, adminName: string, adminPassword: string, sync: boolean): Promise<void>;
|
2
|
-
export declare function deleteUserDb(host: string, port: string, dbName: string
|
9
|
+
export declare function deleteUserDb(host: string, port: string, dbName: string): Promise<void>;
|
3
10
|
export declare function getUserDb(host: string, port: string, dbName: string): Promise<void>;
|
4
11
|
export declare function migrate(): number;
|
5
|
-
export declare function
|
12
|
+
export declare function rollbackMigration(): number;
|
13
|
+
export declare function getUserDBInfo(host: string, port: string, dbName: string): Promise<UserDBInstance>;
|
6
14
|
//# 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":"AAQA,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,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,iBAmCrI;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAoB5E;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAazE;AAED,wBAAgB,OAAO,IAAI,MAAM,CA6DhC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CA4B1C;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAYvG"}
|
@@ -3,13 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.
|
6
|
+
exports.getUserDBInfo = exports.rollbackMigration = exports.migrate = exports.getUserDb = exports.deleteUserDb = exports.createUserDb = void 0;
|
7
7
|
const axios_1 = __importDefault(require("axios"));
|
8
8
|
const logs_1 = require("../telemetry/logs");
|
9
9
|
const utils_1 = require("./utils");
|
10
10
|
const utils_2 = require("../utils");
|
11
11
|
const config_1 = require("../dbos-runtime/config");
|
12
12
|
const child_process_1 = require("child_process");
|
13
|
+
const user_database_1 = require("../user_database");
|
13
14
|
async function createUserDb(host, port, dbName, adminName, adminPassword, sync) {
|
14
15
|
const logger = new logs_1.GlobalLogger();
|
15
16
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
@@ -24,30 +25,12 @@ async function createUserDb(host, port, dbName, adminName, adminPassword, sync)
|
|
24
25
|
logger.info(`Successfully started creating database: ${dbName}`);
|
25
26
|
if (sync) {
|
26
27
|
let status = "";
|
27
|
-
let data;
|
28
28
|
while (status != "available") {
|
29
|
-
await (0, utils_2.sleep)(
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
logger.info(data);
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
35
|
-
status = data.Status;
|
29
|
+
await (0, utils_2.sleep)(30000);
|
30
|
+
const userDBInfo = await getUserDBInfo(host, port, dbName);
|
31
|
+
logger.info(userDBInfo);
|
32
|
+
status = userDBInfo.Status;
|
36
33
|
}
|
37
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
38
|
-
const dbhostname = data.HostName;
|
39
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
40
|
-
const dbport = data.Port;
|
41
|
-
// Update the clouddb info record
|
42
|
-
logger.info("Saving db state to cloud db");
|
43
|
-
await axios_1.default.put(`http://${host}:${port}/${userCredentials.userName}/databases/userdb/info`,
|
44
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
45
|
-
{ DBName: dbName, Status: status, HostName: dbhostname, Port: dbport }, {
|
46
|
-
headers: {
|
47
|
-
"Content-Type": "application/json",
|
48
|
-
Authorization: bearerToken,
|
49
|
-
},
|
50
|
-
});
|
51
34
|
}
|
52
35
|
}
|
53
36
|
catch (e) {
|
@@ -60,7 +43,7 @@ async function createUserDb(host, port, dbName, adminName, adminPassword, sync)
|
|
60
43
|
}
|
61
44
|
}
|
62
45
|
exports.createUserDb = createUserDb;
|
63
|
-
async function deleteUserDb(host, port, dbName
|
46
|
+
async function deleteUserDb(host, port, dbName) {
|
64
47
|
const logger = new logs_1.GlobalLogger();
|
65
48
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
66
49
|
const bearerToken = "Bearer " + userCredentials.token;
|
@@ -71,36 +54,7 @@ async function deleteUserDb(host, port, dbName, sync) {
|
|
71
54
|
Authorization: bearerToken,
|
72
55
|
},
|
73
56
|
});
|
74
|
-
logger.info(`
|
75
|
-
if (sync) {
|
76
|
-
let status = "deleting";
|
77
|
-
while (status == "deleting") {
|
78
|
-
await (0, utils_2.sleep)(60000);
|
79
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
80
|
-
let data;
|
81
|
-
try {
|
82
|
-
// HACK to exit gracefully because the get throws an exception on 500
|
83
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
84
|
-
data = await getDb(host, port, dbName);
|
85
|
-
}
|
86
|
-
catch (e) {
|
87
|
-
logger.info(`Deleted database: ${dbName}`);
|
88
|
-
break;
|
89
|
-
}
|
90
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
91
|
-
logger.info(data);
|
92
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
93
|
-
status = data.Status;
|
94
|
-
}
|
95
|
-
// Update the clouddb info record
|
96
|
-
logger.info("Saving db state to cloud db");
|
97
|
-
await axios_1.default.put(`http://${host}:${port}/${userCredentials.userName}/databases/userdb/info`, { Name: dbName, Status: "deleted", HostName: "", Port: 0 }, {
|
98
|
-
headers: {
|
99
|
-
"Content-Type": "application/json",
|
100
|
-
Authorization: bearerToken,
|
101
|
-
},
|
102
|
-
});
|
103
|
-
}
|
57
|
+
logger.info(`Database deleted: ${dbName}`);
|
104
58
|
}
|
105
59
|
catch (e) {
|
106
60
|
if (axios_1.default.isAxiosError(e) && e.response) {
|
@@ -115,9 +69,8 @@ exports.deleteUserDb = deleteUserDb;
|
|
115
69
|
async function getUserDb(host, port, dbName) {
|
116
70
|
const logger = new logs_1.GlobalLogger();
|
117
71
|
try {
|
118
|
-
|
119
|
-
|
120
|
-
logger.info(res);
|
72
|
+
const userDBInfo = await getUserDBInfo(host, port, dbName);
|
73
|
+
logger.info(userDBInfo);
|
121
74
|
}
|
122
75
|
catch (e) {
|
123
76
|
if (axios_1.default.isAxiosError(e) && e.response) {
|
@@ -131,46 +84,42 @@ async function getUserDb(host, port, dbName) {
|
|
131
84
|
exports.getUserDb = getUserDb;
|
132
85
|
function migrate() {
|
133
86
|
const logger = new logs_1.GlobalLogger();
|
134
|
-
//
|
87
|
+
// Read the configuration YAML file
|
135
88
|
const configFile = (0, config_1.loadConfigFile)(config_1.dbosConfigFilePath);
|
136
89
|
if (!configFile) {
|
137
|
-
logger.error(`
|
90
|
+
logger.error(`Failed to parse ${config_1.dbosConfigFilePath}`);
|
138
91
|
return 1;
|
139
92
|
}
|
140
|
-
|
141
|
-
if
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
const cmd = `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);
|
93
|
+
const userDBName = configFile.database.user_database;
|
94
|
+
logger.info(`Creating database ${userDBName} if it does not already exist`);
|
95
|
+
const createDB = `PGPASSWORD=${configFile.database.password} createdb -h ${configFile.database.hostname} -p ${configFile.database.port} ${userDBName} -U ${configFile.database.username} -ew ${userDBName}`;
|
96
|
+
try {
|
97
|
+
const createDBOutput = (0, child_process_1.execSync)(createDB).toString();
|
98
|
+
if (createDBOutput.includes(`database "${userDBName}" already exists`)) {
|
99
|
+
logger.info(`Database ${userDBName} already exists`);
|
152
100
|
}
|
153
|
-
|
154
|
-
|
155
|
-
logger.error(`Error creating database: ${e.message}`);
|
156
|
-
}
|
101
|
+
else {
|
102
|
+
logger.info(createDBOutput);
|
157
103
|
}
|
158
104
|
}
|
159
|
-
|
160
|
-
|
161
|
-
|
105
|
+
catch (e) {
|
106
|
+
if (e instanceof Error) {
|
107
|
+
logger.error(`Error creating database: ${e.message}`);
|
108
|
+
}
|
162
109
|
}
|
163
|
-
const
|
110
|
+
const dbType = configFile.database.user_dbclient || user_database_1.UserDatabaseName.KNEX;
|
111
|
+
const migrationScript = `node_modules/.bin/${dbType}`;
|
112
|
+
const migrationCommands = configFile.database.migrate;
|
164
113
|
try {
|
165
|
-
|
166
|
-
const command =
|
167
|
-
logger.info(
|
114
|
+
migrationCommands?.forEach((cmd) => {
|
115
|
+
const command = `node ${migrationScript} ${cmd}`;
|
116
|
+
logger.info(`Executing migration command: ${command}`);
|
168
117
|
const migrateCommandOutput = (0, child_process_1.execSync)(command).toString();
|
169
118
|
logger.info(migrateCommandOutput);
|
170
119
|
});
|
171
120
|
}
|
172
121
|
catch (e) {
|
173
|
-
logger.error("Error running migration
|
122
|
+
logger.error("Error running migration");
|
174
123
|
if (e instanceof Error) {
|
175
124
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
|
176
125
|
const stderr = e.stderr;
|
@@ -194,7 +143,7 @@ function migrate() {
|
|
194
143
|
return 0;
|
195
144
|
}
|
196
145
|
exports.migrate = migrate;
|
197
|
-
function
|
146
|
+
function rollbackMigration() {
|
198
147
|
const logger = new logs_1.GlobalLogger();
|
199
148
|
// read the yaml file
|
200
149
|
const configFile = (0, config_1.loadConfigFile)(config_1.dbosConfigFilePath);
|
@@ -220,24 +169,17 @@ function rollbackmigration() {
|
|
220
169
|
}
|
221
170
|
return 0;
|
222
171
|
}
|
223
|
-
exports.
|
224
|
-
|
225
|
-
async function getDb(host, port, dbName) {
|
172
|
+
exports.rollbackMigration = rollbackMigration;
|
173
|
+
async function getUserDBInfo(host, port, dbName) {
|
226
174
|
const userCredentials = (0, utils_1.getCloudCredentials)();
|
227
175
|
const bearerToken = "Bearer " + userCredentials.token;
|
228
|
-
const res = await axios_1.default.get(`http://${host}:${port}/${userCredentials.userName}/databases/userdb/${dbName}`, {
|
176
|
+
const res = await axios_1.default.get(`http://${host}:${port}/${userCredentials.userName}/databases/userdb/info/${dbName}`, {
|
229
177
|
headers: {
|
230
178
|
"Content-Type": "application/json",
|
231
179
|
Authorization: bearerToken,
|
232
180
|
},
|
233
181
|
});
|
234
|
-
|
235
|
-
if (res.status == axios_1.default.HttpStatusCode.Ok) {
|
236
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
237
|
-
return res.data;
|
238
|
-
}
|
239
|
-
else {
|
240
|
-
return { Status: "notfound" };
|
241
|
-
}
|
182
|
+
return res.data;
|
242
183
|
}
|
184
|
+
exports.getUserDBInfo = getUserDBInfo;
|
243
185
|
//# sourceMappingURL=userdb.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"userdb.js","sourceRoot":"","sources":["../../../src/cloud-cli/userdb.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAiD;AACjD,mCAA8C;AAC9C,oCAAiC;AACjC,mDAAwF;AACxF,iDAAyC;
|
1
|
+
{"version":3,"file":"userdb.js","sourceRoot":"","sources":["../../../src/cloud-cli/userdb.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,4CAAiD;AACjD,mCAA8C;AAC9C,oCAAiC;AACjC,mDAAwF;AACxF,iDAAyC;AACzC,oDAAoD;AAU7C,KAAK,UAAU,YAAY,CAAC,IAAY,EAAE,IAAY,EAAE,MAAc,EAAE,SAAiB,EAAE,aAAqB,EAAE,IAAa;IACpI,MAAM,MAAM,GAAG,IAAI,mBAAY,EAAE,CAAC;IAClC,MAAM,eAAe,GAAG,IAAA,2BAAmB,GAAE,CAAC;IAC9C,MAAM,WAAW,GAAG,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC;IAEtD,IAAI;QACF,MAAM,eAAK,CAAC,IAAI,CACd,UAAU,IAAI,IAAI,IAAI,IAAI,eAAe,CAAC,QAAQ,mBAAmB,EACrE,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,EACpE;YACE,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,aAAa,EAAE,WAAW;aAC3B;SACF,CACF,CAAC;QAEF,MAAM,CAAC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E,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,uBAAuB,EAAE,MAAM,CAAC;QAChC,aAAa,EAAE,MAAM,CAAC;QACtB,eAAe,EAAE,MAAM,CAAC;QACxB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,sBAAsB,EAAE,MAAM,CAAC;QAE/B,aAAa,CAAC,EAAE,gBAAgB,CAAC;QACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;IACF,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B,WAAW,EAAE,GAAG,CAAC;IACjB,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAElC,gBAAgB,CAAC,EAAE,GAAG,CAAC;CACxB;AAcD,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAa7E;AAMD,wBAAgB,eAAe,CAAC,UAAU,CAAC,EAAE,mBAAmB,GAAG,CAAC,UAAU,EAAE,iBAAiB,CAAC,CA0EjG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dbos-runtime/config.ts"],"names":[],"mappings":";;;;;;AAAA,oCAAmD;AACnD,oCAAwC;AAGxC,gDAAwB;AAExB,oDAAoD;AAGpD,6DAA6D;AAEhD,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/dbos-runtime/config.ts"],"names":[],"mappings":";;;;;;AAAA,oCAAmD;AACnD,oCAAwC;AAGxC,gDAAwB;AAExB,oDAAoD;AAGpD,6DAA6D;AAEhD,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;AA2BrD;;;;EAIE;AACF,SAAS,iBAAiB,CAAC,OAAe;IACxC,MAAM,KAAK,GAAG,cAAc,CAAC,CAAE,gDAAgD;IAC/E,OAAO,OAAO,CAAC,OAAO,C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