@axway/axway-central-cli 2.7.1 → 2.8.0-rc.0

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.
@@ -103,7 +103,7 @@ const agents = {
103
103
  let gatewayType = await (0, _basicPrompts.askList)({
104
104
  msg: prompts.selectGatewayType,
105
105
  choices: [_types.GatewayTypes.EDGE_GATEWAY, _types.GatewayTypes.AWS_GATEWAY, _types.GatewayTypes.AZURE_GATEWAY, _types.GatewayTypes.ISTIO]
106
- }); // if gateway type is edge ask Gateway only or not
106
+ }); // if gateway type is edge ask Gateway only or not
107
107
 
108
108
  if (gatewayType === _types.GatewayTypes.EDGE_GATEWAY) {
109
109
  installConfig.switches.isGatewayOnly = false;
@@ -134,6 +134,11 @@ const agents = {
134
134
  if (installConfig.switches.isTaEnabled) {
135
135
  installConfig.taVersion = await helpers.getLatestAgentVersion(agentInstallFlow.AgentNameMap[_types.AgentTypes.ta]);
136
136
  }
137
+ } // if EDGE_GATEWAY or EDGE_GATEWAY_ONLY and isDaEnabled, ask if the organization structure should replicate
138
+
139
+
140
+ if ((gatewayType === _types.GatewayTypes.EDGE_GATEWAY || gatewayType === _types.GatewayTypes.EDGE_GATEWAY_ONLY) && installConfig.switches.isDaEnabled) {
141
+ installConfig.switches.isOrgRep = await edgeAgents.askOrganizationReplication();
137
142
  } // get platform connectivity
138
143
 
139
144
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.testables = exports.prompts = exports.installPreprocess = exports.gatewayConnectivity = exports.dockerPublicKey = exports.dockerPrivateKey = exports.completeInstall = exports.askIsGatewayOnlyMode = exports.askConfigType = exports.askBundleTypeGWOnly = exports.askBundleType = exports.EdgeInstallMethods = exports.EdgeGWOnlyInstallMethods = exports.ConfigFiles = void 0;
6
+ exports.testables = exports.prompts = exports.installPreprocess = exports.gatewayConnectivity = exports.dockerPublicKey = exports.dockerPrivateKey = exports.completeInstall = exports.askOrganizationReplication = exports.askIsGatewayOnlyMode = exports.askConfigType = exports.askBundleTypeGWOnly = exports.askBundleType = exports.EdgeInstallMethods = exports.EdgeGWOnlyInstallMethods = exports.ConfigFiles = void 0;
7
7
 
8
8
  var _cliKit = require("cli-kit");
9
9
 
@@ -69,7 +69,8 @@ const prompts = {
69
69
  askEventsPath: 'Enter the path to the API Gateway event log directory',
70
70
  askOpenTrafficPath: 'Enter the path to the API Gateway open traffic log directory',
71
71
  enterGatewayAgentNs: 'Enter the namespace to use for the Amplify Gateway Agents',
72
- enterGatewayManagerMode: 'Do you want to use API Manager with the API Gateway'
72
+ enterGatewayManagerMode: 'Do you want to use API Manager with the API Gateway',
73
+ askIfOrgReplication: 'Do you want to replicate your original organization structure for your newly discovered APIs? If yes, make sure the organization names match the team names that are created in Amplify platform'
73
74
  };
74
75
  exports.prompts = prompts;
75
76
 
@@ -124,6 +125,17 @@ const askIsGatewayOnlyMode = async () => {
124
125
 
125
126
  exports.askIsGatewayOnlyMode = askIsGatewayOnlyMode;
126
127
 
128
+ const askOrganizationReplication = async () => {
129
+ const mode = await (0, _basicPrompts.askList)({
130
+ msg: prompts.askIfOrgReplication,
131
+ default: _types.YesNo.Yes,
132
+ choices: _types.YesNoChoices
133
+ });
134
+ return mode == _types.YesNo.Yes;
135
+ };
136
+
137
+ exports.askOrganizationReplication = askOrganizationReplication;
138
+
127
139
  const askBundleType = async () => {
128
140
  return await (0, _basicPrompts.askList)({
129
141
  msg: helpers.agentMessages.selectAgentType,
@@ -124,7 +124,9 @@ CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
124
124
  CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
125
125
  CENTRAL_ENVIRONMENT={{centralConfig.environment}}
126
126
  CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
127
+ {{#compare centralConfig.ampcTeamName '!=' ""}}
127
128
  CENTRAL_TEAM={{centralConfig.ampcTeamName}}
129
+ {{/compare}}
128
130
  {{#compare . centralConfig.region "EU"}}
129
131
  CENTRAL_URL={{centralConfig.url}}
130
132
  CENTRAL_DEPLOYMENT={{centralConfig.deployment}}
@@ -195,7 +197,9 @@ env:
195
197
  CENTRAL_DEPLOYMENT: {{centralConfig.deployment}}
196
198
  CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
197
199
  CENTRAL_ORGANIZATIONID: "{{centralConfig.ampcTeamName}}"
200
+ {{#compare centralConfig.ampcTeamName '!=' ""}}
198
201
  CENTRAL_TEAM: {{centralConfig.ampcTeamName}}
202
+ {{/compare}}
199
203
  CENTRAL_URL: {{centralConfig.url}}
200
204
  EVENT_LOG_FILE_PATHS: /events/*.log
201
205
  LOG_LEVEL: info
@@ -266,7 +270,9 @@ CENTRAL_AUTH_PRIVATEKEY={{centralConfig.dosaAccount.templatePrivateKey}}
266
270
  CENTRAL_AUTH_PUBLICKEY={{centralConfig.dosaAccount.templatePublicKey}}
267
271
  CENTRAL_ENVIRONMENT={{centralConfig.environment}}
268
272
  CENTRAL_ORGANIZATIONID={{centralConfig.orgId}}
273
+ {{#compare centralConfig.ampcTeamName '!=' ""}}
269
274
  CENTRAL_TEAM={{centralConfig.ampcTeamName}}
275
+ {{/compare}}
270
276
  {{#compare . centralConfig.region "EU"}}
271
277
  CENTRAL_URL={{centralConfig.url}}
272
278
  {{/compare}}
@@ -315,7 +321,9 @@ env:
315
321
  CENTRAL_AUTH_URL: {{centralConfig.authUrl}}
316
322
  CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
317
323
  CENTRAL_ORGANIZATIONID: "{{centralConfig.orgId}}"
324
+ {{#compare centralConfig.ampcTeamName '!=' ""}}
318
325
  CENTRAL_TEAM: {{centralConfig.ampcTeamName}}
326
+ {{/compare}}
319
327
  CENTRAL_URL: {{centralConfig.url}}
320
328
  LOG_LEVEL: info
321
329
 
@@ -100,7 +100,11 @@ const getCentralConfig = async (apiServerClient, platformClient, defsManager, ap
100
100
  centralConfig.orgId = await helpers.getCurrentUserOrgId();
101
101
  centralConfig.ampcEnvInfo = await helpers.askEnvironmentName(apiServerClient, defsManager, centralConfig.axwayManaged);
102
102
  centralConfig.production = centralConfig.ampcEnvInfo.isNew ? await askIsProductionEnvironment() : false;
103
- centralConfig.ampcTeamName = await askTeamName(platformClient);
103
+
104
+ if (!installConfig.switches.isOrgRep) {
105
+ centralConfig.ampcTeamName = await askTeamName(platformClient);
106
+ }
107
+
104
108
  centralConfig.ampcDosaInfo = {
105
109
  clientId: '',
106
110
  name: '',
@@ -127,11 +127,19 @@ class Renderer {
127
127
  bulkResult.success.forEach(r => this.success(`${this.resourceAndScopeKinds(r)} ${simpleSuccessMsg}`));
128
128
  bulkResult.error.forEach(r => this.anyError(r.error, `"${r.kind}/${r.name}" error: `, true));
129
129
  } else if (this.output) {
130
- (0, _resultsRenderers.renderResponse)(this._console, bulkResult.success, this.output);
131
- } else {
132
130
  var _bulkResult$warning2;
133
131
 
134
- (_bulkResult$warning2 = bulkResult.warning) === null || _bulkResult$warning2 === void 0 ? void 0 : _bulkResult$warning2.forEach(r => this.warning(`${this.resourceAndScopeKinds(r)} was created with an autogenerated logical name.`));
132
+ let results = bulkResult.success;
133
+
134
+ if ((_bulkResult$warning2 = bulkResult.warning) !== null && _bulkResult$warning2 !== void 0 && _bulkResult$warning2.length) {
135
+ results = bulkResult.warning.concat(results);
136
+ }
137
+
138
+ (0, _resultsRenderers.renderResponse)(this._console, results, this.output);
139
+ } else {
140
+ var _bulkResult$warning3;
141
+
142
+ (_bulkResult$warning3 = bulkResult.warning) === null || _bulkResult$warning3 === void 0 ? void 0 : _bulkResult$warning3.forEach(r => this.warning(`${this.resourceAndScopeKinds(r)} was created with an autogenerated logical name.`));
135
143
  bulkResult.success.forEach(r => this.success(`${this.resourceAndScopeKinds(r)} ${simpleSuccessMsg}`));
136
144
  }
137
145
  }
@@ -160,11 +168,19 @@ class Renderer {
160
168
  bulkResult.updated.success.forEach(r => this.success(`${this.resourceAndScopeKinds(r)} ${updateSuccessMsg}`));
161
169
  bulkResultCombined.error.forEach(r => this.anyError(r.error, `"${r.kind}/${r.name}" error: `, true));
162
170
  } else if (this.output) {
163
- (0, _resultsRenderers.renderResponse)(this._console, bulkResultCombined.success, this.output);
164
- } else {
165
171
  var _bulkResult$created$w2;
166
172
 
167
- (_bulkResult$created$w2 = bulkResult.created.warning) === null || _bulkResult$created$w2 === void 0 ? void 0 : _bulkResult$created$w2.forEach(r => this.warning(`${this.resourceAndScopeKinds(r)} ${createWarningMsg}`));
173
+ let results = bulkResultCombined.success;
174
+
175
+ if ((_bulkResult$created$w2 = bulkResult.created.warning) !== null && _bulkResult$created$w2 !== void 0 && _bulkResult$created$w2.length) {
176
+ results = bulkResult.created.warning.concat(results);
177
+ }
178
+
179
+ (0, _resultsRenderers.renderResponse)(this._console, results, this.output);
180
+ } else {
181
+ var _bulkResult$created$w3;
182
+
183
+ (_bulkResult$created$w3 = bulkResult.created.warning) === null || _bulkResult$created$w3 === void 0 ? void 0 : _bulkResult$created$w3.forEach(r => this.warning(`${this.resourceAndScopeKinds(r)} ${createWarningMsg}`));
168
184
  bulkResult.created.success.forEach(r => this.success(`${this.resourceAndScopeKinds(r)} ${createSuccessMsg}`));
169
185
  bulkResult.updated.success.forEach(r => this.success(`${this.resourceAndScopeKinds(r)} ${updateSuccessMsg}`));
170
186
  }
@@ -411,12 +411,15 @@ class AgentInstallSwitches {
411
411
 
412
412
  _defineProperty(this, "isBinaryInstall", void 0);
413
413
 
414
+ _defineProperty(this, "isOrgRep", void 0);
415
+
414
416
  this.isDaEnabled = false;
415
417
  this.isTaEnabled = false;
416
418
  this.isHelmInstall = false;
417
419
  this.isGatewayOnly = false;
418
420
  this.isDockerInstall = false;
419
421
  this.isBinaryInstall = false;
422
+ this.isOrgRep = false;
420
423
  }
421
424
 
422
425
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axway/axway-central-cli",
3
- "version": "2.7.1",
3
+ "version": "2.8.0-rc.0",
4
4
  "description": "Manage APIs, services and publish to the Unified Catalog",
5
5
  "homepage": "https://platform.axway.com",
6
6
  "author": {
@@ -41,7 +41,7 @@
41
41
  "name": "central"
42
42
  },
43
43
  "dependencies": {
44
- "@axway/amplify-cli-utils": "^5.0.3",
44
+ "@axway/amplify-cli-utils": "^5.0.6",
45
45
  "chalk": "^4.1.2",
46
46
  "cli-kit": "^1.15.0",
47
47
  "dayjs": "^1.10.7",
@@ -60,42 +60,41 @@
60
60
  "tmp": "^0.2.1"
61
61
  },
62
62
  "devDependencies": {
63
- "@babel/cli": "^7.16.0",
64
- "@babel/core": "^7.16.0",
65
- "@babel/plugin-proposal-class-properties": "^7.16.0",
66
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
67
- "@babel/plugin-proposal-optional-chaining": "^7.16.0",
68
- "@babel/preset-env": "^7.16.4",
69
- "@babel/preset-typescript": "^7.16.0",
70
- "@types/chai": "^4.2.22",
63
+ "@babel/cli": "^7.16.8",
64
+ "@babel/core": "^7.16.12",
65
+ "@babel/plugin-proposal-class-properties": "^7.16.7",
66
+ "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
67
+ "@babel/plugin-proposal-optional-chaining": "^7.16.7",
68
+ "@babel/preset-env": "^7.16.11",
69
+ "@babel/preset-typescript": "^7.16.7",
70
+ "@types/chai": "^4.3.0",
71
71
  "@types/chai-as-promised": "^7.1.4",
72
- "@types/easy-table": "^0.0.33",
73
72
  "@types/form-data": "^2.5.0",
74
73
  "@types/fs-extra": "^9.0.13",
75
- "@types/inquirer": "^8.1.3",
74
+ "@types/inquirer": "^8.2.0",
76
75
  "@types/js-yaml": "^4.0.5",
77
- "@types/lodash": "^4.14.177",
78
- "@types/mocha": "^9.0.0",
79
- "@types/node": "^16.11.10",
76
+ "@types/lodash": "^4.14.178",
77
+ "@types/mocha": "^9.1.0",
78
+ "@types/node": "^17.0.14",
80
79
  "@types/rx": "^4.1.2",
81
80
  "@types/semver": "^7.3.9",
82
- "@types/sinon": "^10.0.6",
83
- "@types/tmp": "^0.2.2",
81
+ "@types/sinon": "^10.0.9",
82
+ "@types/tmp": "^0.2.3",
84
83
  "@types/update-notifier": "^5.1.0",
85
- "@types/uuid": "^8.3.3",
84
+ "@types/uuid": "^8.3.4",
86
85
  "babel-plugin-lodash": "^3.3.4",
87
- "chai": "^4.3.4",
86
+ "chai": "^4.3.6",
88
87
  "chai-as-promised": "^7.1.1",
89
- "core-js": "^3.19.1",
90
- "mocha": "^9.1.3",
91
- "nock": "^13.2.1",
88
+ "core-js": "^3.21.0",
89
+ "mocha": "^9.2.0",
90
+ "nock": "^13.2.2",
92
91
  "nodemon": "^2.0.15",
93
92
  "nyc": "^15.1.0",
94
- "prettier": "^2.4.1",
93
+ "prettier": "^2.5.1",
95
94
  "sinon": "^11.1.2",
96
95
  "source-map-support": "^0.5.21",
97
- "ts-mocha": "^8.0.0",
98
- "typescript": "^4.5.2"
96
+ "ts-mocha": "^9.0.2",
97
+ "typescript": "^4.5.5"
99
98
  },
100
99
  "jest": {
101
100
  "verbose": true,