@axway/axway-central-cli 2.26.0-rc.1 → 2.26.0-rc.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.
@@ -16,6 +16,7 @@ var _Renderer = _interopRequireDefault(require("../../common/Renderer"));
16
16
  var _types = require("../../common/types");
17
17
  var _utils = require("../../common/utils");
18
18
  var awsAgents = _interopRequireWildcard(require("./awsAgents"));
19
+ var awsSaaSAgents = _interopRequireWildcard(require("./awsSaasAgents"));
19
20
  var gitHubAgents = _interopRequireWildcard(require("./gitHubSaasAgents"));
20
21
  var gitLabAgents = _interopRequireWildcard(require("./gitLabAgents"));
21
22
  var azureAgents = _interopRequireWildcard(require("./azureAgents"));
@@ -23,7 +24,6 @@ var edgeAgents = _interopRequireWildcard(require("./edgeAgents"));
23
24
  var apigeeSaaSAgents = _interopRequireWildcard(require("./apigeexSaasAgents"));
24
25
  var helpers = _interopRequireWildcard(require("./helpers"));
25
26
  var istioAgents = _interopRequireWildcard(require("./istioAgents"));
26
- var saasAgents = _interopRequireWildcard(require("./awsSaasAgents"));
27
27
  var kafkaAgents = _interopRequireWildcard(require("./kafkaAgents"));
28
28
  var swaggerHubAgents = _interopRequireWildcard(require("./swaggerHubSaasAgents"));
29
29
  var platform = _interopRequireWildcard(require("./platform"));
@@ -42,19 +42,16 @@ const agentInstallFlows = {
42
42
  [_types.GatewayTypes.EDGE_GATEWAY]: edgeAgents.EdgeInstallMethods,
43
43
  [_types.GatewayTypes.EDGE_GATEWAY_ONLY]: edgeAgents.EdgeGWOnlyInstallMethods,
44
44
  [_types.GatewayTypes.AWS_GATEWAY]: awsAgents.AWSInstallMethods,
45
- [_types.GatewayTypes.GITHUB]: gitHubAgents.GitHubSaaSInstallMethods,
46
45
  [_types.GatewayTypes.GITLAB]: gitLabAgents.GitLabInstallMethods,
47
- [_types.GatewayTypes.APIGEEX_GATEWAY]: apigeeSaaSAgents.APIGEEXSaaSInstallMethods,
48
46
  [_types.GatewayTypes.AZURE_GATEWAY]: azureAgents.AzureInstallMethods,
49
47
  [_types.GatewayTypes.ISTIO]: istioAgents.IstioInstallMethods,
50
- [_types.GatewayTypes.KAFKA]: kafkaAgents.KafkaInstallMethods,
51
- [_types.GatewayTypes.SWAGGERHUB]: swaggerHubAgents.SwaggerHubSaaSInstallMethods
48
+ [_types.GatewayTypes.KAFKA]: kafkaAgents.KafkaInstallMethods
52
49
  };
53
50
  const saasAgentInstallFlows = {
54
- [_types.GatewayTypes.AWS_GATEWAY]: saasAgents.AWSSaaSInstallMethods,
55
- [_types.GatewayTypes.GITHUB]: gitHubAgents.GitHubSaaSInstallMethods,
56
- [_types.GatewayTypes.APIGEEX_GATEWAY]: apigeeSaaSAgents.APIGEEXSaaSInstallMethods,
57
- [_types.GatewayTypes.SWAGGERHUB]: swaggerHubAgents.SwaggerHubSaaSInstallMethods
51
+ [_types.SaaSGatewayTypes.AWS_GATEWAY]: awsSaaSAgents.AWSSaaSInstallMethods,
52
+ [_types.SaaSGatewayTypes.GITHUB]: gitHubAgents.GitHubSaaSInstallMethods,
53
+ [_types.SaaSGatewayTypes.APIGEEX_GATEWAY]: apigeeSaaSAgents.APIGEEXSaaSInstallMethods,
54
+ [_types.SaaSGatewayTypes.SWAGGERHUB]: swaggerHubAgents.SwaggerHubSaaSInstallMethods
58
55
  };
