@bemoje/cli 0.0.13 → 0.0.15
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/cjs/arg/ArgumentBuilder.js +0 -8
- package/cjs/arg/ArgumentBuilder.js.map +1 -1
- package/cjs/cmd/CommandBuilder.js +8 -24
- package/cjs/cmd/CommandBuilder.js.map +1 -1
- package/cjs/index.js +0 -28
- package/cjs/index.js.map +1 -1
- package/esm/arg/ArgumentBuilder.js +0 -8
- package/esm/arg/ArgumentBuilder.js.map +1 -1
- package/esm/cmd/CommandBuilder.js +8 -24
- package/esm/cmd/CommandBuilder.js.map +1 -1
- package/esm/index.js +0 -28
- package/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/types/arg/ArgumentBuilder.d.ts +0 -11
- package/types/arg/ArgumentBuilder.d.ts.map +1 -1
- package/types/cmd/CommandBuilder.d.ts +0 -1
- package/types/cmd/CommandBuilder.d.ts.map +1 -1
- package/types/index.d.ts +0 -28
- package/types/index.d.ts.map +1 -1
- package/cjs/prompt/additions/commandSearchPrompt/commandSearchPrompt.js +0 -39
- package/cjs/prompt/additions/commandSearchPrompt/commandSearchPrompt.js.map +0 -1
- package/cjs/prompt/additions/commandSearchPrompt/core/ICommandSearchPromptResult.js +0 -3
- package/cjs/prompt/additions/commandSearchPrompt/core/ICommandSearchPromptResult.js.map +0 -1
- package/cjs/prompt/additions/commandSearchPrompt/core/createCommandSearchPromptObject.js +0 -34
- package/cjs/prompt/additions/commandSearchPrompt/core/createCommandSearchPromptObject.js.map +0 -1
- package/cjs/prompt/additions/searchPrompt/core/ISearchPromptChoiceMetaData.js +0 -3
- package/cjs/prompt/additions/searchPrompt/core/ISearchPromptChoiceMetaData.js.map +0 -1
- package/cjs/prompt/additions/searchPrompt/core/ISearchPromptMetaData.js +0 -3
- package/cjs/prompt/additions/searchPrompt/core/ISearchPromptMetaData.js.map +0 -1
- package/cjs/prompt/additions/searchPrompt/core/ISearchPromptOptions.js +0 -3
- package/cjs/prompt/additions/searchPrompt/core/ISearchPromptOptions.js.map +0 -1
- package/cjs/prompt/additions/searchPrompt/core/ISearchPromptResult.js +0 -3
- package/cjs/prompt/additions/searchPrompt/core/ISearchPromptResult.js.map +0 -1
- package/cjs/prompt/additions/searchPrompt/core/PROMPT_META_DATA.js +0 -5
- package/cjs/prompt/additions/searchPrompt/core/PROMPT_META_DATA.js.map +0 -1
- package/cjs/prompt/additions/searchPrompt/core/createSearchPromptObject.js +0 -177
- package/cjs/prompt/additions/searchPrompt/core/createSearchPromptObject.js.map +0 -1
- package/cjs/prompt/additions/searchPrompt/core/getSearchPromptMetaData.js +0 -12
- package/cjs/prompt/additions/searchPrompt/core/getSearchPromptMetaData.js.map +0 -1
- package/cjs/prompt/additions/searchPrompt/searchPrompt.js +0 -37
- package/cjs/prompt/additions/searchPrompt/searchPrompt.js.map +0 -1
- package/cjs/prompt/core/AbstractUserPrompt.js +0 -88
- package/cjs/prompt/core/AbstractUserPrompt.js.map +0 -1
- package/cjs/prompt/core/AutoCompleteMultiSelectPrompt.js +0 -90
- package/cjs/prompt/core/AutoCompleteMultiSelectPrompt.js.map +0 -1
- package/cjs/prompt/core/AutocompletePrompt.js +0 -111
- package/cjs/prompt/core/AutocompletePrompt.js.map +0 -1
- package/cjs/prompt/core/ConfirmPrompt.js +0 -34
- package/cjs/prompt/core/ConfirmPrompt.js.map +0 -1
- package/cjs/prompt/core/DatePrompt.js +0 -58
- package/cjs/prompt/core/DatePrompt.js.map +0 -1
- package/cjs/prompt/core/InvisiblePrompt.js +0 -49
- package/cjs/prompt/core/InvisiblePrompt.js.map +0 -1
- package/cjs/prompt/core/ListPrompt.js +0 -56
- package/cjs/prompt/core/ListPrompt.js.map +0 -1
- package/cjs/prompt/core/MultiSelectPrompt.js +0 -90
- package/cjs/prompt/core/MultiSelectPrompt.js.map +0 -1
- package/cjs/prompt/core/NumberPrompt.js +0 -70
- package/cjs/prompt/core/NumberPrompt.js.map +0 -1
- package/cjs/prompt/core/PasswordPrompt.js +0 -49
- package/cjs/prompt/core/PasswordPrompt.js.map +0 -1
- package/cjs/prompt/core/SearchPrompt.js +0 -112
- package/cjs/prompt/core/SearchPrompt.js.map +0 -1
- package/cjs/prompt/core/SelectPrompt.js +0 -62
- package/cjs/prompt/core/SelectPrompt.js.map +0 -1
- package/cjs/prompt/core/TextPrompt.js +0 -49
- package/cjs/prompt/core/TextPrompt.js.map +0 -1
- package/cjs/prompt/core/TogglePrompt.js +0 -48
- package/cjs/prompt/core/TogglePrompt.js.map +0 -1
- package/cjs/prompt/core/types.js +0 -3
- package/cjs/prompt/core/types.js.map +0 -1
- package/cjs/prompt/example.js +0 -117
- package/cjs/prompt/example.js.map +0 -1
- package/cjs/prompt/prompt.js +0 -62
- package/cjs/prompt/prompt.js.map +0 -1
- package/esm/prompt/additions/commandSearchPrompt/commandSearchPrompt.js +0 -32
- package/esm/prompt/additions/commandSearchPrompt/commandSearchPrompt.js.map +0 -1
- package/esm/prompt/additions/commandSearchPrompt/core/ICommandSearchPromptResult.js +0 -2
- package/esm/prompt/additions/commandSearchPrompt/core/ICommandSearchPromptResult.js.map +0 -1
- package/esm/prompt/additions/commandSearchPrompt/core/createCommandSearchPromptObject.js +0 -27
- package/esm/prompt/additions/commandSearchPrompt/core/createCommandSearchPromptObject.js.map +0 -1
- package/esm/prompt/additions/searchPrompt/core/ISearchPromptChoiceMetaData.js +0 -2
- package/esm/prompt/additions/searchPrompt/core/ISearchPromptChoiceMetaData.js.map +0 -1
- package/esm/prompt/additions/searchPrompt/core/ISearchPromptMetaData.js +0 -2
- package/esm/prompt/additions/searchPrompt/core/ISearchPromptMetaData.js.map +0 -1
- package/esm/prompt/additions/searchPrompt/core/ISearchPromptOptions.js +0 -2
- package/esm/prompt/additions/searchPrompt/core/ISearchPromptOptions.js.map +0 -1
- package/esm/prompt/additions/searchPrompt/core/ISearchPromptResult.js +0 -2
- package/esm/prompt/additions/searchPrompt/core/ISearchPromptResult.js.map +0 -1
- package/esm/prompt/additions/searchPrompt/core/PROMPT_META_DATA.js +0 -2
- package/esm/prompt/additions/searchPrompt/core/PROMPT_META_DATA.js.map +0 -1
- package/esm/prompt/additions/searchPrompt/core/createSearchPromptObject.js +0 -173
- package/esm/prompt/additions/searchPrompt/core/createSearchPromptObject.js.map +0 -1
- package/esm/prompt/additions/searchPrompt/core/getSearchPromptMetaData.js +0 -8
- package/esm/prompt/additions/searchPrompt/core/getSearchPromptMetaData.js.map +0 -1
- package/esm/prompt/additions/searchPrompt/searchPrompt.js +0 -30
- package/esm/prompt/additions/searchPrompt/searchPrompt.js.map +0 -1
- package/esm/prompt/core/AbstractUserPrompt.js +0 -81
- package/esm/prompt/core/AbstractUserPrompt.js.map +0 -1
- package/esm/prompt/core/AutoCompleteMultiSelectPrompt.js +0 -86
- package/esm/prompt/core/AutoCompleteMultiSelectPrompt.js.map +0 -1
- package/esm/prompt/core/AutocompletePrompt.js +0 -107
- package/esm/prompt/core/AutocompletePrompt.js.map +0 -1
- package/esm/prompt/core/ConfirmPrompt.js +0 -30
- package/esm/prompt/core/ConfirmPrompt.js.map +0 -1
- package/esm/prompt/core/DatePrompt.js +0 -54
- package/esm/prompt/core/DatePrompt.js.map +0 -1
- package/esm/prompt/core/InvisiblePrompt.js +0 -45
- package/esm/prompt/core/InvisiblePrompt.js.map +0 -1
- package/esm/prompt/core/ListPrompt.js +0 -52
- package/esm/prompt/core/ListPrompt.js.map +0 -1
- package/esm/prompt/core/MultiSelectPrompt.js +0 -86
- package/esm/prompt/core/MultiSelectPrompt.js.map +0 -1
- package/esm/prompt/core/NumberPrompt.js +0 -66
- package/esm/prompt/core/NumberPrompt.js.map +0 -1
- package/esm/prompt/core/PasswordPrompt.js +0 -45
- package/esm/prompt/core/PasswordPrompt.js.map +0 -1
- package/esm/prompt/core/SearchPrompt.js +0 -108
- package/esm/prompt/core/SearchPrompt.js.map +0 -1
- package/esm/prompt/core/SelectPrompt.js +0 -58
- package/esm/prompt/core/SelectPrompt.js.map +0 -1
- package/esm/prompt/core/TextPrompt.js +0 -45
- package/esm/prompt/core/TextPrompt.js.map +0 -1
- package/esm/prompt/core/TogglePrompt.js +0 -44
- package/esm/prompt/core/TogglePrompt.js.map +0 -1
- package/esm/prompt/core/types.js +0 -2
- package/esm/prompt/core/types.js.map +0 -1
- package/esm/prompt/example.js +0 -112
- package/esm/prompt/example.js.map +0 -1
- package/esm/prompt/prompt.js +0 -59
- package/esm/prompt/prompt.js.map +0 -1
- package/types/prompt/additions/commandSearchPrompt/commandSearchPrompt.d.ts +0 -21
- package/types/prompt/additions/commandSearchPrompt/commandSearchPrompt.d.ts.map +0 -1
- package/types/prompt/additions/commandSearchPrompt/core/ICommandSearchPromptResult.d.ts +0 -5
- package/types/prompt/additions/commandSearchPrompt/core/ICommandSearchPromptResult.d.ts.map +0 -1
- package/types/prompt/additions/commandSearchPrompt/core/createCommandSearchPromptObject.d.ts +0 -13
- package/types/prompt/additions/commandSearchPrompt/core/createCommandSearchPromptObject.d.ts.map +0 -1
- package/types/prompt/additions/searchPrompt/core/ISearchPromptChoiceMetaData.d.ts +0 -5
- package/types/prompt/additions/searchPrompt/core/ISearchPromptChoiceMetaData.d.ts.map +0 -1
- package/types/prompt/additions/searchPrompt/core/ISearchPromptMetaData.d.ts +0 -9
- package/types/prompt/additions/searchPrompt/core/ISearchPromptMetaData.d.ts.map +0 -1
- package/types/prompt/additions/searchPrompt/core/ISearchPromptOptions.d.ts +0 -44
- package/types/prompt/additions/searchPrompt/core/ISearchPromptOptions.d.ts.map +0 -1
- package/types/prompt/additions/searchPrompt/core/ISearchPromptResult.d.ts +0 -6
- package/types/prompt/additions/searchPrompt/core/ISearchPromptResult.d.ts.map +0 -1
- package/types/prompt/additions/searchPrompt/core/PROMPT_META_DATA.d.ts +0 -4
- package/types/prompt/additions/searchPrompt/core/PROMPT_META_DATA.d.ts.map +0 -1
- package/types/prompt/additions/searchPrompt/core/createSearchPromptObject.d.ts +0 -13
- package/types/prompt/additions/searchPrompt/core/createSearchPromptObject.d.ts.map +0 -1
- package/types/prompt/additions/searchPrompt/core/getSearchPromptMetaData.d.ts +0 -4
- package/types/prompt/additions/searchPrompt/core/getSearchPromptMetaData.d.ts.map +0 -1
- package/types/prompt/additions/searchPrompt/searchPrompt.d.ts +0 -21
- package/types/prompt/additions/searchPrompt/searchPrompt.d.ts.map +0 -1
- package/types/prompt/core/AbstractUserPrompt.d.ts +0 -55
- package/types/prompt/core/AbstractUserPrompt.d.ts.map +0 -1
- package/types/prompt/core/AutoCompleteMultiSelectPrompt.d.ts +0 -54
- package/types/prompt/core/AutoCompleteMultiSelectPrompt.d.ts.map +0 -1
- package/types/prompt/core/AutocompletePrompt.d.ts +0 -66
- package/types/prompt/core/AutocompletePrompt.d.ts.map +0 -1
- package/types/prompt/core/ConfirmPrompt.d.ts +0 -21
- package/types/prompt/core/ConfirmPrompt.d.ts.map +0 -1
- package/types/prompt/core/DatePrompt.d.ts +0 -37
- package/types/prompt/core/DatePrompt.d.ts.map +0 -1
- package/types/prompt/core/InvisiblePrompt.d.ts +0 -30
- package/types/prompt/core/InvisiblePrompt.d.ts.map +0 -1
- package/types/prompt/core/ListPrompt.d.ts +0 -34
- package/types/prompt/core/ListPrompt.d.ts.map +0 -1
- package/types/prompt/core/MultiSelectPrompt.d.ts +0 -54
- package/types/prompt/core/MultiSelectPrompt.d.ts.map +0 -1
- package/types/prompt/core/NumberPrompt.d.ts +0 -42
- package/types/prompt/core/NumberPrompt.d.ts.map +0 -1
- package/types/prompt/core/PasswordPrompt.d.ts +0 -30
- package/types/prompt/core/PasswordPrompt.d.ts.map +0 -1
- package/types/prompt/core/SearchPrompt.d.ts +0 -71
- package/types/prompt/core/SearchPrompt.d.ts.map +0 -1
- package/types/prompt/core/SelectPrompt.d.ts +0 -38
- package/types/prompt/core/SelectPrompt.d.ts.map +0 -1
- package/types/prompt/core/TextPrompt.d.ts +0 -30
- package/types/prompt/core/TextPrompt.d.ts.map +0 -1
- package/types/prompt/core/TogglePrompt.d.ts +0 -29
- package/types/prompt/core/TogglePrompt.d.ts.map +0 -1
- package/types/prompt/core/types.d.ts +0 -215
- package/types/prompt/core/types.d.ts.map +0 -1
- package/types/prompt/example.d.ts +0 -2
- package/types/prompt/example.d.ts.map +0 -1
- package/types/prompt/prompt.d.ts +0 -33
- package/types/prompt/prompt.d.ts.map +0 -1
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { AbstractUserPrompt } from './AbstractUserPrompt';
|
|
2
|
-
/**
|
|
3
|
-
* Interactive date user prompts in the terminal.
|
|
4
|
-
*/
|
|
5
|
-
export class DatePrompt extends AbstractUserPrompt {
|
|
6
|
-
/**
|
|
7
|
-
* @param type - The type of prompt
|
|
8
|
-
* @param message - The message to display to the user
|
|
9
|
-
*/
|
|
10
|
-
constructor(name, message, callback) {
|
|
11
|
-
super('date', name, message);
|
|
12
|
-
if (callback)
|
|
13
|
-
callback(this);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* On render callback. Keyword this refers to the current prompt
|
|
17
|
-
*/
|
|
18
|
-
onRender(onRender) {
|
|
19
|
-
this.data['onRender'] = onRender;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Default value
|
|
24
|
-
*/
|
|
25
|
-
initial(initial) {
|
|
26
|
-
this.data['initial'] = initial;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Receive user input. Should return true if the value is valid, and an error message String otherwise.
|
|
31
|
-
* If false is returned, a default error message is shown
|
|
32
|
-
*/
|
|
33
|
-
validate(validate) {
|
|
34
|
-
this.data['validate'] = validate;
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Use to define custom locales. See below for an example.
|
|
39
|
-
* More info: https://github.com/terkelg/prompts/wiki/Date-Time-Formatting
|
|
40
|
-
*/
|
|
41
|
-
locales(locales) {
|
|
42
|
-
this.data['locales'] = locales;
|
|
43
|
-
return this;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* The format mask of the date. See below for more information.
|
|
47
|
-
* More info: https://github.com/terkelg/prompts/wiki/Date-Time-Formatting
|
|
48
|
-
*/
|
|
49
|
-
mask(mask = 'YYYY-MM-DD HH:mm:ss') {
|
|
50
|
-
this.data['mask'] = mask;
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=DatePrompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DatePrompt.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/prompt/core/DatePrompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAKzD;;GAEG;AACH,MAAM,OAAO,UAAkC,SAAQ,kBAAkC;IACvF;;;OAGG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,QAAwC;QACjF,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,QAAQ;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,QAAmB;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAU;QAChB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,QAAsB;QAC7B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;OAGG;IACH,OAAO,CAAC,OAAqC;QAC3C,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAc,CAAA;QACrC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;OAGG;IACH,IAAI,CAAC,IAAI,GAAG,qBAAqB;QAC/B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;QACxB,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { AbstractUserPrompt } from './AbstractUserPrompt';
|
|
2
|
-
/**
|
|
3
|
-
* Interactive invisible user prompts in the terminal.
|
|
4
|
-
*/
|
|
5
|
-
export class InvisiblePrompt extends AbstractUserPrompt {
|
|
6
|
-
/**
|
|
7
|
-
* @param type - The type of prompt
|
|
8
|
-
* @param message - The message to display to the user
|
|
9
|
-
*/
|
|
10
|
-
constructor(name, message, callback) {
|
|
11
|
-
super('invisible', name, message);
|
|
12
|
-
if (callback)
|
|
13
|
-
callback(this);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* On render callback. Keyword this refers to the current prompt
|
|
17
|
-
*/
|
|
18
|
-
onRender(onRender) {
|
|
19
|
-
this.data['onRender'] = onRender;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Default value
|
|
24
|
-
*/
|
|
25
|
-
initial(initial) {
|
|
26
|
-
this.data['initial'] = initial;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Receive user input. The returned value will be added to the response object
|
|
31
|
-
*/
|
|
32
|
-
format(format) {
|
|
33
|
-
this.data['format'] = format;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Receive user input. Should return true if the value is valid, and an error message String otherwise.
|
|
38
|
-
* If false is returned, a default error message is shown
|
|
39
|
-
*/
|
|
40
|
-
validate(validate) {
|
|
41
|
-
this.data['validate'] = validate;
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=InvisiblePrompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InvisiblePrompt.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/prompt/core/InvisiblePrompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD;;GAEG;AACH,MAAM,OAAO,eAA2C,SAAQ,kBAAuC;IACrG;;;OAGG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,QAA6C;QACtF,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QACjC,IAAI,QAAQ;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,QAAmB;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAU;QAChB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAkB;QACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,QAAsB;QAC7B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { AbstractUserPrompt } from './AbstractUserPrompt';
|
|
2
|
-
/**
|
|
3
|
-
* Interactive list user prompts in the terminal.
|
|
4
|
-
*/
|
|
5
|
-
export class ListPrompt extends AbstractUserPrompt {
|
|
6
|
-
/**
|
|
7
|
-
* @param type - The type of prompt
|
|
8
|
-
* @param message - The message to display to the user
|
|
9
|
-
*/
|
|
10
|
-
constructor(name, message, callback) {
|
|
11
|
-
super('list', name, message);
|
|
12
|
-
if (callback)
|
|
13
|
-
callback(this);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* On render callback. Keyword this refers to the current prompt
|
|
17
|
-
*/
|
|
18
|
-
onRender(onRender) {
|
|
19
|
-
this.data['onRender'] = onRender;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Default value
|
|
24
|
-
*/
|
|
25
|
-
initial(initial) {
|
|
26
|
-
this.data['initial'] = initial;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* String separator. Will trim all white-spaces from start and end of string. Defaults to ','
|
|
31
|
-
*/
|
|
32
|
-
separator(separator) {
|
|
33
|
-
this.data['separator'] = separator;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Receive user input. Should return true if the value is valid, and an error message String otherwise.
|
|
38
|
-
* If false is returned, a default error message is shown
|
|
39
|
-
*/
|
|
40
|
-
validate(validate) {
|
|
41
|
-
this.data['validate'] = validate;
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Render style
|
|
46
|
-
*/
|
|
47
|
-
style(style = 'default') {
|
|
48
|
-
this.data['style'] = style;
|
|
49
|
-
return this;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=ListPrompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ListPrompt.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/prompt/core/ListPrompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAGzD;;GAEG;AACH,MAAM,OAAO,UAAsC,SAAQ,kBAAkC;IAC3F;;;OAGG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,QAAwC;QACjF,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,QAAQ;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,QAAmB;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAU;QAChB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,SAAiB;QACzB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,SAAS,CAAA;QAClC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,QAAsB;QAC7B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAgB,SAAS;QAC7B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { AbstractUserPrompt } from './AbstractUserPrompt';
|
|
2
|
-
/**
|
|
3
|
-
* Interactive multiselect user prompts in the terminal.
|
|
4
|
-
*/
|
|
5
|
-
export class MultiSelectPrompt extends AbstractUserPrompt {
|
|
6
|
-
/**
|
|
7
|
-
* @param type - The type of prompt
|
|
8
|
-
* @param message - The message to display to the user
|
|
9
|
-
*/
|
|
10
|
-
constructor(name, message, callback) {
|
|
11
|
-
super('multiselect', name, message);
|
|
12
|
-
if (callback)
|
|
13
|
-
callback(this);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* On render callback. Keyword this refers to the current prompt
|
|
17
|
-
*/
|
|
18
|
-
onRender(onRender) {
|
|
19
|
-
this.data['onRender'] = onRender;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Default value
|
|
24
|
-
*/
|
|
25
|
-
initial(initial) {
|
|
26
|
-
this.data['initial'] = initial;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Prompt instructions to display
|
|
31
|
-
*/
|
|
32
|
-
instructions(instructions) {
|
|
33
|
-
this.data['instructions'] = instructions;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Hint to display to the user
|
|
38
|
-
*/
|
|
39
|
-
hint(hint) {
|
|
40
|
-
this.data['hint'] = hint;
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Message to display when selecting a disabled option
|
|
45
|
-
*/
|
|
46
|
-
warn(warn) {
|
|
47
|
-
this.data['warn'] = warn;
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* An array of options/choices for the user to select.
|
|
52
|
-
*/
|
|
53
|
-
choices(choices) {
|
|
54
|
-
this.data['choices'] = choices;
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Number of options displayed per page.
|
|
59
|
-
*/
|
|
60
|
-
optionsPerPage(optionsPerPage = 10) {
|
|
61
|
-
this.data['optionsPerPage'] = optionsPerPage;
|
|
62
|
-
return this;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Minimum number of choices to select - will display error.
|
|
66
|
-
*/
|
|
67
|
-
min(min) {
|
|
68
|
-
this.data['min'] = min;
|
|
69
|
-
return this;
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Maximum number of choices to select
|
|
73
|
-
*/
|
|
74
|
-
max(max) {
|
|
75
|
-
this.data['max'] = max;
|
|
76
|
-
return this;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Receive user input. The returned value will be added to the response object
|
|
80
|
-
*/
|
|
81
|
-
format(format) {
|
|
82
|
-
this.data['format'] = format;
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
//# sourceMappingURL=MultiSelectPrompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelectPrompt.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/prompt/core/MultiSelectPrompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAIzD;;GAEG;AACH,MAAM,OAAO,iBAAgE,SAAQ,kBAEpF;IACC;;;OAGG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,QAA+C;QACxF,KAAK,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QACnC,IAAI,QAAQ;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,QAAmB;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAU;QAChB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,YAAoB;QAC/B,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,YAAY,CAAA;QACxC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,IAAY;QACf,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;QACxB,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,IAAY;QACf,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;QACxB,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAiB;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,cAAc,CAAC,cAAc,GAAG,EAAE;QAChC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,cAAc,CAAA;QAC5C,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,GAAW;QACb,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAA;QACtB,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,GAAG,CAAC,GAAW;QACb,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,CAAA;QACtB,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAkB;QACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { AbstractUserPrompt } from './AbstractUserPrompt';
|
|
2
|
-
/**
|
|
3
|
-
* Interactive numner user prompts in the terminal.
|
|
4
|
-
*/
|
|
5
|
-
export class NumberPrompt extends AbstractUserPrompt {
|
|
6
|
-
/**
|
|
7
|
-
* @param type - The type of prompt
|
|
8
|
-
* @param message - The message to display to the user
|
|
9
|
-
*/
|
|
10
|
-
constructor(name, message, callback) {
|
|
11
|
-
super('number', name, message);
|
|
12
|
-
if (callback)
|
|
13
|
-
callback(this);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* On render callback. Keyword this refers to the current prompt
|
|
17
|
-
*/
|
|
18
|
-
onRender(onRender) {
|
|
19
|
-
this.data['onRender'] = onRender;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Default value
|
|
24
|
-
*/
|
|
25
|
-
initial(initial) {
|
|
26
|
-
this.data['initial'] = initial;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Receive user input. Should return true if the value is valid, and an error message String otherwise.
|
|
31
|
-
* If false is returned, a default error message is shown
|
|
32
|
-
*/
|
|
33
|
-
validate(validate) {
|
|
34
|
-
this.data['validate'] = validate;
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Render style
|
|
39
|
-
*/
|
|
40
|
-
style(style = 'default') {
|
|
41
|
-
this.data['style'] = style;
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Allow floating point inputs.
|
|
46
|
-
*/
|
|
47
|
-
float(float = false) {
|
|
48
|
-
this.data['float'] = float;
|
|
49
|
-
return this;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Round float values to x decimals.
|
|
53
|
-
*/
|
|
54
|
-
round(round = 2) {
|
|
55
|
-
this.data['round'] = round;
|
|
56
|
-
return this;
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Increment step when using arrow keys.
|
|
60
|
-
*/
|
|
61
|
-
increment(increment = 1) {
|
|
62
|
-
this.data['increment'] = increment;
|
|
63
|
-
return this;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=NumberPrompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NumberPrompt.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/prompt/core/NumberPrompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAGzD;;GAEG;AACH,MAAM,OAAO,YAAwC,SAAQ,kBAAoC;IAC/F;;;OAGG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,QAA0C;QACnF,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAC9B,IAAI,QAAQ;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,QAAmB;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAU;QAChB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,QAAsB;QAC7B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAgB,SAAS;QAC7B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,GAAG,KAAK;QACjB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,GAAG,CAAC;QACb,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,SAAS,GAAG,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,SAAS,CAAA;QAClC,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { AbstractUserPrompt } from './AbstractUserPrompt';
|
|
2
|
-
/**
|
|
3
|
-
* Interactive password user prompts in the terminal.
|
|
4
|
-
*/
|
|
5
|
-
export class PasswordPrompt extends AbstractUserPrompt {
|
|
6
|
-
/**
|
|
7
|
-
* @param type - The type of prompt
|
|
8
|
-
* @param message - The message to display to the user
|
|
9
|
-
*/
|
|
10
|
-
constructor(name, message, callback) {
|
|
11
|
-
super('password', name, message);
|
|
12
|
-
if (callback)
|
|
13
|
-
callback(this);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* On render callback. Keyword this refers to the current prompt
|
|
17
|
-
*/
|
|
18
|
-
onRender(onRender) {
|
|
19
|
-
this.data['onRender'] = onRender;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Default value
|
|
24
|
-
*/
|
|
25
|
-
initial(initial) {
|
|
26
|
-
this.data['initial'] = initial;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Receive user input. The returned value will be added to the response object
|
|
31
|
-
*/
|
|
32
|
-
format(format) {
|
|
33
|
-
this.data['format'] = format;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Receive user input. Should return true if the value is valid, and an error message String otherwise.
|
|
38
|
-
* If false is returned, a default error message is shown
|
|
39
|
-
*/
|
|
40
|
-
validate(validate) {
|
|
41
|
-
this.data['validate'] = validate;
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=PasswordPrompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordPrompt.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/prompt/core/PasswordPrompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD;;GAEG;AACH,MAAM,OAAO,cAA0C,SAAQ,kBAAsC;IACnG;;;OAGG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,QAA4C;QACrF,KAAK,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAChC,IAAI,QAAQ;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,QAAmB;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAU;QAChB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAkB;QACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,QAAsB;QAC7B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { AbstractUserPrompt } from './AbstractUserPrompt';
|
|
2
|
-
import { searchPrompt } from '../additions/searchPrompt/searchPrompt';
|
|
3
|
-
/**
|
|
4
|
-
* Interactive autocomplete user prompts in the terminal.
|
|
5
|
-
*/
|
|
6
|
-
export class SearchPrompt extends AbstractUserPrompt {
|
|
7
|
-
/**
|
|
8
|
-
* @param type - The type of prompt
|
|
9
|
-
* @param message - The message to display to the user
|
|
10
|
-
*/
|
|
11
|
-
constructor(name, callback) {
|
|
12
|
-
super('autocomplete', name, '0');
|
|
13
|
-
if (callback)
|
|
14
|
-
callback(this);
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* An array of options/choices for the user to select.
|
|
18
|
-
*/
|
|
19
|
-
choices(data) {
|
|
20
|
-
Object.defineProperty(this.data, 'choices', {
|
|
21
|
-
value: data,
|
|
22
|
-
});
|
|
23
|
-
return this;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Default value
|
|
27
|
-
*/
|
|
28
|
-
initial(initial) {
|
|
29
|
-
this.data['initial'] = initial;
|
|
30
|
-
return this;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* The first ESCAPE keypress will clear the input
|
|
34
|
-
*/
|
|
35
|
-
clearFirst(clearFirst = true) {
|
|
36
|
-
this.data['clearFirst'] = clearFirst;
|
|
37
|
-
return this;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Max number of results to show. Defaults to 25
|
|
41
|
-
*/
|
|
42
|
-
limit(limit = 25) {
|
|
43
|
-
this.data['limit'] = limit;
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* The delimiter to use to split the user input into keywords.
|
|
48
|
-
* Defaults to ' ' (space).
|
|
49
|
-
*/
|
|
50
|
-
separator(delim = ' ') {
|
|
51
|
-
this.data['separator'] = delim;
|
|
52
|
-
return this;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* When this string is encountered, the input coming after will not be considered for searching. Defaults to ':'
|
|
56
|
-
*/
|
|
57
|
-
searchStopSequence(stop) {
|
|
58
|
-
Object.defineProperty(this.data, 'searchStopSequence', { value: stop });
|
|
59
|
-
return this;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Filtering options.
|
|
63
|
-
* @property includes - If true, then the search results will include keyword-matches that match anywhere in the string. Defaults to 'true'
|
|
64
|
-
* @property startsWith - If true, then the search results will include beginning-of-word-matches. Defaults to 'true'
|
|
65
|
-
*/
|
|
66
|
-
filtering(filtering) {
|
|
67
|
-
Object.defineProperty(this.data, 'filtering', { value: filtering });
|
|
68
|
-
return this;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* A function to pre-render each string in the search data before searching has begun.
|
|
72
|
-
* This is useful if the same string formatting will be applied to all returned search results.
|
|
73
|
-
*
|
|
74
|
-
* @param original - The original (or pre-rendered) string.
|
|
75
|
-
*/
|
|
76
|
-
preRender(preRender) {
|
|
77
|
-
Object.defineProperty(this.data, 'preRender', { value: preRender });
|
|
78
|
-
return this;
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* A function to render the search results.
|
|
82
|
-
*
|
|
83
|
-
* @param original - The original (or pre-rendered) string.
|
|
84
|
-
* @param keywords - The keywords that matched the original string.
|
|
85
|
-
*/
|
|
86
|
-
render(render) {
|
|
87
|
-
Object.defineProperty(this.data, 'render', { value: render });
|
|
88
|
-
return this;
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Receive user input. The returned value will be added to the response object
|
|
92
|
-
*/
|
|
93
|
-
format(format) {
|
|
94
|
-
this.data['format'] = format;
|
|
95
|
-
return this;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Render style
|
|
99
|
-
*/
|
|
100
|
-
style(style = 'default') {
|
|
101
|
-
this.data['style'] = style;
|
|
102
|
-
return this;
|
|
103
|
-
}
|
|
104
|
-
async run(options) {
|
|
105
|
-
return await searchPrompt(this.data.choices, this.data, options);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=SearchPrompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchPrompt.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/prompt/core/SearchPrompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAIzD,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAErE;;GAEG;AACH,MAAM,OAAO,YAAwC,SAAQ,kBAA0C;IACrG;;;OAGG;IACH,YAAY,IAAY,EAAE,QAA0C;QAClE,KAAK,CAAC,cAAc,EAAE,IAAI,EAAE,GAAG,CAAC,CAAA;QAChC,IAAI,QAAQ;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,IAAc;QACpB,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE;YAC1C,KAAK,EAAE,IAAI;SACZ,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAU;QAChB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,UAAU,CAAC,UAAU,GAAG,IAAI;QAC1B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,UAAU,CAAA;QACpC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,KAAK,GAAG,EAAE;QACd,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,KAAK,GAAG,GAAG;QACnB,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,KAAK,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,kBAAkB,CAAC,IAAY;QAC7B,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,oBAAoB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAA;QACvE,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;OAIG;IACH,SAAS,CAAC,SAAuD;QAC/D,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;OAKG;IACH,SAAS,CAAC,SAA2C;QACnD,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA;QACnE,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,MAA0D;QAC/D,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;QAC7D,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAkB;QACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAgB,SAAS;QAC7B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;IAEQ,KAAK,CAAC,GAAG,CAAC,OAAiB;QAClC,OAAO,MAAM,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,OAA8B,EAAE,IAAI,CAAC,IAA4B,EAAE,OAAO,CAAC,CAAA;IACjH,CAAC;CACF"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { AbstractUserPrompt } from './AbstractUserPrompt';
|
|
2
|
-
/**
|
|
3
|
-
* Interactive select user prompts in the terminal.
|
|
4
|
-
*/
|
|
5
|
-
export class SelectPrompt extends AbstractUserPrompt {
|
|
6
|
-
/**
|
|
7
|
-
* @param type - The type of prompt
|
|
8
|
-
* @param message - The message to display to the user
|
|
9
|
-
*/
|
|
10
|
-
constructor(name, message, callback) {
|
|
11
|
-
super('select', name, message);
|
|
12
|
-
if (callback)
|
|
13
|
-
callback(this);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* On render callback. Keyword this refers to the current prompt
|
|
17
|
-
*/
|
|
18
|
-
onRender(onRender) {
|
|
19
|
-
this.data['onRender'] = onRender;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Default value
|
|
24
|
-
*/
|
|
25
|
-
initial(initial) {
|
|
26
|
-
this.data['initial'] = initial;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Hint to display to the user
|
|
31
|
-
*/
|
|
32
|
-
hint(hint) {
|
|
33
|
-
this.data['hint'] = hint;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Message to display when selecting a disabled option
|
|
38
|
-
*/
|
|
39
|
-
warn(warn) {
|
|
40
|
-
this.data['warn'] = warn;
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* An array of options/choices for the user to select.
|
|
45
|
-
*/
|
|
46
|
-
choices(choices) {
|
|
47
|
-
this.data['choices'] = choices;
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Receive user input. The returned value will be added to the response object
|
|
52
|
-
*/
|
|
53
|
-
format(format) {
|
|
54
|
-
this.data['format'] = format;
|
|
55
|
-
return this;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=SelectPrompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectPrompt.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/prompt/core/SelectPrompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAIzD;;GAEG;AACH,MAAM,OAAO,YAAwC,SAAQ,kBAAoC;IAC/F;;;OAGG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,QAA0C;QACnF,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAC9B,IAAI,QAAQ;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,QAAmB;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAU;QAChB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,IAAY;QACf,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;QACxB,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,IAAI,CAAC,IAAY;QACf,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAA;QACxB,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAiB;QACvB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,MAAkB;QACvB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { AbstractUserPrompt } from './AbstractUserPrompt';
|
|
2
|
-
/**
|
|
3
|
-
* Interactive text user prompts in the terminal.
|
|
4
|
-
*/
|
|
5
|
-
export class TextPrompt extends AbstractUserPrompt {
|
|
6
|
-
/**
|
|
7
|
-
* @param type - The type of prompt
|
|
8
|
-
* @param message - The message to display to the user
|
|
9
|
-
*/
|
|
10
|
-
constructor(name, message, callback) {
|
|
11
|
-
super('text', name, message);
|
|
12
|
-
if (callback)
|
|
13
|
-
callback(this);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* On render callback. Keyword this refers to the current prompt
|
|
17
|
-
*/
|
|
18
|
-
onRender(onRender) {
|
|
19
|
-
this.data['onRender'] = onRender;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Default value
|
|
24
|
-
*/
|
|
25
|
-
initial(initial) {
|
|
26
|
-
this.data['initial'] = initial;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Receive user input. Should return true if the value is valid, and an error message String otherwise.
|
|
31
|
-
* If false is returned, a default error message is shown
|
|
32
|
-
*/
|
|
33
|
-
validate(validate) {
|
|
34
|
-
this.data['validate'] = validate;
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Render style
|
|
39
|
-
*/
|
|
40
|
-
style(style = 'default') {
|
|
41
|
-
this.data['style'] = style;
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=TextPrompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextPrompt.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/prompt/core/TextPrompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD;;GAEG;AACH,MAAM,OAAO,UAAsC,SAAQ,kBAAkC;IAC3F;;;OAGG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,QAAwC;QACjF,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAC5B,IAAI,QAAQ;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,QAAmB;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAU;QAChB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;OAGG;IACH,QAAQ,CAAC,QAAsB;QAC7B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,QAAgB,SAAS;QAC7B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,CAAA;QAC1B,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { AbstractUserPrompt } from './AbstractUserPrompt';
|
|
2
|
-
/**
|
|
3
|
-
* Interactive toggle user prompts in the terminal.
|
|
4
|
-
*/
|
|
5
|
-
export class TogglePrompt extends AbstractUserPrompt {
|
|
6
|
-
/**
|
|
7
|
-
* @param type - The type of prompt
|
|
8
|
-
* @param message - The message to display to the user
|
|
9
|
-
*/
|
|
10
|
-
constructor(name, message, callback) {
|
|
11
|
-
super('toggle', name, message);
|
|
12
|
-
if (callback)
|
|
13
|
-
callback(this);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* On render callback. Keyword this refers to the current prompt
|
|
17
|
-
*/
|
|
18
|
-
onRender(onRender) {
|
|
19
|
-
this.data['onRender'] = onRender;
|
|
20
|
-
return this;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Default value
|
|
24
|
-
*/
|
|
25
|
-
initial(initial) {
|
|
26
|
-
this.data['initial'] = initial;
|
|
27
|
-
return this;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Text for active state. Defaults to 'on'
|
|
31
|
-
*/
|
|
32
|
-
active(active = 'on') {
|
|
33
|
-
this.data['active'] = active;
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Text for inactive state. Defaults to 'off'
|
|
38
|
-
*/
|
|
39
|
-
inactive(inactive = 'off') {
|
|
40
|
-
this.data['inactive'] = inactive;
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=TogglePrompt.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TogglePrompt.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/prompt/core/TogglePrompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAGzD;;GAEG;AACH,MAAM,OAAO,YAA0C,SAAQ,kBAAoC;IACjG;;;OAGG;IACH,YAAY,IAAY,EAAE,OAAe,EAAE,QAA0C;QACnF,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QAC9B,IAAI,QAAQ;YAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,QAAmB;QAC1B,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,OAAO,CAAC,OAAU;QAChB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAA;QAC9B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,SAAkB,IAAI;QAC3B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAA;QAC5B,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;OAEG;IACH,QAAQ,CAAC,WAAsB,KAAK;QAClC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,QAAQ,CAAA;QAChC,OAAO,IAAI,CAAA;IACb,CAAC;CACF"}
|
package/esm/prompt/core/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/cli/src/prompt/core/types.ts"],"names":[],"mappings":""}
|