@celonis/content-cli 0.13.6 → 1.0.3

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.
Files changed (247) hide show
  1. package/README.md +21 -13
  2. package/{api → commands/action-flows/action-flow}/action-flow-api.js +10 -9
  3. package/commands/{action-flow.command.js → action-flows/action-flow/action-flow-command.service.js} +11 -8
  4. package/{services/action-flow/action-flow-service.js → commands/action-flows/action-flow/action-flow.service.js} +12 -10
  5. package/commands/action-flows/module.js +88 -0
  6. package/commands/{skill.command.js → action-flows/skill/skill-command.service.js} +9 -11
  7. package/{content/factory/skill-manager.factory.js → commands/action-flows/skill/skill.manager-factory.js} +7 -4
  8. package/{content/manager → commands/action-flows/skill}/skill.manager.js +7 -4
  9. package/commands/analysis/analysis-bookmarks-command.service.js +39 -0
  10. package/{content/factory/analysis-bookmarks-manager.factory.js → commands/analysis/analysis-bookmarks.manager-factory.js} +7 -4
  11. package/{content/manager → commands/analysis}/analysis-bookmarks.manager.js +8 -5
  12. package/commands/analysis/module.js +52 -0
  13. package/commands/configuration-management/api/batch-import-export-api.js +84 -0
  14. package/{api → commands/configuration-management/api}/diff-api.js +8 -7
  15. package/commands/configuration-management/api/variable-assignment-candidates-api.js +41 -0
  16. package/{services/package-manager/batch-import-export-service.js → commands/configuration-management/batch-import-export.service.js} +31 -26
  17. package/commands/{config.command.js → configuration-management/config-command.service.js} +21 -16
  18. package/{services/package-manager/diff-service.js → commands/configuration-management/diff.service.js} +11 -8
  19. package/commands/configuration-management/module.js +102 -0
  20. package/{services/studio → commands/configuration-management}/studio.service.js +33 -24
  21. package/commands/{variable.command.js → configuration-management/variable-command.service.js} +10 -7
  22. package/{services/package-manager/variable-service.js → commands/configuration-management/variable.service.js} +36 -42
  23. package/commands/{ctp.command.js → cpm4/ctp-command.service.js} +11 -13
  24. package/{content/manager → commands/cpm4}/ctp.analysis.manager.js +3 -0
  25. package/{content/manager → commands/cpm4}/ctp.datamodel.manager.js +2 -2
  26. package/{content/factory/ctp-manager.factory.js → commands/cpm4/ctp.manager-factory.js} +9 -6
  27. package/{content/manager → commands/cpm4}/ctp.manager.js +6 -4
  28. package/commands/cpm4/module.js +46 -0
  29. package/commands/{connection.command.js → data-pipeline/connection/connection-command.service.js} +14 -11
  30. package/commands/data-pipeline/connection/connection.commands.js +65 -0
  31. package/{services → commands/data-pipeline}/connection/connection.service.js +18 -15
  32. package/{api → commands/data-pipeline/data-pool}/data-pool-api.js +14 -13
  33. package/commands/{data-pool.command.js → data-pipeline/data-pool/data-pool-command.service.js} +25 -23
  34. package/{content/factory → commands/data-pipeline/data-pool}/data-pool-manager.factory.js +9 -6
  35. package/{services → commands/data-pipeline}/data-pool/data-pool-service.js +13 -10
  36. package/commands/data-pipeline/data-pool/data-pool.commands.js +99 -0
  37. package/{content/manager → commands/data-pipeline/data-pool}/data-pool.manager.js +8 -9
  38. package/commands/data-pipeline/module.js +24 -0
  39. package/commands/profile/module.js +60 -0
  40. package/commands/profile/profile-command.service.js +94 -0
  41. package/{api → commands/studio/api}/asset-api.js +8 -7
  42. package/{api → commands/studio/api}/compute-pool-api.js +7 -6
  43. package/{api → commands/studio/api}/node-api.js +9 -8
  44. package/{api → commands/studio/api}/package-api.js +18 -17
  45. package/{api → commands/studio/api}/package-dependencies-api.js +12 -11
  46. package/{api → commands/studio/api}/space-api.js +10 -9
  47. package/commands/{analysis-bookmarks.command.js → studio/api/studio-variables-api.js} +18 -13
  48. package/commands/{asset.command.js → studio/command-service/asset-command.service.js} +21 -19
  49. package/commands/{package.command.js → studio/command-service/package-command.service.js} +22 -20
  50. package/commands/{space.command.js → studio/command-service/space-command.service.js} +9 -11
  51. package/commands/studio/command-service/widget.command.js +56 -0
  52. package/{content/factory/asset-manager.factory.js → commands/studio/manager/asset.manager-factory.js} +7 -4
  53. package/{content → commands/studio}/manager/asset.manager.js +8 -5
  54. package/{content/factory/package-manager.factory.js → commands/studio/manager/package.manager-factory.js} +7 -4
  55. package/{content → commands/studio}/manager/package.manager.js +9 -6
  56. package/{content/factory/space-manager.factory.js → commands/studio/manager/space.manager-factory.js} +6 -3
  57. package/{content → commands/studio}/manager/space.manager.js +7 -4
  58. package/{content/factory/widget-manager.factory.js → commands/studio/manager/widget.manager-factory.js} +8 -5
  59. package/{content → commands/studio}/manager/widget.manager.js +5 -5
  60. package/commands/studio/module.js +169 -0
  61. package/{services/package-manager → commands/studio/service}/asset-service.js +10 -9
  62. package/{services/package-manager/datamodel-service.js → commands/studio/service/data-model.service.js} +8 -6
  63. package/{services/package-manager/package-service.js → commands/studio/service/package.service.js} +59 -49
  64. package/{services/package-manager/space-service.js → commands/studio/service/space.service.js} +9 -9
  65. package/commands/studio/service/studio-variable.service.js +41 -0
  66. package/content-cli.js +75 -20
  67. package/core/command/cli-context.js +69 -0
  68. package/core/command/module-handler.js +200 -0
  69. package/core/http/base-api.js +115 -0
  70. package/{services/http-client-service.v2.js → core/http/http-client.js} +39 -24
  71. package/{services/context.service.js → core/http/http-shared/base.manager.helper.js} +6 -16
  72. package/{content/manager → core/http/http-shared}/base.manager.js +14 -21
  73. package/{services → core/profile}/profile.service.js +11 -5
  74. package/{validators → core/profile}/profile.validator.js +3 -3
  75. package/{services → core/utils}/file-service.js +2 -7
  76. package/core/utils/logger.js +102 -0
  77. package/{services → core/utils}/question.service.js +18 -7
  78. package/core/utils/version.js +37 -0
  79. package/lib/{api → commands/action-flows/action-flow}/action-flow-api.d.ts +4 -4
  80. package/lib/commands/{action-flow.command.d.ts → action-flows/action-flow/action-flow-command.service.d.ts} +4 -1
  81. package/lib/{services/action-flow/action-flow-service.d.ts → commands/action-flows/action-flow/action-flow.service.d.ts} +4 -4
  82. package/lib/commands/action-flows/module.d.ts +14 -0
  83. package/lib/commands/{skill.command.d.ts → action-flows/skill/skill-command.service.d.ts} +3 -2
  84. package/lib/commands/action-flows/skill/skill.manager-factory.d.ts +8 -0
  85. package/lib/{content/manager → commands/action-flows/skill}/skill.manager.d.ts +4 -2
  86. package/lib/commands/analysis/analysis-bookmarks-command.service.d.ts +7 -0
  87. package/lib/commands/analysis/analysis-bookmarks.manager-factory.d.ts +8 -0
  88. package/lib/{content/manager → commands/analysis}/analysis-bookmarks.manager.d.ts +4 -2
  89. package/lib/commands/analysis/module.d.ts +11 -0
  90. package/lib/{api → commands/configuration-management/api}/batch-import-export-api.d.ts +5 -5
  91. package/lib/{api → commands/configuration-management/api}/diff-api.d.ts +5 -5
  92. package/lib/commands/configuration-management/api/variable-assignment-candidates-api.d.ts +8 -0
  93. package/lib/{services/package-manager/batch-import-export-service.d.ts → commands/configuration-management/batch-import-export.service.d.ts} +6 -3
  94. package/lib/commands/{config.command.d.ts → configuration-management/config-command.service.d.ts} +6 -1
  95. package/lib/{services/package-manager/diff-service.d.ts → commands/configuration-management/diff.service.d.ts} +4 -3
  96. package/lib/{interfaces/package-export-transport.d.ts → commands/configuration-management/interfaces/package-export.interfaces.d.ts} +2 -2
  97. package/lib/{api/variable-assignment-apis.d.ts → commands/configuration-management/interfaces/variable-assignment-apis.constants.d.ts} +3 -1
  98. package/lib/commands/configuration-management/module.d.ts +15 -0
  99. package/lib/{services/studio → commands/configuration-management}/studio.service.d.ts +12 -5
  100. package/lib/commands/configuration-management/variable-command.service.d.ts +6 -0
  101. package/lib/{services/package-manager/variable-service.d.ts → commands/configuration-management/variable.service.d.ts} +8 -8
  102. package/lib/commands/cpm4/ctp-command.service.d.ts +7 -0
  103. package/lib/{content/manager → commands/cpm4}/ctp.analysis.manager.d.ts +2 -0
  104. package/lib/{content/manager → commands/cpm4}/ctp.datamodel.manager.d.ts +2 -1
  105. package/lib/{content/factory/ctp-manager.factory.d.ts → commands/cpm4/ctp.manager-factory.d.ts} +4 -1
  106. package/lib/{content/manager → commands/cpm4}/ctp.manager.d.ts +4 -2
  107. package/lib/commands/cpm4/module.d.ts +10 -0
  108. package/lib/commands/data-pipeline/connection/connection-command.service.d.ts +8 -0
  109. package/lib/commands/data-pipeline/connection/connection.commands.d.ts +11 -0
  110. package/lib/{services → commands/data-pipeline}/connection/connection.service.d.ts +4 -3
  111. package/lib/{api → commands/data-pipeline/data-pool}/data-pool-api.d.ts +5 -5
  112. package/lib/commands/data-pipeline/data-pool/data-pool-command.service.d.ts +14 -0
  113. package/lib/commands/data-pipeline/data-pool/data-pool-manager.factory.d.ts +9 -0
  114. package/lib/{services → commands/data-pipeline}/data-pool/data-pool-service.d.ts +4 -3
  115. package/lib/commands/data-pipeline/data-pool/data-pool.commands.d.ts +15 -0
  116. package/lib/{content/manager → commands/data-pipeline/data-pool}/data-pool.manager.d.ts +4 -2
  117. package/lib/commands/data-pipeline/module.d.ts +9 -0
  118. package/lib/commands/profile/module.d.ts +12 -0
  119. package/lib/commands/{profile.command.d.ts → profile/profile-command.service.d.ts} +1 -1
  120. package/lib/{api → commands/studio/api}/asset-api.d.ts +4 -4
  121. package/lib/{api → commands/studio/api}/compute-pool-api.d.ts +4 -4
  122. package/lib/{api → commands/studio/api}/node-api.d.ts +4 -4
  123. package/lib/{api → commands/studio/api}/package-api.d.ts +4 -4
  124. package/lib/{api → commands/studio/api}/package-dependencies-api.d.ts +4 -4
  125. package/lib/commands/studio/api/space-api.d.ts +9 -0
  126. package/lib/commands/studio/api/studio-variables-api.d.ts +8 -0
  127. package/lib/commands/studio/command-service/asset-command.service.d.ts +11 -0
  128. package/lib/commands/{package.command.d.ts → studio/command-service/package-command.service.d.ts} +8 -5
  129. package/lib/commands/studio/command-service/space-command.service.d.ts +6 -0
  130. package/lib/commands/studio/command-service/widget.command.d.ts +7 -0
  131. package/lib/{interfaces/batch-export-node-transport.d.ts → commands/studio/interfaces/batch-export-node.interfaces.d.ts} +1 -9
  132. package/lib/{content/factory/asset-manager.factory.d.ts → commands/studio/manager/asset.manager-factory.d.ts} +4 -1
  133. package/lib/{content → commands/studio}/manager/asset.manager.d.ts +4 -2
  134. package/lib/{content/factory/package-manager.factory.d.ts → commands/studio/manager/package.manager-factory.d.ts} +4 -1
  135. package/lib/{content → commands/studio}/manager/package.manager.d.ts +4 -2
  136. package/lib/commands/studio/manager/space.manager-factory.d.ts +8 -0
  137. package/lib/{content → commands/studio}/manager/space.manager.d.ts +4 -2
  138. package/lib/{content/factory/widget-manager.factory.d.ts → commands/studio/manager/widget.manager-factory.d.ts} +10 -7
  139. package/lib/{content → commands/studio}/manager/widget.manager.d.ts +4 -2
  140. package/lib/commands/studio/module.d.ts +21 -0
  141. package/lib/{services/package-manager → commands/studio/service}/asset-service.d.ts +4 -3
  142. package/lib/{services/package-manager/datamodel-service.d.ts → commands/studio/service/data-model.service.d.ts} +5 -5
  143. package/lib/{services/package-manager/package-service.d.ts → commands/studio/service/package.service.d.ts} +13 -6
  144. package/lib/commands/studio/service/space.service.d.ts +11 -0
  145. package/lib/commands/studio/service/studio-variable.service.d.ts +9 -0
  146. package/lib/core/command/cli-context.d.ts +17 -0
  147. package/lib/core/command/module-handler.d.ts +57 -0
  148. package/lib/core/http/base-api.d.ts +32 -0
  149. package/lib/{services/http-client-service.v2.d.ts → core/http/http-client.d.ts} +8 -3
  150. package/lib/{content/manager → core/http/http-shared}/base.manager.d.ts +4 -6
  151. package/lib/core/http/http-shared/base.manager.helper.d.ts +4 -0
  152. package/lib/{services → core/profile}/profile.service.d.ts +2 -1
  153. package/lib/{validators → core/profile}/profile.validator.d.ts +1 -1
  154. package/lib/{services → core/utils}/file-service.d.ts +0 -2
  155. package/lib/core/utils/question.service.d.ts +10 -0
  156. package/lib/core/utils/version.d.ts +3 -0
  157. package/package.json +4 -3
  158. package/api/batch-import-export-api.js +0 -62
  159. package/api/variables-api.js +0 -56
  160. package/commands/profile.command.js +0 -88
  161. package/commands/widget.command.js +0 -36
  162. package/content-cli-analyze.js +0 -56
  163. package/content-cli-config.js +0 -119
  164. package/content-cli-export.js +0 -90
  165. package/content-cli-get.js +0 -52
  166. package/content-cli-import.js +0 -93
  167. package/content-cli-list.js +0 -129
  168. package/content-cli-profile.js +0 -64
  169. package/content-cli-pull.js +0 -104
  170. package/content-cli-push.js +0 -196
  171. package/content-cli-set.js +0 -55
  172. package/content-cli-update.js +0 -44
  173. package/interfaces/variable-assignment-api.interface.js +0 -12
  174. package/lib/api/space-api.d.ts +0 -9
  175. package/lib/api/variables-api.d.ts +0 -14
  176. package/lib/commands/analysis-bookmarks.command.d.ts +0 -6
  177. package/lib/commands/asset.command.d.ts +0 -8
  178. package/lib/commands/connection.command.d.ts +0 -5
  179. package/lib/commands/ctp.command.d.ts +0 -6
  180. package/lib/commands/data-pool.command.d.ts +0 -11
  181. package/lib/commands/space.command.d.ts +0 -5
  182. package/lib/commands/variable.command.d.ts +0 -3
  183. package/lib/commands/widget.command.d.ts +0 -5
  184. package/lib/content/factory/analysis-bookmarks-manager.factory.d.ts +0 -5
  185. package/lib/content/factory/data-pool-manager.factory.d.ts +0 -6
  186. package/lib/content/factory/skill-manager.factory.d.ts +0 -5
  187. package/lib/content/factory/space-manager.factory.d.ts +0 -5
  188. package/lib/content-cli-analyze.d.ts +0 -1
  189. package/lib/content-cli-config.d.ts +0 -8
  190. package/lib/content-cli-export.d.ts +0 -6
  191. package/lib/content-cli-get.d.ts +0 -1
  192. package/lib/content-cli-import.d.ts +0 -6
  193. package/lib/content-cli-list.d.ts +0 -9
  194. package/lib/content-cli-profile.d.ts +0 -1
  195. package/lib/content-cli-pull.d.ts +0 -1
  196. package/lib/content-cli-push.d.ts +0 -1
  197. package/lib/content-cli-set.d.ts +0 -1
  198. package/lib/content-cli-update.d.ts +0 -1
  199. package/lib/interfaces/variable-assignment-api.interface.d.ts +0 -3
  200. package/lib/services/command.service.d.ts +0 -6
  201. package/lib/services/content.service.d.ts +0 -11
  202. package/lib/services/context.service.d.ts +0 -13
  203. package/lib/services/http-client.service.d.ts +0 -15
  204. package/lib/services/package-manager/space-service.d.ts +0 -11
  205. package/lib/services/question.service.d.ts +0 -4
  206. package/lib/util/context-initializer.d.ts +0 -3
  207. package/lib/util/program.d.ts +0 -2
  208. package/lib/util/version.d.ts +0 -3
  209. package/services/command.service.js +0 -24
  210. package/services/content.service.js +0 -130
  211. package/services/http-client.service.js +0 -157
  212. package/util/context-initializer.js +0 -39
  213. package/util/logger.js +0 -49
  214. package/util/program.js +0 -16
  215. package/util/version.js +0 -21
  216. /package/{interfaces/batch-export-import-constants.js → commands/configuration-management/interfaces/batch-export-import.constants.js} +0 -0
  217. /package/{interfaces/diff-package.transport.js → commands/configuration-management/interfaces/diff-package.interfaces.js} +0 -0
  218. /package/{interfaces/batch-export-node-transport.js → commands/configuration-management/interfaces/package-export.interfaces.js} +0 -0
  219. /package/{api/variable-assignment-apis.js → commands/configuration-management/interfaces/variable-assignment-apis.constants.js} +0 -0
  220. /package/{interfaces → commands/data-pipeline/data-pool}/data-pool-manager.interfaces.js +0 -0
  221. /package/{interfaces/manager-config.interface.js → commands/studio/interfaces/batch-export-node.interfaces.js} +0 -0
  222. /package/{interfaces/manifest-transport.js → commands/studio/interfaces/manifest.interface.js} +0 -0
  223. /package/{interfaces → commands/studio/interfaces}/package-manager.interfaces.js +0 -0
  224. /package/{interfaces → commands/studio/interfaces}/save-content-node.interface.js +0 -0
  225. /package/{interfaces/package-export-transport.js → commands/studio/interfaces/space.interface.js} +0 -0
  226. /package/{util → commands/studio/utils}/semantic-versioning.js +0 -0
  227. /package/{util → core/http}/axios-initializer.js +0 -0
  228. /package/{interfaces/save-space.interface.js → core/http/http-shared/manager-config.interface.js} +0 -0
  229. /package/{util → core/http}/tracing.js +0 -0
  230. /package/{interfaces → core/profile}/profile.interface.js +0 -0
  231. /package/{util → core/utils}/json.js +0 -0
  232. /package/{util → core/utils}/yaml.js +0 -0
  233. /package/lib/{interfaces/batch-export-import-constants.d.ts → commands/configuration-management/interfaces/batch-export-import.constants.d.ts} +0 -0
  234. /package/lib/{interfaces/diff-package.transport.d.ts → commands/configuration-management/interfaces/diff-package.interfaces.d.ts} +0 -0
  235. /package/lib/{interfaces → commands/data-pipeline/data-pool}/data-pool-manager.interfaces.d.ts +0 -0
  236. /package/lib/{interfaces/manifest-transport.d.ts → commands/studio/interfaces/manifest.interface.d.ts} +0 -0
  237. /package/lib/{interfaces → commands/studio/interfaces}/package-manager.interfaces.d.ts +0 -0
  238. /package/lib/{interfaces → commands/studio/interfaces}/save-content-node.interface.d.ts +0 -0
  239. /package/lib/{interfaces/save-space.interface.d.ts → commands/studio/interfaces/space.interface.d.ts} +0 -0
  240. /package/lib/{util → commands/studio/utils}/semantic-versioning.d.ts +0 -0
  241. /package/lib/{util → core/http}/axios-initializer.d.ts +0 -0
  242. /package/lib/{interfaces → core/http/http-shared}/manager-config.interface.d.ts +0 -0
  243. /package/lib/{util → core/http}/tracing.d.ts +0 -0
  244. /package/lib/{interfaces → core/profile}/profile.interface.d.ts +0 -0
  245. /package/lib/{util → core/utils}/json.d.ts +0 -0
  246. /package/lib/{util → core/utils}/logger.d.ts +0 -0
  247. /package/lib/{util → core/utils}/yaml.d.ts +0 -0
