alepha 0.11.5 → 0.11.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.
Files changed (51) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +15 -100
  3. package/api/files.d.ts +168 -169
  4. package/api/jobs.d.ts +263 -154
  5. package/api/notifications.d.ts +28 -29
  6. package/api/users.d.ts +476 -477
  7. package/batch.d.ts +59 -493
  8. package/bucket.d.ts +20 -11
  9. package/cache/redis.d.ts +1 -1
  10. package/cache.d.ts +1 -1
  11. package/command.d.ts +24 -7
  12. package/core.d.ts +299 -222
  13. package/datetime.d.ts +4 -29
  14. package/devtools.d.ts +166 -284
  15. package/email.d.ts +45 -2
  16. package/fake.d.ts +1 -1
  17. package/file.d.ts +1 -1
  18. package/lock/redis.d.ts +1 -1
  19. package/lock.d.ts +1 -1
  20. package/logger.d.ts +11 -9
  21. package/package.json +51 -51
  22. package/postgres.d.ts +480 -198
  23. package/queue/redis.d.ts +1 -1
  24. package/queue.d.ts +1 -1
  25. package/react/auth.d.ts +7 -2
  26. package/react/form.d.ts +39 -16
  27. package/react/head.d.ts +1 -1
  28. package/react/i18n.d.ts +2 -2
  29. package/react.d.ts +66 -41
  30. package/redis.d.ts +1 -1
  31. package/retry.d.ts +84 -21
  32. package/scheduler.d.ts +1 -1
  33. package/security.d.ts +29 -29
  34. package/server/cache.d.ts +1 -1
  35. package/server/compress.d.ts +9 -3
  36. package/server/cookies.d.ts +1 -1
  37. package/server/cors.d.ts +28 -10
  38. package/server/health.d.ts +18 -19
  39. package/server/helmet.d.ts +44 -15
  40. package/server/links.d.ts +37 -31
  41. package/server/metrics.d.ts +1 -1
  42. package/server/multipart.d.ts +1 -1
  43. package/server/proxy.d.ts +1 -1
  44. package/server/security.d.ts +8 -3
  45. package/server/static.d.ts +1 -1
  46. package/server/swagger.d.ts +19 -6
  47. package/server.d.ts +1 -1
  48. package/topic/redis.d.ts +1 -1
  49. package/topic.d.ts +1 -1
  50. package/ui.d.ts +142 -12
  51. package/vite.d.ts +2 -2
