@codiac.io/codiac-cli 1.3.166 → 1.3.169

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.
Files changed (112) hide show
  1. package/README.md +1 -1
  2. package/dist/apis/codiac-api/gen/contracts/types.gen.d.ts +6 -2
  3. package/dist/apis/codiac-api/gen/contracts/types.gen.js +3 -0
  4. package/dist/apis/codiac-api/gen/contracts/types.gen.js.map +1 -1
  5. package/dist/apis/codiac-api-nats/gen/contracts/types.gen.d.ts +7 -3
  6. package/dist/apis/codiac-api-nats/gen/contracts/types.gen.js +4 -1
  7. package/dist/apis/codiac-api-nats/gen/contracts/types.gen.js.map +1 -1
  8. package/dist/apis/codiac-relay/gen/client.d.ts +5 -3
  9. package/dist/apis/codiac-relay/gen/client.js +6 -0
  10. package/dist/apis/codiac-relay/gen/client.js.map +1 -1
  11. package/dist/apis/codiac-relay/gen/contracts/types.gen.d.ts +37 -4
  12. package/dist/apis/codiac-relay/gen/contracts/types.gen.js +6 -0
  13. package/dist/apis/codiac-relay/gen/contracts/types.gen.js.map +1 -1
  14. package/dist/apis/codiac-relay/i-client.d.ts +1 -1
  15. package/dist/apis/codiac-relay-nats/gen/client.d.ts +3 -1
  16. package/dist/apis/codiac-relay-nats/gen/client.js +7 -0
  17. package/dist/apis/codiac-relay-nats/gen/client.js.map +1 -1
  18. package/dist/apis/codiac-relay-nats/gen/contracts/types.gen.d.ts +39 -3
  19. package/dist/apis/codiac-relay-nats/gen/contracts/types.gen.js +6 -0
  20. package/dist/apis/codiac-relay-nats/gen/contracts/types.gen.js.map +1 -1
  21. package/dist/apis/codiac-relay-nats/gen/contracts.ng.d.ts +3 -0
  22. package/dist/apis/codiac-relay-nats/gen/contracts.ng.js.map +1 -1
  23. package/dist/codiac-constants.d.ts +4 -0
  24. package/dist/codiac-constants.js +4 -0
  25. package/dist/codiac-constants.js.map +1 -1
  26. package/dist/codiac-entities/cluster-capture-def.d.ts +1 -1
  27. package/dist/codiac-utils.d.ts +5 -0
  28. package/dist/codiac-utils.js +14 -0
  29. package/dist/codiac-utils.js.map +1 -0
  30. package/dist/command-base-enterprise.d.ts +14 -0
  31. package/dist/command-base-enterprise.js +49 -0
  32. package/dist/command-base-enterprise.js.map +1 -1
  33. package/dist/command-base-exec.js +2 -0
  34. package/dist/command-base-exec.js.map +1 -1
  35. package/dist/commands/asset/deploy.d.ts +2 -0
  36. package/dist/commands/asset/deploy.js +21 -4
  37. package/dist/commands/asset/deploy.js.map +1 -1
  38. package/dist/commands/asset/list.js +4 -3
  39. package/dist/commands/asset/list.js.map +1 -1
  40. package/dist/commands/asset/undeploy.d.ts +2 -0
  41. package/dist/commands/asset/undeploy.js +7 -0
  42. package/dist/commands/asset/undeploy.js.map +1 -1
  43. package/dist/commands/asset/view.js +5 -3
  44. package/dist/commands/asset/view.js.map +1 -1
  45. package/dist/commands/asset/where.js +12 -2
  46. package/dist/commands/asset/where.js.map +1 -1
  47. package/dist/commands/cabinet/contents.d.ts +1 -0
  48. package/dist/commands/cabinet/contents.js +17 -2
  49. package/dist/commands/cabinet/contents.js.map +1 -1
  50. package/dist/commands/cluster/scaling/update.js +3 -2
  51. package/dist/commands/cluster/scaling/update.js.map +1 -1
  52. package/dist/commands/cluster/stack/capture.d.ts +24 -0
  53. package/dist/commands/cluster/stack/capture.js +107 -0
  54. package/dist/commands/cluster/stack/capture.js.map +1 -0
  55. package/dist/commands/cluster/start.js +1 -1
  56. package/dist/commands/cluster/start.js.map +1 -1
  57. package/dist/commands/cluster/stop.js +1 -1
  58. package/dist/commands/cluster/stop.js.map +1 -1
  59. package/dist/commands/config/add.d.ts +2 -0
  60. package/dist/commands/config/add.js +51 -5
  61. package/dist/commands/config/add.js.map +1 -1
  62. package/dist/commands/config/delete.js +3 -1
  63. package/dist/commands/config/delete.js.map +1 -1
  64. package/dist/commands/config/deploy.d.ts +4 -0
  65. package/dist/commands/config/deploy.js +87 -5
  66. package/dist/commands/config/deploy.js.map +1 -1
  67. package/dist/commands/config/settings/get.js +3 -1
  68. package/dist/commands/config/settings/get.js.map +1 -1
  69. package/dist/commands/config/view.js +3 -1
  70. package/dist/commands/config/view.js.map +1 -1
  71. package/dist/commands/kit/create.js +2 -1
  72. package/dist/commands/kit/create.js.map +1 -1
  73. package/dist/commands/noc/cluster/capture.js +2 -1
  74. package/dist/commands/noc/cluster/capture.js.map +1 -1
  75. package/dist/commands/noc/cluster/create.d.ts +2 -0
  76. package/dist/commands/noc/cluster/create.js +17 -4
  77. package/dist/commands/noc/cluster/create.js.map +1 -1
  78. package/dist/commands/noc/cluster/deinit.js +7 -5
  79. package/dist/commands/noc/cluster/deinit.js.map +1 -1
  80. package/dist/commands/noc/cluster/init.js +1 -1
  81. package/dist/commands/noc/cluster/init.js.map +1 -1
  82. package/dist/commands/noc/cluster/recreate.js +1 -1
  83. package/dist/commands/noc/cluster/recreate.js.map +1 -1
  84. package/dist/commands/snapshot/deploy.d.ts +51 -0
  85. package/dist/commands/snapshot/deploy.js +305 -0
  86. package/dist/commands/snapshot/deploy.js.map +1 -0
  87. package/dist/commands/snapshot/list.d.ts +15 -0
  88. package/dist/commands/snapshot/list.js +164 -0
  89. package/dist/commands/snapshot/list.js.map +1 -0
  90. package/dist/sdk-adapters/azure/azure-resource-configurator.d.ts +2 -1
  91. package/dist/sdk-adapters/azure/azure-resource-configurator.js +37 -29
  92. package/dist/sdk-adapters/azure/azure-resource-configurator.js.map +1 -1
  93. package/dist/uilogic/config-ui-utils.d.ts +3 -1
  94. package/dist/uilogic/config-ui-utils.js +36 -5
  95. package/dist/uilogic/config-ui-utils.js.map +1 -1
  96. package/dist/uilogic/enterprise-contextualizer.js +11 -0
  97. package/dist/uilogic/enterprise-contextualizer.js.map +1 -1
  98. package/dist/uilogic/lrp-watcher-predef.d.ts +3 -1
  99. package/dist/uilogic/lrp-watcher-predef.js +19 -6
  100. package/dist/uilogic/lrp-watcher-predef.js.map +1 -1
  101. package/dist/uilogic/lrp-watcher-utils.d.ts +1 -1
  102. package/dist/uilogic/lrp-watcher.d.ts +2 -0
  103. package/dist/uilogic/lrp-watcher.js +14 -2
  104. package/dist/uilogic/lrp-watcher.js.map +1 -1
  105. package/dist/uilogic/rootmap-ui-utils.d.ts +5 -0
  106. package/dist/uilogic/rootmap-ui-utils.js +45 -3
  107. package/dist/uilogic/rootmap-ui-utils.js.map +1 -1
  108. package/dist/user-context-loader.d.ts +24 -1
  109. package/dist/user-context-loader.js +86 -16
  110. package/dist/user-context-loader.js.map +1 -1
  111. package/oclif.manifest.json +232 -19
  112. package/package.json +2 -2
