@axway/axway-central-cli 2.10.0-rc.1 → 2.10.1

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.
@@ -47,6 +47,12 @@ const get = {
47
47
  argv,
48
48
  console
49
49
  }) {
50
+ if (!argv.team && argv.owner === false) {
51
+ // no --team set and --no-owner was set, so we set the team to `null` which will know
52
+ // to get teams that do not have an owner
53
+ argv.team = null;
54
+ }
55
+
50
56
  const {
51
57
  args,
52
58
  attribute,
@@ -204,7 +210,8 @@ ${defsManager.getDefsTableForHelpMsg()}`);
204
210
  '--tag [tag]': {
205
211
  desc: 'Tag of resource(s) to fetch'
206
212
  },
207
- '--team [guid|name]': 'The team name or guid to use'
213
+ '--team [guid|name]': 'The team name or guid to use',
214
+ '--no-owner': 'Returns resources which do not have an owner'
208
215
  }
209
216
  };
210
217
  exports.get = get;
@@ -47,7 +47,7 @@ const {
47
47
  const localhost = 'localhost';
48
48
  exports.localhost = localhost;
49
49
  const prompts = {
50
- selectGatewayType: 'TESTING_Select the type of gateway you want to connect'
50
+ selectGatewayType: 'Select the type of gateway you want to connect'
51
51
  };
52
52
  exports.prompts = prompts;
53
53
  const agentInstallFlows = {
@@ -118,7 +118,8 @@ const agents = {
118
118
 
119
119
  console.log(_chalk.default.gray(`This command configures and installs the agents so that you can manage your gateway environment within the Amplify Platform.\n`));
120
120
  let installConfig = new _types.AgentInstallConfig();
121
- installConfig.centralConfig.axwayManaged = !!axwayManaged; // gateway type
121
+ installConfig.centralConfig.axwayManaged = !!axwayManaged;
122
+ installConfig.centralConfig.region = region ? region.toString() : _types.Regions.US; // gateway type
122
123
 
123
124
  let gatewayType = await (0, _basicPrompts.askList)({
124
125
  msg: prompts.selectGatewayType,
@@ -173,7 +174,7 @@ const agents = {
173
174
 
174
175
  createConfigBackup(agentInstallFlow.ConfigFiles, agentInstallFlow.GatewayDisplay); // run any install preprocess steps
175
176
 
176
- if (agentInstallFlow.InstallPreprocess) installConfig = await agentInstallFlow.InstallPreprocess(installConfig); // finalize platform setup
177
+ if (agentInstallFlow.InstallPreprocess) installConfig = await agentInstallFlow.InstallPreprocess(installConfig); // finalize Platform setup
177
178
 
178
179
  installConfig = await platform.finalizeCentralInstall(apiServerClient, platformClient, defsManager, installConfig); // finalize gateway setup and output
179
180
 
@@ -112,7 +112,7 @@ const askDosaClientId = async (client, showWarning = true) => {
112
112
  } else {
113
113
  // We're using an existing service account. Notify user to make its keys available to the agents.
114
114
  if (showWarning) {
115
- console.log(_chalk.default.yellow('Please make sure your "private_key.pem" and "public_key.pem" files for the selected service account are copied to the folder location of the agents.'));
115
+ console.log(_chalk.default.yellow('Please make sure your "private_key.pem" and "public_key.pem" files for the selected service account are in this installation folder.'));
116
116
  } // Fetch selected service account's client ID and return info about it.
117
117
 
118
118
 
@@ -191,9 +191,9 @@ env:
191
191
  CENTRAL_AUTH_URL: {{centralConfig.authUrl}}
192
192
  CENTRAL_DEPLOYMENT: {{centralConfig.deployment}}
193
193
  CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
194
- CENTRAL_ORGANIZATIONID: "{{centralConfig.ampcTeamName}}"
194
+ CENTRAL_ORGANIZATIONID: "{{centralConfig.orgId}}"
195
195
  {{#compare . centralConfig.ampcTeamName "" operator="!=" }}
196
- CENTRAL_TEAM={{centralConfig.ampcTeamName}}
196
+ CENTRAL_TEAM: {{centralConfig.ampcTeamName}}
197
197
  {{/compare}}
198
198
  CENTRAL_URL: {{centralConfig.url}}
199
199
  EVENT_LOG_FILE_PATHS: /events/*.log
@@ -317,7 +317,7 @@ env:
317
317
  CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
318
318
  CENTRAL_ORGANIZATIONID: "{{centralConfig.orgId}}"
319
319
  {{#compare . centralConfig.ampcTeamName "" operator="!=" }}
320
- CENTRAL_TEAM={{centralConfig.ampcTeamName}}
320
+ CENTRAL_TEAM: {{centralConfig.ampcTeamName}}
321
321
  {{/compare}}
322
322
  CENTRAL_URL: {{centralConfig.url}}
323
323
  LOG_LEVEL: info
@@ -161,6 +161,8 @@ class CoreConfigController {
161
161
  }
162
162
 
163
163
  result.teamGuid = teamObj.guid;
164
+ } else if (team === null) {
165
+ result.teamGuid = null;
164
166
  }
165
167
 
166
168
  log(`getAuthInfo, returning account = ${devOpsAccount.name}`);
@@ -154,9 +154,9 @@ const dataService = async ({
154
154
  const fetch = async (method, url, params = {}) => {
155
155
  try {
156
156
  // add the team guid
157
- if (teamGuid) {
157
+ if (teamGuid !== undefined) {
158
158
  const parsed = new _url.URL(url);
159
- parsed.searchParams.set('query', `owner.id==${teamGuid}`);
159
+ parsed.searchParams.set('query', teamGuid ? `owner.id==${teamGuid},(owner.id==null;metadata.scope.owner.id==${teamGuid})` : 'owner.id==null');
160
160
  url = parsed.toString();
161
161
  }
162
162
 
@@ -167,16 +167,22 @@ async function resolveTeamNames({
167
167
  const targetJsonPath = jsonPath.split('.').slice(0, -1).join('.') + '.teamName';
168
168
  column.jsonPath = `.${targetJsonPath}`; // next loop over data and set the team name
169
169
 
170
- for (const {
170
+ for (let {
171
171
  data
172
172
  } of results) {
173
- if (Array.isArray(data)) {
174
- for (const obj of data) {
175
- const value = (0, _get.default)(obj, jsonPath, null);
173
+ if (!data || typeof data !== 'object') {
174
+ continue;
175
+ }
176
+
177
+ if (!Array.isArray(data)) {
178
+ data = [data];
179
+ }
180
+
181
+ for (const obj of data) {
182
+ const value = (0, _get.default)(obj, jsonPath, null);
176
183
 
177
- if (value !== null) {
178
- (0, _set.default)(obj, targetJsonPath, value && teamNames[value] || value || '');
179
- }
184
+ if (value !== null) {
185
+ (0, _set.default)(obj, targetJsonPath, value && teamNames[value] || value || '');
180
186
  }
181
187
  }
182
188
  }
@@ -370,7 +370,7 @@ class CentralAgentConfig {
370
370
  _defineProperty(this, "axwayManaged", void 0);
371
371
 
372
372
  _defineProperty(this, "setBaseHost", async () => {
373
- this.url = await (0, _dataService.getBaseUrl)();
373
+ this.url = await (0, _dataService.getBaseUrl)(undefined, undefined, this.region);
374
374
  [this.scheme, this.host] = this.url.split('://');
375
375
  });
376
376
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axway/axway-central-cli",
3
- "version": "2.10.0-rc.1",
3
+ "version": "2.10.1",
4
4
  "description": "Manage APIs, services and publish to the Unified Catalog",
5
5
  "homepage": "https://platform.axway.com",
6
6
  "author": {
@@ -41,19 +41,21 @@
41
41
  "name": "central"
42
42
  },
43
43
  "dependencies": {
44
- "@axway/amplify-cli-utils": "^5.0.6",
44
+ "@axway/amplify-cli-utils": "^5.0.7",
45
45
  "chalk": "^4.1.2",
46
46
  "cli-kit": "^1.15.0",
47
- "dayjs": "^1.10.7",
47
+ "dayjs": "^1.11.0",
48
48
  "easy-table": "^1.2.0",
49
49
  "extract-zip": "^2.0.1",
50
50
  "form-data": "^4.0.0",
51
- "fs-extra": "^10.0.0",
51
+ "fs-extra": "^10.0.1",
52
+ "g": "^2.0.1",
52
53
  "handlebars": "^4.7.7",
53
- "inquirer": "^8.2.0",
54
+ "inquirer": "^8.2.1",
54
55
  "js-yaml": "^4.1.0",
55
56
  "lodash": "^4.17.21",
56
57
  "node-cache": "^5.1.2",
58
+ "npm-check-updates": "^12.5.4",
57
59
  "ora": "^5.4.1",
58
60
  "promise-limit": "^2.7.0",
59
61
  "semver": "^7.3.5",
@@ -61,41 +63,41 @@
61
63
  "tmp": "^0.2.1"
62
64
  },
63
65
  "devDependencies": {
64
- "@babel/cli": "^7.16.8",
65
- "@babel/core": "^7.16.12",
66
+ "@babel/cli": "^7.17.6",
67
+ "@babel/core": "^7.17.8",
66
68
  "@babel/plugin-proposal-class-properties": "^7.16.7",
67
69
  "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
68
70
  "@babel/plugin-proposal-optional-chaining": "^7.16.7",
69
71
  "@babel/preset-env": "^7.16.11",
70
72
  "@babel/preset-typescript": "^7.16.7",
71
73
  "@types/chai": "^4.3.0",
72
- "@types/chai-as-promised": "^7.1.4",
74
+ "@types/chai-as-promised": "^7.1.5",
73
75
  "@types/form-data": "^2.5.0",
74
76
  "@types/fs-extra": "^9.0.13",
75
77
  "@types/inquirer": "^8.2.0",
76
78
  "@types/js-yaml": "^4.0.5",
77
- "@types/lodash": "^4.14.178",
79
+ "@types/lodash": "^4.14.180",
78
80
  "@types/mocha": "^9.1.0",
79
- "@types/node": "^17.0.14",
81
+ "@types/node": "^17.0.22",
80
82
  "@types/rx": "^4.1.2",
81
83
  "@types/semver": "^7.3.9",
82
- "@types/sinon": "^10.0.9",
84
+ "@types/sinon": "^10.0.11",
83
85
  "@types/tmp": "^0.2.3",
84
86
  "@types/update-notifier": "^5.1.0",
85
87
  "@types/uuid": "^8.3.4",
86
88
  "babel-plugin-lodash": "^3.3.4",
87
89
  "chai": "^4.3.6",
88
90
  "chai-as-promised": "^7.1.1",
89
- "core-js": "^3.21.0",
90
- "mocha": "^9.2.0",
91
- "nock": "^13.2.2",
91
+ "core-js": "^3.21.1",
92
+ "mocha": "^9.2.2",
93
+ "nock": "^13.2.4",
92
94
  "nodemon": "^2.0.15",
93
95
  "nyc": "^15.1.0",
94
- "prettier": "^2.5.1",
96
+ "prettier": "^2.6.0",
95
97
  "sinon": "^11.1.2",
96
98
  "source-map-support": "^0.5.21",
97
99
  "ts-mocha": "^9.0.2",
98
- "typescript": "^4.5.5"
100
+ "typescript": "^4.6.2"
99
101
  },
100
102
  "jest": {
101
103
  "verbose": true,