@axway/axway-central-cli 2.15.0-rc.1 → 2.15.0-rc.3
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.
|
@@ -10,7 +10,7 @@ var _chalk = _interopRequireDefault(require("chalk"));
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
12
|
const deleteByResourceType = async (client, defsManager, name, resourceType, resourceShortName, scopeName = '') => {
|
|
13
|
-
console.log(`
|
|
13
|
+
console.log(`Deleting ${resourceType}`); // NOTE: only a first found set is used
|
|
14
14
|
|
|
15
15
|
const defs = defsManager.findDefsByWord(resourceShortName);
|
|
16
16
|
|
|
@@ -98,7 +98,7 @@ const ConfigFiles = {}; // AWSAuthType - how the agent will authenticate to AWS
|
|
|
98
98
|
var AWSAuthType; // AWSSaaSPrompts - all AWS Saas prompts to the user for input
|
|
99
99
|
|
|
100
100
|
(function (AWSAuthType) {
|
|
101
|
-
AWSAuthType["ASSUME"] = "
|
|
101
|
+
AWSAuthType["ASSUME"] = "Assume Role Policy";
|
|
102
102
|
AWSAuthType["KEYS"] = "Access and Secret Keys";
|
|
103
103
|
})(AWSAuthType || (AWSAuthType = {}));
|
|
104
104
|
|
|
@@ -151,7 +151,8 @@ const askForAWSCredentials = async hostedAgentValues => {
|
|
|
151
151
|
|
|
152
152
|
hostedAgentValues.externalID = await (0, _basicPrompts.askInput)({
|
|
153
153
|
msg: SaasPrompts.EXTERNAL_ID,
|
|
154
|
-
defaultValue: hostedAgentValues.externalID !== '' ? hostedAgentValues.externalID : undefined
|
|
154
|
+
defaultValue: hostedAgentValues.externalID !== '' ? hostedAgentValues.externalID : undefined,
|
|
155
|
+
allowEmptyInput: true
|
|
155
156
|
});
|
|
156
157
|
} else {
|
|
157
158
|
log("using key and secret authentication"); // get access key
|
|
@@ -170,6 +171,27 @@ const askForAWSCredentials = async hostedAgentValues => {
|
|
|
170
171
|
}
|
|
171
172
|
|
|
172
173
|
return hostedAgentValues;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
const validateFrequency = () => input => {
|
|
177
|
+
let val = (0, _basicPrompts.validateRegex)(helpers.frequencyRegex, helpers.invalidValueExampleErrMsg('frequency', '3d5h12m'))(input);
|
|
178
|
+
|
|
179
|
+
if (typeof val === "string") {
|
|
180
|
+
return val;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
let r = input.toString().match(/^(\d*)m/);
|
|
184
|
+
|
|
185
|
+
if (r) {
|
|
186
|
+
// only minutes
|
|
187
|
+
let mins = r[1];
|
|
188
|
+
|
|
189
|
+
if (parseInt(mins, 10) < 30) {
|
|
190
|
+
return "Minimum frequency is 30m";
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return true;
|
|
173
195
|
}; // @ts-ignore
|
|
174
196
|
|
|
175
197
|
|
|
@@ -187,10 +209,10 @@ const gatewayConnectivity = async installConfig => {
|
|
|
187
209
|
|
|
188
210
|
|
|
189
211
|
log("getting the frequency and if the agent should run now");
|
|
190
|
-
console.log(_chalk.default.gray(`
|
|
212
|
+
console.log(_chalk.default.gray(`00d00h00m format, where 30m = 30 minutes, 1h = 1 hour, 7d = 7 days, and 7d1h30m = 7 days 1 hour and 30 minutes. Minimum of 30m.`));
|
|
191
213
|
hostedAgentValues.frequency = await (0, _basicPrompts.askInput)({
|
|
192
214
|
msg: SaasPrompts.FREQUENCY,
|
|
193
|
-
validate: (
|
|
215
|
+
validate: validateFrequency(),
|
|
194
216
|
allowEmptyInput: true
|
|
195
217
|
});
|
|
196
218
|
hostedAgentValues.queue = (await (0, _basicPrompts.askList)({
|