@cenk1cenk2/oclif-common 6.3.30 → 6.4.1

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 (104) hide show
  1. package/dist/commands/base.command.d.ts +43 -0
  2. package/dist/commands/base.command.js +156 -0
  3. package/dist/commands/index.js +1 -0
  4. package/dist/constants/file.constants.d.ts +6 -0
  5. package/dist/constants/file.constants.js +8 -0
  6. package/dist/constants/help-groups.constants.d.ts +6 -0
  7. package/dist/constants/help-groups.constants.js +8 -0
  8. package/dist/hooks/index.js +2 -0
  9. package/dist/hooks/not-found.hook.d.ts +6 -0
  10. package/dist/hooks/not-found.hook.js +18 -0
  11. package/dist/hooks/update-notifier.hook.d.ts +6 -0
  12. package/dist/hooks/update-notifier.hook.js +11 -0
  13. package/dist/index.d.ts +51 -450
  14. package/dist/index.js +42 -1361
  15. package/dist/interfaces/class.interface.d.ts +4 -0
  16. package/dist/interfaces/hooks.interface.d.ts +16 -0
  17. package/dist/interfaces/index.js +1 -0
  18. package/dist/interfaces/oclif.interface.d.ts +9 -0
  19. package/dist/interfaces/oclif.interface.js +3 -0
  20. package/dist/interfaces/type-helper.interface.d.ts +7 -0
  21. package/dist/lib/cli.interface.d.ts +8 -0
  22. package/dist/lib/cli.module.d.ts +11 -0
  23. package/dist/lib/cli.module.js +57 -0
  24. package/dist/lib/config/config.constants.js +12 -0
  25. package/dist/lib/config/config.interface.d.ts +21 -0
  26. package/dist/lib/config/config.module.d.ts +4 -0
  27. package/dist/lib/config/config.module.js +15 -0
  28. package/dist/lib/config/config.service.d.ts +32 -0
  29. package/dist/lib/config/config.service.js +152 -0
  30. package/dist/lib/config/index.js +2 -0
  31. package/dist/lib/fs/filesystem.interface.d.ts +2 -0
  32. package/dist/lib/fs/filesystem.module.d.ts +4 -0
  33. package/dist/lib/fs/filesystem.module.js +13 -0
  34. package/dist/lib/fs/filesystem.service.d.ts +31 -0
  35. package/dist/lib/fs/filesystem.service.js +141 -0
  36. package/dist/lib/fs/index.js +2 -0
  37. package/dist/lib/index.js +32 -0
  38. package/dist/lib/locker/index.js +2 -0
  39. package/dist/lib/locker/locker.interface.d.ts +28 -0
  40. package/dist/lib/locker/locker.module.d.ts +9 -0
  41. package/dist/lib/locker/locker.module.js +33 -0
  42. package/dist/lib/locker/locker.service.d.ts +41 -0
  43. package/dist/lib/locker/locker.service.js +170 -0
  44. package/dist/lib/logger/index.js +6 -0
  45. package/dist/lib/logger/logger.constants.d.ts +21 -0
  46. package/dist/lib/logger/logger.constants.js +24 -0
  47. package/dist/lib/logger/logger.interface.d.ts +13 -0
  48. package/dist/lib/logger/logger.module.d.ts +4 -0
  49. package/dist/lib/logger/logger.module.js +17 -0
  50. package/dist/lib/logger/logger.service.d.ts +31 -0
  51. package/dist/lib/logger/logger.service.js +70 -0
  52. package/dist/lib/logger/pipe/pipe-process-to-listr.d.ts +7 -0
  53. package/dist/lib/logger/pipe/pipe-process-to-listr.js +9 -0
  54. package/dist/lib/logger/pipe/pipe-process-to-logger.d.ts +12 -0
  55. package/dist/lib/logger/pipe/pipe-process-to-logger.interface.d.ts +19 -0
  56. package/dist/lib/logger/pipe/pipe-process-to-logger.js +54 -0
  57. package/dist/lib/logger/winston.service.d.ts +15 -0
  58. package/dist/lib/logger/winston.service.js +91 -0
  59. package/dist/lib/logo/index.js +3 -0
  60. package/dist/lib/logo/logo.constants.d.ts +6 -0
  61. package/dist/lib/logo/logo.constants.js +5 -0
  62. package/dist/lib/logo/logo.interface.d.ts +6 -0
  63. package/dist/lib/logo/logo.module.d.ts +4 -0
  64. package/dist/lib/logo/logo.module.js +13 -0
  65. package/dist/lib/logo/logo.service.d.ts +17 -0
  66. package/dist/lib/logo/logo.service.js +42 -0
  67. package/dist/lib/parser/fts/env-parser.service.d.ts +16 -0
  68. package/dist/lib/parser/fts/env-parser.service.js +42 -0
  69. package/dist/lib/parser/fts/index.js +3 -0
  70. package/dist/lib/parser/fts/json-parser.service.d.ts +15 -0
  71. package/dist/lib/parser/fts/json-parser.service.js +32 -0
  72. package/dist/lib/parser/fts/yaml-parser.service.d.ts +15 -0
  73. package/dist/lib/parser/fts/yaml-parser.service.js +33 -0
  74. package/dist/lib/parser/index.js +6 -0
  75. package/dist/lib/parser/parser.interface.d.ts +8 -0
  76. package/dist/lib/parser/parser.module.d.ts +4 -0
  77. package/dist/lib/parser/parser.module.js +16 -0
  78. package/dist/lib/parser/parser.service.d.ts +29 -0
  79. package/dist/lib/parser/parser.service.js +76 -0
  80. package/dist/lib/setup.d.ts +4 -0
  81. package/dist/lib/setup.js +16 -0
  82. package/dist/lib/validator/index.js +3 -0
  83. package/dist/lib/validator/validator.constants.d.ts +6 -0
  84. package/dist/lib/validator/validator.constants.js +5 -0
  85. package/dist/lib/validator/validator.interface.d.ts +10 -0
  86. package/dist/lib/validator/validator.module.d.ts +4 -0
  87. package/dist/lib/validator/validator.module.js +13 -0
  88. package/dist/lib/validator/validator.service.d.ts +19 -0
  89. package/dist/lib/validator/validator.service.js +76 -0
  90. package/dist/utils/defaults.d.ts +12 -0
  91. package/dist/utils/defaults.js +16 -0
  92. package/dist/utils/environment.d.ts +8 -0
  93. package/dist/utils/environment.js +16 -0
  94. package/dist/utils/guards.d.ts +9 -0
  95. package/dist/utils/guards.js +13 -0
  96. package/dist/utils/index.d.ts +7 -0
  97. package/dist/utils/index.js +8 -0
  98. package/dist/utils/merge.constants.d.ts +7 -0
  99. package/dist/utils/merge.constants.js +9 -0
  100. package/dist/utils/merge.d.ts +9 -0
  101. package/dist/utils/merge.js +15 -0
  102. package/package.json +27 -23
  103. package/dist/chunk-DzC9Nte8.js +0 -31
  104. package/dist/source-map-support-CuBekda-.js +0 -2435
