@sidekick-coder/zenith-kit 0.0.11 → 0.0.12

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.
@@ -1,11 +1,1004 @@
1
- import * as v from "valibot";
2
1
  import { ChildProcess } from "node:child_process";
2
+ import * as v from "valibot";
3
+ import { InferOutput } from "valibot";
4
+ import cp from "child_process";
5
+ import ms from "ms";
6
+ import { S3Client } from "@aws-sdk/client-s3";
7
+ import dotenv from "dotenv";
8
+ import chalk from "chalk";
3
9
  import { Request as Request$1, Response as Response$1 } from "express";
4
10
  import UploadService from "#server/services/upload.service.ts";
5
11
  import CookieService from "#shared/services/cookie.service.ts";
6
12
  import Acl from "#server/entities/acl.entity.ts";
7
13
  import { ColumnType, Generated, Kysely } from "kysely";
8
14
 
15
+ //#region node_modules/commander/typings/index.d.ts
16
+ // Type definitions for commander
17
+ // Original definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>
18
+ /* eslint-disable @typescript-eslint/no-explicit-any */
19
+ // This is a trick to encourage editor to suggest the known literals while still
20
+ // allowing any BaseType value.
21
+ // References:
22
+ // - https://github.com/microsoft/TypeScript/issues/29729
23
+ // - https://github.com/sindresorhus/type-fest/blob/main/source/literal-union.d.ts
24
+ // - https://github.com/sindresorhus/type-fest/blob/main/source/primitive.d.ts
25
+ type LiteralUnion<LiteralType, BaseType extends string | number> = LiteralType | (BaseType & Record<never, never>);
26
+ declare class CommanderError extends Error {
27
+ code: string;
28
+ exitCode: number;
29
+ message: string;
30
+ nestedError?: string;
31
+ /**
32
+ * Constructs the CommanderError class
33
+ * @param exitCode - suggested exit code which could be used with process.exit
34
+ * @param code - an id string representing the error
35
+ * @param message - human-readable description of the error
36
+ */
37
+ constructor(exitCode: number, code: string, message: string);
38
+ }
39
+ // deprecated old name
40
+ interface ErrorOptions {
41
+ // optional parameter for error()
42
+ /** an id string representing the error */
43
+ code?: string;
44
+ /** suggested exit code which could be used with process.exit */
45
+ exitCode?: number;
46
+ }
47
+ declare class Argument {
48
+ description: string;
49
+ required: boolean;
50
+ variadic: boolean;
51
+ defaultValue?: any;
52
+ defaultValueDescription?: string;
53
+ parseArg?: <T>(value: string, previous: T) => T;
54
+ argChoices?: string[];
55
+ /**
56
+ * Initialize a new command argument with the given name and description.
57
+ * The default is that the argument is required, and you can explicitly
58
+ * indicate this with <> around the name. Put [] around the name for an optional argument.
59
+ */
60
+ constructor(arg: string, description?: string);
61
+ /**
62
+ * Return argument name.
63
+ */
64
+ name(): string;
65
+ /**
66
+ * Set the default value, and optionally supply the description to be displayed in the help.
67
+ */
68
+ default(value: unknown, description?: string): this;
69
+ /**
70
+ * Set the custom handler for processing CLI command arguments into argument values.
71
+ */
72
+ argParser<T>(fn: (value: string, previous: T) => T): this;
73
+ /**
74
+ * Only allow argument value to be one of choices.
75
+ */
76
+ choices(values: readonly string[]): this;
77
+ /**
78
+ * Make argument required.
79
+ */
80
+ argRequired(): this;
81
+ /**
82
+ * Make argument optional.
83
+ */
84
+ argOptional(): this;
85
+ }
86
+ declare class Option {
87
+ flags: string;
88
+ description: string;
89
+ required: boolean; // A value must be supplied when the option is specified.
90
+ optional: boolean; // A value is optional when the option is specified.
91
+ variadic: boolean;
92
+ mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.
93
+ short?: string;
94
+ long?: string;
95
+ negate: boolean;
96
+ defaultValue?: any;
97
+ defaultValueDescription?: string;
98
+ presetArg?: unknown;
99
+ envVar?: string;
100
+ parseArg?: <T>(value: string, previous: T) => T;
101
+ hidden: boolean;
102
+ argChoices?: string[];
103
+ helpGroupHeading?: string;
104
+ constructor(flags: string, description?: string);
105
+ /**
106
+ * Set the default value, and optionally supply the description to be displayed in the help.
107
+ */
108
+ default(value: unknown, description?: string): this;
109
+ /**
110
+ * Preset to use when option used without option-argument, especially optional but also boolean and negated.
111
+ * The custom processing (parseArg) is called.
112
+ *
113
+ * @example
114
+ * ```ts
115
+ * new Option('--color').default('GREYSCALE').preset('RGB');
116
+ * new Option('--donate [amount]').preset('20').argParser(parseFloat);
117
+ * ```
118
+ */
119
+ preset(arg: unknown): this;
120
+ /**
121
+ * Add option name(s) that conflict with this option.
122
+ * An error will be displayed if conflicting options are found during parsing.
123
+ *
124
+ * @example
125
+ * ```ts
126
+ * new Option('--rgb').conflicts('cmyk');
127
+ * new Option('--js').conflicts(['ts', 'jsx']);
128
+ * ```
129
+ */
130
+ conflicts(names: string | string[]): this;
131
+ /**
132
+ * Specify implied option values for when this option is set and the implied options are not.
133
+ *
134
+ * The custom processing (parseArg) is not called on the implied values.
135
+ *
136
+ * @example
137
+ * program
138
+ * .addOption(new Option('--log', 'write logging information to file'))
139
+ * .addOption(new Option('--trace', 'log extra details').implies({ log: 'trace.txt' }));
140
+ */
141
+ implies(optionValues: OptionValues): this;
142
+ /**
143
+ * Set environment variable to check for option value.
144
+ *
145
+ * An environment variables is only used if when processed the current option value is
146
+ * undefined, or the source of the current value is 'default' or 'config' or 'env'.
147
+ */
148
+ env(name: string): this;
149
+ /**
150
+ * Set the custom handler for processing CLI option arguments into option values.
151
+ */
152
+ argParser<T>(fn: (value: string, previous: T) => T): this;
153
+ /**
154
+ * Whether the option is mandatory and must have a value after parsing.
155
+ */
156
+ makeOptionMandatory(mandatory?: boolean): this;
157
+ /**
158
+ * Hide option in help.
159
+ */
160
+ hideHelp(hide?: boolean): this;
161
+ /**
162
+ * Only allow option value to be one of choices.
163
+ */
164
+ choices(values: readonly string[]): this;
165
+ /**
166
+ * Return option name.
167
+ */
168
+ name(): string;
169
+ /**
170
+ * Return option name, in a camelcase format that can be used
171
+ * as an object attribute key.
172
+ */
173
+ attributeName(): string;
174
+ /**
175
+ * Set the help group heading.
176
+ */
177
+ helpGroup(heading: string): this;
178
+ /**
179
+ * Return whether a boolean option.
180
+ *
181
+ * Options are one of boolean, negated, required argument, or optional argument.
182
+ */
183
+ isBoolean(): boolean;
184
+ }
185
+ declare class Help {
186
+ /** output helpWidth, long lines are wrapped to fit */
187
+ helpWidth?: number;
188
+ minWidthToWrap: number;
189
+ sortSubcommands: boolean;
190
+ sortOptions: boolean;
191
+ showGlobalOptions: boolean;
192
+ constructor();
193
+ /*
194
+ * prepareContext is called by Commander after applying overrides from `Command.configureHelp()`
195
+ * and just before calling `formatHelp()`.
196
+ *
197
+ * Commander just uses the helpWidth and the others are provided for subclasses.
198
+ */
199
+ prepareContext(contextOptions: {
200
+ error?: boolean;
201
+ helpWidth?: number;
202
+ outputHasColors?: boolean;
203
+ }): void;
204
+ /** Get the command term to show in the list of subcommands. */
205
+ subcommandTerm(cmd: Command): string;
206
+ /** Get the command summary to show in the list of subcommands. */
207
+ subcommandDescription(cmd: Command): string;
208
+ /** Get the option term to show in the list of options. */
209
+ optionTerm(option: Option): string;
210
+ /** Get the option description to show in the list of options. */
211
+ optionDescription(option: Option): string;
212
+ /** Get the argument term to show in the list of arguments. */
213
+ argumentTerm(argument: Argument): string;
214
+ /** Get the argument description to show in the list of arguments. */
215
+ argumentDescription(argument: Argument): string;
216
+ /** Get the command usage to be displayed at the top of the built-in help. */
217
+ commandUsage(cmd: Command): string;
218
+ /** Get the description for the command. */
219
+ commandDescription(cmd: Command): string;
220
+ /** Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. */
221
+ visibleCommands(cmd: Command): Command[];
222
+ /** Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. */
223
+ visibleOptions(cmd: Command): Option[];
224
+ /** Get an array of the visible global options. (Not including help.) */
225
+ visibleGlobalOptions(cmd: Command): Option[];
226
+ /** Get an array of the arguments which have descriptions. */
227
+ visibleArguments(cmd: Command): Argument[];
228
+ /** Get the longest command term length. */
229
+ longestSubcommandTermLength(cmd: Command, helper: Help): number;
230
+ /** Get the longest option term length. */
231
+ longestOptionTermLength(cmd: Command, helper: Help): number;
232
+ /** Get the longest global option term length. */
233
+ longestGlobalOptionTermLength(cmd: Command, helper: Help): number;
234
+ /** Get the longest argument term length. */
235
+ longestArgumentTermLength(cmd: Command, helper: Help): number;
236
+ /** Return display width of string, ignoring ANSI escape sequences. Used in padding and wrapping calculations. */
237
+ displayWidth(str: string): number;
238
+ /** Style the titles. Called with 'Usage:', 'Options:', etc. */
239
+ styleTitle(title: string): string;
240
+ /** Usage: <str> */
241
+ styleUsage(str: string): string;
242
+ /** Style for command name in usage string. */
243
+ styleCommandText(str: string): string;
244
+ styleCommandDescription(str: string): string;
245
+ styleOptionDescription(str: string): string;
246
+ styleSubcommandDescription(str: string): string;
247
+ styleArgumentDescription(str: string): string;
248
+ /** Base style used by descriptions. */
249
+ styleDescriptionText(str: string): string;
250
+ styleOptionTerm(str: string): string;
251
+ styleSubcommandTerm(str: string): string;
252
+ styleArgumentTerm(str: string): string;
253
+ /** Base style used in terms and usage for options. */
254
+ styleOptionText(str: string): string;
255
+ /** Base style used in terms and usage for subcommands. */
256
+ styleSubcommandText(str: string): string;
257
+ /** Base style used in terms and usage for arguments. */
258
+ styleArgumentText(str: string): string;
259
+ /** Calculate the pad width from the maximum term length. */
260
+ padWidth(cmd: Command, helper: Help): number;
261
+ /**
262
+ * Wrap a string at whitespace, preserving existing line breaks.
263
+ * Wrapping is skipped if the width is less than `minWidthToWrap`.
264
+ */
265
+ boxWrap(str: string, width: number): string;
266
+ /** Detect manually wrapped and indented strings by checking for line break followed by whitespace. */
267
+ preformatted(str: string): boolean;
268
+ /**
269
+ * Format the "item", which consists of a term and description. Pad the term and wrap the description, indenting the following lines.
270
+ *
271
+ * So "TTT", 5, "DDD DDDD DD DDD" might be formatted for this.helpWidth=17 like so:
272
+ * TTT DDD DDDD
273
+ * DD DDD
274
+ */
275
+ formatItem(term: string, termWidth: number, description: string, helper: Help): string;
276
+ /**
277
+ * Format a list of items, given a heading and an array of formatted items.
278
+ */
279
+ formatItemList(heading: string, items: string[], helper: Help): string[];
280
+ /**
281
+ * Group items by their help group heading.
282
+ */
283
+ groupItems<T extends Command | Option>(unsortedItems: T[], visibleItems: T[], getGroup: (item: T) => string): Map<string, T[]>;
284
+ /** Generate the built-in help text. */
285
+ formatHelp(cmd: Command, helper: Help): string;
286
+ }
287
+ type HelpConfiguration = Partial<Help>;
288
+ interface ParseOptions {
289
+ from: 'node' | 'electron' | 'user';
290
+ }
291
+ interface HelpContext {
292
+ // optional parameter for .help() and .outputHelp()
293
+ error: boolean;
294
+ }
295
+ interface AddHelpTextContext {
296
+ // passed to text function used with .addHelpText()
297
+ error: boolean;
298
+ command: Command;
299
+ }
300
+ interface OutputConfiguration {
301
+ writeOut?(str: string): void;
302
+ writeErr?(str: string): void;
303
+ outputError?(str: string, write: (str: string) => void): void;
304
+ getOutHelpWidth?(): number;
305
+ getErrHelpWidth?(): number;
306
+ getOutHasColors?(): boolean;
307
+ getErrHasColors?(): boolean;
308
+ stripColor?(str: string): string;
309
+ }
310
+ type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';
311
+ type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
312
+ // The source is a string so author can define their own too.
313
+ type OptionValueSource = LiteralUnion<'default' | 'config' | 'env' | 'cli' | 'implied', string> | undefined;
314
+ type OptionValues = Record<string, any>;
315
+ declare class Command {
316
+ args: string[];
317
+ processedArgs: any[];
318
+ readonly commands: readonly Command[];
319
+ readonly options: readonly Option[];
320
+ readonly registeredArguments: readonly Argument[];
321
+ parent: Command | null;
322
+ constructor(name?: string);
323
+ /**
324
+ * Set the program version to `str`.
325
+ *
326
+ * This method auto-registers the "-V, --version" flag
327
+ * which will print the version number when passed.
328
+ *
329
+ * You can optionally supply the flags and description to override the defaults.
330
+ */
331
+ version(str: string, flags?: string, description?: string): this;
332
+ /**
333
+ * Get the program version.
334
+ */
335
+ version(): string | undefined;
336
+ /**
337
+ * Define a command, implemented using an action handler.
338
+ *
339
+ * @remarks
340
+ * The command description is supplied using `.description`, not as a parameter to `.command`.
341
+ *
342
+ * @example
343
+ * ```ts
344
+ * program
345
+ * .command('clone <source> [destination]')
346
+ * .description('clone a repository into a newly created directory')
347
+ * .action((source, destination) => {
348
+ * console.log('clone command called');
349
+ * });
350
+ * ```
351
+ *
352
+ * @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
353
+ * @param opts - configuration options
354
+ * @returns new command
355
+ */
356
+ command(nameAndArgs: string, opts?: CommandOptions$1): ReturnType<this['createCommand']>;
357
+ /**
358
+ * Define a command, implemented in a separate executable file.
359
+ *
360
+ * @remarks
361
+ * The command description is supplied as the second parameter to `.command`.
362
+ *
363
+ * @example
364
+ * ```ts
365
+ * program
366
+ * .command('start <service>', 'start named service')
367
+ * .command('stop [service]', 'stop named service, or all if no name supplied');
368
+ * ```
369
+ *
370
+ * @param nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
371
+ * @param description - description of executable command
372
+ * @param opts - configuration options
373
+ * @returns `this` command for chaining
374
+ */
375
+ command(nameAndArgs: string, description: string, opts?: ExecutableCommandOptions): this;
376
+ /**
377
+ * Factory routine to create a new unattached command.
378
+ *
379
+ * See .command() for creating an attached subcommand, which uses this routine to
380
+ * create the command. You can override createCommand to customise subcommands.
381
+ */
382
+ createCommand(name?: string): Command;
383
+ /**
384
+ * Add a prepared subcommand.
385
+ *
386
+ * See .command() for creating an attached subcommand which inherits settings from its parent.
387
+ *
388
+ * @returns `this` command for chaining
389
+ */
390
+ addCommand(cmd: Command, opts?: CommandOptions$1): this;
391
+ /**
392
+ * Factory routine to create a new unattached argument.
393
+ *
394
+ * See .argument() for creating an attached argument, which uses this routine to
395
+ * create the argument. You can override createArgument to return a custom argument.
396
+ */
397
+ createArgument(name: string, description?: string): Argument;
398
+ /**
399
+ * Define argument syntax for command.
400
+ *
401
+ * The default is that the argument is required, and you can explicitly
402
+ * indicate this with <> around the name. Put [] around the name for an optional argument.
403
+ *
404
+ * @example
405
+ * ```
406
+ * program.argument('<input-file>');
407
+ * program.argument('[output-file]');
408
+ * ```
409
+ *
410
+ * @returns `this` command for chaining
411
+ */
412
+ argument<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
413
+ argument(name: string, description?: string, defaultValue?: unknown): this;
414
+ /**
415
+ * Define argument syntax for command, adding a prepared argument.
416
+ *
417
+ * @returns `this` command for chaining
418
+ */
419
+ addArgument(arg: Argument): this;
420
+ /**
421
+ * Define argument syntax for command, adding multiple at once (without descriptions).
422
+ *
423
+ * See also .argument().
424
+ *
425
+ * @example
426
+ * ```
427
+ * program.arguments('<cmd> [env]');
428
+ * ```
429
+ *
430
+ * @returns `this` command for chaining
431
+ */
432
+ arguments(names: string): this;
433
+ /**
434
+ * Customise or override default help command. By default a help command is automatically added if your command has subcommands.
435
+ *
436
+ * @example
437
+ * ```ts
438
+ * program.helpCommand('help [cmd]');
439
+ * program.helpCommand('help [cmd]', 'show help');
440
+ * program.helpCommand(false); // suppress default help command
441
+ * program.helpCommand(true); // add help command even if no subcommands
442
+ * ```
443
+ */
444
+ helpCommand(nameAndArgs: string, description?: string): this;
445
+ helpCommand(enable: boolean): this;
446
+ /**
447
+ * Add prepared custom help command.
448
+ */
449
+ addHelpCommand(cmd: Command): this;
450
+ /** @deprecated since v12, instead use helpCommand */
451
+ addHelpCommand(nameAndArgs: string, description?: string): this;
452
+ /** @deprecated since v12, instead use helpCommand */
453
+ addHelpCommand(enable?: boolean): this;
454
+ /**
455
+ * Add hook for life cycle event.
456
+ */
457
+ hook(event: HookEvent, listener: (thisCommand: Command, actionCommand: Command) => void | Promise<void>): this;
458
+ /**
459
+ * Register callback to use as replacement for calling process.exit.
460
+ */
461
+ exitOverride(callback?: (err: CommanderError) => never | void): this;
462
+ /**
463
+ * Display error message and exit (or call exitOverride).
464
+ */
465
+ error(message: string, errorOptions?: ErrorOptions): never;
466
+ /**
467
+ * You can customise the help with a subclass of Help by overriding createHelp,
468
+ * or by overriding Help properties using configureHelp().
469
+ */
470
+ createHelp(): Help;
471
+ /**
472
+ * You can customise the help by overriding Help properties using configureHelp(),
473
+ * or with a subclass of Help by overriding createHelp().
474
+ */
475
+ configureHelp(configuration: HelpConfiguration): this;
476
+ /** Get configuration */
477
+ configureHelp(): HelpConfiguration;
478
+ /**
479
+ * The default output goes to stdout and stderr. You can customise this for special
480
+ * applications. You can also customise the display of errors by overriding outputError.
481
+ *
482
+ * The configuration properties are all functions:
483
+ * ```
484
+ * // functions to change where being written, stdout and stderr
485
+ * writeOut(str)
486
+ * writeErr(str)
487
+ * // matching functions to specify width for wrapping help
488
+ * getOutHelpWidth()
489
+ * getErrHelpWidth()
490
+ * // functions based on what is being written out
491
+ * outputError(str, write) // used for displaying errors, and not used for displaying help
492
+ * ```
493
+ */
494
+ configureOutput(configuration: OutputConfiguration): this;
495
+ /** Get configuration */
496
+ configureOutput(): OutputConfiguration;
497
+ /**
498
+ * Copy settings that are useful to have in common across root command and subcommands.
499
+ *
500
+ * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
501
+ */
502
+ copyInheritedSettings(sourceCommand: Command): this;
503
+ /**
504
+ * Display the help or a custom message after an error occurs.
505
+ */
506
+ showHelpAfterError(displayHelp?: boolean | string): this;
507
+ /**
508
+ * Display suggestion of similar commands for unknown commands, or options for unknown options.
509
+ */
510
+ showSuggestionAfterError(displaySuggestion?: boolean): this;
511
+ /**
512
+ * Register callback `fn` for the command.
513
+ *
514
+ * @example
515
+ * ```
516
+ * program
517
+ * .command('serve')
518
+ * .description('start service')
519
+ * .action(function() {
520
+ * // do work here
521
+ * });
522
+ * ```
523
+ *
524
+ * @returns `this` command for chaining
525
+ */
526
+ action(fn: (this: this, ...args: any[]) => void | Promise<void>): this;
527
+ /**
528
+ * Define option with `flags`, `description`, and optional argument parsing function or `defaultValue` or both.
529
+ *
530
+ * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space. A required
531
+ * option-argument is indicated by `<>` and an optional option-argument by `[]`.
532
+ *
533
+ * See the README for more details, and see also addOption() and requiredOption().
534
+ *
535
+ * @example
536
+ *
537
+ * ```js
538
+ * program
539
+ * .option('-p, --pepper', 'add pepper')
540
+ * .option('--pt, --pizza-type <TYPE>', 'type of pizza') // required option-argument
541
+ * .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
542
+ * .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function
543
+ * ```
544
+ *
545
+ * @returns `this` command for chaining
546
+ */
547
+ option(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
548
+ option<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
549
+ /** @deprecated since v7, instead use choices or a custom function */
550
+ option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
551
+ /**
552
+ * Define a required option, which must have a value after parsing. This usually means
553
+ * the option must be specified on the command line. (Otherwise the same as .option().)
554
+ *
555
+ * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
556
+ */
557
+ requiredOption(flags: string, description?: string, defaultValue?: string | boolean | string[]): this;
558
+ requiredOption<T>(flags: string, description: string, parseArg: (value: string, previous: T) => T, defaultValue?: T): this;
559
+ /** @deprecated since v7, instead use choices or a custom function */
560
+ requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean | string[]): this;
561
+ /**
562
+ * Factory routine to create a new unattached option.
563
+ *
564
+ * See .option() for creating an attached option, which uses this routine to
565
+ * create the option. You can override createOption to return a custom option.
566
+ */
567
+ createOption(flags: string, description?: string): Option;
568
+ /**
569
+ * Add a prepared Option.
570
+ *
571
+ * See .option() and .requiredOption() for creating and attaching an option in a single call.
572
+ */
573
+ addOption(option: Option): this;
574
+ /**
575
+ * Whether to store option values as properties on command object,
576
+ * or store separately (specify false). In both cases the option values can be accessed using .opts().
577
+ *
578
+ * @returns `this` command for chaining
579
+ */
580
+ storeOptionsAsProperties<T extends OptionValues>(): this & T;
581
+ storeOptionsAsProperties<T extends OptionValues>(storeAsProperties: true): this & T;
582
+ storeOptionsAsProperties(storeAsProperties?: boolean): this;
583
+ /**
584
+ * Retrieve option value.
585
+ */
586
+ getOptionValue(key: string): any;
587
+ /**
588
+ * Store option value.
589
+ */
590
+ setOptionValue(key: string, value: unknown): this;
591
+ /**
592
+ * Store option value and where the value came from.
593
+ */
594
+ setOptionValueWithSource(key: string, value: unknown, source: OptionValueSource): this;
595
+ /**
596
+ * Get source of option value.
597
+ */
598
+ getOptionValueSource(key: string): OptionValueSource | undefined;
599
+ /**
600
+ * Get source of option value. See also .optsWithGlobals().
601
+ */
602
+ getOptionValueSourceWithGlobals(key: string): OptionValueSource | undefined;
603
+ /**
604
+ * Alter parsing of short flags with optional values.
605
+ *
606
+ * @example
607
+ * ```
608
+ * // for `.option('-f,--flag [value]'):
609
+ * .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour
610
+ * .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
611
+ * ```
612
+ *
613
+ * @returns `this` command for chaining
614
+ */
615
+ combineFlagAndOptionalValue(combine?: boolean): this;
616
+ /**
617
+ * Allow unknown options on the command line.
618
+ *
619
+ * @returns `this` command for chaining
620
+ */
621
+ allowUnknownOption(allowUnknown?: boolean): this;
622
+ /**
623
+ * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
624
+ *
625
+ * @returns `this` command for chaining
626
+ */
627
+ allowExcessArguments(allowExcess?: boolean): this;
628
+ /**
629
+ * Enable positional options. Positional means global options are specified before subcommands which lets
630
+ * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
631
+ *
632
+ * The default behaviour is non-positional and global options may appear anywhere on the command line.
633
+ *
634
+ * @returns `this` command for chaining
635
+ */
636
+ enablePositionalOptions(positional?: boolean): this;
637
+ /**
638
+ * Pass through options that come after command-arguments rather than treat them as command-options,
639
+ * so actual command-options come before command-arguments. Turning this on for a subcommand requires
640
+ * positional options to have been enabled on the program (parent commands).
641
+ *
642
+ * The default behaviour is non-positional and options may appear before or after command-arguments.
643
+ *
644
+ * @returns `this` command for chaining
645
+ */
646
+ passThroughOptions(passThrough?: boolean): this;
647
+ /**
648
+ * Parse `argv`, setting options and invoking commands when defined.
649
+ *
650
+ * Use parseAsync instead of parse if any of your action handlers are async.
651
+ *
652
+ * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
653
+ *
654
+ * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
655
+ * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
656
+ * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
657
+ * - `'user'`: just user arguments
658
+ *
659
+ * @example
660
+ * ```
661
+ * program.parse(); // parse process.argv and auto-detect electron and special node flags
662
+ * program.parse(process.argv); // assume argv[0] is app and argv[1] is script
663
+ * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
664
+ * ```
665
+ *
666
+ * @returns `this` command for chaining
667
+ */
668
+ parse(argv?: readonly string[], parseOptions?: ParseOptions): this;
669
+ /**
670
+ * Parse `argv`, setting options and invoking commands when defined.
671
+ *
672
+ * Call with no parameters to parse `process.argv`. Detects Electron and special node options like `node --eval`. Easy mode!
673
+ *
674
+ * Or call with an array of strings to parse, and optionally where the user arguments start by specifying where the arguments are `from`:
675
+ * - `'node'`: default, `argv[0]` is the application and `argv[1]` is the script being run, with user arguments after that
676
+ * - `'electron'`: `argv[0]` is the application and `argv[1]` varies depending on whether the electron application is packaged
677
+ * - `'user'`: just user arguments
678
+ *
679
+ * @example
680
+ * ```
681
+ * await program.parseAsync(); // parse process.argv and auto-detect electron and special node flags
682
+ * await program.parseAsync(process.argv); // assume argv[0] is app and argv[1] is script
683
+ * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
684
+ * ```
685
+ *
686
+ * @returns Promise
687
+ */
688
+ parseAsync(argv?: readonly string[], parseOptions?: ParseOptions): Promise<this>;
689
+ /**
690
+ * Called the first time parse is called to save state and allow a restore before subsequent calls to parse.
691
+ * Not usually called directly, but available for subclasses to save their custom state.
692
+ *
693
+ * This is called in a lazy way. Only commands used in parsing chain will have state saved.
694
+ */
695
+ saveStateBeforeParse(): void;
696
+ /**
697
+ * Restore state before parse for calls after the first.
698
+ * Not usually called directly, but available for subclasses to save their custom state.
699
+ *
700
+ * This is called in a lazy way. Only commands used in parsing chain will have state restored.
701
+ */
702
+ restoreStateBeforeParse(): void;
703
+ /**
704
+ * Parse options from `argv` removing known options,
705
+ * and return argv split into operands and unknown arguments.
706
+ *
707
+ * Side effects: modifies command by storing options. Does not reset state if called again.
708
+ *
709
+ * argv => operands, unknown
710
+ * --known kkk op => [op], []
711
+ * op --known kkk => [op], []
712
+ * sub --unknown uuu op => [sub], [--unknown uuu op]
713
+ * sub -- --unknown uuu op => [sub --unknown uuu op], []
714
+ */
715
+ parseOptions(argv: string[]): ParseOptionsResult;
716
+ /**
717
+ * Return an object containing local option values as key-value pairs
718
+ */
719
+ opts<T extends OptionValues>(): T;
720
+ /**
721
+ * Return an object containing merged local and global option values as key-value pairs.
722
+ */
723
+ optsWithGlobals<T extends OptionValues>(): T;
724
+ /**
725
+ * Set the description.
726
+ *
727
+ * @returns `this` command for chaining
728
+ */
729
+ description(str: string): this;
730
+ /** @deprecated since v8, instead use .argument to add command argument with description */
731
+ description(str: string, argsDescription: Record<string, string>): this;
732
+ /**
733
+ * Get the description.
734
+ */
735
+ description(): string;
736
+ /**
737
+ * Set the summary. Used when listed as subcommand of parent.
738
+ *
739
+ * @returns `this` command for chaining
740
+ */
741
+ summary(str: string): this;
742
+ /**
743
+ * Get the summary.
744
+ */
745
+ summary(): string;
746
+ /**
747
+ * Set an alias for the command.
748
+ *
749
+ * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
750
+ *
751
+ * @returns `this` command for chaining
752
+ */
753
+ alias(alias: string): this;
754
+ /**
755
+ * Get alias for the command.
756
+ */
757
+ alias(): string;
758
+ /**
759
+ * Set aliases for the command.
760
+ *
761
+ * Only the first alias is shown in the auto-generated help.
762
+ *
763
+ * @returns `this` command for chaining
764
+ */
765
+ aliases(aliases: readonly string[]): this;
766
+ /**
767
+ * Get aliases for the command.
768
+ */
769
+ aliases(): string[];
770
+ /**
771
+ * Set the command usage.
772
+ *
773
+ * @returns `this` command for chaining
774
+ */
775
+ usage(str: string): this;
776
+ /**
777
+ * Get the command usage.
778
+ */
779
+ usage(): string;
780
+ /**
781
+ * Set the name of the command.
782
+ *
783
+ * @returns `this` command for chaining
784
+ */
785
+ name(str: string): this;
786
+ /**
787
+ * Get the name of the command.
788
+ */
789
+ name(): string;
790
+ /**
791
+ * Set the name of the command from script filename, such as process.argv[1],
792
+ * or require.main.filename, or __filename.
793
+ *
794
+ * (Used internally and public although not documented in README.)
795
+ *
796
+ * @example
797
+ * ```ts
798
+ * program.nameFromFilename(require.main.filename);
799
+ * ```
800
+ *
801
+ * @returns `this` command for chaining
802
+ */
803
+ nameFromFilename(filename: string): this;
804
+ /**
805
+ * Set the directory for searching for executable subcommands of this command.
806
+ *
807
+ * @example
808
+ * ```ts
809
+ * program.executableDir(__dirname);
810
+ * // or
811
+ * program.executableDir('subcommands');
812
+ * ```
813
+ *
814
+ * @returns `this` command for chaining
815
+ */
816
+ executableDir(path: string): this;
817
+ /**
818
+ * Get the executable search directory.
819
+ */
820
+ executableDir(): string | null;
821
+ /**
822
+ * Set the help group heading for this subcommand in parent command's help.
823
+ *
824
+ * @returns `this` command for chaining
825
+ */
826
+ helpGroup(heading: string): this;
827
+ /**
828
+ * Get the help group heading for this subcommand in parent command's help.
829
+ */
830
+ helpGroup(): string;
831
+ /**
832
+ * Set the default help group heading for subcommands added to this command.
833
+ * (This does not override a group set directly on the subcommand using .helpGroup().)
834
+ *
835
+ * @example
836
+ * program.commandsGroup('Development Commands:);
837
+ * program.command('watch')...
838
+ * program.command('lint')...
839
+ * ...
840
+ *
841
+ * @returns `this` command for chaining
842
+ */
843
+ commandsGroup(heading: string): this;
844
+ /**
845
+ * Get the default help group heading for subcommands added to this command.
846
+ */
847
+ commandsGroup(): string;
848
+ /**
849
+ * Set the default help group heading for options added to this command.
850
+ * (This does not override a group set directly on the option using .helpGroup().)
851
+ *
852
+ * @example
853
+ * program
854
+ * .optionsGroup('Development Options:')
855
+ * .option('-d, --debug', 'output extra debugging')
856
+ * .option('-p, --profile', 'output profiling information')
857
+ *
858
+ * @returns `this` command for chaining
859
+ */
860
+ optionsGroup(heading: string): this;
861
+ /**
862
+ * Get the default help group heading for options added to this command.
863
+ */
864
+ optionsGroup(): string;
865
+ /**
866
+ * Output help information for this command.
867
+ *
868
+ * Outputs built-in help, and custom text added using `.addHelpText()`.
869
+ *
870
+ */
871
+ outputHelp(context?: HelpContext): void;
872
+ /** @deprecated since v7 */
873
+ outputHelp(cb: (str: string) => string): void;
874
+ /**
875
+ * Return command help documentation.
876
+ */
877
+ helpInformation(context?: HelpContext): string;
878
+ /**
879
+ * You can pass in flags and a description to override the help
880
+ * flags and help description for your command. Pass in false
881
+ * to disable the built-in help option.
882
+ */
883
+ helpOption(flags?: string | boolean, description?: string): this;
884
+ /**
885
+ * Supply your own option to use for the built-in help option.
886
+ * This is an alternative to using helpOption() to customise the flags and description etc.
887
+ */
888
+ addHelpOption(option: Option): this;
889
+ /**
890
+ * Output help information and exit.
891
+ *
892
+ * Outputs built-in help, and custom text added using `.addHelpText()`.
893
+ */
894
+ help(context?: HelpContext): never;
895
+ /** @deprecated since v7 */
896
+ help(cb: (str: string) => string): never;
897
+ /**
898
+ * Add additional text to be displayed with the built-in help.
899
+ *
900
+ * Position is 'before' or 'after' to affect just this command,
901
+ * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
902
+ */
903
+ addHelpText(position: AddHelpTextPosition, text: string): this;
904
+ addHelpText(position: AddHelpTextPosition, text: (context: AddHelpTextContext) => string): this;
905
+ /**
906
+ * Add a listener (callback) for when events occur. (Implemented using EventEmitter.)
907
+ */
908
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
909
+ }
910
+ interface CommandOptions$1 {
911
+ hidden?: boolean;
912
+ isDefault?: boolean;
913
+ /** @deprecated since v7, replaced by hidden */
914
+ noHelp?: boolean;
915
+ }
916
+ interface ExecutableCommandOptions extends CommandOptions$1 {
917
+ executableFile?: string;
918
+ }
919
+ interface ParseOptionsResult {
920
+ operands: string[];
921
+ unknown: string[];
922
+ }
923
+ //#endregion
924
+ //#region src/server/utils/printTable.d.ts
925
+ interface TableColumn {
926
+ label: string;
927
+ value: string | ((item: any) => string);
928
+ width?: number;
929
+ realWidth?: number;
930
+ }
931
+ interface ObjectOptions {
932
+ keyWidth?: number;
933
+ }
934
+ declare function printObject(output?: any, options?: ObjectOptions): void;
935
+ declare function printTable(items: any[], columns?: TableColumn[]): void;
936
+ //#endregion
937
+ //#region src/server/services/ArtisanService.d.ts
938
+ declare class ArtisanService extends Command {
939
+ needs: Set<string>;
940
+ table: typeof printTable;
941
+ object: typeof printObject;
942
+ colors: chalk.Chalk & chalk.ChalkFunction & {
943
+ supportsColor: chalk.ColorSupport | false;
944
+ Level: chalk.Level;
945
+ Color: ("black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "grey" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright") | ("bgBlack" | "bgRed" | "bgGreen" | "bgYellow" | "bgBlue" | "bgMagenta" | "bgCyan" | "bgWhite" | "bgGray" | "bgGrey" | "bgBlackBright" | "bgRedBright" | "bgGreenBright" | "bgYellowBright" | "bgBlueBright" | "bgMagentaBright" | "bgCyanBright" | "bgWhiteBright");
946
+ ForegroundColor: "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray" | "grey" | "blackBright" | "redBright" | "greenBright" | "yellowBright" | "blueBright" | "magentaBright" | "cyanBright" | "whiteBright";
947
+ BackgroundColor: "bgBlack" | "bgRed" | "bgGreen" | "bgYellow" | "bgBlue" | "bgMagenta" | "bgCyan" | "bgWhite" | "bgGray" | "bgGrey" | "bgBlackBright" | "bgRedBright" | "bgGreenBright" | "bgYellowBright" | "bgBlueBright" | "bgMagentaBright" | "bgCyanBright" | "bgWhiteBright";
948
+ Modifiers: "reset" | "bold" | "dim" | "italic" | "underline" | "inverse" | "hidden" | "strikethrough" | "visible";
949
+ stderr: chalk.Chalk & {
950
+ supportsColor: chalk.ColorSupport | false;
951
+ };
952
+ };
953
+ need(...args: string[]): this;
954
+ createCommand(name?: string): ArtisanService;
955
+ }
956
+ //#endregion
957
+ //#region src/server/services/ArtisanTesterService.d.ts
958
+ declare class ArteTesterService extends ArtisanService {
959
+ constructor();
960
+ add(path: string): Promise<void>;
961
+ execute(args: string[]): Promise<void>;
962
+ }
963
+ //#endregion
964
+ //#region src/shared/services/ConfigService.d.ts
965
+ interface Entry {
966
+ key: string;
967
+ value: any;
968
+ source: string;
969
+ }
970
+ declare class ConfigService {
971
+ entries: Map<string, Entry>;
972
+ constructor();
973
+ list(): Entry[];
974
+ parseValue(value: any): any;
975
+ loadFromRecord(record: Record<string, any>, source?: string): void;
976
+ loadFromEntries(entries: [string, any][], source?: string): void;
977
+ toRecord(): Record<string, any>;
978
+ has(key: string): boolean;
979
+ get<T = any | undefined>(key: string, defaultValue?: any): T;
980
+ getOne<T = any | undefined>(keys: string[], defaultValue?: any): T;
981
+ set(key: string, value: any, source?: string): void;
982
+ unset(key: string): void;
983
+ clear(): void;
984
+ }
985
+ //#endregion
986
+ //#region src/shared/services/ContainerService.d.ts
987
+ type Constructor$1<T = object> = new (...args: any[]) => T;
988
+ type EntryKey = string | symbol | Constructor$1;
989
+ declare class ContainerService {
990
+ private entries;
991
+ loadFromRecord(record: Record<string, any>): void;
992
+ toRecord(): Record<string, any>;
993
+ set(payload: EntryKey, value: any): this;
994
+ has(payload: EntryKey): boolean;
995
+ get<T>(payload: EntryKey): T;
996
+ singleton<T>(classConstructor: Constructor$1<T>): T;
997
+ load(entries: Record<any, any>): void;
998
+ proxy<T = unknown>(key: EntryKey): T;
999
+ keys(): EntryKey[];
1000
+ }
1001
+ //#endregion
9
1002
  //#region src/shared/services/LoggerService.d.ts
