alepha 0.10.5 → 0.10.7
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 +302 -1
- package/api/jobs.d.ts +207 -188
- package/api/notifications.cjs +8 -0
- package/api/notifications.d.ts +377 -0
- package/api/notifications.js +1 -0
- package/api/users.d.ts +1074 -258
- package/api/verifications.cjs +8 -0
- package/api/verifications.d.ts +1 -0
- package/api/verifications.js +1 -0
- package/batch.d.ts +8 -8
- package/bucket.d.ts +0 -194
- package/cache.d.ts +12 -12
- package/command.d.ts +11 -11
- package/core.d.ts +63 -42
- package/devtools.d.ts +247 -247
- package/email.d.ts +44 -228
- package/lock.d.ts +8 -8
- package/logger.d.ts +0 -1
- package/package.json +69 -48
- package/postgres.d.ts +437 -390
- package/queue.d.ts +14 -14
- package/react/form.d.ts +17 -17
- package/react/i18n.d.ts +10 -7
- package/react.d.ts +39 -39
- package/retry.d.ts +8 -8
- package/scheduler.d.ts +11 -1
- package/security.d.ts +0 -3
- package/server/cache.d.ts +92 -8
- package/server/cookies.d.ts +10 -10
- package/server/links.d.ts +34 -34
- package/server/security.d.ts +4 -6
- package/server/swagger.d.ts +2 -1
- package/server.d.ts +50 -37
- package/topic.d.ts +17 -17
- package/ui.cjs +8 -0
- package/ui.d.ts +300 -0
- package/ui.js +1 -0
- package/vite.d.ts +5 -3
package/queue.d.ts
CHANGED
|
@@ -105,9 +105,9 @@ declare class WorkerProvider {
|
|
|
105
105
|
*/
|
|
106
106
|
wakeUp(): void;
|
|
107
107
|
}
|
|
108
|
-
interface Consumer<T extends TSchema = TSchema> {
|
|
109
|
-
queue: QueueDescriptor<T>;
|
|
110
|
-
handler: (message: QueueMessage<T>) => Promise<void>;
|
|
108
|
+
interface Consumer<T$1 extends TSchema = TSchema> {
|
|
109
|
+
queue: QueueDescriptor<T$1>;
|
|
110
|
+
handler: (message: QueueMessage<T$1>) => Promise<void>;
|
|
111
111
|
}
|
|
112
112
|
interface NextMessage {
|
|
113
113
|
consumer: Consumer;
|
|
@@ -230,7 +230,7 @@ declare const $queue: {
|
|
|
230
230
|
<T extends TSchema>(options: QueueDescriptorOptions<T>): QueueDescriptor<T>;
|
|
231
231
|
[KIND]: typeof QueueDescriptor;
|
|
232
232
|
};
|
|
233
|
-
interface QueueDescriptorOptions<T extends TSchema> {
|
|
233
|
+
interface QueueDescriptorOptions<T$1 extends TSchema> {
|
|
234
234
|
/**
|
|
235
235
|
* Unique name for the queue.
|
|
236
236
|
*
|
|
@@ -306,7 +306,7 @@ interface QueueDescriptorOptions<T extends TSchema> {
|
|
|
306
306
|
* })
|
|
307
307
|
* ```
|
|
308
308
|
*/
|
|
309
|
-
schema: T;
|
|
309
|
+
schema: T$1;
|
|
310
310
|
/**
|
|
311
311
|
* Message handler function that processes queue messages.
|
|
312
312
|
*
|
|
@@ -348,21 +348,21 @@ interface QueueDescriptorOptions<T extends TSchema> {
|
|
|
348
348
|
* }
|
|
349
349
|
* ```
|
|
350
350
|
*/
|
|
351
|
-
handler?: (message: QueueMessage<T>) => Promise<void>;
|
|
351
|
+
handler?: (message: QueueMessage<T$1>) => Promise<void>;
|
|
352
352
|
}
|
|
353
|
-
declare class QueueDescriptor<T extends TSchema> extends Descriptor<QueueDescriptorOptions<T>> {
|
|
353
|
+
declare class QueueDescriptor<T$1 extends TSchema> extends Descriptor<QueueDescriptorOptions<T$1>> {
|
|
354
354
|
protected readonly log: _alepha_logger0.Logger;
|
|
355
355
|
protected readonly workerProvider: WorkerProvider;
|
|
356
356
|
readonly provider: QueueProvider | MemoryQueueProvider;
|
|
357
|
-
push(...payloads: Array<Static<T>>): Promise<void>;
|
|
357
|
+
push(...payloads: Array<Static<T$1>>): Promise<void>;
|
|
358
358
|
get name(): string;
|
|
359
359
|
protected $provider(): QueueProvider | MemoryQueueProvider;
|
|
360
360
|
}
|
|
361
361
|
interface QueueMessageSchema {
|
|
362
362
|
payload: TSchema;
|
|
363
363
|
}
|
|
364
|
-
interface QueueMessage<T extends TSchema> {
|
|
365
|
-
payload: Static<T>;
|
|
364
|
+
interface QueueMessage<T$1 extends TSchema> {
|
|
365
|
+
payload: Static<T$1>;
|
|
366
366
|
}
|
|
367
367
|
//#endregion
|
|
368
368
|
//#region src/descriptors/$consumer.d.ts
|
|
@@ -631,7 +631,7 @@ declare const $consumer: {
|
|
|
631
631
|
<T extends TSchema>(options: ConsumerDescriptorOptions<T>): ConsumerDescriptor<T>;
|
|
632
632
|
[KIND]: typeof ConsumerDescriptor;
|
|
633
633
|
};
|
|
634
|
-
interface ConsumerDescriptorOptions<T extends TSchema> {
|
|
634
|
+
interface ConsumerDescriptorOptions<T$1 extends TSchema> {
|
|
635
635
|
/**
|
|
636
636
|
* The queue descriptor that this consumer will process messages from.
|
|
637
637
|
*
|
|
@@ -662,7 +662,7 @@ interface ConsumerDescriptorOptions<T extends TSchema> {
|
|
|
662
662
|
* });
|
|
663
663
|
* ```
|
|
664
664
|
*/
|
|
665
|
-
queue: QueueDescriptor<T>;
|
|
665
|
+
queue: QueueDescriptor<T$1>;
|
|
666
666
|
/**
|
|
667
667
|
* Message handler function that processes individual messages from the queue.
|
|
668
668
|
*
|
|
@@ -737,10 +737,10 @@ interface ConsumerDescriptorOptions<T extends TSchema> {
|
|
|
737
737
|
* ```
|
|
738
738
|
*/
|
|
739
739
|
handler: (message: {
|
|
740
|
-
payload: Static<T>;
|
|
740
|
+
payload: Static<T$1>;
|
|
741
741
|
}) => Promise<void>;
|
|
742
742
|
}
|
|
743
|
-
declare class ConsumerDescriptor<T extends TSchema> extends Descriptor<ConsumerDescriptorOptions<T>> {}
|
|
743
|
+
declare class ConsumerDescriptor<T$1 extends TSchema> extends Descriptor<ConsumerDescriptorOptions<T$1>> {}
|
|
744
744
|
//#endregion
|
|
745
745
|
//#region src/index.d.ts
|
|
746
746
|
/**
|
package/react/form.d.ts
CHANGED
|
@@ -4,22 +4,22 @@ import { InputHTMLAttributes, ReactNode } from "react";
|
|
|
4
4
|
import * as _alepha_logger0 from "alepha/logger";
|
|
5
5
|
|
|
6
6
|
//#region src/services/FormModel.d.ts
|
|
7
|
-
declare class FormModel<T extends TObject> {
|
|
7
|
+
declare class FormModel<T$1 extends TObject> {
|
|
8
8
|
readonly id: string;
|
|
9
|
-
|
|
9
|
+
readonly options: FormCtrlOptions<T$1>;
|
|
10
10
|
protected readonly log: _alepha_logger0.Logger;
|
|
11
11
|
protected readonly alepha: Alepha;
|
|
12
12
|
protected readonly values: Record<string, any>;
|
|
13
|
-
input: SchemaToInput<T>;
|
|
14
|
-
constructor(id: string, options: FormCtrlOptions<T>);
|
|
13
|
+
input: SchemaToInput<T$1>;
|
|
14
|
+
constructor(id: string, options: FormCtrlOptions<T$1>);
|
|
15
15
|
readonly onSubmit: (event: FormEventLike) => Promise<void>;
|
|
16
|
-
protected parseValuesFromFormElement<T extends TObject>(options: FormCtrlOptions<T>, store: Record<string, any>): Record<string, any>;
|
|
17
|
-
protected getValueFromInputObject<T extends TObject>(options: FormCtrlOptions<T>, values: Record<string, any>, key: string, value: FormDataEntryValue): void;
|
|
18
|
-
protected createProxyFromSchema<T extends TObject>(options: FormCtrlOptions<T>, schema: TSchema, context: {
|
|
16
|
+
protected parseValuesFromFormElement<T extends TObject>(options: FormCtrlOptions<T$1>, store: Record<string, any>): Record<string, any>;
|
|
17
|
+
protected getValueFromInputObject<T extends TObject>(options: FormCtrlOptions<T$1>, values: Record<string, any>, key: string, value: FormDataEntryValue): void;
|
|
18
|
+
protected createProxyFromSchema<T extends TObject>(options: FormCtrlOptions<T$1>, schema: TSchema, context: {
|
|
19
19
|
parent: string;
|
|
20
20
|
store: Record<string, any>;
|
|
21
|
-
}): SchemaToInput<T>;
|
|
22
|
-
protected createInputFromSchema<T extends TObject>(name: keyof Static<T> & string, options: FormCtrlOptions<T>, schema: TObject, required: boolean, context: {
|
|
21
|
+
}): SchemaToInput<T$1>;
|
|
22
|
+
protected createInputFromSchema<T extends TObject>(name: keyof Static<T$1> & string, options: FormCtrlOptions<T$1>, schema: TObject, required: boolean, context: {
|
|
23
23
|
parent: string;
|
|
24
24
|
store: Record<string, any>;
|
|
25
25
|
}): InputField;
|
|
@@ -29,7 +29,7 @@ declare class FormModel<T extends TObject> {
|
|
|
29
29
|
protected getValueFromInput(input: FormDataEntryValue, schema: TSchema): any;
|
|
30
30
|
protected valueToInputEntry(value: any): string | number | boolean;
|
|
31
31
|
}
|
|
32
|
-
type SchemaToInput<T extends TObject> = { [K in keyof T["properties"]]: T["properties"][K] extends TObject ? SchemaToInput<T["properties"][K]> : InputField };
|
|
32
|
+
type SchemaToInput<T$1 extends TObject> = { [K in keyof T$1["properties"]]: T$1["properties"][K] extends TObject ? SchemaToInput<T$1["properties"][K]> : InputField };
|
|
33
33
|
interface FormEventLike {
|
|
34
34
|
currentTarget: any;
|
|
35
35
|
preventDefault: () => void;
|
|
@@ -48,29 +48,29 @@ type InputHTMLAttributesLike = Pick<InputHTMLAttributes<unknown>, "id" | "name"
|
|
|
48
48
|
defaultValue?: any;
|
|
49
49
|
onChange?: (event: any) => void;
|
|
50
50
|
};
|
|
51
|
-
type FormCtrlOptions<T extends TObject> = {
|
|
51
|
+
type FormCtrlOptions<T$1 extends TObject> = {
|
|
52
52
|
/**
|
|
53
53
|
* The schema defining the structure and validation rules for the form.
|
|
54
54
|
* This should be a TypeBox schema object.
|
|
55
55
|
*/
|
|
56
|
-
schema: T;
|
|
56
|
+
schema: T$1;
|
|
57
57
|
/**
|
|
58
58
|
* Callback function to handle form submission.
|
|
59
59
|
* This function will receive the parsed and validated form values.
|
|
60
60
|
*/
|
|
61
|
-
handler: (values: Static<T>, args: {
|
|
61
|
+
handler: (values: Static<T$1>, args: {
|
|
62
62
|
form: HTMLFormElement;
|
|
63
63
|
}) => unknown;
|
|
64
64
|
/**
|
|
65
65
|
* Optional initial values for the form fields.
|
|
66
66
|
* This can be used to pre-populate the form with existing data.
|
|
67
67
|
*/
|
|
68
|
-
initialValues?: Partial<Static<T>>;
|
|
68
|
+
initialValues?: Partial<Static<T$1>>;
|
|
69
69
|
/**
|
|
70
70
|
* Optional function to create custom field attributes.
|
|
71
71
|
* This can be used to add custom validation, styles, or other attributes.
|
|
72
72
|
*/
|
|
73
|
-
onCreateField?: (name: keyof Static<T> & string, schema: TSchema) => InputHTMLAttributes<unknown>;
|
|
73
|
+
onCreateField?: (name: keyof Static<T$1> & string, schema: TSchema) => InputHTMLAttributes<unknown>;
|
|
74
74
|
/**
|
|
75
75
|
* If defined, this will generate a unique ID for each field, prefixed with this string.
|
|
76
76
|
*
|
|
@@ -126,10 +126,10 @@ declare const FormState: <T extends TObject>(props: {
|
|
|
126
126
|
declare const useForm: <T extends TObject>(options: FormCtrlOptions<T>) => FormModel<T>;
|
|
127
127
|
//#endregion
|
|
128
128
|
//#region src/hooks/useFormState.d.ts
|
|
129
|
-
interface UseFormStateReturn<T extends TObject> {
|
|
129
|
+
interface UseFormStateReturn<T$1 extends TObject> {
|
|
130
130
|
loading: boolean;
|
|
131
131
|
dirty: boolean;
|
|
132
|
-
values?: T;
|
|
132
|
+
values?: T$1;
|
|
133
133
|
error?: Error;
|
|
134
134
|
}
|
|
135
135
|
type FormStateEvent = "change" | "submit" | "error";
|
package/react/i18n.d.ts
CHANGED
|
@@ -14,10 +14,10 @@ declare const useI18n: <S extends object, K extends keyof ServiceDictionary<S>>(
|
|
|
14
14
|
default?: string;
|
|
15
15
|
}): string;
|
|
16
16
|
};
|
|
17
|
-
type ServiceDictionary<T extends object> = { [K in keyof T]: T[K] extends DictionaryDescriptor<infer U> ? U : never };
|
|
17
|
+
type ServiceDictionary<T$1 extends object> = { [K in keyof T$1]: T$1[K] extends DictionaryDescriptor<infer U> ? U : never };
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region src/providers/I18nProvider.d.ts
|
|
20
|
-
declare class I18nProvider<S extends object, K extends keyof ServiceDictionary<S>> {
|
|
20
|
+
declare class I18nProvider<S$1 extends object, K$1 extends keyof ServiceDictionary<S$1>> {
|
|
21
21
|
protected logger: _alepha_logger0.Logger;
|
|
22
22
|
protected alepha: Alepha;
|
|
23
23
|
protected cookie: _alepha_server_cookies0.AbstractCookieDescriptor<typebox0.TString>;
|
|
@@ -30,6 +30,9 @@ declare class I18nProvider<S extends object, K extends keyof ServiceDictionary<S
|
|
|
30
30
|
options: {
|
|
31
31
|
fallbackLang: string;
|
|
32
32
|
};
|
|
33
|
+
dateFormat: {
|
|
34
|
+
format: (value: Date) => string;
|
|
35
|
+
};
|
|
33
36
|
numberFormat: {
|
|
34
37
|
format: (value: number) => string;
|
|
35
38
|
};
|
|
@@ -37,11 +40,11 @@ declare class I18nProvider<S extends object, K extends keyof ServiceDictionary<S
|
|
|
37
40
|
protected readonly onRender: _alepha_core1.HookDescriptor<"server:onRequest">;
|
|
38
41
|
protected readonly onStart: _alepha_core1.HookDescriptor<"start">;
|
|
39
42
|
protected createFormatters(): void;
|
|
40
|
-
setLang(lang: string)
|
|
43
|
+
setLang: (lang: string) => Promise<void>;
|
|
41
44
|
protected readonly mutate: _alepha_core1.HookDescriptor<"state:mutate">;
|
|
42
45
|
get lang(): string;
|
|
43
46
|
translate: (key: string, args?: string[]) => string;
|
|
44
|
-
readonly tr: (key: keyof ServiceDictionary<S>[K] | string, options?: {
|
|
47
|
+
readonly tr: (key: keyof ServiceDictionary<S$1>[K$1] | string, options?: {
|
|
45
48
|
args?: string[];
|
|
46
49
|
default?: string;
|
|
47
50
|
}) => string;
|
|
@@ -84,14 +87,14 @@ declare const $dictionary: {
|
|
|
84
87
|
<T extends Record<string, string>>(options: DictionaryDescriptorOptions<T>): DictionaryDescriptor<T>;
|
|
85
88
|
[KIND]: typeof DictionaryDescriptor;
|
|
86
89
|
};
|
|
87
|
-
interface DictionaryDescriptorOptions<T extends Record<string, string>> {
|
|
90
|
+
interface DictionaryDescriptorOptions<T$1 extends Record<string, string>> {
|
|
88
91
|
lang?: string;
|
|
89
92
|
name?: string;
|
|
90
93
|
lazy: () => Promise<{
|
|
91
|
-
default: T;
|
|
94
|
+
default: T$1;
|
|
92
95
|
}>;
|
|
93
96
|
}
|
|
94
|
-
declare class DictionaryDescriptor<T extends Record<string, string>> extends Descriptor<DictionaryDescriptorOptions<T>> {
|
|
97
|
+
declare class DictionaryDescriptor<T$1 extends Record<string, string>> extends Descriptor<DictionaryDescriptorOptions<T$1>> {
|
|
95
98
|
protected provider: I18nProvider<object, never>;
|
|
96
99
|
protected onInit(): void;
|
|
97
100
|
}
|
package/react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _alepha_core5 from "alepha";
|
|
2
2
|
import { Alepha, Async, Descriptor, Hooks, KIND, Service, State, Static, TObject, TSchema } from "alepha";
|
|
3
3
|
import { RequestConfigSchema, ServerHandler, ServerProvider, ServerRequest, ServerRouterProvider, ServerTimingProvider } from "alepha/server";
|
|
4
4
|
import { ServerRouteCache } from "alepha/server/cache";
|
|
@@ -40,8 +40,8 @@ declare class Redirection extends Error {
|
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/providers/ReactPageProvider.d.ts
|
|
43
|
-
declare const envSchema$2:
|
|
44
|
-
REACT_STRICT_MODE:
|
|
43
|
+
declare const envSchema$2: _alepha_core5.TObject<{
|
|
44
|
+
REACT_STRICT_MODE: _alepha_core5.TBoolean;
|
|
45
45
|
}>;
|
|
46
46
|
declare module "alepha" {
|
|
47
47
|
interface Env extends Partial<Static<typeof envSchema$2>> {}
|
|
@@ -83,7 +83,7 @@ declare class ReactPageProvider {
|
|
|
83
83
|
}, params?: Record<string, any>): string;
|
|
84
84
|
compile(path: string, params?: Record<string, string>): string;
|
|
85
85
|
protected renderView(index: number, path: string, view: ReactNode | undefined, page: PageRoute): ReactNode;
|
|
86
|
-
protected readonly configure:
|
|
86
|
+
protected readonly configure: _alepha_core5.HookDescriptor<"configure">;
|
|
87
87
|
protected map(pages: Array<PageDescriptor>, target: PageDescriptor): PageRouteEntry;
|
|
88
88
|
add(entry: PageRouteEntry): void;
|
|
89
89
|
protected createMatch(page: PageRoute): string;
|
|
@@ -255,7 +255,7 @@ declare const $page: {
|
|
|
255
255
|
<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = any, TPropsParent extends object = TPropsParentDefault>(options: PageDescriptorOptions<TConfig, TProps, TPropsParent>): PageDescriptor<TConfig, TProps, TPropsParent>;
|
|
256
256
|
[KIND]: typeof PageDescriptor;
|
|
257
257
|
};
|
|
258
|
-
interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> {
|
|
258
|
+
interface PageDescriptorOptions<TConfig$1 extends PageConfigSchema = PageConfigSchema, TProps$1 extends object = TPropsDefault, TPropsParent$1 extends object = TPropsParentDefault> {
|
|
259
259
|
/**
|
|
260
260
|
* Name your page.
|
|
261
261
|
*
|
|
@@ -279,7 +279,7 @@ interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSch
|
|
|
279
279
|
* - `params`: parameters from the pathname.
|
|
280
280
|
* - `query`: query parameters from the URL.
|
|
281
281
|
*/
|
|
282
|
-
schema?: TConfig;
|
|
282
|
+
schema?: TConfig$1;
|
|
283
283
|
/**
|
|
284
284
|
* Load data before rendering the page.
|
|
285
285
|
*
|
|
@@ -294,14 +294,14 @@ interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSch
|
|
|
294
294
|
*
|
|
295
295
|
* RedirectError can be thrown to redirect the user to another page.
|
|
296
296
|
*/
|
|
297
|
-
resolve?: (context: PageResolve<TConfig, TPropsParent>) => Async<TProps>;
|
|
297
|
+
resolve?: (context: PageResolve<TConfig$1, TPropsParent$1>) => Async<TProps$1>;
|
|
298
298
|
/**
|
|
299
299
|
* The component to render when the page is loaded.
|
|
300
300
|
*
|
|
301
301
|
* If `lazy` is defined, this will be ignored.
|
|
302
302
|
* Prefer using `lazy` to improve the initial loading time.
|
|
303
303
|
*/
|
|
304
|
-
component?: FC<TProps & TPropsParent>;
|
|
304
|
+
component?: FC<TProps$1 & TPropsParent$1>;
|
|
305
305
|
/**
|
|
306
306
|
* Lazy load the component when the page is loaded.
|
|
307
307
|
*
|
|
@@ -309,7 +309,7 @@ interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSch
|
|
|
309
309
|
* and enable code-splitting.
|
|
310
310
|
*/
|
|
311
311
|
lazy?: () => Promise<{
|
|
312
|
-
default: FC<TProps & TPropsParent>;
|
|
312
|
+
default: FC<TProps$1 & TPropsParent$1>;
|
|
313
313
|
}>;
|
|
314
314
|
/**
|
|
315
315
|
* Set some children pages and make the page a parent page.
|
|
@@ -319,7 +319,7 @@ interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSch
|
|
|
319
319
|
* If you still want to render at this pathname, add a child page with an empty path.
|
|
320
320
|
*/
|
|
321
321
|
children?: Array<PageDescriptor> | (() => Array<PageDescriptor>);
|
|
322
|
-
parent?: PageDescriptor<PageConfigSchema, TPropsParent>;
|
|
322
|
+
parent?: PageDescriptor<PageConfigSchema, TPropsParent$1>;
|
|
323
323
|
can?: () => boolean;
|
|
324
324
|
/**
|
|
325
325
|
* Catch any error from the `resolve` function or during `rendering`.
|
|
@@ -368,7 +368,7 @@ interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSch
|
|
|
368
368
|
* It will act as timeless cached page server-side. You can use `cache` to configure the cache behavior.
|
|
369
369
|
*/
|
|
370
370
|
static?: boolean | {
|
|
371
|
-
entries?: Array<Partial<PageRequestConfig<TConfig>>>;
|
|
371
|
+
entries?: Array<Partial<PageRequestConfig<TConfig$1>>>;
|
|
372
372
|
};
|
|
373
373
|
cache?: ServerRouteCache;
|
|
374
374
|
/**
|
|
@@ -429,7 +429,7 @@ interface PageDescriptorOptions<TConfig extends PageConfigSchema = PageConfigSch
|
|
|
429
429
|
animation?: PageAnimation;
|
|
430
430
|
}
|
|
431
431
|
type ErrorHandler = (error: Error, state: ReactRouterState) => ReactNode | Redirection | undefined;
|
|
432
|
-
declare class PageDescriptor<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> extends Descriptor<PageDescriptorOptions<TConfig, TProps, TPropsParent>> {
|
|
432
|
+
declare class PageDescriptor<TConfig$1 extends PageConfigSchema = PageConfigSchema, TProps$1 extends object = TPropsDefault, TPropsParent$1 extends object = TPropsParentDefault> extends Descriptor<PageDescriptorOptions<TConfig$1, TProps$1, TPropsParent$1>> {
|
|
433
433
|
protected onInit(): void;
|
|
434
434
|
get name(): string;
|
|
435
435
|
/**
|
|
@@ -467,11 +467,11 @@ interface PageDescriptorRenderResult {
|
|
|
467
467
|
state: ReactRouterState;
|
|
468
468
|
redirect?: string;
|
|
469
469
|
}
|
|
470
|
-
interface PageRequestConfig<TConfig extends PageConfigSchema = PageConfigSchema> {
|
|
471
|
-
params: TConfig["params"] extends TSchema ? Static<TConfig["params"]> : Record<string, string>;
|
|
472
|
-
query: TConfig["query"] extends TSchema ? Static<TConfig["query"]> : Record<string, string>;
|
|
470
|
+
interface PageRequestConfig<TConfig$1 extends PageConfigSchema = PageConfigSchema> {
|
|
471
|
+
params: TConfig$1["params"] extends TSchema ? Static<TConfig$1["params"]> : Record<string, string>;
|
|
472
|
+
query: TConfig$1["query"] extends TSchema ? Static<TConfig$1["query"]> : Record<string, string>;
|
|
473
473
|
}
|
|
474
|
-
type PageResolve<TConfig extends PageConfigSchema = PageConfigSchema, TPropsParent extends object = TPropsParentDefault> = PageRequestConfig<TConfig> & TPropsParent & Omit<ReactRouterState, "layers" | "onError">;
|
|
474
|
+
type PageResolve<TConfig$1 extends PageConfigSchema = PageConfigSchema, TPropsParent$1 extends object = TPropsParentDefault> = PageRequestConfig<TConfig$1> & TPropsParent$1 & Omit<ReactRouterState, "layers" | "onError">;
|
|
475
475
|
type PageAnimation = PageAnimationObject | ((state: ReactRouterState) => PageAnimationObject | undefined);
|
|
476
476
|
type PageAnimationObject = CssAnimationName | {
|
|
477
477
|
enter?: CssAnimation | CssAnimationName;
|
|
@@ -493,14 +493,14 @@ declare class ReactBrowserRouterProvider extends RouterProvider<BrowserRoute> {
|
|
|
493
493
|
protected readonly alepha: Alepha;
|
|
494
494
|
protected readonly pageApi: ReactPageProvider;
|
|
495
495
|
add(entry: PageRouteEntry): void;
|
|
496
|
-
protected readonly configure:
|
|
496
|
+
protected readonly configure: _alepha_core5.HookDescriptor<"configure">;
|
|
497
497
|
transition(url: URL, previous?: PreviousLayerData[], meta?: {}): Promise<string | void>;
|
|
498
498
|
root(state: ReactRouterState): ReactNode;
|
|
499
499
|
}
|
|
500
500
|
//#endregion
|
|
501
501
|
//#region src/providers/ReactBrowserProvider.d.ts
|
|
502
|
-
declare const envSchema$1:
|
|
503
|
-
REACT_ROOT_ID:
|
|
502
|
+
declare const envSchema$1: _alepha_core5.TObject<{
|
|
503
|
+
REACT_ROOT_ID: _alepha_core5.TString;
|
|
504
504
|
}>;
|
|
505
505
|
declare module "alepha" {
|
|
506
506
|
interface Env extends Partial<Static<typeof envSchema$1>> {}
|
|
@@ -546,8 +546,8 @@ declare class ReactBrowserProvider {
|
|
|
546
546
|
* Get embedded layers from the server.
|
|
547
547
|
*/
|
|
548
548
|
protected getHydrationState(): ReactHydrationState | undefined;
|
|
549
|
-
protected readonly onTransitionEnd:
|
|
550
|
-
readonly ready:
|
|
549
|
+
protected readonly onTransitionEnd: _alepha_core5.HookDescriptor<"react:transition:end">;
|
|
550
|
+
readonly ready: _alepha_core5.HookDescriptor<"ready">;
|
|
551
551
|
}
|
|
552
552
|
interface RouterGoOptions {
|
|
553
553
|
replace?: boolean;
|
|
@@ -703,13 +703,13 @@ interface UseQueryParamsHookOptions {
|
|
|
703
703
|
}
|
|
704
704
|
//#endregion
|
|
705
705
|
//#region src/services/ReactRouter.d.ts
|
|
706
|
-
declare class ReactRouter<T extends object> {
|
|
706
|
+
declare class ReactRouter<T$1 extends object> {
|
|
707
707
|
protected readonly alepha: Alepha;
|
|
708
708
|
protected readonly pageApi: ReactPageProvider;
|
|
709
709
|
get state(): ReactRouterState;
|
|
710
710
|
get pages(): PageRoute[];
|
|
711
711
|
get browser(): ReactBrowserProvider | undefined;
|
|
712
|
-
path(name: keyof VirtualRouter<T>, config?: {
|
|
712
|
+
path(name: keyof VirtualRouter<T$1>, config?: {
|
|
713
713
|
params?: Record<string, any>;
|
|
714
714
|
query?: Record<string, any>;
|
|
715
715
|
}): string;
|
|
@@ -727,9 +727,9 @@ declare class ReactRouter<T extends object> {
|
|
|
727
727
|
forward(): Promise<void>;
|
|
728
728
|
invalidate(props?: Record<string, any>): Promise<void>;
|
|
729
729
|
go(path: string, options?: RouterGoOptions): Promise<void>;
|
|
730
|
-
go(path: keyof VirtualRouter<T>, options?: RouterGoOptions): Promise<void>;
|
|
730
|
+
go(path: keyof VirtualRouter<T$1>, options?: RouterGoOptions): Promise<void>;
|
|
731
731
|
anchor(path: string, options?: RouterGoOptions): AnchorProps;
|
|
732
|
-
anchor(path: keyof VirtualRouter<T>, options?: RouterGoOptions): AnchorProps;
|
|
732
|
+
anchor(path: keyof VirtualRouter<T$1>, options?: RouterGoOptions): AnchorProps;
|
|
733
733
|
base(path: string): string;
|
|
734
734
|
/**
|
|
735
735
|
* Set query params.
|
|
@@ -744,7 +744,7 @@ declare class ReactRouter<T extends object> {
|
|
|
744
744
|
push?: boolean;
|
|
745
745
|
}): void;
|
|
746
746
|
}
|
|
747
|
-
type VirtualRouter<T> = { [K in keyof T as T[K] extends PageDescriptor ? K : never]: T[K] };
|
|
747
|
+
type VirtualRouter<T$1> = { [K in keyof T$1 as T$1[K] extends PageDescriptor ? K : never]: T$1[K] };
|
|
748
748
|
//#endregion
|
|
749
749
|
//#region src/hooks/useRouter.d.ts
|
|
750
750
|
/**
|
|
@@ -764,9 +764,9 @@ type VirtualRouter<T> = { [K in keyof T as T[K] extends PageDescriptor ? K : nev
|
|
|
764
764
|
declare const useRouter: <T extends object = any>() => ReactRouter<T>;
|
|
765
765
|
//#endregion
|
|
766
766
|
//#region src/hooks/useRouterEvents.d.ts
|
|
767
|
-
type Hook<T extends keyof Hooks> = ((ev: Hooks[T]) => void) | {
|
|
767
|
+
type Hook<T$1 extends keyof Hooks> = ((ev: Hooks[T$1]) => void) | {
|
|
768
768
|
priority?: "first" | "last";
|
|
769
|
-
callback: (ev: Hooks[T]) => void;
|
|
769
|
+
callback: (ev: Hooks[T$1]) => void;
|
|
770
770
|
};
|
|
771
771
|
/**
|
|
772
772
|
* Subscribe to various router events.
|
|
@@ -783,7 +783,7 @@ declare const useRouterState: () => ReactRouterState;
|
|
|
783
783
|
//#endregion
|
|
784
784
|
//#region src/hooks/useSchema.d.ts
|
|
785
785
|
declare const useSchema: <TConfig extends RequestConfigSchema>(action: VirtualAction<TConfig>) => UseSchemaReturn<TConfig>;
|
|
786
|
-
type UseSchemaReturn<TConfig extends RequestConfigSchema> = TConfig & {
|
|
786
|
+
type UseSchemaReturn<TConfig$1 extends RequestConfigSchema> = TConfig$1 & {
|
|
787
787
|
loading: boolean;
|
|
788
788
|
};
|
|
789
789
|
/**
|
|
@@ -800,12 +800,12 @@ declare const ssrSchemaLoading: (alepha: Alepha, name: string) => RequestConfigS
|
|
|
800
800
|
declare const useStore: <Key extends keyof State>(key: Key, defaultValue?: State[Key]) => [State[Key], (value: State[Key]) => void];
|
|
801
801
|
//#endregion
|
|
802
802
|
//#region src/providers/ReactServerProvider.d.ts
|
|
803
|
-
declare const envSchema:
|
|
804
|
-
REACT_SERVER_DIST:
|
|
805
|
-
REACT_SERVER_PREFIX:
|
|
806
|
-
REACT_SSR_ENABLED:
|
|
807
|
-
REACT_ROOT_ID:
|
|
808
|
-
REACT_SERVER_TEMPLATE:
|
|
803
|
+
declare const envSchema: _alepha_core5.TObject<{
|
|
804
|
+
REACT_SERVER_DIST: _alepha_core5.TString;
|
|
805
|
+
REACT_SERVER_PREFIX: _alepha_core5.TString;
|
|
806
|
+
REACT_SSR_ENABLED: _alepha_core5.TOptional<_alepha_core5.TBoolean>;
|
|
807
|
+
REACT_ROOT_ID: _alepha_core5.TString;
|
|
808
|
+
REACT_SERVER_TEMPLATE: _alepha_core5.TOptional<_alepha_core5.TString>;
|
|
809
809
|
}>;
|
|
810
810
|
declare module "alepha" {
|
|
811
811
|
interface Env extends Partial<Static<typeof envSchema>> {}
|
|
@@ -824,13 +824,13 @@ declare class ReactServerProvider {
|
|
|
824
824
|
protected readonly env: {
|
|
825
825
|
REACT_SSR_ENABLED?: boolean | undefined;
|
|
826
826
|
REACT_SERVER_TEMPLATE?: string | undefined;
|
|
827
|
+
REACT_ROOT_ID: string;
|
|
827
828
|
REACT_SERVER_DIST: string;
|
|
828
829
|
REACT_SERVER_PREFIX: string;
|
|
829
|
-
REACT_ROOT_ID: string;
|
|
830
830
|
};
|
|
831
831
|
protected readonly ROOT_DIV_REGEX: RegExp;
|
|
832
832
|
protected preprocessedTemplate: PreprocessedTemplate | null;
|
|
833
|
-
readonly onConfigure:
|
|
833
|
+
readonly onConfigure: _alepha_core5.HookDescriptor<"configure">;
|
|
834
834
|
get template(): string;
|
|
835
835
|
protected registerPages(templateLoader: TemplateLoader): Promise<void>;
|
|
836
836
|
protected getPublicDirectory(): string;
|
|
@@ -871,7 +871,7 @@ declare module "alepha" {
|
|
|
871
871
|
html: string;
|
|
872
872
|
};
|
|
873
873
|
"react:browser:render": {
|
|
874
|
-
root:
|
|
874
|
+
root: HTMLElement;
|
|
875
875
|
element: ReactNode;
|
|
876
876
|
state: ReactRouterState;
|
|
877
877
|
hydration?: ReactHydrationState;
|
|
@@ -903,7 +903,7 @@ declare module "alepha" {
|
|
|
903
903
|
* @see {@link $page}
|
|
904
904
|
* @module alepha.react
|
|
905
905
|
*/
|
|
906
|
-
declare const AlephaReact:
|
|
906
|
+
declare const AlephaReact: _alepha_core5.Service<_alepha_core5.Module<{}>>;
|
|
907
907
|
//#endregion
|
|
908
908
|
export { $page, AlephaContext, AlephaReact, AnchorProps, ClientOnly, CreateLayersResult, ErrorBoundary, ErrorHandler, ErrorViewer, Layer, Link, LinkProps, _default as NestedView, NotFoundPage as NotFound, PageAnimation, PageConfigSchema, PageDescriptor, PageDescriptorOptions, PageDescriptorRenderOptions, PageDescriptorRenderResult, PageRequestConfig, PageResolve, PageRoute, PageRouteEntry, PreviousLayerData, ReactBrowserProvider, ReactBrowserRendererOptions, ReactHydrationState, ReactPageProvider, ReactRouter, ReactRouterState, ReactServerProvider, Redirection, RouterGoOptions, RouterLayerContext, RouterLayerContextValue, RouterRenderOptions, RouterStackItem, TPropsDefault, TPropsParentDefault, TransitionOptions, UseActiveHook, UseActiveOptions, UseQueryParamsHookOptions, UseSchemaReturn, VirtualRouter, isPageRoute, ssrSchemaLoading, useActive, useAlepha, useClient, useInject, useQueryParams, useRouter, useRouterEvents, useRouterState, useSchema, useStore };
|
|
909
909
|
//# sourceMappingURL=index.d.ts.map
|
package/retry.d.ts
CHANGED
|
@@ -11,11 +11,11 @@ declare const $retry: {
|
|
|
11
11
|
<T extends (...args: any[]) => any>(options: RetryDescriptorOptions<T>): RetryDescriptorFn<T>;
|
|
12
12
|
[KIND]: typeof RetryDescriptor;
|
|
13
13
|
};
|
|
14
|
-
interface RetryDescriptorOptions<T extends (...args: any[]) => any> {
|
|
14
|
+
interface RetryDescriptorOptions<T$1 extends (...args: any[]) => any> {
|
|
15
15
|
/**
|
|
16
16
|
* The function to retry.
|
|
17
17
|
*/
|
|
18
|
-
handler: T;
|
|
18
|
+
handler: T$1;
|
|
19
19
|
/**
|
|
20
20
|
* The maximum number of attempts.
|
|
21
21
|
*
|
|
@@ -45,20 +45,20 @@ interface RetryDescriptorOptions<T extends (...args: any[]) => any> {
|
|
|
45
45
|
* A custom callback for when a retry attempt fails.
|
|
46
46
|
* This is called before the delay.
|
|
47
47
|
*/
|
|
48
|
-
onError?: (error: Error, attempt: number, ...args: Parameters<T>) => void;
|
|
48
|
+
onError?: (error: Error, attempt: number, ...args: Parameters<T$1>) => void;
|
|
49
49
|
/**
|
|
50
50
|
* An AbortSignal to allow for external cancellation of the retry loop.
|
|
51
51
|
*/
|
|
52
52
|
signal?: AbortSignal;
|
|
53
53
|
}
|
|
54
|
-
declare class RetryDescriptor<T extends (...args: any[]) => any> extends Descriptor<RetryDescriptorOptions<T>> {
|
|
54
|
+
declare class RetryDescriptor<T$1 extends (...args: any[]) => any> extends Descriptor<RetryDescriptorOptions<T$1>> {
|
|
55
55
|
protected readonly dateTimeProvider: DateTimeProvider;
|
|
56
56
|
protected appAbortController: AbortController;
|
|
57
|
-
constructor(args: DescriptorArgs<RetryDescriptorOptions<T>>);
|
|
58
|
-
run(...args: Parameters<T>): Promise<ReturnType<T>>;
|
|
57
|
+
constructor(args: DescriptorArgs<RetryDescriptorOptions<T$1>>);
|
|
58
|
+
run(...args: Parameters<T$1>): Promise<ReturnType<T$1>>;
|
|
59
59
|
}
|
|
60
|
-
interface RetryDescriptorFn<T extends (...args: any[]) => any> extends RetryDescriptor<T> {
|
|
61
|
-
(...args: Parameters<T>): Promise<ReturnType<T>>;
|
|
60
|
+
interface RetryDescriptorFn<T$1 extends (...args: any[]) => any> extends RetryDescriptor<T$1> {
|
|
61
|
+
(...args: Parameters<T$1>): Promise<ReturnType<T$1>>;
|
|
62
62
|
}
|
|
63
63
|
interface RetryBackoffOptions {
|
|
64
64
|
/**
|
package/scheduler.d.ts
CHANGED
|
@@ -6,6 +6,16 @@ import * as _alepha_logger0 from "alepha/logger";
|
|
|
6
6
|
import { Cron } from "cron-schedule";
|
|
7
7
|
import * as dayjs0 from "dayjs";
|
|
8
8
|
|
|
9
|
+
//#region src/constants/CRON.d.ts
|
|
10
|
+
declare const CRON: {
|
|
11
|
+
EVERY_MINUTE: string;
|
|
12
|
+
EVERY_5_MINUTES: string;
|
|
13
|
+
EVERY_15_MINUTES: string;
|
|
14
|
+
EVERY_30_MINUTES: string;
|
|
15
|
+
EVERY_HOUR: string;
|
|
16
|
+
EVERY_DAY_AT_MIDNIGHT: string;
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
9
19
|
//#region src/providers/CronProvider.d.ts
|
|
10
20
|
declare class CronProvider {
|
|
11
21
|
protected readonly dt: DateTimeProvider;
|
|
@@ -131,5 +141,5 @@ declare module "alepha" {
|
|
|
131
141
|
*/
|
|
132
142
|
declare const AlephaScheduler: _alepha_core4.Service<_alepha_core4.Module<{}>>;
|
|
133
143
|
//#endregion
|
|
134
|
-
export { $scheduler, AlephaScheduler, SchedulerDescriptor, SchedulerDescriptorOptions, SchedulerHandlerArguments };
|
|
144
|
+
export { $scheduler, AlephaScheduler, CRON, CronJob, CronProvider, SchedulerDescriptor, SchedulerDescriptorOptions, SchedulerHandlerArguments };
|
|
135
145
|
//# sourceMappingURL=index.d.ts.map
|
package/security.d.ts
CHANGED
|
@@ -199,9 +199,6 @@ declare class SecurityProvider {
|
|
|
199
199
|
checkPermission(permissionLike: string | Permission, ...roleEntries: string[]): SecurityCheckResult;
|
|
200
200
|
/**
|
|
201
201
|
* Creates a user account from the provided payload.
|
|
202
|
-
*
|
|
203
|
-
* @param headerOrToken
|
|
204
|
-
* @param permissionLike
|
|
205
202
|
*/
|
|
206
203
|
createUserFromToken(headerOrToken?: string, options?: {
|
|
207
204
|
permission?: Permission | string;
|