@celonis/content-cli 1.0.4 → 1.0.5

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.
@@ -22,18 +22,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  const logger_1 = require("../../../core/utils/logger");
23
23
  class ActionFlowApi {
24
24
  constructor(context) {
25
- this.httpClient = context.httpClient;
25
+ this.httpClient = () => context.httpClient;
26
26
  }
27
27
  exportRawAssets(packageId) {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
- return this.httpClient.getFile(`/ems-automation/api/root/${packageId}/export/assets`).catch(e => {
29
+ return this.httpClient().getFile(`/ems-automation/api/root/${packageId}/export/assets`).catch(e => {
30
30
  throw new logger_1.FatalError(`Problem getting Action Flow assets: ${e}`);
31
31
  });
32
32
  });
33
33
  }
34
34
  analyzeAssets(packageId) {
35
35
  return __awaiter(this, void 0, void 0, function* () {
36
- return this.httpClient.get(`/ems-automation/api/root/${packageId}/export/assets/analyze`).catch(e => {
36
+ return this.httpClient().get(`/ems-automation/api/root/${packageId}/export/assets/analyze`).catch(e => {
37
37
  throw new logger_1.FatalError(`Problem analyzing Action Flow assets: ${e}`);
38
38
  });
39
39
  });
@@ -43,7 +43,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
43
43
  const params = {
44
44
  dryRun: dryRun,
45
45
  };
46
- return this.httpClient.postFile(`/ems-automation/api/root/${packageId}/import/assets`, data, params).catch(e => {
46
+ return this.httpClient().postFile(`/ems-automation/api/root/${packageId}/import/assets`, data, params).catch(e => {
47
47
  throw new logger_1.FatalError(`Problem importing Action Flow assets: ${e}`);
48
48
  });
49
49
  });
@@ -22,14 +22,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  const logger_1 = require("../../../core/utils/logger");
23
23
  class BatchImportExportApi {
24
24
  constructor(context) {
25
- this.httpClient = context.httpClient;
25
+ this.httpClient = () => context.httpClient;
26
26
  }
27
27
  findAllActivePackages(flavors, withDependencies = false) {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
29
  const queryParams = new URLSearchParams();
30
30
  queryParams.set("withDependencies", withDependencies.toString());
31
31
  flavors.forEach(flavor => queryParams.append("flavors", flavor));
32
- return this.httpClient.get(`/package-manager/api/core/packages/export/list?${queryParams.toString()}`).catch(e => {
32
+ return this.httpClient().get(`/package-manager/api/core/packages/export/list?${queryParams.toString()}`).catch(e => {
33
33
  throw new logger_1.FatalError(`Problem getting active packages: ${e}`);
34
34
  });
35
35
  });
@@ -42,7 +42,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
42
42
  queryParams.set("variableType", variableType);
43
43
  }
44
44
  flavors.forEach(flavor => queryParams.append("flavors", flavor));
45
- return this.httpClient.get(`/package-manager/api/core/packages/export/list-by-variable-value?${queryParams.toString()}`).catch(e => {
45
+ return this.httpClient().get(`/package-manager/api/core/packages/export/list-by-variable-value?${queryParams.toString()}`).catch(e => {
46
46
  throw new logger_1.FatalError(`Problem getting active packages by variable value: ${e}`);
47
47
  });
48
48
  });
@@ -52,7 +52,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
52
52
  const queryParams = new URLSearchParams();
53
53
  packageKeys.forEach(key => queryParams.append("packageKeys", key));
54
54
  queryParams.set("withDependencies", withDependencies.toString());
55
- return this.httpClient.get(`/package-manager/api/core/packages/export/list-by-keys?${queryParams.toString()}`).catch(e => {
55
+ return this.httpClient().get(`/package-manager/api/core/packages/export/list-by-keys?${queryParams.toString()}`).catch(e => {
56
56
  throw new logger_1.FatalError(`Problem getting active packages by keys: ${e}`);
57
57
  });
58
58
  });
@@ -62,19 +62,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
62
62
  const queryParams = new URLSearchParams();
63
63
  packageKeys.forEach(packageKey => queryParams.append("packageKeys", packageKey));
64
64
  queryParams.set("withDependencies", withDependencies.toString());
65
- return this.httpClient.getFile(`/package-manager/api/core/packages/export/batch?${queryParams.toString()}`).catch(e => {
65
+ return this.httpClient().getFile(`/package-manager/api/core/packages/export/batch?${queryParams.toString()}`).catch(e => {
66
66
  throw new logger_1.FatalError(`Problem exporting packages: ${e}`);
67
67
  });
68
68
  });
69
69
  }
70
70
  importPackages(data, overwrite) {
71
71
  return __awaiter(this, void 0, void 0, function* () {
72
- return this.httpClient.postFile("/package-manager/api/core/packages/import/batch", data, { overwrite });
72
+ return this.httpClient().postFile("/package-manager/api/core/packages/import/batch", data, { overwrite });
73
73
  });
74
74
  }
75
75
  findVariablesWithValuesByPackageKeysAndVersion(packagesByKeyAndVersion) {
76
76
  return __awaiter(this, void 0, void 0, function* () {
77
- return this.httpClient.post("/package-manager/api/core/packages/export/batch/variables-with-assignments", packagesByKeyAndVersion).catch(e => {
77
+ return this.httpClient().post("/package-manager/api/core/packages/export/batch/variables-with-assignments", packagesByKeyAndVersion).catch(e => {
78
78
  throw new logger_1.FatalError(`Problem exporting package variables: ${e}`);
79
79
  });
80
80
  });
@@ -21,16 +21,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  exports.DiffApi = void 0;
22
22
  class DiffApi {
23
23
  constructor(context) {
24
- this.httpClient = context.httpClient;
24
+ this.httpClient = () => context.httpClient;
25
25
  }
26
26
  diffPackages(data) {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
- return this.httpClient.postFile("/package-manager/api/core/packages/diff/configuration", data);
28
+ return this.httpClient().postFile("/package-manager/api/core/packages/diff/configuration", data);
29
29
  });
30
30
  }
31
31
  hasChanges(data) {
32
32
  return __awaiter(this, void 0, void 0, function* () {
33
- return this.httpClient.postFile("/package-manager/api/core/packages/diff/configuration/has-changes", data);
33
+ return this.httpClient().postFile("/package-manager/api/core/packages/diff/configuration/has-changes", data);
34
34
  });
35
35
  }
36
36
  }
@@ -23,7 +23,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
23
  const logger_1 = require("../../../core/utils/logger");
24
24
  class VariableAssignmentCandidatesApi {
25
25
  constructor(context) {
26
- this.httpClient = context.httpClient;
26
+ this.httpClient = () => context.httpClient;
27
27
  }
28
28
  getCandidateAssignments(type, params) {
29
29
  return __awaiter(this, void 0, void 0, function* () {
@@ -31,7 +31,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
31
31
  throw new logger_1.FatalError(`Variable type ${type} not supported.`);
32
32
  }
33
33
  const apiUrl = variable_assignment_apis_constants_1.variableAssignmentApis[type].url + (params.toString().length ? `?${params.toString()}` : "");
34
- return this.httpClient.get(apiUrl).catch(e => {
34
+ return this.httpClient().get(apiUrl).catch(e => {
35
35
  throw new logger_1.FatalError(`Problem getting variables assignment values for type ${type}: ${e}`);
36
36
  });
37
37
  });
@@ -22,53 +22,53 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  const logger_1 = require("../../../core/utils/logger");
23
23
  class DataPoolApi {
24
24
  constructor(context) {
25
- this.httpClient = context.httpClient;
25
+ this.httpClient = () => context.httpClient;
26
26
  }
27
27
  findAllPagedPools(limit, page) {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
- return this.httpClient.get(`/integration/api/pools/paged?limit=${limit}&page=${page}`).catch(e => {
29
+ return this.httpClient().get(`/integration/api/pools/paged?limit=${limit}&page=${page}`).catch(e => {
30
30
  throw new logger_1.FatalError(`Problem getting data pools: : ${e}`);
31
31
  });
32
32
  });
33
33
  }
34
34
  executeDataPoolsBatchImport(importRequest) {
35
35
  return __awaiter(this, void 0, void 0, function* () {
36
- return this.httpClient.post("/integration/api/pool/batch-import", importRequest).catch(e => {
36
+ return this.httpClient().post("/integration/api/pool/batch-import", importRequest).catch(e => {
37
37
  throw new logger_1.FatalError(`Data Pool batch import failed: : ${e}`);
38
38
  });
39
39
  });
40
40
  }
41
41
  exportDataPool(poolId) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
- return this.httpClient.get(`/integration/api/pools/${poolId}/v2/export`).catch(e => {
43
+ return this.httpClient().get(`/integration/api/pools/${poolId}/v2/export`).catch(e => {
44
44
  throw new logger_1.FatalError(`Data Pool export failed: : ${e}`);
45
45
  });
46
46
  });
47
47
  }
48
48
  listConnections(poolId) {
49
49
  return __awaiter(this, void 0, void 0, function* () {
50
- return this.httpClient.get(`/integration/api/pools/${poolId}/overviews/data-sources`).catch(e => {
50
+ return this.httpClient().get(`/integration/api/pools/${poolId}/overviews/data-sources`).catch(e => {
51
51
  throw new logger_1.FatalError(`Can not list connections: : ${e}`);
52
52
  });
53
53
  });
54
54
  }
55
55
  getConnection(poolId, connectionId) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
- return this.httpClient.get(`/integration/api/pools/${poolId}/data-sources/${connectionId}`).catch(e => {
57
+ return this.httpClient().get(`/integration/api/pools/${poolId}/data-sources/${connectionId}`).catch(e => {
58
58
  throw new logger_1.FatalError(`Can not get connection: : ${e}`);
59
59
  });
60
60
  });
61
61
  }
62
62
  getTypedConnection(poolId, connectionId, type) {
63
63
  return __awaiter(this, void 0, void 0, function* () {
64
- return this.httpClient.get(`/integration/api/datasource/${type}/${connectionId}`).catch(e => {
64
+ return this.httpClient().get(`/integration/api/datasource/${type}/${connectionId}`).catch(e => {
65
65
  throw new logger_1.FatalError(`Can get typed connection: : ${e}`);
66
66
  });
67
67
  });
68
68
  }
69
69
  updateTypedConnection(poolId, connectionId, type, data) {
70
70
  return __awaiter(this, void 0, void 0, function* () {
71
- return this.httpClient.put(`/integration/api/datasource/${type}/${connectionId}`, data).catch(e => {
71
+ return this.httpClient().put(`/integration/api/datasource/${type}/${connectionId}`, data).catch(e => {
72
72
  throw new logger_1.FatalError(`Can not update typed connection: ${e}`);
73
73
  });
74
74
  });
@@ -22,11 +22,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  const logger_1 = require("../../../core/utils/logger");
23
23
  class AssetApi {
24
24
  constructor(context) {
25
- this.httpClient = context.httpClient;
25
+ this.httpClient = () => context.httpClient;
26
26
  }
27
27
  findAllAssets(assetType) {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
- return this.httpClient.get(this.getFindAllAssetsUrl(assetType)).catch(e => {
29
+ return this.httpClient().get(this.getFindAllAssetsUrl(assetType)).catch(e => {
30
30
  throw new logger_1.FatalError(`Problem getting assets: ${e}`);
31
31
  });
32
32
  });
@@ -21,11 +21,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  exports.ComputePoolApi = void 0;
22
22
  class ComputePoolApi {
23
23
  constructor(context) {
24
- this.httpClient = context.httpClient;
24
+ this.httpClient = () => context.httpClient;
25
25
  }
26
26
  findAllDataModelsDetails() {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
- return this.httpClient.get("/package-manager/api/compute-pools/data-models/details")
28
+ return this.httpClient().get("/package-manager/api/compute-pools/data-models/details")
29
29
  .catch(e => {
30
30
  return null;
31
31
  });
@@ -22,11 +22,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  const logger_1 = require("../../../core/utils/logger");
23
23
  class NodeApi {
24
24
  constructor(context) {
25
- this.httpClient = context.httpClient;
25
+ this.httpClient = () => context.httpClient;
26
26
  }
27
27
  findAllNodesOfType(assetType) {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
- return this.httpClient.get(`/package-manager/api/nodes?assetType=${assetType}`)
29
+ return this.httpClient().get(`/package-manager/api/nodes?assetType=${assetType}`)
30
30
  .catch(e => {
31
31
  throw new logger_1.FatalError(`Problem getting nodes of type ${assetType}: ${e}`);
32
32
  });
@@ -34,7 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34
34
  }
35
35
  findOneByKeyAndRootNodeKey(packageKey, nodeKey) {
36
36
  return __awaiter(this, void 0, void 0, function* () {
37
- return this.httpClient.get(`/package-manager/api/nodes/${packageKey}/${nodeKey}`).catch(e => {
37
+ return this.httpClient().get(`/package-manager/api/nodes/${packageKey}/${nodeKey}`).catch(e => {
38
38
  return null;
39
39
  });
40
40
  });
@@ -22,11 +22,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  const logger_1 = require("../../../core/utils/logger");
23
23
  class PackageApi {
24
24
  constructor(context) {
25
- this.httpClient = context.httpClient;
25
+ this.httpClient = () => context.httpClient;
26
26
  }
27
27
  findAllPackages() {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
- return this.httpClient.get("/package-manager/api/packages").catch(e => {
29
+ return this.httpClient().get("/package-manager/api/packages").catch(e => {
30
30
  throw new logger_1.FatalError(`Problem getting packages: ${e}`);
31
31
  });
32
32
  });
@@ -37,7 +37,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
37
37
  queryParams.set("newKey", rootPackageKey);
38
38
  queryParams.set("version", version !== null && version !== void 0 ? version : "");
39
39
  queryParams.set("excludeActionFlows", excludeActionFlows ? "true" : "false");
40
- return yield this.httpClient.downloadFile(`/package-manager/api/packages/${rootPackageKey}/export?${queryParams.toString()}`).catch(e => {
40
+ return yield this.httpClient().downloadFile(`/package-manager/api/packages/${rootPackageKey}/export?${queryParams.toString()}`).catch(e => {
41
41
  throw new logger_1.FatalError(`Package ${rootPackageKey}_${version} failed to export.`);
42
42
  });
43
43
  });
@@ -48,42 +48,42 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
48
48
  if (type) {
49
49
  queryParams.set("type", type);
50
50
  }
51
- return this.httpClient.get(`/package-manager/api/packages/with-variable-assignments?${queryParams.toString()}`).catch(e => {
51
+ return this.httpClient().get(`/package-manager/api/packages/with-variable-assignments?${queryParams.toString()}`).catch(e => {
52
52
  throw new logger_1.FatalError(`Problem getting variables of packages: : ${e}`);
53
53
  });
54
54
  });
55
55
  }
56
56
  findLatestVersionById(nodeId) {
57
57
  return __awaiter(this, void 0, void 0, function* () {
58
- return this.httpClient.get(`/package-manager/api/packages/${nodeId}/latest-version`).catch(e => {
58
+ return this.httpClient().get(`/package-manager/api/packages/${nodeId}/latest-version`).catch(e => {
59
59
  throw new logger_1.FatalError(`Problem getting latest version of package: ${e}`);
60
60
  });
61
61
  });
62
62
  }
63
63
  findActiveVersionById(nodeId) {
64
64
  return __awaiter(this, void 0, void 0, function* () {
65
- return this.httpClient.get(`/package-manager/api/packages/${nodeId}/active`).catch(e => {
65
+ return this.httpClient().get(`/package-manager/api/packages/${nodeId}/active`).catch(e => {
66
66
  throw new logger_1.FatalError(`Problem getting latest version of package: ${e}`);
67
67
  });
68
68
  });
69
69
  }
70
70
  findActiveVersionByIds(nodeIds) {
71
71
  return __awaiter(this, void 0, void 0, function* () {
72
- return this.httpClient.post("/package-manager/api/packages/active/by-ids", nodeIds).catch(e => {
72
+ return this.httpClient().post("/package-manager/api/packages/active/by-ids", nodeIds).catch(e => {
73
73
  throw new logger_1.FatalError(`Problem getting latest version of packages: ${e}`);
74
74
  });
75
75
  });
76
76
  }
77
77
  findNextVersion(nodeId) {
78
78
  return __awaiter(this, void 0, void 0, function* () {
79
- return this.httpClient.get(`/package-manager/api/packages/${nodeId}/next-version`).catch(e => {
79
+ return this.httpClient().get(`/package-manager/api/packages/${nodeId}/next-version`).catch(e => {
80
80
  throw new logger_1.FatalError(`Problem getting latest version of package: ${e}`);
81
81
  });
82
82
  });
83
83
  }
84
84
  importPackage(nodeContent, spaceId, overwrite, excludeActionFlows) {
85
85
  return __awaiter(this, void 0, void 0, function* () {
86
- yield this.httpClient.postFile("/package-manager/api/packages/import", nodeContent, {
86
+ yield this.httpClient().postFile("/package-manager/api/packages/import", nodeContent, {
87
87
  spaceId: spaceId,
88
88
  overwrite: overwrite,
89
89
  excludeActionFlows: excludeActionFlows
@@ -94,14 +94,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
94
94
  }
95
95
  movePackageToSpace(nodeId, spaceId) {
96
96
  return __awaiter(this, void 0, void 0, function* () {
97
- yield this.httpClient.put(`/package-manager/api/packages/${nodeId}/move/${spaceId}`, {}).catch(e => {
97
+ yield this.httpClient().put(`/package-manager/api/packages/${nodeId}/move/${spaceId}`, {}).catch(e => {
98
98
  throw new logger_1.FatalError(`Problem moving package: ${e}`);
99
99
  });
100
100
  });
101
101
  }
102
102
  publishPackage(activatePackage) {
103
103
  return __awaiter(this, void 0, void 0, function* () {
104
- yield this.httpClient.post(`/package-manager/api/packages/${activatePackage.packageKey}/activate`, activatePackage).catch(e => {
104
+ yield this.httpClient().post(`/package-manager/api/packages/${activatePackage.packageKey}/activate`, activatePackage).catch(e => {
105
105
  throw new logger_1.FatalError(`Problem activating package with key ${activatePackage.packageKey}: ${e}`);
106
106
  });
107
107
  });
@@ -22,11 +22,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  const logger_1 = require("../../../core/utils/logger");
23
23
  class PackageDependenciesApi {
24
24
  constructor(context) {
25
- this.httpClient = context.httpClient;
25
+ this.httpClient = () => context.httpClient;
26
26
  }
27
27
  findDependenciesOfPackage(nodeId, draftId) {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
- return this.httpClient.get(`/package-manager/api/package-dependencies/${nodeId}/by-root-draft-id/${draftId}`)
29
+ return this.httpClient().get(`/package-manager/api/package-dependencies/${nodeId}/by-root-draft-id/${draftId}`)
30
30
  .catch(e => {
31
31
  throw new logger_1.FatalError(`Problem getting dependencies of package: ${e}`);
32
32
  });
@@ -34,7 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34
34
  }
35
35
  findPackageDependenciesByIds(nodeDraftIdMap) {
36
36
  return __awaiter(this, void 0, void 0, function* () {
37
- return yield this.httpClient.post("/package-manager/api/package-dependencies/by-ids", Object.fromEntries(nodeDraftIdMap))
37
+ return yield this.httpClient().post("/package-manager/api/package-dependencies/by-ids", Object.fromEntries(nodeDraftIdMap))
38
38
  .catch(e => {
39
39
  throw new logger_1.FatalError(`Problem getting dependencies of package: ${e}`);
40
40
  });
@@ -42,21 +42,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
42
42
  }
43
43
  updatePackageDependency(nodeId, packageDependency) {
44
44
  return __awaiter(this, void 0, void 0, function* () {
45
- yield this.httpClient.put(`/package-manager/api/package-dependencies/${nodeId}/dependency/by-key/${packageDependency.key}`, packageDependency).catch(e => {
45
+ yield this.httpClient().put(`/package-manager/api/package-dependencies/${nodeId}/dependency/by-key/${packageDependency.key}`, packageDependency).catch(e => {
46
46
  throw new logger_1.FatalError(`Problem updating package dependency: ${e}`);
47
47
  });
48
48
  });
49
49
  }
50
50
  createDependencies(packageId, packageDependency) {
51
51
  return __awaiter(this, void 0, void 0, function* () {
52
- yield this.httpClient.post(`/package-manager/api/package-dependencies/${packageId}`, packageDependency).catch(e => {
52
+ yield this.httpClient().post(`/package-manager/api/package-dependencies/${packageId}`, packageDependency).catch(e => {
53
53
  throw new logger_1.FatalError(`Problem updating package dependency: ${e}`);
54
54
  });
55
55
  });
56
56
  }
57
57
  deleteDependency(packageId, packageDependencyKey) {
58
58
  return __awaiter(this, void 0, void 0, function* () {
59
- yield this.httpClient.delete(`/package-manager/api/package-dependencies/${packageId}/dependency/by-key/${packageDependencyKey}`).catch(e => {
59
+ yield this.httpClient().delete(`/package-manager/api/package-dependencies/${packageId}/dependency/by-key/${packageDependencyKey}`).catch(e => {
60
60
  throw new logger_1.FatalError(`Problem updating package dependency: ${e}`);
61
61
  });
62
62
  });
@@ -22,25 +22,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  const logger_1 = require("../../../core/utils/logger");
23
23
  class SpaceApi {
24
24
  constructor(context) {
25
- this.httpClient = context.httpClient;
25
+ this.httpClient = () => context.httpClient;
26
26
  }
27
27
  findOne(spaceId) {
28
28
  return __awaiter(this, void 0, void 0, function* () {
29
- return this.httpClient.get(`/package-manager/api/spaces/${spaceId}`).catch(e => {
29
+ return this.httpClient().get(`/package-manager/api/spaces/${spaceId}`).catch(e => {
30
30
  throw new logger_1.FatalError(`Problem getting space: ${spaceId} ${e}`);
31
31
  });
32
32
  });
33
33
  }
34
34
  findAllSpaces() {
35
35
  return __awaiter(this, void 0, void 0, function* () {
36
- return this.httpClient.get("/package-manager/api/spaces").catch(e => {
36
+ return this.httpClient().get("/package-manager/api/spaces").catch(e => {
37
37
  throw new logger_1.FatalError(`Problem getting spaces: ${e}`);
38
38
  });
39
39
  });
40
40
  }
41
41
  createSpace(space) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
- return this.httpClient.post("/package-manager/api/spaces", space).catch(e => {
43
+ return this.httpClient().post("/package-manager/api/spaces", space).catch(e => {
44
44
  throw new logger_1.FatalError(`Problem space creation: ${e}`);
45
45
  });
46
46
  });
@@ -23,11 +23,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
23
  const logger_1 = require("../../../core/utils/logger");
24
24
  class StudioVariablesApi {
25
25
  constructor(context) {
26
- this.httpClient = context.httpClient;
26
+ this.httpClient = () => context.httpClient;
27
27
  }
28
28
  assignVariableValues(packageKey, variablesAssignments) {
29
29
  return __awaiter(this, void 0, void 0, function* () {
30
- return this.httpClient.post(`/package-manager/api/nodes/by-package-key/${packageKey}/variables/values`, variablesAssignments).catch(e => {
30
+ return this.httpClient().post(`/package-manager/api/nodes/by-package-key/${packageKey}/variables/values`, variablesAssignments).catch(e => {
31
31
  throw new logger_1.FatalError(`Problem updating variables of package ${packageKey}: ${e}`);
32
32
  });
33
33
  });
@@ -36,7 +36,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
36
36
  return __awaiter(this, void 0, void 0, function* () {
37
37
  const queryParams = new url_1.URLSearchParams();
38
38
  queryParams.set("appMode", appMode);
39
- return this.httpClient.get(`/package-manager/api/nodes/by-package-key/${packageKey}/variables/runtime-values?${queryParams.toString()}`).catch(e => {
39
+ return this.httpClient().get(`/package-manager/api/nodes/by-package-key/${packageKey}/variables/runtime-values?${queryParams.toString()}`).catch(e => {
40
40
  throw new logger_1.FatalError(`Problem getting runtime variables of package ${packageKey}: ${e}`);
41
41
  });
42
42
  });
@@ -33,13 +33,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
33
  this.profileService = new profile_service_1.ProfileService();
34
34
  this.profileName = options.profile;
35
35
  }
36
+ get httpClient() {
37
+ if (!this._httpClient) {
38
+ throw new logger_1.FatalError("No profile provided. Please provide a profile or a TEAM_URL and API_TOKEN through env variables");
39
+ }
40
+ return this._httpClient;
41
+ }
36
42
  init() {
37
43
  return __awaiter(this, void 0, void 0, function* () {
38
44
  yield this.loadProfile(this.profileName);
39
45
  if (this.profile) {
40
46
  // only if a profile is available, it makes sense to provide an initialized
41
47
  // HttpClient API.
42
- this.httpClient = new http_client_1.HttpClient(this);
48
+ this._httpClient = new http_client_1.HttpClient(this);
43
49
  }
44
50
  });
45
51
  }
@@ -58,7 +64,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
58
64
  this.log.debug(`Using profile ${profileName}`);
59
65
  }
60
66
  catch (err) {
61
- this.log.error(err);
67
+ this.log.debug(err);
62
68
  this.profile = undefined;
63
69
  this.profileName = undefined;
64
70
  }
@@ -25,12 +25,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
25
25
  class BaseManager {
26
26
  constructor(context) {
27
27
  this.fileDownloadedMessage = "File downloaded successfully. New filename: ";
28
- this.httpClient = context.httpClient;
28
+ this.httpClient = () => context.httpClient;
29
29
  }
30
30
  pull() {
31
31
  return __awaiter(this, void 0, void 0, function* () {
32
32
  return new Promise((resolve, reject) => {
33
- this.httpClient
33
+ this.httpClient()
34
34
  .get(this.getConfig().pullUrl)
35
35
  .then(data => {
36
36
  try {
@@ -53,7 +53,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
53
53
  pullFile() {
54
54
  return __awaiter(this, void 0, void 0, function* () {
55
55
  return new Promise((resolve, reject) => {
56
- this.httpClient
56
+ this.httpClient()
57
57
  .downloadFile(this.getConfig().pullUrl)
58
58
  .then(data => {
59
59
  const filename = this.writeStreamToFile(data);
@@ -70,7 +70,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
70
70
  push() {
71
71
  return __awaiter(this, void 0, void 0, function* () {
72
72
  return new Promise((resolve, reject) => {
73
- this.httpClient
73
+ this.httpClient()
74
74
  .post(this.getConfig().pushUrl, this.getBody())
75
75
  .then(data => {
76
76
  logger_1.logger.info(this.getConfig().onPushSuccessMessage(data));
@@ -86,7 +86,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
86
86
  update() {
87
87
  return __awaiter(this, void 0, void 0, function* () {
88
88
  return new Promise((resolve, reject) => {
89
- this.httpClient
89
+ this.httpClient()
90
90
  .put(this.getConfig().updateUrl, this.getBody())
91
91
  .then(data => {
92
92
  logger_1.logger.info(this.getConfig().onUpdateSuccessMessage());
@@ -102,7 +102,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
102
102
  findAll() {
103
103
  return __awaiter(this, void 0, void 0, function* () {
104
104
  return new Promise((resolve, reject) => {
105
- this.httpClient
105
+ this.httpClient()
106
106
  .get(this.getConfig().findAllUrl)
107
107
  .then(data => {
108
108
  this.getConfig().onFindAll(data);
@@ -308,7 +308,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
308
308
  }
309
309
  checkIfMissingProfile(profileName, reject) {
310
310
  if (!profileName && (!process.env.TEAM_URL || !process.env.API_TOKEN)) {
311
- reject("No profile provided. Please provide a profile or an TEAM_URL and API_TOKEN through env variables");
311
+ reject("Profile not found");
312
312
  }
313
313
  }
314
314
  }
@@ -6,12 +6,13 @@ import { Profile } from "../profile/profile.interface";
6
6
  * configured upon the start of the CLI.
7
7
  */
8
8
  export declare class Context {
9
- httpClient: HttpClient;
9
+ _httpClient: HttpClient;
10
10
  profile: Profile;
11
11
  private log;
12
12
  private profileName;
13
13
  private profileService;
14
14
  constructor(options: any);
15
+ get httpClient(): HttpClient;
15
16
  init(): Promise<void>;
16
17
  private loadProfile;
17
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celonis/content-cli",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "CLI Tool to help manage content in Celonis Platform",
5
5
  "main": "content-cli.js",
6
6
  "bin": {