@extrahorizon/exh-cli 1.13.4-dev-205-667cfa3 → 1.13.4-dev-207-4973d7d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,7 @@ async function getFromV1(name, id) {
27
27
  }
28
28
  }
29
29
  catch (error) {
30
- if (!(error instanceof javascript_sdk_1.ServiceNotFoundError)) {
30
+ if (!(error instanceof javascript_sdk_1.ServiceNotFoundError) && !(error instanceof javascript_sdk_1.ServiceUnreachableError)) {
31
31
  throw error;
32
32
  }
33
33
  }
@@ -44,7 +44,7 @@ async function getFromV2(name, id) {
44
44
  }
45
45
  }
46
46
  catch (error) {
47
- if (!(error instanceof javascript_sdk_1.ServiceNotFoundError)) {
47
+ if (!(error instanceof javascript_sdk_1.ServiceNotFoundError) && !(error instanceof javascript_sdk_1.ServiceUnreachableError)) {
48
48
  throw error;
49
49
  }
50
50
  }
@@ -12,7 +12,7 @@ async function list(isTTY) {
12
12
  templates.push(...templatesV1);
13
13
  }
14
14
  catch (error) {
15
- if (!(error instanceof javascript_sdk_1.ServiceNotFoundError)) {
15
+ if (!(error instanceof javascript_sdk_1.ServiceNotFoundError) && !(error instanceof javascript_sdk_1.ServiceUnreachableError)) {
16
16
  throw error;
17
17
  }
18
18
  }
@@ -21,7 +21,7 @@ async function list(isTTY) {
21
21
  templates.push(...templatesV2);
22
22
  }
23
23
  catch (error) {
24
- if (!(error instanceof javascript_sdk_1.ServiceNotFoundError)) {
24
+ if (!(error instanceof javascript_sdk_1.ServiceNotFoundError) && !(error instanceof javascript_sdk_1.ServiceUnreachableError)) {
25
25
  throw error;
26
26
  }
27
27
  }
@@ -29,7 +29,7 @@ async function removeFromV1(name, id) {
29
29
  return true;
30
30
  }
31
31
  catch (error) {
32
- if (!(error instanceof javascript_sdk_1.ServiceNotFoundError)) {
32
+ if (!(error instanceof javascript_sdk_1.ServiceNotFoundError) && !(error instanceof javascript_sdk_1.ServiceUnreachableError)) {
33
33
  throw error;
34
34
  }
35
35
  }
@@ -5,6 +5,7 @@ const templateRepository = require("../../../repositories/templates");
5
5
  const templateV2Repository = require("../../../repositories/templatesV2");
6
6
  const utils_1 = require("./utils");
7
7
  async function uploadTemplate(template) {
8
+ console.log(`Syncing template: '${template.name}'`);
8
9
  if ((0, utils_1.isV1Template)(template)) {
9
10
  await uploadV1Template(template);
10
11
  }
@@ -14,14 +15,12 @@ async function uploadTemplate(template) {
14
15
  }
15
16
  exports.uploadTemplate = uploadTemplate;
16
17
  async function uploadV1Template(template) {
17
- const existingTemplate = await templateRepository.findByName(template.name);
18
18
  try {
19
+ const existingTemplate = await templateRepository.findByName(template.name);
19
20
  if (!existingTemplate) {
20
- console.log(`Creating new template '${template.name}'`);
21
21
  await templateRepository.create(template);
22
22
  }
23
23
  else {
24
- console.log(`Updating existing template '${template.name}'`);
25
24
  await templateRepository.update(existingTemplate.id, template);
26
25
  }
27
26
  }
@@ -30,14 +29,12 @@ async function uploadV1Template(template) {
30
29
  }
31
30
  }
32
31
  async function uploadV2Template(template) {
33
- const existingTemplate = await templateV2Repository.findByName(template.name);
34
32
  try {
33
+ const existingTemplate = await templateV2Repository.findByName(template.name);
35
34
  if (!existingTemplate) {
36
- console.log(`Creating new template '${template.name}'`);
37
35
  await templateV2Repository.create(template);
38
36
  }
39
37
  else {
40
- console.log(`Updating existing template '${template.name}'`);
41
38
  const update = { description: null, inputs: null, ...template };
42
39
  await templateV2Repository.update(existingTemplate.id, update);
43
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrahorizon/exh-cli",
3
- "version": "1.13.4-dev-205-667cfa3",
3
+ "version": "1.13.4-dev-207-4973d7d",
4
4
  "main": "build/index.js",
5
5
  "exports": "./build/index.js",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  "typescript": "4.5.5"
42
42
  },
43
43
  "dependencies": {
44
- "@extrahorizon/javascript-sdk": "8.11.0",
44
+ "@extrahorizon/javascript-sdk": "8.12.0-feat-170-8c1c1e0",
45
45
  "ajv": "8.18.0",
46
46
  "archiver": "^7.0.1",
47
47
  "chalk": "^4.0.0",