@axway/axway-central-cli 4.10.0-rc.0 → 4.10.0-rc.2

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 (152) hide show
  1. package/dist/commands/install/akamaiSaasAgents.js +1 -1
  2. package/dist/commands/install/apigeexSaasAgents.js +1 -1
  3. package/dist/commands/install/awsSaasAgents.js +1 -1
  4. package/dist/commands/install/azureSaasAgents.js +1 -1
  5. package/dist/commands/install/gitHubSaasAgents.js +1 -1
  6. package/dist/commands/install/platform.js +6 -3
  7. package/dist/commands/install/swaggerHubSaasAgents.js +1 -1
  8. package/dist/commands/install/traceableSaasAgents.js +1 -1
  9. package/dist/common/CoreConfigController.js +1 -1
  10. package/dist/common/types.js +16 -2
  11. package/package.json +3 -2
  12. package/src/cli.ts +65 -0
  13. package/src/commands/apply/index.spec.ts +756 -0
  14. package/src/commands/apply/index.ts +106 -0
  15. package/src/commands/completion/index.ts +91 -0
  16. package/src/commands/config/common/index.ts +21 -0
  17. package/src/commands/config/index.ts +15 -0
  18. package/src/commands/config/list.spec.ts +57 -0
  19. package/src/commands/config/list.ts +18 -0
  20. package/src/commands/config/set.spec.ts +242 -0
  21. package/src/commands/config/set.ts +102 -0
  22. package/src/commands/config/unset.spec.ts +74 -0
  23. package/src/commands/config/unset.ts +40 -0
  24. package/src/commands/create/agentResource.spec.ts +210 -0
  25. package/src/commands/create/agentResource.ts +154 -0
  26. package/src/commands/create/environment.spec.ts +104 -0
  27. package/src/commands/create/environment.ts +52 -0
  28. package/src/commands/create/index.spec.ts +489 -0
  29. package/src/commands/create/index.ts +101 -0
  30. package/src/commands/create/serviceAccount.spec.ts +33 -0
  31. package/src/commands/create/serviceAccount.ts +19 -0
  32. package/src/commands/delete/index.spec.ts +650 -0
  33. package/src/commands/delete/index.ts +196 -0
  34. package/src/commands/edit/environment.spec.ts +186 -0
  35. package/src/commands/edit/environment.ts +79 -0
  36. package/src/commands/edit/index.ts +25 -0
  37. package/src/commands/get/index.spec.ts +1257 -0
  38. package/src/commands/get/index.ts +305 -0
  39. package/src/commands/install/agent.spec.ts +592 -0
  40. package/src/commands/install/agents.ts +385 -0
  41. package/src/commands/install/akamaiAgents.spec.ts +511 -0
  42. package/src/commands/install/akamaiAgents.ts +334 -0
  43. package/src/commands/install/akamaiSaasAgents.spec.ts +265 -0
  44. package/src/commands/install/akamaiSaasAgents.ts +376 -0
  45. package/src/commands/install/apigeexAgents.spec.ts +339 -0
  46. package/src/commands/install/apigeexAgents.ts +277 -0
  47. package/src/commands/install/apigeexSaasAgents.spec.ts +359 -0
  48. package/src/commands/install/apigeexSaasAgents.ts +428 -0
  49. package/src/commands/install/awsAgents.spec.ts +1203 -0
  50. package/src/commands/install/awsAgents.ts +611 -0
  51. package/src/commands/install/awsSaasAgents.spec.ts +741 -0
  52. package/src/commands/install/awsSaasAgents.ts +739 -0
  53. package/src/commands/install/azureAgents.spec.ts +636 -0
  54. package/src/commands/install/azureAgents.ts +310 -0
  55. package/src/commands/install/azureSaasAgents.spec.ts +743 -0
  56. package/src/commands/install/azureSaasAgents.ts +783 -0
  57. package/src/commands/install/backstageAgents.spec.ts +299 -0
  58. package/src/commands/install/backstageAgents.ts +207 -0
  59. package/src/commands/install/edgeAgents.spec.ts +1139 -0
  60. package/src/commands/install/edgeAgents.ts +524 -0
  61. package/src/commands/install/gitHubSaasAgents.spec.ts +360 -0
  62. package/src/commands/install/gitHubSaasAgents.ts +408 -0
  63. package/src/commands/install/gitLabAgents.spec.ts +236 -0
  64. package/src/commands/install/gitLabAgents.ts +221 -0
  65. package/src/commands/install/graylogAgent.ts +203 -0
  66. package/src/commands/install/graylogAgents.spec.ts +381 -0
  67. package/src/commands/install/helpers/creators.spec.ts +46 -0
  68. package/src/commands/install/helpers/creators.ts +434 -0
  69. package/src/commands/install/helpers/deleters.ts +38 -0
  70. package/src/commands/install/helpers/getters.spec.ts +38 -0
  71. package/src/commands/install/helpers/getters.ts +111 -0
  72. package/src/commands/install/helpers/index.ts +65 -0
  73. package/src/commands/install/helpers/inputs.spec.ts +78 -0
  74. package/src/commands/install/helpers/inputs.ts +699 -0
  75. package/src/commands/install/helpers/regex.ts +74 -0
  76. package/src/commands/install/helpers/templates/akamaiTemplates.ts +109 -0
  77. package/src/commands/install/helpers/templates/apigeexTemplates.ts +99 -0
  78. package/src/commands/install/helpers/templates/awsTemplates.ts +124 -0
  79. package/src/commands/install/helpers/templates/azureTemplates.ts +115 -0
  80. package/src/commands/install/helpers/templates/backstageTemplates.ts +87 -0
  81. package/src/commands/install/helpers/templates/edgeTemplates.ts +345 -0
  82. package/src/commands/install/helpers/templates/gitLabTemplates.ts +60 -0
  83. package/src/commands/install/helpers/templates/graylogTemplates.ts +63 -0
  84. package/src/commands/install/helpers/templates/ibmAPIConnectTemplates.ts +106 -0
  85. package/src/commands/install/helpers/templates/istioTemplates.ts +204 -0
  86. package/src/commands/install/helpers/templates/kafkaTemplates.ts +184 -0
  87. package/src/commands/install/helpers/templates/sapApiPortalTemplates.ts +104 -0
  88. package/src/commands/install/helpers/templates/sensediaTemplates.ts +108 -0
  89. package/src/commands/install/helpers/templates/softwareAGWebMethodsTemplates.ts +86 -0
  90. package/src/commands/install/helpers/templates/traceableTemplates.ts +123 -0
  91. package/src/commands/install/helpers/templates/wso2Templates.ts +75 -0
  92. package/src/commands/install/helpers/util.ts +45 -0
  93. package/src/commands/install/ibmAPIConnectAgents.spec.ts +539 -0
  94. package/src/commands/install/ibmAPIConnectAgents.ts +259 -0
  95. package/src/commands/install/index.ts +30 -0
  96. package/src/commands/install/istioAgents.spec.ts +1086 -0
  97. package/src/commands/install/istioAgents.ts +471 -0
  98. package/src/commands/install/kafkaAgents.spec.ts +707 -0
  99. package/src/commands/install/kafkaAgents.ts +358 -0
  100. package/src/commands/install/platform.ts +296 -0
  101. package/src/commands/install/sapApiPortalAgents.spec.ts +318 -0
  102. package/src/commands/install/sapApiPortalAgents.ts +248 -0
  103. package/src/commands/install/sensediaAgents.spec.ts +364 -0
  104. package/src/commands/install/sensediaAgents.ts +270 -0
  105. package/src/commands/install/softwareAGWebMethodsAgents.spec.ts +503 -0
  106. package/src/commands/install/softwareAGWebMethodsAgents.ts +191 -0
  107. package/src/commands/install/swaggerHubSaasAgents.spec.ts +351 -0
  108. package/src/commands/install/swaggerHubSaasAgents.ts +358 -0
  109. package/src/commands/install/traceableAgents.spec.ts +505 -0
  110. package/src/commands/install/traceableAgents.ts +323 -0
  111. package/src/commands/install/traceableSaasAgents.spec.ts +289 -0
  112. package/src/commands/install/traceableSaasAgents.ts +388 -0
  113. package/src/commands/install/wso2Agents.spec.ts +275 -0
  114. package/src/commands/install/wso2Agents.ts +197 -0
  115. package/src/commands/productize/helpers/productizationHelper.ts +466 -0
  116. package/src/commands/productize/index.spec.ts +367 -0
  117. package/src/commands/productize/index.ts +87 -0
  118. package/src/common/ApiServerClient.spec.ts +176 -0
  119. package/src/common/ApiServerClient.ts +1341 -0
  120. package/src/common/CacheController.spec.ts +207 -0
  121. package/src/common/CacheController.ts +162 -0
  122. package/src/common/CliConfigManager.spec.ts +83 -0
  123. package/src/common/CliConfigManager.ts +84 -0
  124. package/src/common/CompositeError.spec.ts +137 -0
  125. package/src/common/CompositeError.ts +94 -0
  126. package/src/common/CoreConfigController.spec.ts +107 -0
  127. package/src/common/CoreConfigController.ts +272 -0
  128. package/src/common/DefinitionsManager.spec.ts +267 -0
  129. package/src/common/DefinitionsManager.ts +328 -0
  130. package/src/common/Kubectl.ts +72 -0
  131. package/src/common/PlatformClient.ts +144 -0
  132. package/src/common/Renderer.spec.ts +141 -0
  133. package/src/common/Renderer.ts +426 -0
  134. package/src/common/TmpFile.spec.ts +85 -0
  135. package/src/common/TmpFile.ts +77 -0
  136. package/src/common/bashCommands.ts +88 -0
  137. package/src/common/basicPrompts.spec.ts +200 -0
  138. package/src/common/basicPrompts.ts +186 -0
  139. package/src/common/dataService.spec.ts +74 -0
  140. package/src/common/dataService.ts +330 -0
  141. package/src/common/errorHandler.ts +45 -0
  142. package/src/common/kubectl.spec.ts +72 -0
  143. package/src/common/modules.d.ts +6 -0
  144. package/src/common/resultRenderers.spec.ts +26 -0
  145. package/src/common/resultsRenderers.ts +169 -0
  146. package/src/common/types.ts +881 -0
  147. package/src/common/utils.spec.ts +200 -0
  148. package/src/common/utils.ts +530 -0
  149. package/src/main.ts +6 -0
  150. package/src/scripts/postinstall.js +54 -0
  151. package/src/scripts/resources/amplify-cli-utils-envs.js +83 -0
  152. package/src/scripts/resources/amplify-sdk-envs.js +62 -0
