alepha 0.10.7 → 0.11.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.
package/batch.d.ts CHANGED
@@ -281,7 +281,7 @@ declare const $batch: {
281
281
  <TItem extends TSchema, TResponse>(options: BatchDescriptorOptions<TItem, TResponse>): BatchDescriptor<TItem, TResponse>;
282
282
  [KIND]: typeof BatchDescriptor;
283
283
  };
284
- interface BatchDescriptorOptions<TItem$1 extends TSchema, TResponse$1 = any> {
284
+ interface BatchDescriptorOptions<TItem extends TSchema, TResponse = any> {
285
285
  /**
286
286
  * TypeBox schema for validating each item added to the batch.
287
287
  *
@@ -308,7 +308,7 @@ interface BatchDescriptorOptions<TItem$1 extends TSchema, TResponse$1 = any> {
308
308
  * })
309
309
  * ```
310
310
  */
311
- schema: TItem$1;
311
+ schema: TItem;
312
312
  /**
313
313
  * The batch processing handler function that processes arrays of validated items.
314
314
  *
@@ -369,7 +369,7 @@ interface BatchDescriptorOptions<TItem$1 extends TSchema, TResponse$1 = any> {
369
369
  * }
370
370
  * ```
371
371
  */
372
- handler: (items: Static<TItem$1>[]) => TResponse$1;
372
+ handler: (items: Static<TItem>[]) => TResponse;
373
373
  /**
374
374
  * Maximum number of items to collect before automatically flushing the batch.
375
375
  *
@@ -463,7 +463,7 @@ interface BatchDescriptorOptions<TItem$1 extends TSchema, TResponse$1 = any> {
463
463
  * }
464
464
  * ```
465
465
  */
466
- partitionBy?: (item: Static<TItem$1>) => string;
466
+ partitionBy?: (item: Static<TItem>) => string;
467
467
  /**
468
468
  * Maximum number of batch handlers that can execute simultaneously.
469
469
  *
@@ -526,19 +526,19 @@ interface BatchDescriptorOptions<TItem$1 extends TSchema, TResponse$1 = any> {
526
526
  * }
527
527
  * ```
528
528
  */
529
- retry?: Omit<RetryDescriptorOptions<() => Array<Static<TItem$1>>>, "handler">;
529
+ retry?: Omit<RetryDescriptorOptions<() => Array<Static<TItem>>>, "handler">;
530
530
  }
531
- declare class BatchDescriptor<TItem$1 extends TSchema, TResponse$1 = any> extends Descriptor<BatchDescriptorOptions<TItem$1, TResponse$1>> {
531
+ declare class BatchDescriptor<TItem extends TSchema, TResponse = any> extends Descriptor<BatchDescriptorOptions<TItem, TResponse>> {
532
532
  protected readonly log: _alepha_logger0.Logger;
533
533
  protected readonly dateTime: DateTimeProvider;
534
534
  protected readonly partitions: Map<any, any>;
535
535
  protected activeHandlers: PromiseWithResolvers<void>[];
536
- protected retry: _alepha_retry0.RetryDescriptorFn<(items: typebox0.StaticType<[], "Encode", {}, {}, TItem$1>[]) => TResponse$1>;
536
+ protected retry: _alepha_retry0.RetryDescriptorFn<(items: typebox0.StaticType<[], "Decode", {}, {}, TItem>[]) => TResponse>;
537
537
  /**
538
538
  * Pushes an item into the batch. The item will be processed
539
539
  * asynchronously with other items when the batch is flushed.
540
540
  */
541
- push(item: Static<TItem$1>): Promise<TResponse$1>;
541
+ push(item: Static<TItem>): Promise<TResponse>;
542
542
  flush(partitionKey?: string): Promise<void>;
543
543
  protected flushPartition(partitionKey: string): Promise<void>;
544
544
  protected readonly dispose: _alepha_core1.HookDescriptor<"stop">;
package/bucket.d.ts CHANGED
@@ -334,7 +334,7 @@ declare class BucketDescriptor extends Descriptor<BucketDescriptorOptions> {
334
334
  /**
335
335
  * Delete permanently a file from the bucket.
336
336
  */
337
- delete(fileId: string): Promise<void>;
337
+ delete(fileId: string, skipHook?: boolean): Promise<void>;
338
338
  /**
339
339
  * Checks if a file exists in the bucket.
340
340
  */
package/cache.d.ts CHANGED
@@ -185,7 +185,7 @@ declare const $cache: {
185
185
  <TReturn = string, TParameter extends any[] = any[]>(options?: CacheDescriptorOptions<TReturn, TParameter>): CacheDescriptorFn<TReturn, TParameter>;
186
186
  [KIND]: typeof CacheDescriptor;
187
187
  };
188
- interface CacheDescriptorOptions<TReturn$1 = any, TParameter$1 extends any[] = any[]> {
188
+ interface CacheDescriptorOptions<TReturn = any, TParameter extends any[] = any[]> {
189
189
  /**
190
190
  * The cache name. This is useful for invalidating multiple caches at once.
191
191
  *
@@ -197,12 +197,12 @@ interface CacheDescriptorOptions<TReturn$1 = any, TParameter$1 extends any[] = a
197
197
  /**
198
198
  * Function which returns cached data.
199
199
  */
200
- handler?: (...args: TParameter$1) => TReturn$1;
200
+ handler?: (...args: TParameter) => TReturn;
201
201
  /**
202
202
  * The key generator for the cache.
203
203
  * If not provided, the arguments will be json.stringify().
204
204
  */
205
- key?: (...args: TParameter$1) => string;
205
+ key?: (...args: TParameter) => string;
206
206
  /**
207
207
  * The store provider for the cache.
208
208
  * If not provided, the default store provider will be used.
@@ -220,7 +220,7 @@ interface CacheDescriptorOptions<TReturn$1 = any, TParameter$1 extends any[] = a
220
220
  */
221
221
  disabled?: boolean;
222
222
  }
223
- declare class CacheDescriptor<TReturn$1 = any, TParameter$1 extends any[] = any[]> extends Descriptor<CacheDescriptorOptions<TReturn$1, TParameter$1>> {
223
+ declare class CacheDescriptor<TReturn = any, TParameter extends any[] = any[]> extends Descriptor<CacheDescriptorOptions<TReturn, TParameter>> {
224
224
  protected readonly env: {
225
225
  CACHE_ENABLED: boolean;
226
226
  CACHE_DEFAULT_TTL: number;
@@ -235,20 +235,20 @@ declare class CacheDescriptor<TReturn$1 = any, TParameter$1 extends any[] = any[
235
235
  STRING: number;
236
236
  };
237
237
  get container(): string;
238
- run(...args: TParameter$1): Promise<TReturn$1>;
239
- key(...args: TParameter$1): string;
238
+ run(...args: TParameter): Promise<TReturn>;
239
+ key(...args: TParameter): string;
240
240
  invalidate(...keys: string[]): Promise<void>;
241
- set(key: string, value: TReturn$1, ttl?: DurationLike): Promise<void>;
242
- get(key: string): Promise<TReturn$1 | undefined>;
243
- protected serialize<TReturn>(value: TReturn$1): Uint8Array;
244
- protected deserialize<TReturn>(uint8Array: Uint8Array): Promise<TReturn$1>;
241
+ set(key: string, value: TReturn, ttl?: DurationLike): Promise<void>;
242
+ get(key: string): Promise<TReturn | undefined>;
243
+ protected serialize<TReturn>(value: TReturn): Uint8Array;
244
+ protected deserialize<TReturn>(uint8Array: Uint8Array): Promise<TReturn>;
245
245
  protected $provider(): CacheProvider;
246
246
  }
247
- interface CacheDescriptorFn<TReturn$1 = any, TParameter$1 extends any[] = any[]> extends CacheDescriptor<TReturn$1, TParameter$1> {
247
+ interface CacheDescriptorFn<TReturn = any, TParameter extends any[] = any[]> extends CacheDescriptor<TReturn, TParameter> {
248
248
  /**
249
249
  * Run the cache descriptor with the provided arguments.
250
250
  */
251
- (...args: TParameter$1): Promise<TReturn$1>;
251
+ (...args: TParameter): Promise<TReturn>;
252
252
  }
253
253
  //#endregion
254
254
  //#region src/providers/MemoryCacheProvider.d.ts
package/command.d.ts CHANGED
@@ -1,13 +1,13 @@
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_logger0 from "alepha/logger";
3
+ import * as _alepha_logger1 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";
7
7
  import * as typebox0 from "typebox";
8
8
 
9
9
  //#region src/helpers/Asker.d.ts
10
- interface AskOptions<T$1 extends TSchema = TString> {
10
+ interface AskOptions<T extends TSchema = TString> {
11
11
  /**
12
12
  * Response schema expected.
13
13
  *
@@ -26,18 +26,18 @@ interface AskOptions<T$1 extends TSchema = TString> {
26
26
  *
27
27
  * @default TString
28
28
  */
29
- schema?: T$1;
29
+ schema?: T;
30
30
  /**
31
31
  * Custom validation function.
32
32
  * Throws an AlephaError in case of validation failure.
33
33
  */
34
- validate?: (value: Static<T$1>) => void;
34
+ validate?: (value: Static<T>) => void;
35
35
  }
36
36
  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_logger0.Logger;
40
+ protected readonly log: _alepha_logger1.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_logger0.Logger;
70
+ protected readonly log: _alepha_logger1.Logger;
71
71
  protected readonly timers: Timer[];
72
72
  protected readonly startTime: number;
73
73
  readonly run: RunnerMethod;
@@ -99,11 +99,11 @@ declare const $command: {
99
99
  <T extends TObject, A extends TSchema>(options: CommandDescriptorOptions<T, A>): CommandDescriptor<T, A>;
100
100
  [KIND]: typeof CommandDescriptor;
101
101
  };
102
- interface CommandDescriptorOptions<T$1 extends TObject, A$1 extends TSchema> {
102
+ interface CommandDescriptorOptions<T extends TObject, A extends TSchema> {
103
103
  /**
104
104
  * The handler function to execute when the command is matched.
105
105
  */
106
- handler: (args: CommandHandlerArgs<T$1, A$1>) => Async<void>;
106
+ handler: (args: CommandHandlerArgs<T, A>) => Async<void>;
107
107
  /**
108
108
  * The name of the command. If omitted, the property key is used.
109
109
  *
@@ -121,7 +121,7 @@ interface CommandDescriptorOptions<T$1 extends TObject, A$1 extends TSchema> {
121
121
  /**
122
122
  * A TypeBox object schema defining the flags for the command.
123
123
  */
124
- flags?: T$1;
124
+ flags?: T;
125
125
  /**
126
126
  * An optional TypeBox schema defining the arguments for the command.
127
127
  *
@@ -138,20 +138,20 @@ interface CommandDescriptorOptions<T$1 extends TObject, A$1 extends TSchema> {
138
138
  * args: t.tuple([t.text(), t.optional(t.number())])
139
139
  * my-cli command <arg1: string> [arg2: number]
140
140
  */
141
- args?: A$1;
141
+ args?: A;
142
142
  /**
143
143
  * If false, skip summary message at the end of the command execution.
144
144
  */
145
145
  summary?: boolean;
146
146
  }
147
- declare class CommandDescriptor<T$1 extends TObject = TObject, A$1 extends TSchema = TSchema> extends Descriptor<CommandDescriptorOptions<T$1, A$1>> {
147
+ declare class CommandDescriptor<T extends TObject = TObject, A extends TSchema = TSchema> extends Descriptor<CommandDescriptorOptions<T, A>> {
148
148
  readonly flags: TObject<{}>;
149
149
  readonly aliases: string[];
150
150
  get name(): string;
151
151
  }
152
- interface CommandHandlerArgs<T$1 extends TObject, A$1 extends TSchema = TSchema> {
153
- flags: Static<T$1>;
154
- args: A$1 extends TSchema ? Static<A$1> : Array<string>;
152
+ interface CommandHandlerArgs<T extends TObject, A extends TSchema = TSchema> {
153
+ flags: Static<T>;
154
+ args: A extends TSchema ? Static<A> : Array<string>;
155
155
  run: RunnerMethod;
156
156
  ask: AskMethod;
157
157
  glob: typeof glob;
@@ -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_logger0.Logger;
180
+ protected readonly log: _alepha_logger1.Logger;
181
181
  protected readonly runner: Runner;
182
182
  protected readonly asker: Asker;
183
183
  options: {