@bemoje/cli 0.1.25 → 0.1.27

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 (176) hide show
  1. package/cjs/index.d.ts +1 -25
  2. package/cjs/index.d.ts.map +1 -1
  3. package/cjs/index.js +3 -26
  4. package/cjs/index.js.map +1 -1
  5. package/cjs/lib/autostudy.d.ts +2 -0
  6. package/cjs/lib/autostudy.d.ts.map +1 -0
  7. package/cjs/lib/autostudy.js +33 -0
  8. package/cjs/lib/autostudy.js.map +1 -0
  9. package/cjs/lib/core/assertValidOptions.d.ts +3 -0
  10. package/cjs/lib/core/assertValidOptions.d.ts.map +1 -0
  11. package/cjs/lib/core/assertValidOptions.js +32 -0
  12. package/cjs/lib/core/assertValidOptions.js.map +1 -0
  13. package/cjs/lib/core/defaultParams.d.ts +4 -0
  14. package/cjs/lib/core/defaultParams.d.ts.map +1 -0
  15. package/cjs/lib/core/defaultParams.js +18 -0
  16. package/cjs/lib/core/defaultParams.js.map +1 -0
  17. package/cjs/lib/core/ensureEnglish.d.ts +3 -0
  18. package/cjs/lib/core/ensureEnglish.d.ts.map +1 -0
  19. package/cjs/lib/core/ensureEnglish.js +15 -0
  20. package/cjs/lib/core/ensureEnglish.js.map +1 -0
  21. package/cjs/lib/core/pdfParser.d.ts +2 -0
  22. package/cjs/lib/core/pdfParser.d.ts.map +1 -0
  23. package/cjs/lib/core/pdfParser.js +19 -0
  24. package/cjs/lib/core/pdfParser.js.map +1 -0
  25. package/cjs/lib/core/renderMarkdown.d.ts +3 -0
  26. package/cjs/lib/core/renderMarkdown.d.ts.map +1 -0
  27. package/cjs/lib/core/renderMarkdown.js +32 -0
  28. package/cjs/lib/core/renderMarkdown.js.map +1 -0
  29. package/cjs/lib/core/study.d.ts +7 -0
  30. package/cjs/lib/core/study.d.ts.map +1 -0
  31. package/cjs/lib/core/study.js +33 -0
  32. package/cjs/lib/core/study.js.map +1 -0
  33. package/cjs/lib/core/studySelections.d.ts +7 -0
  34. package/cjs/lib/core/studySelections.d.ts.map +1 -0
  35. package/cjs/lib/core/studySelections.js +30 -0
  36. package/cjs/lib/core/studySelections.js.map +1 -0
  37. package/cjs/lib/core/writeMarkdownFileResult.d.ts +6 -0
  38. package/cjs/lib/core/writeMarkdownFileResult.d.ts.map +1 -0
  39. package/cjs/lib/core/writeMarkdownFileResult.js +22 -0
  40. package/cjs/lib/core/writeMarkdownFileResult.js.map +1 -0
  41. package/cjs/lib/gpt/determineLanguage.d.ts +3 -0
  42. package/cjs/lib/gpt/determineLanguage.d.ts.map +1 -0
  43. package/cjs/lib/gpt/determineLanguage.js +16 -0
  44. package/cjs/lib/gpt/determineLanguage.js.map +1 -0
  45. package/cjs/lib/gpt/getAnswer.d.ts +4 -0
  46. package/cjs/lib/gpt/getAnswer.d.ts.map +1 -0
  47. package/cjs/lib/gpt/getAnswer.js +17 -0
  48. package/cjs/lib/gpt/getAnswer.js.map +1 -0
  49. package/cjs/lib/gpt/getConcepts.d.ts +4 -0
  50. package/cjs/lib/gpt/getConcepts.d.ts.map +1 -0
  51. package/cjs/lib/gpt/getConcepts.js +17 -0
  52. package/cjs/lib/gpt/getConcepts.js.map +1 -0
  53. package/cjs/lib/gpt/getSummary.d.ts +4 -0
  54. package/cjs/lib/gpt/getSummary.d.ts.map +1 -0
  55. package/cjs/lib/gpt/getSummary.js +17 -0
  56. package/cjs/lib/gpt/getSummary.js.map +1 -0
  57. package/cjs/lib/gpt/translateDaToEn.d.ts +3 -0
  58. package/cjs/lib/gpt/translateDaToEn.d.ts.map +1 -0
  59. package/cjs/lib/gpt/translateDaToEn.js +14 -0
  60. package/cjs/lib/gpt/translateDaToEn.js.map +1 -0
  61. package/cjs/lib/main.d.ts +2 -0
  62. package/cjs/lib/main.d.ts.map +1 -0
  63. package/cjs/lib/main.js +9 -0
  64. package/cjs/lib/main.js.map +1 -0
  65. package/cjs/lib/templates/getArticleConfigTemplate.d.ts +3 -0
  66. package/cjs/lib/templates/getArticleConfigTemplate.d.ts.map +1 -0
  67. package/cjs/lib/templates/getArticleConfigTemplate.js +28 -0
  68. package/cjs/lib/templates/getArticleConfigTemplate.js.map +1 -0
  69. package/cjs/lib/templates/getBookConfigTemplate.d.ts +3 -0
  70. package/cjs/lib/templates/getBookConfigTemplate.d.ts.map +1 -0
  71. package/cjs/lib/templates/getBookConfigTemplate.js +35 -0
  72. package/cjs/lib/templates/getBookConfigTemplate.js.map +1 -0
  73. package/cjs/lib/types.d.ts +37 -0
  74. package/cjs/lib/types.d.ts.map +1 -0
  75. package/cjs/{types/IConfig.js → lib/types.js} +1 -1
  76. package/cjs/lib/types.js.map +1 -0
  77. package/package.json +1 -1
  78. package/cjs/arg/ArgumentBuilder.d.ts +0 -23
  79. package/cjs/arg/ArgumentBuilder.d.ts.map +0 -1
  80. package/cjs/arg/ArgumentBuilder.js +0 -52
  81. package/cjs/arg/ArgumentBuilder.js.map +0 -1
  82. package/cjs/arg/ArgumentParserSelector.d.ts +0 -9
  83. package/cjs/arg/ArgumentParserSelector.d.ts.map +0 -1
  84. package/cjs/arg/ArgumentParserSelector.js +0 -15
  85. package/cjs/arg/ArgumentParserSelector.js.map +0 -1
  86. package/cjs/arg/ArgumentReader.d.ts +0 -15
  87. package/cjs/arg/ArgumentReader.d.ts.map +0 -1
  88. package/cjs/arg/ArgumentReader.js +0 -38
  89. package/cjs/arg/ArgumentReader.js.map +0 -1
  90. package/cjs/arg/ArgumentValidatorSelector.d.ts +0 -8
  91. package/cjs/arg/ArgumentValidatorSelector.d.ts.map +0 -1
  92. package/cjs/arg/ArgumentValidatorSelector.js +0 -16
  93. package/cjs/arg/ArgumentValidatorSelector.js.map +0 -1
  94. package/cjs/cmd/CommandBuilder.d.ts +0 -410
  95. package/cjs/cmd/CommandBuilder.d.ts.map +0 -1
  96. package/cjs/cmd/CommandBuilder.js +0 -1277
  97. package/cjs/cmd/CommandBuilder.js.map +0 -1
  98. package/cjs/cmd/CommandBuilderMetaData.d.ts +0 -26
  99. package/cjs/cmd/CommandBuilderMetaData.d.ts.map +0 -1
  100. package/cjs/cmd/CommandBuilderMetaData.js +0 -45
  101. package/cjs/cmd/CommandBuilderMetaData.js.map +0 -1
  102. package/cjs/cmd/CommandFeatureSelector.d.ts +0 -80
  103. package/cjs/cmd/CommandFeatureSelector.d.ts.map +0 -1
  104. package/cjs/cmd/CommandFeatureSelector.js +0 -114
  105. package/cjs/cmd/CommandFeatureSelector.js.map +0 -1
  106. package/cjs/cmd/DefaultHelpConfig.d.ts +0 -29
  107. package/cjs/cmd/DefaultHelpConfig.d.ts.map +0 -1
  108. package/cjs/cmd/DefaultHelpConfig.js +0 -177
  109. package/cjs/cmd/DefaultHelpConfig.js.map +0 -1
  110. package/cjs/cmd/commanderBackRefs.d.ts +0 -10
  111. package/cjs/cmd/commanderBackRefs.d.ts.map +0 -1
  112. package/cjs/cmd/commanderBackRefs.js +0 -38
  113. package/cjs/cmd/commanderBackRefs.js.map +0 -1
  114. package/cjs/core/OutputManager.d.ts +0 -64
  115. package/cjs/core/OutputManager.d.ts.map +0 -1
  116. package/cjs/core/OutputManager.js +0 -92
  117. package/cjs/core/OutputManager.js.map +0 -1
  118. package/cjs/core/ParserSelector.d.ts +0 -23
  119. package/cjs/core/ParserSelector.d.ts.map +0 -1
  120. package/cjs/core/ParserSelector.js +0 -46
  121. package/cjs/core/ParserSelector.js.map +0 -1
  122. package/cjs/core/ValidatorSelector.d.ts +0 -19
  123. package/cjs/core/ValidatorSelector.d.ts.map +0 -1
  124. package/cjs/core/ValidatorSelector.js +0 -42
  125. package/cjs/core/ValidatorSelector.js.map +0 -1
  126. package/cjs/core/splitCombinedArgvShorts.d.ts +0 -2
  127. package/cjs/core/splitCombinedArgvShorts.d.ts.map +0 -1
  128. package/cjs/core/splitCombinedArgvShorts.js +0 -15
  129. package/cjs/core/splitCombinedArgvShorts.js.map +0 -1
  130. package/cjs/db/AbstractJsonFileSection.d.ts +0 -136
  131. package/cjs/db/AbstractJsonFileSection.d.ts.map +0 -1
  132. package/cjs/db/AbstractJsonFileSection.js +0 -190
  133. package/cjs/db/AbstractJsonFileSection.js.map +0 -1
  134. package/cjs/db/AppDataSection.d.ts +0 -31
  135. package/cjs/db/AppDataSection.d.ts.map +0 -1
  136. package/cjs/db/AppDataSection.js +0 -49
  137. package/cjs/db/AppDataSection.js.map +0 -1
  138. package/cjs/db/ConfigSection.d.ts +0 -46
  139. package/cjs/db/ConfigSection.d.ts.map +0 -1
  140. package/cjs/db/ConfigSection.js +0 -71
  141. package/cjs/db/ConfigSection.js.map +0 -1
  142. package/cjs/db/JsonFile.d.ts +0 -36
  143. package/cjs/db/JsonFile.d.ts.map +0 -1
  144. package/cjs/db/JsonFile.js +0 -60
  145. package/cjs/db/JsonFile.js.map +0 -1
  146. package/cjs/db/PresetsSection.d.ts +0 -45
  147. package/cjs/db/PresetsSection.d.ts.map +0 -1
  148. package/cjs/db/PresetsSection.js +0 -82
  149. package/cjs/db/PresetsSection.js.map +0 -1
  150. package/cjs/opt/OptionArgumentParserSelector.d.ts +0 -8
  151. package/cjs/opt/OptionArgumentParserSelector.d.ts.map +0 -1
  152. package/cjs/opt/OptionArgumentParserSelector.js +0 -16
  153. package/cjs/opt/OptionArgumentParserSelector.js.map +0 -1
  154. package/cjs/opt/OptionArgumentValidatorSelector.d.ts +0 -8
  155. package/cjs/opt/OptionArgumentValidatorSelector.d.ts.map +0 -1
  156. package/cjs/opt/OptionArgumentValidatorSelector.js +0 -19
  157. package/cjs/opt/OptionArgumentValidatorSelector.js.map +0 -1
  158. package/cjs/opt/OptionBuilder.d.ts +0 -32
  159. package/cjs/opt/OptionBuilder.d.ts.map +0 -1
  160. package/cjs/opt/OptionBuilder.js +0 -97
  161. package/cjs/opt/OptionBuilder.js.map +0 -1
  162. package/cjs/opt/OptionHelpers.d.ts +0 -33
  163. package/cjs/opt/OptionHelpers.d.ts.map +0 -1
  164. package/cjs/opt/OptionHelpers.js +0 -57
  165. package/cjs/opt/OptionHelpers.js.map +0 -1
  166. package/cjs/opt/OptionReader.d.ts +0 -24
  167. package/cjs/opt/OptionReader.d.ts.map +0 -1
  168. package/cjs/opt/OptionReader.js +0 -66
  169. package/cjs/opt/OptionReader.js.map +0 -1
  170. package/cjs/types/IConfig.d.ts +0 -22
  171. package/cjs/types/IConfig.d.ts.map +0 -1
  172. package/cjs/types/IConfig.js.map +0 -1
  173. package/cjs/types/IPreset.d.ts +0 -15
  174. package/cjs/types/IPreset.d.ts.map +0 -1
  175. package/cjs/types/IPreset.js +0 -3
  176. package/cjs/types/IPreset.js.map +0 -1
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.commanderBackRefs = void 0;
4
- const extra_typings_1 = require("@commander-js/extra-typings");
5
- const splitCombinedArgvShorts_1 = require("../core/splitCombinedArgvShorts");
6
- exports.commanderBackRefs = (function overrideCommanderPrototype() {
7
- const wm = new WeakMap();
8
- const oldParse = extra_typings_1.Command.prototype.parse;
9
- const oldParseAsync = extra_typings_1.Command.prototype.parseAsync;
10
- extra_typings_1.Command.prototype.parse = function parse(argv, options) {
11
- return oldParse.call(this, handleArgv(this, argv), options);
12
- };
13
- extra_typings_1.Command.prototype.parseAsync = async function (argv, options) {
14
- return await oldParseAsync.call(this, handleArgv(this, argv), options);
15
- };
16
- extra_typings_1.Command.prototype.execute = function (argv, options) {
17
- return this.builder.meta.isActionAsync ? this.parseAsync(argv, options) : this.parse(argv, options);
18
- };
19
- function handleArgv(cmd, argv) {
20
- const args = (0, splitCombinedArgvShorts_1.splitCombinedArgvShorts)((argv || process.argv).slice());
21
- // workaround for problem where when help is requested, but there are required args, will error
22
- if (args.find((a) => a === '-h' || a === '--help')) {
23
- const dummyArgs = 'aaaaaaaa'.split('');
24
- args.push(...dummyArgs);
25
- }
26
- return args;
27
- }
28
- Object.defineProperty(extra_typings_1.Command.prototype, 'builder', {
29
- get() {
30
- const ins = wm.get(this);
31
- if (!ins)
32
- throw new Error(`CommandBuilder not found for command ${this.name()}`);
33
- return ins;
34
- },
35
- });
36
- return wm;
37
- })();
38
- //# sourceMappingURL=commanderBackRefs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"commanderBackRefs.js","sourceRoot":"","sources":["../../../../../packages/cli/src/cmd/commanderBackRefs.ts"],"names":[],"mappings":";;;AACA,+DAAmE;AAEnE,6EAAyE;AAE5D,QAAA,iBAAiB,GAAG,CAAC,SAAS,0BAA0B;IACnE,MAAM,EAAE,GAAG,IAAI,OAAO,EAA+C,CAAA;IACrE,MAAM,QAAQ,GAAG,uBAAO,CAAC,SAAS,CAAC,KAAK,CAAA;IACxC,MAAM,aAAa,GAAG,uBAAO,CAAC,SAAS,CAAC,UAAU,CAAA;IAElD,uBAAO,CAAC,SAAS,CAAC,KAAK,GAAG,SAAS,KAAK,CAAgB,IAAwB,EAAE,OAAsB;QACtG,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAA;IAC7D,CAAC,CAAA;IAED,uBAAO,CAAC,SAAS,CAAC,UAAU,GAAG,KAAK,WAA0B,IAAwB,EAAE,OAAsB;QAC5G,OAAO,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAA;IACxE,CAAC,CAAA;IAED,uBAAO,CAAC,SAAS,CAAC,OAAO,GAAG,UAE1B,IAAwB,EACxB,OAAsB;QAEtB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IACrG,CAAC,CAAA;IAED,SAAS,UAAU,CAAC,GAAY,EAAE,IAAwB;QACxD,MAAM,IAAI,GAAG,IAAA,iDAAuB,EAAC,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC,CAAA;QAEpE,+FAA+F;QAC/F,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,QAAQ,CAAC,EAAE;YAClD,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;YACtC,IAAI,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAA;SACxB;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,uBAAO,CAAC,SAAS,EAAE,SAAS,EAAE;QAClD,GAAG;YACD,MAAM,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;YACxB,IAAI,CAAC,GAAG;gBAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;YAChF,OAAO,GAAG,CAAA;QACZ,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,EAAE,CAAA;AACX,CAAC,CAAC,EAAE,CAAA"}
@@ -1,64 +0,0 @@
1
- import colors from 'ansi-colors';
2
- import { Any } from '@bemoje/types';
3
- import { MethodDisabler } from '@bemoje/function';
4
- /**
5
- * The OutputManager class manages the output of debug messages to the console.
6
- */
7
- export declare class OutputManager {
8
- /**
9
- * The singleton instance of the OutputManager class.
10
- */
11
- private static instance;
12
- /**
13
- * Returns the singleton instance of the OutputManager class.
14
- * If the instance does not exist, it creates a new one.
15
- */
16
- static getInstance(): OutputManager;
17
- /**
18
- * Ansi-colors object
19
- */
20
- readonly colors: typeof colors;
21
- /**
22
- * A MethodDisabler instance for disabling the write method of the process.stdout object.
23
- */
24
- readonly stdout: MethodDisabler;
25
- /**
26
- * A MethodDisabler instance for disabling the write method of the process.stderr object.
27
- */
28
- readonly stderr: MethodDisabler;
29
- /**
30
- * A MethodDisabler instance for disabling the debug method of the console object.
31
- */
32
- readonly debug: MethodDisabler;
33
- /**
34
- * An array that holds queued debug messages.
35
- */
36
- protected readonly debugMsgQueue: (() => Any)[];
37
- /**
38
- * Constructs a new instance of the OutputManager class.
39
- * console.debug is disabled by default.
40
- */
41
- constructor();
42
- get queueSize(): number;
43
- /**
44
- * Resets the OutputManager to its default state.
45
- * - Enables colors.
46
- * - Enables the write method of the process.stdout object.
47
- * - Enables the write method of the process.stderr object.
48
- * - Disables the debug method of the console object.
49
- * @returns The OutputManager instance.
50
- */
51
- reset(): this;
52
- /**
53
- * Outputs a debug message to the console.
54
- * If the debug method is enabled, the message is immediately logged to the console.
55
- * Otherwise, the message is added to the debug message queue.
56
- * @param fn - A function that returns the debug message.
57
- */
58
- outputDebug(fn: () => Any): void;
59
- /**
60
- * Drains the debug message queue by logging all the messages to the console.
61
- */
62
- drainDebugMessageQueue(): void;
63
- }
64
- //# sourceMappingURL=OutputManager.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OutputManager.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/core/OutputManager.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAA;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAEjD;;GAEG;AACH,qBAAa,aAAa;IACxB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAe;IAEtC;;;OAGG;IACH,MAAM,CAAC,WAAW;IAKlB;;OAEG;IACH,QAAQ,CAAC,MAAM,gBAAS;IAExB;;OAEG;IACH,QAAQ,CAAC,MAAM,iBAA8C;IAE7D;;OAEG;IACH,QAAQ,CAAC,MAAM,iBAA8C;IAE7D;;OAEG;IACH,QAAQ,CAAC,KAAK,iBAAuC;IAErD;;OAEG;IACH,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAK;IAEpD;;;OAGG;;IAMH,IAAI,SAAS,WAEZ;IAED;;;;;;;OAOG;IACH,KAAK;IAQL;;;;;OAKG;IACH,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG;IAKzB;;OAEG;IACH,sBAAsB;CAIvB"}
@@ -1,92 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OutputManager = void 0;
4
- const tslib_1 = require("tslib");
5
- const ansi_colors_1 = tslib_1.__importDefault(require("ansi-colors"));
6
- const node_1 = require("@bemoje/node");
7
- const function_1 = require("@bemoje/function");
8
- /**
9
- * The OutputManager class manages the output of debug messages to the console.
10
- */
11
- class OutputManager {
12
- /**
13
- * The singleton instance of the OutputManager class.
14
- */
15
- static instance;
16
- /**
17
- * Returns the singleton instance of the OutputManager class.
18
- * If the instance does not exist, it creates a new one.
19
- */
20
- static getInstance() {
21
- if (!this.instance)
22
- this.instance = new OutputManager();
23
- return this.instance;
24
- }
25
- /**
26
- * Ansi-colors object
27
- */
28
- colors = ansi_colors_1.default;
29
- /**
30
- * A MethodDisabler instance for disabling the write method of the process.stdout object.
31
- */
32
- stdout = new function_1.MethodDisabler(process.stdout, 'write');
33
- /**
34
- * A MethodDisabler instance for disabling the write method of the process.stderr object.
35
- */
36
- stderr = new function_1.MethodDisabler(process.stderr, 'write');
37
- /**
38
- * A MethodDisabler instance for disabling the debug method of the console object.
39
- */
40
- debug = new function_1.MethodDisabler(console, 'debug');
41
- /**
42
- * An array that holds queued debug messages.
43
- */
44
- debugMsgQueue = [];
45
- /**
46
- * Constructs a new instance of the OutputManager class.
47
- * console.debug is disabled by default.
48
- */
49
- constructor() {
50
- this.debug.disable();
51
- ansi_colors_1.default.enabled = (0, node_1.isTerminalColorSupported)();
52
- }
53
- get queueSize() {
54
- return this.debugMsgQueue.length;
55
- }
56
- /**
57
- * Resets the OutputManager to its default state.
58
- * - Enables colors.
59
- * - Enables the write method of the process.stdout object.
60
- * - Enables the write method of the process.stderr object.
61
- * - Disables the debug method of the console object.
62
- * @returns The OutputManager instance.
63
- */
64
- reset() {
65
- this.colors.enabled = true;
66
- this.stdout.enable();
67
- this.stderr.enable();
68
- this.debug.disable();
69
- return this;
70
- }
71
- /**
72
- * Outputs a debug message to the console.
73
- * If the debug method is enabled, the message is immediately logged to the console.
74
- * Otherwise, the message is added to the debug message queue.
75
- * @param fn - A function that returns the debug message.
76
- */
77
- outputDebug(fn) {
78
- if (this.debug.isEnabled)
79
- console.debug(fn());
80
- else
81
- this.debugMsgQueue.push(fn);
82
- }
83
- /**
84
- * Drains the debug message queue by logging all the messages to the console.
85
- */
86
- drainDebugMessageQueue() {
87
- this.debugMsgQueue.forEach((fn) => console.debug(fn()));
88
- this.debugMsgQueue.splice(0, this.debugMsgQueue.length);
89
- }
90
- }
91
- exports.OutputManager = OutputManager;
92
- //# sourceMappingURL=OutputManager.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OutputManager.js","sourceRoot":"","sources":["../../../../../packages/cli/src/core/OutputManager.ts"],"names":[],"mappings":";;;;AAAA,sEAAgC;AAEhC,uCAAuD;AACvD,+CAAiD;AAEjD;;GAEG;AACH,MAAa,aAAa;IACxB;;OAEG;IACK,MAAM,CAAC,QAAQ,CAAe;IAEtC;;;OAGG;IACH,MAAM,CAAC,WAAW;QAChB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAA;QACvD,OAAO,IAAI,CAAC,QAAQ,CAAA;IACtB,CAAC;IAED;;OAEG;IACM,MAAM,GAAG,qBAAM,CAAA;IAExB;;OAEG;IACM,MAAM,GAAG,IAAI,yBAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAE7D;;OAEG;IACM,MAAM,GAAG,IAAI,yBAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAE7D;;OAEG;IACM,KAAK,GAAG,IAAI,yBAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAErD;;OAEG;IACgB,aAAa,GAAkB,EAAE,CAAA;IAEpD;;;OAGG;IACH;QACE,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAA;QACpB,qBAAM,CAAC,OAAO,GAAG,IAAA,+BAAwB,GAAE,CAAA;IAC7C,CAAC;IAED,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAA;IAClC,CAAC;IAED;;;;;;;OAOG;IACH,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,OAAO,GAAG,IAAI,CAAA;QAC1B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAA;QACpB,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAA;QACpB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAA;QACpB,OAAO,IAAI,CAAA;IACb,CAAC;IAED;;;;;OAKG;IACH,WAAW,CAAC,EAAa;QACvB,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS;YAAE,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAA;;YACxC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAClC,CAAC;IAED;;OAEG;IACH,sBAAsB;QACpB,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAA;QACvD,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAA;IACzD,CAAC;CACF;AAvFD,sCAuFC"}
@@ -1,23 +0,0 @@
1
- import { ArgumentBuilder } from '../arg/ArgumentBuilder';
2
- import { JsonValue } from '@bemoje/types';
3
- import { OptionBuilder } from '../opt/OptionBuilder';
4
- import { TStringParser } from '@bemoje/types';
5
- export declare abstract class ParserSelector<Builder extends ArgumentBuilder | OptionBuilder> {
6
- protected readonly builder: Builder;
7
- constructor(builder: Builder);
8
- abstract custom<T extends JsonValue>(parser: TStringParser<T>): Builder;
9
- string(): Builder;
10
- number(): Builder;
11
- integer(): Builder;
12
- /**
13
- * Creates a boolean parser for the argument/option.
14
- * @param trueValues - An array of strings that are considered true. Defaults to ['TRUE', 'T', 'YES', 'Y', '1'].
15
- */
16
- boolean(trueValues?: string[], falseValues?: string[]): Builder;
17
- delimitedStrings(delimiter?: string): Builder;
18
- delimitedNumbers(delimiter?: string): Builder;
19
- delimitedIntegers(delimiter?: string): Builder;
20
- delimitedBooleans(delimiter?: string, trueValues?: string[], falseValues?: string[]): Builder;
21
- delimited<T extends JsonValue>(delimiter: string, parser: TStringParser<T>): Builder;
22
- }
23
- //# sourceMappingURL=ParserSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParserSelector.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/core/ParserSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAIpD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAE7C,8BAAsB,cAAc,CAAC,OAAO,SAAS,eAAe,GAAG,aAAa;IACtE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO;gBAAhB,OAAO,EAAE,OAAO;IAE/C,QAAQ,CAAC,MAAM,CAAC,CAAC,SAAS,SAAS,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,OAAO;IAEvE,MAAM;IAGN,MAAM;IAGN,OAAO;IAIP;;;OAGG;IACH,OAAO,CACL,UAAU,GAAE,MAAM,EAAmC,EACrD,WAAW,GAAE,MAAM,EAAmC;IAKxD,gBAAgB,CAAC,SAAS,SAAM;IAGhC,gBAAgB,CAAC,SAAS,SAAM;IAGhC,iBAAiB,CAAC,SAAS,SAAM;IAGjC,iBAAiB,CACf,SAAS,SAAM,EACf,UAAU,GAAE,MAAM,EAAmC,EACrD,WAAW,GAAE,MAAM,EAAmC;IAKxD,SAAS,CAAC,CAAC,SAAS,SAAS,EAAE,SAAS,QAAM,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;CAGzE"}
@@ -1,46 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ParserSelector = void 0;
4
- const parse_1 = require("@bemoje/parse");
5
- const parse_2 = require("@bemoje/parse");
6
- const parse_3 = require("@bemoje/parse");
7
- const parse_4 = require("@bemoje/parse");
8
- class ParserSelector {
9
- builder;
10
- constructor(builder) {
11
- this.builder = builder;
12
- }
13
- string() {
14
- return this.custom(parse_4.parseString);
15
- }
16
- number() {
17
- return this.custom(parse_3.parseNumber);
18
- }
19
- integer() {
20
- return this.custom(parse_2.parseInteger);
21
- }
22
- /**
23
- * Creates a boolean parser for the argument/option.
24
- * @param trueValues - An array of strings that are considered true. Defaults to ['TRUE', 'T', 'YES', 'Y', '1'].
25
- */
26
- boolean(trueValues = ['TRUE', 'T', 'YES', 'Y', '1'], falseValues = ['FALSE', 'F', 'NO', 'N', '0']) {
27
- return this.custom((0, parse_1.createBooleanParser)(trueValues, falseValues));
28
- }
29
- delimitedStrings(delimiter = ',') {
30
- return this.delimited(delimiter, parse_4.parseString);
31
- }
32
- delimitedNumbers(delimiter = ',') {
33
- return this.delimited(delimiter, parse_3.parseNumber);
34
- }
35
- delimitedIntegers(delimiter = ',') {
36
- return this.delimited(delimiter, parse_2.parseInteger);
37
- }
38
- delimitedBooleans(delimiter = ',', trueValues = ['TRUE', 'T', 'YES', 'Y', '1'], falseValues = ['FALSE', 'F', 'NO', 'N', '0']) {
39
- return this.delimited(delimiter, (0, parse_1.createBooleanParser)(trueValues, falseValues));
40
- }
41
- delimited(delimiter = ',', parser) {
42
- return this.custom((0, parse_1.createTypedListParser)(delimiter, parser));
43
- }
44
- }
45
- exports.ParserSelector = ParserSelector;
46
- //# sourceMappingURL=ParserSelector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParserSelector.js","sourceRoot":"","sources":["../../../../../packages/cli/src/core/ParserSelector.ts"],"names":[],"mappings":";;;AACA,yCAA0E;AAG1E,yCAA4C;AAC5C,yCAA2C;AAC3C,yCAA2C;AAG3C,MAAsB,cAAc;IACH;IAA/B,YAA+B,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAG,CAAC;IAInD,MAAM;QACJ,OAAO,IAAI,CAAC,MAAM,CAAS,mBAAW,CAAC,CAAA;IACzC,CAAC;IACD,MAAM;QACJ,OAAO,IAAI,CAAC,MAAM,CAAS,mBAAW,CAAC,CAAA;IACzC,CAAC;IACD,OAAO;QACL,OAAO,IAAI,CAAC,MAAM,CAAS,oBAAY,CAAC,CAAA;IAC1C,CAAC;IAED;;;OAGG;IACH,OAAO,CACL,aAAuB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EACrD,cAAwB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC;QAEtD,OAAO,IAAI,CAAC,MAAM,CAAU,IAAA,2BAAmB,EAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAA;IAC3E,CAAC;IAED,gBAAgB,CAAC,SAAS,GAAG,GAAG;QAC9B,OAAO,IAAI,CAAC,SAAS,CAAS,SAAS,EAAE,mBAAW,CAAC,CAAA;IACvD,CAAC;IACD,gBAAgB,CAAC,SAAS,GAAG,GAAG;QAC9B,OAAO,IAAI,CAAC,SAAS,CAAS,SAAS,EAAE,mBAAW,CAAC,CAAA;IACvD,CAAC;IACD,iBAAiB,CAAC,SAAS,GAAG,GAAG;QAC/B,OAAO,IAAI,CAAC,SAAS,CAAS,SAAS,EAAE,oBAAY,CAAC,CAAA;IACxD,CAAC;IACD,iBAAiB,CACf,SAAS,GAAG,GAAG,EACf,aAAuB,CAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,CAAC,EACrD,cAAwB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,CAAC;QAEtD,OAAO,IAAI,CAAC,SAAS,CAAU,SAAS,EAAE,IAAA,2BAAmB,EAAC,UAAU,EAAE,WAAW,CAAC,CAAC,CAAA;IACzF,CAAC;IAED,SAAS,CAAsB,SAAS,GAAG,GAAG,EAAE,MAAwB;QACtE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAA,6BAAqB,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;IAC9D,CAAC;CACF;AA9CD,wCA8CC"}
@@ -1,19 +0,0 @@
1
- import { ArgumentBuilder } from '../arg/ArgumentBuilder';
2
- import { JsonValue } from '@bemoje/types';
3
- import { OptionBuilder } from '../opt/OptionBuilder';
4
- import { TValidator } from '@bemoje/types';
5
- export declare abstract class ValidatorSelector<Builder extends OptionBuilder | ArgumentBuilder> {
6
- protected readonly builder: Builder;
7
- constructor(builder: Builder);
8
- abstract custom<O>(validator: TValidator<O>): typeof this.builder;
9
- isString(): Builder;
10
- isNumber(): Builder;
11
- isInteger(): Builder;
12
- isBoolean(): Builder;
13
- isStringArray(): Builder;
14
- isNumberArray(): Builder;
15
- isIntegerArray(): Builder;
16
- isBooleanArray(): Builder;
17
- arrayWhereEach<O extends JsonValue = JsonValue>(...validators: TValidator<O>[]): Builder;
18
- }
19
- //# sourceMappingURL=ValidatorSelector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ValidatorSelector.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/core/ValidatorSelector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAKxD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAE1C,8BAAsB,iBAAiB,CAAC,OAAO,SAAS,aAAa,GAAG,eAAe;IACzE,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,OAAO;gBAAhB,OAAO,EAAE,OAAO;IAE/C,QAAQ,CAAC,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,OAAO;IAEjE,QAAQ;IAGR,QAAQ;IAGR,SAAS;IAGT,SAAS;IAIT,aAAa;IAGb,aAAa;IAGb,cAAc;IAGd,cAAc;IAId,cAAc,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS,EAAE,GAAG,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE;CAG/E"}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ValidatorSelector = void 0;
4
- const is_1 = require("@bemoje/is");
5
- const is_2 = require("@bemoje/is");
6
- const is_3 = require("@bemoje/is");
7
- const is_4 = require("@bemoje/is");
8
- class ValidatorSelector {
9
- builder;
10
- constructor(builder) {
11
- this.builder = builder;
12
- }
13
- isString() {
14
- return this.custom(is_3.isString);
15
- }
16
- isNumber() {
17
- return this.custom(is_4.isValidNumber);
18
- }
19
- isInteger() {
20
- return this.custom(is_2.isInteger);
21
- }
22
- isBoolean() {
23
- return this.custom(is_1.isBoolean);
24
- }
25
- isStringArray() {
26
- return this.arrayWhereEach(is_3.isString);
27
- }
28
- isNumberArray() {
29
- return this.arrayWhereEach(is_4.isValidNumber);
30
- }
31
- isIntegerArray() {
32
- return this.arrayWhereEach(is_2.isInteger);
33
- }
34
- isBooleanArray() {
35
- return this.arrayWhereEach(is_1.isBoolean);
36
- }
37
- arrayWhereEach(...validators) {
38
- return this.custom((0, is_1.createTypedArrayValidator)(validators));
39
- }
40
- }
41
- exports.ValidatorSelector = ValidatorSelector;
42
- //# sourceMappingURL=ValidatorSelector.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ValidatorSelector.js","sourceRoot":"","sources":["../../../../../packages/cli/src/core/ValidatorSelector.ts"],"names":[],"mappings":";;;AACA,mCAAiE;AACjE,mCAAsC;AACtC,mCAAqC;AACrC,mCAA0C;AAK1C,MAAsB,iBAAiB;IACN;IAA/B,YAA+B,OAAgB;QAAhB,YAAO,GAAP,OAAO,CAAS;IAAG,CAAC;IAInD,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,aAAQ,CAAC,CAAA;IAC9B,CAAC;IACD,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,kBAAa,CAAC,CAAA;IACnC,CAAC;IACD,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,cAAS,CAAC,CAAA;IAC/B,CAAC;IACD,SAAS;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,cAAS,CAAC,CAAA;IAC/B,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,aAAQ,CAAC,CAAA;IACtC,CAAC;IACD,aAAa;QACX,OAAO,IAAI,CAAC,cAAc,CAAC,kBAAa,CAAC,CAAA;IAC3C,CAAC;IACD,cAAc;QACZ,OAAO,IAAI,CAAC,cAAc,CAAC,cAAS,CAAC,CAAA;IACvC,CAAC;IACD,cAAc;QACZ,OAAO,IAAI,CAAC,cAAc,CAAC,cAAS,CAAC,CAAA;IACvC,CAAC;IAED,cAAc,CAAkC,GAAG,UAA2B;QAC5E,OAAO,IAAI,CAAC,MAAM,CAAC,IAAA,8BAAyB,EAAC,UAAU,CAAC,CAAC,CAAA;IAC3D,CAAC;CACF;AAlCD,8CAkCC"}
@@ -1,2 +0,0 @@
1
- export declare function splitCombinedArgvShorts(argv: string[]): string[];
2
- //# sourceMappingURL=splitCombinedArgvShorts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splitCombinedArgvShorts.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/core/splitCombinedArgvShorts.ts"],"names":[],"mappings":"AAAA,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,YASrD"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.splitCombinedArgvShorts = void 0;
4
- function splitCombinedArgvShorts(argv) {
5
- return argv
6
- .map((arg) => {
7
- if (arg.length < 3 || !arg.startsWith('-') || arg.startsWith('--') || arg.includes('=')) {
8
- return arg;
9
- }
10
- return Array.from(arg.replace('-', '')).map((s) => '-' + s);
11
- })
12
- .flat();
13
- }
14
- exports.splitCombinedArgvShorts = splitCombinedArgvShorts;
15
- //# sourceMappingURL=splitCombinedArgvShorts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splitCombinedArgvShorts.js","sourceRoot":"","sources":["../../../../../packages/cli/src/core/splitCombinedArgvShorts.ts"],"names":[],"mappings":";;;AAAA,SAAgB,uBAAuB,CAAC,IAAc;IACpD,OAAO,IAAI;SACR,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QACX,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YACvF,OAAO,GAAG,CAAA;SACX;QACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;IAC7D,CAAC,CAAC;SACD,IAAI,EAAE,CAAA;AACX,CAAC;AATD,0DASC"}
@@ -1,136 +0,0 @@
1
- import { Any, JsonValue } from '@bemoje/types';
2
- import { JsonFile } from './JsonFile';
3
- /**
4
- * A class that represents a section of the JSON file used as a simple database.
5
- */
6
- export declare abstract class AbstractJsonFileSection<Val = JsonValue> {
7
- readonly file: JsonFile;
8
- protected readonly name: string;
9
- protected readonly keysAreFixed: boolean;
10
- /**
11
- * Indicates whether the section has been initialized.
12
- */
13
- protected isInitialized: boolean;
14
- /**
15
- * The default values for the section.
16
- */
17
- readonly defaultValues: Record<string, Val>;
18
- /**
19
- * The base string used as a prefix for the section.
20
- */
21
- readonly prefixBaseString: string;
22
- /**
23
- * Creates an instance of AbstractJsonFileSection.
24
- * @param file - The parent JsonFile instance.
25
- * @param name - The name of the section.
26
- * @param keysAreFixed - Indicates whether the keys in the section are fixed.
27
- */
28
- constructor(file: JsonFile, name: string, keysAreFixed: boolean);
29
- /**
30
- * Asserts that a key-value pair is valid.
31
- * @param key - The key to assert.
32
- * @param value - The value to assert.
33
- */
34
- abstract assertValid(key: string, value: Val): void;
35
- /**
36
- * Defines a property for the section.
37
- * @param key - The key of the property.
38
- * @param options - The options for the property.
39
- */
40
- abstract defineProperty(key: string, options: Any): void;
41
- /**
42
- * Initializes the section.
43
- * @param save - Indicates whether to save the section after initialization.
44
- * @returns A string if an error occurred during initialization, otherwise void.
45
- */
46
- abstract initialize(save?: boolean): void | string;
47
- /**
48
- * The JsonDB associated with the section.
49
- */
50
- get db(): import("@bemoje/jsondb").JsonDB;
51
- /**
52
- * The CommandBuilder associated with the section.
53
- */
54
- get cmd(): import("..").CommandBuilder<unknown[], import("@commander-js/extra-typings").OptionValues>;
55
- /**
56
- * Saves the section.
57
- * @returns A promise that resolves when the section is saved.
58
- */
59
- save(): Promise<void>;
60
- /**
61
- * Gets the object path prefix as dot-separated keys for this section of the JSON file database.
62
- * @param key - An optional key to append to the prefix path.
63
- * @returns The object path prefix.
64
- * @throws An error if the keys are fixed and the specified key does not exist in the default values.
65
- */
66
- prefix(key?: string): string;
67
- /**
68
- * Gets the value associated with the specified key.
69
- * @param key - The key to get the value for.
70
- * @returns The value associated with the key.
71
- */
72
- get<T extends Val = Val>(key: string): T;
73
- /**
74
- * Gets all the values in the section.
75
- * @returns All the values in the section.
76
- */
77
- getAll(): Record<string, Val>;
78
- /**
79
- * Gets the keys in the section.
80
- * @returns The keys in the section.
81
- */
82
- get keys(): string[];
83
- /**
84
- * Gets the number of keys in the section.
85
- * @returns The number of keys in the section.
86
- */
87
- count(): number;
88
- /**
89
- * Sets the value associated with the specified key.
90
- * @param key - The key to set the value for.
91
- * @param value - The value to set.
92
- * @param save - Indicates whether to save the section after setting the value.
93
- */
94
- set(key: string, value: Val, save?: boolean): void;
95
- /**
96
- * Sets all the values in the section.
97
- * @param values - The values to set.
98
- * @param save - Indicates whether to save the section after setting the values.
99
- */
100
- setAll(values: typeof this.defaultValues, save?: boolean): void;
101
- /**
102
- * Updates the value associated with the specified key.
103
- * @param key - The key to set the value for.
104
- * @param callback - The callback function that returns the new value.
105
- * @param save - Indicates whether to save the section after setting the value.
106
- */
107
- update(key: string, callback: (val: Val, key: string) => Val, save?: boolean): void;
108
- /**
109
- * Resets the value associated with the specified key to its default value.
110
- * @param key - The key to reset.
111
- * @param save - Indicates whether to save the section after resetting the value.
112
- */
113
- reset(key: string, save?: boolean): void;
114
- /**
115
- * Resets all the values in the section to their default values.
116
- * @param save - Indicates whether to save the section after resetting the values.
117
- */
118
- resetAll(save?: boolean): void;
119
- /**
120
- * Deletes the value associated with the specified key.
121
- * @param key - The key to delete.
122
- * @param save - Indicates whether to save the section after deleting the value.
123
- */
124
- delete(key: string, save?: boolean): void;
125
- /**
126
- * Deletes all the values in the section.
127
- * @param save - Indicates whether to save the section after deleting the values.
128
- */
129
- deleteAll(save?: boolean): void;
130
- /**
131
- * Edits the values in the section using a text editor.
132
- * @param editor - The text editor to use. If not specified, the default text editor command will be used.
133
- */
134
- edit(editor?: string): void;
135
- }
136
- //# sourceMappingURL=AbstractJsonFileSection.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AbstractJsonFileSection.d.ts","sourceRoot":"","sources":["../../../../../packages/cli/src/db/AbstractJsonFileSection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAGrC;;GAEG;AACH,8BAAsB,uBAAuB,CAAC,GAAG,GAAG,SAAS;IAsB/C,QAAQ,CAAC,IAAI,EAAE,QAAQ;IAAE,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM;IAAE,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO;IArB9G;;OAEG;IACH,SAAS,CAAC,aAAa,UAAQ;IAE/B;;OAEG;IACH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAK;IAEhD;;OAEG;IACH,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAA;IAEjC;;;;;OAKG;gBACkB,IAAI,EAAE,QAAQ,EAAqB,IAAI,EAAE,MAAM,EAAqB,YAAY,EAAE,OAAO;IAI9G;;;;OAIG;IACH,QAAQ,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI;IAEnD;;;;OAIG;IACH,QAAQ,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,GAAG,IAAI;IAExD;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,GAAG,MAAM;IAElD;;OAEG;IACH,IAAI,EAAE,oCAEL;IAED;;OAEG;IACH,IAAI,GAAG,+FAEN;IAED;;;OAGG;IACG,IAAI;IAIV;;;;;OAKG;IACH,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM;IAOnB;;;;OAIG;IACH,GAAG,CAAC,CAAC,SAAS,GAAG,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;IAKxC;;;OAGG;IACH,MAAM;IAKN;;;OAGG;IACH,IAAI,IAAI,aAGP;IAED;;;OAGG;IACH,KAAK;IAIL;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,UAAO;IAMxC;;;;OAIG;IACH,MAAM,CAAC,MAAM,EAAE,OAAO,IAAI,CAAC,aAAa,EAAE,IAAI,UAAO;IAgBrD;;;;;OAKG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,KAAK,GAAG,EAAE,IAAI,UAAO;IAIzE;;;;OAIG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,UAAO;IAI9B;;;OAGG;IACH,QAAQ,CAAC,IAAI,UAAO;IAIpB;;;;OAIG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,UAAO;IAK/B;;;OAGG;IACH,SAAS,CAAC,IAAI,UAAO;IAOrB;;;OAGG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM;CAKrB"}