alepha 0.10.7 → 0.11.0
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/api/files.d.ts +172 -235
- package/api/jobs.d.ts +133 -208
- package/api/notifications.d.ts +112 -225
- package/api/users.d.ts +499 -786
- package/batch.d.ts +8 -8
- package/bucket.d.ts +1 -1
- package/cache.d.ts +12 -12
- package/command.d.ts +11 -11
- package/core.d.ts +312 -221
- package/datetime.d.ts +41 -10
- package/lock.d.ts +8 -8
- package/logger.d.ts +19 -9
- package/package.json +52 -65
- package/postgres.d.ts +488 -1172
- package/queue.d.ts +14 -14
- package/react/auth.d.ts +1 -1
- package/react/form.d.ts +33 -22
- package/react/i18n.d.ts +8 -8
- package/react.d.ts +76 -56
- package/retry.d.ts +8 -8
- package/scheduler.d.ts +1 -1
- package/security.d.ts +4 -4
- package/server/cookies.d.ts +10 -10
- package/server/health.d.ts +31 -8
- package/server/links.d.ts +3 -3
- package/server/multipart.d.ts +2 -2
- package/server/swagger.d.ts +4 -0
- package/server.d.ts +43 -42
- package/topic.d.ts +17 -17
- package/ui.d.ts +365 -46
- package/vite.d.ts +7 -2
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
529
|
+
retry?: Omit<RetryDescriptorOptions<() => Array<Static<TItem>>>, "handler">;
|
|
530
530
|
}
|
|
531
|
-
declare class BatchDescriptor<TItem
|
|
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<[], "
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
239
|
-
key(...args: TParameter
|
|
238
|
+
run(...args: TParameter): Promise<TReturn>;
|
|
239
|
+
key(...args: TParameter): string;
|
|
240
240
|
invalidate(...keys: string[]): Promise<void>;
|
|
241
|
-
set(key: string, value: TReturn
|
|
242
|
-
get(key: string): Promise<TReturn
|
|
243
|
-
protected serialize<TReturn>(value: TReturn
|
|
244
|
-
protected deserialize<TReturn>(uint8Array: Uint8Array): Promise<TReturn
|
|
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
|
|
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
|
|
251
|
+
(...args: TParameter): Promise<TReturn>;
|
|
252
252
|
}
|
|
253
253
|
//#endregion
|
|
254
254
|
//#region src/providers/MemoryCacheProvider.d.ts
|
package/command.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ 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
|
|
10
|
+
interface AskOptions<T extends TSchema = TString> {
|
|
11
11
|
/**
|
|
12
12
|
* Response schema expected.
|
|
13
13
|
*
|
|
@@ -26,12 +26,12 @@ interface AskOptions<T$1 extends TSchema = TString> {
|
|
|
26
26
|
*
|
|
27
27
|
* @default TString
|
|
28
28
|
*/
|
|
29
|
-
schema?: T
|
|
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
|
|
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>>;
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
153
|
-
flags: Static<T
|
|
154
|
-
args: A
|
|
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;
|