@dbos-inc/dbos-sdk 0.8.39-preview → 0.8.40-preview

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,11 +29,11 @@ async function deleteApp(host) {
29
29
  }
30
30
  catch (e) {
31
31
  if (axios_1.default.isAxiosError(e) && e.response) {
32
- logger.error(`failed to delete application ${appName}: ${e.response?.data}`);
32
+ logger.error(`Failed to delete application ${appName}: ${e.response?.data}`);
33
33
  return 1;
34
34
  }
35
35
  else {
36
- logger.error(`failed to delete application ${appName}: ${e.message}`);
36
+ logger.error(`Failed to delete application ${appName}: ${e.message}`);
37
37
  return 1;
38
38
  }
39
39
  }
@@ -83,11 +83,11 @@ async function deployAppCode(host, docker) {
83
83
  }
84
84
  catch (e) {
85
85
  if (axios_1.default.isAxiosError(e) && e.response) {
86
- logger.error(`failed to deploy application ${appName}: ${e.response?.data}`);
86
+ logger.error(`Failed to deploy application ${appName}: ${e.response?.data}`);
87
87
  return 1;
88
88
  }
89
89
  else {
90
- logger.error(`failed to deploy application ${appName}: ${e.message}`);
90
+ logger.error(`Failed to deploy application ${appName}: ${e.message}`);
91
91
  return 1;
92
92
  }
93
93
  }
@@ -138,7 +138,7 @@ dist/
138
138
  return true;
139
139
  }
140
140
  catch (e) {
141
- logger.error(`failed to build application ${appName}: ${e.message}`);
141
+ logger.error(`Failed to build application ${appName}: ${e.message}`);
142
142
  return false;
143
143
  }
144
144
  }
@@ -29,11 +29,11 @@ async function getAppLogs(host) {
29
29
  }
30
30
  catch (e) {
31
31
  if (axios_1.default.isAxiosError(e) && e.response) {
32
- logger.error(`failed to retrieve logs of application ${appName}: ${e.response?.data}`);
32
+ logger.error(`Failed to retrieve logs of application ${appName}: ${e.response?.data}`);
33
33
  return 1;
34
34
  }
35
35
  else {
36
- logger.error(`failed to retrieve logs of application ${appName}: ${e.message}`);
36
+ logger.error(`Failed to retrieve logs of application ${appName}: ${e.message}`);
37
37
  return 1;
38
38
  }
39
39
  }
@@ -19,7 +19,7 @@ async function listApps(host) {
19
19
  });
20
20
  const data = list.data;
21
21
  if (data.length === 0) {
22
- logger.info("no application found");
22
+ logger.info("No applications found");
23
23
  return 1;
24
24
  }
25
25
  const formattedData = [];
@@ -32,11 +32,11 @@ async function listApps(host) {
32
32
  }
33
33
  catch (e) {
34
34
  if (axios_1.default.isAxiosError(e) && e.response) {
35
- logger.error(`failed to list applications: ${e.response?.data}`);
35
+ logger.error(`Failed to list applications: ${e.response?.data}`);
36
36
  return 1;
37
37
  }
38
38
  else {
39
- logger.error(`failed to list applications: ${e.message}`);
39
+ logger.error(`Failed to list applications: ${e.message}`);
40
40
  return 1;
41
41
  }
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"list-apps.js","sourceRoot":"","sources":["../../../../src/cloud-cli/applications/list-apps.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,+CAAoD;AACpD,oCAA+C;AAGxC,KAAK,UAAU,QAAQ,CAAC,IAAY;IACzC,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,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,IAAI,GAAkB,IAAI,CAAC,IAAqB,CAAC;QACvD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACtB,MAAM,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;YACpC,OAAO,CAAC,CAAC;QACX,CAAC;QACD,MAAM,aAAa,GAAkB,EAAE,CAAA;QACvC,KAAK,MAAM,WAAW,IAAI,IAAI,EAAE,CAAC;YAC/B,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,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AC;AAnCD,4BAmCC"}
@@ -35,11 +35,11 @@ async function registerApp(dbname, host, machines) {
35
35
  }
36
36
  catch (e) {
37
37
  if (axios_1.default.isAxiosError(e) && e.response) {
38
- logger.error(`failed to register application ${appName}: ${e.response?.data}`);
38
+ logger.error(`Failed to register application ${appName}: ${e.response?.data}`);
39
39
  return 1;
40
40
  }
41
41
  else {
42
- logger.error(`failed to register application ${appName}: ${e.message}`);
42
+ logger.error(`Failed to register application ${appName}: ${e.message}`);
43
43
  return 1;
44
44
  }
45
45
  }
@@ -35,11 +35,11 @@ async function updateApp(host, machines) {
35
35
  }
36
36
  catch (e) {
37
37
  if (axios_1.default.isAxiosError(e) && e.response) {
38
- logger.error(`failed to update application ${appName}: ${e.response?.data}`);
38
+ logger.error(`Failed to update application ${appName}: ${e.response?.data}`);
39
39
  return 1;
40
40
  }
41
41
  else {
42
- e.message = `failed to update application ${appName}: ${e.message}`;
42
+ e.message = `Failed to update application ${appName}: ${e.message}`;
43
43
  logger.error(e);
44
44
  return 1;
45
45
  }
@@ -27,10 +27,10 @@ async function registerUser(username, host) {
27
27
  }
28
28
  catch (e) {
29
29
  if (axios_1.default.isAxiosError(e) && e.response) {
30
- logger.error(`failed to register user ${userName}: ${e.response.data}`);
30
+ logger.error(`Failed to register user ${userName}: ${e.response.data}`);
31
31
  }
32
32
  else {
33
- logger.error(`failed to register user ${userName}: ${e.message}`);
33
+ logger.error(`Failed to register user ${userName}: ${e.message}`);
34
34
  }
35
35
  return 1;
36
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/cloud-cli/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAe,MAAM,SAAS,CAAC;AAI5D,wBAAgB,mBAAmB,IAAI,oBAAoB,CAM1D;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAGD,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAkBhF"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/cloud-cli/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAe,MAAM,SAAS,CAAC;AAK5D,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"}
@@ -7,7 +7,13 @@ exports.runCommand = exports.credentialsExist = exports.getCloudCredentials = vo
7
7
  const login_1 = require("./login");
8
8
  const fs_1 = __importDefault(require("fs"));
9
9
  const child_process_1 = require("child_process");
10
+ const logs_1 = require("../telemetry/logs");
10
11
  function getCloudCredentials() {
12
+ const logger = new logs_1.GlobalLogger();
13
+ if (!credentialsExist()) {
14
+ logger.error("Error: not logged in");
15
+ process.exit(1);
16
+ }
11
17
  const userCredentials = JSON.parse(fs_1.default.readFileSync(`./${login_1.dbosEnvPath}/credentials`).toString("utf-8"));
12
18
  return {
13
19
  userName: userCredentials.userName,
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/cloud-cli/utils.ts"],"names":[],"mappings":";;;;;;AAAA,mCAA4D;AAC5D,4CAAoB;AACpB,iDAAoD;AAEpD,SAAgB,mBAAmB;IACjC,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,KAAK,mBAAW,cAAc,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAyB,CAAC;IAC9H,OAAO;QACL,QAAQ,EAAE,eAAe,CAAC,QAAQ;QAClC,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,EAAE,2BAA2B;KAChF,CAAC;AACJ,CAAC;AAND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inc/dbos-sdk",
3
- "version": "0.8.39-preview",
3
+ "version": "0.8.40-preview",
4
4
  "description": "A Typescript framework built on the database",
5
5
  "license": "MIT",
6
6
  "repository": {