@dbos-inc/dbos-sdk 0.9.11-preview → 0.9.14-preview

Sign up to get free protection for your applications and to get access to all the features.
@@ -7,7 +7,6 @@ export interface DBOSCloudCredentials {
7
7
  }
8
8
  export declare const dbosConfigFilePath = "dbos-config.yaml";
9
9
  export declare const DBOSCloudHost: string;
10
- export declare const productionEnvironment: boolean;
11
10
  export declare const dbosEnvPath = ".dbos";
12
11
  export declare function getLogger(): Logger;
13
12
  export declare function getCloudCredentials(): DBOSCloudCredentials;
@@ -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;AAEnC,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,qBAAqB,SAAqC,CAAC;AACxE,eAAO,MAAM,WAAW,UAAU,CAAC;AAGnC,wBAAgB,SAAS,IAAI,MAAM,CASlC;AAqBD,wBAAgB,mBAAmB,IAAI,oBAAoB,CAW1D;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;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,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,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,13 +3,12 @@ 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.productionEnvironment = exports.DBOSCloudHost = exports.dbosConfigFilePath = void 0;
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;
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
  exports.dbosConfigFilePath = "dbos-config.yaml";
11
11
  exports.DBOSCloudHost = process.env.DBOS_DOMAIN || "cloud.dbos.dev";
12
- exports.productionEnvironment = exports.DBOSCloudHost === "cloud.dbos.dev";
13
12
  exports.dbosEnvPath = ".dbos";
14
13
  // FIXME: we should have a global instance of the logger created in cli.ts