59
56
  const createConfigBackup = async (configFiles, gatewayType) => {
60
57
  // If current configurations exist, back them up
@@ -115,9 +112,12 @@ const agents = exports.agents = {
115
112
  // top priority is region option on command line, second priority is region from config file, default is US
116
113
  installConfig.centralConfig.region = await determineRegion(region);
117
114
  installConfig.centralConfig.singleEntryPointUrl = _types.SingleEntryPointUrls[installConfig.centralConfig.region];
115
+ let gatewayTypeChoices = [];
116
+ Object.values(_types.GatewayTypes).forEach(v => gatewayTypeChoices.push(v));
117
+ Object.values(_types.SaaSGatewayTypes).filter(v => v !== _types.SaaSGatewayTypes.AWS_GATEWAY).forEach(v => gatewayTypeChoices.push(v));
118
118
  let gatewayType = await (0, _basicPrompts.askList)({
119
119
  msg: prompts.selectGatewayType,
120
- choices: Object.values(_types.GatewayTypes).filter(v => v !== _types.GatewayTypes.EDGE_GATEWAY_ONLY)
120
+ choices: gatewayTypeChoices.sort().filter(v => v !== _types.GatewayTypes.EDGE_GATEWAY_ONLY)
121
121
  });
122
122
  if (gatewayType === _types.GatewayTypes.AWS_GATEWAY) {
123
123
  // hosted vs on premise
@@ -127,7 +127,7 @@ const agents = exports.agents = {
127
127
  default: _types.YesNo.Yes
128
128
  })) === _types.YesNo.Yes;
129
129
  }