@@ -0,0 +1,305 @@
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 command_base_enterprise_1 = require("../../command-base-enterprise");
6
+ const cli_common_1 = require("../../cli-common");
7
+ const config_ui_utils_1 = require("../../uilogic/config-ui-utils");
8
+ const _ = require("lodash");
9
+ const codiac_utils_1 = require("../../codiac-utils");
10
+ class SnapshotDeploy extends command_base_enterprise_1.CommandBaseEnterprise {
11
+ constructor() {
12
+ super(...arguments);
13
+ /** CLI Command-line string to rerun this execution as a non-TTY script. */
14
+ this.cmd = [];
15
+ this.infrxAliases = ["cluster:install:snapshot"];
16
+ }
17
+ run() {
18
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
19
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
+ this.bootstrap();
21
+ const { flags } = yield this.parse(SnapshotDeploy);
22
+ // Initialize command string for echo/to-script modes
23
+ this.cmd = [this.config.bin, ...((_b = (_a = this.id) === null || _a === void 0 ? void 0 : _a.split(":")) !== null && _b !== void 0 ? _b : [])];
24
+ try {
25
+ // 1. ESTABLISH CONTEXT
26
+ this._userCntx = yield this.establishTenantContext(this._userCntx);
27
+ let rootMap = yield this.getRootMap();
28
+ const interactionMode = this.getInteractionMode(flags.silent, flags.echo, flags['to-script']);
29
+ let currentEnterprise = (yield this.establishEnterpriseContext(rootMap, flags.enterprise, interactionMode)).enterprise;
30
+ const isInfrxEnterprise = codiac_utils_1.CodiacUtils.isInfrxEnterprise(currentEnterprise.name);
31
+ this.enforceEnterpriseType(currentEnterprise.name);
32
+ // 2. FETCH SNAPSHOTS
33
+ if (interactionMode !== config_ui_utils_1.InteractionModes.silent) {
34
+ this._ui.startSpinner("Retrieving snapshots");
35
+ }
36
+ let crit = {
37
+ enterprise: currentEnterprise.name,
38
+ take: 50,
39
+ sort: "created~desc"
40
+ };
41
+ let result = yield this._codiacApi.EnterpriseVersionConfig.tryReadMany(crit);
42
+ if (result.error) {
43
+ if (interactionMode !== config_ui_utils_1.InteractionModes.silent) {
44
+ this._ui.stopSpinner("failed");
45
+ }
46
+ this.logger.error(`Error retrieving snapshots: ${result.error.message || result.message || "Unknown error"}`);
47
+ throw result.error;
48
+ }
49
+ let snapshots = (_c = result.output) !== null && _c !== void 0 ? _c : [];
50
+ if (interactionMode !== config_ui_utils_1.InteractionModes.silent) {
51
+ this._ui.stopSpinner(`found ${snapshots.length}`);
52
+ }
53
+ if (snapshots.length === 0) {
54
+ this._ui.userMessage("No snapshots found in enterprise: " + currentEnterprise.name);
55
+ return;
56
+ }
57
+ // 3. SELECT SNAPSHOT
58
+ let selectedSnapshot;
59
+ if (interactionMode === config_ui_utils_1.InteractionModes.silent) {
60
+ selectedSnapshot = yield this.selectSnapshot_silently(snapshots, flags.version);
61
+ }
62
+ else {
63
+ selectedSnapshot = yield this.selectSnapshot_interactively(snapshots, flags.version);
64
+ }
65
+ if (!selectedSnapshot) {
66
+ this._ui.userMessage("No snapshot selected. Operation cancelled.");
67
+ return;
68
+ }
69
+ // Display selected snapshot info
70
+ const assetCount = (_e = (_d = selectedSnapshot.contents) === null || _d === void 0 ? void 0 : _d.length) !== null && _e !== void 0 ? _e : 0;
71
+ if (interactionMode !== config_ui_utils_1.InteractionModes.silent) {
72
+ this._ui.userMessage(`Selected snapshot: ${this._styler.hilite(selectedSnapshot.version)} (${assetCount} assets)`);
73
+ }
74
+ if (!selectedSnapshot.contents || selectedSnapshot.contents.length === 0) {
75
+ this._ui.userMessage("Selected snapshot has no assets to deploy.");
76
+ return;
77
+ }
78
+ // 4. SELECT CABINET
79
+ let cab;
80
+ let envName;
81
+ if (interactionMode === config_ui_utils_1.InteractionModes.silent) {
82
+ [cab, envName] = yield this.selectCabinet_silently(rootMap, currentEnterprise.name, flags.cabinet);
83
+ }
84
+ else {
85
+ [cab, envName] = yield this.selectCabinet_interactively(rootMap, currentEnterprise.name, flags.cabinet);
86
+ }
87
+ // ------------------------------------------------------------------
88
+ // Infrx lexicon...
89
+ let destType = isInfrxEnterprise ? "cluster" : "cabinet";
90
+ let dest = isInfrxEnterprise ? ((_f = cab.cluster) !== null && _f !== void 0 ? _f : envName) : `${currentEnterprise.name}/${envName}/${this._styler.hilite(cab.name)}`;
91
+ let destAbbrv = isInfrxEnterprise ? ((_g = cab.cluster) !== null && _g !== void 0 ? _g : envName) : cab.name;
92
+ let action = isInfrxEnterprise ? "install" : "deploy";
93
+ // ------------------------------------------------------------------
94
+ if (isInfrxEnterprise) {
95
+ this._ui.userMessage(`Target ${destType}: ${this._styler.hilite(dest)}`);
96
+ }
97
+ else {
98
+ this._ui.userMessage(`Target ${destType}: ${this._styler.hilite(cab.name)} (environment: ${envName})`);
99
+ }
100
+ // 5. PROMPT FOR CLOUD PROVIDER CREDS
101
+ let cluster = rootMap.clusters.find(c => c.name == cab.cluster);
102
+ if (cluster == undefined) {
103
+ throw new Error(`Did not recognize cluster [${cab.cluster}]`);
104
+ }
105
+ const suppressCspPrompts = interactionMode === config_ui_utils_1.InteractionModes.silent;
106
+ yield this.cspContextualizer.promptForCloudProviderCreds(this.ioc, cluster.provider, suppressCspPrompts, undefined, undefined, cluster.providerSubscriptionId);
107
+ // 6. BUILD DEPLOY REQUEST
108
+ let assets = this.buildAssetVersionsFromSnapshot(selectedSnapshot);
109
+ // Show what will be deployed (unless silent)
110
+ if (interactionMode !== config_ui_utils_1.InteractionModes.silent) {
111
+ this._ui.userMessage(`\nThe following assets will be ${action}ed:`);
112
+ for (let asset of assets) {
113
+ this._ui.userMessage(` - ${asset.a}: ${asset.v}`);
114
+ }
115
+ this._ui.userMessage(`\n${action}ing ${assets.length} assets\n`);
116
+ }
117
+ // 7. BUILD COMMAND STRING (for echo and to-script modes)
118
+ if (interactionMode && [config_ui_utils_1.InteractionModes.echo, config_ui_utils_1.InteractionModes.toscript].includes(interactionMode)) {
119
+ this.cmd = this.buildCommandString(currentEnterprise.name, selectedSnapshot.version, cab.name);
120
+ this._ui.userMessage(this.cmd.join(" "));
121
+ }
122
+ // 8. CONFIRM DEPLOYMENT (skip for silent and to-script)
123
+ if (interactionMode !== config_ui_utils_1.InteractionModes.silent && interactionMode !== config_ui_utils_1.InteractionModes.toscript) {
124
+ let confirmed = yield this._ui.promptConfirm("confirmDeploy", `${action} snapshot ${this._styler.hilite(selectedSnapshot.version)} to ${this._styler.hilite(destAbbrv)}?`, true);
125
+ if (!confirmed) {
126
+ this._ui.userMessage(`${action} cancelled.`);
127
+ return;
128
+ }
129
+ }
130
+ // 9. EXECUTE DEPLOYMENT (skip for to-script mode)
131
+ if (interactionMode === config_ui_utils_1.InteractionModes.toscript) {
132
+ // to-script mode: don't execute, just output the command
133
+ return;
134
+ }
135
+ let target = {
136
+ enterprise: currentEnterprise.name,
137
+ environment: envName,
138
+ cabinet: cab.name
139
+ };
140
+ let deployRequest = {
141
+ target: target,
142
+ assets: assets
143
+ };
144
+ yield this._ui.startSpinner(`${action}ing snapshot to [${dest}]...`);
145
+ let deployResult = yield this.genRelayClient.Call.postExecuteDeployment(deployRequest);
146
+ yield this._ui.stopSpinner(deployResult.success ? "SUCCESS" : (deployResult.error ? "ERROR" : "FAILED"));
147
+ if (deployResult.success) {
148
+ this._ui.userMessage(`${this._styler.colorGood("SUCCESS")}: Snapshot ${selectedSnapshot.version} ${action}ed to ${destAbbrv}`);
149
+ this._ui.userMessage(`${(_h = deployResult.message) !== null && _h !== void 0 ? _h : ""}`);
150
+ }
151
+ else if (deployResult.error) {
152
+ this._ui.userMessage(`${this._styler.colorCritical("ERROR")}: ${deployResult.message}`);
153
+ throw deployResult.error;
154
+ }
155
+ else {
156
+ this._ui.userMessage(`FAILED: ${deployResult.message}`);
157
+ throw new Error((_j = deployResult.message) !== null && _j !== void 0 ? _j : `${action} failed`);
158
+ }
159
+ return;
160
+ }
161
+ catch (err) {
162
+ throw err;
163
+ }
164
+ finally {
165
+ yield this.closeConnections();
166
+ }
167
+ });
168
+ }
169
+ /**
170
+ * Builds the equivalent CLI command string for echo/to-script modes.
171
+ */
172
+ buildCommandString(enterprise, snapshotVersion, cabinetName) {
173
+ var _a, _b;
174
+ let cmd = [this.config.bin, ...((_b = (_a = this.id) === null || _a === void 0 ? void 0 : _a.split(":")) !== null && _b !== void 0 ? _b : [])];
175
+ cmd.push("-e", enterprise);
176
+ cmd.push("-v", snapshotVersion);
177
+ cmd.push("-c", cabinetName);
178
+ cmd.push("--silent");
179
+ return cmd;
180
+ }
181
+ /**
182
+ * Selects a snapshot in silent mode - requires the version to be provided.
183
+ */
184
+ selectSnapshot_silently(snapshots, snapshotVersion) {
185
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
186
+ if (!snapshotVersion) {
187
+ throw new Error("Snapshot version (--version or -v) is required in silent mode.");
188
+ }
189
+ let found = snapshots.find(s => s.version.toLowerCase() === snapshotVersion.toLowerCase());
190
+ if (!found) {
191
+ throw new Error(`Snapshot version "${snapshotVersion}" not found in the enterprise.`);
192
+ }
193
+ return found;
194
+ });
195
+ }
196
+ /**
197
+ * Prompts the user to select a snapshot from the available list interactively.
198
+ */
199
+ selectSnapshot_interactively(snapshots, preselectedVersion) {
200
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
201
+ // If a version was provided via flag, try to find it
202
+ if (preselectedVersion) {
203
+ let found = snapshots.find(s => s.version.toLowerCase() === preselectedVersion.toLowerCase());
204
+ if (found) {
205
+ return found;
206
+ }
207
+ this._ui.userMessage(`Snapshot version "${preselectedVersion}" not found. Please select from available snapshots.`);
208
+ }
209
+ // Build choices for the fuzzy selector
210
+ let choices = snapshots.map(s => {
211
+ var _a, _b, _c, _d;
212
+ const assetCount = (_b = (_a = s.contents) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
213
+ const dateStr = this.formatDate(s.created);
214
+ const displayName = `${s.version} - ${assetCount} asset${assetCount !== 1 ? 's' : ''} - ${dateStr} - by ${s.createdBy}`;
215
+ const tag = (_d = (_c = s.tags) === null || _c === void 0 ? void 0 : _c.map(t => t.name).join("|")) !== null && _d !== void 0 ? _d : "";
216
+ return { name: `${displayName} - ${tag}`, value: s.version };
217
+ });
218
+ let fuzzySelector = new cli_common_1.PromptSelectFuzzy(this.logger, this._ui, this._styler);
219
+ let selectedVersion = yield fuzzySelector.go("snapshotVersion", "Select a snapshot to deploy:", false, undefined, false, () => tslib_1.__awaiter(this, void 0, void 0, function* () { return choices; }));
220
+ return snapshots.find(s => s.version === selectedVersion);
221
+ });
222
+ }
223
+ /**
224
+ * Selects a cabinet in silent mode - requires the cabinet name to be provided.
225
+ */
226
+ selectCabinet_silently(rootMap, enterpriseName, cabinetName) {
227
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
228
+ if (!cabinetName) {
229
+ throw new Error("Cabinet name (--cabinet or -c) is required in silent mode.");
230
+ }
231
+ // Find the cabinet in the rootMap
232
+ let ent = rootMap.enterprises.find(e => e.name === enterpriseName);
233
+ if (!ent) {
234
+ throw new Error(`Enterprise "${enterpriseName}" not found.`);
235
+ }
236
+ for (let env of ent.environments) {
237
+ let cab = env.cabinets.find(c => c.name.toLowerCase() === cabinetName.toLowerCase());
238
+ if (cab) {
239
+ this.validateCabinet(cab);
240
+ return [cab, env.name];
241
+ }
242
+ }
243
+ throw new Error(`Cabinet "${cabinetName}" not found in enterprise "${enterpriseName}".`);
244
+ });
245
+ }
246
+ /**
247
+ * Prompts the user to select a target cabinet interactively.
248
+ */
249
+ selectCabinet_interactively(rootMap, enterpriseName, preselectedCabinet) {
250
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
251
+ let [cab, envName] = yield this.rootMapUtils.promptForCabinet(enterpriseName, rootMap, preselectedCabinet, false, undefined, preselectedCabinet);
252
+ this.validateCabinet(cab);
253
+ return [cab, envName];
254
+ });
255
+ }
256
+ /**
257
+ * Validates that a cabinet has the required infrastructure.
258
+ */
259
+ validateCabinet(cab) {
260
+ if (cab.infrx == undefined || _.isEmpty(cab.infrx)) {
261
+ throw new Error(`Cannot connect to cabinet ${cab.name}: it has no infrastructure record.`);
262
+ }
263
+ if (cab.cluster == undefined || _.isEmpty(cab.cluster)) {
264
+ throw new Error(`Cannot connect to cabinet ${cab.name}: it has no cluster assigned.`);
265
+ }
266
+ }
267
+ /**
268
+ * Builds an array of AssetVersion from the snapshot's contents.
269
+ */
270
+ buildAssetVersionsFromSnapshot(snapshot) {
271
+ if (!snapshot.contents || !Array.isArray(snapshot.contents)) {
272
+ return [];
273
+ }
274
+ return snapshot.contents.map(content => {
275
+ // The content has assetName and version properties
276
+ const assetName = content.assetName || content.entityName || 'unknown';
277
+ const assetVersion = content.version || 'unknown';
278
+ return { a: assetName, v: assetVersion };
279
+ });
280
+ }
281
+ /**
282
+ * Formats a date for display.
283
+ */
284
+ formatDate(date) {
285
+ if (date instanceof Date) {
286
+ return date.toISOString().split('T')[0];
287
+ }
288
+ return new Date(date).toISOString().split('T')[0];
289
+ }
290
+ }
291
+ exports.default = SnapshotDeploy;
292
+ SnapshotDeploy.description = 'Deploys all assets in a snapshot to a target cabinet.';
293
+ SnapshotDeploy.aliases = ["cluster:install:snapshot"];
294
+ SnapshotDeploy.flags = {
295
+ enterprise: core_1.Flags.string({ char: 'e', required: false, description: 'The name of the enterprise containing the snapshot to deploy.' }),
296
+ version: core_1.Flags.string({ char: 'v', required: false, description: 'The version of the snapshot to deploy (e.g., 5CJRH7XB).' }),
297
+ cabinet: core_1.Flags.string({ char: 'c', required: false, description: 'The target cabinet name to deploy to.' }),
298
+ help: core_1.Flags.help({ char: 'h', description: 'Displays the help document for this command.' }),
299
+ // Interaction mode flags
300
+ 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.' }),
301
+ 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.' }),
302
+ "to-script": core_1.Flags.boolean({ exclusive: ["echo", "silent"], description: 'Toscript interaction mode; renders the equivalent non-interactive cli command WITHOUT any execution.' })
303
+ };
304
+ SnapshotDeploy.args = {};
305
+ //# sourceMappingURL=deploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../src/commands/snapshot/deploy.ts"],"names":[],"mappings":";;;AAAA,sCAAoC;AAGpC,2EAAsE;AACtE,iDAAmE;AACnE,mEAAiE;AACjE,4BAA6B;AAC7B,qDAAiD;AAEjD,MAAqB,cAAe,SAAQ,+CAAqB;IAAjE;;QAkBE,2EAA2E;QACnE,QAAG,GAAa,EAAE,CAAC;QAEjB,iBAAY,GAAyB,CAAC,0BAA0B,CAAC,CAAC;IA2T9E,CAAC;IAzTO,GAAG;;;YACP,IAAI,CAAC,SAAS,EAAE,CAAC;YACjB,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;YAEnD,qDAAqD;YACrD,IAAI,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,MAAA,MAAA,IAAI,CAAC,EAAE,0CAAE,KAAK,CAAC,GAAG,CAAC,mCAAI,EAAE,CAAC,CAAC,CAAC;YAE7D,IAAI;gBACF,uBAAuB;gBACvB,IAAI,CAAC,SAAS,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBACnE,IAAI,OAAO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AAG,CAAC,0BAA0B,CAAC,CAAC;AAEvC,oBAAK,GAAG;IACb,UAAU,EAAE,YAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,+DAA+D,EAAE,CAAC;IACtI,OAAO,EAAE,YAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;IAC7H,OAAO,EAAE,YAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE,uCAAuC,EAAE,CAAC;IAC3G,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;IAC5F,yBAAyB;IACzB,MAAM,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,4GAA4G,EAAE,CAAC;IACtL,IAAI,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,kHAAkH,EAAE,CAAC;IAC5L,WAAW,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,WAAW,EAAE,sGAAsG,EAAE,CAAC;CACnL,CAAA;AAEM,mBAAI,GAAG,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { CommandBaseEnterprise } from '../../command-base-enterprise';
2
+ export default class SnapshotList extends CommandBaseEnterprise {
3
+ static description: string;
4
+ static flags: {
5
+ enterprise: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
6
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
+ help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
8
+ };
9
+ static args: {};
10
+ run(): Promise<void>;
11
+ private buildSnapshotListForText;
12
+ private renderSnapshotDetails;
13
+ private formatDate;
14
+ private buildSnapshotTree;
15
+ }
@@ -0,0 +1,164 @@
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 command_base_enterprise_1 = require("../../command-base-enterprise");
7
+ const _ = require("lodash");
8
+ const render = require("../../uilogic/render-methods");
9
+ const render_methods_1 = require("../../uilogic/render-methods");
10
+ const type_safety_utils_1 = require("../../uilogic/type-safety-utils");
11
+ class SnapshotList extends command_base_enterprise_1.CommandBaseEnterprise {
12
+ run() {
13
+ var _a, _b;
14
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
+ this.bootstrap();
16
+ const { args, flags } = yield this.parse(SnapshotList);
17
+ try {
18
+ this._userCntx = yield this.establishTenantContext(this._userCntx);
19
+ let rootMap = yield this.getRootMap();
20
+ const interactionMode = this.getInteractionMode(flags.silent, flags.echo, flags['to-script']);
21
+ let currentEnterprise = (yield this.establishEnterpriseContext(rootMap, flags.enterprise, interactionMode)).enterprise;
22
+ // RETRIEVE
23
+ let outputFormat = (_a = type_safety_utils_1.TypeSafetyUtils.toEnum(render_methods_1.OutputFormatsEnum, flags.output)) !== null && _a !== void 0 ? _a : render_methods_1.OutputFormatsEnum.tree;
24
+ if ([render_methods_1.OutputFormatsEnum.json, render_methods_1.OutputFormatsEnum.yaml].includes(outputFormat) === false)
25
+ this._ui.startSpinner("Retrieving");
26
+ // Filter by enterprise - API handles the filtering
27
+ let crit = {
28
+ enterprise: currentEnterprise.name,
29
+ take: 20,
30
+ sort: "version~desc"
31
+ };
32
+ let result = yield this._codiacApi.EnterpriseVersionConfig.tryReadMany(crit);
33
+ if (result.error) {
34
+ this.logger.error(`Error retrieving snapshots: ${result.error.message || result.message || "Unknown error"}`);
35
+ throw result.error;
36
+ }
37
+ let snapshots = (_b = result.output) !== null && _b !== void 0 ? _b : [];
38
+ let snapshotCount = snapshots.length;
39
+ if ([render_methods_1.OutputFormatsEnum.json, render_methods_1.OutputFormatsEnum.yaml].includes(outputFormat) === false)
40
+ this._ui.stopSpinner(`found ${snapshotCount}`);
41
+ // RENDER
42
+ let output = "";
43
+ switch (outputFormat) {
44
+ case render_methods_1.OutputFormatsEnum.json:
45
+ // Keep full structure with contents array
46
+ let sortedForJson = _.sortBy(snapshots, s => s.enterprise, s => s.version);
47
+ output = JSON.stringify(sortedForJson, undefined, 2);
48
+ this._ui.userMessage(output);
49
+ break;
50
+ case render_methods_1.OutputFormatsEnum.yaml:
51
+ // Keep full structure with contents array
52
+ let sortedForYaml = _.sortBy(snapshots, s => s.enterprise, s => s.version);
53
+ output = YAML.stringify(sortedForYaml, { indent: 2 });
54
+ this._ui.userMessage(output);
55
+ break;
56
+ case render_methods_1.OutputFormatsEnum.text:
57
+ let listForText = this.buildSnapshotListForText(snapshots);
58
+ output = render.renderStringList(listForText);
59
+ this._ui.userMessage(output);
60
+ break;
61
+ case render_methods_1.OutputFormatsEnum.tree:
62
+ default:
63
+ let tree = this.buildSnapshotTree(snapshots);
64
+ let out = render.renderStringTree(tree);
65
+ this._ui.userMessage(out);
66
+ break;
67
+ }
68
+ return;
69
+ }
70
+ catch (err) {
71
+ throw err;
72
+ }
73
+ finally {
74
+ yield this.closeConnections();
75
+ }
76
+ });
77
+ }
78
+ buildSnapshotListForText(snapshots) {
79
+ try {
80
+ let listForText = [];
81
+ let sorted = _.sortBy(snapshots, s => s.enterprise, s => s.version);
82
+ for (let snapshot of sorted) {
83
+ let snapshotLine = this._styler.hilite(snapshot.version);
84
+ snapshotLine = snapshot.enterprise.concat("/", snapshotLine);
85
+ let details = this.renderSnapshotDetails(snapshot);
86
+ snapshotLine = snapshotLine.concat(this._styler.dim(` (${details})`));
87
+ listForText.push(snapshotLine);
88
+ // Add contents (assets) as indented sub-items
89
+ if (snapshot.contents && Array.isArray(snapshot.contents) && snapshot.contents.length > 0) {
90
+ for (let content of snapshot.contents) {
91
+ let assetName = content.assetName || content.entityName || 'unknown';
92
+ let assetVersion = content.version || 'unknown';
93
+ let assetLine = ` └─ ${this._styler.hilite(assetName)} ${this._styler.dim(`(${assetVersion})`)}`;
94
+ listForText.push(assetLine);
95
+ }
96
+ }
97
+ }
98
+ return listForText;
99
+ }
100
+ catch (err) {
101
+ throw err;
102
+ }
103
+ }
104
+ renderSnapshotDetails(snapshot) {
105
+ let details = `created: ${this.formatDate(snapshot.created)}`;
106
+ if (snapshot.contents && Array.isArray(snapshot.contents) && snapshot.contents.length > 0) {
107
+ details = details.concat(`, ${snapshot.contents.length} asset${snapshot.contents.length !== 1 ? 's' : ''}`);
108
+ }
109
+ if (snapshot.contentHash) {
110
+ details = details.concat(`, hash: ${snapshot.contentHash.substring(0, 8)}...`);
111
+ }
112
+ return details;
113
+ }
114
+ formatDate(date) {
115
+ if (date instanceof Date) {
116
+ return date.toISOString().split('T')[0];
117
+ }
118
+ return new Date(date).toISOString().split('T')[0];
119
+ }
120
+ buildSnapshotTree(snapshots) {
121
+ let tree = [];
122
+ let byEnterprise = _.groupBy(snapshots, s => s.enterprise);
123
+ for (let enterprise of Object.keys(byEnterprise).sort()) {
124
+ let entSnapshots = byEnterprise[enterprise];
125
+ let entBranch = { text: `Enterprise: ${enterprise}` };
126
+ for (let snapshot of _.sortBy(entSnapshots, s => s.version)) {
127
+ let text = this._styler.hilite(snapshot.version);
128
+ // Add asset count if available
129
+ if (snapshot.contents && Array.isArray(snapshot.contents) && snapshot.contents.length > 0) {
130
+ text = text.concat(` (${snapshot.contents.length} asset${snapshot.contents.length !== 1 ? 's' : ''})`);
131
+ }
132
+ // Add created by
133
+ text = text.concat(` - Tagged by: ${snapshot.createdBy}`);
134
+ // Add creation date
135
+ text = text.concat(` - Date: ${this.formatDate(snapshot.created)}`);
136
+ let snapshotBranch = { text: text };
137
+ // // Add contents (assets) as children
138
+ // if (snapshot.contents && Array.isArray(snapshot.contents) && snapshot.contents.length > 0) {
139
+ // snapshotBranch.children = [];
140
+ // for (let content of snapshot.contents) {
141
+ // let assetName = (content as any).assetName || content.entityName || 'unknown';
142
+ // let assetVersion = content.version || 'unknown';
143
+ // let assetText = `${this._styler.hilite(assetName)} (${assetVersion})`;
144
+ // snapshotBranch.children.push({ text: assetText });
145
+ // }
146
+ // }
147
+ if (entBranch.children === undefined)
148
+ entBranch.children = [];
149
+ entBranch.children.push(snapshotBranch);
150
+ }
151
+ tree.push(entBranch);
152
+ }
153
+ return tree;
154
+ }
155
+ }
156
+ exports.default = SnapshotList;
157
+ SnapshotList.description = 'Shows the list of snapshots (enterprise version configs) in a given enterprise.';
158
+ SnapshotList.flags = {
159
+ enterprise: core_1.Flags.string({ char: 'e', required: false, description: 'The name of the enterprise containing the snapshots being viewed (required if there are more than one).' }),
160
+ output: core_1.Flags.string({ char: 'o', default: render_methods_1.OutputFormatsEnum.tree, description: "format in which to render the data.", options: [render_methods_1.OutputFormatsEnum.json, render_methods_1.OutputFormatsEnum.yaml, render_methods_1.OutputFormatsEnum.tree, render_methods_1.OutputFormatsEnum.text] }),
161
+ help: core_1.Flags.help({ char: 'h', description: 'Displays the help document for this command.' })
162
+ };
163
+ SnapshotList.args = {};
164
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["../../../src/commands/snapshot/list.ts"],"names":[],"mappings":";;;AAAA,sCAA4C;AAC5C,6BAA6B;AAE7B,2EAAsE;AACtE,4BAA6B;AAC7B,uDAAuD;AACvD,iEAA+E;AAC/E,uEAAkE;AAMlE,MAAqB,YAAa,SAAQ,+CAAqB;IAWvD,GAAG;;;YACP,IAAI,CAAC,SAAS,EAAE,CAAC;YACjB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,I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E,kCAAiB,CAAC,IAAI,EAAE,WAAW,EAAE,qCAAqC,EAAE,OAAO,EAAE,CAAC,kCAAiB,CAAC,IAAI,EAAE,kCAAiB,CAAC,IAAI,EAAE,kCAAiB,CAAC,IAAI,EAAE,kCAAiB,CAAC,IAAI,CAAC,EAAE,CAAC;IACnO,IAAI,EAAE,YAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,8CAA8C,EAAE,CAAC;CAC7F,CAAA;AAEM,iBAAI,GAAG,EAAE,CAAC"}
@@ -105,7 +105,8 @@ export declare class AzureResourceConfigurator implements sdk.IFileStoreConfigur
105
105
  defaults: Partial<ClusterDef>;
106
106
  }>;
107
107
  promptForNodeGroup(cluster: AtLeast<ClusterDef, "name" | "providerSubscription" | "locationName">, nodeGroupSpec: Partial<Pick<ClusterDef, "nodeSpec" | "nodesMin" | "nodesMax" | "startingNodeCount">>, nodePoolName: string, defaultMaxNodes?: number): Promise<api.NodePoolDef>;
108
- promptForIngressSpec(current?: Partial<IngressDef>): Promise<IngressDef | undefined>;
108
+ promptForIngressIp(partial: Partial<IngressDef>, enableAutoGen: boolean): Promise<void>;
109
+ promptForIngressSpec(current?: Partial<IngressDef>, enableAutoGen?: boolean): Promise<IngressDef | undefined>;
109
110
  defineClusterCaptureParams(initial: Partial<ClusterDef>, rootMap: RootMap, defaults?: Partial<ClusterDef>, cspTenantId?: string, cspUser?: CspPrimaryCredsMeta): Promise<{
110
111
  spec: ClusterCaptureDef;
111
112
  defaults: Partial<ClusterDef>;