@codiac.io/codiac-cli 1.2.236 → 1.2.248

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 (41) hide show
  1. package/README.md +1 -1
  2. package/dist/apis/codiac-api/gen/client.d.ts +2 -2
  3. package/dist/apis/codiac-api/gen/client.js +4 -2
  4. package/dist/apis/codiac-api/gen/client.js.map +1 -1
  5. package/dist/apis/codiac-api/gen/contracts.d.ts +25 -4
  6. package/dist/apis/codiac-api/gen/contracts.js +3 -1
  7. package/dist/apis/codiac-api/gen/contracts.js.map +1 -1
  8. package/dist/apis/codiac-relay/gen/client.d.ts +5 -1
  9. package/dist/apis/codiac-relay/gen/client.js +28 -0
  10. package/dist/apis/codiac-relay/gen/client.js.map +1 -1
  11. package/dist/apis/codiac-relay/gen/contracts.d.ts +64 -4
  12. package/dist/apis/codiac-relay/gen/contracts.js +14 -2
  13. package/dist/apis/codiac-relay/gen/contracts.js.map +1 -1
  14. package/dist/command-base-enterprise.js +1 -1
  15. package/dist/command-base-enterprise.js.map +1 -1
  16. package/dist/command-base-exec.d.ts +3 -0
  17. package/dist/command-base-exec.js +1 -1
  18. package/dist/command-base-exec.js.map +1 -1
  19. package/dist/commands/asset/deploy.d.ts +54 -0
  20. package/dist/commands/asset/deploy.js +429 -0
  21. package/dist/commands/asset/deploy.js.map +1 -0
  22. package/dist/commands/deploy.d.ts +2 -0
  23. package/dist/commands/deploy.js +35 -6
  24. package/dist/commands/deploy.js.map +1 -1
  25. package/dist/relay/relay-container.d.ts +5 -0
  26. package/dist/relay/relay-container.js +138 -3
  27. package/dist/relay/relay-container.js.map +1 -1
  28. package/dist/relay/wsclient/relay-websocket-client.js +2 -1
  29. package/dist/relay/wsclient/relay-websocket-client.js.map +1 -1
  30. package/dist/uilogic/cloud-provider-contextualizer.d.ts +3 -3
  31. package/dist/uilogic/cloud-provider-contextualizer.js +5 -5
  32. package/dist/uilogic/config-ui-utils.d.ts +5 -38
  33. package/dist/uilogic/config-ui-utils.js +33 -234
  34. package/dist/uilogic/config-ui-utils.js.map +1 -1
  35. package/dist/uilogic/enterprise-contextualizer.js +1 -0
  36. package/dist/uilogic/enterprise-contextualizer.js.map +1 -1
  37. package/dist/uilogic/rootmap-ui-utils.d.ts +49 -0
  38. package/dist/uilogic/rootmap-ui-utils.js +243 -0
  39. package/dist/uilogic/rootmap-ui-utils.js.map +1 -0
  40. package/oclif.manifest.json +169 -1
  41. package/package.json +20 -7