10
1003
  declare class LoggerService {
11
1004
  info(message: string, meta?: any): void;
@@ -58,6 +1051,295 @@ declare class EmmitterService$1<Events extends Record<string, any> = Record<stri
58
1051
  hasHandlers(): boolean;
59
1052
  }
60
1053
  //#endregion
1054
+ //#region src/shared/entities/LifecycleHook.d.ts
1055
+ declare class LifecycleHook {
1056
+ hook_id: string;
1057
+ order?: number;
1058
+ subhooks?: LifecycleHook[];
1059
+ constructor();
1060
+ onRegister(): Promise<void>;
1061
+ onLoad(): Promise<void>;
1062
+ onBoot(): Promise<void>;
1063
+ onShutdown(): Promise<void>;
1064
+ }
1065
+ //#endregion
1066
+ //#region src/shared/utils/compose.d.ts
1067
+ type Constructor<T = {}> = new (...args: any[]) => T;
1068
+ //#endregion
1069
+ //#region src/shared/schemas/tokenSchema.d.ts
1070
+ type Token = v.InferOutput<typeof tokenSchema>;
1071
+ declare const tokenSchema: v.ObjectSchema<{
1072
+ readonly id: v.NumberSchema<undefined>;
1073
+ readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1074
+ readonly type: v.StringSchema<undefined>;
1075
+ readonly user_id: v.NumberSchema<undefined>;
1076
+ readonly token: v.StringSchema<undefined>;
1077
+ readonly created_at: v.StringSchema<undefined>;
1078
+ readonly updated_at: v.StringSchema<undefined>;
1079
+ readonly expires_at: v.StringSchema<undefined>;
1080
+ }, undefined>;
1081
+ //#endregion
1082
+ //#region src/shared/entities/DriveEntryEntity.d.ts
1083
+ declare class DriveEntry {
1084
+ name: string;
1085
+ path: string;
1086
+ type: 'file' | 'directory';
1087
+ metas: Record<string, any>;
1088
+ constructor(data: DriveEntry);
1089
+ }
1090
+ //#endregion
1091
+ //#region src/shared/entities/ModuleManifestEntity.d.ts
1092
+ interface ModuleManifestBuildImport {
1093
+ from: string;
1094
+ to?: string;
1095
+ type: 'global_import';
1096
+ }
1097
+ interface ModuleManifestBuild {
1098
+ imports?: ModuleManifestBuildImport[];
1099
+ }
1100
+ declare const ModuleManifest_base: {
1101
+ new (...args: any[]): {
1102
+ merge(data: Partial< /*elided*/any>): /*elided*/any;
1103
+ };
1104
+ from<T>(this: new () => T, data: Partial<T>): T;
1105
+ } & Constructor;
1106
+ declare class ModuleManifest extends ModuleManifest_base {
1107
+ id: string;
1108
+ name: string;
1109
+ version: string;
1110
+ description?: string;
1111
+ enabled: boolean;
1112
+ author?: string;
1113
+ dependencies?: Record<string, string>;
1114
+ build?: ModuleManifestBuild;
1115
+ [key: string]: any;
1116
+ }
1117
+ //#endregion
1118
+ //#region src/shared/entities/ModuleEntity.d.ts
1119
+ interface ModuleUpgradeInfo {
1120
+ source: 'git' | 'zip';
1121
+ [key: string]: any;
1122
+ }
1123
+ declare const Module_base$1: {
1124
+ new (...args: any[]): {
1125
+ merge(data: Partial< /*elided*/any>): /*elided*/any;
1126
+ };
1127
+ from<T>(this: new () => T, data: Partial<T>): T;
1128
+ } & Constructor & Constructor<{}> & typeof LifecycleHook;
1129
+ declare class Module$1 extends Module_base$1 {
1130
+ id: string;
1131
+ name: string;
1132
+ enabled: boolean;
1133
+ dependencies: Record<string, any>;
1134
+ build: ModuleManifest['build'];
1135
+ directory: string;
1136
+ upgrade_info?: ModuleUpgradeInfo;
1137
+ setData(data: Partial<Module$1 | ModuleManifest>): void;
1138
+ }
1139
+ //#endregion
1140
+ //#region src/server/services/ArtisanWrapperService.d.ts
1141
+ declare class ArtisanWrapperService {
1142
+ process: cp.ChildProcess | null;
1143
+ appBasePath: string;
1144
+ env: Map<string, any>;
1145
+ args: string[];
1146
+ configArguments: Map<string, string>;
1147
+ configFiles: string[];
1148
+ debug: boolean;
1149
+ logger: LoggerService;
1150
+ setBasePath(path: string): this;
1151
+ setDebug(debug: boolean): this;
1152
+ setLogger(logger: LoggerService): this;
1153
+ addConfigArgument(key: string, value: string): this;
1154
+ addConfigFile(...filePaths: string[]): this;
1155
+ addEnv(key: string, value: any): this;
1156
+ loadConfigArguments(): void;
1157
+ loadConfigFiles(): void;
1158
+ loadEnvironment(): void;
1159
+ loadArguments(): void;
1160
+ kill(code?: number): void;
1161
+ run(): Promise<void>;
1162
+ }
1163
+ //#endregion
1164
+ //#region src/server/services/ConfigFSService.d.ts
1165
+ interface InitiOptions$1 {
1166
+ directory?: string;
1167
+ debug?: boolean;
1168
+ logger?: LoggerService;
1169
+ }
1170
+ declare class ConfigFSService extends ConfigService {
1171
+ directory: string;
1172
+ logger: LoggerService;
1173
+ debug: boolean;
1174
+ constructor(options?: InitiOptions$1);
1175
+ load(): Promise<void>;
1176
+ private parseKey;
1177
+ set(fullKey: string, value: any, source?: string): void;
1178
+ unset(fullKey: string): void;
1179
+ }
1180
+ //#endregion
1181
+ //#region src/server/schemas/envSchema.d.ts
1182
+ type EnvSchema = v.InferOutput<typeof envSchema>;
1183
+ declare const envSchema: v.ObjectSchema<{
1184
+ readonly NODE_ENV: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"development", undefined>, v.LiteralSchema<"production", undefined>, v.LiteralSchema<"test", undefined>], undefined>, "development">;
1185
+ readonly ZENITH_BASE_PATH: v.StringSchema<undefined>;
1186
+ readonly ZENITH_APP_URL: v.OptionalSchema<v.StringSchema<undefined>, "http://localhost:3000">;
1187
+ readonly ZENITH_PORT: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, number>]>, "3000">;
1188
+ readonly ZENITH_HOST: v.OptionalSchema<v.StringSchema<undefined>, "0.0.0.0">;
1189
+ readonly ZENITH_LOG_LEVEL: v.OptionalSchema<v.PicklistSchema<["error", "warn", "info", "debug"], undefined>, "info">;
1190
+ readonly ZENITH_LIFECYCLE_DEBUG: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"true", undefined>, v.LiteralSchema<"false", undefined>, v.LiteralSchema<"1", undefined>, v.LiteralSchema<"0", undefined>], undefined>, v.TransformAction<"0" | "1" | "true" | "false", boolean>, v.BooleanSchema<undefined>]>, "false">;
1191
+ readonly ZENITH_CLIENT_CONFIG: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, Record<string, any>>]>, undefined>;
1192
+ readonly ZENITH_CONFIG: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, Record<string, any>>]>, undefined>;
1193
+ readonly ZENITH_CONFIG_ARGUMENTS: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, Record<string, any>>]>, undefined>;
1194
+ readonly ZENITH_CONFIG_FILES: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string[]>]>, "">;
1195
+ readonly ZENITH_CONFIG_DEBUG: v.OptionalSchema<v.SchemaWithPipe<readonly [v.UnionSchema<[v.LiteralSchema<"true", undefined>, v.LiteralSchema<"false", undefined>, v.LiteralSchema<"1", undefined>, v.LiteralSchema<"0", undefined>], undefined>, v.TransformAction<"0" | "1" | "true" | "false", boolean>, v.BooleanSchema<undefined>]>, "false">;
1196
+ readonly ZENITH_CONFIG_DRIVER: v.OptionalSchema<v.PicklistSchema<["fs", "s3"], undefined>, "fs">;
1197
+ readonly ZENITH_CONFIG_FS_PATH: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1198
+ readonly ZENITH_CONFIG_S3_BUCKET: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1199
+ readonly ZENITH_CONFIG_S3_REGION: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1200
+ readonly ZENITH_CONFIG_S3_ACCESS_KEY_ID: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1201
+ readonly ZENITH_CONFIG_S3_SECRET_ACCESS_KEY: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1202
+ readonly ZENITH_CONFIG_S3_SESSION_TOKEN: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1203
+ readonly ZENITH_CONFIG_S3_ENDPOINT: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1204
+ readonly ZENITH_CONFIG_S3_PREFIX: v.OptionalSchema<v.StringSchema<undefined>, "">;
1205
+ readonly ZENITH_MODULE_EXTRAS: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, string[]>]>, "">;
1206
+ }, undefined>;
1207
+ //#endregion
1208
+ //#region src/server/services/EnvService.d.ts
1209
+ declare class EnvService {
1210
+ private env;
1211
+ private files;
1212
+ static dotEnvConfig(options?: dotenv.DotenvConfigOptions): dotenv.DotenvConfigOutput;
1213
+ setFiles(files: string[]): this;
1214
+ addFile(file: string): this;
1215
+ load(): {
1216
+ NODE_ENV: "development" | "production" | "test";
1217
+ ZENITH_BASE_PATH: string;
1218
+ ZENITH_APP_URL: string;
1219
+ ZENITH_PORT: number;
1220
+ ZENITH_HOST: string;
1221
+ ZENITH_LOG_LEVEL: "error" | "warn" | "info" | "debug";
1222
+ ZENITH_LIFECYCLE_DEBUG: boolean;
1223
+ ZENITH_CLIENT_CONFIG?: Record<string, any> | undefined;
1224
+ ZENITH_CONFIG?: Record<string, any> | undefined;
1225
+ ZENITH_CONFIG_ARGUMENTS?: Record<string, any> | undefined;
1226
+ ZENITH_CONFIG_FILES: string[];
1227
+ ZENITH_CONFIG_DEBUG: boolean;
1228
+ ZENITH_CONFIG_DRIVER: "fs" | "s3";
1229
+ ZENITH_CONFIG_FS_PATH?: string | undefined;
1230
+ ZENITH_CONFIG_S3_BUCKET?: string | undefined;
1231
+ ZENITH_CONFIG_S3_REGION?: string | undefined;
1232
+ ZENITH_CONFIG_S3_ACCESS_KEY_ID?: string | undefined;
1233
+ ZENITH_CONFIG_S3_SECRET_ACCESS_KEY?: string | undefined;
1234
+ ZENITH_CONFIG_S3_SESSION_TOKEN?: string | undefined;
1235
+ ZENITH_CONFIG_S3_ENDPOINT?: string | undefined;
1236
+ ZENITH_CONFIG_S3_PREFIX: string;
1237
+ ZENITH_MODULE_EXTRAS: string[];
1238
+ };
1239
+ get production(): boolean;
1240
+ get development(): boolean;
1241
+ get test(): boolean;
1242
+ has<K extends keyof EnvSchema>(key: K): boolean;
1243
+ get<K extends keyof EnvSchema>(key: K, defaultValue?: any): EnvSchema[K];
1244
+ set<K extends keyof EnvSchema>(key: K, value: EnvSchema[K]): void;
1245
+ }
1246
+ //#endregion
1247
+ //#region src/server/services/ConfigManagerService.d.ts
1248
+ declare class ConfigManagerService {
1249
+ env: EnvService;
1250
+ logger: LoggerService;
1251
+ constructor(env: EnvService, logger: LoggerService);
1252
+ static create(env: EnvService, logger: LoggerService): ConfigManagerService;
1253
+ private loadS3Config;
1254
+ private loadFSConfig;
1255
+ loadConfigFromEnv(service: ConfigService): void;
1256
+ loadConfigFromFile(service: ConfigService, file: string): void;
1257
+ loadConfigFromFiles(service: ConfigService, files: string[]): void;
1258
+ load(): Promise<ConfigService>;
1259
+ }
1260
+ //#endregion
1261
+ //#region src/server/gateways/DriveBaseGateway.d.ts
1262
+ interface UrlOptions {
1263
+ expires?: ms.StringValue;
1264
+ }
1265
+ interface UploadUrlOptions {
1266
+ expires?: ms.StringValue;
1267
+ mime_types?: string[];
1268
+ max_size?: number;
1269
+ }
1270
+ declare class DriveBaseGateway {
1271
+ id: string;
1272
+ name: string;
1273
+ description?: string;
1274
+ config: Record<string, any>;
1275
+ constructor(data: Pick<DriveBaseGateway, 'id' | 'name' | 'description' | 'config'>);
1276
+ list(folder?: string): Promise<DriveEntry[]>;
1277
+ find(filename: string): Promise<DriveEntry>;
1278
+ exists(filename: string): Promise<boolean>;
1279
+ read(filename: string): Promise<Uint8Array>;
1280
+ readStream(filename: string): Promise<NodeJS.ReadableStream>;
1281
+ write(filename: string, data: Uint8Array): Promise<void>;
1282
+ writeStream(filename: string, stream: NodeJS.ReadableStream): Promise<void>;
1283
+ delete(filename: string): Promise<void>;
1284
+ url(filename: string, options?: UrlOptions): Promise<string>;
1285
+ uploadUrl(filename: string, options?: UploadUrlOptions): Promise<string>;
1286
+ }
1287
+ //#endregion
1288
+ //#region src/server/gateways/DriveS3Gateway.d.ts
1289
+ declare const schema: v.ObjectSchema<{
1290
+ readonly bucket: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1291
+ readonly region: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1292
+ readonly accessKeyId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1293
+ readonly secretAccessKey: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
1294
+ readonly sessionToken: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1295
+ readonly endpoint: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1296
+ readonly prefix: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1297
+ }, undefined>;
1298
+ type S3DriveConfig = InferOutput<typeof schema>;
1299
+ declare class DriveS3 extends DriveBaseGateway {
1300
+ private schema;
1301
+ private _client?;
1302
+ constructor(data: Pick<DriveBaseGateway, 'id' | 'name' | 'description' | 'config'>);
1303
+ get valid(): boolean;
1304
+ private checkValid;
1305
+ protected get bucket(): string;
1306
+ protected get prefix(): string;
1307
+ private getKey;
1308
+ protected get client(): S3Client;
1309
+ exists: DriveBaseGateway['exists'];
1310
+ list: DriveBaseGateway['list'];
1311
+ find: DriveBaseGateway['find'];
1312
+ mkdir(_filename: string): Promise<void>;
1313
+ read: DriveBaseGateway['read'];
1314
+ readStream(filename: string): Promise<any>;
1315
+ write: DriveBaseGateway['write'];
1316
+ writeStream(filename: string, stream: NodeJS.ReadableStream): Promise<void>;
1317
+ delete: DriveBaseGateway['delete'];
1318
+ url: DriveBaseGateway['url'];
1319
+ uploadUrl: DriveBaseGateway['uploadUrl'];
1320
+ }
1321
+ //#endregion
1322
+ //#region src/server/services/ConfigS3Service.d.ts
1323
+ interface InitiOptions extends Omit<S3DriveConfig, 'name' | 'description'> {
1324
+ prefix?: string;
1325
+ debug?: boolean;
1326
+ logger?: LoggerService;
1327
+ }
1328
+ declare class ConfigS3Service extends ConfigService {
1329
+ prefix: string;
1330
+ logger: LoggerService;
1331
+ debug: boolean;
1332
+ drive: DriveS3;
1333
+ bucket: string;
1334
+ region: string;
1335
+ endpoint?: string;
1336
+ constructor(options: InitiOptions);
1337
+ private parseKey;
1338
+ load(): Promise<void>;
1339
+ set(fullKey: string, value: any, source?: string): void;
1340
+ unset(fullKey: string): void;
1341
+ }
1342
+ //#endregion
61
1343
  //#region src/server/contracts/EventContract.d.ts
