@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.
- package/dist/commands/get/index.js +8 -1
- package/dist/commands/install/agents.js +4 -3
- package/dist/commands/install/helpers/templates/awsTemplates.js +0 -4
- package/dist/commands/install/helpers/templates/azureTemplates.js +0 -4
- package/dist/commands/install/helpers/templates/edgeTemplates.js +0 -4
- package/dist/commands/install/platform.js +3 -6
- package/dist/common/CoreConfigController.js +2 -0
- package/dist/common/dataService.js +2 -2
- package/dist/common/resultsRenderers.js +13 -7
- package/dist/common/types.js +1 -1
- package/package.json +18 -16
|
@@ -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;
|
|
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
|
|
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
|
-
|
|
78
|
-
|
|
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;
|
|
@@ -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 (
|
|
170
|
+
for (let {
|
|
171
171
|
data
|
|
172
172
|
} of results) {
|
|
173
|
-
if (
|
|
174
|
-
|
|
175
|
-
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
184
|
+
if (value !== null) {
|
|
185
|
+
(0, _set.default)(obj, targetJsonPath, value && teamNames[value] || value || '');
|
|
180
186
|
}
|
|
181
187
|
}
|
|
182
188
|
}
|
package/dist/common/types.js
CHANGED
|
@@ -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
|
|
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.
|
|
44
|
+
"@axway/amplify-cli-utils": "^5.0.7",
|
|
45
45
|
"chalk": "^4.1.2",
|
|
46
46
|
"cli-kit": "^1.15.0",
|
|
47
|
-
"dayjs": "^1.
|
|
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.
|
|
51
|
+
"fs-extra": "^10.0.1",
|
|
52
|
+
"g": "^2.0.1",
|
|
52
53
|
"handlebars": "^4.7.7",
|
|
53
|
-
"inquirer": "^8.2.
|
|
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.
|
|
65
|
-
"@babel/core": "^7.
|
|
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.
|
|
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.
|
|
79
|
+
"@types/lodash": "^4.14.180",
|
|
78
80
|
"@types/mocha": "^9.1.0",
|
|
79
|
-
"@types/node": "^17.0.
|
|
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.
|
|
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.
|
|
90
|
-
"mocha": "^9.2.
|
|
91
|
-
"nock": "^13.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.
|
|
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.
|
|
100
|
+
"typescript": "^4.6.2"
|
|
99
101
|
},
|
|
100
102
|
"jest": {
|
|
101
103
|
"verbose": true,
|