130
- if (gatewayType === _types.GatewayTypes.APIGEEX_GATEWAY || gatewayType === _types.GatewayTypes.GITHUB || gatewayType === _types.GatewayTypes.SWAGGERHUB) {
130
+ if (gatewayType === _types.SaaSGatewayTypes.APIGEEX_GATEWAY || gatewayType === _types.SaaSGatewayTypes.GITHUB || gatewayType === _types.SaaSGatewayTypes.SWAGGERHUB) {
131
131
  installConfig.switches.isHostedInstall = true;
132
132
  }
133
133
 
@@ -157,7 +157,7 @@ const gatewayConnectivity = async installConfig => {
157
157
 
158
158
  // DeploymentType
159
159
  let hostedAgentValues = new SaasAgentValues();
160
- if (installConfig.gatewayType === _types.GatewayTypes.APIGEEX_GATEWAY) {
160
+ if (installConfig.gatewayType === _types.SaaSGatewayTypes.APIGEEX_GATEWAY) {
161
161
  // APIGEE X connection details
162
162
  hostedAgentValues = new SaasAPIGEEXAgentValues();
163
163
  hostedAgentValues = await askForAPIGEEXCredentials(hostedAgentValues);
@@ -217,7 +217,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
217
217
  axwayManaged: installConfig.centralConfig.axwayManaged,
218
218
  production: installConfig.centralConfig.production
219
219
  }) : installConfig.centralConfig.ampcEnvInfo.name;
220
- if (installConfig.gatewayType === _types.GatewayTypes.APIGEEX_GATEWAY) {
220
+ if (installConfig.gatewayType === _types.SaaSGatewayTypes.APIGEEX_GATEWAY) {
221
221
  apigeeXAgentValues.dataplaneConfig = new APIGEEXDataplaneConfig(apigeeXAgentValues.projectId, apigeeXAgentValues.developerEmailAddress, apigeeXAgentValues.mode);
222
222
  }
223
223
 
@@ -256,7 +256,7 @@ const APIGEEXSaaSInstallMethods = exports.APIGEEXSaaSInstallMethods = {
256
256
  [_types.AgentTypes.da]: _types.AgentNames.APIGEEX_DA,
257
257
  [_types.AgentTypes.ta]: _types.AgentNames.APIGEEX_TA
258
258
  },
259
- GatewayDisplay: _types.GatewayTypes.APIGEEX_GATEWAY
259
+ GatewayDisplay: _types.SaaSGatewayTypes.APIGEEX_GATEWAY
260
260
  };
261
261
 
262
262
  // These are the items that are not exported, but need to be for testing
@@ -140,7 +140,7 @@ const gatewayConnectivity = async installConfig => {
140
140
 
141
141
  // DeploymentType
142
142
  let hostedAgentValues = new SaasAgentValues();
143
- if (installConfig.gatewayType === _types.GatewayTypes.GITHUB) {
143
+ if (installConfig.gatewayType === _types.SaaSGatewayTypes.GITHUB) {
144
144
  // GitHub connection details
145
145
  hostedAgentValues = new SaasGitHubAgentValues();
146
146
  hostedAgentValues = await askForGitHubCredentials(hostedAgentValues);
@@ -251,7 +251,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
251
251
  axwayManaged: installConfig.centralConfig.axwayManaged,
252
252
  production: installConfig.centralConfig.production
253
253
  }) : installConfig.centralConfig.ampcEnvInfo.name;
254
- if (installConfig.gatewayType === _types.GatewayTypes.GITHUB) {
254
+ if (installConfig.gatewayType === _types.SaaSGatewayTypes.GITHUB) {
255
255
  gitHubAgentValues.dataplaneConfig = new GitHubDataplaneConfig(gitHubAgentValues.repositoryName, gitHubAgentValues.repositoryOwner, new GitHubFilterConfig(gitHubAgentValues.filePaths, gitHubAgentValues.repositoryBranch, gitHubAgentValues.filePatterns));
256
256
  }
257
257
 
@@ -284,7 +284,7 @@ const GitHubSaaSInstallMethods = exports.GitHubSaaSInstallMethods = {
284
284
  [_types.AgentTypes.da]: _types.AgentNames.GITHUB_DA,
285
285
  [_types.AgentTypes.ta]: _types.AgentNames.GITHUB_DA
286
286
  },
287
- GatewayDisplay: _types.GatewayTypes.GITHUB
287
+ GatewayDisplay: _types.SaaSGatewayTypes.GITHUB
288
288
  };
289
289
 
290
290
  // These are the items that are not exported, but need to be for testing
@@ -95,8 +95,8 @@ const ConfigFiles = {};
95
95
  const SaasPrompts = {
96
96
  API_KEY: 'Enter the SwaggerHub API Key the agent will use',
97
97
  ORGANIZATION_OWNER: 'Enter the SwaggerHub Organization Owner the agent will use',
98
- API_VISIBILITY: 'Enter the visibility of the APIs to be discovered (Optional). If nothing is selected, both Private and Public APIs will be discoverd',
99
- API_PUBLICATION: 'Enter the publication status of APIs to be discovered (Optional). If nothing is selected, both Published and UnPublished APIs will be discovered',
98
+ API_VISIBILITY: 'Enter the visibility of the APIs to be discovered (Optional).',
99
+ API_PUBLICATION: 'Enter the publication status of APIs to be discovered (Optional).',
100
100
  DA_FREQUENCY: 'How often should the discovery run, leave blank for integrating in CI/CD process',
101
101
  QUEUE: 'Do you want to discover immediately after installation'
102
102
  };
@@ -139,7 +139,7 @@ const gatewayConnectivity = async installConfig => {
139
139
 
140
140
  // DeploymentType
141
141
  let hostedAgentValues = new SaasAgentValues();
142
- if (installConfig.gatewayType === _types.GatewayTypes.SWAGGERHUB) {
142
+ if (installConfig.gatewayType === _types.SaaSGatewayTypes.SWAGGERHUB) {
143
143
  // SwaggerHub connection details
144
144
  hostedAgentValues = new SaasSwaggerHubAgentValues();
145
145
  hostedAgentValues = await askForSwaggerHubCredentials(hostedAgentValues);
@@ -229,7 +229,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
229
229
  axwayManaged: installConfig.centralConfig.axwayManaged,
230
230
  production: installConfig.centralConfig.production
231
231
  }) : installConfig.centralConfig.ampcEnvInfo.name;
232
- if (installConfig.gatewayType === _types.GatewayTypes.SWAGGERHUB) {
232
+ if (installConfig.gatewayType === _types.SaaSGatewayTypes.SWAGGERHUB) {
233
233
  swaggerHubAgentValues.dataplaneConfig = new SwaggerHubDataplaneConfig(swaggerHubAgentValues.owner, new SwaggerHubFilterConfig(swaggerHubAgentValues.visibility, swaggerHubAgentValues.publication));
234
234
  }
235
235
 
@@ -262,7 +262,7 @@ const SwaggerHubSaaSInstallMethods = exports.SwaggerHubSaaSInstallMethods = {
262
262
  [_types.AgentTypes.da]: _types.AgentNames.SWAGGERHUB_DA,
263
263
  [_types.AgentTypes.ta]: _types.AgentNames.SWAGGERHUB_DA
264
264
  },
265
- GatewayDisplay: _types.GatewayTypes.SWAGGERHUB
265
+ GatewayDisplay: _types.SaaSGatewayTypes.SWAGGERHUB
266
266
  };
267
267
 
268
268
  // These are the items that are not exported, but need to be for testing
@@ -229,20 +229,18 @@ let AgentNames = exports.AgentNames = /*#__PURE__*/function (AgentNames) {
229
229
  let GatewayTypes = exports.GatewayTypes = /*#__PURE__*/function (GatewayTypes) {
230
230
  GatewayTypes["EDGE_GATEWAY"] = "Amplify API Gateway";
231
231
  GatewayTypes["AWS_GATEWAY"] = "Amazon API Gateway";
232
- GatewayTypes["APIGEEX_GATEWAY"] = "Apigee X Gateway";
233
232
  GatewayTypes["AZURE_GATEWAY"] = "Azure API Gateway";
234
- GatewayTypes["GITHUB"] = "GitHub";
235
233
  GatewayTypes["GITLAB"] = "GitLab";
236
234
  GatewayTypes["ISTIO"] = "Istio";
237
235
  GatewayTypes["EDGE_GATEWAY_ONLY"] = "Amplify API Gateway only";
238
236
  GatewayTypes["KAFKA"] = "Kafka";
239
- GatewayTypes["SWAGGERHUB"] = "SwaggerHub";
240
237
  return GatewayTypes;
241
238
  }({});
242
239
  let SaaSGatewayTypes = exports.SaaSGatewayTypes = /*#__PURE__*/function (SaaSGatewayTypes) {
243
- SaaSGatewayTypes[SaaSGatewayTypes["AWS_GATEWAY"] = 0] = "AWS_GATEWAY";
244
- SaaSGatewayTypes[SaaSGatewayTypes["GITHUB_GATEWAY"] = 1] = "GITHUB_GATEWAY";
245
- SaaSGatewayTypes[SaaSGatewayTypes["APIGEEX_GATEWAY"] = 2] = "APIGEEX_GATEWAY";
240
+ SaaSGatewayTypes["AWS_GATEWAY"] = "Amazon API Gateway";
241
+ SaaSGatewayTypes["APIGEEX_GATEWAY"] = "Apigee X Gateway";
242
+ SaaSGatewayTypes["GITHUB"] = "GitHub";
243
+ SaaSGatewayTypes["SWAGGERHUB"] = "SwaggerHub";
246
244
  return SaaSGatewayTypes;
247
245
  }({});
248
246
  let DataPlaneNames = exports.DataPlaneNames = /*#__PURE__*/function (DataPlaneNames) {
@@ -264,13 +262,13 @@ const GatewayTypeToDataPlane = exports.GatewayTypeToDataPlane = {
264
262
  [GatewayTypes.EDGE_GATEWAY]: DataPlaneNames.EDGE,
265
263
  [GatewayTypes.EDGE_GATEWAY_ONLY]: DataPlaneNames.EDGE,
266
264
  [GatewayTypes.AWS_GATEWAY]: DataPlaneNames.AWS,
267
- [GatewayTypes.GITHUB]: DataPlaneNames.GITHUB,
265
+ [SaaSGatewayTypes.GITHUB]: DataPlaneNames.GITHUB,
268
266
  [GatewayTypes.GITLAB]: DataPlaneNames.GITLAB,
269
267
  [GatewayTypes.AZURE_GATEWAY]: DataPlaneNames.AZURE,
270
268
  [GatewayTypes.ISTIO]: 'Istio',
271
- [GatewayTypes.APIGEEX_GATEWAY]: DataPlaneNames.APIGEE,
269
+ [SaaSGatewayTypes.APIGEEX_GATEWAY]: DataPlaneNames.APIGEE,
272
270
  [GatewayTypes.KAFKA]: DataPlaneNames.KAFKA,
273
- [GatewayTypes.SWAGGERHUB]: DataPlaneNames.SWAGGERHUB
271
+ [SaaSGatewayTypes.SWAGGERHUB]: DataPlaneNames.SWAGGERHUB
274
272
  };
275
273
  let AgentResourceKind = exports.AgentResourceKind = /*#__PURE__*/function (AgentResourceKind) {
276
274
  AgentResourceKind["da"] = "DiscoveryAgent";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axway/axway-central-cli",
3
- "version": "2.26.0-rc.1",
3
+ "version": "2.26.0-rc.3",
4
4
  "description": "Manage APIs, services and publish to the Unified Catalog",
5
5
  "homepage": "https://platform.axway.com",
6
6
  "author": {