@codiac.io/codiac-cli 1.2.217 → 1.2.221
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/README.md +1 -1
- package/dist/apis/codiac-api/gen/client.d.ts +4 -4
- package/dist/apis/codiac-api/gen/client.js +20 -19
- package/dist/apis/codiac-api/gen/client.js.map +1 -1
- package/dist/cli-common/command-base.d.ts +2 -0
- package/dist/cli-common/command-base.js +23 -8
- package/dist/cli-common/command-base.js.map +1 -1
- package/dist/codiac-constants.d.ts +10 -0
- package/dist/codiac-constants.js +10 -0
- package/dist/codiac-constants.js.map +1 -1
- package/dist/commands/config/add.d.ts +34 -22
- package/dist/commands/config/add.js +321 -209
- package/dist/commands/config/add.js.map +1 -1
- package/dist/commands/config/delete.d.ts +22 -5
- package/dist/commands/config/delete.js +270 -82
- package/dist/commands/config/delete.js.map +1 -1
- package/dist/commands/config/settings/get.d.ts +38 -0
- package/dist/commands/config/settings/get.js +297 -0
- package/dist/commands/config/settings/get.js.map +1 -0
- package/dist/uilogic/config-ui-utils.d.ts +112 -0
- package/dist/uilogic/config-ui-utils.js +574 -0
- package/dist/uilogic/config-ui-utils.js.map +1 -0
- package/dist/uilogic/enterprise-contextualizer.d.ts +6 -3
- package/dist/uilogic/enterprise-contextualizer.js +51 -21
- package/dist/uilogic/enterprise-contextualizer.js.map +1 -1
- package/oclif.manifest.json +331 -59
- package/package.json +2 -1
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var ConfigUiUtils_1;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.findScopeTarget = exports.ConfigUiUtils = exports.InteractionModes = exports.SpecialConfigTypes = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
6
|
+
const inversify_1 = require("inversify");
|
|
7
|
+
const _ = require("lodash");
|
|
8
|
+
const YAML = require("yaml");
|
|
9
|
+
const minimatch_1 = require("minimatch");
|
|
10
|
+
const codiac_common_1 = require("@codiac.io/codiac-common");
|
|
11
|
+
const codiac_ops_common_1 = require("@codiac.io/codiac-ops-common");
|
|
12
|
+
const codiac_api_1 = require("../apis/codiac-api");
|
|
13
|
+
const contracts_1 = require("../apis/codiac-api/contracts");
|
|
14
|
+
const CodiacConstants = require("../codiac-constants");
|
|
15
|
+
const render = require("./render-methods");
|
|
16
|
+
var SpecialConfigTypes;
|
|
17
|
+
(function (SpecialConfigTypes) {
|
|
18
|
+
SpecialConfigTypes["env"] = "env";
|
|
19
|
+
SpecialConfigTypes["footprint"] = "footprint";
|
|
20
|
+
SpecialConfigTypes["helm"] = "helm";
|
|
21
|
+
})(SpecialConfigTypes = exports.SpecialConfigTypes || (exports.SpecialConfigTypes = {}));
|
|
22
|
+
var InteractionModes;
|
|
23
|
+
(function (InteractionModes) {
|
|
24
|
+
InteractionModes["echo"] = "echo";
|
|
25
|
+
InteractionModes["toscript"] = "toscript";
|
|
26
|
+
InteractionModes["silent"] = "silent";
|
|
27
|
+
})(InteractionModes = exports.InteractionModes || (exports.InteractionModes = {}));
|
|
28
|
+
let ConfigUiUtils = ConfigUiUtils_1 = class ConfigUiUtils {
|
|
29
|
+
buildConfigTree(settings) {
|
|
30
|
+
let tree = [];
|
|
31
|
+
for (let setting of settings) {
|
|
32
|
+
let branch = { text: `${this._styler.dim(setting.setting)}: ${setting.value}`, value: "" };
|
|
33
|
+
// TODO: unflatten dotpaths and recurse...
|
|
34
|
+
tree.push(branch);
|
|
35
|
+
}
|
|
36
|
+
return tree;
|
|
37
|
+
}
|
|
38
|
+
constructor(_ui, _styler, _codiacApi) {
|
|
39
|
+
this._ui = _ui;
|
|
40
|
+
this._styler = _styler;
|
|
41
|
+
this._codiacApi = _codiacApi;
|
|
42
|
+
}
|
|
43
|
+
/** Validates the candidate's current value,
|
|
44
|
+
* prompts the user if necessary,
|
|
45
|
+
* mutates the candidate as needed,
|
|
46
|
+
* and returns the applicable enterprise obj from the RootMap.
|
|
47
|
+
*
|
|
48
|
+
* Throws when unable to assign one,
|
|
49
|
+
* so otherwise, candidate SHALL ALWAYS end up with an enterprise assigned.*/
|
|
50
|
+
promptForEnterprise(candidate, rootMap) {
|
|
51
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
try {
|
|
53
|
+
let ent;
|
|
54
|
+
if (candidate.enterprise != undefined) {
|
|
55
|
+
// validate the given enterprise
|
|
56
|
+
if (rootMap.enterprises.length === 0) {
|
|
57
|
+
throw new Error("No enterprises found. You must create an enterprise to run this command.");
|
|
58
|
+
}
|
|
59
|
+
let found = rootMap.enterprises.find(x => x.name === candidate.enterprise);
|
|
60
|
+
if (found == undefined)
|
|
61
|
+
candidate.enterprise = undefined;
|
|
62
|
+
}
|
|
63
|
+
if (candidate.enterprise != undefined) {
|
|
64
|
+
ent = rootMap.enterprises.find(x => x.name === candidate.enterprise); // this assertion operator is ok bc we just validated that its in the list
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
if (rootMap.enterprises.length === 1) {
|
|
68
|
+
ent = rootMap.enterprises[0];
|
|
69
|
+
candidate.enterprise = ent.name; // Auto-select the one-and-only
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
// PROMPT FOR IT
|
|
73
|
+
let choices = rootMap.enterprises.map(e => e.name);
|
|
74
|
+
candidate.enterprise = (yield this._ui.promptSelect("enterprise", "Enterprise: ", choices));
|
|
75
|
+
ent = (rootMap.enterprises.find(x => x.name === candidate.enterprise)); // this assertion operator is ok bc we know its in this list
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return ent;
|
|
79
|
+
}
|
|
80
|
+
catch (err) {
|
|
81
|
+
throw err;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/** Returns the ultiamate asset name and the flag telling whether the original user input was changed. */
|
|
86
|
+
promptForAsset(assets, current) {
|
|
87
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
let selected = current;
|
|
89
|
+
let changed = false;
|
|
90
|
+
if (assets.length === 0) {
|
|
91
|
+
throw new Error("This enterprise has no assets. You must create an asset to run this command.");
|
|
92
|
+
}
|
|
93
|
+
if (selected != undefined) {
|
|
94
|
+
// Drop the current value if its invalid
|
|
95
|
+
let found = assets.find(x => x.name === selected);
|
|
96
|
+
if (found == undefined) {
|
|
97
|
+
selected = undefined;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (selected == undefined) {
|
|
101
|
+
if (assets.length === 1) {
|
|
102
|
+
selected = assets[0].name; // Auto-select the one-and-only
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
// PROMPT FOR IT
|
|
106
|
+
let choices = assets.map(a => { return { name: a.name, value: a.name }; });
|
|
107
|
+
selected = (yield this._ui.promptSelect("asset", "Asset: ", choices)); // TODO: This needs to be a fuzzy-select
|
|
108
|
+
}
|
|
109
|
+
changed = Boolean(current != undefined);
|
|
110
|
+
}
|
|
111
|
+
return [selected, changed];
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
promptForTypeAndFile(enterprise, asset, configType, targetFile, existingConfigDefs) {
|
|
115
|
+
var _a, _b, _c;
|
|
116
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
let typeFileChanged = false; // true when original input is invalid
|
|
118
|
+
let partial = {
|
|
119
|
+
configType: configType,
|
|
120
|
+
targetFile: targetFile
|
|
121
|
+
};
|
|
122
|
+
let configDefs;
|
|
123
|
+
if (existingConfigDefs) {
|
|
124
|
+
// Use the given list
|
|
125
|
+
configDefs = existingConfigDefs;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
// Query the api for the list of existing configDefs for this asset
|
|
129
|
+
let crit = {
|
|
130
|
+
asset: asset,
|
|
131
|
+
enterprise: enterprise
|
|
132
|
+
};
|
|
133
|
+
let cfgResult = yield this._codiacApi.Call.getConfigDefs(crit, { projection: { pathsExcluded: [], pathsIncluded: ["type", "targetFile", "settings"] } });
|
|
134
|
+
if (cfgResult.error)
|
|
135
|
+
throw cfgResult.error;
|
|
136
|
+
configDefs = (_a = cfgResult.output) !== null && _a !== void 0 ? _a : [];
|
|
137
|
+
if (configDefs.length == 0)
|
|
138
|
+
throw new Error("This asset has no configs defined."); // REVISIT THIS THROW - Dont we just want to return empty results instead?
|
|
139
|
+
}
|
|
140
|
+
// Validate Type/File
|
|
141
|
+
if (partial.targetFile != undefined) {
|
|
142
|
+
const found = configDefs.find(x => x.targetFile == partial.targetFile);
|
|
143
|
+
if (found) {
|
|
144
|
+
partial.targetFile = found.targetFile;
|
|
145
|
+
partial.existingSettings = found.settings;
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
partial.targetFile = undefined;
|
|
149
|
+
typeFileChanged = true;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else if (partial.configType != undefined) {
|
|
153
|
+
const found = configDefs.find(x => { var _a; return (x.type != undefined) && (x.type.toString() == ((_a = partial.configType) === null || _a === void 0 ? void 0 : _a.toString())); });
|
|
154
|
+
if (found) {
|
|
155
|
+
partial.configType = SpecialConfigTypes[found.type];
|
|
156
|
+
partial.existingSettings = found.settings;
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
partial.configType = undefined;
|
|
160
|
+
typeFileChanged = true;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
if (partial.targetFile == undefined && partial.configType == undefined) {
|
|
164
|
+
let choices = configDefs.map(x => {
|
|
165
|
+
var _a, _b;
|
|
166
|
+
return {
|
|
167
|
+
name: (x.type == contracts_1.ConfigDefTypesEnum.file && x.targetFile != undefined) ? x.targetFile : x.type,
|
|
168
|
+
value: `${(_a = x.type) !== null && _a !== void 0 ? _a : ""}|${(_b = x.targetFile) !== null && _b !== void 0 ? _b : ""}`
|
|
169
|
+
};
|
|
170
|
+
});
|
|
171
|
+
let selected;
|
|
172
|
+
if (choices.length === 1) {
|
|
173
|
+
selected = choices[0].value; // Auto-select the one-and-only
|
|
174
|
+
if (typeFileChanged) {
|
|
175
|
+
// if we changed their value, then we need their confirmation
|
|
176
|
+
let keep = yield this._ui.promptConfirm("type-file-changed", `Only 1 config found; Continue? ${this._styler.hilite(choices[0].name)} `);
|
|
177
|
+
if (!keep)
|
|
178
|
+
throw new Error("You declined the only available config definition.");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
selected = (yield this._ui.promptSelect("cfgType", "Config: ", choices));
|
|
183
|
+
}
|
|
184
|
+
partial.configType = SpecialConfigTypes[selected.split("|")[0]];
|
|
185
|
+
if (_.isEmpty(partial.configType))
|
|
186
|
+
partial.configType = undefined;
|
|
187
|
+
partial.targetFile = selected.split("|")[1];
|
|
188
|
+
if (_.isEmpty(partial.targetFile))
|
|
189
|
+
partial.targetFile = undefined;
|
|
190
|
+
if (partial.configType)
|
|
191
|
+
partial.existingSettings = (_b = configDefs.find(x => { var _a; return x.type.toString() == ((_a = partial.configType) === null || _a === void 0 ? void 0 : _a.toString()); })) === null || _b === void 0 ? void 0 : _b.settings;
|
|
192
|
+
else if (partial.targetFile)
|
|
193
|
+
partial.existingSettings = (_c = configDefs.find(x => x.targetFile == partial.targetFile)) === null || _c === void 0 ? void 0 : _c.settings;
|
|
194
|
+
}
|
|
195
|
+
return [partial.configType, partial.targetFile, partial.existingSettings, typeFileChanged];
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
/** Prompts for a single setting name.
|
|
199
|
+
*
|
|
200
|
+
* TODO: Add ability to select branches of settings (globbed dot-paths)
|
|
201
|
+
* so user can delete entire sections at a time (eg: database-settings.*).
|
|
202
|
+
*
|
|
203
|
+
*
|
|
204
|
+
* Use this inquirer plugin for navigating the object structure:
|
|
205
|
+
* https://github.com/insightfuls/inquirer-tree-prompt
|
|
206
|
+
*
|
|
207
|
+
* See if this file tree selector could be fashioned to do the same:
|
|
208
|
+
* https://github.com/anc95/inquirer-file-tree-selection
|
|
209
|
+
*
|
|
210
|
+
* @param existing The list of existing settings to choose from.
|
|
211
|
+
* @param mode Set this to `write` only if you want the user to be able to add new settings. Indicates whether "Add New" (mode: `write`) or "All" (mode: `read`) options will be provided.
|
|
212
|
+
* @param given A prompt gets invoked in `read` mode only if none match any existing settings, and in `write` mode only if none are given at all.
|
|
213
|
+
*/
|
|
214
|
+
promptForOneSetting(existing, mode = "read", given) {
|
|
215
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
if (mode == "read") {
|
|
217
|
+
let [selectedMany, instances, changedGivens] = yield this.promptForManySettings(existing, given, false); // TODO: prevent multi
|
|
218
|
+
if (selectedMany.length == 0)
|
|
219
|
+
throw new Error("User canceled setting selection");
|
|
220
|
+
return [selectedMany[0], instances, changedGivens];
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
// mode == "write"
|
|
224
|
+
let selected;
|
|
225
|
+
if ((given != undefined) && !_.isEmpty(given)) {
|
|
226
|
+
selected = given; // NOTE: blindly accepting the given without a prompt. Because in write mode, misspellings arent our problem.
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
if (existing.length > 0) {
|
|
230
|
+
// let choices = existing.map(s => { return { name: s.setting, value: s.setting }; });
|
|
231
|
+
let choices = _.uniq(existing.map(s => s.setting));
|
|
232
|
+
choices.sort();
|
|
233
|
+
choices = _.uniq(choices);
|
|
234
|
+
choices.push(CodiacConstants.CliConstants.CHOICE_VALUE_FOR_NEW);
|
|
235
|
+
selected = (yield this._ui.promptSelect("settingSelect", "Setting: ", choices));
|
|
236
|
+
}
|
|
237
|
+
if (selected == undefined || selected === CodiacConstants.CliConstants.CHOICE_VALUE_FOR_NEW) {
|
|
238
|
+
selected = (yield this._ui.prompt("settingFreehand", "Setting (use '.' for hierarchy): "));
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
let instances = existing.filter(s => s.setting == selected);
|
|
242
|
+
let settingChanged = ConfigUiUtils_1.areDifferent(selected, given);
|
|
243
|
+
return [selected, instances, settingChanged];
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
/** Prompts for one or many setting names. Includes an `ALL` but NOT an `ADDNEW` option.
|
|
248
|
+
*
|
|
249
|
+
* TODO: Add ability to select branches of settings (globbed dot-paths)
|
|
250
|
+
* so user can delete entire sections at a time (eg: database-settings.*).
|
|
251
|
+
*
|
|
252
|
+
*
|
|
253
|
+
* Use this inquirer plugin for navigating the object structure:
|
|
254
|
+
* https://github.com/insightfuls/inquirer-tree-prompt
|
|
255
|
+
*
|
|
256
|
+
* See if this file tree selector could be fashioned to do the same:
|
|
257
|
+
* https://github.com/anc95/inquirer-file-tree-selection
|
|
258
|
+
*
|
|
259
|
+
* @param existing
|
|
260
|
+
* @param given A prompt gets invoked only if no givens match any existing settings.
|
|
261
|
+
*/
|
|
262
|
+
promptForManySettings(existing, given, multi = true) {
|
|
263
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
264
|
+
try {
|
|
265
|
+
let selected = ((given != undefined) && (typeof given == 'string')) ? [given] : given;
|
|
266
|
+
let settingChanged = false;
|
|
267
|
+
let instances;
|
|
268
|
+
if (existing.length == 0) {
|
|
269
|
+
throw new Error("No existing settings were found");
|
|
270
|
+
}
|
|
271
|
+
// TODO: Check for glob magic - globs should pass through
|
|
272
|
+
instances = (selected != undefined) ? ConfigUiUtils_1.matchMultipleWithGlobbing(existing, selected) : [];
|
|
273
|
+
if (instances.length > 0) {
|
|
274
|
+
// (at least one or more of) the given setting(s) are valid.
|
|
275
|
+
}
|
|
276
|
+
else {
|
|
277
|
+
if (given != undefined && !_.isEmpty(given)) {
|
|
278
|
+
this._ui.userMessage(`None of your requested settings were found.`);
|
|
279
|
+
}
|
|
280
|
+
// TODO: render a tree of settings choices
|
|
281
|
+
// so they can select either branches (glob) or leaf nodes (distinct)
|
|
282
|
+
// let choices = existing.map(s => { return { name: s.setting, value: s.setting }; });
|
|
283
|
+
let choices = existing.map(s => { return { name: s.setting, value: s.setting }; });
|
|
284
|
+
choices = _.orderBy(choices, x => x.name);
|
|
285
|
+
choices = _.uniqBy(choices, x => x.name);
|
|
286
|
+
choices.unshift({ name: CodiacConstants.CliConstants.CHOICE_VALUE_FOR_ALL, value: CodiacConstants.CliConstants.GLOB_FOR_ALL });
|
|
287
|
+
selected = [(yield this._ui.promptSelect("settingSelect", "Setting: ", choices))]; // stuffing it into an Array here!!!
|
|
288
|
+
instances = ConfigUiUtils_1.matchMultipleWithGlobbing(existing, selected);
|
|
289
|
+
}
|
|
290
|
+
settingChanged = ConfigUiUtils_1.areDifferent(selected, given);
|
|
291
|
+
// ----------------------------------------------------------------------------------------------
|
|
292
|
+
// // Try to implement un-selectable options...
|
|
293
|
+
// let settings = ["bill", "sam", "tom", "harry"];
|
|
294
|
+
// let choices: any[] = settings.map(s => { return { name: s, value: s }; });
|
|
295
|
+
// // choices.push({ name: "some branch", value: new inquirer.Separator("--I am a branch") });
|
|
296
|
+
// choices.push(new inquirer.Separator("--I am a branch"));
|
|
297
|
+
// choices.push({ name: "sally", value: "sally" });
|
|
298
|
+
// choices.push({ name: "Sue", value: "Sue" });
|
|
299
|
+
// choices.push({ name: "Suzy", value: "Suzy" });
|
|
300
|
+
// let nada = await this._ui.promptSelect("test", "try this", choices);
|
|
301
|
+
// ----------------------------------------------------------------------------------------------
|
|
302
|
+
return [selected, instances, settingChanged];
|
|
303
|
+
}
|
|
304
|
+
catch (err) {
|
|
305
|
+
throw err;
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
/** Searches out availables that match ANY of the given specs.
|
|
310
|
+
* @param availables: setting objects to search for.
|
|
311
|
+
* @param matchSpecs: each can be either a distinct setting name (eg `shoe-size`) or a glob (eg `api-settings.*`).
|
|
312
|
+
*/
|
|
313
|
+
static matchMultipleWithGlobbing(availables, matchSpecs) {
|
|
314
|
+
let patterns = matchSpecs.filter(x => (new minimatch_1.Minimatch(x, {})).hasMagic());
|
|
315
|
+
let names = _.difference(matchSpecs, patterns);
|
|
316
|
+
let globs = patterns.map(g => new minimatch_1.Minimatch(g));
|
|
317
|
+
let instances = [];
|
|
318
|
+
if (names) {
|
|
319
|
+
instances = instances.concat(availables.filter(s => names.includes(s.setting)));
|
|
320
|
+
}
|
|
321
|
+
if (globs) {
|
|
322
|
+
for (let glob of globs) {
|
|
323
|
+
instances = instances.concat(availables.filter(s => glob.match(s.setting)));
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
return instances;
|
|
327
|
+
}
|
|
328
|
+
/** Determines if the two collections have ANY different concrete values,
|
|
329
|
+
* regardless of order or string/array/undefined/empty)
|
|
330
|
+
*
|
|
331
|
+
* ```
|
|
332
|
+
* DIFFERENT IF:
|
|
333
|
+
* any of A not in B
|
|
334
|
+
* AND
|
|
335
|
+
* any of B not in A
|
|
336
|
+
* ```
|
|
337
|
+
* */
|
|
338
|
+
static areDifferent(thingA, thingB) {
|
|
339
|
+
if (thingA == undefined || _.isEmpty(thingA)) {
|
|
340
|
+
return !Boolean(thingB == undefined || _.isEmpty(thingB));
|
|
341
|
+
}
|
|
342
|
+
else if (thingB == undefined || _.isEmpty(thingB)) {
|
|
343
|
+
return true; // because A is not empty
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
let areDiff = (Boolean(_.difference((typeof thingA == 'string') ? [thingA] : thingA, thingB).length > 0)
|
|
347
|
+
|| Boolean(_.difference((typeof thingB == 'string') ? [thingB] : thingB, thingA).length > 0));
|
|
348
|
+
return areDiff;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
validateAndPromptForScope(rootMap, enterprise, scope, target, existings, allowEverywhere = true) {
|
|
352
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
353
|
+
let targetChanged = false;
|
|
354
|
+
let partial = {
|
|
355
|
+
scope: scope,
|
|
356
|
+
target: target
|
|
357
|
+
};
|
|
358
|
+
if (partial.scope != undefined || partial.target != undefined) {
|
|
359
|
+
// Validate
|
|
360
|
+
partial.scope = (partial.scope == undefined) ? undefined : contracts_1.ScopeLevel[partial.scope];
|
|
361
|
+
if (partial.scope == undefined)
|
|
362
|
+
partial.target = undefined; // NOTE: Instead of dropping the target, you could deduce the scope by searching around the map for a single target with this name...
|
|
363
|
+
if (partial.scope != undefined && partial.target != undefined) {
|
|
364
|
+
let found = findScopeTarget(rootMap, partial.scope, partial.target);
|
|
365
|
+
partial.target = found === null || found === void 0 ? void 0 : found.name;
|
|
366
|
+
targetChanged = Boolean(partial.target == undefined);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
if (partial.scope == undefined || partial.target == undefined) {
|
|
370
|
+
let scope = yield this.promptForScope(enterprise, rootMap, existings, allowEverywhere, undefined);
|
|
371
|
+
if (scope) {
|
|
372
|
+
partial.scope = scope.scope;
|
|
373
|
+
partial.target = scope.target;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return [partial.scope, partial.target, targetChanged];
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
promptForScope(enterprise, rootMap, existings, allowEverywhere = true, prompt) {
|
|
380
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
381
|
+
try {
|
|
382
|
+
let output;
|
|
383
|
+
// render cab tree with all lines selectable
|
|
384
|
+
let cabTree = this.buildCabinetTree(rootMap, existings);
|
|
385
|
+
let choices = this.buildSelectChoicesFrom(cabTree);
|
|
386
|
+
if (allowEverywhere)
|
|
387
|
+
choices.unshift({ name: "** Everywhere **", value: CodiacConstants.CliConstants.GLOB_FOR_ALL });
|
|
388
|
+
let delimited = (yield this._ui.promptSelect("scope", prompt !== null && prompt !== void 0 ? prompt : "Scope: ", choices, undefined, false));
|
|
389
|
+
if (delimited == CodiacConstants.CliConstants.GLOB_FOR_ALL) {
|
|
390
|
+
output = undefined;
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
let parts = delimited.split("|");
|
|
394
|
+
output = { scope: parts[0], target: parts[1] };
|
|
395
|
+
}
|
|
396
|
+
return output;
|
|
397
|
+
}
|
|
398
|
+
catch (err) {
|
|
399
|
+
throw (err);
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
/** sets each value to "scope|target".
|
|
404
|
+
* */
|
|
405
|
+
buildCabinetTree(rootMap, existings) {
|
|
406
|
+
var _a, _b, _c, _d;
|
|
407
|
+
let tree = [];
|
|
408
|
+
// If there's more than a single setting name in the list, then we're gonna show counts>0 at each scope, otherwise we'll show ellipsised values.
|
|
409
|
+
let showCounts = false;
|
|
410
|
+
if (existings != undefined && _.uniq(existings.map(x => x.setting).sort()).length > 1) {
|
|
411
|
+
showCounts = true;
|
|
412
|
+
}
|
|
413
|
+
for (let ent of rootMap.enterprises) {
|
|
414
|
+
let entBranch = { text: `${ent.name} enterprise:`, value: `${contracts_1.ScopeLevel.enterprise}|${ent.name}` };
|
|
415
|
+
let entSettings = existings === null || existings === void 0 ? void 0 : existings.filter(s => s.scope === contracts_1.ScopeLevel.enterprise && s.target === ent.name);
|
|
416
|
+
if (entSettings !== undefined && entSettings.length > 0) {
|
|
417
|
+
let valueSuffix = showCounts ? `${entSettings.length} found` : (this.ellipsis(35, (_a = entSettings[0].value) !== null && _a !== void 0 ? _a : "[set to undefined]"));
|
|
418
|
+
valueSuffix = `(${valueSuffix})`;
|
|
419
|
+
entBranch.text = entBranch.text.concat(" ", this._styler.dim(valueSuffix));
|
|
420
|
+
}
|
|
421
|
+
for (let env of _.sortBy(ent.environments, e => e.sequence, e => e.name)) {
|
|
422
|
+
let envBranch = { text: `${env.name}`, value: `${contracts_1.ScopeLevel.environment}|${env.name}` };
|
|
423
|
+
let envSettings = existings === null || existings === void 0 ? void 0 : existings.filter(s => s.scope === contracts_1.ScopeLevel.environment && s.target === env.name);
|
|
424
|
+
if (envSettings !== undefined && envSettings.length > 0) {
|
|
425
|
+
let valueSuffix = showCounts ? `${envSettings.length} found` : (this.ellipsis(35, (_b = envSettings[0].value) !== null && _b !== void 0 ? _b : "[set to undefined]"));
|
|
426
|
+
valueSuffix = `(${valueSuffix})`;
|
|
427
|
+
envBranch.text = envBranch.text.concat(" ", this._styler.dim(valueSuffix));
|
|
428
|
+
}
|
|
429
|
+
for (let cab of env.cabinets) {
|
|
430
|
+
// let cwg = rootMap.clusters.find(c => c.name === cab.cluster);
|
|
431
|
+
// let clusterDesc = cwg ? ` (${cab.cluster}, ${cwg.provider} ${cwg.locationName})` : "";
|
|
432
|
+
let cabBranch = {
|
|
433
|
+
text: `${cab.name}`,
|
|
434
|
+
value: `${contracts_1.ScopeLevel.cabinet}|${cab.name}`
|
|
435
|
+
};
|
|
436
|
+
let cabSettings = existings === null || existings === void 0 ? void 0 : existings.filter(s => s.scope === contracts_1.ScopeLevel.cabinet && s.target === cab.name);
|
|
437
|
+
if (cabSettings !== undefined && cabSettings.length > 0) {
|
|
438
|
+
let valueSuffix = showCounts ? `${cabSettings.length} found` : this.ellipsis(35, (_c = cabSettings[0].value) !== null && _c !== void 0 ? _c : "[set to undefined]");
|
|
439
|
+
valueSuffix = `(${valueSuffix})`;
|
|
440
|
+
cabBranch.text = cabBranch.text.concat(" ", this._styler.dim(valueSuffix));
|
|
441
|
+
}
|
|
442
|
+
if (envBranch.children === undefined)
|
|
443
|
+
envBranch.children = [];
|
|
444
|
+
(_d = envBranch.children) === null || _d === void 0 ? void 0 : _d.push(cabBranch);
|
|
445
|
+
}
|
|
446
|
+
if (entBranch.children === undefined)
|
|
447
|
+
entBranch.children = [];
|
|
448
|
+
entBranch.children.push(envBranch);
|
|
449
|
+
}
|
|
450
|
+
tree.push(entBranch);
|
|
451
|
+
}
|
|
452
|
+
return tree;
|
|
453
|
+
}
|
|
454
|
+
/** Truncates the string to the given length with an ellipses as suffix */
|
|
455
|
+
ellipsis(maxLength, value) {
|
|
456
|
+
let output = value;
|
|
457
|
+
if (output.length > maxLength) {
|
|
458
|
+
let ellipsis = "..."; // Rather use the ellipsis character but String.fromCharCode(133) is returning a problematic character.
|
|
459
|
+
output = output.slice(0, maxLength - 1 - ellipsis.length).concat(ellipsis);
|
|
460
|
+
}
|
|
461
|
+
return output;
|
|
462
|
+
}
|
|
463
|
+
buildSelectChoicesFrom(tree) {
|
|
464
|
+
try {
|
|
465
|
+
let choices = [];
|
|
466
|
+
// the value is no good here - need scope and target both available
|
|
467
|
+
render.renderStringTree(tree, (txt, item) => choices.push({ name: txt, value: item.value }));
|
|
468
|
+
// // This is one way to do it
|
|
469
|
+
// for (let item of tree) {
|
|
470
|
+
//
|
|
471
|
+
// let thisChoice: PromptChoice = { name: item.text, value: item.text };
|
|
472
|
+
// choices.push(thisChoice);
|
|
473
|
+
//
|
|
474
|
+
// if (item.children && item.children.length > 0) {
|
|
475
|
+
// let children = this.buildSelectChoicesFrom(item.children);
|
|
476
|
+
// choices.push(...children);
|
|
477
|
+
// }
|
|
478
|
+
// }
|
|
479
|
+
return choices;
|
|
480
|
+
}
|
|
481
|
+
catch (err) {
|
|
482
|
+
throw err;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
/** Determines the format of the string that was piped in,
|
|
486
|
+
* and parses it into an object in memory.
|
|
487
|
+
*
|
|
488
|
+
* Supports formats: json, yaml
|
|
489
|
+
*/
|
|
490
|
+
parseInputString(input) {
|
|
491
|
+
var _a, _b;
|
|
492
|
+
let output;
|
|
493
|
+
try {
|
|
494
|
+
// Determine format
|
|
495
|
+
let format; // | "csv" | "tsv";
|
|
496
|
+
// if (input.startsWith("setting,value\n")) {
|
|
497
|
+
// format = "csv";
|
|
498
|
+
// } else if (input.startsWith("setting\tvalue\n")) {
|
|
499
|
+
// format = "tsv";
|
|
500
|
+
/* } else */ if (input.startsWith("{") || input.startsWith("[")) {
|
|
501
|
+
format = "json";
|
|
502
|
+
// } else if (input.startsWith("- setting\n")) {
|
|
503
|
+
// format = "yaml";
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
// throw new Error("Invalid stdin data; data format not recognized.");
|
|
507
|
+
format = "yaml";
|
|
508
|
+
}
|
|
509
|
+
// Parse
|
|
510
|
+
switch (format) {
|
|
511
|
+
case "json":
|
|
512
|
+
let jsonDoc = JSON.parse(input);
|
|
513
|
+
output = codiac_common_1.ObjectFlattener.flatten(jsonDoc).map(x => { return { setting: x.key, value: x.value }; });
|
|
514
|
+
break;
|
|
515
|
+
case "yaml":
|
|
516
|
+
let yamlDoc = YAML.parse(input);
|
|
517
|
+
output = codiac_common_1.ObjectFlattener.flatten(yamlDoc).map(x => { return { setting: x.key, value: x.value }; });
|
|
518
|
+
break;
|
|
519
|
+
// case "csv":
|
|
520
|
+
// output = this.parseTable(input, ",");
|
|
521
|
+
// break;
|
|
522
|
+
// case "tsv":
|
|
523
|
+
// output = this.parseTable(input, "\t");
|
|
524
|
+
// break;
|
|
525
|
+
}
|
|
526
|
+
return output;
|
|
527
|
+
}
|
|
528
|
+
catch (err) {
|
|
529
|
+
throw new Error(`Error parsing stdin: ${(_a = err.name) !== null && _a !== void 0 ? _a : ""} ${(_b = err.message) !== null && _b !== void 0 ? _b : ""}`);
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
};
|
|
533
|
+
ConfigUiUtils = ConfigUiUtils_1 = tslib_1.__decorate([
|
|
534
|
+
(0, inversify_1.injectable)(),
|
|
535
|
+
tslib_1.__param(0, (0, inversify_1.inject)(codiac_ops_common_1.INTERFACES_OPS.IUserInputProvider)),
|
|
536
|
+
tslib_1.__param(1, (0, inversify_1.inject)(codiac_ops_common_1.INTERFACES_OPS.IOutputStyler)),
|
|
537
|
+
tslib_1.__param(2, (0, inversify_1.inject)(codiac_api_1.CodiacClient)),
|
|
538
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object, codiac_api_1.CodiacClient])
|
|
539
|
+
], ConfigUiUtils);
|
|
540
|
+
exports.ConfigUiUtils = ConfigUiUtils;
|
|
541
|
+
/** Finds the object in the rootmap (ent, env, or cab) specified by the given scope.
|
|
542
|
+
*
|
|
543
|
+
* Returns undefined if the scope/target combination does not exist.
|
|
544
|
+
*/
|
|
545
|
+
function findScopeTarget(rootMap, scope, target) {
|
|
546
|
+
switch (scope) {
|
|
547
|
+
case contracts_1.ScopeLevel.enterprise:
|
|
548
|
+
return rootMap.enterprises.find(e => e.name == target);
|
|
549
|
+
case contracts_1.ScopeLevel.environment:
|
|
550
|
+
let env;
|
|
551
|
+
for (let ent of rootMap.enterprises) {
|
|
552
|
+
env = ent.environments.find(v => v.name == target);
|
|
553
|
+
if (env)
|
|
554
|
+
break;
|
|
555
|
+
}
|
|
556
|
+
return env;
|
|
557
|
+
case contracts_1.ScopeLevel.cabinet:
|
|
558
|
+
let cab;
|
|
559
|
+
for (let ent of rootMap.enterprises) {
|
|
560
|
+
for (let env of ent.environments) {
|
|
561
|
+
cab = env.cabinets.find(v => v.name == target);
|
|
562
|
+
if (cab)
|
|
563
|
+
break;
|
|
564
|
+
}
|
|
565
|
+
if (cab)
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
568
|
+
return cab;
|
|
569
|
+
default:
|
|
570
|
+
return undefined;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
exports.findScopeTarget = findScopeTarget;
|
|
574
|
+
//# sourceMappingURL=config-ui-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-ui-utils.js","sourceRoot":"","sources":["../../src/uilogic/config-ui-utils.ts"],"names":[],"mappings":";;;;;AAAA,yCAA+C;AAC/C,4BAA6B;AAC7B,6BAA6B;AAC7B,yCAAsC;AACtC,4DAA2D;AAE3D,oEAAiG;AACjG,mDAAkD;AAClD,4DAAyL;AACzL,uDAAuD;AAEvD,2CAA2C;AAO3C,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,iCAAa,CAAA;IACb,6CAAyB,CAAA;IACzB,mCAAe,CAAA;AACjB,CAAC,EAJW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAI7B;AAGD,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,iCAAe,CAAA;IACf,yCAAuB,CA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C,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,MAAM,CAAC,CAAC;oBAC/C,IAAI,GAAG;wBAAE,MAAM;iBAChB;gBACD,IAAI,GAAG;oBAAE,MAAM;aAChB;YACD,OAAO,GAAG,CAAC;QACb;YACE,OAAO,SAAS,CAAC;KACpB;AACH,CAAC;AAzBD,0CAyBC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IBetterLogger } from '@codiac.io/codiac-common/IBetterLogger';
|
|
2
2
|
import { CodiacClient } from '../apis/codiac-api';
|
|
3
3
|
import { RelayClient as GenRelayClient } from '../apis/codiac-relay';
|
|
4
|
-
import { Enterprise, Cabinet } from '../apis/codiac-api/contracts';
|
|
4
|
+
import { Enterprise, Cabinet, ConfigDef } from '../apis/codiac-api/contracts';
|
|
5
5
|
import { ProjectUserConfig, CabinetScope, ProjectConfig, UserContext } from '@codiac.io/codiac-relay-contracts';
|
|
6
6
|
import { LocalOps, ProjectContextRepo } from '../ops';
|
|
7
7
|
import { IOutputStyler, IUserInputProvider } from '@codiac.io/codiac-ops-common';
|
|
@@ -35,8 +35,11 @@ export declare class EnterpriseContextualizer {
|
|
|
35
35
|
* or keeps original with orignal asset context if user selects it. */
|
|
36
36
|
establishEnterprise(requestedEnterpriseCode?: string): Promise<Enterprise>;
|
|
37
37
|
establishEnterpriseAsset(enterprise: Enterprise, suppressConfirmations?: boolean): Promise<string>;
|
|
38
|
-
/** This method WAS a copy from config:add
|
|
39
|
-
|
|
38
|
+
/** This method WAS a copy from config:add
|
|
39
|
+
*
|
|
40
|
+
* @param configFileDefs Cached list of existing config file definitions for the given asset. Use this to absolve this method from making an api call.
|
|
41
|
+
*/
|
|
42
|
+
promptForTargetFile(enterprise: string, asset: string, given?: string, configFileDefs?: ConfigDef[]): Promise<string>;
|
|
40
43
|
/** Throws when the image os does not match that of the image in the remote enterprise asset record.
|
|
41
44
|
*
|
|
42
45
|
* Throws any errors. */
|