62
1344
  interface EventContract {
63
1345
  'user:before-create': {
@@ -233,127 +1515,12 @@ declare class PluginRouter {
233
1515
  delete(path: string, handler: RouteHandler): void;
234
1516
  }
235
1517
  //#endregion
236
- //#region src/shared/utils/compose.d.ts
237
- type Constructor$1<T = {}> = new (...args: any[]) => T;
238
- //#endregion
239
1518
  //#region src/shared/mixins/HooksMixin.d.ts
240
1519
  interface Listener {
241
1520
  event: string;
242
1521
  listener: (...args: any[]) => void;
243
1522
  }
244
1523
  //#endregion
245
- //#region src/shared/services/ConfigService.d.ts
246
- interface Entry {
247
- key: string;
248
- value: any;
249
- source: string;
250
- }
251
- declare class ConfigService {
252
- entries: Map<string, Entry>;
253
- constructor();
254
- list(): Entry[];
255
- parseValue(value: any): any;
256
- loadFromRecord(record: Record<string, any>, source?: string): void;
257
- loadFromEntries(entries: [string, any][], source?: string): void;
258
- toRecord(): Record<string, any>;
259
- has(key: string): boolean;
260
- get<T = any | undefined>(key: string, defaultValue?: any): T;
261
- getOne<T = any | undefined>(keys: string[], defaultValue?: any): T;
262
- set(key: string, value: any, source?: string): void;
263
- unset(key: string): void;
264
- clear(): void;
265
- }
266
- //#endregion
267
- //#region src/shared/services/ContainerService.d.ts
268
- type Constructor<T = object> = new (...args: any[]) => T;
269
- type EntryKey = string | symbol | Constructor;
270
- declare class ContainerService {
271
- private entries;
272
- loadFromRecord(record: Record<string, any>): void;
273
- toRecord(): Record<string, any>;
274
- set(payload: EntryKey, value: any): void;
275
- has(payload: EntryKey): boolean;
276
- get<T>(payload: EntryKey): T;
277
- singleton<T>(classConstructor: Constructor<T>): T;
278
- load(entries: Record<any, any>): void;
279
- proxy<T = unknown>(key: EntryKey): T;
280
- keys(): EntryKey[];
281
- }
282
- //#endregion
283
- //#region src/shared/entities/LifecycleHook.d.ts
284
- declare class LifecycleHook {
285
- hook_id: string;
286
- order?: number;
287
- subhooks?: LifecycleHook[];
288
- constructor();
289
- onRegister(): Promise<void>;
290
- onLoad(): Promise<void>;
291
- onBoot(): Promise<void>;
292
- onShutdown(): Promise<void>;
293
- }
294
- //#endregion
295
- //#region src/shared/schemas/tokenSchema.d.ts
296
- type Token = v.InferOutput<typeof tokenSchema>;
297
- declare const tokenSchema: v.ObjectSchema<{
298
- readonly id: v.NumberSchema<undefined>;
299
- readonly name: v.NullableSchema<v.StringSchema<undefined>, undefined>;
300
- readonly type: v.StringSchema<undefined>;
301
- readonly user_id: v.NumberSchema<undefined>;
302
- readonly token: v.StringSchema<undefined>;
303
- readonly created_at: v.StringSchema<undefined>;
304
- readonly updated_at: v.StringSchema<undefined>;
305
- readonly expires_at: v.StringSchema<undefined>;
306
- }, undefined>;
307
- //#endregion
308
- //#region src/shared/entities/ModuleManifestEntity.d.ts
309
- interface ModuleManifestBuildImport {
310
- from: string;
311
- to?: string;
312
- type: 'global_import';
313
- }
314
- interface ModuleManifestBuild {
315
- imports?: ModuleManifestBuildImport[];
316
- }
317
- declare const ModuleManifest_base: {
318
- new (...args: any[]): {
319
- merge(data: Partial< /*elided*/any>): /*elided*/any;
320
- };
321
- from<T>(this: new () => T, data: Partial<T>): T;
322
- } & Constructor$1;
323
- declare class ModuleManifest extends ModuleManifest_base {
324
- id: string;
325
- name: string;
326
- version: string;
327
- description?: string;
328
- enabled: boolean;
329
- author?: string;
330
- dependencies?: Record<string, string>;
331
- build?: ModuleManifestBuild;
332
- [key: string]: any;
333
- }
334
- //#endregion
335
- //#region src/shared/entities/ModuleEntity.d.ts
336
- interface ModuleUpgradeInfo {
337
- source: 'git' | 'zip';
338
- [key: string]: any;
339
- }
340
- declare const Module_base$1: {
341
- new (...args: any[]): {
342
- merge(data: Partial< /*elided*/any>): /*elided*/any;
343
- };
344
- from<T>(this: new () => T, data: Partial<T>): T;
345
- } & Constructor$1 & Constructor$1<{}> & typeof LifecycleHook;
346
- declare class Module$1 extends Module_base$1 {
347
- id: string;
348
- name: string;
349
- enabled: boolean;
350
- dependencies: Record<string, any>;
351
- build: ModuleManifest['build'];
352
- directory: string;
353
- upgrade_info?: ModuleUpgradeInfo;
354
- setData(data: Partial<Module$1 | ModuleManifest>): void;
355
- }
356
- //#endregion
357
1524
  //#region src/server/contracts/HttpContextContract.d.ts
358
1525
  interface Request extends Request$1 {}
359
1526
  interface Response extends Response$1 {}
@@ -422,7 +1589,7 @@ declare const Router_base: {
422
1589
  emit(event: string, ...args: any[]): void;
423
1590
  emitAsync(event: string, ...args: any[]): Promise<void>;
424
1591
  };
425
- } & Constructor$1;
1592
+ } & Constructor;
426
1593
  declare class Router<C = {}> extends Router_base {
427
1594
  routes: Route[];
428
1595
  middlewares: MiddlewareRegister[];
@@ -552,7 +1719,7 @@ interface IRepositoryTypes<TEntity = Record<string, any>, TPrimaryKeyType = any,
552
1719
  deleteById(id: TPrimaryKeyType): Promise<void>;
553
1720
  destroyMany(options?: TOptions): Promise<void>;
554
1721
  }