package/queue/redis.d.ts CHANGED
@@ -23,7 +23,7 @@ declare class RedisQueueProvider implements QueueProvider {
23
23
  * @see {@link RedisQueueProvider}
24
24
  * @module alepha.queue.redis
25
25
  */
26
- declare const AlephaQueueRedis: _alepha_core0.Service<_alepha_core0.Module<{}>>;
26
+ declare const AlephaQueueRedis: _alepha_core0.Service<_alepha_core0.Module>;
27
27
  //#endregion
28
28
  export { AlephaQueueRedis, RedisQueueProvider };
29
29
  //# sourceMappingURL=index.d.ts.map
package/queue.d.ts CHANGED
@@ -754,7 +754,7 @@ declare class ConsumerDescriptor<T extends TSchema> extends Descriptor<ConsumerD
754
754
  * @see {@link $consumer}
755
755
  * @module alepha.queue
756
756
  */
757
- declare const AlephaQueue: _alepha_core1.Service<_alepha_core1.Module<{}>>;
757
+ declare const AlephaQueue: _alepha_core1.Service<_alepha_core1.Module>;
758
758
  //#endregion
759
759
  export { $consumer, $queue, AlephaQueue, ConsumerDescriptor, ConsumerDescriptorOptions, MemoryQueueProvider, QueueDescriptor, QueueDescriptorOptions, QueueMessage, QueueMessageSchema, QueueProvider };
760
760
  //# sourceMappingURL=index.d.ts.map
package/react/auth.d.ts CHANGED
@@ -479,7 +479,12 @@ declare const useAuth: <T extends object = any>() => {
479
479
  //#region src/index.d.ts
480
480
  declare module "alepha" {
481
481
  interface State {
482
- user?: UserAccount;
482
+ /**
483
+ * The authenticated user account attached to the server request state.
484
+ *
485
+ * @internal
486
+ */
487
+ "alepha.server.request.user"?: UserAccount;
483
488
  }
484
489
  }
485
490
  declare module "alepha/react" {
@@ -493,7 +498,7 @@ declare module "alepha/react" {
493
498
  * @see {@link ReactAuthProvider}
494
499
  * @module alepha.react.auth
495
500
  */
496
- declare const AlephaReactAuth: _alepha_core4.Service<_alepha_core4.Module<{}>>;
501
+ declare const AlephaReactAuth: _alepha_core4.Service<_alepha_core4.Module>;
497
502
  //#endregion
498
503
  export { $auth, AccessToken, AlephaReactAuth, AuthDescriptor, AuthDescriptorOptions, AuthExternal, AuthInternal, CredentialsOptions, OAuth2Options, OAuth2Profile, OidcOptions, ReactAuth, ReactAuthProvider, SessionExpiredError, useAuth };
499
504
  //# sourceMappingURL=index.d.ts.map
package/react/form.d.ts CHANGED
@@ -4,24 +4,45 @@ 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
+
8
+ /**
9
+ * FormModel is a dynamic form handler that generates form inputs based on a provided TypeBox schema.
10
+ * It manages form state, handles input changes, and processes form submissions with validation.
11
+ *
12
+ * It means to be injected and used within React components to provide a structured way to create and manage forms.
13
+ *
14
+ * @see {@link useForm}
15
+ */
7
16
  declare class FormModel<T extends TObject> {
8
17
  readonly id: string;
9
18
  readonly options: FormCtrlOptions<T>;
10
19
  protected readonly log: _alepha_logger0.Logger;
11
20
  protected readonly alepha: Alepha;
12
21
  protected readonly values: Record<string, any>;
22
+ protected submitInProgress: boolean;
13
23
  input: SchemaToInput<T>;
24
+ get submitting(): boolean;
14
25
  constructor(id: string, options: FormCtrlOptions<T>);
26
+ get element(): HTMLFormElement;
15
27
  get currentValues(): Record<string, any>;
16
28
  get props(): {
29
+ id: string;
17
30
  noValidate: boolean;
18
- onSubmit: (values: FormEventLike) => Promise<void>;
31
+ onSubmit: (ev?: FormEventLike) => void;
19
32
  onReset: (event: FormEventLike) => Promise<void>;
20
33
  };
21
- protected readonly reset: (event: FormEventLike) => Promise<void>;
22
- protected readonly submit: (event: FormEventLike) => Promise<void>;
23
- protected parseValuesFromFormElement<T extends TObject>(options: FormCtrlOptions<T>, store: Record<string, any>): Record<string, any>;
24
- protected getValueFromInputObject<T extends TObject>(options: FormCtrlOptions<T>, values: Record<string, any>, key: string, value: FormDataEntryValue): void;
34
+ readonly reset: (event: FormEventLike) => Promise<void>;
35
+ readonly submit: () => Promise<void>;
36
+ /**
37
+ * Restructures flat keys like "address.city" into nested objects like { address: { city: ... } }
38
+ * Values are already typed from onChange, so no conversion is needed.
39
+ */
40
+ protected restructureValues(store: Record<string, any>): Record<string, any>;
41
+ /**
42
+ * Helper to restructure a flat key like "address.city" into nested object structure.
43
+ * The value is already typed, so we just assign it to the nested path.
44
+ */
45
+ protected restructureNestedValue(values: Record<string, any>, key: string, value: any): void;
25
46
  protected createProxyFromSchema<T extends TObject>(options: FormCtrlOptions<T>, schema: TSchema, context: {
26
47
  parent: string;
27
48
  store: Record<string, any>;
@@ -31,16 +52,16 @@ declare class FormModel<T extends TObject> {
31
52
  store: Record<string, any>;
32
53
  }): InputField;
33
54
  /**
34
- * Convert an input value from HTML to the correct type based on the schema.
55
+ * Convert an input value to the correct type based on the schema.
56
+ * Handles raw DOM values (strings, booleans from checkboxes, Files, etc.)
35
57
  */
36
- protected getValueFromInput(input: FormDataEntryValue, schema: TSchema): any;
58
+ protected getValueFromInput(input: any, schema: TSchema): any;
37
59
  protected valueToInputEntry(value: any): string | number | boolean;
38
60
  }
39
61
  type SchemaToInput<T extends TObject> = { [K in keyof T["properties"]]: T["properties"][K] extends TObject ? SchemaToInput<T["properties"][K]> : InputField };
40
62
  interface FormEventLike {
41
- currentTarget: any;
42
- preventDefault: () => void;
43
- stopPropagation: () => void;
63
+ preventDefault?: () => void;
64
+ stopPropagation?: () => void;
44
65
  }
45
66
  interface InputField {
46
67
  path: string;
@@ -50,7 +71,7 @@ interface InputField {
50
71
  set: (value: any) => void;
51
72
  form: FormModel<any>;
52
73
  }
53
- type InputHTMLAttributesLike = Pick<InputHTMLAttributes<unknown>, "id" | "name" | "type" | "value" | "defaultValue" | "required" | "maxLength" | "minLength" | "aria-label"> & {
74
+ type InputHTMLAttributesLike = Pick<InputHTMLAttributes<unknown>, "id" | "name" | "type" | "value" | "defaultValue" | "required" | "maxLength" | "minLength" | "aria-label" | "autoComplete"> & {
54
75
  value?: any;
55
76
  defaultValue?: any;
56
77
  onChange?: (event: any) => void;
@@ -90,6 +111,7 @@ type FormCtrlOptions<T extends TObject> = {
90
111
  form: HTMLFormElement;
91
112
  }) => void;
92
113
  onChange?: (key: string, value: any, store: Record<string, any>) => void;
114
+ onReset?: () => void;
93
115
  };
94
116
  //#endregion
95
117
  //#region src/components/FormState.d.ts
@@ -122,15 +144,15 @@ declare const FormState: <T extends TObject>(props: {
122
144
  * });
123
145
  *
124
146
  * return (
125
- * <form onSubmit={form.onSubmit}>
126
- * <input {...form.input("username")} />
127
- * <input {...form.input("password")} />
147
+ * <form {...form.props}>
148
+ * <input {...form.input.username.props} />
149
+ * <input {...form.input.password.props} />
128
150
  * <button type="submit">Submit</button>
129
151
  * </form>
130
152
  * );
131
153
  * ```
132
154
  */
133
- declare const useForm: <T extends TObject>(options: FormCtrlOptions<T>) => FormModel<T>;
155
+ declare const useForm: <T extends TObject>(options: FormCtrlOptions<T>, deps?: any[]) => FormModel<T>;
134
156
  //#endregion
135
157
  //#region src/hooks/useFormState.d.ts
136
158
  interface UseFormStateReturn {
@@ -150,6 +172,7 @@ declare module "alepha" {
150
172
  "form:change": {
151
173
  id: string;
152
174
  path: string;
175
+ value: any;
153
176
  };
154
177
  "form:reset": {
155
178
  id: string;
@@ -182,7 +205,7 @@ declare module "alepha" {
182
205
  * @see {@link useForm}
183
206
  * @module alepha.react.form
184
207
  */
185
- declare const AlephaReactForm: _alepha_core0.Service<_alepha_core0.Module<{}>>;
208
+ declare const AlephaReactForm: _alepha_core0.Service<_alepha_core0.Module>;
186
209
  //#endregion
187
210
  export { AlephaReactForm, FormCtrlOptions, FormEventLike, FormModel, FormState, InputField, InputHTMLAttributesLike, SchemaToInput, UseFormStateReturn, useForm, useFormState };
188
211
  //# sourceMappingURL=index.d.ts.map
package/react/head.d.ts CHANGED
@@ -114,7 +114,7 @@ declare module "alepha/react" {
114
114
  * @see {@link ServerHeadProvider}
115
115
  * @module alepha.react.head
116
116
  */
117
- declare const AlephaReactHead: _alepha_core1.Service<_alepha_core1.Module<{}>>;
117
+ declare const AlephaReactHead: _alepha_core1.Service<_alepha_core1.Module>;
118
118
  //#endregion
119
119
  export { $head, AlephaReactHead, Head, HeadDescriptor, HeadDescriptorOptions, ServerHeadProvider, SimpleHead, UseHeadOptions, UseHeadReturn, useHead };
120
120
  //# sourceMappingURL=index.d.ts.map
package/react/i18n.d.ts CHANGED
@@ -152,7 +152,7 @@ declare class DictionaryDescriptor<T extends Record<string, string>> extends Des
152
152
  //#region src/index.d.ts
153
153
  declare module "alepha" {
154
154
  interface State {
155
- "react.i18n.lang"?: string;
155
+ "alepha.react.i18n.lang"?: string;
156
156
  }
157
157
  }
158
158
  /**
@@ -162,7 +162,7 @@ declare module "alepha" {
162
162
  *
163
163
  * @module alepha.react.i18n
164
164
  */
165
- declare const AlephaReactI18n: _alepha_core1.Service<_alepha_core1.Module<{}>>;
165
+ declare const AlephaReactI18n: _alepha_core1.Service<_alepha_core1.Module>;
166
166
  //#endregion
167
167
  export { $dictionary, AlephaReactI18n, DictionaryDescriptor, DictionaryDescriptorOptions, I18nLocalizeOptions, I18nLocalizeType, I18nProvider, Localize, type LocalizeProps, ServiceDictionary, useI18n };
168
168
  //# sourceMappingURL=index.d.ts.map
package/react.d.ts CHANGED
@@ -1,15 +1,16 @@
1
- import * as _alepha_core10 from "alepha";
2
- import { Alepha, Async, Configurable, Descriptor, Hook, Hooks, KIND, Service, State, Static, TObject, TSchema } from "alepha";
1
+ import * as _alepha_core20 from "alepha";
2
+ import { Alepha, Async, Atom, Descriptor, Hook, Hooks, KIND, Service, State, Static, TAtomObject, TObject, TSchema } from "alepha";
3
3
  import { DateTimeProvider, DurationLike } from "alepha/datetime";
4
4
  import { RequestConfigSchema, ServerHandler, ServerProvider, ServerRequest, ServerRouterProvider, ServerTimingProvider } from "alepha/server";
5
5
  import { ServerRouteCache } from "alepha/server/cache";
6
6
  import { ClientScope, HttpVirtualClient, LinkProvider, VirtualAction } from "alepha/server/links";
7
- import * as _alepha_logger0 from "alepha/logger";
7
+ import * as _alepha_logger1 from "alepha/logger";
8
8
  import * as react0 from "react";
9
9
  import React, { AnchorHTMLAttributes, CSSProperties, DependencyList, ErrorInfo, FC, PropsWithChildren, ReactNode } from "react";
10
10
  import * as react_jsx_runtime0 from "react/jsx-runtime";
11
- import { ServeDescriptorOptions, ServerStaticProvider } from "alepha/server/static";
11
+ import { ServerStaticProvider } from "alepha/server/static";
12
12
  import { Route, RouterProvider } from "alepha/router";
13
+ import * as typebox0 from "typebox";
13
14
 
14
15
  //#region src/components/ClientOnly.d.ts
15
16
  interface ClientOnlyProps {
@@ -40,14 +41,14 @@ declare class Redirection extends Error {
40
41
  }
41
42
  //#endregion
42
43
  //#region src/providers/ReactPageProvider.d.ts
43
- declare const envSchema$2: _alepha_core10.TObject<{
44
- REACT_STRICT_MODE: _alepha_core10.TBoolean;
44
+ declare const envSchema$2: _alepha_core20.TObject<{
45
+ REACT_STRICT_MODE: _alepha_core20.TBoolean;
45
46
  }>;
46
47
  declare module "alepha" {
47
48
  interface Env extends Partial<Static<typeof envSchema$2>> {}
48
49
  }
49
50
  declare class ReactPageProvider {
50
- protected readonly log: _alepha_logger0.Logger;
51
+ protected readonly log: _alepha_logger1.Logger;
51
52
  protected readonly env: {
52
53
  REACT_STRICT_MODE: boolean;
53
54
  };
@@ -84,7 +85,7 @@ declare class ReactPageProvider {
84
85
  }, params?: Record<string, any>): string;
85
86
  compile(path: string, params?: Record<string, string>): string;
86
87
  protected renderView(index: number, path: string, view: ReactNode | undefined, page: PageRoute): ReactNode;
87
- protected readonly configure: _alepha_core10.HookDescriptor<"configure">;
88
+ protected readonly configure: _alepha_core20.HookDescriptor<"configure">;
88
89
  protected map(pages: Array<PageDescriptor>, target: PageDescriptor): PageRouteEntry;
89
90
  add(entry: PageRouteEntry): void;
90
91
  protected createMatch(page: PageRoute): string;
@@ -498,35 +499,46 @@ interface BrowserRoute extends Route {
498
499
  page: PageRoute;
499
500
  }
500
501
  declare class ReactBrowserRouterProvider extends RouterProvider<BrowserRoute> {
501
- protected readonly log: _alepha_logger0.Logger;
502
+ protected readonly log: _alepha_logger1.Logger;
502
503
  protected readonly alepha: Alepha;
503
504
  protected readonly pageApi: ReactPageProvider;
504
505
  add(entry: PageRouteEntry): void;
505
- protected readonly configure: _alepha_core10.HookDescriptor<"configure">;
506
+ protected readonly configure: _alepha_core20.HookDescriptor<"configure">;
506
507
  transition(url: URL, previous?: PreviousLayerData[], meta?: {}): Promise<string | void>;
507
508
  root(state: ReactRouterState): ReactNode;
508
509
  }
509
510
  //#endregion
510
511
  //#region src/providers/ReactBrowserProvider.d.ts
511
- declare const envSchema$1: _alepha_core10.TObject<{
512
- REACT_ROOT_ID: _alepha_core10.TString;
512
+ declare const envSchema$1: _alepha_core20.TObject<{
513
+ REACT_ROOT_ID: _alepha_core20.TString;
513
514
  }>;
514
515
  declare module "alepha" {
515
516
  interface Env extends Partial<Static<typeof envSchema$1>> {}
516
517
  }
517
- interface ReactBrowserRendererOptions {
518
- scrollRestoration?: "top" | "manual";
518
+ /**
519
+ * React browser renderer configuration atom
520
+ */
521
+ declare const reactBrowserOptions: _alepha_core20.Atom<_alepha_core20.TObject<{
522
+ scrollRestoration: typebox0.TUnsafe<"top" | "manual">;
523
+ }>, "alepha.react.browser.options">;
524
+ type ReactBrowserRendererOptions = Static<typeof reactBrowserOptions.schema>;
525
+ declare module "alepha" {
526
+ interface State {
527
+ [reactBrowserOptions.key]: ReactBrowserRendererOptions;
528
+ }
519
529
  }
520
530
  declare class ReactBrowserProvider {
521
531
  protected readonly env: {
522
532
  REACT_ROOT_ID: string;
523
533
  };
524
- protected readonly log: _alepha_logger0.Logger;
534
+ protected readonly log: _alepha_logger1.Logger;
525
535
  protected readonly client: LinkProvider;
526
536
  protected readonly alepha: Alepha;
527
537
  protected readonly router: ReactBrowserRouterProvider;
528
538
  protected readonly dateTimeProvider: DateTimeProvider;
529
- options: ReactBrowserRendererOptions;
539
+ protected readonly options: Readonly<{
540
+ scrollRestoration: "top" | "manual";
541
+ }>;
530
542
  protected getRootElement(): HTMLElement;
531
543
  transitioning?: {
532
544
  to: string;
@@ -555,8 +567,8 @@ declare class ReactBrowserProvider {
555
567
  * Get embedded layers from the server.
556
568
  */
557
569
  protected getHydrationState(): ReactHydrationState | undefined;
558
- protected readonly onTransitionEnd: _alepha_core10.HookDescriptor<"react:transition:end">;
559
- readonly ready: _alepha_core10.HookDescriptor<"ready">;
570
+ protected readonly onTransitionEnd: _alepha_core20.HookDescriptor<"react:transition:end">;
571
+ readonly ready: _alepha_core20.HookDescriptor<"ready">;
560
572
  }
561
573
  interface RouterGoOptions {
562
574
  replace?: boolean;
@@ -1052,37 +1064,44 @@ declare const ssrSchemaLoading: (alepha: Alepha, name: string) => RequestConfigS
1052
1064
  /**
1053
1065
  * Hook to access and mutate the Alepha state.
1054
1066
  */
1055
- declare const useStore: <Key extends keyof State>(key: Key, defaultValue?: State[Key]) => [State[Key], (value: State[Key]) => void];
1067
+ declare function useStore<T$1 extends TAtomObject>(target: Atom<T$1>, defaultValue?: Static<T$1>): UseStoreReturn<Static<T$1>>;
1068
+ declare function useStore<Key extends keyof State>(target: Key, defaultValue?: State[Key]): UseStoreReturn<State[Key]>;
1069
+ type UseStoreReturn<T$1> = [T$1, (value: T$1) => void];
1056
1070
  //#endregion
1057
1071
  //#region src/providers/ReactServerProvider.d.ts
1058
- declare const envSchema: _alepha_core10.TObject<{
1059
- REACT_SERVER_DIST: _alepha_core10.TString;
1060
- REACT_SERVER_PREFIX: _alepha_core10.TString;
1061
- REACT_SSR_ENABLED: _alepha_core10.TOptional<_alepha_core10.TBoolean>;
1062
- REACT_ROOT_ID: _alepha_core10.TString;
1063
- REACT_SERVER_TEMPLATE: _alepha_core10.TOptional<_alepha_core10.TString>;
1072
+ declare const envSchema: _alepha_core20.TObject<{
1073
+ REACT_SSR_ENABLED: _alepha_core20.TOptional<_alepha_core20.TBoolean>;
1074
+ REACT_ROOT_ID: _alepha_core20.TString;
1075
+ REACT_SERVER_TEMPLATE: _alepha_core20.TOptional<_alepha_core20.TString>;
1064
1076
  }>;
1065
1077
  declare module "alepha" {
1066
1078
  interface Env extends Partial<Static<typeof envSchema>> {}
1067
1079
  interface State {
1068
- "react.server.ssr"?: boolean;
1080
+ "alepha.react.server.ssr"?: boolean;
1069
1081
  }
1070
1082
  }
1071
- interface ReactServerProviderOptions {
1072
- /**
1073
- * Override default options for the static file server.
1074
- * > Static file server is only created in non-serverless production mode.
1075
- */
1076
- static?: Partial<Omit<ServeDescriptorOptions, "root">>;
1083
+ /**
1084
+ * React server provider configuration atom
1085
+ */
1086
+ declare const reactServerOptions: _alepha_core20.Atom<_alepha_core20.TObject<{
1087
+ publicDir: _alepha_core20.TString;
1088
+ staticServer: _alepha_core20.TObject<{
1089
+ disabled: _alepha_core20.TBoolean;
1090
+ path: _alepha_core20.TString;
1091
+ }>;
1092
+ }>, "alepha.react.server.options">;
1093
+ type ReactServerProviderOptions = Static<typeof reactServerOptions.schema>;
1094
+ declare module "alepha" {
1095
+ interface State {
1096
+ [reactServerOptions.key]: ReactServerProviderOptions;
1097
+ }
1077
1098
  }
1078
- declare class ReactServerProvider implements Configurable {
1079
- protected readonly log: _alepha_logger0.Logger;
1099
+ declare class ReactServerProvider {
1100
+ protected readonly log: _alepha_logger1.Logger;
1080
1101
  protected readonly alepha: Alepha;
1081
1102
  protected readonly env: {
1082
1103
  REACT_SSR_ENABLED?: boolean | undefined;
1083
1104
  REACT_SERVER_TEMPLATE?: string | undefined;
1084
- REACT_SERVER_DIST: string;
1085
- REACT_SERVER_PREFIX: string;
1086
1105
  REACT_ROOT_ID: string;
1087
1106
  };
1088
1107
  protected readonly pageApi: ReactPageProvider;
@@ -1092,11 +1111,17 @@ declare class ReactServerProvider implements Configurable {
1092
1111
  protected readonly serverTimingProvider: ServerTimingProvider;
1093
1112
  readonly ROOT_DIV_REGEX: RegExp;
1094
1113
  protected preprocessedTemplate: PreprocessedTemplate | null;
1095
- options: ReactServerProviderOptions;
1114
+ protected readonly options: Readonly<{
1115
+ publicDir: string;
1116
+ staticServer: {
1117
+ disabled: boolean;
1118
+ path: string;
1119
+ };
1120
+ }>;
1096
1121
  /**
1097
1122
  * Configure the React server provider.
1098
1123
  */
1099
- readonly onConfigure: _alepha_core10.HookDescriptor<"configure">;
1124
+ readonly onConfigure: _alepha_core20.HookDescriptor<"configure">;
1100
1125
  get template(): string;
1101
1126
  protected registerPages(templateLoader: TemplateLoader): Promise<void>;
1102
1127
  /**
@@ -1133,7 +1158,7 @@ interface PreprocessedTemplate {
1133
1158
  //#region src/index.d.ts
1134
1159
  declare module "alepha" {
1135
1160
  interface State {
1136
- "react.router.state"?: ReactRouterState;
1161
+ "alepha.react.router.state"?: ReactRouterState;
1137
1162
  }
1138
1163
  interface Hooks {
1139
1164
  /**
@@ -1232,7 +1257,7 @@ declare module "alepha" {
1232
1257
  * @see {@link $page}
1233
1258
  * @module alepha.react
1234
1259
  */
1235
- declare const AlephaReact: _alepha_core10.Service<_alepha_core10.Module<{}>>;
1260
+ declare const AlephaReact: _alepha_core20.Service<_alepha_core20.Module>;
1236
1261
  //#endregion
1237
- export { $page, ActionContext, AlephaContext, AlephaReact, AnchorProps, ClientOnly, CreateLayersResult, ErrorBoundary, ErrorHandler, ErrorViewer, Layer, Link, type 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, ReactServerProviderOptions, Redirection, RouterGoOptions, RouterLayerContext, RouterLayerContextValue, RouterRenderOptions, RouterStackItem, TPropsDefault, TPropsParentDefault, TransitionOptions, UseActionOptions, UseActionReturn, UseActiveHook, UseActiveOptions, UseQueryParamsHookOptions, UseSchemaReturn, VirtualRouter, isPageRoute, ssrSchemaLoading, useAction, useActive, useAlepha, useClient, useEvents, useInject, useQueryParams, useRouter, useRouterState, useSchema, useStore };
1262
+ export { $page, ActionContext, AlephaContext, AlephaReact, AnchorProps, ClientOnly, CreateLayersResult, ErrorBoundary, ErrorHandler, ErrorViewer, Layer, Link, type 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, ReactServerProviderOptions, Redirection, RouterGoOptions, RouterLayerContext, RouterLayerContextValue, RouterRenderOptions, RouterStackItem, TPropsDefault, TPropsParentDefault, TransitionOptions, UseActionOptions, UseActionReturn, UseActiveHook, UseActiveOptions, UseQueryParamsHookOptions, UseSchemaReturn, UseStoreReturn, VirtualRouter, isPageRoute, reactBrowserOptions, reactServerOptions, ssrSchemaLoading, useAction, useActive, useAlepha, useClient, useEvents, useInject, useQueryParams, useRouter, useRouterState, useSchema, useStore };
1238
1263
  //# sourceMappingURL=index.d.ts.map
package/redis.d.ts CHANGED
@@ -76,7 +76,7 @@ declare class RedisSubscriberProvider {
76
76
  * @see {@link RedisProvider}
77
77
  * @module alepha.redis
78
78
  */
79
- declare const AlephaRedis: _alepha_core3.Service<_alepha_core3.Module<{}>>;
79
+ declare const AlephaRedis: _alepha_core3.Service<_alepha_core3.Module>;
80
80
  //#endregion
81
81
  export { AlephaRedis, RedisClient, RedisClientOptions, RedisProvider, RedisSetOptions, RedisSubscriberProvider };
82
82
  //# sourceMappingURL=index.d.ts.map
package/retry.d.ts CHANGED
@@ -1,17 +1,9 @@
1
1
  import { AlephaError, Descriptor, DescriptorArgs, KIND } from "alepha";
2
2
  import { DateTimeProvider, DurationLike } from "alepha/datetime";
3
+ import * as _alepha_logger0 from "alepha/logger";
3
4
 
4
- //#region src/descriptors/$retry.d.ts
5
-
6
- /**
7
- * Creates a function that automatically retries a handler upon failure,
8
- * with support for exponential backoff, max duration, and cancellation.
9
- */
10
- declare const $retry: {
11
- <T extends (...args: any[]) => any>(options: RetryDescriptorOptions<T>): RetryDescriptorFn<T>;
12
- [KIND]: typeof RetryDescriptor;
13
- };
14
- interface RetryDescriptorOptions<T extends (...args: any[]) => any> {
5
+ //#region src/providers/RetryProvider.d.ts
6
+ interface RetryOptions<T extends (...args: any[]) => any> {
15
7
  /**
16
8
  * The function to retry.
17
9
  */
@@ -50,15 +42,11 @@ interface RetryDescriptorOptions<T extends (...args: any[]) => any> {
50
42
  * An AbortSignal to allow for external cancellation of the retry loop.
51
43
  */
52
44
  signal?: AbortSignal;
53
- }
54
- declare class RetryDescriptor<T extends (...args: any[]) => any> extends Descriptor<RetryDescriptorOptions<T>> {
55
- protected readonly dateTimeProvider: DateTimeProvider;
56
- protected appAbortController: AbortController;
57
- constructor(args: DescriptorArgs<RetryDescriptorOptions<T>>);
58
- run(...args: Parameters<T>): Promise<ReturnType<T>>;
59
- }
60
- interface RetryDescriptorFn<T extends (...args: any[]) => any> extends RetryDescriptor<T> {
61
- (...args: Parameters<T>): Promise<ReturnType<T>>;
45
+ /**
46
+ * An additional AbortSignal to combine with the provided signal.
47
+ * Used internally by $retry to handle app lifecycle.
48
+ */
49
+ additionalSignal?: AbortSignal;
62
50
  }
63
51
  interface RetryBackoffOptions {
64
52
  /**
@@ -84,6 +72,81 @@ interface RetryBackoffOptions {
84
72
  */
85
73
  jitter?: boolean;
86
74
  }
75
+ /**
76
+ * Service for executing functions with automatic retry logic.
77
+ * Supports exponential backoff, max duration, conditional retries, and cancellation.
78
+ */
79
+ declare class RetryProvider {
80
+ protected readonly log: _alepha_logger0.Logger;
81
+ protected readonly dateTime: DateTimeProvider;
82
+ /**
83
+ * Execute a function with automatic retry logic.
84
+ */
85
+ retry<T extends (...args: any[]) => any>(options: RetryOptions<T>, ...args: Parameters<T>): Promise<ReturnType<T>>;
86
+ /**
87
+ * Calculate the backoff delay for a given attempt.
88
+ */
89
+ protected calculateBackoff(attempt: number, options?: number | RetryBackoffOptions): number;
90
+ }
91
+ //#endregion
92
+ //#region src/descriptors/$retry.d.ts
93
+ /**
94
+ * Creates a function that automatically retries a handler upon failure,
95
+ * with support for exponential backoff, max duration, and cancellation.
96
+ */
97
+ declare const $retry: {
98
+ <T extends (...args: any[]) => any>(options: RetryDescriptorOptions<T>): RetryDescriptorFn<T>;
99
+ [KIND]: typeof RetryDescriptor;
100
+ };
101
+ interface RetryDescriptorOptions<T extends (...args: any[]) => any> {
102
+ /**
103
+ * The function to retry.
104
+ */
105
+ handler: T;
106
+ /**
107
+ * The maximum number of attempts.
108
+ *
109
+ * @default 3
110
+ */
111
+ max?: number;
112
+ /**
113
+ * The backoff strategy for delays between retries.
114
+ * Can be a fixed number (in ms) or a configuration object for exponential backoff.
115
+ *
116
+ * @default { initial: 200, factor: 2, jitter: true }
117
+ */
118
+ backoff?: number | RetryBackoffOptions;
119
+ /**
120
+ * An overall time limit for all retry attempts combined.
121
+ *
122
+ * e.g., `[5, 'seconds']`
123
+ */
124
+ maxDuration?: DurationLike;
125
+ /**
126
+ * A function that determines if a retry should be attempted based on the error.
127
+ *
128
+ * @default (error) => true (retries on any error)
129
+ */
130
+ when?: (error: Error) => boolean;
131
+ /**
132
+ * A custom callback for when a retry attempt fails.
133
+ * This is called before the delay.
134
+ */
135
+ onError?: (error: Error, attempt: number, ...args: Parameters<T>) => void;
136
+ /**
137
+ * An AbortSignal to allow for external cancellation of the retry loop.
138
+ */
139
+ signal?: AbortSignal;
140
+ }
141
+ declare class RetryDescriptor<T extends (...args: any[]) => any> extends Descriptor<RetryDescriptorOptions<T>> {
142
+ protected readonly retryProvider: RetryProvider;
143
+ protected appAbortController: AbortController;
144
+ constructor(args: DescriptorArgs<RetryDescriptorOptions<T>>);
145
+ run(...args: Parameters<T>): Promise<ReturnType<T>>;
146
+ }
147
+ interface RetryDescriptorFn<T extends (...args: any[]) => any> extends RetryDescriptor<T> {
148
+ (...args: Parameters<T>): Promise<ReturnType<T>>;
149
+ }
87
150
  //#endregion
88
151
  //#region src/errors/RetryCancelError.d.ts
89
152
  declare class RetryCancelError extends AlephaError {
@@ -95,5 +158,5 @@ declare class RetryTimeoutError extends AlephaError {
95
158
  constructor(duration: number);
96
159
  }
97
160
  //#endregion
98
- export { $retry, RetryBackoffOptions, RetryCancelError, RetryDescriptor, RetryDescriptorFn, RetryDescriptorOptions, RetryTimeoutError };
161
+ export { $retry, RetryBackoffOptions, RetryCancelError, RetryDescriptor, RetryDescriptorFn, RetryDescriptorOptions, RetryOptions, RetryProvider, RetryTimeoutError };
99
162
  //# sourceMappingURL=index.d.ts.map
package/scheduler.d.ts CHANGED
@@ -139,7 +139,7 @@ declare module "alepha" {
139
139
  * @see {@link $scheduler}
140
140
  * @module alepha.scheduler
141
141
  */
142
- declare const AlephaScheduler: _alepha_core1.Service<_alepha_core1.Module<{}>>;
142
+ declare const AlephaScheduler: _alepha_core1.Service<_alepha_core1.Module>;
143
143
  //#endregion
144
144
  export { $scheduler, AlephaScheduler, CRON, CronJob, CronProvider, SchedulerDescriptor, SchedulerDescriptorOptions, SchedulerHandlerArguments };
145
145
  //# sourceMappingURL=index.d.ts.map