@codiac.io/codiac-cli 1.3.144 → 1.3.145
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/command-base-exec.js +70 -64
- package/dist/command-base-exec.js.map +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ $ npm install -g @codiac.io/codiac-cli
|
|
|
21
21
|
$ codiac COMMAND
|
|
22
22
|
running command...
|
|
23
23
|
$ codiac (--version|-v)
|
|
24
|
-
@codiac.io/codiac-cli/1.3.
|
|
24
|
+
@codiac.io/codiac-cli/1.3.145 linux-x64 node-v22.15.1
|
|
25
25
|
$ codiac --help [COMMAND]
|
|
26
26
|
USAGE
|
|
27
27
|
$ codiac COMMAND
|
|
@@ -7,6 +7,8 @@ const command_base_enterprise_1 = require("./command-base-enterprise");
|
|
|
7
7
|
const config_ui_utils_1 = require("./uilogic/config-ui-utils");
|
|
8
8
|
const _ = require("lodash");
|
|
9
9
|
const ops_1 = require("./ops");
|
|
10
|
+
const rxjs_1 = require("rxjs");
|
|
11
|
+
const operators_1 = require("rxjs/operators");
|
|
10
12
|
class CommandBaseExec extends command_base_enterprise_1.CommandBaseEnterprise {
|
|
11
13
|
constructor() {
|
|
12
14
|
var _a, _b;
|
|
@@ -17,73 +19,77 @@ class CommandBaseExec extends command_base_enterprise_1.CommandBaseEnterprise {
|
|
|
17
19
|
run() {
|
|
18
20
|
var _a;
|
|
19
21
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
try {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// 4. EXECUTE THE MAIN TASK
|
|
66
|
-
yield this.executeTask(candidate);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
22
|
+
// try {
|
|
23
|
+
this.bootstrap();
|
|
24
|
+
yield this.readStdin();
|
|
25
|
+
(_a = this._relayContainer) === null || _a === void 0 ? void 0 : _a.ready$.pipe(
|
|
26
|
+
// timeout(600000), // Fail if no emission in 10 minutes
|
|
27
|
+
(0, operators_1.tap)((ready) => this.logger.debug(`ready$ emitted: ${ready}`)), (0, operators_1.concatMap)((ready) => (0, rxjs_1.from)((() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
this.logger.debug(`Relay container ready: ${ready}`);
|
|
29
|
+
// 0. SET DEFAULTS
|
|
30
|
+
this._userCntx = yield this.establishTenantContext(this._userCntx);
|
|
31
|
+
// 1. CAPTURE ARGS
|
|
32
|
+
let [partial, interactionMode, takeDefaults] = yield this.captureArgs(); // TODO: Do this before setting any context. (not required bc there's no overriding tenant context, but better design nonetheless).
|
|
33
|
+
// In silent mode, prevent user interaction and tui styling
|
|
34
|
+
if (interactionMode === config_ui_utils_1.InteractionModes.silent) {
|
|
35
|
+
this.ioc.rebind(ops_1.INTERFACES_CLI.IUserInputProvider).to(ops_1.ThrowingUserInputProvider);
|
|
36
|
+
this.__ui = undefined; // invoke a new lazy load | new ThrowingUserInputProvider(this.logger);
|
|
37
|
+
this.ioc.rebind(ops_1.INTERFACES_CLI.IOutputStyler).to(ops_1.NoStyleOutputStyler);
|
|
38
|
+
this.__styler = undefined; // invoke a new lazy load | new NoStyleOutputStyler();
|
|
39
|
+
}
|
|
40
|
+
// 2. ACQUIRE INPUT
|
|
41
|
+
let rootMap = yield this.getRootMap(); // we're gonna load the entire thing, so we can use it to get everything else.
|
|
42
|
+
let enterprise = (yield this.establishEnterpriseContext(rootMap, partial.enterprise, interactionMode)).enterprise;
|
|
43
|
+
partial.enterprise = enterprise.name;
|
|
44
|
+
// TEMPORARY: Trim this down for now to the current enterprise to match legacy conditions
|
|
45
|
+
// (in case any legacy code is doing something stupid like a rootmap.enterprises[0])
|
|
46
|
+
_.remove(rootMap.enterprises, e => e.name != enterprise.name);
|
|
47
|
+
let candidate;
|
|
48
|
+
if (interactionMode == config_ui_utils_1.InteractionModes.silent) {
|
|
49
|
+
candidate = yield this.buildCandidate_silently(partial, rootMap);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
candidate = yield this.buildCandidate_interactively(partial, rootMap, takeDefaults);
|
|
53
|
+
}
|
|
54
|
+
// In case we're hanging waiting for piped-in data that doesnt exist...
|
|
55
|
+
if (!process.stdin.destroyed)
|
|
56
|
+
process.stdin.destroy();
|
|
57
|
+
if (candidate == undefined) {
|
|
58
|
+
this.logger.notice(`Operation cancelled. No work was done.`);
|
|
59
|
+
this._ui.userMessage(`Operation cancelled. No work was done.`);
|
|
60
|
+
process.exit(0);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
// 3. RENDER COMMAND STRING
|
|
64
|
+
if (interactionMode != undefined && [config_ui_utils_1.InteractionModes.echo, config_ui_utils_1.InteractionModes.toscript].includes(interactionMode)) {
|
|
65
|
+
this.cmd = this.buildCommandString(candidate, this.cmd);
|
|
66
|
+
this._ui.userMessage(this.cmd.join(" "));
|
|
69
67
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
68
|
+
if (interactionMode != config_ui_utils_1.InteractionModes.toscript) {
|
|
69
|
+
// 4. EXECUTE THE MAIN TASK
|
|
70
|
+
yield this.executeTask(candidate);
|
|
73
71
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
}
|
|
73
|
+
return ready; // Return ready value if no error
|
|
74
|
+
}))())), (0, operators_1.tap)((ready) => {
|
|
75
|
+
// Send user messages based on ready state
|
|
76
|
+
if (ready) {
|
|
77
|
+
this.logger.debug("Relay container is ready");
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
this.logger.debug("Relay container not ready");
|
|
81
|
+
}
|
|
82
|
+
}), (0, operators_1.catchError)((err) => {
|
|
81
83
|
this.handleError(err);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
return (0, rxjs_1.of)(false);
|
|
85
|
+
}), (0, operators_1.finalize)(() => {
|
|
86
|
+
this.logger.debug("ready$ subscription finalized");
|
|
87
|
+
this.closeConnections().catch((err) => {
|
|
88
|
+
this.logger.error(`Error during dispose: ${err.message}`);
|
|
89
|
+
});
|
|
90
|
+
})).subscribe(_ => {
|
|
91
|
+
this.logger.debug("Subscribing to the relay");
|
|
92
|
+
});
|
|
87
93
|
});
|
|
88
94
|
}
|
|
89
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-base-exec.js","sourceRoot":"","sources":["../src/command-base-exec.ts"],"names":[],"mappings":";;;;AAAA,4BAAyB;AAGzB,uEAAkE;AAClE,+DAA6D;AAC7D,4BAA6B;AAC7B,+BAA0H;
|
|
1
|
+
{"version":3,"file":"command-base-exec.js","sourceRoot":"","sources":["../src/command-base-exec.ts"],"names":[],"mappings":";;;;AAAA,4BAAyB;AAGzB,uEAAkE;AAClE,+DAA6D;AAC7D,4BAA6B;AAC7B,+BAA0H;AAC1H,+BAGc;AACd,8CAMwB;AAQxB,MAAsB,eAAsD,SAAQ,+CAAqB;IAAzG;;;QAEE,2EAA2E;QACjE,QAAG,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