@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
|
@@ -47,6 +47,8 @@ export declare abstract class commandBase extends Command {
|
|
|
47
47
|
* ```
|
|
48
48
|
*/
|
|
49
49
|
protected abstract bootstrap(): void;
|
|
50
|
+
protected pipedInput: string | undefined;
|
|
51
|
+
protected readStdin(): Promise<void>;
|
|
50
52
|
protected get ioc(): Container;
|
|
51
53
|
private __ioc;
|
|
52
54
|
protected get logger(): IBetterLogger;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.commandBase = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
require("reflect-metadata");
|
|
5
6
|
const inversify_1 = require("inversify");
|
|
6
7
|
const core_1 = require("@oclif/core");
|
|
@@ -16,6 +17,7 @@ const codiac_relay_contracts_1 = require("@codiac.io/codiac-relay-contracts");
|
|
|
16
17
|
const codiac_ops_common_1 = require("@codiac.io/codiac-ops-common");
|
|
17
18
|
const codiac_ops_common_2 = require("@codiac.io/codiac-ops-common");
|
|
18
19
|
const ops_1 = require("../ops");
|
|
20
|
+
const read_stdin_1 = require("../read-stdin");
|
|
19
21
|
const built_in_cli_user_input_1 = require("./built-in-cli-user-input");
|
|
20
22
|
class commandBase extends core_1.Command {
|
|
21
23
|
constructor() {
|
|
@@ -80,6 +82,20 @@ class commandBase extends core_1.Command {
|
|
|
80
82
|
codiac_ops_common_2.OpsCommon.bootstrap(ioc);
|
|
81
83
|
this.isBootstrapped = true;
|
|
82
84
|
}
|
|
85
|
+
readStdin() {
|
|
86
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
return new Promise((resolve, reject) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
try {
|
|
89
|
+
// this.pipedInput = await read(process.stdin);
|
|
90
|
+
this.pipedInput = yield (0, read_stdin_1.default)();
|
|
91
|
+
resolve();
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
reject(err);
|
|
95
|
+
}
|
|
96
|
+
}));
|
|
97
|
+
});
|
|
98
|
+
}
|
|
83
99
|
// ------------------------------------
|
|
84
100
|
// Lazy-loaded properties
|
|
85
101
|
//
|
|
@@ -145,19 +161,18 @@ class commandBase extends core_1.Command {
|
|
|
145
161
|
* Writes the error message appropriately to the console,
|
|
146
162
|
* minding stderr and stdout as required. */
|
|
147
163
|
handleError(err) {
|
|
164
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
148
165
|
if (err.stdout || err.stderr) {
|
|
149
|
-
|
|
150
|
-
this.logger.error(`Operation failed! ${err.message || ""} stdout...`, err.stdout);
|
|
151
|
-
if (err.stderr)
|
|
152
|
-
this.logger.error(`Operation failed! ${err.message || ""} stderr...`, err.stderr);
|
|
166
|
+
this.logger.error(`Operation failed! ${(_a = err.name) !== null && _a !== void 0 ? _a : ""} ${(_b = err.message) !== null && _b !== void 0 ? _b : ""}`, { stdout: err.stdout, stderr: err.stderr, stack: err.stack });
|
|
153
167
|
}
|
|
154
168
|
else {
|
|
155
|
-
this.logger.
|
|
156
|
-
this.
|
|
157
|
-
this._ui.userMessage(`Operation failed! ${err.message || ""}`);
|
|
169
|
+
this.logger.error(`Operation failed! ${(_c = err.name) !== null && _c !== void 0 ? _c : ""} ${(_d = err.message) !== null && _d !== void 0 ? _d : ""}`, err.stack);
|
|
170
|
+
// this._ui.userMessage(`Operation failed! ${err.message || ""}`);
|
|
158
171
|
}
|
|
159
172
|
// need to output stderr for pipelines
|
|
160
|
-
(err
|
|
173
|
+
(err === null || err === void 0 ? void 0 : err.message) ? process.stderr.write(`Operation failed! ${(_e = err.name) !== null && _e !== void 0 ? _e : ""} ${(_f = err.message) !== null && _f !== void 0 ? _f : ""}`) : process.stderr.write("Error, see logs for details");
|
|
174
|
+
// this.exit(err.code ?? 1);
|
|
175
|
+
process.exit((_g = err.code) !== null && _g !== void 0 ? _g : 1);
|
|
161
176
|
}
|
|
162
177
|
}
|
|
163
178
|
exports.commandBase = commandBase;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-base.js","sourceRoot":"","sources":["../../src/cli-common/command-base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command-base.js","sourceRoot":"","sources":["../../src/cli-common/command-base.ts"],"names":[],"mappings":";;;;AAAA,4BAAyB;AACzB,yCAA8D;AAC9D,sCAA2D;AAC3D,iCAAgC;AAChC,yBAAyB;AACzB,iDAAgD;AAChD,qDAAuC;AAEvC,4DAAsD;AACtD,0EAAiG;AACjG,0EAA6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;IAC5G,UAAU,EAAE,YAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,sOAAsO,EAAE,CAAC;IACjR,eAAe,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,WAAW,EAAE,wEAAwE,EAAE,CAAC;IACzH,OAAO,EAAE,YAAK,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAE,qFAAqF,EAAE,CAAC;CAC1I,CAAC"}
|
|
@@ -20,14 +20,24 @@ export declare class CliConstants {
|
|
|
20
20
|
* a user's desire to be prompted with a list from which choose the value(s),
|
|
21
21
|
* instead of entering them manually or taking a default. */
|
|
22
22
|
static readonly PROMPT_ME_DESIGNATOR = "?";
|
|
23
|
+
/** (On Macs) The value provided as input that indicates
|
|
24
|
+
* a user's desire to be prompted with a list from which choose the value(s),
|
|
25
|
+
* instead of entering them manually or taking a default. */
|
|
26
|
+
static readonly PROMPT_ME_DESIGNATOR_MACOS = "??";
|
|
23
27
|
/** The value in a select list prompt designating the user's choice
|
|
24
28
|
* to create a new record instead of selecting from the existing choices.
|
|
25
29
|
* Use this choice when the ui will walk the user through the creation of a new item. */
|
|
26
30
|
static readonly CHOICE_VALUE_FOR_NEW = "** create new **";
|
|
27
31
|
/** The value in a select list prompt designating the user's choice
|
|
32
|
+
* to select "all" instead of an existing choice.
|
|
33
|
+
* Use this choice to prevent a filter being applied for the property. */
|
|
34
|
+
static readonly CHOICE_VALUE_FOR_ALL = "** all **";
|
|
35
|
+
/** The value in a select list prompt designating the user's choice
|
|
28
36
|
* to let the system atuo-create a new record instead of selecting from the existing choices.
|
|
29
37
|
* Use this choice when three is no user interaction for the create. */
|
|
30
38
|
static readonly CHOICE_VALUE_FOR_AUTOCREATE = "** auto-create **";
|
|
39
|
+
/** The "*" glob. */
|
|
40
|
+
static readonly GLOB_FOR_ALL = "*";
|
|
31
41
|
/** The value to provide to an argument that specifies a selection from a list,
|
|
32
42
|
* that when set, will automatically select the first available value without prompting for a selection. */
|
|
33
43
|
static readonly ARGUMENT_VALUE_FOR_ANY = "any";
|
package/dist/codiac-constants.js
CHANGED
|
@@ -25,14 +25,24 @@ CliConstants.USER_CONTEXT_FILENAME = "usercontext.json";
|
|
|
25
25
|
* a user's desire to be prompted with a list from which choose the value(s),
|
|
26
26
|
* instead of entering them manually or taking a default. */
|
|
27
27
|
CliConstants.PROMPT_ME_DESIGNATOR = "?";
|
|
28
|
+
/** (On Macs) The value provided as input that indicates
|
|
29
|
+
* a user's desire to be prompted with a list from which choose the value(s),
|
|
30
|
+
* instead of entering them manually or taking a default. */
|
|
31
|
+
CliConstants.PROMPT_ME_DESIGNATOR_MACOS = "??";
|
|
28
32
|
/** The value in a select list prompt designating the user's choice
|
|
29
33
|
* to create a new record instead of selecting from the existing choices.
|
|
30
34
|
* Use this choice when the ui will walk the user through the creation of a new item. */
|
|
31
35
|
CliConstants.CHOICE_VALUE_FOR_NEW = "** create new **";
|
|
32
36
|
/** The value in a select list prompt designating the user's choice
|
|
37
|
+
* to select "all" instead of an existing choice.
|
|
38
|
+
* Use this choice to prevent a filter being applied for the property. */
|
|
39
|
+
CliConstants.CHOICE_VALUE_FOR_ALL = "** all **";
|
|
40
|
+
/** The value in a select list prompt designating the user's choice
|
|
33
41
|
* to let the system atuo-create a new record instead of selecting from the existing choices.
|
|
34
42
|
* Use this choice when three is no user interaction for the create. */
|
|
35
43
|
CliConstants.CHOICE_VALUE_FOR_AUTOCREATE = "** auto-create **";
|
|
44
|
+
/** The "*" glob. */
|
|
45
|
+
CliConstants.GLOB_FOR_ALL = "*";
|
|
36
46
|
/** The value to provide to an argument that specifies a selection from a list,
|
|
37
47
|
* that when set, will automatically select the first available value without prompting for a selection. */
|
|
38
48
|
CliConstants.ARGUMENT_VALUE_FOR_ANY = "any";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codiac-constants.js","sourceRoot":"","sources":["../src/codiac-constants.ts"],"names":[],"mappings":";;;AAEA,sCAAsC;AACzB,QAAA,oBAAoB,GAAG,4BAA4B,CAAC;AAEjE;iFACiF;AACpE,QAAA,aAAa,GAAG,OAAO,CAAC;AAErC;;iFAEiF;AACpE,QAAA,eAAe,GAAG,SAAS,CAAC;AAGzC;iCACiC;AACpB,QAAA,6BAA6B,GAAG,iBAAiB,CAAC;AAG/D,MAAa,YAAY;;AAAzB,
|
|
1
|
+
{"version":3,"file":"codiac-constants.js","sourceRoot":"","sources":["../src/codiac-constants.ts"],"names":[],"mappings":";;;AAEA,sCAAsC;AACzB,QAAA,oBAAoB,GAAG,4BAA4B,CAAC;AAEjE;iFACiF;AACpE,QAAA,aAAa,GAAG,OAAO,CAAC;AAErC;;iFAEiF;AACpE,QAAA,eAAe,GAAG,SAAS,CAAC;AAGzC;iCACiC;AACpB,QAAA,6BAA6B,GAAG,iBAAiB,CAAC;AAG/D,MAAa,YAAY;;AAAzB,oCA0CC;AAxCC,6DAA6D;AACtC,qCAAwB,GAAG,SAAS,CAAC;AAE5D;wCACwC;AACjB,kCAAqB,GAAG,kBAAkB,CAAC;AAElE;;4DAE4D;AACrC,iCAAoB,GAAG,GAAG,CAAC;AAElD;;4DAE4D;AACrC,uCAA0B,GAAG,IAAI,CAAC;AAEzD;;uFAEuF;AAChE,iCAAoB,GAAG,kBAAkB,CAAC;AAEjE;;wEAEwE;AACjD,iCAAoB,GAAG,WAAW,CAAC;AAE1D;;uEAEuE;AAChD,wCAA2B,GAAG,mBAAmB,CAAC;AAEzE,oBAAoB;AACG,yBAAY,GAAG,GAAG,CAAC;AAG1C;4GAC4G;AACrF,mCAAsB,GAAG,KAAK,CAAC;AAKxD,MAAa,YAAY;;AAAzB,oCAMC;AAJwB,6BAAgB,GAAG,WAAW,CAAC;AAE/B,gCAAmB,GAAG,cAAc,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ScopeLevel } from '@codiac.io/codiac-relay-contracts';
|
|
2
1
|
import { ScopedSetting } from '../../apis/codiac-api/contracts';
|
|
3
2
|
import { CommandBaseEnterprise } from '../../command-base-enterprise';
|
|
3
|
+
import { ConfigUiUtils, SpecialConfigTypes } from '../../uilogic/config-ui-utils';
|
|
4
4
|
/** The value provided as input that indicates
|
|
5
5
|
* a user's desire to be prompted with a list from which choose the value(s),
|
|
6
6
|
* instead of entering them manually or taking a default. */
|
|
@@ -21,24 +21,47 @@ export type ScopedValuePedigree = {
|
|
|
21
21
|
value?: string;
|
|
22
22
|
parent?: ScopedValuePedigree;
|
|
23
23
|
};
|
|
24
|
+
type ScopedSettingCandidate = Omit<ScopedSetting, "setting" | "value"> & {
|
|
25
|
+
configType?: SpecialConfigTypes;
|
|
26
|
+
settings: {
|
|
27
|
+
setting: string;
|
|
28
|
+
value: any;
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
24
31
|
export default class ConfigAdd extends CommandBaseEnterprise {
|
|
25
32
|
static description: string;
|
|
26
33
|
static aliases: string[];
|
|
27
34
|
static flags: {
|
|
28
35
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
29
|
-
setting: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
30
|
-
value: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
31
36
|
enterprise: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
32
|
-
|
|
33
|
-
cabinet: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
37
|
+
asset: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
34
38
|
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
39
|
+
type: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
40
|
+
"enterprise-scope": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
41
|
+
enviro: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
42
|
+
cabinet: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
43
|
+
setting: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
44
|
+
value: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
45
|
+
silent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
46
|
+
echo: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
47
|
+
"to-script": import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
35
48
|
};
|
|
36
|
-
static args: {
|
|
37
|
-
|
|
38
|
-
|
|
49
|
+
static args: {};
|
|
50
|
+
/** CLI Command-line string to rerun this execution as a non-TTY script. */
|
|
51
|
+
private cmd;
|
|
39
52
|
private _appConfig;
|
|
53
|
+
protected get configUtils(): ConfigUiUtils;
|
|
54
|
+
private _configUtils_backer;
|
|
55
|
+
protected bootstrap(): void;
|
|
40
56
|
run(): Promise<void>;
|
|
41
|
-
private
|
|
57
|
+
private captureArgs;
|
|
58
|
+
parseTable(input: string, separator?: string): {
|
|
59
|
+
setting: string;
|
|
60
|
+
value: any;
|
|
61
|
+
}[];
|
|
62
|
+
private buildCandidate_silently;
|
|
63
|
+
private buildCandidate_interactively;
|
|
64
|
+
private buildCommandString;
|
|
42
65
|
private promptForValue;
|
|
43
66
|
/** Returns the recursive parent path of values for the given setting
|
|
44
67
|
* up through the enterprise scope.
|
|
@@ -55,24 +78,13 @@ export default class ConfigAdd extends CommandBaseEnterprise {
|
|
|
55
78
|
private buildCabinetTree;
|
|
56
79
|
/** Truncates the string to the given length with an ellipses as suffix */
|
|
57
80
|
private ellipsis;
|
|
58
|
-
/**
|
|
59
|
-
*
|
|
60
|
-
* Use this inquirer plugin for navigating the object structure:
|
|
61
|
-
* https://github.com/insightfuls/inquirer-tree-prompt
|
|
62
|
-
*
|
|
63
|
-
* See if this file tree selector could be fashioned to do the same:
|
|
64
|
-
* https://github.com/anc95/inquirer-file-tree-selection
|
|
65
|
-
*
|
|
66
|
-
* @param existing
|
|
67
|
-
* @param defaultSetting
|
|
68
|
-
*/
|
|
69
|
-
private promptForSetting;
|
|
70
81
|
/** Copy of this method is in config:view */
|
|
71
82
|
private promptForTargetFile;
|
|
72
83
|
private extractSettingsFromFile;
|
|
73
|
-
|
|
84
|
+
executeTask(candidate: ScopedSettingCandidate): Promise<void>;
|
|
74
85
|
upsertSetting(settingObj: ScopedSetting): Promise<void>;
|
|
75
86
|
writeSetting_local(setting: string, value: any): void;
|
|
76
87
|
/** Retrieves the list of app config settings that are not yet explicitly declared in the app config file itself */
|
|
77
88
|
getAvailableSettings(): Promise<string[]>;
|
|
78
89
|
}
|
|
90
|
+
export {};
|