@axway/axway-central-cli 2.9.2 → 2.9.5
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/install/agents.js +4 -3
- package/dist/commands/install/helpers/getters.js +2 -2
- package/dist/commands/install/helpers/templates/awsTemplates.js +0 -8
- package/dist/commands/install/helpers/templates/azureTemplates.js +0 -8
- package/dist/commands/install/helpers/templates/edgeTemplates.js +2 -7
- package/dist/commands/install/platform.js +3 -6
- package/dist/common/resultsRenderers.js +12 -5
- package/dist/common/types.js +1 -1
- package/package.json +1 -1
|
@@ -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
|
|
|
@@ -136,8 +136,8 @@ const getLatestAgentVersion = async agent => {
|
|
|
136
136
|
} // find the largest tag
|
|
137
137
|
|
|
138
138
|
|
|
139
|
-
const [pMajor, pMinor, pPatch] = prev.split('.');
|
|
140
|
-
const [cMajor, cMinor, cPatch] = current.split('.');
|
|
139
|
+
const [pMajor, pMinor, pPatch] = prev.split('.').map(Number);
|
|
140
|
+
const [cMajor, cMinor, cPatch] = current.split('.').map(Number);
|
|
141
141
|
|
|
142
142
|
if (cMajor > pMajor) {
|
|
143
143
|
return current;
|
|
@@ -94,25 +94,17 @@ CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
|
94
94
|
{{#compare . centralConfig.region "EU"}}
|
|
95
95
|
CENTRAL_URL={{centralConfig.url}}
|
|
96
96
|
CENTRAL_DEPLOYMENT={{centralConfig.deployment}}
|
|
97
|
-
{{#if traceabilityConfig.enabled}}
|
|
98
97
|
|
|
99
98
|
TRACEABILITY_HOST={{traceabilityConfig.host}}
|
|
100
|
-
{{else}}
|
|
101
|
-
|
|
102
|
-
{{/if}}
|
|
103
99
|
{{/compare}}
|
|
104
100
|
{{#compare . centralConfig.region "US"}}
|
|
105
101
|
|
|
106
102
|
{{/compare}}
|
|
107
|
-
{{#if traceabilityConfig.enabled}}
|
|
108
103
|
{{#compare . traceabilityConfig.protocol "https"}}
|
|
109
104
|
TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
|
|
110
105
|
{{/compare}}
|
|
111
106
|
TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
|
|
112
107
|
TRACEABILITY_SAMPLING_REPORTALLERRORS={{traceabilityConfig.samplingReportAllErrors}}
|
|
113
|
-
{{else}}
|
|
114
|
-
TRACEABILITY_SAMPLING_PERCENTAGE=0
|
|
115
|
-
{{/if}}
|
|
116
108
|
{{/if}}
|
|
117
109
|
|
|
118
110
|
# Logging configs
|
|
@@ -89,25 +89,17 @@ CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
|
89
89
|
{{#compare . centralConfig.region "EU"}}
|
|
90
90
|
CENTRAL_URL={{centralConfig.url}}
|
|
91
91
|
CENTRAL_DEPLOYMENT={{centralConfig.deployment}}
|
|
92
|
-
{{#if traceabilityConfig.enabled}}
|
|
93
92
|
|
|
94
93
|
TRACEABILITY_HOST={{traceabilityConfig.host}}
|
|
95
|
-
{{else}}
|
|
96
|
-
|
|
97
|
-
{{/if}}
|
|
98
94
|
{{/compare}}
|
|
99
95
|
{{#compare . centralConfig.region "US"}}
|
|
100
96
|
|
|
101
97
|
{{/compare}}
|
|
102
|
-
{{#if traceabilityConfig.enabled}}
|
|
103
98
|
{{#compare . traceabilityConfig.protocol "https"}}
|
|
104
99
|
TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
|
|
105
100
|
{{/compare}}
|
|
106
101
|
TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
|
|
107
102
|
TRACEABILITY_SAMPLING_REPORTALLERRORS={{traceabilityConfig.samplingReportAllErrors}}
|
|
108
|
-
{{else}}
|
|
109
|
-
TRACEABILITY_SAMPLING_PERCENTAGE=0
|
|
110
|
-
{{/if}}
|
|
111
103
|
{{/if}}
|
|
112
104
|
|
|
113
105
|
# Logging configs
|
|
@@ -130,22 +130,17 @@ CENTRAL_TEAM={{centralConfig.ampcTeamName}}
|
|
|
130
130
|
{{#compare . centralConfig.region "EU"}}
|
|
131
131
|
CENTRAL_URL={{centralConfig.url}}
|
|
132
132
|
CENTRAL_DEPLOYMENT={{centralConfig.deployment}}
|
|
133
|
-
{{#if traceabilityConfig.enabled}}
|
|
134
133
|
|
|
135
134
|
TRACEABILITY_HOST={{traceabilityConfig.host}}
|
|
136
|
-
{{
|
|
135
|
+
{{/compare}}
|
|
136
|
+
{{#compare . centralConfig.region "US"}}
|
|
137
137
|
|
|
138
|
-
{{/if}}
|
|
139
138
|
{{/compare}}
|
|
140
|
-
{{#if traceabilityConfig.enabled}}
|
|
141
139
|
{{#compare . traceabilityConfig.protocol "https"}}
|
|
142
140
|
TRACEABILITY_PROTOCOL={{traceabilityConfig.protocol}}
|
|
143
141
|
{{/compare}}
|
|
144
142
|
TRACEABILITY_SAMPLING_PERCENTAGE={{traceabilityConfig.samplingPercentage}}
|
|
145
143
|
TRACEABILITY_SAMPLING_REPORTALLERRORS={{traceabilityConfig.samplingReportAllErrors}}
|
|
146
|
-
{{else}}
|
|
147
|
-
TRACEABILITY_SAMPLING_PERCENTAGE=0
|
|
148
|
-
{{/if}}
|
|
149
144
|
{{/if}}
|
|
150
145
|
|
|
151
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;
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.renderResponse = exports.parseAsYaml = exports.parseAsJson = void 0;
|
|
7
7
|
exports.resolveTeamNames = resolveTeamNames;
|
|
8
8
|
|
|
9
|
+
var _chalk = _interopRequireDefault(require("chalk"));
|
|
10
|
+
|
|
9
11
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
10
12
|
|
|
11
13
|
var _easyTable = _interopRequireDefault(require("easy-table"));
|
|
@@ -76,7 +78,7 @@ const parseAsTable = (response, columns) => {
|
|
|
76
78
|
if (col.type === 'date') {
|
|
77
79
|
value = (0, _dayjs.default)(value).fromNow();
|
|
78
80
|
} else if (col.type === 'teamGuid' && !value) {
|
|
79
|
-
value = '
|
|
81
|
+
value = _chalk.default.gray('---');
|
|
80
82
|
}
|
|
81
83
|
|
|
82
84
|
t.cell(col.name.toUpperCase(), value);
|
|
@@ -166,11 +168,16 @@ async function resolveTeamNames({
|
|
|
166
168
|
column.jsonPath = `.${targetJsonPath}`; // next loop over data and set the team name
|
|
167
169
|
|
|
168
170
|
for (const {
|
|
169
|
-
data
|
|
171
|
+
data
|
|
170
172
|
} of results) {
|
|
171
|
-
|
|
172
|
-
const
|
|
173
|
-
|
|
173
|
+
if (Array.isArray(data)) {
|
|
174
|
+
for (const obj of data) {
|
|
175
|
+
const value = (0, _get.default)(obj, jsonPath, null);
|
|
176
|
+
|
|
177
|
+
if (value !== null) {
|
|
178
|
+
(0, _set.default)(obj, targetJsonPath, value && teamNames[value] || value || '');
|
|
179
|
+
}
|
|
180
|
+
}
|
|
174
181
|
}
|
|
175
182
|
}
|
|
176
183
|
}
|
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
|
|