@@ -13,31 +13,40 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "../../api/package-api", "../../interfaces/package-manager.interfaces", "../package-manager/datamodel-service", "../../util/json", "../../api/node-api", "../../api/variables-api", "../../api/space-api", "../package-manager/space-service", "../package-manager/variable-service", "../../interfaces/batch-export-import-constants", "adm-zip"], factory);
16
+ define(["require", "exports", "adm-zip", "../studio/interfaces/package-manager.interfaces", "./interfaces/batch-export-import.constants", "../../core/utils/json", "../studio/api/package-api", "../studio/service/data-model.service", "../studio/api/node-api", "../studio/api/space-api", "../studio/api/studio-variables-api", "../studio/service/space.service", "../studio/service/studio-variable.service"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.studioService = void 0;
22
- const package_api_1 = require("../../api/package-api");
23
- const package_manager_interfaces_1 = require("../../interfaces/package-manager.interfaces");
24
- const datamodel_service_1 = require("../package-manager/datamodel-service");
25
- const json_1 = require("../../util/json");
26
- const node_api_1 = require("../../api/node-api");
27
- const variables_api_1 = require("../../api/variables-api");
28
- const space_api_1 = require("../../api/space-api");
29
- const space_service_1 = require("../package-manager/space-service");
30
- const variable_service_1 = require("../package-manager/variable-service");
31
- const batch_export_import_constants_1 = require("../../interfaces/batch-export-import-constants");
21
+ exports.StudioService = void 0;
32
22
  const AdmZip = require("adm-zip");
23
+ const package_manager_interfaces_1 = require("../studio/interfaces/package-manager.interfaces");
24
+ const batch_export_import_constants_1 = require("./interfaces/batch-export-import.constants");
25
+ const json_1 = require("../../core/utils/json");
26
+ const package_api_1 = require("../studio/api/package-api");
27
+ const data_model_service_1 = require("../studio/service/data-model.service");
28
+ const node_api_1 = require("../studio/api/node-api");
29
+ const space_api_1 = require("../studio/api/space-api");
30
+ const studio_variables_api_1 = require("../studio/api/studio-variables-api");
31
+ const space_service_1 = require("../studio/service/space.service");
32
+ const studio_variable_service_1 = require("../studio/service/studio-variable.service");
33
33
  class StudioService {
34
+ constructor(context) {
35
+ this.studioPackageApi = new package_api_1.PackageApi(context);
36
+ this.studioNodeApi = new node_api_1.NodeApi(context);
37
+ this.studioSpaceApi = new space_api_1.SpaceApi(context);
38
+ this.studioVariablesApi = new studio_variables_api_1.StudioVariablesApi(context);
39
+ this.studioDataModelService = new data_model_service_1.DataModelService(context);
40
+ this.studioSpaceService = new space_service_1.SpaceService(context);
41
+ this.studioVariableService = new studio_variable_service_1.StudioVariableService(context);
42
+ }
34
43
  getExportPackagesWithStudioData(packagesToExport, withDependencies) {
35
44
  return __awaiter(this, void 0, void 0, function* () {
36
- const studioPackagesWithDataModels = yield package_api_1.packageApi.findAllPackagesWithVariableAssignments(package_manager_interfaces_1.PackageManagerVariableType.DATA_MODEL);
37
- packagesToExport = exports.studioService.setSpaceIdForStudioPackages(packagesToExport, studioPackagesWithDataModels);
45
+ const studioPackagesWithDataModels = yield this.studioPackageApi.findAllPackagesWithVariableAssignments(package_manager_interfaces_1.PackageManagerVariableType.DATA_MODEL);
46
+ packagesToExport = this.setSpaceIdForStudioPackages(packagesToExport, studioPackagesWithDataModels);
38
47
  if (withDependencies) {
39
- const dataModelDetailsByNode = yield datamodel_service_1.dataModelService.getDataModelDetailsForPackages(studioPackagesWithDataModels);
40
- packagesToExport = exports.studioService.setDataModelsForStudioPackages(packagesToExport, studioPackagesWithDataModels, dataModelDetailsByNode);
48
+ const dataModelDetailsByNode = yield this.studioDataModelService.getDataModelDetailsForPackages(studioPackagesWithDataModels);
49
+ packagesToExport = this.setDataModelsForStudioPackages(packagesToExport, studioPackagesWithDataModels, dataModelDetailsByNode);
41
50
  }
42
51
  return packagesToExport;
43
52
  });
@@ -53,9 +62,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
53
62
  getStudioPackageManifests(studioPackageKeys) {
54
63
  return __awaiter(this, void 0, void 0, function* () {
55
64
  return Promise.all(studioPackageKeys.map((packageKey) => __awaiter(this, void 0, void 0, function* () {
56
- const node = yield node_api_1.nodeApi.findOneByKeyAndRootNodeKey(packageKey, packageKey);
57
- const nodeSpace = yield space_api_1.spaceApi.findOne(node.spaceId);
58
- const variableAssignments = yield variables_api_1.variablesApi.getRuntimeVariableValues(packageKey, batch_export_import_constants_1.BatchExportImportConstants.APP_MODE_VIEWER);
65
+ const node = yield this.studioNodeApi.findOneByKeyAndRootNodeKey(packageKey, packageKey);
66
+ const nodeSpace = yield this.studioSpaceApi.findOne(node.spaceId);
67
+ const variableAssignments = yield this.studioVariablesApi.getRuntimeVariableValues(packageKey, batch_export_import_constants_1.BatchExportImportConstants.APP_MODE_VIEWER);
59
68
  return {
60
69
  packageKey: packageKey,
61
70
  space: {
@@ -81,7 +90,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
81
90
  for (const manifest of studioManifests) {
82
91
  const existingPackage = existingStudioPackages.find(existingPackage => existingPackage.key === manifest.packageKey);
83
92
  if (existingPackage) {
84
- yield package_api_1.packageApi.movePackageToSpace(existingPackage.id, manifest.space.id);
93
+ yield this.studioPackageApi.movePackageToSpace(existingPackage.id, manifest.space.id);
85
94
  }
86
95
  yield this.assignRuntimeVariables(manifest);
87
96
  }
@@ -185,7 +194,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
185
194
  }
186
195
  findDesiredSpaceIdForPackage(studioPackageManifest) {
187
196
  return __awaiter(this, void 0, void 0, function* () {
188
- const allSpaces = yield space_service_1.spaceService.refreshAndGetAllSpaces();
197
+ const allSpaces = yield this.studioSpaceService.refreshAndGetAllSpaces();
189
198
  if (studioPackageManifest.space.id) {
190
199
  const targetSpace = allSpaces.find(space => space.id === studioPackageManifest.space.id);
191
200
  if (!targetSpace) {
@@ -197,14 +206,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
197
206
  if (targetSpaceByName) {
198
207
  return targetSpaceByName.id;
199
208
  }
200
- const spaceTransport = yield space_service_1.spaceService.createSpace(studioPackageManifest.space.name, studioPackageManifest.space.iconReference);
209
+ const spaceTransport = yield this.studioSpaceService.createSpace(studioPackageManifest.space.name, studioPackageManifest.space.iconReference);
201
210
  return spaceTransport.id;
202
211
  });
203
212
  }
204
213
  assignRuntimeVariables(manifest) {
205
214
  return __awaiter(this, void 0, void 0, function* () {
206
215
  if (manifest.runtimeVariableAssignments.length) {
207
- yield variable_service_1.variableService.assignVariableValues(manifest.packageKey, manifest.runtimeVariableAssignments);
216
+ yield this.studioVariableService.assignVariableValues(manifest.packageKey, manifest.runtimeVariableAssignments);
208
217
  }
209
218
  });
210
219
  }
@@ -215,5 +224,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
215
224
  return nodeContent;
216
225
  }
217
226
  }
218
- exports.studioService = new StudioService();
227
+ exports.StudioService = StudioService;
219
228
  });
@@ -13,24 +13,27 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "../services/package-manager/variable-service"], factory);
16
+ define(["require", "exports", "./variable.service"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.VariableCommand = void 0;
22
- const variable_service_1 = require("../services/package-manager/variable-service");
23
- class VariableCommand {
21
+ exports.VariableCommandService = void 0;
22
+ const variable_service_1 = require("./variable.service");
23
+ class VariableCommandService {
24
+ constructor(context) {
25
+ this.variableService = new variable_service_1.VariableService(context);
26
+ }
24
27
  listAssignments(variableType, jsonResponse, params) {
25
28
  return __awaiter(this, void 0, void 0, function* () {
26
29
  if (jsonResponse) {
27
- yield variable_service_1.variableService.findAndExportCandidateAssignments(variableType, params);
30
+ yield this.variableService.findAndExportCandidateAssignments(variableType, params);
28
31
  }
29
32
  else {
30
- yield variable_service_1.variableService.listCandidateAssignments(variableType, params);
33
+ yield this.variableService.listCandidateAssignments(variableType, params);
31
34
  }
32
35
  });
33
36
  }
34
37
  }
35
- exports.VariableCommand = VariableCommand;
38
+ exports.VariableCommandService = VariableCommandService;
36
39
  });
@@ -13,35 +13,37 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "../../api/package-api", "../../api/variables-api", "uuid", "../../util/logger", "../file-service", "url", "../studio/studio.service", "../../api/batch-import-export-api"], factory);
16
+ define(["require", "exports", "uuid", "../../core/utils/logger", "./studio.service", "../../core/utils/file-service", "./api/batch-import-export-api", "url", "./api/variable-assignment-candidates-api"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.variableService = void 0;
22
- const package_api_1 = require("../../api/package-api");
23
- const variables_api_1 = require("../../api/variables-api");
21
+ exports.VariableService = void 0;
24
22
  const uuid_1 = require("uuid");
25
- const logger_1 = require("../../util/logger");
26
- const file_service_1 = require("../file-service");
23
+ const logger_1 = require("../../core/utils/logger");
24
+ const studio_service_1 = require("./studio.service");
25
+ const file_service_1 = require("../../core/utils/file-service");
26
+ const batch_import_export_api_1 = require("./api/batch-import-export-api");
27
27
  const url_1 = require("url");
28
- const studio_service_1 = require("../studio/studio.service");
29
- const batch_import_export_api_1 = require("../../api/batch-import-export-api");
28
+ const variable_assignment_candidates_api_1 = require("./api/variable-assignment-candidates-api");
30
29
  class VariableService {
31
- getVariableAssignmentsForNodes(type) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- return yield package_api_1.packageApi.findAllPackagesWithVariableAssignments(type);
34
- });
30
+ constructor(context) {
31
+ this.batchImportExportApi = new batch_import_export_api_1.BatchImportExportApi(context);
32
+ this.variableAssignmentCandidatesApi = new variable_assignment_candidates_api_1.VariableAssignmentCandidatesApi(context);
33
+ this.studioService = new studio_service_1.StudioService(context);
35
34
  }
36
- assignVariableValues(packageKey, variablesAssignments) {
35
+ listVariables(keysByVersion, keysByVersionFile) {
37
36
  return __awaiter(this, void 0, void 0, function* () {
38
- yield variables_api_1.variablesApi.assignVariableValues(packageKey, variablesAssignments);
37
+ const variableManifests = yield this.getVersionedVariablesByKeyVersionPairs(keysByVersion, keysByVersionFile);
38
+ variableManifests.forEach(variableManifest => {
39
+ logger_1.logger.info(JSON.stringify(variableManifest));
40
+ });
39
41
  });
40
42
  }
41
43
  listCandidateAssignments(type, params) {
42
44
  return __awaiter(this, void 0, void 0, function* () {
43
45
  const parsedParams = this.parseParams(params);
44
- const assignments = yield variables_api_1.variablesApi.getCandidateAssignments(type, parsedParams);
46
+ const assignments = yield this.variableAssignmentCandidatesApi.getCandidateAssignments(type, parsedParams);
45
47
  assignments.forEach(assignment => {
46
48
  logger_1.logger.info(JSON.stringify(assignment));
47
49
  });
@@ -50,44 +52,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
50
52
  findAndExportCandidateAssignments(type, params) {
51
53
  return __awaiter(this, void 0, void 0, function* () {
52
54
  const parsedParams = this.parseParams(params);
53
- const assignments = yield variables_api_1.variablesApi.getCandidateAssignments(type, parsedParams);
55
+ const assignments = yield this.variableAssignmentCandidatesApi.getCandidateAssignments(type, parsedParams);
54
56
  this.exportToJson(assignments);
55
57
  });
56
58
  }
57
- listVariables(keysByVersion, keysByVersionFile) {
58
- return __awaiter(this, void 0, void 0, function* () {
59
- const variableManifests = yield this.getVersionedVariablesByKeyVersionPairs(keysByVersion, keysByVersionFile);
60
- variableManifests.forEach(variableManifest => {
61
- logger_1.logger.info(JSON.stringify(variableManifest));
62
- });
63
- });
64
- }
65
59
  exportVariables(keysByVersion, keysByVersionFile) {
66
60
  return __awaiter(this, void 0, void 0, function* () {
67
61
  const variableManifests = yield this.getVersionedVariablesByKeyVersionPairs(keysByVersion, keysByVersionFile);
68
62
  this.exportToJson(variableManifests);
69
63
  });
70
64
  }
71
- parseParams(params) {
72
- const queryParams = new url_1.URLSearchParams();
73
- if (params) {
74
- try {
75
- params.split(",").forEach((param) => {
76
- const paramKeyValuePair = param.split("=");
77
- queryParams.set(paramKeyValuePair[0], paramKeyValuePair[1]);
78
- });
79
- }
80
- catch (e) {
81
- throw new logger_1.FatalError(`Problem parsing query params: ${e}`);
82
- }
83
- }
84
- return queryParams;
85
- }
86
65
  getVersionedVariablesByKeyVersionPairs(keysByVersion, keysByVersionFile) {
87
66
  return __awaiter(this, void 0, void 0, function* () {
88
67
  const variablesExportRequest = yield this.buildKeyVersionPairs(keysByVersion, keysByVersionFile);
89
- const variableManifests = yield batch_import_export_api_1.batchImportExportApi.findVariablesWithValuesByPackageKeysAndVersion(variablesExportRequest);
90
- return studio_service_1.studioService.fixConnectionVariables(variableManifests);
68
+ const variableManifests = yield this.batchImportExportApi.findVariablesWithValuesByPackageKeysAndVersion(variablesExportRequest);
69
+ return this.studioService.fixConnectionVariables(variableManifests);
91
70
  });
92
71
  }
93
72
  buildKeyVersionPairs(keysByVersion, keysByVersionFile) {
@@ -119,6 +98,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
119
98
  file_service_1.fileService.writeToFileWithGivenName(JSON.stringify(data), filename);
120
99
  logger_1.logger.info(file_service_1.FileService.fileDownloadedMessage + filename);
121
100
  }
101
+ parseParams(params) {
102
+ const queryParams = new url_1.URLSearchParams();
103
+ if (params) {
104
+ try {
105
+ params.split(",").forEach((param) => {
106
+ const paramKeyValuePair = param.split("=");
107
+ queryParams.set(paramKeyValuePair[0], paramKeyValuePair[1]);
108
+ });
109
+ }
110
+ catch (e) {
111
+ throw new logger_1.FatalError(`Problem parsing query params: ${e}`);
112
+ }
113
+ }
114
+ return queryParams;
115
+ }
122
116
  }
123
- exports.variableService = new VariableService();
117
+ exports.VariableService = VariableService;
124
118
  });
@@ -13,28 +13,26 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "../services/content.service", "../content/factory/ctp-manager.factory", "../util/logger"], factory);
16
+ define(["require", "exports", "../../core/utils/logger", "./ctp.manager-factory"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.CTPCommand = void 0;
22
- const content_service_1 = require("../services/content.service");
23
- const ctp_manager_factory_1 = require("../content/factory/ctp-manager.factory");
24
- const logger_1 = require("../util/logger");
25
- class CTPCommand {
26
- constructor() {
27
- this.contentService = new content_service_1.ContentService();
28
- this.ctpManagerFactory = new ctp_manager_factory_1.CTPManagerFactory();
21
+ exports.CTPCommandService = void 0;
22
+ const logger_1 = require("../../core/utils/logger");
23
+ const ctp_manager_factory_1 = require("./ctp.manager-factory");
24
+ class CTPCommandService {
25
+ constructor(context) {
26
+ this.ctpManagerFactory = new ctp_manager_factory_1.CTPManagerFactory(context);
29
27
  }
30
- pushCTPFile(profile, filename, password, pushAnalysis, pushDataModels, existingPoolId, globalPoolName, spaceKey) {
28
+ pushCTPFile(filename, password, pushAnalysis, pushDataModels, existingPoolId, globalPoolName, spaceKey) {
31
29
  return __awaiter(this, void 0, void 0, function* () {
32
30
  if (pushAnalysis) {
33
- yield this.contentService.push(profile, this.ctpManagerFactory.createCtpAnalysisManager(filename, password, spaceKey));
31
+ yield this.ctpManagerFactory.createCtpAnalysisManager(filename, password, spaceKey).push();
34
32
  }
35
33
  if (pushDataModels) {
36
34
  this.validateParamsForDataModelPush(existingPoolId, globalPoolName);
37
- yield this.contentService.push(profile, this.ctpManagerFactory.createCtpDataModelManager(filename, password, existingPoolId, globalPoolName));
35
+ yield this.ctpManagerFactory.createCtpDataModelManager(filename, password, existingPoolId, globalPoolName).push();
38
36
  }
39
37
  });
40
38
  }
@@ -44,5 +42,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
44
42
  }
45
43
  }
46
44
  }
47
- exports.CTPCommand = CTPCommand;
45
+ exports.CTPCommandService = CTPCommandService;
48
46
  });
@@ -13,6 +13,9 @@
13
13
  const ctp_manager_1 = require("./ctp.manager");
14
14
  const FormData = require("form-data");
15
15
  class CtpAnalysisManager extends ctp_manager_1.CtpManager {
16
+ constructor(context) {
17
+ super(context);
18
+ }
16
19
  getUrl() {
17
20
  return CtpAnalysisManager.BASE_URL;
18
21
  }
@@ -13,8 +13,8 @@
13
13
  const ctp_manager_1 = require("./ctp.manager");
14
14
  const FormData = require("form-data");
15
15
  class CtpDataModelManager extends ctp_manager_1.CtpManager {
16
- constructor(existingPoolId, globalPoolName) {
17
- super();
16
+ constructor(context, existingPoolId, globalPoolName) {
17
+ super(context);
18
18
  this.existingPoolId = existingPoolId;
19
19
  this.globalPoolName = globalPoolName;
20
20
  }
@@ -4,7 +4,7 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "fs", "path", "../../util/logger", "../manager/ctp.analysis.manager", "../manager/ctp.datamodel.manager"], factory);
7
+ define(["require", "exports", "fs", "path", "./ctp.analysis.manager", "./ctp.datamodel.manager", "../../core/utils/logger"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
@@ -12,16 +12,19 @@
12
12
  exports.CTPManagerFactory = void 0;
13
13
  const fs = require("fs");
14
14
  const path = require("path");
15
- const logger_1 = require("../../util/logger");
16
- const ctp_analysis_manager_1 = require("../manager/ctp.analysis.manager");
17
- const ctp_datamodel_manager_1 = require("../manager/ctp.datamodel.manager");
15
+ const ctp_analysis_manager_1 = require("./ctp.analysis.manager");
16
+ const ctp_datamodel_manager_1 = require("./ctp.datamodel.manager");
17
+ const logger_1 = require("../../core/utils/logger");
18
18
  class CTPManagerFactory {
19
+ constructor(context) {
20
+ this.context = context;
21
+ }
19
22
  createCtpAnalysisManager(filename, password, spaceKey) {
20
- const ctpManager = new ctp_analysis_manager_1.CtpAnalysisManager();
23
+ const ctpManager = new ctp_analysis_manager_1.CtpAnalysisManager(this.context);
21
24
  return this.initManager(ctpManager, filename, password, spaceKey);
22
25
  }
23
26
  createCtpDataModelManager(filename, password, existingPoolId, globalPoolName) {
24
- const ctpManager = new ctp_datamodel_manager_1.CtpDataModelManager(existingPoolId, globalPoolName);
27
+ const ctpManager = new ctp_datamodel_manager_1.CtpDataModelManager(this.context, existingPoolId, globalPoolName);
25
28
  return this.initManager(ctpManager, filename, password);
26
29
  }
27
30
  initManager(ctpManager, filename, password, spaceKey) {
@@ -4,14 +4,17 @@
4
4
  if (v !== undefined) module.exports = v;
5
5
  }
6
6
  else if (typeof define === "function" && define.amd) {
7
- define(["require", "exports", "./base.manager"], factory);
7
+ define(["require", "exports", "../../core/http/http-shared/base.manager"], factory);
8
8
  }
9
9
  })(function (require, exports) {
10
10
  "use strict";
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CtpManager = void 0;
13
- const base_manager_1 = require("./base.manager");
13
+ const base_manager_1 = require("../../core/http/http-shared/base.manager");
14
14
  class CtpManager extends base_manager_1.BaseManager {
15
+ constructor(context) {
16
+ super(context);
17
+ }
15
18
  get content() {
16
19
  return this._content;
17
20
  }
@@ -31,9 +34,8 @@
31
34
  this._spaceKey = value;
32
35
  }
33
36
  getConfig() {
34
- const baseUrl = this.getUrl();
35
37
  return {
36
- pushUrl: this.profile.team.replace(/\/?$/, `${baseUrl}`),
38
+ pushUrl: this.getUrl(),
37
39
  onPushSuccessMessage: () => {
38
40
  return "CTP File was pushed successfully";
39
41
  },
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Commands related to the CPM4 area.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ (function (factory) {
14
+ if (typeof module === "object" && typeof module.exports === "object") {
15
+ var v = factory(require, exports);
16
+ if (v !== undefined) module.exports = v;
17
+ }
18
+ else if (typeof define === "function" && define.amd) {
19
+ define(["require", "exports", "../../core/command/module-handler", "./ctp-command.service"], factory);
20
+ }
21
+ })(function (require, exports) {
22
+ "use strict";
23
+ const module_handler_1 = require("../../core/command/module-handler");
24
+ const ctp_command_service_1 = require("./ctp-command.service");
25
+ class Module extends module_handler_1.IModule {
26
+ register(context, configurator) {
27
+ const pushCommand = configurator.command("push");
28
+ pushCommand.command("ctp")
29
+ .description("Command to push a .ctp (Celonis 4 transport file) to create a package")
30
+ .option("-a, --pushAnalysis", "Specify this option if you want to push analysis from the CTP file")
31
+ .option("-d, --pushDataModels", "Specify this option if you want to push data models from the CTP file")
32
+ .option("--globalPoolName <globalPoolName>", "Specify this option if you want to push all Data models into one newly created pool along with value to set the name of the pool to be created", null)
33
+ .option("--existingPoolId <existingPoolId>", "Specify this option if you want to push all Data models into one already existing pool with provided ID", null)
34
+ .option("-s, --spaceKey <spaceKey>", "The key of the destination space where the analyses from .ctp file will be created.", "")
35
+ .requiredOption("-f, --file <file>", "The .ctp file you want to push")
36
+ .requiredOption("--password <password>", "The password used for extracting the .ctp file")
37
+ .action(this.pushCTPFile);
38
+ }
39
+ pushCTPFile(context, command, options) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ yield new ctp_command_service_1.CTPCommandService(context).pushCTPFile(options.file, options.password, options.pushAnalysis, options.pushDataModels, options.existingPoolId, options.globalPoolName, options.spaceKey);
42
+ });
43
+ }
44
+ }
45
+ return Module;
46
+ });
@@ -13,29 +13,32 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
13
13
  if (v !== undefined) module.exports = v;
14
14
  }
15
15
  else if (typeof define === "function" && define.amd) {
16
- define(["require", "exports", "../services/connection/connection.service"], factory);
16
+ define(["require", "exports", "./connection.service"], factory);
17
17
  }
18
18
  })(function (require, exports) {
19
19
  "use strict";
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.ConnectionCommand = void 0;
22
- const connection_service_1 = require("../services/connection/connection.service");
23
- class ConnectionCommand {
24
- updateProperty(profile, dataPoolId, connectionId, property, value) {
21
+ exports.ConnectionCommandService = void 0;
22
+ const connection_service_1 = require("./connection.service");
23
+ class ConnectionCommandService {
24
+ constructor(context) {
25
+ this.connectionService = new connection_service_1.ConnectionService(context);
26
+ }
27
+ updateProperty(dataPoolId, connectionId, property, value) {
25
28
  return __awaiter(this, void 0, void 0, function* () {
26
- yield connection_service_1.connectionService.updateProperty(dataPoolId, connectionId, property, value);
29
+ yield this.connectionService.updateProperty(dataPoolId, connectionId, property, value);
27
30
  });
28
31
  }
29
- getProperties(profile, dataPoolId, connectionId) {
32
+ getProperties(dataPoolId, connectionId) {
30
33
  return __awaiter(this, void 0, void 0, function* () {
31
- yield connection_service_1.connectionService.listProperties(dataPoolId, connectionId);
34
+ yield this.connectionService.listProperties(dataPoolId, connectionId);
32
35
  });
33
36
  }
34
- listConnections(profile, dataPoolId) {
37
+ listConnections(dataPoolId) {
35
38
  return __awaiter(this, void 0, void 0, function* () {
36
- return yield connection_service_1.connectionService.findAllConnections(dataPoolId);
39
+ yield this.connectionService.findAllConnections(dataPoolId);
37
40
  });
38
41
  }
39
42
  }
40
- exports.ConnectionCommand = ConnectionCommand;
43
+ exports.ConnectionCommandService = ConnectionCommandService;
41
44
  });
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Commands related to the Data Pool Connections.
3
+ */
4
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
6
+ return new (P || (P = Promise))(function (resolve, reject) {
7
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
8
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
9
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
10
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
11
+ });
12
+ };
13
+ (function (factory) {
14
+ if (typeof module === "object" && typeof module.exports === "object") {
15
+ var v = factory(require, exports);
16
+ if (v !== undefined) module.exports = v;
17
+ }
18
+ else if (typeof define === "function" && define.amd) {
19
+ define(["require", "exports", "./connection-command.service"], factory);
20
+ }
21
+ })(function (require, exports) {
22
+ "use strict";
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.ConnectionCommands = void 0;
25
+ const connection_command_service_1 = require("./connection-command.service");
26
+ class ConnectionCommands {
27
+ register(context, configurator) {
28
+ const listCommand = configurator.command("list");
29
+ listCommand.command("connection")
30
+ .description("Command to list all connections in a Data Pool")
31
+ .requiredOption("--dataPoolId <dataPoolId>", "ID of the data pool")
32
+ .action(this.listConnections);
33
+ const getCommand = configurator.command("get");
34
+ getCommand.command("connection")
35
+ .description("Programmatically read properties of your connections")
36
+ .requiredOption("--dataPoolId <dataPoolId>", "Id of the data pool you want to update")
37
+ .requiredOption("--connectionId <connectionId>", "Id of the connection you want to update")
38
+ .action(this.getCommandProperties);
39
+ const setCommand = configurator.command("set");
40
+ setCommand.command("connection")
41
+ .description("Programmatically update properties of your connections")
42
+ .requiredOption("--dataPoolId <dataPoolId>", "Id of the data pool you want to update")
43
+ .requiredOption("--connectionId <connectionId>", "Id of the connection you want to update")
44
+ .requiredOption("--property <property>", "The property you want to update")
45
+ .requiredOption("--value <value>", "The value you want to update")
46
+ .action(this.updateConnectionProperty);
47
+ }
48
+ getCommandProperties(context, command, options) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ yield new connection_command_service_1.ConnectionCommandService(context).getProperties(options.dataPoolId, options.connectionId);
51
+ });
52
+ }
53
+ listConnections(context, command, options) {
54
+ return __awaiter(this, void 0, void 0, function* () {
55
+ yield new connection_command_service_1.ConnectionCommandService(context).listConnections(options.dataPoolId);
56
+ });
57
+ }
58
+ updateConnectionProperty(context, command, options) {
59
+ return __awaiter(this, void 0, void 0, function* () {
60
+ yield new connection_command_service_1.ConnectionCommandService(context).updateProperty(options.dataPoolId, options.connectionId, options.property, options.value);
61
+ });
62
+ }
63
+ }
64
+ exports.ConnectionCommands = ConnectionCommands;
65
+ });