@@ -188,7 +188,7 @@ const gatewayConnectivity = async installConfig => {
188
188
  return hostedAgentValues;
189
189
  };
190
190
  const generateOutput = async installConfig => {
191
- return `Install complete of hosted agent for ${installConfig.gatewayType}`;
191
+ return `Install complete of hosted agent for ${installConfig.gatewayType} region`;
192
192
  };
193
193
  const createEncryptedAccessData = async (hostedAgentValues, dataplaneRes) => {
194
194
  var _dataplaneRes$securit, _dataplaneRes$securit2;
@@ -220,7 +220,7 @@ const gatewayConnectivity = async installConfig => {
220
220
  return hostedAgentValues;
221
221
  };
222
222
  const generateOutput = async installConfig => {
223
- return `Install complete of hosted agent for ${installConfig.gatewayType}`;
223
+ return `Install complete of hosted agent for ${installConfig.gatewayType} region`;
224
224
  };
225
225
  const createEncryptedAccessData = async (hostedAgentValues, dataplaneRes) => {
226
226
  var _dataplaneRes$securit, _dataplaneRes$securit2;
@@ -357,7 +357,7 @@ const gatewayConnectivity = async installConfig => {
357
357
  return hostedAgentValues;
358
358
  };
359
359
  const generateOutput = async installConfig => {
360
- return `Install complete of hosted agent for ${installConfig.gatewayType}`;
360
+ return `Install complete of hosted agent for ${installConfig.gatewayType} region`;
361
361
  };
362
362
  const createEncryptedAccessData = async (hostedAgentValues, dataplaneRes) => {
363
363
  var _dataplaneRes$securit, _dataplaneRes$securit2;
@@ -367,7 +367,7 @@ const gatewayConnectivity = async installConfig => {
367
367
  return hostedAgentValues;
368
368
  };
369
369
  const generateOutput = async installConfig => {
370
- return `Install complete of hosted agent for ${installConfig.gatewayType}`;
370
+ return `Install complete of hosted agent for ${installConfig.gatewayType} region`;
371
371
  };
372
372
  const createEncryptedAccessData = async (agentValues, dataplaneRes) => {
373
373
  var _dataplaneRes$securit, _dataplaneRes$securit2;
@@ -220,7 +220,7 @@ const gatewayConnectivity = async installConfig => {
220
220
  return hostedAgentValues;
221
221
  };
222
222
  const generateOutput = async installConfig => {
223
- return `Install complete of hosted agent for ${installConfig.gatewayType}`;
223
+ return `Install complete of hosted agent for ${installConfig.gatewayType} region`;
224
224
  };
225
225
  const createEncryptedAccessData = async (hostedAgentValues, dataplaneRes) => {
226
226
  var _dataplaneRes$securit, _dataplaneRes$securit2;
@@ -158,15 +158,18 @@ const getApicDeployment = (region, env) => {
158
158
  const deployments = {
159
159
  [_types.Regions.US]: {
160
160
  [_types.Platforms.prod]: _types.APICDeployments.US,
161
- [_types.Platforms.staging]: _types.APICDeployments.TEAMS
161
+ [_types.Platforms.staging]: _types.APICDeployments.TEAMS,
162
+ [_types.Platforms.preprod]: _types.APICDeployments.USPreprod
162
163
  },
163
164
  [_types.Regions.EU]: {
164
165
  [_types.Platforms.prod]: _types.APICDeployments.EU,
165
- [_types.Platforms.staging]: _types.APICDeployments.EUStaging
166
+ [_types.Platforms.staging]: _types.APICDeployments.EUStaging,
167
+ [_types.Platforms.preprod]: _types.APICDeployments.EUPreprod
166
168
  },
167
169
  [_types.Regions.AP]: {
168
170
  [_types.Platforms.prod]: _types.APICDeployments.AP,
169
- [_types.Platforms.staging]: _types.APICDeployments.APStaging
171
+ [_types.Platforms.staging]: _types.APICDeployments.APStaging,
172
+ [_types.Platforms.preprod]: _types.APICDeployments.APPreprod
170
173
  }
171
174
  };
172
175
  const savedDeployment = new _CliConfigManager.CliConfigManager().getAll()['apic-deployment'];
@@ -198,7 +198,7 @@ const gatewayConnectivity = async installConfig => {
198
198
  return hostedAgentValues;
199
199
  };
200
200
  const generateOutput = async installConfig => {
201
- return `Install complete of hosted agent for ${installConfig.gatewayType}`;
201
+ return `Install complete of hosted agent for ${installConfig.gatewayType} region`;
202
202
  };
203
203
  const createEncryptedAccessData = async (hostedAgentValues, dataplaneRes) => {
204
204
  var _dataplaneRes$securit, _dataplaneRes$securit2;
@@ -194,7 +194,7 @@ const gatewayConnectivity = async installConfig => {
194
194
  return hostedAgentValues;
195
195
  };
196
196
  const generateOutput = async installConfig => {
197
- return `Install complete of hosted agent for ${installConfig.gatewayType}`;
197
+ return `Install complete of hosted agent for ${installConfig.gatewayType} region`;
198
198
  };
199
199
  const createEncryptedAccessData = async (hostedAgentValues, dataplaneRes) => {
200
200
  var _dataplaneRes$securit, _dataplaneRes$securit2;
@@ -68,7 +68,7 @@ class CoreConfigController {
68
68
 
69
69
  // environment defined by using central cli "base-url" or axway "env" configs if set,
70
70
  // otherwise its undefined (equals to prod)
71
- const environment = !baseUrl || baseUrl === _types.ProdBaseUrls.US || baseUrl === _types.ProdBaseUrls.EU || baseUrl === _types.ProdBaseUrls.AP ? config.get('env') : 'staging';
71
+ const environment = !baseUrl || baseUrl === _types.ProdBaseUrls.US || baseUrl === _types.ProdBaseUrls.EU || baseUrl === _types.ProdBaseUrls.AP || baseUrl === _types.PreprodBaseUrls.US || baseUrl === _types.PreprodBaseUrls.EU ? config.get('env') : 'staging';
72
72
  log(`getAuthInfo, baseUrl = ${baseUrl}, environment = ${environment}`);
73
73
  const {
74
74
  sdk
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.docsUrl = exports.commonCmdArgsDescription = exports.cliVersionHeader = exports.YesNoChoices = exports.YesNo = exports.WAIT_TIMEOUT = exports.TrueFalseChoices = exports.TrueFalse = exports.TraceableRegionType = exports.TraceabilityConfig = exports.SaaSGatewayTypes = exports.Regions = exports.PublicRepoUrl = exports.PublicDockerRepoBaseUrl = exports.Protocol = exports.ProdBaseUrls = exports.Platforms = exports.OutputTypes = exports.MAX_TABLE_STRING_LENGTH = exports.MAX_FILE_SIZE = exports.MAX_CACHE_FILE_SIZE = exports.LoggingSource = exports.LanguageTypes = exports.KindTypes = exports.Kind = exports.IstioProfileChoices = exports.IstioInstallValues = exports.IstioAgentValues = exports.IDPType = exports.IDPConfiguration = exports.IDPClientSecretAuthMethod = exports.IDPAuthType = exports.IDPAuthConfiguration = exports.IDPAuthClientSecret = exports.IDPAuthAccessToken = exports.GatewayTypes = exports.GatewayTypeToDataPlane = exports.GatewayMode = exports.EnvironmentConfigInfo = exports.DosaAccount = exports.DataPlaneNames = exports.DOSAConfigInfo = exports.ConfigTypes = exports.CloudFormationConfig = exports.Certificate = exports.CentralAgentConfig = exports.CACHE_FILE_TTL_MILLISECONDS = exports.BundleType = exports.BasePaths = exports.AzureDataplaneMode = exports.AuthUrls = exports.ApigeeMetricsFilterConfig = exports.AgentTypes = exports.AgentResourceKind = exports.AgentNames = exports.AgentInstallSwitches = exports.AgentInstallConfig = exports.AgentConfigTypes = exports.AWSRegions = exports.APIGEEXDISCOVERYMODES = exports.APIGEEXAuthType = exports.APICDeployments = exports.ABORT_TIMEOUT = void 0;
6
+ exports.docsUrl = exports.commonCmdArgsDescription = exports.cliVersionHeader = exports.YesNoChoices = exports.YesNo = exports.WAIT_TIMEOUT = exports.TrueFalseChoices = exports.TrueFalse = exports.TraceableRegionType = exports.TraceabilityConfig = exports.SaaSGatewayTypes = exports.Regions = exports.PublicRepoUrl = exports.PublicDockerRepoBaseUrl = exports.Protocol = exports.ProdBaseUrls = exports.PreprodRegions = exports.PreprodBaseUrls = exports.Platforms = exports.OutputTypes = exports.MAX_TABLE_STRING_LENGTH = exports.MAX_FILE_SIZE = exports.MAX_CACHE_FILE_SIZE = exports.LoggingSource = exports.LanguageTypes = exports.KindTypes = exports.Kind = exports.IstioProfileChoices = exports.IstioInstallValues = exports.IstioAgentValues = exports.IDPType = exports.IDPConfiguration = exports.IDPClientSecretAuthMethod = exports.IDPAuthType = exports.IDPAuthConfiguration = exports.IDPAuthClientSecret = exports.IDPAuthAccessToken = exports.GatewayTypes = exports.GatewayTypeToDataPlane = exports.GatewayMode = exports.EnvironmentConfigInfo = exports.DosaAccount = exports.DataPlaneNames = exports.DOSAConfigInfo = exports.ConfigTypes = exports.CloudFormationConfig = exports.Certificate = exports.CentralAgentConfig = exports.CACHE_FILE_TTL_MILLISECONDS = exports.BundleType = exports.BasePaths = exports.AzureDataplaneMode = exports.AuthUrls = exports.ApigeeMetricsFilterConfig = exports.AgentTypes = exports.AgentResourceKind = exports.AgentNames = exports.AgentInstallSwitches = exports.AgentInstallConfig = exports.AgentConfigTypes = exports.AWSRegions = exports.APIGEEXDISCOVERYMODES = exports.APIGEEXAuthType = exports.APICDeployments = exports.ABORT_TIMEOUT = void 0;
7
7
  var _utils = require("./utils");
8
8
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
9
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
@@ -63,6 +63,7 @@ let ConfigTypes = exports.ConfigTypes = /*#__PURE__*/function (ConfigTypes) {
63
63
  let AuthUrls = exports.AuthUrls = /*#__PURE__*/function (AuthUrls) {
64
64
  AuthUrls["Staging"] = "https://login.axwaytest.net";
65
65
  AuthUrls["Prod"] = "https://login.axway.com";
66
+ AuthUrls["Preprod"] = "https://login.na-us.axwaypreprod.net";
66
67
  return AuthUrls;
67
68
  }({});
68
69
  let Regions = exports.Regions = /*#__PURE__*/function (Regions) {
@@ -71,9 +72,15 @@ let Regions = exports.Regions = /*#__PURE__*/function (Regions) {
71
72
  Regions["AP"] = "AP";
72
73
  return Regions;
73
74
  }({});
75
+ let PreprodRegions = exports.PreprodRegions = /*#__PURE__*/function (PreprodRegions) {
76
+ PreprodRegions["US"] = "US";
77
+ PreprodRegions["EU"] = "EU";
78
+ return PreprodRegions;
79
+ }({});
74
80
  let Platforms = exports.Platforms = /*#__PURE__*/function (Platforms) {
75
81
  Platforms["prod"] = "prod";
76
82
  Platforms["staging"] = "staging";
83
+ Platforms["preprod"] = "preprod";
77
84
  return Platforms;
78
85
  }({});
79
86
  const ProdBaseUrls = exports.ProdBaseUrls = {
@@ -81,6 +88,10 @@ const ProdBaseUrls = exports.ProdBaseUrls = {
81
88
  EU: 'https://central.eu-fr.axway.com',
82
89
  AP: 'https://central.ap-sg.axway.com'
83
90
  };
91
+ const PreprodBaseUrls = exports.PreprodBaseUrls = {
92
+ US: 'https://engage.na-us.axwaypreprod.net',
93
+ EU: 'https://engage.eu-fr.axwaypreprod.net'
94
+ };
84
95
  const APICDeployments = exports.APICDeployments = {
85
96
  EU: 'prod-eu',
86
97
  EUStaging: 'staging-eu',
@@ -89,7 +100,10 @@ const APICDeployments = exports.APICDeployments = {
89
100
  USStaging: 'staging',
90
101
  TEAMS: 'teams',
91
102
  AP: 'prod-ap',
92
- APStaging: 'preprod'
103
+ APStaging: 'preprod',
104
+ USPreprod: 'preprod',
105
+ EUPreprod: 'preprod',
106
+ APPreprod: 'preprod'
93
107
  };
94
108
  const commonCmdArgsDescription = exports.commonCmdArgsDescription = {
95
109
  '--account [value]': 'Override your default account config',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axway/axway-central-cli",
3
- "version": "4.10.0-rc.0",
3
+ "version": "4.10.0-rc.2",
4
4
  "description": "Manage APIs, services and publish to the Amplify Marketplace",
5
5
  "homepage": "https://platform.axway.com",
6
6
  "author": {
@@ -32,7 +32,8 @@
32
32
  "test:w": "yarn test -w --watch-extensions ts",
33
33
  "type-check": "tsc -p tsconfig.build.json",
34
34
  "start": "nodemon --watch src -e yaml,ts,js,json -i *.spec.ts --exec npm run build",
35
- "sonar": "bash sonar.sh"
35
+ "sonar": "bash sonar.sh",
36
+ "postinstall": "node src/scripts/postinstall.js || node -e true"
36
37
  },
37
38
  "main": "./dist/main.js",
38
39
  "amplify": {
package/src/cli.ts ADDED
@@ -0,0 +1,65 @@
1
+ import CLI from 'cli-kit';
2
+ import dayjs from 'dayjs';
3
+ import relativeTime from 'dayjs/plugin/relativeTime';
4
+ import { existsSync, outputJsonSync, readJsonSync } from 'fs-extra';
5
+ import { apply } from './commands/apply';
6
+ import { completion } from './commands/completion';
7
+ import { config } from './commands/config';
8
+ import { create } from './commands/create';
9
+ import { deleteCmd } from './commands/delete';
10
+ import { edit } from './commands/edit';
11
+ import { get } from './commands/get';
12
+ import { install } from './commands/install';
13
+ import { configFile, hbsCompare } from './common/utils';
14
+ import { productize } from './commands/productize';
15
+
16
+ dayjs.extend(relativeTime);
17
+ require('tls').DEFAULT_ECDH_CURVE = 'auto';
18
+ hbsCompare();
19
+
20
+ const { version } = require('../package.json');
21
+
22
+ // Create the configFile if it doesn't exist yet and read all extensions on load
23
+ if (!existsSync(configFile)) {
24
+ outputJsonSync(configFile, {});
25
+ }
26
+ const extensions = [...Object.values(readJsonSync(configFile).extensions || {})];
27
+
28
+ // cliParams export only needed for "completion" command and its testing
29
+ export const cliParams = {
30
+ title: 'Axway Engage CLI',
31
+ name: 'engage',
32
+ banner: '',
33
+ version,
34
+ commands: {
35
+ completion,
36
+ apply,
37
+ config,
38
+ create,
39
+ delete: deleteCmd,
40
+ edit,
41
+ get,
42
+ install,
43
+ productize,
44
+ },
45
+ extensions,
46
+ };
47
+
48
+ export default new CLI({
49
+ title: 'Axway Central CLI',
50
+ name: 'central',
51
+ banner: '',
52
+ version,
53
+ commands: {
54
+ completion,
55
+ apply,
56
+ config,
57
+ create,
58
+ delete: deleteCmd,
59
+ edit,
60
+ get,
61
+ install,
62
+ productize,
63
+ },
64
+ extensions,
65
+ });