@@ -0,0 +1,243 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RootMapUiUtils = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const inversify_1 = require("inversify");
6
+ const codiac_ops_common_1 = require("@codiac.io/codiac-ops-common");
7
+ const contracts_1 = require("../apis/codiac-api/contracts");
8
+ const render = require("./render-methods");
9
+ const _ = require("lodash");
10
+ ;
11
+ let RootMapUiUtils = class RootMapUiUtils {
12
+ constructor(_ui, _styler) {
13
+ this._ui = _ui;
14
+ this._styler = _styler;
15
+ }
16
+ /** Validates the candidate's current value,
17
+ * prompts the user if necessary,
18
+ * mutates the candidate as needed,
19
+ * and returns the applicable enterprise obj from the RootMap.
20
+ *
21
+ * Throws when unable to assign one,
22
+ * so otherwise, candidate SHALL ALWAYS end up with an enterprise assigned.*/
23
+ promptForEnterprise(candidate, rootMap) {
24
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
+ try {
26
+ let ent;
27
+ if (candidate.enterprise != undefined) {
28
+ // validate the given enterprise
29
+ if (rootMap.enterprises.length === 0) {
30
+ throw new Error("No enterprises found. You must create an enterprise to run this command.");
31
+ }
32
+ let found = rootMap.enterprises.find(x => x.name === candidate.enterprise);
33
+ if (found == undefined)
34
+ candidate.enterprise = undefined;
35
+ }
36
+ if (candidate.enterprise != undefined) {
37
+ ent = rootMap.enterprises.find(x => x.name === candidate.enterprise); // this assertion operator is ok bc we just validated that its in the list
38
+ }
39
+ else {
40
+ if (rootMap.enterprises.length === 1) {
41
+ ent = rootMap.enterprises[0];
42
+ candidate.enterprise = ent.name; // Auto-select the one-and-only
43
+ }
44
+ else {
45
+ // PROMPT FOR IT
46
+ let choices = rootMap.enterprises.map(e => e.name);
47
+ candidate.enterprise = (yield this._ui.promptSelect("enterprise", "Enterprise: ", choices));
48
+ ent = (rootMap.enterprises.find(x => x.name === candidate.enterprise)); // this assertion operator is ok bc we know its in this list
49
+ }
50
+ }
51
+ return ent;
52
+ }
53
+ catch (err) {
54
+ throw err;
55
+ }
56
+ });
57
+ }
58
+ /** Returns the ultiamate asset name and the flag telling whether the original user input was changed. */
59
+ promptForAsset(assets, current) {
60
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
61
+ let selected = current;
62
+ let changed = false;
63
+ if (assets.length === 0) {
64
+ throw new Error("This enterprise has no assets. You must create an asset to run this command.");
65
+ }
66
+ if (selected != undefined) {
67
+ // Drop the current value if its invalid
68
+ let found = assets.find(x => x.name === selected);
69
+ if (found == undefined) {
70
+ selected = undefined;
71
+ }
72
+ }
73
+ if (selected == undefined) {
74
+ if (assets.length === 1) {
75
+ selected = assets[0].name; // Auto-select the one-and-only
76
+ }
77
+ else {
78
+ // PROMPT FOR IT
79
+ let choices = assets.map(a => { return { name: a.name, value: a.name }; });
80
+ selected = (yield this._ui.promptSelect("asset", "Asset: ", choices)); // TODO: This needs to be a fuzzy-select
81
+ }
82
+ changed = Boolean(current != undefined);
83
+ }
84
+ return [selected, changed];
85
+ });
86
+ }
87
+ /** Selects a cabinet from a tree view.
88
+ *
89
+ * @returns Cabinet object from RootMap and the environment name.
90
+ * @param takeDefaults (optional, defaults to false) suppresses confirmation of default values when user has not provided any (but NOT when the user-supplied values were invalid and automatically CHANGED to a default).
91
+ */
92
+ promptForCabinet(enterprise, rootMap, defaultValue, takeDefaults = false, embellisher) {
93
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
94
+ try {
95
+ let output;
96
+ // render cab tree with all lines selectable
97
+ let cabTree = this.buildCabinetTree(rootMap, embellisher);
98
+ let choices = this.buildSelectChoicesFrom(cabTree);
99
+ // ISSUES:
100
+ // 0. Remove the freaking lines from the selected value.
101
+ // 1. Remember the last cabinet (user's enterprise context).
102
+ // 2. We should only render the cabinets that actually contain a deployment of the asset (or dim the others and loop back if selected)
103
+ // 3. The picklist should render the cluster (provider, name, location)
104
+ // 4. PERHAPS? The version of the asset running in the selected cabinet should get rendered (either in the picklist or after the cab is selected)
105
+ /** If we changed the input they provided, we need their confirmation (whether or not they said takeDefaults) */
106
+ const CAB_PREFIX = "cabinet|";
107
+ let cabChoices = choices.filter(c => c.value.startsWith(CAB_PREFIX));
108
+ let changedUserInput = false;
109
+ if (cabChoices.length === 1) {
110
+ if (defaultValue != cabChoices[0].value.slice(CAB_PREFIX.length)) {
111
+ changedUserInput = !_.isEmpty(defaultValue);
112
+ defaultValue = cabChoices[0].value.slice(CAB_PREFIX.length);
113
+ }
114
+ }
115
+ let keep = takeDefaults;
116
+ if (defaultValue && Boolean(choices.find(x => x.value === `${CAB_PREFIX}${defaultValue}`)) && (changedUserInput || !takeDefaults)) {
117
+ keep = yield this._ui.promptConfirm("keepCabinet", `Cabinet: ${this._styler.hilite(defaultValue)} `);
118
+ }
119
+ if (keep && defaultValue !== undefined) {
120
+ output = defaultValue;
121
+ }
122
+ else {
123
+ let scope;
124
+ let target;
125
+ do {
126
+ if (scope === "environment") {
127
+ // we could just filter it down from here...
128
+ }
129
+ let selection = (yield this._ui.promptSelect("cabinet", "Cabinet: ", choices, false, false));
130
+ let parts = selection.split("|");
131
+ scope = parts[0];
132
+ target = parts[1];
133
+ } while (scope !== "cabinet"); // ensure they select a cabinet
134
+ output = target;
135
+ }
136
+ let env = this.deriveEnvironmentFrom(enterprise, output, rootMap); // this is fkng stupid. Put this value into the cab value
137
+ let cabObj = this.getCabinetInfrx(enterprise, env.name, output, rootMap);
138
+ // return output;
139
+ return [cabObj, env.name];
140
+ }
141
+ catch (err) {
142
+ throw (err);
143
+ }
144
+ });
145
+ }
146
+ deriveEnvironmentFrom(enterprise, cabinet, rootMap) {
147
+ try {
148
+ let ent = rootMap.enterprises.find(e => e.name === enterprise);
149
+ if (ent === undefined)
150
+ throw new Error(`Cannot find environment: did not recognize enterprise [${enterprise}]`);
151
+ let enviro = ent.environments.find(x => x.cabinets.find(c => c.name === cabinet));
152
+ if (enviro === undefined)
153
+ throw new Error(`Cannot find environment: did not recognize cabinet [${cabinet}]`);
154
+ return enviro;
155
+ }
156
+ catch (err) {
157
+ throw err;
158
+ }
159
+ }
160
+ /** Retrieves the cabinet object from the RootMap. */
161
+ getCabinetInfrx(enterprise, environment, cabinet, rootMap) {
162
+ try {
163
+ let targetEnt = rootMap.enterprises.find(ent => ent.name == enterprise);
164
+ let targetCab = targetEnt
165
+ .environments.find(env => env.name == environment)
166
+ .cabinets.find(c => c.name == cabinet);
167
+ return targetCab;
168
+ }
169
+ catch (err) {
170
+ throw err;
171
+ }
172
+ }
173
+ /** sets each value to "scope|target".
174
+ *
175
+ * @param embellisher (optional) Adds custom content to each branch in the tree
176
+ * */
177
+ buildCabinetTree(rootMap, embellisher) {
178
+ var _a;
179
+ let tree = [];
180
+ for (let ent of rootMap.enterprises) {
181
+ let entBranch = { text: `${ent.name} enterprise:`, value: `${contracts_1.ScopeLevel.enterprise}|${ent.name}` };
182
+ embellisher === null || embellisher === void 0 ? void 0 : embellisher.eachEnterprise(entBranch, ent, rootMap);
183
+ for (let env of _.sortBy(ent.environments, e => e.sequence, e => e.name)) {
184
+ let envBranch = { text: `${env.name}`, value: `${contracts_1.ScopeLevel.environment}|${env.name}` };
185
+ embellisher === null || embellisher === void 0 ? void 0 : embellisher.eachEnviro(envBranch, env, ent, rootMap);
186
+ for (let cab of env.cabinets) {
187
+ let cabBranch = {
188
+ text: `${cab.name}`,
189
+ value: `${contracts_1.ScopeLevel.cabinet}|${cab.name}`
190
+ };
191
+ embellisher === null || embellisher === void 0 ? void 0 : embellisher.eachCabinet(cabBranch, cab, env, ent, rootMap);
192
+ if (envBranch.children === undefined)
193
+ envBranch.children = [];
194
+ (_a = envBranch.children) === null || _a === void 0 ? void 0 : _a.push(cabBranch);
195
+ }
196
+ if (entBranch.children === undefined)
197
+ entBranch.children = [];
198
+ entBranch.children.push(envBranch);
199
+ }
200
+ tree.push(entBranch);
201
+ }
202
+ return tree;
203
+ }
204
+ /** Truncates the string to the given length with an ellipses as suffix */
205
+ ellipsis(maxLength, value) {
206
+ let output = value;
207
+ if (output.length > maxLength) {
208
+ let ellipsis = "..."; // Rather use the ellipsis character but String.fromCharCode(133) is returning a problematic character.
209
+ output = output.slice(0, maxLength - 1 - ellipsis.length).concat(ellipsis);
210
+ }
211
+ return output;
212
+ }
213
+ buildSelectChoicesFrom(tree) {
214
+ try {
215
+ let choices = [];
216
+ // the value is no good here - need scope and target both available
217
+ render.renderStringTree(tree, (txt, item) => choices.push({ name: txt, value: item.value }));
218
+ // // This is one way to do it
219
+ // for (let item of tree) {
220
+ //
221
+ // let thisChoice: PromptChoice = { name: item.text, value: item.text };
222
+ // choices.push(thisChoice);
223
+ //
224
+ // if (item.children && item.children.length > 0) {
225
+ // let children = this.buildSelectChoicesFrom(item.children);
226
+ // choices.push(...children);
227
+ // }
228
+ // }
229
+ return choices;
230
+ }
231
+ catch (err) {
232
+ throw err;
233
+ }
234
+ }
235
+ };
236
+ RootMapUiUtils = tslib_1.__decorate([
237
+ (0, inversify_1.injectable)(),
238
+ tslib_1.__param(0, (0, inversify_1.inject)(codiac_ops_common_1.INTERFACES_OPS.IUserInputProvider)),
239
+ tslib_1.__param(1, (0, inversify_1.inject)(codiac_ops_common_1.INTERFACES_OPS.IOutputStyler)),
240
+ tslib_1.__metadata("design:paramtypes", [Object, Object])
241
+ ], RootMapUiUtils);
242
+ exports.RootMapUiUtils = RootMapUiUtils;
243
+ //# sourceMappingURL=rootmap-ui-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rootmap-ui-utils.js","sourceRoot":"","sources":["../../src/uilogic/root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E,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAoB,IAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YAGhH,8BAA8B;YAC9B,2BAA2B;YAC3B,GAAG;YACH,0EAA0E;YAC1E,8BAA8B;YAC9B,GAAG;YACH,qDAAqD;YACrD,iEAAiE;YACjE,iCAAiC;YACjC,MAAM;YACN,IAAI;YAEJ,OAAO,OAAO,CAAC;SAChB;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,GAAG,CAAC;SACX;IACH,CAAC;CAGF,CAAA;AAlQY,cAAc;IAD1B,IAAA,sBAAU,GAAE;IAIR,mBAAA,IAAA,kBAAM,EAAC,kCAAc,CAAC,kBAAkB,CAAC,CAAA;IACzC,mBAAA,IAAA,kBAAM,EAAC,kCAAc,CAAC,aAAa,CAAC,CAAA;;GAJ5B,cAAc,CAkQ1B;AAlQY,wCAAc"}
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.236",
2
+ "version": "1.2.248",
3
3
  "commands": {
4
4
  "branch": {
5
5
  "id": "branch",
@@ -308,6 +308,33 @@
308
308
  "required": false,
309
309
  "multiple": false
310
310
  },
311
+ "tag": {
312
+ "name": "tag",
313
+ "type": "option",
314
+ "char": "t",
315
+ "description": "Cabinet tags with which to declare the target cabinet (instead of by name).",
316
+ "required": false,
317
+ "multiple": true,
318
+ "exclusive": [
319
+ "cabinetName"
320
+ ]
321
+ },
322
+ "tagMatch": {
323
+ "name": "tagMatch",
324
+ "type": "option",
325
+ "char": "m",
326
+ "description": "(Optional: Defaults to any) Declares the logic that will be used to select cabinets from the given tags.",
327
+ "required": false,
328
+ "multiple": false,
329
+ "options": [
330
+ "any",
331
+ "all",
332
+ "none"
333
+ ],
334
+ "dependsOn": [
335
+ "tag"
336
+ ]
337
+ },
311
338
  "asset": {
312
339
  "name": "asset",
313
340
  "type": "option",
@@ -1354,6 +1381,147 @@
1354
1381
  "port"
1355
1382
  ]
1356
1383
  },