package/dist/index.d.ts CHANGED
@@ -1,450 +1,51 @@
1
- import { DynamicModule, DynamicModule as DynamicModule$1, INestApplicationContext, Inject, InjectionToken } from "@nestjs/common";
2
- import { Manager } from "@listr2/manager";
3
- import { Args, Command as Command$1, Config, Flags, Hook, Interfaces, ux } from "@oclif/core";
4
- import op from "object-path-immutable";
5
- import { ListrContext, ListrTaskWrapper, splat } from "listr2";
6
- import { LeveledLogMethod, Logger } from "winston";
7
- import fs, { default as fs$1 } from "fs-extra";
8
- import { ClassTransformOptions } from "class-transformer";
9
- import { ValidatorOptions } from "class-validator";
10
- import { ModuleRef } from "@nestjs/core";
11
- import "reflect-metadata";
12
- import * as _oclif_core_lib_interfaces0 from "@oclif/core/lib/interfaces";
13
- import { Flag, InferredFlags } from "@oclif/core/lib/interfaces";
14
- import { ChildProcess } from "child_process";
15
- import { Arg, ArgInput, FlagInput } from "@oclif/core/lib/interfaces/parser";
16
-
17
- //#region src/interfaces/class.interface.d.ts
18
- type ClassType<T> = new (...args: any[]) => T;
19
- //#endregion
20
- //#region src/lib/config/config.interface.d.ts
21
- interface GlobalConfig {
22
- logLevel: LogLevels;
23
- isJson: boolean;
24
- }
25
- interface ConfigIterator {
26
- key: (string | number)[];
27
- env: string;
28
- parser?: string;
29
- extensions?: ConfigIterator[];
30
- }
31
- interface ConfigModuleOptions {
32
- oclif?: Config;
33
- command?: typeof Command$1;
34
- config: GlobalConfig;
35
- }
36
- //#endregion
37
- //#region src/lib/parser/parser.interface.d.ts
38
- declare class GenericParser {
39
- readonly extensions: string[];
40
- parse<T = unknown>(data: string | Buffer): T;
41
- stringify<T = any>(data: T): string;
42
- }
43
- //#endregion
44
- //#region src/lib/logger/pipe/pipe-process-to-listr.d.ts
45
- declare function pipeProcessThroughListr(task: ListrTaskWrapper<any, any, any>, instance: ChildProcess): ChildProcess;
46
- //#endregion
47
- //#region src/lib/logger/logger.constants.d.ts
48
- declare enum LogLevels {
49
- SILENT = "SILENT",
50
- DIRECT = "DIRECT",
51
- FATAL = "FATAL",
52
- ERROR = "ERROR",
53
- WARN = "WARN",
54
- INFO = "INFO",
55
- VERBOSE = "VERBOSE",
56
- DEBUG = "DEBUG",
57
- TRACE = "TRACE",
58
- }
59
- declare enum LogFieldStatus {
60
- RUN = "run",
61
- END = "end",
62
- STAGE = "stage",
63
- EXIT = "exit",
64
- TERMINATE = "terminate",
65
- }
66
- //#endregion
67
- //#region src/lib/logger/pipe/pipe-process-to-logger.interface.d.ts
68
- interface PipeProcessToLoggerOptions {
69
- /** Will log the command when the process starts. */
70
- start?: LogLevels;
71
- /** Will log the command when the process ends. */
72
- end?: LogLevels;
73
- /** enable/disable stdout */
74
- stdout?: LogLevels;
75
- /** enable/disable stderrr */
76
- stderr?: LogLevels;
77
- /** will callback on error in the instance */
78
- callback?: (error?: Error) => void;
79
- /** context for logger */
80
- context?: string;
81
- }
82
- //#endregion
83
- //#region src/lib/logger/logger.interface.d.ts
84
- interface LoggerFormat {
85
- level: LogLevels;
86
- message: string;
87
- context: string;
88
- status: string;
89
- }
90
- type Winston = Logger & Record<keyof typeof LogLevels, LeveledLogMethod>;
91
- //#endregion
92
- //#region src/lib/logger/winston.service.d.ts
93
- declare class WinstonService {
94
- private readonly options;
95
- readonly instance: Winston;
96
- constructor(options: ConfigModuleOptions);
97
- private initiateLogger;
98
- private logColoring;
99
- }
100
- //#endregion
101
- //#region src/lib/logger/logger.service.d.ts
102
- /**
103
- * A general logger for the the CLI applications.
104
- */
105
- declare class LoggerService {
106
- private readonly winston;
107
- context: string;
108
- constructor(winston: WinstonService);
109
- setup(context: string): LoggerService;
110
- log(level: LogLevels, data: string | Buffer, ...args: any): void;
111
- direct(data: string | Buffer, ...args: any): void;
112
- fatal(data: string | Buffer, ...args: any): void;
113
- error(data: string | Buffer, ...args: any): void;
114
- warn(data: string | Buffer, ...args: any): void;
115
- info(data: string | Buffer, ...args: any): void;
116
- verbose(data: string | Buffer, ...args: any): void;
117
- debug(data: string | Buffer, ...args: any): void;
118
- trace(data: string | Buffer, ...args: any): void;
119
- run(data: string | Buffer, ...args: any): void;
120
- end(data: string | Buffer, ...args: any): void;
121
- stage(data: string | Buffer, ...args: any): void;
122
- splat(...args: Parameters<typeof splat>): ReturnType<typeof splat>;
123
- private parseMessage;
124
- }
125
- //#endregion
126
- //#region src/lib/logger/pipe/pipe-process-to-logger.d.ts
127
- /**
128
- * Given the instance it will pipe process output through the logger to append prefixes such as the application name.
129
- */
130
- declare function pipeProcessToLogger(logger: LoggerService, instance: ChildProcess, options?: PipeProcessToLoggerOptions): ChildProcess;
131
- //#endregion
132
- //#region src/lib/logger/logger.module.d.ts
133
- declare class LoggerModule {}
134
- //#endregion
135
- //#region src/lib/parser/fts/env-parser.service.d.ts
136
- declare class EnvironmentVariableParser implements GenericParser {
137
- private readonly logger;
138
- readonly extensions: string[];
139
- private readonly LINE;
140
- constructor(logger: LoggerService);
141
- parse<T = unknown>(data: string | Buffer): T;
142
- stringify<T = any>(data: T): string;
143
- }
144
- //#endregion
145
- //#region src/lib/parser/fts/json-parser.service.d.ts
146
- declare class JsonParser implements GenericParser {
147
- private readonly logger;
148
- readonly extensions: string[];
149
- constructor(logger: LoggerService);
150
- parse<T = unknown>(data: string | Buffer): T;
151
- stringify<T = any>(data: T): string;
152
- }
153
- //#endregion
154
- //#region src/lib/parser/fts/yaml-parser.service.d.ts
155
- declare class YamlParser implements GenericParser {
156
- private readonly logger;
157
- readonly extensions: string[];
158
- constructor(logger: LoggerService);
159
- parse<T = unknown>(data: string | Buffer): T;
160
- stringify<T = any>(data: T): string;
161
- }
162
- //#endregion
163
- //#region src/lib/parser/parser.module.d.ts
164
- declare class ParserModule {}
165
- //#endregion
166
- //#region src/lib/fs/filesystem.service.d.ts
167
- declare class FileSystemService {
168
- private readonly logger;
169
- readonly extra: typeof fs$1;
170
- constructor(logger: LoggerService);
171
- exists(path: string): boolean;
172
- stats(path: string): fs$1.Stats;
173
- dirname(path: string): string;
174
- extname(path: string): string;
175
- read(file: string): Promise<string>;
176
- readSync(file: string): string;
177
- write(file: string, data: string | Buffer, options?: fs$1.WriteFileOptions): Promise<void>;
178
- writeSync(file: string, data: string | Buffer, options?: fs$1.WriteFileOptions): void;
179
- append(file: string, data: string | Buffer, options?: fs$1.WriteFileOptions): Promise<void>;
180
- appendSync(file: string, data: string | Buffer): void;
181
- remove(file: string, options?: fs$1.RmOptions): Promise<void>;
182
- removeSync(file: string, options?: fs$1.RmOptions): void;
183
- emptyDir(directory: string): Promise<void>;
184
- emptyDirSync(directory: string): void;
185
- removeDir(directory: string): Promise<void>;
186
- removeDirSync(directory: string): void;
187
- mkdir(directory: string): Promise<void>;
188
- mkdirSync(directory: string): void;
189
- }
190
- //#endregion
191
- //#region src/lib/fs/filesystem.module.d.ts
192
- declare class FilesystemModule {}
193
- //#endregion
194
- //#region src/lib/parser/parser.service.d.ts
195
- declare class ParserService {
196
- private moduleRef;
197
- private fs;
198
- private readonly logger;
199
- private readonly instances;
200
- constructor(moduleRef: ModuleRef, fs: FileSystemService, logger: LoggerService);
201
- byFt(file: string): GenericParser;
202
- fetch<T extends GenericParser>(Parser: ClassType<T>): T;
203
- inject<T extends GenericParser>(Parser: ClassType<T>): Promise<T>;
204
- register(...parsers: ClassType<GenericParser>[]): Promise<void>;
205
- read<T = unknown>(file: string): Promise<T>;
206
- write<T = LockableData>(file: string, data: T): Promise<void>;
207
- parse<T = unknown>(file: string, data: string | Buffer): T;
208
- parseWith<T = unknown>(Parser: ClassType<GenericParser>, data: string | Buffer): T;
209
- stringify<T = any>(file: string, data: T): string;
210
- stringifyWith<T = any>(Parser: ClassType<GenericParser>, data: T): string;
211
- }
212
- //#endregion
213
- //#region src/utils/defaults.d.ts
214
- type SetCtxDefaultsOptions<T extends ListrContext = ListrContext> = Partial<T>;
215
- interface SetCtxAssignOptions<K = Record<PropertyKey, any>> {
216
- from: K;
217
- keys: (keyof K)[];
218
- }
219
- declare function setCtxDefaults<T extends ListrContext = ListrContext>(ctx: T, ...defaults: SetCtxDefaultsOptions<T>[]): void;
220
- declare function setCtxAssign<T extends ListrContext = ListrContext, K = Record<PropertyKey, any>>(ctx: T, ...assigns: SetCtxAssignOptions<K>[]): void;
221
- //#endregion
222
- //#region src/utils/environment.d.ts
223
- declare function isVerbose(logLevel: LogLevels): boolean;
224
- declare function isDebug(logLevel: LogLevels): boolean;
225
- declare function isSilent(logLevel: LogLevels): boolean;
226
- //#endregion
227
- //#region src/utils/guards.d.ts
228
- declare function isHookedWithShouldRunBefore<T extends Command$1 = Command$1>(command: T): command is T & ShouldRunBeforeHook;
229
- declare function isHookedWithShouldRunAfter<T extends Command$1 = Command$1>(command: T): command is T & ShouldRunAfterHook<any>;
230
- declare function isHookedWithRegister<T extends Command$1 = Command$1>(command: T): command is T & RegisterHook;
231
- //#endregion
232
- //#region src/utils/merge.constants.d.ts
233
- declare enum MergeStrategy {
234
- OVERWRITE = "OVERWRITE",
235
- EXTEND = "EXTEND",
236
- }
237
- //#endregion
238
- //#region src/utils/merge.d.ts
239
- /** Merge objects deep from overwriting the properties from source to target.
240
- * Does not mutate the object */
241
- declare function merge<T extends Record<PropertyKey, any> | any[]>(strategy: MergeStrategy, ...source: Partial<T>[]): T;
242
- declare function uniqueArrayFilter(value: any, index: any, self: string | any[]): boolean;
243
- //#endregion
244
- //#region src/lib/locker/locker.interface.d.ts
245
- interface CommonLockerData {
246
- path?: string | string[];
247
- enabled?: boolean;
248
- root?: boolean;
249
- }
250
- type LockableData = any;
251
- interface LockData<T extends LockableData = LockableData> extends Partial<CommonLockerData> {
252
- data: T;
253
- merge?: MergeStrategy;
254
- }
255
- interface UnlockData extends CommonLockerData {
256
- path: string | string[];
257
- }
258
- interface LockerServiceOptions {
259
- file: string;
260
- parser: ClassType<GenericParser>;
261
- root?: string[];
262
- context?: string;
263
- token?: InjectionToken;
264
- }
265
- //#endregion
266
- //#region src/lib/locker/locker.service.d.ts
267
- declare class LockerService<LockFile extends LockableData = LockableData> {
268
- private readonly logger;
269
- private readonly fs;
270
- private readonly parser;
271
- private readonly options;
272
- readonly op: typeof op;
273
- private toLock;
274
- private toUnlock;
275
- constructor(logger: LoggerService, fs: FileSystemService, parser: ParserService, options: LockerServiceOptions);
276
- hasLock(): boolean;
277
- hasUnlock(): boolean;
278
- addLock<T extends LockableData = LockFile>(...data: LockData<T>[]): void;
279
- addUnlock(...data: UnlockData[]): void;
280
- applyLockAll(lock: LockFile): Promise<LockFile>;
281
- lockAll(): Promise<void>;
282
- applyUnlockAll(lock: LockFile): Promise<LockFile>;
283
- unlockAll(): Promise<void>;
284
- all(): Promise<void>;
285
- applyAll(lock: LockFile): Promise<LockFile>;
286
- applyLock<T extends LockableData = LockFile>(lock: LockFile, ...data: LockData<T>[]): Promise<LockFile>;
287
- lock<T extends LockableData = LockFile>(...data: LockData<T>[]): Promise<LockFile>;
288
- applyUnlock(lock: LockFile, ...data: UnlockData[]): Promise<LockFile>;
289
- unlock(...data: UnlockData[]): Promise<LockFile | undefined>;
290
- read(): Promise<LockFile>;
291
- tryRead(): Promise<LockFile | undefined>;
292
- tryRemove(): Promise<void>;
293
- write(data: LockFile): Promise<void>;
294
- private buildPath;
295
- private normalizePath;
296
- }
297
- //#endregion
298
- //#region src/lib/locker/locker.module.d.ts
299
- declare class LockerModule {
300
- static forFeature(options: LockerServiceOptions): DynamicModule$1;
301
- }
302
- //#endregion
303
- //#region src/lib/config/config.service.d.ts
304
- declare class ConfigService {
305
- private readonly parser;
306
- private readonly logger;
307
- defaults: string;
308
- root: string;
309
- config: GlobalConfig;
310
- oclif: Config;
311
- command: typeof Command$1;
312
- constructor(parser: ParserService, logger: LoggerService, options: ConfigModuleOptions);
313
- get isVerbose(): boolean;
314
- get isDebug(): boolean;
315
- get isSilent(): boolean;
316
- get isJson(): boolean;
317
- read<T extends LockableData = LockableData>(path: string): Promise<T>;
318
- extend<T extends LockableData = LockableData>(paths: (string | Partial<T>)[], strategy?: MergeStrategy): Promise<T>;
319
- merge<T extends LockableData = LockableData>(configs: Partial<T>[], strategy?: MergeStrategy): T;
320
- env<T extends LockableData = LockableData>(definition: string | Record<PropertyKey, any>, config: T): Promise<T>;
321
- write<T extends LockableData = LockableData>(path: string, data: T): Promise<void>;
322
- }
323
- //#endregion
324
- //#region src/lib/config/config.module.d.ts
325
- declare class ConfigModule {}
326
- //#endregion
327
- //#region src/lib/logo/logo.constants.d.ts
328
- declare const TOKEN_LOGO_GENERATOR: InjectionToken;
329
- //#endregion
330
- //#region src/lib/logo/logo.service.d.ts
331
- declare class LogoService {
332
- readonly cs: ConfigService;
333
- private generator;
334
- constructor(cs: ConfigService, moduleRef: ModuleRef);
335
- generate(): void;
336
- shouldBeSilent(): boolean;
337
- write(...data: string[]): void;
338
- }
339
- //#endregion
340
- //#region src/lib/logo/logo.interface.d.ts
341
- type LogoGeneratorFn = (this: LogoService) => void;
342
- //#endregion
343
- //#region src/lib/logo/logo.module.d.ts
344
- declare class LogoModule {}
345
- //#endregion
346
- //#region src/lib/validator/validator.constants.d.ts
347
- declare const TOKEN_VALIDATOR_SERVICE_OPTIONS: InjectionToken;
348
- //#endregion
349
- //#region src/lib/validator/validator.interface.d.ts
350
- interface ValidatorServiceOptions {
351
- validator?: ValidatorOptions;
352
- transformer?: ClassTransformOptions;
353
- }
354
- //#endregion
355
- //#region src/lib/validator/validator.module.d.ts
356
- declare class ValidatorModule {}
357
- //#endregion
358
- //#region src/lib/validator/validator.service.d.ts
359
- declare class ValidatorService {
360
- private readonly logger;
361
- private options;
362
- constructor(logger: LoggerService, moduleRef: ModuleRef);
363
- validate<T extends Record<PropertyKey, any>>(classType: ClassType<T>, object: T, options?: ValidatorServiceOptions): Promise<T>;
364
- validateSync<T extends Record<PropertyKey, any>>(classType: ClassType<T>, object: T, options?: ValidatorServiceOptions): T;
365
- private logValidationError;
366
- }
367
- //#endregion
368
- //#region src/lib/setup.d.ts
369
- declare function setup(): Promise<void>;
370
- //#endregion
371
- //#region src/lib/cli.interface.d.ts
372
- interface CliModuleOptions {
373
- config: ConfigModuleOptions;
374
- }
375
- //#endregion
376
- //#region src/lib/cli.module.d.ts
377
- declare class CliModule {
378
- static forRoot(options: CliModuleOptions): DynamicModule$1;
379
- static forMinimum(): DynamicModule$1;
380
- static create(cls: DynamicModule$1): Promise<INestApplicationContext>;
381
- }
382
- //#endregion
383
- //#region src/interfaces/hooks.interface.d.ts
384
- declare class ShouldRunBeforeHook {
385
- shouldRunBefore(): void | Promise<void>;
386
- }
387
- declare class ShouldRunAfterHook<Ctx extends ListrContext = ListrContext> {
388
- shouldRunAfter(ctx: Ctx): void | Promise<void>;
389
- }
390
- declare class RegisterHook {
391
- register(cli: DynamicModule$1, options: CliModuleOptions): DynamicModule$1 | Promise<DynamicModule$1>;
392
- }
393
- //#endregion
394
- //#region src/interfaces/oclif.interface.d.ts
395
- type InferFlags<T extends typeof Command$1> = Interfaces.InferredFlags<(typeof Command$1)['baseFlags'] & T['flags']>;
396
- type InferArgs<T extends typeof Command$1> = Interfaces.InferredArgs<T['args']>;
397
- //#endregion
398
- //#region src/interfaces/type-helper.interface.d.ts
399
- /**
400
- * Makes the object deep partial.
401
- */
402
- type DeepPartial<T> = { [P in keyof T]?: DeepPartial<T[P]> };
403
- //#endregion
404
- //#region src/commands/base.command.d.ts
405
- declare abstract class Command<T extends typeof Command$1 = typeof Command$1, Ctx extends ListrContext = ListrContext> extends Command$1 {
406
- static baseFlags: {
407
- "log-level": _oclif_core_lib_interfaces0.OptionFlag<string, _oclif_core_lib_interfaces0.CustomOptions>;
408
- ci: _oclif_core_lib_interfaces0.BooleanFlag<boolean>;
409
- json: _oclif_core_lib_interfaces0.BooleanFlag<boolean>;
410
- };
411
- logger: LoggerService;
412
- tasks: Manager<Ctx>;
413
- app: INestApplicationContext;
414
- flags: InferFlags<T>;
415
- args: InferArgs<T>;
416
- exit(code?: number): never;
417
- /** Run all tasks from task manager. */
418
- runTasks<C extends Ctx = Ctx>(): Promise<C>;
419
- protected setCtxDefaults<T extends Ctx = Ctx>(...defaults: SetCtxDefaultsOptions<T>[]): void;
420
- protected setCtxAssign<K = Record<PropertyKey, any>>(...assigns: SetCtxAssignOptions<K>[]): void;
421
- protected pipeProcessToLogger(instance: ChildProcess, options?: PipeProcessToLoggerOptions): ChildProcess;
422
- protected pipeProcessThroughListr(instance: ChildProcess, task: ListrTaskWrapper<any, any, any>): ChildProcess;
423
- /** Initial functions / constructor */
424
- protected init(): Promise<void>;
425
- /** Tasks to run before end of the command. */
426
- protected finally<C extends Ctx = Ctx>(err: Error | undefined): Promise<{
427
- ctx: C;
428
- }>;
429
- /** Catch any error occurred during command. */
430
- protected catch(err: Error): Promise<never>;
431
- abstract run(): Promise<any>;
432
- }
433
- //#endregion
434
- //#region src/constants/file.constants.d.ts
435
- declare enum FileConstants {
436
- CONFIG_SERVICE_DEFAULTS_DIR = "config",
437
- }
438
- //#endregion
439
- //#region src/constants/help-groups.constants.d.ts
440
- declare enum HelpGroups {
441
- CLI = "CLI",
442
- }
443
- //#endregion
444
- //#region src/hooks/not-found.hook.d.ts
445
- declare const notFoundHook: Hook<'command_not_found'>;
446
- //#endregion
447
- //#region src/hooks/update-notifier.hook.d.ts
448
- declare const updateNotifierHook: Hook<'init'>;
449
- //#endregion
450
- export { type Arg, type ArgInput, Args, ClassType, CliModule, CliModuleOptions, Command, CommonLockerData, ConfigIterator, ConfigModule, ConfigModuleOptions, ConfigService, DeepPartial, type DynamicModule, EnvironmentVariableParser, FileConstants, FileSystemService, FilesystemModule, type Flag, type FlagInput, Flags, GenericParser, GlobalConfig, HelpGroups, InferArgs, InferFlags, type InferredFlags, Inject, JsonParser, LockData, LockableData, LockerModule, LockerService, LockerServiceOptions, LogFieldStatus, LogLevels, LoggerFormat, LoggerModule, LoggerService, LogoGeneratorFn, LogoModule, LogoService, MergeStrategy, ParserModule, ParserService, PipeProcessToLoggerOptions, RegisterHook, SetCtxAssignOptions, SetCtxDefaultsOptions, ShouldRunAfterHook, ShouldRunBeforeHook, TOKEN_LOGO_GENERATOR, TOKEN_VALIDATOR_SERVICE_OPTIONS, UnlockData, ValidatorModule, ValidatorService, ValidatorServiceOptions, Winston, WinstonService, YamlParser, type fs, isDebug, isHookedWithRegister, isHookedWithShouldRunAfter, isHookedWithShouldRunBefore, isSilent, isVerbose, merge, notFoundHook, pipeProcessThroughListr, pipeProcessToLogger, setCtxAssign, setCtxDefaults, setup, uniqueArrayFilter, updateNotifierHook, ux };
1
+ import { ClassType } from "./interfaces/class.interface.js";
2
+ import { ConfigIterator, ConfigModuleOptions, GlobalConfig } from "./lib/config/config.interface.js";
3
+ import { GenericParser } from "./lib/parser/parser.interface.js";
4
+ import { pipeProcessThroughListr } from "./lib/logger/pipe/pipe-process-to-listr.js";
5
+ import { LogFieldStatus, LogLevels } from "./lib/logger/logger.constants.js";
6
+ import { PipeProcessToLoggerOptions } from "./lib/logger/pipe/pipe-process-to-logger.interface.js";
7
+ import { LoggerFormat, Winston } from "./lib/logger/logger.interface.js";
8
+ import { WinstonService } from "./lib/logger/winston.service.js";
9
+ import { LoggerService } from "./lib/logger/logger.service.js";
10
+ import { pipeProcessToLogger } from "./lib/logger/pipe/pipe-process-to-logger.js";
11
+ import { LoggerModule } from "./lib/logger/logger.module.js";
12
+ import { EnvironmentVariableParser } from "./lib/parser/fts/env-parser.service.js";
13
+ import { JsonParser } from "./lib/parser/fts/json-parser.service.js";
14
+ import { YamlParser } from "./lib/parser/fts/yaml-parser.service.js";
15
+ import { ParserModule } from "./lib/parser/parser.module.js";
16
+ import { fs } from "./lib/fs/filesystem.interface.js";
17
+ import { FileSystemService } from "./lib/fs/filesystem.service.js";
18
+ import { FilesystemModule } from "./lib/fs/filesystem.module.js";
19
+ import { ParserService } from "./lib/parser/parser.service.js";
20
+ import { SetCtxAssignOptions, SetCtxDefaultsOptions, setCtxAssign, setCtxDefaults } from "./utils/defaults.js";
21
+ import { isDebug, isSilent, isVerbose } from "./utils/environment.js";
22
+ import { isHookedWithRegister, isHookedWithShouldRunAfter, isHookedWithShouldRunBefore } from "./utils/guards.js";
23
+ import { MergeStrategy } from "./utils/merge.constants.js";
24
+ import { merge, uniqueArrayFilter } from "./utils/merge.js";
25
+ import { ux } from "./utils/index.js";
26
+ import { CommonLockerData, LockData, LockableData, LockerServiceOptions, UnlockData } from "./lib/locker/locker.interface.js";
27
+ import { LockerService } from "./lib/locker/locker.service.js";
28
+ import { LockerModule } from "./lib/locker/locker.module.js";
29
+ import { ConfigService } from "./lib/config/config.service.js";
30
+ import { ConfigModule } from "./lib/config/config.module.js";
31
+ import { TOKEN_LOGO_GENERATOR } from "./lib/logo/logo.constants.js";
32
+ import { LogoService } from "./lib/logo/logo.service.js";
33
+ import { LogoGeneratorFn } from "./lib/logo/logo.interface.js";
34
+ import { LogoModule } from "./lib/logo/logo.module.js";
35
+ import { TOKEN_VALIDATOR_SERVICE_OPTIONS } from "./lib/validator/validator.constants.js";
36
+ import { ValidatorServiceOptions } from "./lib/validator/validator.interface.js";
37
+ import { ValidatorModule } from "./lib/validator/validator.module.js";
38
+ import { ValidatorService } from "./lib/validator/validator.service.js";
39
+ import { setup } from "./lib/setup.js";
40
+ import { CliModuleOptions } from "./lib/cli.interface.js";
41
+ import { CliModule } from "./lib/cli.module.js";
42
+ import { RegisterHook, ShouldRunAfterHook, ShouldRunBeforeHook } from "./interfaces/hooks.interface.js";
43
+ import { Arg, ArgInput, Args, Flag, FlagInput, Flags, InferArgs, InferFlags, InferredFlags } from "./interfaces/oclif.interface.js";
44
+ import { DeepPartial } from "./interfaces/type-helper.interface.js";
45
+ import { Command } from "./commands/base.command.js";
46
+ import { FileConstants } from "./constants/file.constants.js";
47
+ import { HelpGroups } from "./constants/help-groups.constants.js";
48
+ import { notFoundHook } from "./hooks/not-found.hook.js";
49
+ import { updateNotifierHook } from "./hooks/update-notifier.hook.js";
50
+ import { DynamicModule, Inject } from "@nestjs/common";
51
+ export { Arg, ArgInput, Args, ClassType, CliModule, CliModuleOptions, Command, CommonLockerData, ConfigIterator, ConfigModule, ConfigModuleOptions, ConfigService, DeepPartial, type DynamicModule, EnvironmentVariableParser, FileConstants, FileSystemService, FilesystemModule, Flag, FlagInput, Flags, GenericParser, GlobalConfig, HelpGroups, InferArgs, InferFlags, InferredFlags, Inject, JsonParser, LockData, LockableData, LockerModule, LockerService, LockerServiceOptions, LogFieldStatus, LogLevels, LoggerFormat, LoggerModule, LoggerService, LogoGeneratorFn, LogoModule, LogoService, MergeStrategy, ParserModule, ParserService, PipeProcessToLoggerOptions, RegisterHook, SetCtxAssignOptions, SetCtxDefaultsOptions, ShouldRunAfterHook, ShouldRunBeforeHook, TOKEN_LOGO_GENERATOR, TOKEN_VALIDATOR_SERVICE_OPTIONS, UnlockData, ValidatorModule, ValidatorService, ValidatorServiceOptions, Winston, WinstonService, YamlParser, fs, isDebug, isHookedWithRegister, isHookedWithShouldRunAfter, isHookedWithShouldRunBefore, isSilent, isVerbose, merge, notFoundHook, pipeProcessThroughListr, pipeProcessToLogger, setCtxAssign, setCtxDefaults, setup, uniqueArrayFilter, updateNotifierHook, ux };