15
14
  function getLogger() {
@@ -1 +1 @@
1
- {"version":3,"file":"cloudutils.js","sourceRoot":"","sources":["../../../packages/dbos-cloud/cloudutils.ts"],"names":[],"mappings":";;;;;;AACA,iDAAoD;AACpD,qCAAmE;AACnE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AAa;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,5 +1,2 @@
1
- export declare const Auth0Domain: string;
2
- export declare const DBOSClientID: string;
3
- export declare const DBOSCloudIdentifier = "dbos-cloud-api";
4
1
  export declare function login(username: string): Promise<number>;
5
2
  //# sourceMappingURL=login.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../packages/dbos-cloud/login.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,WAAW,QAAqE,CAAC;AAC9F,eAAO,MAAM,YAAY,QAAkG,CAAC;AAC5H,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AA8CpD,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4D7D"}
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../packages/dbos-cloud/login.ts"],"names":[],"mappings":"AAyDA,wBAAsB,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4D7D"}
@@ -3,18 +3,20 @@ 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.login = exports.DBOSCloudIdentifier = exports.DBOSClientID = exports.Auth0Domain = void 0;
6
+ exports.login = void 0;
7
7
  const axios_1 = __importDefault(require("axios"));
8
8
  const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
9
9
  const jwks_rsa_1 = __importDefault(require("jwks-rsa"));
10
10
  const child_process_1 = require("child_process");
11
11
  const fs_1 = __importDefault(require("fs"));
12
12
  const cloudutils_1 = require("./cloudutils");
13
- exports.Auth0Domain = cloudutils_1.productionEnvironment ? 'login.dbos.dev' : 'dbos-inc.us.auth0.com';
14
- exports.DBOSClientID = cloudutils_1.productionEnvironment ? '6p7Sjxf13cyLMkdwn14MxlH7JdhILled' : 'G38fLmVErczEo9ioCFjVIHea6yd0qMZu';
15
- exports.DBOSCloudIdentifier = 'dbos-cloud-api';
13
+ const DBOSCloudHost = process.env.DBOS_DOMAIN || "cloud.dbos.dev";
14
+ const productionEnvironment = DBOSCloudHost === "cloud.dbos.dev";
15
+ const Auth0Domain = productionEnvironment ? 'login.dbos.dev' : 'dbos-inc.us.auth0.com';
16
+ const DBOSClientID = productionEnvironment ? '6p7Sjxf13cyLMkdwn14MxlH7JdhILled' : 'G38fLmVErczEo9ioCFjVIHea6yd0qMZu';
17
+ const DBOSCloudIdentifier = 'dbos-cloud-api';
16
18
  const client = (0, jwks_rsa_1.default)({
17
- jwksUri: `https://${exports.Auth0Domain}/.well-known/jwks.json`
19
+ jwksUri: `https://${Auth0Domain}/.well-known/jwks.json`
18
20
  });
19
21
  async function getSigningKey(kid) {
20
22
  const key = await client.getSigningKey(kid);
@@ -42,9 +44,9 @@ async function login(username) {
42
44
  logger.info(`Please authenticate with DBOS Cloud!`);
43
45
  const deviceCodeRequest = {
44
46
  method: 'POST',
45
- url: `https://${exports.Auth0Domain}/oauth/device/code`,
47
+ url: `https://${Auth0Domain}/oauth/device/code`,
46
48
  headers: { 'content-type': 'application/x-www-form-urlencoded' },
47
- data: { client_id: exports.DBOSClientID, scope: 'sub', audience: exports.DBOSCloudIdentifier }
49
+ data: { client_id: DBOSClientID, scope: 'sub', audience: DBOSCloudIdentifier }
48
50
  };
49
51
  let deviceCodeResponse;
50
52
  try {
@@ -61,12 +63,12 @@ async function login(username) {
61
63
  console.log(`Login URL: ${deviceCodeResponse.verification_uri_complete}`);
62
64
  const tokenRequest = {
63
65
  method: 'POST',
64
- url: `https://${exports.Auth0Domain}/oauth/token`,
66
+ url: `https://${Auth0Domain}/oauth/token`,
65
67
  headers: { 'content-type': 'application/x-www-form-urlencoded' },
66
68
  data: new URLSearchParams({
67
69
  grant_type: 'urn:ietf:params:oauth:grant-type:device_code',
68
70
  device_code: deviceCodeResponse.device_code,
69
- client_id: exports.DBOSClientID
71
+ client_id: DBOSClientID
70
72
  })
71
73
  };
72
74
  let tokenResponse;
@@ -1 +1 @@
1
- {"version":3,"file":"login.js","sourceRoot":"","sources":["../../../packages/dbos-cloud/login.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,gEAA+C;AAC/C,wDAAkC;AAClC,iDAAyC;AACzC,4CAAoB;AACpB,6CAA0G;AAE7F,QAAA,WAAW,GAAG,kCAAqB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,uBAAuB,CAAC;AACjF,QAAA,YAAY,GAAG,kCAAqB,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,kCAAkC,CAAC;AAC/G,QAAA,mBAAmB,GAAG,gBAAgB,CAAC;AAiBpD,MAAM,MAAM,GAAG,IAAA,kBAAU,EAAC;IACxB,OAAO,EAAE,WAAW,mBAAW,wBAAwB;CACxD,CAAC,CAAC;AAEH,KAAK,UAAU,aAAa,CAAC,GAAW;IACtC,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,GAAG,CAAC,YAAY,EAAE,CAAC;AAC5B,CAAC;AAED,KAAK,UAAU,WAAW,CAAC,KAAa;IACtC,MAAM,OAAO,GAAG,sBAAG,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAEtD,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACnE,MAAM,IAAI,KAAK,CAAC,eAAe,CAA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AW,GAAyB;QACxC,KAAK,EAAE,aAAa,CAAC,YAAY;QACjC,QAAQ,EAAE,QAAQ;KACnB,CAAC;IACF,IAAA,wBAAQ,EAAC,YAAY,wBAAW,EAAE,CAAC,CAAC;IACpC,YAAE,CAAC,aAAa,CAAC,GAAG,wBAAW,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,wBAAW,cAAc,CAAC,CAAC;IAC9E,OAAO,CAAC,CAAC;AACX,CAAC;AA5DD,sBA4DC"}
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/init.ts"],"names":[],"mappings":"AAMA,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;CACtC;AAID,eAAO,MAAM,IAAI,QACV,MAAM,WACF,MAAM,EAAE,QACX,MAAM,eACW,UAAU,oBA6BlC,CAAA;AAED,wBAAsB,IAAI,CAAC,OAAO,EAAE,MAAM,iBAkBzC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/init.ts"],"names":[],"mappings":"AAMA,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;CACtC;AAID,eAAO,MAAM,IAAI,QACV,MAAM,WACF,MAAM,EAAE,QACX,MAAM,eACW,UAAU,oBA6BlC,CAAA;AAED,wBAAsB,IAAI,CAAC,OAAO,EAAE,MAAM,iBAmBzC"}
@@ -43,10 +43,11 @@ async function init(appName) {
43
43
  const packageJson = JSON.parse(fs_1.default.readFileSync(packageJsonName, 'utf-8'));
44
44
  packageJson.name = appName;
45
45
  fs_1.default.writeFileSync(packageJsonName, JSON.stringify(packageJson, null, 2), 'utf-8');
46
- (0, child_process_1.execSync)("npm i", { cwd: appName, stdio: 'inherit' });
47
- (0, child_process_1.execSync)("npm uninstall @dbos-inc/dbos-sdk", { cwd: appName, stdio: 'inherit' });
48
- (0, child_process_1.execSync)("npm install --save @dbos-inc/dbos-sdk", { cwd: appName, stdio: 'inherit' });
49
- (0, child_process_1.execSync)("npm install --save-dev @dbos-inc/dbos-cloud", { cwd: appName, stdio: 'inherit' });
46
+ (0, child_process_1.execSync)("npm i --no-fund", { cwd: appName, stdio: 'inherit' });
47
+ (0, child_process_1.execSync)("npm uninstall --no-fund @dbos-inc/dbos-sdk", { cwd: appName, stdio: 'inherit' });
48
+ (0, child_process_1.execSync)("npm install --no-fund --save @dbos-inc/dbos-sdk", { cwd: appName, stdio: 'inherit' });
49
+ (0, child_process_1.execSync)("npm install --no-fund --save-dev @dbos-inc/dbos-cloud", { cwd: appName, stdio: 'inherit' });
50
+ console.log("Application initialized successfully!");
50
51
  }
51
52
  exports.init = init;
52
53
  //# sourceMappingURL=init.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/dbos-runtime/init.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAyC;AACzC,gDAAuB;AACvB,4CAAmB;AACnB,iDAAwC;AACxC,oCAAoC;AAMpC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAA;AAE1B,MAAM,IAAI,GAAG,KAAK,EACvB,GAAW,EACX,OAAiB,EACjB,IAAY,EACZ,EAAE,MAAM,GAAG,QAAQ,KAAiB,EAAE,EACtC,EAAE;IAEF,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAClC,MAAM,IAAI,SAAS,CAAC,+BAA+B,CAAC,CAAA;IACtD,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,IAAA,iBAAI,EAAC,OAAO,EAAE;QACtC,GAAG,EAAE,GAAG;QAC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,MAAM,YAAY,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IACpF,MAAM,OAAO,GAAG,CAAC,IAAI,CAAC,CAAA;IACtB,MAAM,IAAA,YAAI,EAAC,YAAY,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAE3C,MAAM,eAAe,GAAG,cAAI,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAC9D,MAAM,WAAW,GAAqB,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAqB,CAAC;IAChH,WAAW,CAAC,IAAI,GAAG,OAAO,CAAC;IAC3B,YAAE,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IACjF,IAAA,wBAAQ,EAAC,iBAAiB,EAAE,EAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC,CAAA;IAC7D,IAAA,wBAAQ,EAAC,4CAA4C,EAAE,EAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC,CAAA;IACxF,IAAA,wBAAQ,EAAC,iDAAiD,EAAE,EAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC,CAAA;IAC7F,IAAA,wBAAQ,EAAC,uDAAuD,EAAE,EAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC,CAAA;IACnG,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAA;AACtD,CAAC;AAnBD,oBAmBC"}
@@ -1,5 +1,6 @@
1
1
  import { GlobalLogger } from "../telemetry/logs";
2
2
  import { ConfigFile } from "./config";
3
3
  export declare function migrate(configFile: ConfigFile, logger: GlobalLogger): Promise<1 | 0>;
4
+ export declare function checkDatabaseExists(configFile: ConfigFile, logger: GlobalLogger): Promise<boolean>;
4
5
  export declare function rollbackMigration(configFile: ConfigFile, logger: GlobalLogger): Promise<1 | 0>;
5
6
  //# sourceMappingURL=migrate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../../../src/dbos-runtime/migrate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAMtC,wBAAsB,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,kBAyEzE;AAGD,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,kBAqBnF"}
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,kBAwEzE;AAED,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,oBAqBrF;AAGD,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,kBAqBnF"}
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.rollbackMigration = exports.migrate = void 0;
3
+ exports.rollbackMigration = exports.checkDatabaseExists = exports.migrate = void 0;
4
4
  const child_process_1 = require("child_process");
5
5
  const logs_1 = require("../telemetry/logs");
6
- const user_database_1 = require("../user_database");
7
6
  const utils_1 = require("../utils");
8
7
  const pg_1 = require("pg");
9
8
  const user_db_schema_1 = require("../../schemas/user_db_schema");
@@ -11,40 +10,37 @@ const system_database_1 = require("../system_database");
11
10
  async function migrate(configFile, logger) {
12
11
  const userDBName = configFile.database.user_database;
13
12
  logger.info(`Starting migration: creating database ${userDBName} if it does not exist`);
14
- const createDB = `createdb -h ${configFile.database.hostname} -p ${configFile.database.port} ${userDBName} -U ${configFile.database.username} -ew ${userDBName}`;
15
- try {
16
- process.env.PGPASSWORD = configFile.database.password;
17
- const createDBOutput = (0, child_process_1.execSync)(createDB, { env: process.env }).toString();
18
- if (createDBOutput.includes(`database "${userDBName}" already exists`)) {
19
- logger.info(`Database ${userDBName} already exists`);
20
- }
21
- else {
22
- logger.info(createDBOutput);
13
+ if (!(await checkDatabaseExists(configFile, logger))) {
14
+ const postgresConfig = {
15
+ host: configFile.database.hostname,
16
+ port: configFile.database.port,
17
+ user: configFile.database.username,
18
+ password: configFile.database.password,
19
+ connectionTimeoutMillis: configFile.database.connectionTimeoutMillis || 3000,
20
+ database: "postgres",
21
+ };
22
+ const postgresClient = new pg_1.Client(postgresConfig);
23
+ try {
24
+ await postgresClient.connect();
25
+ await postgresClient.query(`CREATE DATABASE ${configFile.database.user_database}`);
23
26
  }
24
- }
25
- catch (e) {
26
- if (e instanceof Error) {
27
- if (e.message.includes(`database "${userDBName}" already exists`)) {
28
- logger.info(`Database ${userDBName} already exists`);
27
+ catch (e) {
28
+ if (e instanceof Error) {
29
+ logger.error(`Error creating database ${configFile.database.user_database}: ${e.message}`);
29
30
  }
30
31
  else {
31
- logger.error(`Error creating database: ${e.message}`);
32
- return 1;
32
+ logger.error(e);
33
33
  }
34
34
  }
35
- else {
36
- logger.error(e);
37
- return 1;
35
+ finally {
36
+ await postgresClient.end();
38
37
  }
39
38
  }
40
- const dbType = configFile.database.user_dbclient || user_database_1.UserDatabaseName.KNEX;
41
- const migrationScript = `node_modules/.bin/${dbType}`;
42
39
  const migrationCommands = configFile.database.migrate;
43
40
  try {
44
41
  migrationCommands?.forEach((cmd) => {
45
- const command = `node ${migrationScript} ${cmd}`;
46
- logger.info(`Executing migration command: ${command}`);
47
- const migrateCommandOutput = (0, child_process_1.execSync)(command).toString();
42
+ logger.info(`Executing migration command: ${cmd}`);
43
+ const migrateCommandOutput = (0, child_process_1.execSync)(cmd).toString();
48
44
  logger.info(migrateCommandOutput);
49
45
  });
50
46
  }
@@ -83,9 +79,34 @@ async function migrate(configFile, logger) {
83
79
  }
84
80
  return 1;
85
81
  }
82
+ logger.info("Migration successful!");
86
83
  return 0;
87
84
  }
88
85
  exports.migrate = migrate;
86
+ async function checkDatabaseExists(configFile, logger) {
87
+ const userPoolConfig = {
88
+ host: configFile.database.hostname,
89
+ port: configFile.database.port,
90
+ user: configFile.database.username,
91
+ password: configFile.database.password,
92
+ connectionTimeoutMillis: configFile.database.connectionTimeoutMillis || 3000,
93
+ database: configFile.database.user_database,
94
+ };
95
+ const pgUserClient = new pg_1.Client(userPoolConfig);
96
+ try {
97
+ await pgUserClient.connect(); // Try to establish a connection
98
+ logger.info(`Database ${configFile.database.user_database} exists!`);
99
+ return true; // If successful, return true
100
+ }
101
+ catch (error) {
102
+ logger.info(`Database ${configFile.database.user_database} does not exist, creating...`);
103
+ return false; // If connection fails, return false
104
+ }
105
+ finally {
106
+ await pgUserClient.end(); // Close pool regardless of the outcome
107
+ }
108
+ }
109
+ exports.checkDatabaseExists = checkDatabaseExists;
89
110
  // eslint-disable-next-line @typescript-eslint/require-await
90
111
  async function rollbackMigration(configFile, logger) {
91
112
  logger.info("Starting Migration Rollback");
@@ -1 +1 @@
1
- {"version":3,"file":"migrate.js","sourceRoot":"","sources":["../../../src/dbos-runtime/migrate.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC,4CAAiD;AACjD,oDAAoD;AAEpD,oCAAwC;AACxC,2BAAwC;AACxC,iEAA6F;AAC7F,wDAA2E;AAEpE,KAAK,UAAU,OAAO,CAAC,UAAsB,EAAE,MAAoB;IACxE,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAA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