1384
+ "asset:deploy": {
1385
+ "id": "asset:deploy",
1386
+ "description": "Deploys a given asset to a given cabinet.",
1387
+ "strict": true,
1388
+ "pluginName": "@codiac.io/codiac-cli",
1389
+ "pluginAlias": "@codiac.io/codiac-cli",
1390
+ "pluginType": "core",
1391
+ "hidden": true,
1392
+ "aliases": [],
1393
+ "flags": {
1394
+ "help": {
1395
+ "name": "help",
1396
+ "type": "boolean",
1397
+ "char": "h",
1398
+ "description": "Show CLI help.",
1399
+ "allowNo": false
1400
+ },
1401
+ "enterpriseCode": {
1402
+ "name": "enterpriseCode",
1403
+ "type": "option",
1404
+ "char": "e",
1405
+ "description": "Code (name) of the enterprise to deploy",
1406
+ "required": false,
1407
+ "multiple": false
1408
+ },
1409
+ "cabinetName": {
1410
+ "name": "cabinetName",
1411
+ "type": "option",
1412
+ "char": "c",
1413
+ "description": "Target cabinet name you want deploy",
1414
+ "required": false,
1415
+ "multiple": false
1416
+ },
1417
+ "tag": {
1418
+ "name": "tag",
1419
+ "type": "option",
1420
+ "char": "t",
1421
+ "description": "Cabinet tags with which to declare the target cabinet (instead of by name).",
1422
+ "required": false,
1423
+ "multiple": true,
1424
+ "exclusive": [
1425
+ "cabinetName"
1426
+ ]
1427
+ },
1428
+ "tagMatch": {
1429
+ "name": "tagMatch",
1430
+ "type": "option",
1431
+ "char": "m",
1432
+ "description": "(Optional: Defaults to any) Declares the logic that will be used to select cabinets from the given tags.",
1433
+ "required": false,
1434
+ "multiple": false,
1435
+ "options": [
1436
+ "any",
1437
+ "all",
1438
+ "none"
1439
+ ],
1440
+ "dependsOn": [
1441
+ "tag"
1442
+ ]
1443
+ },
1444
+ "asset": {
1445
+ "name": "asset",
1446
+ "type": "option",
1447
+ "char": "a",
1448
+ "description": "Search string for the name of the asset to deploy (use ? or ?? to be prompted).",
1449
+ "required": false,
1450
+ "multiple": false
1451
+ },
1452
+ "version": {
1453
+ "name": "version",
1454
+ "type": "option",
1455
+ "char": "u",
1456
+ "description": "Search string for the version of the asset to deploy (use ? or ?? to be prompted).",
1457
+ "required": false,
1458
+ "multiple": false,
1459
+ "dependsOn": [
1460
+ "asset"
1461
+ ]
1462
+ },
1463
+ "providerUserName": {
1464
+ "name": "providerUserName",
1465
+ "type": "option",
1466
+ "char": "n",
1467
+ "description": "OPTIONAL: For silent/scripted calls, bring cloud creds to auth against",
1468
+ "required": false,
1469
+ "multiple": false
1470
+ },
1471
+ "providerPassword": {
1472
+ "name": "providerPassword",
1473
+ "type": "option",
1474
+ "char": "p",
1475
+ "description": "OPTIONAL: For silent/scripted calls, bring cloud creds to auth against",
1476
+ "required": false,
1477
+ "multiple": false
1478
+ },
1479
+ "silent": {
1480
+ "name": "silent",
1481
+ "type": "boolean",
1482
+ "description": "Non-Interactive mode; executes without any user interaction and fails on any missing or invalid arguments.",
1483
+ "allowNo": false,
1484
+ "exclusive": [
1485
+ "echo",
1486
+ "to-script"
1487
+ ]
1488
+ },
1489
+ "echo": {
1490
+ "name": "echo",
1491
+ "type": "boolean",
1492
+ "description": "Echo interaction mode; renders the equivalent non-interactive cli command for future use before final execution.",
1493
+ "allowNo": false,
1494
+ "exclusive": [
1495
+ "to-script",
1496
+ "silent"
1497
+ ]
1498
+ },
1499
+ "to-script": {
1500
+ "name": "to-script",
1501
+ "type": "boolean",
1502
+ "description": "Toscript interaction mode; renders the equivalent non-interactive cli command WITHOUT any execution.",
1503
+ "allowNo": false,
1504
+ "exclusive": [
1505
+ "echo",
1506
+ "silent"
1507
+ ]
1508
+ },
1509
+ "take-defaults": {
1510
+ "name": "take-defaults",
1511
+ "type": "boolean",
1512
+ "description": "Setting this to true prevents prompting for confirmation on parameters that were passed in or were automatically set to default values (Irrelevant in --silent mode). This behavior does NOT apply to scenarios that the command needs to override invalid user input; such cases will always prompt for confirmation. eg: when no argument was provided for file or type, and only one exists, the system will render the autoselected file unless this flag is set.",
1513
+ "allowNo": false,
1514
+ "exclusive": [
1515
+ "silent"
1516
+ ]
1517
+ }
1518
+ },
1519
+ "args": {},
1520
+ "dependsOn": [
1521
+ "enterpriseCode",
1522
+ "cabinetName"
1523
+ ]
1524
+ },
1357
1525
  "asset:destroy": {
1358
1526
  "id": "asset:destroy",
1359
1527
  "description": "UN-deploys a given asset from a given cabinet. Defaults to removing only the pod deployments and leaving the service in place; set the --scorch argument to remove the service.",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@codiac.io/codiac-cli",
3
- "description": "Local command line interface for registering and maintaining enterprise assets and pipelines",
4
- "version": "1.2.236",
3
+ "description": "Local command line interface for managing enterprise assets and environments",
4
+ "version": "1.2.248",
5
5
  "author": "Codiac",
6
6
  "bin": {
7
7
  "codiac": "./bin/run",
@@ -16,7 +16,7 @@
16
16
  "upgrade-toyhauler": "npm uninstall toyhauler-api-client && npm install toyhauler-auth-client@latest && npm uninstall toyhauler-auth-client && npm install toyhauler-auth-client@latest && npm uninstall @codiac.io/codiac-common && npm install @codiac.io/codiac-common@latest && npm uninstall toyhauler-domain && npm install toyhauler-domain@latest",
17
17
  "auto-commit": "git add -A && git commit -m 'publish [skip ci]' && git push origin HEAD:master",
18
18
  "increment": "npm version prerelease -m 'v %s [skip ci]' && cp package.json package-lock.json ./dist",
19
- "generate-manifest": "oclif manifest",
19
+ "generate-manifest": "oclif manifest --jit",
20
20
  "clear-manifest": "rm -rf oclif.manifest.json",
21
21
  "clear-build-output": "rm -rf ./dist ./tsconfig.tsbuildinfo ./oclif.manifest.json",
22
22
  "build": "node node_modules/typescript/bin/tsc -v && node node_modules/typescript/bin/tsc && npm run generate-manifest",
@@ -30,21 +30,22 @@
30
30
  "@codiac.io/api-client-base": "^1.1.15",
31
31
  "@codiac.io/cli-tools": "^1.1.10",
32
32
  "@codiac.io/codiac-common": "^1.1.76",
33
- "@codiac.io/codiac-domain": "^1.3.28",
33
+ "@codiac.io/codiac-domain": "^1.3.31",
34
34
  "@codiac.io/codiac-ops-common": "^1.1.87",
35
35
  "@codiac.io/codiac-relay-contracts": "^1.2.17",
36
36
  "@codiac.io/jwt-lib": "^1.1.6",
37
37
  "@codiac.io/relay-client": "^1.2.44",
38
- "@kubernetes/client-node": "^0.17.0",
38
+ "@kubernetes/client-node": "^0.20.0",
39
39
  "@oclif/core": "2.8.6",
40
40
  "@oclif/plugin-autocomplete": "^1.4.6",
41
41
  "@oclif/plugin-help": "^5.2.10",
42
- "@oclif/plugin-update": "^3.1.21",
42
+ "@oclif/plugin-update": "^3.2.4",
43
43
  "@oclif/plugin-version": "^1.3.5",
44
44
  "@types/ini": "^1.3.31",
45
45
  "@types/json-stringify-safe": "^5.0.0",
46
46
  "@types/request-promise": "^4.1.48",
47
47
  "@types/rimraf": "^3.0.2",
48
+ "@types/ws": "^8.5.10",
48
49
  "case": "^1.6.3",
49
50
  "chalk": "^4.1.2",
50
51
  "comment-json": "^4.2.3",
@@ -76,6 +77,7 @@
76
77
  "select-files-cli": "0.0.4",
77
78
  "split-cmd": "^1.0.1",
78
79
  "url-pattern": "^1.0.3",
80
+ "ws": "^7.4.6",
79
81
  "yaml": "^1.10.2"
80
82
  },
81
83
  "devDependencies": {
@@ -132,6 +134,10 @@
132
134
  "license": "ISC",
133
135
  "main": "dist/index.js",
134
136
  "oclif": {
137
+ "binAliases": [
138
+ "cod"
139
+ ],
140
+ "dirname": "codiac",
135
141
  "default": ".",
136
142
  "commands": "./dist/commands",
137
143
  "topicSeparator": " ",
@@ -142,12 +148,19 @@
142
148
  "-v"
143
149
  ],
144
150
  "bin": "codiac",
151
+ "nsisCustomization": "./installer-win.nsi",
145
152
  "plugins": [
146
153
  "@oclif/plugin-help",
147
154
  "@oclif/plugin-version",
148
155
  "@oclif/plugin-autocomplete",
149
156
  "@oclif/plugin-update"
150
- ]
157
+ ],
158
+ "update": {
159
+ "s3": {
160
+ "bucket": "installers-for-cli",
161
+ "host": "https://installers-for-cli.s3.amazonaws.com"
162
+ }
163
+ }
151
164
  },
152
165
  "repository": "codiac/codiac-cli",
153
166
  "types": "dist/index.d.ts"