@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,297 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const YAML = require("yaml");
|
|
6
|
+
const _ = require("lodash");
|
|
7
|
+
const contracts_1 = require("@codiac.io/codiac-common/contracts");
|
|
8
|
+
const codiac_common_1 = require("@codiac.io/codiac-common");
|
|
9
|
+
const contracts_2 = require("../../../apis/codiac-api/contracts");
|
|
10
|
+
const command_base_enterprise_1 = require("../../../command-base-enterprise");
|
|
11
|
+
const render = require("../../../uilogic/render-methods");
|
|
12
|
+
const render_methods_1 = require("../../../uilogic/render-methods");
|
|
13
|
+
const config_ui_utils_1 = require("../../../uilogic/config-ui-utils");
|
|
14
|
+
class ConfigSettingsGet extends command_base_enterprise_1.CommandBaseEnterprise {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
// protected takeDefaults: boolean = false;
|
|
18
|
+
/** CLI Command-line string to rerun this execution as a non-TTY script. */
|
|
19
|
+
this.cmd = ["cod", "config", "settings", "get", "--silent"];
|
|
20
|
+
}
|
|
21
|
+
// --------------------------------------------------------------------
|
|
22
|
+
// Lazy-loaded properties
|
|
23
|
+
get configUtils() {
|
|
24
|
+
if (this._configUtils_backer === undefined) {
|
|
25
|
+
this._configUtils_backer = this.ioc.get(config_ui_utils_1.ConfigUiUtils);
|
|
26
|
+
}
|
|
27
|
+
return this._configUtils_backer;
|
|
28
|
+
}
|
|
29
|
+
// --------------------------------------------------------------------
|
|
30
|
+
bootstrap() {
|
|
31
|
+
super.bootstrap();
|
|
32
|
+
this.ioc.bind(config_ui_utils_1.ConfigUiUtils).toSelf();
|
|
33
|
+
}
|
|
34
|
+
run() {
|
|
35
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
this.bootstrap();
|
|
37
|
+
yield this.readStdin();
|
|
38
|
+
try {
|
|
39
|
+
// 0. SET DEFAULTS
|
|
40
|
+
this._userCntx = yield this.establishTenantContext(this._userCntx);
|
|
41
|
+
let currentEnterprise = (yield this.establishEnterpriseContext()).enterprise; // We only need this bc the RootMap requires it.
|
|
42
|
+
// 1. CAPTURE ARGS
|
|
43
|
+
let [partial, interactionMode, outputFormat] = yield this.captureArgs(currentEnterprise);
|
|
44
|
+
// 2. VALIDATE AND ACQUIRE INPUT
|
|
45
|
+
let rootMap = yield this.getRootMap(partial.enterprise);
|
|
46
|
+
let candidate;
|
|
47
|
+
if (interactionMode == config_ui_utils_1.InteractionModes.silent) {
|
|
48
|
+
candidate = this.buildCandidate_silently(partial, rootMap);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
candidate = yield this.buildCandidate_interactively(partial, rootMap);
|
|
52
|
+
}
|
|
53
|
+
// In case we're hanging waiting for piped-in data that doesnt exist...
|
|
54
|
+
if (!process.stdin.destroyed)
|
|
55
|
+
process.stdin.destroy();
|
|
56
|
+
if (candidate == undefined) {
|
|
57
|
+
this.logger.notice(`Operation cancelled. No work was done.`);
|
|
58
|
+
this._ui.userMessage(`Operation cancelled. No work was done.`);
|
|
59
|
+
this.exit(0);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// 3. RENDER COMMAND STRING
|
|
63
|
+
if (interactionMode != undefined && [config_ui_utils_1.InteractionModes.echo, config_ui_utils_1.InteractionModes.toscript].includes(interactionMode)) {
|
|
64
|
+
this.cmd = this.buildCommandString(candidate, outputFormat, this.cmd);
|
|
65
|
+
this._ui.userMessage(this.cmd.join(" "));
|
|
66
|
+
}
|
|
67
|
+
if (interactionMode != config_ui_utils_1.InteractionModes.toscript) {
|
|
68
|
+
// 4. EXECUTE THE MAIN TASK
|
|
69
|
+
yield this.executeTask(candidate, outputFormat);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
// throw err;
|
|
76
|
+
this.handleError(err);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
captureArgs(currentEnterprise) {
|
|
81
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
82
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const { args, flags } = yield this.parse(ConfigSettingsGet);
|
|
84
|
+
let partial = {};
|
|
85
|
+
partial.enterprise = (_a = flags.enterprise) !== null && _a !== void 0 ? _a : currentEnterprise.code;
|
|
86
|
+
partial.asset = flags.asset;
|
|
87
|
+
if (flags.type) {
|
|
88
|
+
partial.configType = Object.values(config_ui_utils_1.SpecialConfigTypes).find(x => x.toString() == flags.type);
|
|
89
|
+
if (partial.configType == undefined)
|
|
90
|
+
delete partial.configType;
|
|
91
|
+
}
|
|
92
|
+
else if (flags.file) {
|
|
93
|
+
partial.targetFile = flags.file;
|
|
94
|
+
}
|
|
95
|
+
partial.scope =
|
|
96
|
+
(_c = (_b = (flags['enterprise-scope'] ? contracts_2.ScopeLevel.enterprise : undefined)) !== null && _b !== void 0 ? _b : (flags.enviro ? contracts_2.ScopeLevel.environment : undefined)) !== null && _c !== void 0 ? _c : (flags.cabinet ? contracts_2.ScopeLevel.cabinet : undefined);
|
|
97
|
+
partial.target =
|
|
98
|
+
(_e = (_d = (flags['enterprise-scope'] ? partial.enterprise : undefined)) !== null && _d !== void 0 ? _d : flags.enviro) !== null && _e !== void 0 ? _e : flags.cabinet;
|
|
99
|
+
if (flags.setting)
|
|
100
|
+
partial.setting = flags.setting;
|
|
101
|
+
if (flags.value)
|
|
102
|
+
partial.value = flags.value;
|
|
103
|
+
const interactionMode = (_g = (_f = (flags.echo ? config_ui_utils_1.InteractionModes.echo : undefined)) !== null && _f !== void 0 ? _f : (flags["to-script"] ? config_ui_utils_1.InteractionModes.toscript : undefined)) !== null && _g !== void 0 ? _g : (flags.silent ? config_ui_utils_1.InteractionModes.silent : undefined);
|
|
104
|
+
// this.takeDefaults = flags["--take-defaults"] ?? false;
|
|
105
|
+
let outputFormat = (flags.output) ? render_methods_1.OutputFormatsEnum[flags.output] : render_methods_1.OutputFormatsEnum.json;
|
|
106
|
+
return [partial, interactionMode, outputFormat];
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
buildCandidate_silently(partial, rootMap) {
|
|
110
|
+
let output;
|
|
111
|
+
try {
|
|
112
|
+
if (partial.enterprise == undefined)
|
|
113
|
+
throw new Error("Must specify the enterprise of the asset.");
|
|
114
|
+
let ent = rootMap.enterprises.find(x => x.name === partial.enterprise);
|
|
115
|
+
if (ent == undefined)
|
|
116
|
+
throw new Error(`No enterprise was found with that name.`);
|
|
117
|
+
if (partial.asset == undefined)
|
|
118
|
+
throw new Error("Must specify the asset.");
|
|
119
|
+
let asset = ent.assets.find(x => x.name === partial.asset);
|
|
120
|
+
if (asset === undefined)
|
|
121
|
+
throw new Error(`No asset was found with that name.`);
|
|
122
|
+
if (partial.targetFile == undefined && partial.configType == undefined)
|
|
123
|
+
throw new Error("Must specify the file or type.");
|
|
124
|
+
// output = {
|
|
125
|
+
// enterprise: partial.enterprise,
|
|
126
|
+
// asset: partial.asset,
|
|
127
|
+
// targetFile: partial.targetFile,
|
|
128
|
+
// scope: partial.scope,
|
|
129
|
+
// target: partial.target
|
|
130
|
+
// };
|
|
131
|
+
output = partial;
|
|
132
|
+
return output;
|
|
133
|
+
}
|
|
134
|
+
catch (err) {
|
|
135
|
+
throw err;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
buildCandidate_interactively(partial, rootMap) {
|
|
139
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
let output;
|
|
141
|
+
try {
|
|
142
|
+
// Enterprise
|
|
143
|
+
let ent = yield this.configUtils.promptForEnterprise(partial, rootMap);
|
|
144
|
+
partial.enterprise = ent.name; // This is just for TS context (the method above already set this).
|
|
145
|
+
// Asset
|
|
146
|
+
let assetChanged;
|
|
147
|
+
[partial.asset, assetChanged] = yield this.configUtils.promptForAsset(ent.assets, partial.asset);
|
|
148
|
+
// Type/File
|
|
149
|
+
// TODO: Can we include the configDefs in the RootMap?
|
|
150
|
+
let typeFileChanged;
|
|
151
|
+
let existingSettings;
|
|
152
|
+
[partial.configType, partial.targetFile, existingSettings, typeFileChanged] = yield this.configUtils.promptForTypeAndFile(partial.enterprise, partial.asset, partial.configType, partial.targetFile);
|
|
153
|
+
// Scope
|
|
154
|
+
let targetChanged = false;
|
|
155
|
+
[partial.scope, partial.target, targetChanged] = yield this.configUtils.validateAndPromptForScope(rootMap, partial.enterprise, partial.scope, partial.target, existingSettings, false);
|
|
156
|
+
// Setting names?
|
|
157
|
+
// Setting values?
|
|
158
|
+
// value vs Secret/Ref?
|
|
159
|
+
output = partial;
|
|
160
|
+
return output;
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
throw err;
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
buildCommandString(ultimate, outputFormat, cmd) {
|
|
168
|
+
cmd.push("-o", outputFormat);
|
|
169
|
+
cmd.push("--enterprise", ultimate.enterprise);
|
|
170
|
+
cmd.push("-a", ultimate.asset);
|
|
171
|
+
if (ultimate.configType) {
|
|
172
|
+
cmd.push("-t", ultimate.configType);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
cmd.push("-f", ultimate.targetFile); // assertion is ok bc we forced one or the other just above ^.
|
|
176
|
+
}
|
|
177
|
+
if (ultimate.scope) {
|
|
178
|
+
if (ultimate.scope == contracts_2.ScopeLevel.enterprise) {
|
|
179
|
+
cmd.push("--enterprise-scope");
|
|
180
|
+
}
|
|
181
|
+
else if (ultimate.target) {
|
|
182
|
+
if (ultimate.scope == contracts_2.ScopeLevel.environment)
|
|
183
|
+
cmd.push("-e", ultimate.target);
|
|
184
|
+
if (ultimate.scope == contracts_2.ScopeLevel.cabinet)
|
|
185
|
+
cmd.push("-c", ultimate.target);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (ultimate.setting)
|
|
189
|
+
cmd.push("--setting", ultimate.setting);
|
|
190
|
+
if (ultimate.value)
|
|
191
|
+
cmd.push("--value", ultimate.value);
|
|
192
|
+
return cmd;
|
|
193
|
+
}
|
|
194
|
+
executeTask(candidate, outputFormat) {
|
|
195
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
196
|
+
// 4. RETRIEVE
|
|
197
|
+
let settings = yield this.fetch(candidate, outputFormat);
|
|
198
|
+
// 5. RENDER
|
|
199
|
+
this.render(settings, outputFormat);
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
fetch(candidate, outputFormat) {
|
|
203
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
204
|
+
try {
|
|
205
|
+
if ([render_methods_1.OutputFormatsEnum.json, render_methods_1.OutputFormatsEnum.yaml].includes(outputFormat) === false)
|
|
206
|
+
this._ui.startSpinner("Retrieving");
|
|
207
|
+
let crit = {};
|
|
208
|
+
crit.enterprise = new contracts_1.StringFilter();
|
|
209
|
+
crit.enterprise.$eq = candidate.enterprise;
|
|
210
|
+
crit.asset = new contracts_1.StringFilter();
|
|
211
|
+
crit.asset.$eq = candidate.asset;
|
|
212
|
+
crit.targetFile = new contracts_1.StringFilter();
|
|
213
|
+
crit.targetFile.$eq = candidate.targetFile;
|
|
214
|
+
if (candidate.scope && !_.isEmpty(candidate.scope))
|
|
215
|
+
crit.scope = candidate.scope;
|
|
216
|
+
if (candidate.target && !_.isEmpty(candidate.target))
|
|
217
|
+
crit.target = candidate.target;
|
|
218
|
+
if ((candidate.setting != undefined) && (!_.isEmpty(candidate.setting))) {
|
|
219
|
+
crit.setting = candidate.setting;
|
|
220
|
+
}
|
|
221
|
+
// if ((candidate.value != undefined) && (!_.isEmpty(candidate.value))) {
|
|
222
|
+
// crit.value = candidate.value;
|
|
223
|
+
// }
|
|
224
|
+
// crit.sort = ["enterprise", "asset", "targetFile", "setting", "scope"];
|
|
225
|
+
let prjxn = { pathsIncluded: ["setting", "value", "source"], pathsExcluded: [] };
|
|
226
|
+
let settings = yield this._codiacApi.ScopedSetting.readMany(crit, { throwNotFound: false, projection: prjxn });
|
|
227
|
+
settings = _.sortBy(settings, x => x.enterprise, x => x.asset, x => x.targetFile, x => x.setting); // TODO: sort in the crit
|
|
228
|
+
// TODO: COnsider moving this into the api?
|
|
229
|
+
settings.forEach(s => {
|
|
230
|
+
delete s.id;
|
|
231
|
+
if (s.source != undefined && !_.isEmpty(s.source)) {
|
|
232
|
+
s.value = `#REF|${s.source.type}|${s.source.name}|${s.source.key}`;
|
|
233
|
+
delete s.source;
|
|
234
|
+
}
|
|
235
|
+
else if (_.isEmpty(s.source))
|
|
236
|
+
delete s.source;
|
|
237
|
+
});
|
|
238
|
+
if ([render_methods_1.OutputFormatsEnum.json, render_methods_1.OutputFormatsEnum.yaml].includes(outputFormat) === false)
|
|
239
|
+
this._ui.stopSpinner(`found ${settings.length}`);
|
|
240
|
+
return settings;
|
|
241
|
+
}
|
|
242
|
+
catch (err) {
|
|
243
|
+
throw err;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
/** Renders the given settings as a hierarchical config doc (NOT a list of key-value pairs) */
|
|
248
|
+
render(settings, outputFormat) {
|
|
249
|
+
let output = "";
|
|
250
|
+
// Unflatten into a config doc
|
|
251
|
+
let doc = {};
|
|
252
|
+
for (let setting of settings) {
|
|
253
|
+
doc[setting.setting] = setting.value;
|
|
254
|
+
}
|
|
255
|
+
doc = codiac_common_1.ObjectFlattener.unflatten(doc);
|
|
256
|
+
switch (outputFormat) {
|
|
257
|
+
case render_methods_1.OutputFormatsEnum.yaml:
|
|
258
|
+
output = YAML.stringify(doc, { indent: 2 });
|
|
259
|
+
break;
|
|
260
|
+
case render_methods_1.OutputFormatsEnum.json:
|
|
261
|
+
output = JSON.stringify(doc, undefined, 2);
|
|
262
|
+
break;
|
|
263
|
+
case render_methods_1.OutputFormatsEnum.text:
|
|
264
|
+
let list = settings.map(s => `${this._styler.dim(s.setting)}: ${s.value}`);
|
|
265
|
+
output = render.renderStringList(list);
|
|
266
|
+
break;
|
|
267
|
+
case render_methods_1.OutputFormatsEnum.tree:
|
|
268
|
+
default:
|
|
269
|
+
let tree = this.configUtils.buildConfigTree(settings);
|
|
270
|
+
output = render.renderStringTree(tree);
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
this._ui.userMessage(output);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
exports.default = ConfigSettingsGet;
|
|
277
|
+
ConfigSettingsGet.description = 'Shows the list of clusters.';
|
|
278
|
+
ConfigSettingsGet.aliases = ["cluster:list"];
|
|
279
|
+
ConfigSettingsGet.flags = {
|
|
280
|
+
enterprise: core_1.Flags.string({ char: 'n', description: '(required only when more than one enterprise exists) The name of the enterprise containing the asset.' }),
|
|
281
|
+
asset: core_1.Flags.string({ char: 'a', description: 'The name of the asset to which the settings belong.' }),
|
|
282
|
+
file: core_1.Flags.string({ char: 'f', exclusive: ["type"], description: 'The path-name to the file to which the settings belong, relative to the root of the container image.' }),
|
|
283
|
+
type: core_1.Flags.string({ char: 't', exclusive: ["file"], options: Object.keys(config_ui_utils_1.SpecialConfigTypes), description: 'Filters for the settings types that do not land in a config file (such as... env: OS environment variables, footprint: container footprint specs, and helm: helm chart settings).' }),
|
|
284
|
+
"enterprise-scope": core_1.Flags.boolean({ char: 's', exclusive: ["enviro", "cabinet"], description: 'Filters for settings scoped at the enterprise level.' }),
|
|
285
|
+
enviro: core_1.Flags.string({ char: 'e', exclusive: ["enterprise-scope", "cabinet"], description: 'Filters for settings scoped to the given environment name.' }),
|
|
286
|
+
cabinet: core_1.Flags.string({ char: 'c', exclusive: ["enterprise-scope", "enviro"], description: 'Filters for settings scoped to the given cabinet name.' }),
|
|
287
|
+
setting: core_1.Flags.string({ description: 'Glob for settings names. Filters for individual settings with matching names.' }),
|
|
288
|
+
value: core_1.Flags.string({ description: 'Glob for settings values. Filters for individual settings with matching values.' }),
|
|
289
|
+
output: core_1.Flags.string({ char: 'o', default: render_methods_1.OutputFormatsEnum.json, description: "format in which to render the data.", options: Object.keys(render_methods_1.OutputFormatsEnum) }),
|
|
290
|
+
silent: core_1.Flags.boolean({ exclusive: ["echo", "to-script"], description: 'Non-Interactive mode; executes without any user interaction and fails on any missing or invalid arguments.' }),
|
|
291
|
+
echo: core_1.Flags.boolean({ exclusive: ["to-script", "silent"], description: 'Echo interaction mode; renders the equivalent non-interactive cli command for future use before final execution.' }),
|
|
292
|
+
"to-script": core_1.Flags.boolean({ exclusive: ["echo", "silent"], description: 'Toscript interaction mode; renders the equivalent non-interactive cli command WITHOUT any execution.' }),
|
|
293
|
+
"take-defaults": core_1.Flags.boolean({ exclusive: ["silent"], description: "Prevents prompting for confirmation on parameters that were passed in or were set to default values." }),
|
|
294
|
+
help: core_1.Flags.help({ char: 'h', description: 'Displays the help document for this command.' })
|
|
295
|
+
};
|
|
296
|
+
ConfigSettingsGet.args = {};
|
|
297
|
+
//# sourceMappingURL=get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.js","sourceRoot":"","sources":["../../../../src/commands/config/settings/get.ts"],"names":[],"mappings":";;;AAAA,sCAAmC;AACnC,6BAA6B;AAC7B,4BAA6B;AAC7B,kEAA2E;AAC3E,4DAA2D;AAC3D,kEAAkO;AAClO,8EAAyE;AACzE,0DAA0D;AAC1D,oEAAoE;AAEpE,sEAAwH;AAiBxH,MAAqB,iBAAkB,SAAQ,+CAAqB;IAApE;;QA0BE,2CAA2C;QAE3C,2EAA2E;QACnE,QAAG,GAAa,CAAC,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC;IAkU3E,CAAC;IA9TC,uEAAuE;IACvE,yBAAyB;IAEzB,IAAc,WAAW;QACvB,IAAI,IAAI,CAAC,mBAAmB,KAAK,SAAS,EAAE;YAC1C,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,+BAAa,CAAC,CAAC;SACxD;QACD,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAID,uEAAuE;IAG7D,SAAS;QACjB,KAAK,CAAC,SAAS,EAAE,CAAC;QAClB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,+BAAa,CAAC,CAAC,MAAM,EAAE,CAAC;IACxC,CAAC;IAGK,GAAG;;YACP,IAAI,CAAC,SAAS,EAAE,CAAC;YACjB,MAAM,IAAI,CAAC,SAAS,EAAE,CAA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iac-ops-common";
|
|
3
|
+
import { CodiacClient } from "../apis/codiac-api";
|
|
4
|
+
import { CabinetClusterRoot, ConfigDef, EnterpriseRoot, EnvironmentRoot, RootMap, ScopedSetting, ScopeLevel } from "../apis/codiac-api/contracts";
|
|
5
|
+
export type TextValueParent = {
|
|
6
|
+
text: string;
|
|
7
|
+
value: string;
|
|
8
|
+
children?: TextValueParent[];
|
|
9
|
+
};
|
|
10
|
+
export declare enum SpecialConfigTypes {
|
|
11
|
+
"env" = "env",
|
|
12
|
+
"footprint" = "footprint",
|
|
13
|
+
"helm" = "helm"
|
|
14
|
+
}
|
|
15
|
+
export declare enum InteractionModes {
|
|
16
|
+
"echo" = "echo",
|
|
17
|
+
"toscript" = "toscript",
|
|
18
|
+
"silent" = "silent"
|
|
19
|
+
}
|
|
20
|
+
export declare class ConfigUiUtils {
|
|
21
|
+
private _ui;
|
|
22
|
+
private _styler;
|
|
23
|
+
private _codiacApi;
|
|
24
|
+
buildConfigTree(settings: Pick<ScopedSetting, "setting" | "value">[]): TextValueParent[];
|
|
25
|
+
constructor(_ui: IUserInputProvider, _styler: IOutputStyler, _codiacApi: CodiacClient);
|
|
26
|
+
/** Validates the candidate's current value,
|
|
27
|
+
* prompts the user if necessary,
|
|
28
|
+
* mutates the candidate as needed,
|
|
29
|
+
* and returns the applicable enterprise obj from the RootMap.
|
|
30
|
+
*
|
|
31
|
+
* Throws when unable to assign one,
|
|
32
|
+
* so otherwise, candidate SHALL ALWAYS end up with an enterprise assigned.*/
|
|
33
|
+
promptForEnterprise<TCandidate extends {
|
|
34
|
+
enterprise?: string | undefined;
|
|
35
|
+
}>(candidate: TCandidate, rootMap: RootMap): Promise<EnterpriseRoot>;
|
|
36
|
+
/** Returns the ultiamate asset name and the flag telling whether the original user input was changed. */
|
|
37
|
+
promptForAsset(assets: {
|
|
38
|
+
name: string;
|
|
39
|
+
}[], current?: string | undefined): Promise<[string, boolean]>;
|
|
40
|
+
promptForTypeAndFile(enterprise: string, asset: string, configType?: SpecialConfigTypes | undefined, targetFile?: string | undefined, existingConfigDefs?: Pick<ConfigDef, "type" | "targetFile">[] | undefined): Promise<[SpecialConfigTypes | undefined, string | undefined, ScopedSetting[] | undefined, boolean]>;
|
|
41
|
+
/** Prompts for a single setting name.
|
|
42
|
+
*
|
|
43
|
+
* TODO: Add ability to select branches of settings (globbed dot-paths)
|
|
44
|
+
* so user can delete entire sections at a time (eg: database-settings.*).
|
|
45
|
+
*
|
|
46
|
+
*
|
|
47
|
+
* Use this inquirer plugin for navigating the object structure:
|
|
48
|
+
* https://github.com/insightfuls/inquirer-tree-prompt
|
|
49
|
+
*
|
|
50
|
+
* See if this file tree selector could be fashioned to do the same:
|
|
51
|
+
* https://github.com/anc95/inquirer-file-tree-selection
|
|
52
|
+
*
|
|
53
|
+
* @param existing The list of existing settings to choose from.
|
|
54
|
+
* @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.
|
|
55
|
+
* @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.
|
|
56
|
+
*/
|
|
57
|
+
promptForOneSetting(existing: ScopedSetting[], mode?: "read" | "write", given?: string | undefined): Promise<[string, ScopedSetting[], boolean]>;
|
|
58
|
+
/** Prompts for one or many setting names. Includes an `ALL` but NOT an `ADDNEW` option.
|
|
59
|
+
*
|
|
60
|
+
* TODO: Add ability to select branches of settings (globbed dot-paths)
|
|
61
|
+
* so user can delete entire sections at a time (eg: database-settings.*).
|
|
62
|
+
*
|
|
63
|
+
*
|
|
64
|
+
* Use this inquirer plugin for navigating the object structure:
|
|
65
|
+
* https://github.com/insightfuls/inquirer-tree-prompt
|
|
66
|
+
*
|
|
67
|
+
* See if this file tree selector could be fashioned to do the same:
|
|
68
|
+
* https://github.com/anc95/inquirer-file-tree-selection
|
|
69
|
+
*
|
|
70
|
+
* @param existing
|
|
71
|
+
* @param given A prompt gets invoked only if no givens match any existing settings.
|
|
72
|
+
*/
|
|
73
|
+
promptForManySettings(existing: ScopedSetting[], given?: string | string[] | undefined, multi?: boolean): Promise<[string[], ScopedSetting[], boolean]>;
|
|
74
|
+
/** Searches out availables that match ANY of the given specs.
|
|
75
|
+
* @param availables: setting objects to search for.
|
|
76
|
+
* @param matchSpecs: each can be either a distinct setting name (eg `shoe-size`) or a glob (eg `api-settings.*`).
|
|
77
|
+
*/
|
|
78
|
+
private static matchMultipleWithGlobbing;
|
|
79
|
+
/** Determines if the two collections have ANY different concrete values,
|
|
80
|
+
* regardless of order or string/array/undefined/empty)
|
|
81
|
+
*
|
|
82
|
+
* ```
|
|
83
|
+
* DIFFERENT IF:
|
|
84
|
+
* any of A not in B
|
|
85
|
+
* AND
|
|
86
|
+
* any of B not in A
|
|
87
|
+
* ```
|
|
88
|
+
* */
|
|
89
|
+
private static areDifferent;
|
|
90
|
+
validateAndPromptForScope(rootMap: RootMap, enterprise: string, scope?: ScopeLevel | undefined, target?: string | undefined, existings?: AtLeast<ScopedSetting, "scope" | "target">[], allowEverywhere?: boolean): Promise<[(ScopeLevel | undefined), (string | undefined), boolean]>;
|
|
91
|
+
promptForScope(enterprise: string, rootMap: RootMap, existings?: AtLeast<ScopedSetting, "scope" | "target">[], allowEverywhere?: boolean, prompt?: string): Promise<Pick<ScopedSetting, "scope" | "target"> | undefined>;
|
|
92
|
+
/** sets each value to "scope|target".
|
|
93
|
+
* */
|
|
94
|
+
buildCabinetTree(rootMap: RootMap, existings?: AtLeast<ScopedSetting, "scope" | "target">[]): TextValueParent[];
|
|
95
|
+
/** Truncates the string to the given length with an ellipses as suffix */
|
|
96
|
+
private ellipsis;
|
|
97
|
+
private buildSelectChoicesFrom;
|
|
98
|
+
/** Determines the format of the string that was piped in,
|
|
99
|
+
* and parses it into an object in memory.
|
|
100
|
+
*
|
|
101
|
+
* Supports formats: json, yaml
|
|
102
|
+
*/
|
|
103
|
+
parseInputString(input: string): {
|
|
104
|
+
setting: string;
|
|
105
|
+
value: any;
|
|
106
|
+
}[];
|
|
107
|
+
}
|
|
108
|
+
/** Finds the object in the rootmap (ent, env, or cab) specified by the given scope.
|
|
109
|
+
*
|
|
110
|
+
* Returns undefined if the scope/target combination does not exist.
|
|
111
|
+
*/
|
|
112
|
+
export declare function findScopeTarget(rootMap: RootMap, scope: ScopeLevel, target: string): EnterpriseRoot | EnvironmentRoot | CabinetClusterRoot | undefined;
|