alepha 0.11.1 → 0.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/command.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _alepha_core1 from "alepha";
2
2
  import { Alepha, AlephaError, Async, Descriptor, KIND, Static, TObject, TSchema, TString } from "alepha";
3
- import * as _alepha_logger1 from "alepha/logger";
3
+ import * as _alepha_logger0 from "alepha/logger";
4
4
  import * as fs from "node:fs/promises";
5
5
  import { glob } from "node:fs/promises";
6
6
  import * as readline_promises0 from "readline/promises";
@@ -37,7 +37,7 @@ interface AskMethod {
37
37
  <T extends TSchema = TString>(question: string, options?: AskOptions<T>): Promise<Static<T>>;
38
38
  }
39
39
  declare class Asker {
40
- protected readonly log: _alepha_logger1.Logger;
40
+ protected readonly log: _alepha_logger0.Logger;
41
41
  readonly ask: AskMethod;
42
42
  protected readonly alepha: Alepha;
43
43
  constructor();
@@ -67,7 +67,7 @@ interface RunnerMethod {
67
67
  cp: (source: string, dest: string, options?: RunOptions) => Promise<string>;
68
68
  }
69
69
  declare class Runner {
70
- protected readonly log: _alepha_logger1.Logger;
70
+ protected readonly log: _alepha_logger0.Logger;
71
71
  protected readonly timers: Timer[];
72
72
  protected readonly startTime: number;
73
73
  readonly run: RunnerMethod;
@@ -177,7 +177,7 @@ declare class CliProvider {
177
177
  CLI_DESCRIPTION: string;
178
178
  };
179
179
  protected readonly alepha: Alepha;
180
- protected readonly log: _alepha_logger1.Logger;
180
+ protected readonly log: _alepha_logger0.Logger;
181
181
  protected readonly runner: Runner;
182
182
  protected readonly asker: Asker;
183
183
  options: {
package/core.d.ts CHANGED
@@ -4,9 +4,9 @@ import * as TypeBoxValue from "typebox/value";
4
4
  import * as TypeBox from "typebox";
5
5
  import { Static as Static$1, StaticDecode, StaticDecode as Static, StaticDecode as StaticDecode$1, StaticEncode, StaticEncode as StaticEncode$1, TAny, TAny as TAny$1, TArray, TArray as TArray$1, TArrayOptions, TBigInt, TBoolean, TBoolean as TBoolean$1, TInteger, TInteger as TInteger$1, TKeysToIndexer, TKeysToIndexer as TKeysToIndexer$1, TNull, TNull as TNull$1, TNumber, TNumber as TNumber$1, TNumberOptions, TNumberOptions as TNumberOptions$1, TObject, TObject as TObject$1, TObjectOptions, TObjectOptions as TObjectOptions$1, TOmit, TOptional, TOptionalAdd, TOptionalAdd as TOptionalAdd$1, TPick, TPick as TPick$1, TProperties, TProperties as TProperties$1, TRecord, TRecord as TRecord$1, TSchema, TSchema as TSchema$1, TSchemaOptions, TString, TString as TString$1, TStringOptions, TStringOptions as TStringOptions$1, TTuple, TUnion, TUnion as TUnion$1, TUnsafe, TUnsafe as TUnsafe$1, TVoid } from "typebox";
6
6
  import TypeBoxFormat from "typebox/format";
7
+ import { TLocalizedValidationError } from "typebox/error";
7
8
  import { Readable } from "node:stream";
8
9
  import { ReadableStream as ReadableStream$1 } from "node:stream/web";
9
- import { TLocalizedValidationError } from "typebox/error";
10
10
 
11
11
  //#region src/constants/KIND.d.ts
12
12
  /**
@@ -283,6 +283,28 @@ declare class Json {
283
283
  parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
284
284
  }
285
285
  //#endregion
286
+ //#region src/errors/AlephaError.d.ts
287
+ /**
288
+ * Default error class for Alepha.
289
+ */
290
+ declare class AlephaError extends Error {
291
+ name: string;
292
+ }
293
+ //#endregion
294
+ //#region src/errors/TypeBoxError.d.ts
295
+ declare class TypeBoxError extends AlephaError {
296
+ readonly name = "TypeBoxError";
297
+ readonly cause: TLocalizedValidationError;
298
+ readonly value: {
299
+ path: string;
300
+ message: string;
301
+ };
302
+ constructor(error: TLocalizedValidationError);
303
+ }
304
+ interface TypeBoxErrorParams {
305
+ requiredProperties?: string[];
306
+ }
307
+ //#endregion
286
308
  //#region src/helpers/FileLike.d.ts
287
309
  interface FileLike {
288
310
  /**
@@ -384,6 +406,7 @@ declare module "typebox" {
384
406
  }
385
407
  declare class TypeProvider {
386
408
  static format: typeof TypeBoxFormat;
409
+ static translateError(error: TypeBoxError, locale?: string): string;
387
410
  static setLocale(locale: string): void;
388
411
  static isValidBigInt(value: string | number): boolean;
389
412
  /**
@@ -1496,14 +1519,6 @@ declare class HookDescriptor<T extends keyof Hooks> extends Descriptor<HookOptio
1496
1519
  protected onInit(): void;
1497
1520
  }
1498
1521
  //#endregion
1499
- //#region src/errors/AlephaError.d.ts
1500
- /**
1501
- * Default error class for Alepha.
1502
- */
1503
- declare class AlephaError extends Error {
1504
- name: string;
1505
- }
1506
- //#endregion
1507
1522
  //#region src/errors/AppNotStartedError.d.ts
1508
1523
  declare class AppNotStartedError extends AlephaError {
1509
1524
  readonly name = "AppNotStartedError";
@@ -1528,20 +1543,6 @@ declare class TooLateSubstitutionError extends AlephaError {
1528
1543
  constructor(original: string, substitution: string);
1529
1544
  }
1530
1545
  //#endregion
1531
- //#region src/errors/TypeBoxError.d.ts
1532
- declare class TypeBoxError extends AlephaError {
1533
- readonly name = "TypeBoxError";
1534
- readonly cause: TLocalizedValidationError;
1535
- readonly value: {
1536
- path: string;
1537
- message: string;
1538
- };
1539
- constructor(error: TLocalizedValidationError);
1540
- }
1541
- interface TypeBoxErrorParams {
1542
- requiredProperties?: string[];
1543
- }
1544
- //#endregion
1545
1546
  //#region src/index.d.ts
1546
1547
  /**
1547
1548
  * Run Alepha application, trigger start lifecycle.
package/datetime.d.ts CHANGED
@@ -22,7 +22,6 @@ declare const isTimeSchema: (schema: unknown) => schema is ReturnType<typeof tim
22
22
  declare const isDurationSchema: (schema: unknown) => schema is ReturnType<typeof duration>;
23
23
  //#endregion
24
24
  //#region src/providers/DateTimeProvider.d.ts
25
- type DateTimeApi = typeof dayjs;
26
25
  type DateTime = DayjsApi.Dayjs;
27
26
  type Duration = dayjsDuration.Duration;
28
27
  type DurationLike = number | dayjsDuration.Duration | [number, ManipulateType];
@@ -36,6 +35,8 @@ declare class DateTimeProvider {
36
35
  constructor();
37
36
  protected readonly onStart: _alepha_core1.HookDescriptor<"start">;
38
37
  protected readonly onStop: _alepha_core1.HookDescriptor<"stop">;
38
+ setLocale(locale: string): void;
39
+ isDateTime(value: unknown): value is DateTime;
39
40
  /**
40
41
  * Create a new UTC DateTime instance.
41
42
  */
@@ -163,5 +164,5 @@ declare module "alepha" {
163
164
  }
164
165
  declare const AlephaDateTime: _alepha_core1.Service<_alepha_core1.Module<{}>>;
165
166
  //#endregion
166
- export { $interval, AlephaDateTime, DateTime, DateTimeApi, DateTimeProvider, Duration, DurationLike, Interval, IntervalDescriptor, IntervalDescriptorOptions, Timeout, date, datetime, dayjs, duration, isDateSchema, isDateTimeSchema, isDurationSchema, isTimeSchema, time };
167
+ export { $interval, AlephaDateTime, DateTime, DateTimeProvider, Duration, DurationLike, Interval, IntervalDescriptor, IntervalDescriptorOptions, Timeout, date, datetime, dayjs, duration, isDateSchema, isDateTimeSchema, isDurationSchema, isTimeSchema, time };
167
168
  //# sourceMappingURL=index.d.ts.map