555
- declare function DatabaseRepositoryInferMixin<TEntity = Record<string, any>, TPrimaryKeyType = any, TOptions = Record<string, any>>(): <TBase extends Constructor$1>(Base: TBase) => TBase & Constructor$1<IRepositoryTypes<TEntity, TPrimaryKeyType, TOptions>>;
1722
+ declare function DatabaseRepositoryInferMixin<TEntity = Record<string, any>, TPrimaryKeyType = any, TOptions = Record<string, any>>(): <TBase extends Constructor>(Base: TBase) => TBase & Constructor<IRepositoryTypes<TEntity, TPrimaryKeyType, TOptions>>;
556
1723
  //#endregion
557
1724
  //#region src/server/repositories/PermissionAssignmentRepository.d.ts
558
1725
  interface PermissionAssignmentRepositoryQueryOptions {
@@ -561,14 +1728,14 @@ interface PermissionAssignmentRepositoryQueryOptions {
561
1728
  assignableId?: number | number[];
562
1729
  assignableType?: string | string[];
563
1730
  }
564
- declare const PermissionAssignmentRepository_base: Constructor$1 & Constructor$1<IRepositoryTypes<{
1731
+ declare const PermissionAssignmentRepository_base: Constructor & Constructor<IRepositoryTypes<{
565
1732
  id: number;
566
1733
  permission_id: number;
567
1734
  assignable_type: string;
568
1735
  assignable_id: string;
569
1736
  created_at: string;
570
1737
  updated_at: string;
571
- }, number, PermissionAssignmentRepositoryQueryOptions>> & Constructor$1<{}> & typeof DatabaseRepository;
1738
+ }, number, PermissionAssignmentRepositoryQueryOptions>> & Constructor<{}> & typeof DatabaseRepository;
572
1739
  declare class PermissionAssignmentRepository extends PermissionAssignmentRepository_base {
573
1740
  constructor(db: DatabaseRepository['db']);
574
1741
  query(options?: PermissionAssignmentRepositoryQueryOptions): any;
@@ -579,7 +1746,7 @@ interface PermissionRepositoryQueryOptions {
579
1746
  id?: number | number[];
580
1747
  search?: string;
581
1748
  }
582
- declare const PermissionRepository_base: Constructor$1<{}> & typeof DatabaseRepository & Constructor$1 & Constructor$1<IRepositoryTypes<{
1749
+ declare const PermissionRepository_base: Constructor<{}> & typeof DatabaseRepository & Constructor & Constructor<IRepositoryTypes<{
583
1750
  id: number;
584
1751
  name: string | null;
585
1752
  description: string | null;
@@ -601,7 +1768,7 @@ interface TokenRepositoryQueryOptions {
601
1768
  search?: string;
602
1769
  type?: string | string[];
603
1770
  }
604
- declare const TokenRepository_base: Constructor$1<{}> & typeof DatabaseRepository & Constructor$1 & Constructor$1<IRepositoryTypes<{
1771
+ declare const TokenRepository_base: Constructor<{}> & typeof DatabaseRepository & Constructor & Constructor<IRepositoryTypes<{
605
1772
  id: number;
606
1773
  name: string | null;
607
1774
  type: string;
@@ -821,6 +1988,9 @@ declare function createLoaderFactory<E extends Record<string, any> = Record<stri
821
1988
  load: (entities: E | E[], names: keyof R | (keyof R)[]) => Promise<void>;
822
1989
  };
823
1990
  //#endregion
1991
+ //#region src/server/utils/generateIndexFile.d.ts
1992
+ declare function generateIndexFile(options: any): void;
1993
+ //#endregion
824
1994
  //#region src/server/utils/importAll.d.ts
825
1995
  interface Options {
826
1996
  cache?: boolean;
@@ -844,4 +2014,4 @@ declare function importAll(directory: string, options?: Options): Promise<Record
844
2014
  //#region src/server/utils/importOne.d.ts
845
2015
  declare function importOne(filenames: string[]): Promise<any>;
846
2016
  //#endregion
847
- export { DatabaseContract, DatabaseRepository, DatabaseRepositoryInferMixin, DeleteManyOptions, EmailTemplateMetaTable, EmailTemplateTable, EmmitterService, EventContract, FileMetaTable, FileTable, FindManyOptions, GitBranch, GitBranchFetchOptions, GitBranchRepository, GitCommit, GitCommitListOptions, GitCommitRef, GitCommitRepository, GitGateway, GitGatewayOptions, GitRepoInfo, HandleResult, Handler, HasManyThroughLoaderOptions, HttpContext, HttpMethod, IRepositoryTypes, IpcMessage, JobTable, Loader, LoaderRecord, Middleware, MiddlewareHandleResult, MigrationsTable, Module as ModuleEntity, OauthAccountTable, OauthTokenTable, PaginateOptions, PaginatedCommits, Pagination, PermissionAssignmentRepository, PermissionAssignmentRepositoryQueryOptions, PermissionAssignmentTable, PermissionRepository, PermissionRepositoryQueryOptions, PermissionTable, PluginIpcClient, PluginIpcHost, PluginRouter, Redirect, Request, Response, RoleTable, RouteDefinition, Route as RouteEntity, RouteHandler, RouteReply, RouteRequest, RouteResponsePayload, RouterFileBaseRoutingService, Router as RouterService, ShellService, SoftDeleteTable, TimestampTable, TokenRepository, TokenRepositoryQueryOptions, TokenTable, UploadSessionTable, UserMetaTable, UserRoleTable, UserTable, basePath, config, _default as container, createHasManyThroughLoader, createLoaderFactory, database, defineLoader, importAll, importFiles, importGlob, importOne, key, loadHasManyThrough, logger, router, shell, tmpPath };
2017
+ export { ArtisanService, ArteTesterService as ArtisanTesterService, ArtisanWrapperService, ConfigFSService, ConfigManagerService, ConfigS3Service, DatabaseContract, DatabaseRepository, DatabaseRepositoryInferMixin, DeleteManyOptions, DriveBaseGateway, DriveS3 as DriveS3Gateway, EmailTemplateMetaTable, EmailTemplateTable, EmmitterService, EnvService, EventContract, FileMetaTable, FileTable, FindManyOptions, GitBranch, GitBranchFetchOptions, GitBranchRepository, GitCommit, GitCommitListOptions, GitCommitRef, GitCommitRepository, GitGateway, GitGatewayOptions, GitRepoInfo, HandleResult, Handler, HasManyThroughLoaderOptions, HttpContext, HttpMethod, IRepositoryTypes, IpcMessage, JobTable, Loader, LoaderRecord, Middleware, MiddlewareHandleResult, MigrationsTable, Module as ModuleEntity, OauthAccountTable, OauthTokenTable, ObjectOptions, PaginateOptions, PaginatedCommits, Pagination, PermissionAssignmentRepository, PermissionAssignmentRepositoryQueryOptions, PermissionAssignmentTable, PermissionRepository, PermissionRepositoryQueryOptions, PermissionTable, PluginIpcClient, PluginIpcHost, PluginRouter, Redirect, Request, Response, RoleTable, RouteDefinition, Route as RouteEntity, RouteHandler, RouteReply, RouteRequest, RouteResponsePayload, RouterFileBaseRoutingService, Router as RouterService, S3DriveConfig, ShellService, SoftDeleteTable, TableColumn, TimestampTable, TokenRepository, TokenRepositoryQueryOptions, TokenTable, UploadSessionTable, UploadUrlOptions, UrlOptions, UserMetaTable, UserRoleTable, UserTable, basePath, config, _default as container, createHasManyThroughLoader, createLoaderFactory, database, defineLoader, generateIndexFile, importAll, importFiles, importGlob, importOne, key, loadHasManyThrough, logger, printObject, printTable, router, shell, tmpPath };