@axway/axway-central-cli 2.10.0-rc.0 → 2.10.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.
@@ -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;
@@ -118,12 +118,13 @@ 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,
125
126
  choices: [_types.GatewayTypes.EDGE_GATEWAY, _types.GatewayTypes.AWS_GATEWAY, _types.GatewayTypes.AZURE_GATEWAY, _types.GatewayTypes.ISTIO]
126
- }); // if gateway type is edge ask Gateway only or not
127
+ }); // if gateway type is edge ask Gateway only or not
127
128
 
128
129
  if (gatewayType === _types.GatewayTypes.EDGE_GATEWAY) {
129
130
  installConfig.switches.isGatewayOnly = false;
@@ -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
 
@@ -100,15 +100,11 @@ TRACEABILITY_HOST={{traceabilityConfig.host}}
100
100
  {{#compare . centralConfig.region "US"}}
101
101
 
102
102
  {{/compare}}
103
- {{#if traceabilityConfig.enabled}}
104
103
  {{#compare . traceabilityConfig.protocol "https"}}
105
104
  TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
106
105
  {{/compare}}
107
106
  TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
108
107
  TRACEABILITY_SAMPLING_REPORTALLERRORS={{traceabilityConfig.samplingReportAllErrors}}
109
- {{else}}
110
- TRACEABILITY_SAMPLING_PERCENTAGE=0
111
- {{/if}}
112
108
  {{/if}}
113
109
 
114
110
  # Logging configs
@@ -95,15 +95,11 @@ TRACEABILITY_HOST={{traceabilityConfig.host}}
95
95
  {{#compare . centralConfig.region "US"}}
96
96
 
97
97
  {{/compare}}
98
- {{#if traceabilityConfig.enabled}}
99
98
  {{#compare . traceabilityConfig.protocol "https"}}
100
99
  TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
101
100
  {{/compare}}
102
101
  TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
103
102
  TRACEABILITY_SAMPLING_REPORTALLERRORS={{traceabilityConfig.samplingReportAllErrors}}
104
- {{else}}
105
- TRACEABILITY_SAMPLING_PERCENTAGE=0
106
- {{/if}}
107
103
  {{/if}}
108
104
 
109
105
  # Logging configs
@@ -136,15 +136,11 @@ TRACEABILITY_HOST={{traceabilityConfig.host}}
136
136
  {{#compare . centralConfig.region "US"}}
137
137
 
138
138
  {{/compare}}
139
- {{#if traceabilityConfig.enabled}}
140
139
  {{#compare . traceabilityConfig.protocol "https"}}
141
140
  TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
142
141
  {{/compare}}
143
142
  TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
144
143
  TRACEABILITY_SAMPLING_REPORTALLERRORS={{traceabilityConfig.samplingReportAllErrors}}
145
- {{else}}
146
- TRACEABILITY_SAMPLING_PERCENTAGE=0
147
- {{/if}}
148
144
  {{/if}}
149
145
 
150
146
  # Logging configs
@@ -73,12 +73,9 @@ const getTraceabilityConfig = async installConfig => {
73
73
  traceabilityConfig.enabled = enabled;
74
74
  traceabilityConfig.samplingPercentage = samplingPercentage;
75
75
  traceabilityConfig.samplingReportAllErrors = shouldReportAllErrors;
76
-
77
- if (traceabilityConfig.enabled) {
78
- const traceabilityProtocol = await helpers.askIngestionProtocol();
79
- traceabilityConfig.protocol = traceabilityProtocol;
80
- traceabilityConfig.host = helpers.getIngestionHost(installConfig.centralConfig.region, _CoreConfigController.CoreConfigController.getEnv(), installConfig.centralConfig.deployment, traceabilityProtocol);
81
- }
76
+ const traceabilityProtocol = await helpers.askIngestionProtocol();
77
+ traceabilityConfig.protocol = traceabilityProtocol;
78
+ traceabilityConfig.host = helpers.getIngestionHost(installConfig.centralConfig.region, _CoreConfigController.CoreConfigController.getEnv(), installConfig.centralConfig.deployment, traceabilityProtocol);
82
79
  }
83
80
 
84
81
  return traceabilityConfig;
@@ -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.0",
3
+ "version": "2.10.0",
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,