@alepha/ui 0.13.8 → 0.14.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.
@@ -1,24 +1,19 @@
1
+ import { BaseInputField, FormModel } from "@alepha/react/form";
2
+ import * as _alepha_react_head0 from "@alepha/react/head";
1
3
  import * as alepha1 from "alepha";
2
- import { Alepha, AlephaError, Async, FileLike, InstantiableClass, LogLevel, LoggerInterface, Page, PageMetadata, Primitive, Static, StreamLike, TArray, TFile, TObject, TProperties, TRecord, TSchema, TStream, TString, TVoid, TypeBoxError } from "alepha";
4
+ import { Alepha, Async, Page, PageMetadata, Static, TObject, TProperties } from "alepha";
5
+ import * as alepha_server_cookies0 from "alepha/server/cookies";
6
+ import * as _alepha_react0 from "@alepha/react";
7
+ import { RouterGoOptions, UseActionReturn, UseActiveOptions } from "@alepha/react";
3
8
  import { AnchorProps, AppShellFooterProps, AppShellHeaderProps, AppShellMainProps, AppShellNavbarProps, AppShellProps, AutocompleteProps, BurgerProps, ButtonProps, ColorInputProps, ColorSchemeScriptProps, FileInputProps, Flex, FlexProps, MantineBreakpoint, MantineProviderProps, MantineSize, MantineThemeOverride, MenuProps, MenuTargetProps, ModalProps, MultiSelectProps, NumberInputProps, PasswordInputProps, SegmentedControlProps, SelectProps, SliderProps, SwitchProps, TableProps, TableTrProps, TagsInputProps, Text, TextInputProps, TextareaProps, ThemeIconProps, TooltipProps } from "@mantine/core";
4
9
  import { ModalsProviderProps } from "@mantine/modals";
5
10
  import * as _mantine_notifications0 from "@mantine/notifications";
6
11
  import { NotificationData, NotificationsProps } from "@mantine/notifications";
7
12
  import { NavigationProgressProps } from "@mantine/nprogress";
8
- import * as react_jsx_runtime5 from "react/jsx-runtime";
9
- import { ComponentType, FC, InputHTMLAttributes, ReactElement, ReactNode } from "react";
13
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
14
+ import { ComponentType, ReactElement, ReactNode } from "react";
10
15
  import { DateInputProps, DateTimePickerProps, TimeInputProps } from "@mantine/dates";
11
- import "dayjs/plugin/relativeTime.js";
12
- import dayjsDuration from "dayjs/plugin/duration.js";
13
- import "dayjs/plugin/utc.js";
14
- import "dayjs/plugin/timezone.js";
15
- import "dayjs/plugin/localizedFormat.js";
16
- import "dayjs/locale/ar.js";
17
- import "dayjs/locale/fr.js";
18
- import DayjsApi, { Dayjs, ManipulateType, PluginFunc } from "dayjs";
19
- import { IncomingMessage, Server, ServerResponse } from "node:http";
20
- import { Readable } from "node:stream";
21
- import { ReadableStream } from "node:stream/web";
16
+ import { DurationLike } from "alepha/datetime";
22
17
 
23
18
  //#region ../../src/core/atoms/alephaThemeAtom.d.ts
24
19
  declare const alephaThemeAtom: alepha1.Atom<alepha1.TObject<{
@@ -26,363 +21,6 @@ declare const alephaThemeAtom: alepha1.Atom<alepha1.TObject<{
26
21
  }>, "alepha.ui.theme">;
27
22
  type CurrentAlephaTheme = Static<typeof alephaThemeAtom.schema>;
28
23
  //#endregion
29
- //#region ../../../alepha/src/logger/schemas/logEntrySchema.d.ts
30
- declare const logEntrySchema: alepha1.TObject<{
31
- level: alepha1.TUnsafe<"SILENT" | "TRACE" | "DEBUG" | "INFO" | "WARN" | "ERROR">;
32
- message: alepha1.TString;
33
- service: alepha1.TString;
34
- module: alepha1.TString;
35
- context: alepha1.TOptional<alepha1.TString>;
36
- app: alepha1.TOptional<alepha1.TString>;
37
- data: alepha1.TOptional<alepha1.TAny>;
38
- timestamp: alepha1.TNumber;
39
- }>;
40
- type LogEntry = Static<typeof logEntrySchema>;
41
- //#endregion
42
- //#region ../../../alepha/src/datetime/providers/DateTimeProvider.d.ts
43
- type DateTime = DayjsApi.Dayjs;
44
- type Duration = dayjsDuration.Duration;
45
- type DurationLike = number | dayjsDuration.Duration | [number, ManipulateType];
46
- declare class DateTimeProvider {
47
- static PLUGINS: Array<PluginFunc<any>>;
48
- protected alepha: Alepha;
49
- protected ref: DateTime | null;
50
- protected readonly timeouts: Timeout[];
51
- protected readonly intervals: Interval[];
52
- constructor();
53
- protected readonly onStart: alepha1.HookPrimitive<"start">;
54
- protected readonly onStop: alepha1.HookPrimitive<"stop">;
55
- setLocale(locale: string): void;
56
- isDateTime(value: unknown): value is DateTime;
57
- /**
58
- * Create a new UTC DateTime instance.
59
- */
60
- utc(date: string | number | Date | Dayjs | null | undefined): DateTime;
61
- /**
62
- * Create a new DateTime instance.
63
- */
64
- of(date: string | number | Date | Dayjs | null | undefined): DateTime;
65
- /**
66
- * Get the current date as a string.
67
- */
68
- toISOString(date?: Date | string | DateTime): string;
69
- /**
70
- * Get the current date.
71
- */
72
- now(): DateTime;
73
- /**
74
- * Get the current date as a string.
75
- *
76
- * This is much faster than `DateTimeProvider.now().toISOString()` as it avoids creating a DateTime instance.
77
- */
78
- nowISOString(): string;
79
- /**
80
- * Get the current date as milliseconds since epoch.
81
- *
82
- * This is much faster than `DateTimeProvider.now().valueOf()` as it avoids creating a DateTime instance.
83
- */
84
- nowMillis(): number;
85
- /**
86
- * Get the current date as a string.
87
- *
88
- * @protected
89
- */
90
- protected getCurrentDate(): DateTime;
91
- /**
92
- * Create a new Duration instance.
93
- */
94
- duration: (duration: DurationLike, unit?: ManipulateType) => Duration;
95
- isDurationLike(value: unknown): value is DurationLike;
96
- /**
97
- * Return a promise that resolves after the next tick.
98
- * It uses `setTimeout` with 0 ms delay.
99
- */
100
- tick(): Promise<void>;
101
- /**
102
- * Wait for a certain duration.
103
- *
104
- * You can clear the timeout by using the `AbortSignal` API.
105
- * Aborted signal will resolve the promise immediately, it does not reject it.
106
- */
107
- wait(duration: DurationLike, options?: {
108
- signal?: AbortSignal;
109
- now?: number;
110
- }): Promise<void>;
111
- createInterval(run: () => unknown, duration: DurationLike, start?: boolean): Interval;
112
- /**
113
- * Run a callback after a certain duration.
114
- */
115
- createTimeout(callback: () => void, duration: DurationLike, now?: number): Timeout;
116
- clearTimeout(timeout: Timeout): void;
117
- clearInterval(interval: Interval): void;
118
- /**
119
- * Run a function with a deadline.
120
- */
121
- deadline<T$1>(fn: (signal: AbortSignal) => Promise<T$1>, duration: DurationLike): Promise<T$1>;
122
- /**
123
- * Add time to the current date.
124
- */
125
- travel(duration: DurationLike, unit?: ManipulateType): Promise<void>;
126
- /**
127
- * Stop the time.
128
- */
129
- pause(): DateTime;
130
- /**
131
- * Reset the reference date.
132
- */
133
- reset(): void;
134
- }
135
- interface Interval {
136
- timer?: any;
137
- duration: number;
138
- run: () => unknown;
139
- }
140
- interface Timeout {
141
- now: number;
142
- timer?: any;
143
- duration: number;
144
- callback: () => void;
145
- clear: () => void;
146
- }
147
- //#endregion
148
- //#region ../../../alepha/src/logger/providers/LogDestinationProvider.d.ts
149
- declare abstract class LogDestinationProvider {
150
- abstract write(message: string, entry: LogEntry): void;
151
- }
152
- //#endregion
153
- //#region ../../../alepha/src/logger/providers/LogFormatterProvider.d.ts
154
- declare abstract class LogFormatterProvider {
155
- abstract format(entry: LogEntry): string;
156
- }
157
- //#endregion
158
- //#region ../../../alepha/src/logger/services/Logger.d.ts
159
- declare class Logger implements LoggerInterface {
160
- protected readonly alepha: Alepha;
161
- protected readonly formatter: LogFormatterProvider;
162
- protected readonly destination: LogDestinationProvider;
163
- protected readonly dateTimeProvider: DateTimeProvider;
164
- protected readonly levels: Record<string, number>;
165
- protected readonly service: string;
166
- protected readonly module: string;
167
- protected readonly app?: string;
168
- protected appLogLevel: string;
169
- protected logLevel: LogLevel;
170
- constructor(service: string, module: string);
171
- get context(): string | undefined;
172
- get level(): string;
173
- parseLevel(level: string, app: string): LogLevel;
174
- private matchesPattern;
175
- asLogLevel(something: string): LogLevel;
176
- error(message: string, data?: unknown): void;
177
- warn(message: string, data?: unknown): void;
178
- info(message: string, data?: unknown): void;
179
- debug(message: string, data?: unknown): void;
180
- trace(message: string, data?: unknown): void;
181
- protected log(level: LogLevel, message: string, data?: unknown): void;
182
- protected emit(entry: LogEntry, message?: string): void;
183
- }
184
- //#endregion
185
- //#region ../../../alepha/src/logger/index.d.ts
186
- declare const envSchema$6: alepha1.TObject<{
187
- /**
188
- * Default log level for the application.
189
- *
190
- * Default by environment:
191
- * - dev = info
192
- * - prod = info
193
- * - test = error
194
- *
195
- * Levels are: "trace" | "debug" | "info" | "warn" | "error" | "silent"
196
- *
197
- * Level can be set for a specific module:
198
- *
199
- * @example
200
- * LOG_LEVEL=my.module.name:debug,info # Set debug level for my.module.name and info for all other modules
201
- * LOG_LEVEL=alepha:trace, info # Set trace level for all alepha modules and info for all other modules
202
- */
203
- LOG_LEVEL: alepha1.TOptional<alepha1.TString>;
204
- /**
205
- * Built-in log formats.
206
- * - "json" - JSON format, useful for structured logging and log aggregation. {@link JsonFormatterProvider}
207
- * - "pretty" - Simple text format, human-readable, with colors. {@link PrettyFormatterProvider}
208
- * - "raw" - Raw format, no formatting, just the message. {@link RawFormatterProvider}
209
- */
210
- LOG_FORMAT: alepha1.TOptional<alepha1.TUnsafe<"json" | "pretty" | "raw">>;
211
- }>;
212
- declare module "alepha" {
213
- interface Env extends Partial<Static<typeof envSchema$6>> {}
214
- interface State {
215
- /**
216
- * Current log level for the application or specific modules.
217
- */
218
- "alepha.logger.level"?: string;
219
- }
220
- interface Hooks {
221
- log: {
222
- message?: string;
223
- entry: LogEntry;
224
- };
225
- }
226
- }
227
- //#endregion
228
- //#region ../../../react/src/form/services/FormModel.d.ts
229
- /**
230
- * FormModel is a dynamic form handler that generates form inputs based on a provided TypeBox schema.
231
- * It manages form state, handles input changes, and processes form submissions with validation.
232
- *
233
- * It means to be injected and used within React components to provide a structured way to create and manage forms.
234
- *
235
- * @see {@link useForm}
236
- */
237
- declare class FormModel<T$1 extends TObject> {
238
- readonly id: string;
239
- readonly options: FormCtrlOptions<T$1>;
240
- protected readonly log: Logger;
241
- protected readonly alepha: Alepha;
242
- protected readonly values: Record<string, any>;
243
- protected submitInProgress: boolean;
244
- input: SchemaToInput<T$1>;
245
- get submitting(): boolean;
246
- constructor(id: string, options: FormCtrlOptions<T$1>);
247
- get element(): HTMLFormElement;
248
- get currentValues(): Record<string, any>;
249
- get props(): {
250
- id: string;
251
- noValidate: boolean;
252
- onSubmit: (ev?: FormEventLike) => void;
253
- onReset: (event: FormEventLike) => Promise<void>;
254
- };
255
- readonly reset: (event: FormEventLike) => Promise<void>;
256
- readonly submit: () => Promise<void>;
257
- /**
258
- * Restructures flat keys like "address.city" into nested objects like { address: { city: ... } }
259
- * Values are already typed from onChange, so no conversion is needed.
260
- */
261
- protected restructureValues(store: Record<string, any>): Record<string, any>;
262
- /**
263
- * Helper to restructure a flat key like "address.city" into nested object structure.
264
- * The value is already typed, so we just assign it to the nested path.
265
- */
266
- protected restructureNestedValue(values: Record<string, any>, key: string, value: any): void;
267
- protected createProxyFromSchema<T$1 extends TObject>(options: FormCtrlOptions<T$1>, schema: TSchema, context: {
268
- parent: string;
269
- store: Record<string, any>;
270
- }): SchemaToInput<T$1>;
271
- protected createInputFromSchema<T$1 extends TObject>(name: keyof Static<T$1> & string, options: FormCtrlOptions<T$1>, schema: TObject, required: boolean, context: {
272
- parent: string;
273
- store: Record<string, any>;
274
- }): BaseInputField;
275
- /**
276
- * Convert an input value to the correct type based on the schema.
277
- * Handles raw DOM values (strings, booleans from checkboxes, Files, etc.)
278
- */
279
- protected getValueFromInput(input: any, schema: TSchema): any;
280
- protected valueToInputEntry(value: any): string | number | boolean;
281
- }
282
- type SchemaToInput<T$1 extends TObject> = { [K in keyof T$1["properties"]]: InputField<T$1["properties"][K]> };
283
- interface FormEventLike {
284
- preventDefault?: () => void;
285
- stopPropagation?: () => void;
286
- }
287
- type InputField<T$1 extends TSchema> = T$1 extends TObject ? ObjectInputField<T$1> : T$1 extends TArray<infer U> ? ArrayInputField<U> : BaseInputField;
288
- interface BaseInputField {
289
- path: string;
290
- required: boolean;
291
- props: InputHTMLAttributesLike;
292
- schema: TSchema;
293
- set: (value: any) => void;
294
- form: FormModel<any>;
295
- items?: any;
296
- }
297
- interface ObjectInputField<T$1 extends TObject> extends BaseInputField {
298
- items: SchemaToInput<T$1>;
299
- }
300
- interface ArrayInputField<T$1 extends TSchema> extends BaseInputField {
301
- items: Array<InputField<T$1>>;
302
- }
303
- type InputHTMLAttributesLike = Pick<InputHTMLAttributes<unknown>, "id" | "name" | "type" | "value" | "defaultValue" | "required" | "maxLength" | "minLength" | "aria-label" | "autoComplete"> & {
304
- value?: any;
305
- defaultValue?: any;
306
- onChange?: (event: any) => void;
307
- };
308
- type FormCtrlOptions<T$1 extends TObject> = {
309
- /**
310
- * The schema defining the structure and validation rules for the form.
311
- * This should be a TypeBox schema object.
312
- */
313
- schema: T$1;
314
- /**
315
- * Callback function to handle form submission.
316
- * This function will receive the parsed and validated form values.
317
- */
318
- handler: (values: Static<T$1>, args: {
319
- form: HTMLFormElement;
320
- }) => unknown;
321
- /**
322
- * Optional initial values for the form fields.
323
- * This can be used to pre-populate the form with existing data.
324
- */
325
- initialValues?: Partial<Static<T$1>>;
326
- /**
327
- * Optional function to create custom field attributes.
328
- * This can be used to add custom validation, styles, or other attributes.
329
- */
330
- onCreateField?: (name: keyof Static<T$1> & string, schema: TSchema) => InputHTMLAttributes<unknown>;
331
- /**
332
- * If defined, this will generate a unique ID for each field, prefixed with this string.
333
- *
334
- * > "username" with id="form-123" will become "form-123-username".
335
- *
336
- * If omitted, IDs will not be generated.
337
- */
338
- id?: string;
339
- onError?: (error: Error, args: {
340
- form: HTMLFormElement;
341
- }) => void;
342
- onChange?: (key: string, value: any, store: Record<string, any>) => void;
343
- onReset?: () => void;
344
- };
345
- //#endregion
346
- //#region ../../../react/src/form/index.d.ts
347
- declare module "alepha" {
348
- interface Hooks {
349
- "form:change": {
350
- id: string;
351
- path: string;
352
- value: any;
353
- };
354
- "form:reset": {
355
- id: string;
356
- values: Record<string, any>;
357
- };
358
- "form:submit:begin": {
359
- id: string;
360
- };
361
- "form:submit:success": {
362
- id: string;
363
- values: Record<string, any>;
364
- };
365
- "form:submit:error": {
366
- id: string;
367
- error: Error;
368
- };
369
- "form:submit:end": {
370
- id: string;
371
- };
372
- }
373
- }
374
- /**
375
- * React hooks for managing forms in Alepha applications.
376
- *
377
- * This module provides a set of hooks to simplify form handling, validation, and submission in React applications built with Alepha.
378
- *
379
- * It includes:
380
- * - `useForm`: A hook for managing form state, validation, and submission.
381
- *
382
- * @see {@link useForm}
383
- * @module alepha.react.form
384
- */
385
- //#endregion
386
24
  //#region ../../src/core/utils/parseInput.d.ts
387
25
  interface GenericControlProps {
388
26
  input: BaseInputField;
@@ -433,1819 +71,198 @@ interface ControlArrayProps extends GenericControlProps {
433
71
  itemControlProps?: Partial<Omit<ControlProps, "input">>;
434
72
  /**
435
73
  * Show drag handle for reordering.
436
- * @default false
437
- */
438
- sortable?: boolean;
439
- }
440
- /**
441
- * ControlArray component for editing arrays of schema items.
442
- *
443
- * Features:
444
- * - Dynamic add/remove of items
445
- * - Supports arrays of objects with nested fields
446
- * - Supports arrays of primitives
447
- * - Grid layout for object items
448
- * - Min/max constraints
449
- *
450
- * @example
451
- * ```tsx
452
- * // For a schema like:
453
- * // t.object({
454
- * // contacts: t.array(t.object({
455
- * // name: t.text(),
456
- * // email: t.text({ format: "email" }),
457
- * // }))
458
- * // })
459
- *
460
- * <ControlArray
461
- * input={form.input.contacts}
462
- * columns={2}
463
- * addLabel="Add contact"
464
- * controlProps={{
465
- * email: { text: { placeholder: "email@example.com" } }
466
- * }}
467
- * />
468
- * ```
469
- */
470
- declare const ControlArray: (props: ControlArrayProps) => react_jsx_runtime5.JSX.Element | null;
471
- //#endregion
472
- //#region ../../src/core/components/form/ControlNumber.d.ts
473
- interface ControlNumberProps extends GenericControlProps {
474
- numberInputProps?: Partial<NumberInputProps>;
475
- sliderProps?: Partial<SliderProps>;
476
- }
477
- /**
478
- *
479
- */
480
- declare const ControlNumber: (props: ControlNumberProps) => react_jsx_runtime5.JSX.Element | null;
481
- //#endregion
482
- //#region ../../src/core/components/form/ControlObject.d.ts
483
- interface ControlObjectProps extends GenericControlProps {
484
- /**
485
- * Number of columns for the grid layout.
486
- * @default 1
487
- */
488
- columns?: number;
489
- /**
490
- * Variant for the container.
491
- * - "fieldset": Uses Mantine Fieldset with legend
492
- * - "plain": No container, just renders fields
493
- * @default "fieldset"
494
- */
495
- variant?: "fieldset" | "plain";
496
- /**
497
- * Per-field control props override.
498
- * Keys are field names from the schema.
499
- */
500
- controlProps?: Record<string, Partial<Omit<ControlProps, "input">>>;
501
- }
502
- /**
503
- * ControlObject component for editing nested object schemas.
504
- *
505
- * Features:
506
- * - Renders all properties of an object schema
507
- * - Supports grid layout with configurable columns
508
- * - Per-field customization via controlProps
509
- * - Recursive support for deeply nested objects
510
- *
511
- * The form system provides nested InputFields under the `.items` property.
512
- * For example: form.input.address.items.street
513
- *
514
- * @example
515
- * ```tsx
516
- * // For a schema like:
517
- * // t.object({
518
- * // address: t.object({
519
- * // street: t.text(),
520
- * // city: t.text(),
521
- * // zip: t.text(),
522
- * // })
523
- * // })
524
- *
525
- * <ControlObject
526
- * input={form.input.address}
527
- * columns={2}
528
- * controlProps={{
529
- * zip: { text: { maxLength: 10 } }
530
- * }}
531
- * />
532
- * ```
533
- */
534
- declare const ControlObject: (props: ControlObjectProps) => react_jsx_runtime5.JSX.Element | null;
535
- //#endregion
536
- //#region ../../src/core/components/form/ControlSelect.d.ts
537
- type SelectValueLabel = string | {
538
- value: string;
539
- label: string;
540
- icon?: string;
541
- };
542
- interface ControlSelectProps extends GenericControlProps {
543
- select?: boolean | SelectProps;
544
- multi?: boolean | MultiSelectProps;
545
- tags?: boolean | TagsInputProps;
546
- autocomplete?: boolean | AutocompleteProps;
547
- segmented?: boolean | Partial<SegmentedControlProps>;
548
- loader?: () => Promise<SelectValueLabel[]>;
549
- }
550
- /**
551
- * ControlSelect component for handling Select, MultiSelect, and TagsInput.
552
- *
553
- * Features:
554
- * - Basic Select with enum support
555
- * - MultiSelect for array of enums
556
- * - TagsInput for array of strings (no enum)
557
- * - Future: Lazy loading
558
- * - Future: Searchable/filterable options
559
- * - Future: Custom option rendering
560
- *
561
- * Automatically detects enum values and array types from schema.
562
- */
563
- declare const ControlSelect: (props: ControlSelectProps) => react_jsx_runtime5.JSX.Element | null;
564
- //#endregion
565
- //#region ../../src/core/components/form/Control.d.ts
566
- interface ControlProps extends GenericControlProps {
567
- text?: TextInputProps;
568
- area?: boolean | TextareaProps;
569
- select?: boolean | Partial<ControlSelectProps>;
570
- password?: boolean | PasswordInputProps;
571
- switch?: boolean | SwitchProps;
572
- number?: boolean | Partial<ControlNumberProps>;
573
- file?: boolean | FileInputProps;
574
- color?: boolean | ColorInputProps;
575
- date?: boolean | DateInputProps;
576
- datetime?: boolean | DateTimePickerProps;
577
- time?: boolean | TimeInputProps;
578
- query?: any;
579
- object?: boolean | Partial<Omit<ControlObjectProps, "input">>;
580
- array?: boolean | Partial<Omit<ControlArrayProps, "input">>;
581
- custom?: ComponentType<CustomControlProps>;
582
- }
583
- /**
584
- * Generic form control that renders the appropriate input based on the schema and props.
585
- *
586
- * Supports:
587
- * - TextInput (with format detection: email, url, tel)
588
- * - Textarea
589
- * - NumberInput (for number/integer types)
590
- * - FileInput
591
- * - ColorInput (for color format)
592
- * - Select (for enum types)
593
- * - Autocomplete
594
- * - PasswordInput
595
- * - Switch (for boolean types)
596
- * - SegmentedControl (for enum types)
597
- * - DateInput (for date format)
598
- * - DateTimePicker (for date-time format)
599
- * - TimeInput (for time format)
600
- * - QueryBuilder (for building type-safe queries with autocomplete)
601
- * - ControlObject (for nested object schemas)
602
- * - ControlArray (for arrays of objects)
603
- * - Custom component
604
- *
605
- * Automatically handles labels, descriptions, error messages, required state, and default icons.
606
- */
607
- declare const Control: (_props: ControlProps) => react_jsx_runtime5.JSX.Element | null;
608
- type CustomControlProps = {
609
- defaultValue: any;
610
- onChange: (value: any) => void;
611
- };
612
- //#endregion
613
- //#region ../../src/core/atoms/alephaThemeListAtom.d.ts
614
- declare const alephaThemeListAtom: alepha1.Atom<alepha1.TArray<alepha1.TRecord<string, alepha1.TAny>>, "alepha.ui.themeList">;
615
- //#endregion
616
- //#region ../../src/core/interfaces/AlephaTheme.d.ts
617
- type AlephaTheme = MantineThemeOverride & {
618
- name: string;
619
- description: string;
620
- defaultColorScheme?: "light" | "dark";
621
- };
622
- //#endregion
623
- //#region ../../src/core/atoms/themes/default.d.ts
624
- declare const defaultTheme: AlephaTheme;
625
- //#endregion
626
- //#region ../../src/core/atoms/themes/midnight.d.ts
627
- declare const midnightTheme: AlephaTheme;
628
- //#endregion
629
- //#region ../../../alepha/src/server/core/schemas/errorSchema.d.ts
630
- declare const errorSchema: alepha1.TObject<{
631
- error: alepha1.TString;
632
- status: alepha1.TInteger;
633
- message: alepha1.TString;
634
- details: alepha1.TOptional<alepha1.TString>;
635
- requestId: alepha1.TOptional<alepha1.TString>;
636
- cause: alepha1.TOptional<alepha1.TObject<{
637
- name: alepha1.TString;
638
- message: alepha1.TString;
639
- }>>;
640
- }>;
641
- type ErrorSchema = Static<typeof errorSchema>;
642
- //#endregion
643
- //#region ../../../alepha/src/server/core/errors/HttpError.d.ts
644
- declare class HttpError extends AlephaError {
645
- name: string;
646
- static is: (error: unknown, status?: number) => error is HttpErrorLike;
647
- static toJSON(error: HttpError): ErrorSchema;
648
- readonly error: string;
649
- readonly status: number;
650
- readonly requestId?: string;
651
- readonly details?: string;
652
- readonly reason?: {
653
- name: string;
654
- message: string;
655
- };
656
- constructor(options: Partial<ErrorSchema>, cause?: unknown);
657
- }
658
- interface HttpErrorLike extends Error {
659
- status: number;
660
- }
661
- //#endregion
662
- //#region ../../../alepha/src/router/providers/RouterProvider.d.ts
663
- declare abstract class RouterProvider<T$1 extends Route = Route> {
664
- protected routePathRegex: RegExp;
665
- protected tree: Tree<T$1>;
666
- protected cache: Map<string, RouteMatch<T$1>>;
667
- match(path: string): RouteMatch<T$1>;
668
- protected test(path: string): void;
669
- protected push(route: T$1): void;
670
- protected createRouteMatch(path: string): RouteMatch<T$1>;
671
- protected mapParams(match: RouteMatch<T$1>): RouteMatch<T$1>;
672
- protected createParts(path: string): string[];
673
- }
674
- interface RouteMatch<T$1 extends Route> {
675
- route?: T$1;
676
- params?: Record<string, string>;
677
- }
678
- interface Route {
679
- path: string;
680
- /**
681
- * Rename a param in the route.
682
- * This is automatically filled when you have scenarios like:
683
- * `/customers/:id` and `/customers/:userId/payments`
684
- *
685
- * In this case, `:id` will be renamed to `:userId` in the second route.
686
- */
687
- mapParams?: Record<string, string>;
688
- }
689
- interface Tree<T$1 extends Route> {
690
- route?: T$1;
691
- children: {
692
- [key: string]: Tree<T$1>;
693
- };
694
- param?: {
695
- route?: T$1;
696
- name: string;
697
- children: {
698
- [key: string]: Tree<T$1>;
699
- };
700
- };
701
- wildcard?: {
702
- route: T$1;
703
- };
704
- }
705
- //#endregion
706
- //#region ../../../alepha/src/server/core/constants/routeMethods.d.ts
707
- declare const routeMethods: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS", "CONNECT", "TRACE"];
708
- type RouteMethod = (typeof routeMethods)[number];
709
- //#endregion
710
- //#region ../../../alepha/src/server/core/helpers/ServerReply.d.ts
711
- /**
712
- * Helper for building server replies.
713
- */
714
- declare class ServerReply {
715
- headers: Record<string, string> & {
716
- "set-cookie"?: string[];
717
- };
718
- status?: number;
719
- body?: any;
720
- /**
721
- * Redirect to a given URL with optional status code (default 302).
722
- */
723
- redirect(url: string, status?: number): void;
724
- /**
725
- * Set the response status code.
726
- */
727
- setStatus(status: number): this;
728
- /**
729
- * Set a response header.
730
- */
731
- setHeader(name: string, value: string): this;
732
- /**
733
- * Set the response body.
734
- */
735
- setBody(body: any): this;
736
- }
737
- //#endregion
738
- //#region ../../../alepha/src/server/core/services/UserAgentParser.d.ts
739
- interface UserAgentInfo {
740
- os: "Windows" | "Android" | "Ubuntu" | "MacOS" | "iOS" | "Linux" | "FreeBSD" | "OpenBSD" | "ChromeOS" | "BlackBerry" | "Symbian" | "Windows Phone";
741
- browser: "Chrome" | "Firefox" | "Safari" | "Edge" | "Opera" | "Internet Explorer" | "Brave" | "Vivaldi" | "Samsung Browser" | "UC Browser" | "Yandex";
742
- device: "MOBILE" | "DESKTOP" | "TABLET";
743
- }
744
- /**
745
- * Simple User-Agent parser to detect OS, browser, and device type.
746
- * This parser is not exhaustive and may not cover all edge cases.
747
- *
748
- * Use result for non
749
- */
750
- declare class UserAgentParser {
751
- parse(userAgent?: string): UserAgentInfo;
752
- }
753
- //#endregion
754
- //#region ../../../alepha/src/server/core/interfaces/ServerRequest.d.ts
755
- type TRequestBody = TObject | TString | TArray | TRecord | TStream;
756
- type TResponseBody = TObject | TString | TRecord | TFile | TArray | TStream | TVoid;
757
- interface RequestConfigSchema {
758
- body?: TRequestBody;
759
- params?: TObject;
760
- query?: TObject;
761
- headers?: TObject;
762
- response?: TResponseBody;
763
- }
764
- interface ServerRequestConfig<TConfig extends RequestConfigSchema = RequestConfigSchema> {
765
- body: TConfig["body"] extends TRequestBody ? Static<TConfig["body"]> : any;
766
- headers: TConfig["headers"] extends TObject ? Static<TConfig["headers"]> : Record<string, string>;
767
- params: TConfig["params"] extends TObject ? Static<TConfig["params"]> : Record<string, string>;
768
- query: TConfig["query"] extends TObject ? Static<TConfig["query"]> : Record<string, any>;
769
- }
770
- type ServerRequestConfigEntry<TConfig extends RequestConfigSchema = RequestConfigSchema> = Partial<ServerRequestConfig<TConfig>>;
771
- interface ServerRequest<TConfig extends RequestConfigSchema = RequestConfigSchema> extends ServerRequestConfig<TConfig> {
772
- /**
773
- * HTTP method used for this request.
774
- */
775
- method: RouteMethod;
776
- /**
777
- * Full request URL.
778
- */
779
- url: URL;
780
- /**
781
- * Unique request ID assigned to this request.
782
- */
783
- requestId: string;
784
- /**
785
- * Client IP address.
786
- * Will parse `X-Forwarded-For` header if present.
787
- */
788
- ip?: string;
789
- /**
790
- * Value of the `Host` header sent by the client.
791
- */
792
- host?: string;
793
- /**
794
- * Browser user agent information.
795
- * Information are not guaranteed to be accurate. Use with caution.
796
- *
797
- * @see {@link UserAgentParser}
798
- */
799
- userAgent: UserAgentInfo;
800
- /**
801
- * Arbitrary metadata attached to the request. Can be used by middlewares to store information.
802
- */
803
- metadata: Record<string, any>;
804
- /**
805
- * Reply object to be used to send response.
806
- */
807
- reply: ServerReply;
808
- /**
809
- * The raw underlying request object (Web Request).
810
- */
811
- raw: ServerRawRequest;
812
- }
813
- interface ServerRoute<TConfig extends RequestConfigSchema = RequestConfigSchema> extends Route {
814
- /**
815
- * Handler function for this route.
816
- */
817
- handler: ServerHandler<TConfig>;
818
- /**
819
- * HTTP method for this route.
820
- */
821
- method?: RouteMethod;
822
- /**
823
- * Request/response schema for this route.
824
- *
825
- * Request schema contains:
826
- * - body, for POST/PUT/PATCH requests
827
- * - params, for URL parameters (e.g. /user/:id)
828
- * - query, for URL query parameters (e.g. /user?id=123)
829
- * - headers, for HTTP headers
830
- *
831
- * Response schema contains:
832
- * - response
833
- *
834
- * Response schema is used to validate and serialize the response sent by the handler.
835
- */
836
- schema?: TConfig;
837
- /**
838
- * @see ServerLoggerProvider
839
- */
840
- silent?: boolean;
841
- }
842
- type ServerResponseBody<TConfig extends RequestConfigSchema = RequestConfigSchema> = TConfig["response"] extends TResponseBody ? Static<TConfig["response"]> : ResponseBodyType;
843
- type ResponseKind = "json" | "text" | "void" | "file" | "any";
844
- type ResponseBodyType = string | Buffer | StreamLike | undefined | null | void;
845
- type ServerHandler<TConfig extends RequestConfigSchema = RequestConfigSchema> = (request: ServerRequest<TConfig>) => Async<ServerResponseBody<TConfig>>;
846
- interface ServerResponse$1 {
847
- body: string | Buffer | ArrayBuffer | Readable | ReadableStream;
848
- headers: Record<string, string>;
849
- status: number;
850
- }
851
- type ServerRouteRequestHandler = (request: ServerRequestData) => Promise<ServerResponse$1>;
852
- interface ServerRouteMatcher extends Route {
853
- handler: ServerRouteRequestHandler;
854
- }
855
- interface ServerRequestData {
856
- method: RouteMethod;
857
- url: URL;
858
- headers: Record<string, string>;
859
- query: Record<string, string>;
860
- params: Record<string, string>;
861
- raw: ServerRawRequest;
862
- }
863
- interface ServerRawRequest {
864
- node?: NodeRequestEvent;
865
- web?: WebRequestEvent;
866
- }
867
- interface NodeRequestEvent {
868
- req: IncomingMessage;
869
- res: ServerResponse;
870
- }
871
- interface WebRequestEvent {
872
- req: Request;
873
- res?: Response;
874
- }
875
- //#endregion
876
- //#region ../../../alepha/src/server/core/services/ServerRequestParser.d.ts
877
- declare class ServerRequestParser {
878
- protected readonly alepha: Alepha;
879
- protected readonly userAgentParser: UserAgentParser;
880
- createServerRequest(rawRequest: ServerRequestData): ServerRequest;
881
- getRequestId(request: ServerRequestData): string | undefined;
882
- getRequestUserAgent(request: ServerRequestData): UserAgentInfo;
883
- getRequestIp(request: ServerRequestData): string | undefined;
884
- }
885
- //#endregion
886
- //#region ../../../alepha/src/server/core/providers/ServerTimingProvider.d.ts
887
- type TimingMap = Record<string, [number, number]>;
888
- declare class ServerTimingProvider {
889
- protected readonly log: Logger;
890
- protected readonly alepha: Alepha;
891
- options: {
892
- prefix: string;
893
- disabled: boolean;
894
- };
895
- readonly onRequest: alepha1.HookPrimitive<"server:onRequest">;
896
- readonly onResponse: alepha1.HookPrimitive<"server:onResponse">;
897
- protected get handlerName(): string;
898
- beginTiming(name: string): void;
899
- endTiming(name: string): void;
900
- protected setDuration(name: string, timing: TimingMap): void;
901
- }
902
- //#endregion
903
- //#region ../../../alepha/src/server/core/providers/ServerRouterProvider.d.ts
904
- /**
905
- * Main router for all routes on the server side.
906
- *
907
- * - $route => generic route
908
- * - $action => action route (for API calls)
909
- * - $page => React route (for SSR)
910
- */
911
- declare class ServerRouterProvider extends RouterProvider<ServerRouteMatcher> {
912
- protected readonly log: Logger;
913
- protected readonly alepha: Alepha;
914
- protected readonly routes: ServerRoute[];
915
- protected readonly serverTimingProvider: ServerTimingProvider;
916
- protected readonly serverRequestParser: ServerRequestParser;
917
- /**
918
- * Get all registered routes, optionally filtered by a pattern.
919
- *
920
- * Pattern accept simple wildcard '*' at the end.
921
- * Example: '/api/*' will match all routes starting with '/api/' but '/api/' will match only that exact route.
922
- */
923
- getRoutes(pattern?: string): ServerRoute[];
924
- createRoute<TConfig extends RequestConfigSchema = RequestConfigSchema>(route: ServerRoute<TConfig>): void;
925
- protected getContextId(headers: Record<string, string>): string;
926
- protected processRequest(request: ServerRequest, route: ServerRoute, responseKind: ResponseKind): Promise<{
927
- status: number;
928
- headers: Record<string, string> & {
929
- "set-cookie"?: string[];
930
- };
931
- body: any;
932
- }>;
933
- protected runRouteHandler(route: ServerRoute, request: ServerRequest, responseKind: ResponseKind): Promise<void>;
934
- serializeResponse(route: ServerRoute, reply: ServerReply, responseKind: ResponseKind): void;
935
- protected getResponseType(schema?: RequestConfigSchema): ResponseKind;
936
- protected errorHandler(route: ServerRoute, request: ServerRequest, error: Error): Promise<void>;
937
- validateRequest(route: {
938
- schema?: RequestConfigSchema;
939
- }, request: ServerRequestConfig): void;
940
- }
941
- //#endregion
942
- //#region ../../../alepha/src/server/core/providers/ServerProvider.d.ts
943
- /**
944
- * Base server provider to handle incoming requests and route them.
945
- *
946
- * This is the default implementation for serverless environments.
947
- *
948
- * ServerProvider supports both Node.js HTTP requests and Web (Fetch API) requests.
949
- */
950
- declare class ServerProvider {
951
- protected readonly log: Logger;
952
- protected readonly alepha: Alepha;
953
- protected readonly dateTimeProvider: DateTimeProvider;
954
- protected readonly router: ServerRouterProvider;
955
- protected readonly internalServerErrorMessage = "Internal Server Error";
956
- get hostname(): string;
957
- /**
958
- * When a Node.js HTTP request is received from outside. (Vercel, AWS Lambda, etc.)
959
- */
960
- protected readonly onNodeRequest: alepha1.HookPrimitive<"node:request">;
961
- /**
962
- * When a Web (Fetch API) request is received from outside. (Netlify, Cloudflare Workers, etc.)
963
- */
964
- protected readonly onWebRequest: alepha1.HookPrimitive<"web:request">;
965
- /**
966
- * Handle Node.js HTTP request event.
967
- *
968
- * Technically, we just convert Node.js request to Web Standard Request.
969
- */
970
- handleNodeRequest(nodeRequestEvent: NodeRequestEvent): Promise<void>;
971
- /**
972
- * Handle Web (Fetch API) request event.
973
- */
974
- handleWebRequest(ev: WebRequestEvent): Promise<void>;
975
- /**
976
- * Helper for Vite development mode to let Vite handle (or not) 404.
977
- */
978
- protected isViteNotFound(url?: string, route?: Route, params?: Record<string, string>): boolean;
979
- }
980
- //#endregion
981
- //#region ../../../alepha/src/cache/core/providers/CacheProvider.d.ts
982
- /**
983
- * Cache provider interface.
984
- *
985
- * All methods are asynchronous and return promises.
986
- * Values are stored as Uint8Array.
987
- */
988
- declare abstract class CacheProvider {
989
- /**
990
- * Get the value of a key.
991
- *
992
- * @param name Cache name, used to group keys. Should be Redis-like "some:group:name" format.
993
- * @param key The key of the value to get.
994
- *
995
- * @return The value of the key, or undefined if the key does not exist.
996
- */
997
- abstract get(name: string, key: string): Promise<Uint8Array | undefined>;
998
- /**
999
- * Set the string value of a key.
1000
- *
1001
- * @param name Cache name, used to group keys. Should be Redis-like "some:group:name" format.
1002
- * @param key The key of the value to set.
1003
- * @param value The value to set.
1004
- * @param ttl The time-to-live of the key, in milliseconds.
1005
- *
1006
- * @return The value of the key.
1007
- */
1008
- abstract set(name: string, key: string, value: Uint8Array, ttl?: number): Promise<Uint8Array>;
1009
- /**
1010
- * Remove the specified keys.
1011
- *
1012
- * @param name Cache name, used to group keys. Should be Redis-like "some:group:name" format.
1013
- * @param keys The keys to delete.
1014
- */
1015
- abstract del(name: string, ...keys: string[]): Promise<void>;
1016
- abstract has(name: string, key: string): Promise<boolean>;
1017
- abstract keys(name: string, filter?: string): Promise<string[]>;
1018
- /**
1019
- * Remove all keys from all cache names.
1020
- */
1021
- abstract clear(): Promise<void>;
1022
- }
1023
- //#endregion
1024
- //#region ../../../alepha/src/cache/core/primitives/$cache.d.ts
1025
- interface CachePrimitiveOptions<TReturn = any, TParameter extends any[] = any[]> {
1026
- /**
1027
- * The cache name. This is useful for invalidating multiple caches at once.
1028
- *
1029
- * Store key as `cache:$name:$key`.
1030
- *
1031
- * @default Name of the key of the class.
1032
- */
1033
- name?: string;
1034
- /**
1035
- * Function which returns cached data.
1036
- */
1037
- handler?: (...args: TParameter) => TReturn;
1038
- /**
1039
- * The key generator for the cache.
1040
- * If not provided, the arguments will be json.stringify().
1041
- */
1042
- key?: (...args: TParameter) => string;
1043
- /**
1044
- * The store provider for the cache.
1045
- * If not provided, the default store provider will be used.
1046
- */
1047
- provider?: InstantiableClass<CacheProvider> | "memory";
1048
- /**
1049
- * The time-to-live for the cache in seconds.
1050
- * Set 0 to skip expiration.
1051
- *
1052
- * @default 300 (5 minutes).
1053
- */
1054
- ttl?: DurationLike;
1055
- /**
1056
- * If the cache is disabled.
1057
- */
1058
- disabled?: boolean;
1059
- }
1060
- declare class CachePrimitive<TReturn = any, TParameter extends any[] = any[]> extends Primitive<CachePrimitiveOptions<TReturn, TParameter>> {
1061
- protected readonly env: {
1062
- CACHE_ENABLED: boolean;
1063
- CACHE_DEFAULT_TTL: number;
1064
- };
1065
- protected readonly dateTimeProvider: DateTimeProvider;
1066
- protected readonly provider: CacheProvider;
1067
- protected encoder: TextEncoder;
1068
- protected decoder: TextDecoder;
1069
- protected codes: {
1070
- BINARY: number;
1071
- JSON: number;
1072
- STRING: number;
1073
- };
1074
- get container(): string;
1075
- run(...args: TParameter): Promise<TReturn>;
1076
- key(...args: TParameter): string;
1077
- invalidate(...keys: string[]): Promise<void>;
1078
- set(key: string, value: TReturn, ttl?: DurationLike): Promise<void>;
1079
- get(key: string): Promise<TReturn | undefined>;
1080
- protected serialize<TReturn>(value: TReturn): Uint8Array;
1081
- protected deserialize<TReturn>(uint8Array: Uint8Array): Promise<TReturn>;
1082
- protected $provider(): CacheProvider;
1083
- }
1084
- interface CachePrimitiveFn<TReturn = any, TParameter extends any[] = any[]> extends CachePrimitive<TReturn, TParameter> {
1085
- /**
1086
- * Run the cache primitive with the provided arguments.
1087
- */
1088
- (...args: TParameter): Promise<TReturn>;
1089
- }
1090
- //#endregion
1091
- //#region ../../../alepha/src/server/core/services/HttpClient.d.ts
1092
- declare class HttpClient {
1093
- protected readonly log: Logger;
1094
- protected readonly alepha: Alepha;
1095
- readonly cache: CachePrimitiveFn<HttpClientCache, any[]>;
1096
- protected readonly pendingRequests: HttpClientPendingRequests;
1097
- fetchAction(args: FetchActionArgs): Promise<FetchResponse>;
1098
- fetch<T$1 extends TSchema>(url: string, request?: RequestInitWithOptions<T$1>): Promise<FetchResponse<Static<T$1>>>;
1099
- protected url(host: string, action: HttpAction, args: ServerRequestConfigEntry): string;
1100
- protected body(init: RequestInit, headers: Record<string, string>, action: HttpAction, args?: ServerRequestConfigEntry): Promise<void>;
1101
- protected responseData(response: Response, options: FetchOptions): Promise<any>;
1102
- protected isMaybeFile(response: Response): boolean;
1103
- protected createFileLike(response: Response, defaultFileName?: string): FileLike;
1104
- pathVariables(url: string, action: {
1105
- schema?: {
1106
- params?: TObject;
1107
- };
1108
- }, args?: ServerRequestConfigEntry): string;
1109
- queryParams(url: string, action: {
1110
- schema?: {
1111
- query?: TObject;
1112
- };
1113
- }, args?: ServerRequestConfigEntry): string;
1114
- }
1115
- interface FetchOptions<T$1 extends TSchema = TSchema> {
1116
- /**
1117
- * Key to identify the request in the pending requests.
1118
- */
1119
- key?: string;
1120
- /**
1121
- * The schema to validate the response against.
1122
- */
1123
- schema?: {
1124
- response?: T$1;
1125
- };
1126
- /**
1127
- * Built-in cache options.
1128
- */
1129
- localCache?: boolean | number | DurationLike;
1130
- }
1131
- type RequestInitWithOptions<T$1 extends TSchema = TSchema> = RequestInit & FetchOptions<T$1>;
1132
- interface FetchResponse<T$1 = any> {
1133
- data: T$1;
1134
- status: number;
1135
- statusText: string;
1136
- headers: Headers;
1137
- raw?: Response;
1138
- }
1139
- type HttpClientPendingRequests = Record<string, Promise<any> | undefined>;
1140
- interface HttpClientCache {
1141
- data: any;
1142
- etag?: string;
1143
- }
1144
- interface FetchActionArgs {
1145
- action: HttpAction;
1146
- host?: string;
1147
- config?: ServerRequestConfigEntry;
1148
- options?: ClientRequestOptions;
1149
- }
1150
- interface HttpAction {
1151
- method?: string;
1152
- prefix?: string;
1153
- path: string;
1154
- requestBodyType?: string;
1155
- schema?: {
1156
- params?: TObject;
1157
- query?: TObject;
1158
- body?: TRequestBody;
1159
- response?: TResponseBody;
1160
- };
1161
- }
1162
- //#endregion
1163
- //#region ../../../alepha/src/server/core/primitives/$action.d.ts
1164
- interface ActionPrimitiveOptions<TConfig extends RequestConfigSchema> extends Omit<ServerRoute, "handler" | "path" | "schema" | "mapParams"> {
1165
- /**
1166
- * Name of the action.
1167
- *
1168
- * - It will be used to generate the route path if `path` is not provided.
1169
- * - It will be used to generate the permission name if `security` is enabled.
1170
- */
1171
- name?: string;
1172
- /**
1173
- * Group actions together.
1174
- *
1175
- * - If not provided, the service name containing the route will be used.
1176
- * - It will be used as Tag for documentation purposes.
1177
- * - It will be used for permission name generation if `security` is enabled.
1178
- *
1179
- * @example
1180
- * ```ts
1181
- * // group = "MyController"
1182
- * class MyController {
1183
- * hello = $action({ handler: () => "Hello World" });
1184
- * }
1185
- *
1186
- * // group = "users"
1187
- * class MyOtherController {
1188
- * group = "users";
1189
- * a1 = $action({ handler: () => "Action 1", group: this.group });
1190
- * a2 = $action({ handler: () => "Action 2", group: this.group });
1191
- * }
1192
- * ```
1193
- */
1194
- group?: string;
1195
- /**
1196
- * Pathname of the route. If not provided, property key is used.
1197
- */
1198
- path?: string;
1199
- /**
1200
- * The route method.
1201
- *
1202
- * - If not provided, it will be set to "GET" by default.
1203
- * - If not provider and a body is provided, it will be set to "POST".
1204
- *
1205
- * Wildcard methods are not supported for now. (e.g. "ALL", "ANY", etc.)
1206
- */
1207
- method?: RouteMethod;
1208
- /**
1209
- * The config schema of the route.
1210
- * - body: The request body schema.
1211
- * - params: Path variables schema.
1212
- * - query: The request query-params schema.
1213
- * - response: The response schema.
1214
- */
1215
- schema?: TConfig;
1216
- /**
1217
- * A short description of the action. Used for documentation purposes.
1218
- */
1219
- description?: string;
1220
- /**
1221
- * Disable the route. Useful with env variables do disable one specific route.
1222
- * Route won't be available in the API but can still be called locally!
1223
- */
1224
- disabled?: boolean;
1225
- /**
1226
- * Main route handler. This is where the route logic is implemented.
1227
- */
1228
- handler: ServerActionHandler<TConfig>;
1229
- }
1230
- declare class ActionPrimitive<TConfig extends RequestConfigSchema> extends Primitive<ActionPrimitiveOptions<TConfig>> {
1231
- protected readonly log: Logger;
1232
- protected readonly env: {
1233
- SERVER_API_PREFIX: string;
1234
- };
1235
- protected readonly httpClient: HttpClient;
1236
- protected readonly serverProvider: ServerProvider;
1237
- protected readonly serverRouterProvider: ServerRouterProvider;
1238
- protected onInit(): void;
1239
- get prefix(): string;
1240
- get route(): ServerRoute;
1241
- /**
1242
- * Returns the name of the action.
1243
- */
1244
- get name(): string;
1245
- /**
1246
- * Returns the group of the action. (e.g. "orders", "admin", etc.)
1247
- */
1248
- get group(): string;
1249
- /**
1250
- * Returns the HTTP method of the action.
1251
- */
1252
- get method(): RouteMethod;
1253
- /**
1254
- * Returns the path of the action.
1255
- *
1256
- * Path is prefixed by `/api` by default.
1257
- */
1258
- get path(): string;
1259
- get schema(): TConfig | undefined;
1260
- getBodyContentType(): string | undefined;
1261
- /**
1262
- * Call the action handler directly.
1263
- * There is no HTTP layer involved.
1264
- */
1265
- run(config?: ClientRequestEntry<TConfig>, options?: ClientRequestOptions): Promise<ClientRequestResponse<TConfig>>;
1266
- /**
1267
- * Works like `run`, but always fetches (http request) the route.
1268
- */
1269
- fetch(config?: ClientRequestEntry<TConfig>, options?: ClientRequestOptions): Promise<FetchResponse<ClientRequestResponse<TConfig>>>;
1270
- }
1271
- type ClientRequestEntry<TConfig extends RequestConfigSchema, T$1 = ClientRequestEntryContainer<TConfig>> = { [K in keyof T$1 as T$1[K] extends undefined ? never : K]: T$1[K] };
1272
- type ClientRequestEntryContainer<TConfig extends RequestConfigSchema> = {
1273
- body: TConfig["body"] extends TObject ? Static<TConfig["body"]> : undefined;
1274
- params: TConfig["params"] extends TObject ? Static<TConfig["params"]> : undefined;
1275
- headers?: TConfig["headers"] extends TObject ? Static<TConfig["headers"]> : undefined;
1276
- query?: TConfig["query"] extends TObject ? Partial<Static<TConfig["query"]>> : undefined;
1277
- };
1278
- interface ClientRequestOptions extends FetchOptions {
1279
- /**
1280
- * Standard request fetch options.
1281
- */
1282
- request?: RequestInit;
1283
- }
1284
- type ClientRequestResponse<TConfig extends RequestConfigSchema> = TConfig["response"] extends TSchema ? Static<TConfig["response"]> : any;
1285
- /**
1286
- * Specific handler for server actions.
1287
- */
1288
- type ServerActionHandler<TConfig extends RequestConfigSchema = RequestConfigSchema> = (request: ServerActionRequest<TConfig>) => Async<ServerResponseBody<TConfig>>;
1289
- /**
1290
- * Server Action Request Interface
1291
- *
1292
- * Can be extended with module augmentation to add custom properties (like `user` in Server Security).
1293
- *
1294
- * This is NOT Server Request, but a specific type for actions.
1295
- */
1296
- interface ServerActionRequest<TConfig extends RequestConfigSchema> extends ServerRequest<TConfig> {}
1297
- //#endregion
1298
- //#region ../../../alepha/src/server/core/providers/BunHttpServerProvider.d.ts
1299
- declare const envSchema$5: alepha1.TObject<{
1300
- SERVER_PORT: alepha1.TInteger;
1301
- SERVER_HOST: alepha1.TString;
1302
- }>;
1303
- declare module "alepha" {
1304
- interface Env extends Partial<Static<typeof envSchema$5>> {}
1305
- }
1306
- //#endregion
1307
- //#region ../../../alepha/src/server/core/providers/NodeHttpServerProvider.d.ts
1308
- declare const envSchema$4: alepha1.TObject<{
1309
- SERVER_PORT: alepha1.TInteger;
1310
- SERVER_HOST: alepha1.TString;
1311
- }>;
1312
- declare module "alepha" {
1313
- interface Env extends Partial<Static<typeof envSchema$4>> {}
1314
- }
1315
- //#endregion
1316
- //#region ../../../alepha/src/server/core/index.d.ts
1317
- declare module "alepha" {
1318
- interface State {
1319
- "alepha.node.server"?: Server;
1320
- }
1321
- interface Hooks {
1322
- "action:onRequest": {
1323
- action: ActionPrimitive<RequestConfigSchema>;
1324
- request: ServerRequest;
1325
- options: ClientRequestOptions;
1326
- };
1327
- "action:onResponse": {
1328
- action: ActionPrimitive<RequestConfigSchema>;
1329
- request: ServerRequest;
1330
- options: ClientRequestOptions;
1331
- response: any;
1332
- };
1333
- "server:onRequest": {
1334
- route: ServerRoute;
1335
- request: ServerRequest;
1336
- };
1337
- "server:onError": {
1338
- route: ServerRoute;
1339
- request: ServerRequest;
1340
- error: Error;
1341
- };
1342
- "server:onSend": {
1343
- route: ServerRoute;
1344
- request: ServerRequest;
1345
- };
1346
- "server:onResponse": {
1347
- route: ServerRoute;
1348
- request: ServerRequest;
1349
- response: ServerResponse$1;
1350
- };
1351
- "client:onRequest": {
1352
- route: HttpAction;
1353
- config: ServerRequestConfigEntry;
1354
- options: ClientRequestOptions;
1355
- headers: Record<string, string>;
1356
- request: RequestInit;
1357
- };
1358
- "client:beforeFetch": {
1359
- url: string;
1360
- options: FetchOptions;
1361
- request: RequestInit;
1362
- };
1363
- "client:onError": {
1364
- route?: HttpAction;
1365
- error: HttpError;
1366
- };
1367
- "node:request": NodeRequestEvent;
1368
- "web:request": WebRequestEvent;
1369
- }
1370
- }
1371
- //#endregion
1372
- //#region ../../../alepha/src/server/cache/providers/ServerCacheProvider.d.ts
1373
- declare module "alepha/server" {
1374
- interface ServerRoute {
1375
- /**
1376
- * Enable caching for this route.
1377
- * - If true: enables both store and etag
1378
- * - If object: fine-grained control over store, etag, and cache-control headers
1379
- *
1380
- * @default false
1381
- */
1382
- cache?: ServerRouteCache;
1383
- }
1384
- interface ActionPrimitive<TConfig extends RequestConfigSchema> {
1385
- invalidate: () => Promise<void>;
1386
- }
1387
- }
1388
- type ServerRouteCache =
1389
- /**
1390
- * If true, enables caching with:
1391
- * - store: true
1392
- * - etag: true
1393
- */
1394
- boolean
1395
- /**
1396
- * Object configuration for fine-grained cache control.
1397
- *
1398
- * If empty, no caching will be applied.
1399
- */ | {
1400
- /**
1401
- * If true, enables storing cached responses. (in-memory, Redis, @see alepha/cache for other providers)
1402
- * If a DurationLike is provided, it will be used as the TTL for the cache.
1403
- * If CachePrimitiveOptions is provided, it will be used to configure the cache storage.
1404
- *
1405
- * @default false
1406
- */
1407
- store?: true | DurationLike | CachePrimitiveOptions;
1408
- /**
1409
- * If true, enables ETag support for the cached responses.
1410
- */
1411
- etag?: true;
1412
- /**
1413
- * - If true, sets Cache-Control to "public, max-age=300" (5 minutes).
1414
- * - If string, sets Cache-Control to the provided value directly.
1415
- * - If object, configures Cache-Control directives.
1416
- */
1417
- control?: true
1418
- /**
1419
- * If string, sets Cache-Control to the provided value directly.
1420
- */ | string
1421
- /**
1422
- * If object, configures Cache-Control directives.
1423
- */ | {
1424
- /**
1425
- * Indicates that the response may be cached by any cache.
1426
- */
1427
- public?: boolean;
1428
- /**
1429
- * Indicates that the response is intended for a single user and must not be stored by a shared cache.
1430
- */
1431
- private?: boolean;
1432
- /**
1433
- * Forces caches to submit the request to the origin server for validation before releasing a cached copy.
1434
- */
1435
- noCache?: boolean;
1436
- /**
1437
- * Instructs caches not to store the response.
1438
- */
1439
- noStore?: boolean;
1440
- /**
1441
- * Maximum amount of time a resource is considered fresh.
1442
- * Can be specified as a number (seconds) or as a DurationLike object.
1443
- *
1444
- * @example 300 // 5 minutes in seconds
1445
- * @example { minutes: 5 } // 5 minutes
1446
- * @example { hours: 1 } // 1 hour
1447
- */
1448
- maxAge?: number | DurationLike;
1449
- /**
1450
- * Overrides max-age for shared caches (e.g., CDNs).
1451
- * Can be specified as a number (seconds) or as a DurationLike object.
1452
- */
1453
- sMaxAge?: number | DurationLike;
1454
- /**
1455
- * Indicates that once a resource becomes stale, caches must not use it without successful validation.
1456
- */
1457
- mustRevalidate?: boolean;
1458
- /**
1459
- * Similar to must-revalidate, but only for shared caches.
1460
- */
1461
- proxyRevalidate?: boolean;
1462
- /**
1463
- * Indicates that the response can be stored but must be revalidated before each use.
1464
- */
1465
- immutable?: boolean;
1466
- };
1467
- };
1468
- //#endregion
1469
- //#region ../../../react/src/core/components/ClientOnly.d.ts
1470
- interface ClientOnlyProps {
1471
- fallback?: ReactNode;
1472
- disabled?: boolean;
1473
- }
1474
- //#endregion
1475
- //#region ../../../react/src/core/errors/Redirection.d.ts
1476
- /**
1477
- * Used for Redirection during the page loading.
1478
- *
1479
- * Depends on the context, it can be thrown or just returned.
1480
- */
1481
- declare class Redirection extends Error {
1482
- readonly redirect: string;
1483
- constructor(redirect: string);
1484
- }
1485
- //#endregion
1486
- //#region ../../../react/src/core/providers/ReactPageProvider.d.ts
1487
- declare const envSchema$3: alepha1.TObject<{
1488
- REACT_STRICT_MODE: alepha1.TBoolean;
1489
- }>;
1490
- declare module "alepha" {
1491
- interface Env extends Partial<Static<typeof envSchema$3>> {}
1492
- }
1493
- interface PageRouteEntry extends Omit<PagePrimitiveOptions, "children" | "parent"> {
1494
- children?: PageRouteEntry[];
1495
- }
1496
- interface PageRoute extends PageRouteEntry {
1497
- type: "page";
1498
- name: string;
1499
- parent?: PageRoute;
1500
- match: string;
1501
- }
1502
- interface Layer {
1503
- config?: {
1504
- query?: Record<string, any>;
1505
- params?: Record<string, any>;
1506
- context?: Record<string, any>;
1507
- };
1508
- name: string;
1509
- props?: Record<string, any>;
1510
- error?: Error;
1511
- part?: string;
1512
- element: ReactNode;
1513
- index: number;
1514
- path: string;
1515
- route?: PageRoute;
1516
- cache?: boolean;
1517
- }
1518
- type PreviousLayerData = Omit<Layer, "element" | "index" | "path">;
1519
- interface ReactRouterState {
1520
- /**
1521
- * Stack of layers for the current page.
1522
- */
1523
- layers: Array<Layer>;
1524
- /**
1525
- * URL of the current page.
1526
- */
1527
- url: URL;
1528
- /**
1529
- * Error handler for the current page.
1530
- */
1531
- onError: ErrorHandler;
1532
- /**
1533
- * Params extracted from the URL for the current page.
1534
- */
1535
- params: Record<string, any>;
1536
- /**
1537
- * Query parameters extracted from the URL for the current page.
1538
- */
1539
- query: Record<string, string>;
1540
- /**
1541
- * Optional meta information associated with the current page.
1542
- */
1543
- meta: Record<string, any>;
1544
- name?: string;
1545
- }
1546
- interface TransitionOptions {
1547
- previous?: PreviousLayerData[];
1548
- }
1549
- //#endregion
1550
- //#region ../../../react/src/core/services/ReactPageService.d.ts
1551
- declare class ReactPageService {
1552
- fetch(pathname: string, options?: PagePrimitiveRenderOptions): Promise<{
1553
- html: string;
1554
- response: Response;
1555
- }>;
1556
- render(name: string, options?: PagePrimitiveRenderOptions): Promise<PagePrimitiveRenderResult>;
1557
- }
1558
- //#endregion
1559
- //#region ../../../react/src/core/primitives/$page.d.ts
1560
- interface PagePrimitiveOptions<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> {
1561
- /**
1562
- * Identifier name for the page. Must be unique.
1563
- *
1564
- * @default Primitive key
1565
- */
1566
- name?: string;
1567
- /**
1568
- * Add a pathname to the page.
1569
- *
1570
- * Pathname can contain parameters, like `/post/:slug`.
1571
- *
1572
- * @default ""
1573
- */
1574
- path?: string;
1575
- /**
1576
- * Add an input schema to define:
1577
- * - `params`: parameters from the pathname.
1578
- * - `query`: query parameters from the URL.
1579
- */
1580
- schema?: TConfig;
1581
- /**
1582
- * Load data before rendering the page.
1583
- *
1584
- * This function receives
1585
- * - the request context (params, query, etc.)
1586
- * - the parent props (if page has a parent)
1587
- *
1588
- * > In SSR, the returned data will be serialized and sent to the client, then reused during the client-side hydration.
1589
- *
1590
- * Resolve can be stopped by throwing an error, which will be handled by the `errorHandler` function.
1591
- * It's common to throw a `NotFoundError` to display a 404 page.
1592
- *
1593
- * RedirectError can be thrown to redirect the user to another page.
1594
- */
1595
- resolve?: (context: PageResolve<TConfig, TPropsParent>) => Async<TProps>;
1596
- /**
1597
- * Default props to pass to the component when rendering the page.
1598
- *
1599
- * Resolved props from the `resolve` function will override these default props.
1600
- */
1601
- props?: () => Partial<TProps>;
1602
- /**
1603
- * The component to render when the page is loaded.
1604
- *
1605
- * If `lazy` is defined, this will be ignored.
1606
- * Prefer using `lazy` to improve the initial loading time.
1607
- */
1608
- component?: FC<TProps & TPropsParent>;
1609
- /**
1610
- * Lazy load the component when the page is loaded.
1611
- *
1612
- * It's recommended to use this for components to improve the initial loading time
1613
- * and enable code-splitting.
1614
- */
1615
- lazy?: () => Promise<{
1616
- default: FC<TProps & TPropsParent>;
1617
- }>;
1618
- /**
1619
- * Attach child pages to create nested routes.
1620
- * This will make the page a parent route.
1621
- */
1622
- children?: Array<PagePrimitive> | (() => Array<PagePrimitive>);
1623
- /**
1624
- * Define a parent page for nested routing.
1625
- */
1626
- parent?: PagePrimitive<PageConfigSchema, TPropsParent, any>;
1627
- /**
1628
- * Function to determine if the page can be accessed.
1629
- *
1630
- * If it returns false, the page will not be accessible and a 403 Forbidden error will be returned.
1631
- * This function can be used to implement permission-based access control.
1632
- */
1633
- can?: () => boolean;
1634
- /**
1635
- * Catch any error from the `resolve` function or during `rendering`.
1636
- *
1637
- * Expected to return one of the following:
1638
- * - a ReactNode to render an error page
1639
- * - a Redirection to redirect the user
1640
- * - undefined to let the error propagate
1641
- *
1642
- * If not defined, the error will be thrown and handled by the server or client error handler.
1643
- * If a leaf $page does not define an error handler, the error can be caught by parent pages.
1644
- *
1645
- * @example Catch a 404 from API and render a custom not found component:
1646
- * ```ts
1647
- * resolve: async ({ params, query }) => {
1648
- * api.fetch("/api/resource", { params, query });
1649
- * },
1650
- * errorHandler: (error, context) => {
1651
- * if (HttpError.is(error, 404)) {
1652
- * return <ResourceNotFound />;
1653
- * }
1654
- * }
1655
- * ```
1656
- *
1657
- * @example Catch an 401 error and redirect the user to the login page:
1658
- * ```ts
1659
- * resolve: async ({ params, query }) => {
1660
- * // but the user is not authenticated
1661
- * api.fetch("/api/resource", { params, query });
1662
- * },
1663
- * errorHandler: (error, context) => {
1664
- * if (HttpError.is(error, 401)) {
1665
- * // throwing a Redirection is also valid!
1666
- * return new Redirection("/login");
1667
- * }
1668
- * }
1669
- * ```
1670
- */
1671
- errorHandler?: ErrorHandler;
1672
- /**
1673
- * If true, the page will be considered as a static page, immutable and cacheable.
1674
- * Replace boolean by an object to define static entries. (e.g. list of params/query)
1675
- *
1676
- * Browser-side: it only works with `alepha/vite`, which can pre-render the page at build time.
1677
- *
1678
- * Server-side: It will act as timeless cached page. You can use `cache` to configure the cache behavior.
1679
- */
1680
- static?: boolean | {
1681
- entries?: Array<Partial<PageRequestConfig<TConfig>>>;
1682
- };
1683
- cache?: ServerRouteCache;
1684
- /**
1685
- * If true, force the page to be rendered only on the client-side (browser).
1686
- * It uses the `<ClientOnly/>` component to render the page.
1687
- */
1688
- client?: boolean | ClientOnlyProps;
1689
- /**
1690
- * Called before the server response is sent to the client. (server only)
1691
- */
1692
- onServerResponse?: (request: ServerRequest) => unknown;
1693
- /**
1694
- * Called when user leaves the page. (browser only)
1695
- */
1696
- onLeave?: () => void;
1697
- /**
1698
- * @experimental
1699
- *
1700
- * Add a css animation when the page is loaded or unloaded.
1701
- * It uses CSS animations, so you need to define the keyframes in your CSS.
1702
- *
1703
- * @example Simple animation name
1704
- * ```ts
1705
- * animation: "fadeIn"
1706
- * ```
1707
- *
1708
- * CSS example:
1709
- * ```css
1710
- * @keyframes fadeIn {
1711
- * from { opacity: 0; }
1712
- * to { opacity: 1; }
1713
- * }
1714
- * ```
1715
- *
1716
- * @example Detailed animation
1717
- * ```ts
1718
- * animation: {
1719
- * enter: { name: "fadeIn", duration: 300 },
1720
- * exit: { name: "fadeOut", duration: 200, timing: "ease-in-out" },
1721
- * }
1722
- * ```
1723
- *
1724
- * @example Only exit animation
1725
- * ```ts
1726
- * animation: {
1727
- * exit: "fadeOut"
1728
- * }
1729
- * ```
1730
- *
1731
- * @example With custom timing function
1732
- * ```ts
1733
- * animation: {
1734
- * enter: { name: "fadeIn", duration: 300, timing: "cubic-bezier(0.4, 0, 0.2, 1)" },
1735
- * exit: { name: "fadeOut", duration: 200, timing: "ease-in-out" },
1736
- * }
1737
- * ```
1738
- */
1739
- animation?: PageAnimation;
1740
- }
1741
- type ErrorHandler = (error: Error, state: ReactRouterState) => ReactNode | Redirection | undefined;
1742
- declare class PagePrimitive<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> extends Primitive<PagePrimitiveOptions<TConfig, TProps, TPropsParent>> {
1743
- protected readonly reactPageService: ReactPageService;
1744
- protected onInit(): void;
1745
- get name(): string;
1746
- /**
1747
- * For testing or build purposes.
1748
- *
1749
- * This will render the page (HTML layout included or not) and return the HTML + context.
1750
- * Only valid for server-side rendering, it will throw an error if called on the client-side.
1751
- */
1752
- render(options?: PagePrimitiveRenderOptions): Promise<PagePrimitiveRenderResult>;
1753
- fetch(options?: PagePrimitiveRenderOptions): Promise<{
1754
- html: string;
1755
- response: Response;
1756
- }>;
1757
- match(url: string): boolean;
1758
- pathname(config: any): string;
1759
- }
1760
- interface PageConfigSchema {
1761
- query?: TSchema;
1762
- params?: TSchema;
1763
- }
1764
- type TPropsDefault = any;
1765
- type TPropsParentDefault = {};
1766
- interface PagePrimitiveRenderOptions {
1767
- params?: Record<string, string>;
1768
- query?: Record<string, string>;
1769
- /**
1770
- * If true, the HTML layout will be included in the response.
1771
- * If false, only the page content will be returned.
1772
- *
1773
- * @default true
1774
- */
1775
- html?: boolean;
1776
- hydration?: boolean;
1777
- }
1778
- interface PagePrimitiveRenderResult {
1779
- html: string;
1780
- state: ReactRouterState;
1781
- redirect?: string;
1782
- }
1783
- interface PageRequestConfig<TConfig extends PageConfigSchema = PageConfigSchema> {
1784
- params: TConfig["params"] extends TSchema ? Static<TConfig["params"]> : Record<string, string>;
1785
- query: TConfig["query"] extends TSchema ? Static<TConfig["query"]> : Record<string, string>;
1786
- }
1787
- type PageResolve<TConfig extends PageConfigSchema = PageConfigSchema, TPropsParent extends object = TPropsParentDefault> = PageRequestConfig<TConfig> & TPropsParent & Omit<ReactRouterState, "layers" | "onError">;
1788
- type PageAnimation = PageAnimationObject | ((state: ReactRouterState) => PageAnimationObject | undefined);
1789
- type PageAnimationObject = CssAnimationName | {
1790
- enter?: CssAnimation | CssAnimationName;
1791
- exit?: CssAnimation | CssAnimationName;
1792
- };
1793
- type CssAnimationName = string;
1794
- type CssAnimation = {
1795
- name: string;
1796
- duration?: number;
1797
- timing?: string;
1798
- };
1799
- //#endregion
1800
- //#region ../../../alepha/src/security/schemas/userAccountInfoSchema.d.ts
1801
- declare const userAccountInfoSchema: alepha1.TObject<{
1802
- id: alepha1.TString;
1803
- name: alepha1.TOptional<alepha1.TString>;
1804
- email: alepha1.TOptional<alepha1.TString>;
1805
- username: alepha1.TOptional<alepha1.TString>;
1806
- picture: alepha1.TOptional<alepha1.TString>;
1807
- sessionId: alepha1.TOptional<alepha1.TString>;
1808
- organizations: alepha1.TOptional<alepha1.TArray<alepha1.TString>>;
1809
- roles: alepha1.TOptional<alepha1.TArray<alepha1.TString>>;
1810
- }>;
1811
- type UserAccount = Static<typeof userAccountInfoSchema>;
1812
- //#endregion
1813
- //#region ../../../alepha/src/security/interfaces/UserAccountToken.d.ts
1814
- /**
1815
- * Add contextual metadata to a user account info.
1816
- * E.g. UserAccountToken is a UserAccountInfo during a request.
1817
- */
1818
- interface UserAccountToken extends UserAccount {
1819
- /**
1820
- * Access token for the user.
1821
- */
1822
- token?: string;
1823
- /**
1824
- * Realm name of the user.
1825
- */
1826
- realm?: string;
1827
- /**
1828
- * Is user dedicated to his own resources for this scope ?
1829
- * Mostly, Admin is false and Customer is true.
1830
- */
1831
- ownership?: string | boolean;
1832
- }
1833
- //#endregion
1834
- //#region ../../../alepha/src/security/providers/SecurityProvider.d.ts
1835
- declare const envSchema$2: alepha1.TObject<{
1836
- APP_SECRET: alepha1.TString;
1837
- }>;
1838
- declare module "alepha" {
1839
- interface Env extends Partial<Static<typeof envSchema$2>> {}
1840
- }
1841
- //#endregion
1842
- //#region ../../../alepha/src/security/index.d.ts
1843
- declare module "alepha" {
1844
- interface Hooks {
1845
- "security:user:created": {
1846
- realm: string;
1847
- user: UserAccount;
1848
- };
1849
- }
1850
- }
1851
- /**
1852
- * Provides comprehensive authentication and authorization capabilities with JWT tokens, role-based access control, and user management.
1853
- *
1854
- * The security module enables building secure applications using primitives like `$realm`, `$role`, and `$permission`
1855
- * on class properties. It offers JWT-based authentication, fine-grained permissions, service accounts, and seamless
1856
- * integration with various authentication providers and user management systems.
1857
- *
1858
- * @see {@link $realm}
1859
- * @see {@link $role}
1860
- * @see {@link $permission}
1861
- * @module alepha.security
1862
- */
1863
- //#endregion
1864
- //#region ../../../alepha/src/server/security/providers/ServerBasicAuthProvider.d.ts
1865
- interface BasicAuthOptions {
1866
- username: string;
1867
- password: string;
1868
- }
1869
- //#endregion
1870
- //#region ../../../alepha/src/server/security/providers/ServerSecurityProvider.d.ts
1871
- type ServerRouteSecure = {
1872
- realm?: string;
1873
- basic?: BasicAuthOptions;
1874
- };
1875
- //#endregion
1876
- //#region ../../../alepha/src/server/security/index.d.ts
1877
- declare module "alepha" {
1878
- interface State {
1879
- /**
1880
- * Real (or fake) user account, used for internal actions.
1881
- *
1882
- * If you define this, you assume that all actions are executed by this user by default.
1883
- * > To force a different user, you need to pass it explicitly in the options.
1884
- */
1885
- "alepha.server.security.system.user"?: UserAccountToken;
1886
- /**
1887
- * The authenticated user account attached to the server request state.
1888
- *
1889
- * @internal
1890
- */
1891
- "alepha.server.request.user"?: UserAccount;
1892
- }
1893
- }
1894
- declare module "alepha/server" {
1895
- interface ServerRequest<TConfig> {
1896
- user?: UserAccountToken;
1897
- }
1898
- interface ServerActionRequest<TConfig> {
1899
- user: UserAccountToken;
1900
- }
1901
- interface ServerRoute {
1902
- /**
1903
- * If true, the route will be protected by the security provider.
1904
- * All actions are secure by default, but you can disable it for specific actions.
1905
- */
1906
- secure?: boolean | ServerRouteSecure;
1907
- }
1908
- interface ClientRequestOptions extends FetchOptions {
1909
- /**
1910
- * Forward user from the previous request.
1911
- * If "system", use system user. @see {ServerSecurityProvider.localSystemUser}
1912
- * If "context", use the user from the current context (e.g. request).
1913
- *
1914
- * @default "system" if provided, else "context" if available.
1915
- */
1916
- user?: UserAccountToken | "system" | "context";
1917
- }
1918
- }
1919
- /**
1920
- * Plugin for Alepha Server that provides security features. Based on the Alepha Security module.
1921
- *
1922
- * By default, all $action will be guarded by a permission check.
1923
- *
1924
- * @see {@link ServerSecurityProvider}
1925
- * @module alepha.server.security
1926
- */
1927
- //#endregion
1928
- //#region ../../../alepha/src/server/links/schemas/apiLinksResponseSchema.d.ts
1929
- declare const apiLinksResponseSchema: alepha1.TObject<{
1930
- prefix: alepha1.TOptional<alepha1.TString>;
1931
- links: alepha1.TArray<alepha1.TObject<{
1932
- name: alepha1.TString;
1933
- group: alepha1.TOptional<alepha1.TString>;
1934
- path: alepha1.TString;
1935
- method: alepha1.TOptional<alepha1.TString>;
1936
- requestBodyType: alepha1.TOptional<alepha1.TString>;
1937
- service: alepha1.TOptional<alepha1.TString>;
1938
- }>>;
1939
- }>;
1940
- type ApiLinksResponse = Static<typeof apiLinksResponseSchema>;
1941
- //#endregion
1942
- //#region ../../../alepha/src/server/links/index.d.ts
1943
- declare module "alepha" {
1944
- interface State {
1945
- /**
1946
- * API links attached to the server request state.
1947
- *
1948
- * @see {@link ApiLinksResponse}
1949
- * @internal
1950
- */
1951
- "alepha.server.request.apiLinks"?: ApiLinksResponse;
1952
- }
74
+ * @default false
75
+ */
76
+ sortable?: boolean;
1953
77
  }
1954
78
  /**
1955
- * Provides server-side link management and remote capabilities for client-server interactions.
79
+ * ControlArray component for editing arrays of schema items.
80
+ *
81
+ * Features:
82
+ * - Dynamic add/remove of items
83
+ * - Supports arrays of objects with nested fields
84
+ * - Supports arrays of primitives
85
+ * - Grid layout for object items
86
+ * - Min/max constraints
1956
87
  *
1957
- * The server-links module enables declarative link definitions using `$remote` and `$client` primitives,
1958
- * facilitating seamless API endpoint management and client-server communication. It integrates with server
1959
- * security features to ensure safe and controlled access to resources.
88
+ * @example
89
+ * ```tsx
90
+ * // For a schema like:
91
+ * // t.object({
92
+ * // contacts: t.array(t.object({
93
+ * // name: t.text(),
94
+ * // email: t.text({ format: "email" }),
95
+ * // }))
96
+ * // })
1960
97
  *
1961
- * @see {@link $remote}
1962
- * @see {@link $client}
1963
- * @module alepha.server.links
98
+ * <ControlArray
99
+ * input={form.input.contacts}
100
+ * columns={2}
101
+ * addLabel="Add contact"
102
+ * controlProps={{
103
+ * email: { text: { placeholder: "email@example.com" } }
104
+ * }}
105
+ * />
106
+ * ```
1964
107
  */
108
+ declare const ControlArray: (props: ControlArrayProps) => react_jsx_runtime11.JSX.Element | null;
1965
109
  //#endregion
1966
- //#region ../../../react/src/core/providers/ReactBrowserProvider.d.ts
1967
- declare const envSchema$1: alepha1.TObject<{
1968
- REACT_ROOT_ID: alepha1.TString;
1969
- }>;
1970
- declare module "alepha" {
1971
- interface Env extends Partial<Static<typeof envSchema$1>> {}
110
+ //#region ../../src/core/components/form/ControlNumber.d.ts
111
+ interface ControlNumberProps extends GenericControlProps {
112
+ numberInputProps?: Partial<NumberInputProps>;
113
+ sliderProps?: Partial<SliderProps>;
1972
114
  }
1973
115
  /**
1974
- * React browser renderer configuration atom
116
+ *
1975
117
  */
1976
- declare const reactBrowserOptions: alepha1.Atom<alepha1.TObject<{
1977
- scrollRestoration: alepha1.TUnsafe<"top" | "manual">;
1978
- }>, "alepha.react.browser.options">;
1979
- type ReactBrowserRendererOptions = Static<typeof reactBrowserOptions.schema>;
1980
- declare module "alepha" {
1981
- interface State {
1982
- [reactBrowserOptions.key]: ReactBrowserRendererOptions;
1983
- }
1984
- }
1985
- interface RouterGoOptions {
1986
- replace?: boolean;
1987
- match?: TransitionOptions;
1988
- params?: Record<string, string>;
1989
- query?: Record<string, string>;
1990
- meta?: Record<string, any>;
1991
- /**
1992
- * Recreate the whole page, ignoring the current state.
1993
- */
1994
- force?: boolean;
1995
- }
1996
- type ReactHydrationState = {
1997
- layers?: Array<PreviousLayerData>;
1998
- } & {
1999
- [key: string]: any;
2000
- };
118
+ declare const ControlNumber: (props: ControlNumberProps) => react_jsx_runtime11.JSX.Element | null;
2001
119
  //#endregion
2002
- //#region ../../../react/src/core/hooks/useAction.d.ts
2003
- interface UseActionReturn<Args extends any[], Result> {
2004
- /**
2005
- * Execute the action with the provided arguments.
2006
- *
2007
- * @example
2008
- * ```tsx
2009
- * const action = useAction({ handler: async (data) => { ... } }, []);
2010
- * action.run(data);
2011
- * ```
2012
- */
2013
- run: (...args: Args) => Promise<Result | undefined>;
120
+ //#region ../../src/core/components/form/ControlObject.d.ts
121
+ interface ControlObjectProps extends GenericControlProps {
2014
122
  /**
2015
- * Loading state - true when action is executing.
123
+ * Number of columns for the grid layout.
124
+ * @default 1
2016
125
  */
2017
- loading: boolean;
126
+ columns?: number;
2018
127
  /**
2019
- * Error state - contains error if action failed, undefined otherwise.
128
+ * Variant for the container.
129
+ * - "fieldset": Uses Mantine Fieldset with legend
130
+ * - "plain": No container, just renders fields
131
+ * @default "fieldset"
2020
132
  */
2021
- error?: Error;
133
+ variant?: "fieldset" | "plain";
2022
134
  /**
2023
- * Cancel any pending debounced action or abort the current in-flight request.
2024
- *
2025
- * @example
2026
- * ```tsx
2027
- * const action = useAction({ ... }, []);
2028
- *
2029
- * <button onClick={action.cancel} disabled={!action.loading}>
2030
- * Cancel
2031
- * </button>
2032
- * ```
135
+ * Per-field control props override.
136
+ * Keys are field names from the schema.
2033
137
  */
2034
- cancel: () => void;
2035
- }
2036
- //#endregion
2037
- //#region ../../../react/src/core/hooks/useActive.d.ts
2038
- interface UseActiveOptions {
2039
- href: string;
2040
- startWith?: boolean;
2041
- }
2042
- //#endregion
2043
- //#region ../../../react/src/head/interfaces/Head.d.ts
2044
- interface Head extends SimpleHead {
2045
- description?: string;
2046
- keywords?: string[];
2047
- author?: string;
2048
- robots?: string;
2049
- themeColor?: string;
2050
- viewport?: string | {
2051
- width?: string;
2052
- height?: string;
2053
- initialScale?: string;
2054
- maximumScale?: string;
2055
- userScalable?: "no" | "yes" | "0" | "1";
2056
- interactiveWidget?: "resizes-visual" | "resizes-content" | "overlays-content";
2057
- };
2058
- og?: {
2059
- title?: string;
2060
- description?: string;
2061
- image?: string;
2062
- url?: string;
2063
- type?: string;
2064
- };
2065
- twitter?: {
2066
- card?: string;
2067
- title?: string;
2068
- description?: string;
2069
- image?: string;
2070
- site?: string;
2071
- };
2072
- }
2073
- interface SimpleHead {
2074
- title?: string;
2075
- titleSeparator?: string;
2076
- htmlAttributes?: Record<string, string>;
2077
- bodyAttributes?: Record<string, string>;
2078
- meta?: Array<{
2079
- name: string;
2080
- content: string;
2081
- }>;
2082
- link?: Array<{
2083
- rel: string;
2084
- href: string;
2085
- }>;
2086
- }
2087
- //#endregion
2088
- //#region ../../../react/src/head/providers/HeadProvider.d.ts
2089
- declare class HeadProvider {
2090
- global?: Array<Head | (() => Head)>;
2091
- fillHead(state: ReactRouterState): void;
2092
- protected fillHeadByPage(page: PageRoute, state: ReactRouterState, props: Record<string, any>): void;
2093
- }
2094
- //#endregion
2095
- //#region ../../../react/src/head/primitives/$head.d.ts
2096
- type HeadPrimitiveOptions = Head | (() => Head);
2097
- declare class HeadPrimitive extends Primitive<HeadPrimitiveOptions> {
2098
- protected readonly provider: HeadProvider;
2099
- protected onInit(): void;
2100
- }
2101
- //#endregion
2102
- //#region ../../../react/src/head/index.d.ts
2103
- declare module "@alepha/react" {
2104
- interface PagePrimitiveOptions<TConfig extends PageConfigSchema = PageConfigSchema, TProps extends object = TPropsDefault, TPropsParent extends object = TPropsParentDefault> {
2105
- head?: Head | ((props: TProps, previous?: Head) => Head);
2106
- }
2107
- interface ReactRouterState {
2108
- head: Head;
2109
- }
138
+ controlProps?: Record<string, Partial<Omit<ControlProps, "input">>>;
2110
139
  }
2111
140
  /**
2112
- * Fill `<head>` server & client side.
141
+ * ControlObject component for editing nested object schemas.
142
+ *
143
+ * Features:
144
+ * - Renders all properties of an object schema
145
+ * - Supports grid layout with configurable columns
146
+ * - Per-field customization via controlProps
147
+ * - Recursive support for deeply nested objects
148
+ *
149
+ * The form system provides nested InputFields under the `.items` property.
150
+ * For example: form.input.address.items.street
151
+ *
152
+ * @example
153
+ * ```tsx
154
+ * // For a schema like:
155
+ * // t.object({
156
+ * // address: t.object({
157
+ * // street: t.text(),
158
+ * // city: t.text(),
159
+ * // zip: t.text(),
160
+ * // })
161
+ * // })
2113
162
  *
2114
- * @see {@link ServerHeadProvider}
2115
- * @module alepha.react.head
163
+ * <ControlObject
164
+ * input={form.input.address}
165
+ * columns={2}
166
+ * controlProps={{
167
+ * zip: { text: { maxLength: 10 } }
168
+ * }}
169
+ * />
170
+ * ```
2116
171
  */
172
+ declare const ControlObject: (props: ControlObjectProps) => react_jsx_runtime11.JSX.Element | null;
2117
173
  //#endregion
2118
- //#region ../../../react/src/core/providers/ReactServerProvider.d.ts
2119
- declare const envSchema: alepha1.TObject<{
2120
- REACT_SSR_ENABLED: alepha1.TOptional<alepha1.TBoolean>;
2121
- REACT_ROOT_ID: alepha1.TString;
2122
- }>;
2123
- declare module "alepha" {
2124
- interface Env extends Partial<Static<typeof envSchema>> {}
2125
- interface State {
2126
- "alepha.react.server.ssr"?: boolean;
2127
- "alepha.react.server.template"?: string;
2128
- }
174
+ //#region ../../src/core/components/form/ControlSelect.d.ts
175
+ type SelectValueLabel = string | {
176
+ value: string;
177
+ label: string;
178
+ icon?: string;
179
+ };
180
+ interface ControlSelectProps extends GenericControlProps {
181
+ select?: boolean | SelectProps;
182
+ multi?: boolean | MultiSelectProps;
183
+ tags?: boolean | TagsInputProps;
184
+ autocomplete?: boolean | AutocompleteProps;
185
+ segmented?: boolean | Partial<SegmentedControlProps>;
186
+ loader?: () => Promise<SelectValueLabel[]>;
2129
187
  }
2130
188
  /**
2131
- * React server provider configuration atom
189
+ * ControlSelect component for handling Select, MultiSelect, and TagsInput.
190
+ *
191
+ * Features:
192
+ * - Basic Select with enum support
193
+ * - MultiSelect for array of enums
194
+ * - TagsInput for array of strings (no enum)
195
+ * - Future: Lazy loading
196
+ * - Future: Searchable/filterable options
197
+ * - Future: Custom option rendering
198
+ *
199
+ * Automatically detects enum values and array types from schema.
2132
200
  */
2133
- declare const reactServerOptions: alepha1.Atom<alepha1.TObject<{
2134
- publicDir: alepha1.TString;
2135
- staticServer: alepha1.TObject<{
2136
- disabled: alepha1.TBoolean;
2137
- path: alepha1.TString;
2138
- }>;
2139
- }>, "alepha.react.server.options">;
2140
- type ReactServerProviderOptions = Static<typeof reactServerOptions.schema>;
2141
- declare module "alepha" {
2142
- interface State {
2143
- [reactServerOptions.key]: ReactServerProviderOptions;
2144
- }
2145
- }
201
+ declare const ControlSelect: (props: ControlSelectProps) => react_jsx_runtime11.JSX.Element | null;
2146
202
  //#endregion
2147
- //#region ../../../react/src/core/index.d.ts
2148
- declare module "alepha" {
2149
- interface State {
2150
- "alepha.react.router.state"?: ReactRouterState;
2151
- }
2152
- interface Hooks {
2153
- /**
2154
- * Fires when the React application is starting to be rendered on the server.
2155
- */
2156
- "react:server:render:begin": {
2157
- request?: ServerRequest;
2158
- state: ReactRouterState;
2159
- };
2160
- /**
2161
- * Fires when the React application has been rendered on the server.
2162
- */
2163
- "react:server:render:end": {
2164
- request?: ServerRequest;
2165
- state: ReactRouterState;
2166
- html: string;
2167
- };
2168
- /**
2169
- * Fires when the React application is being rendered on the browser.
2170
- */
2171
- "react:browser:render": {
2172
- root: HTMLElement;
2173
- element: ReactNode;
2174
- state: ReactRouterState;
2175
- hydration?: ReactHydrationState;
2176
- };
2177
- /**
2178
- * Fires when a user action is starting.
2179
- * Action can be a form submission, a route transition, or a custom action.
2180
- */
2181
- "react:action:begin": {
2182
- type: string;
2183
- id?: string;
2184
- };
2185
- /**
2186
- * Fires when a user action has succeeded.
2187
- * Action can be a form submission, a route transition, or a custom action.
2188
- */
2189
- "react:action:success": {
2190
- type: string;
2191
- id?: string;
2192
- };
2193
- /**
2194
- * Fires when a user action has failed.
2195
- * Action can be a form submission, a route transition, or a custom action.
2196
- */
2197
- "react:action:error": {
2198
- type: string;
2199
- id?: string;
2200
- error: Error;
2201
- };
2202
- /**
2203
- * Fires when a user action has completed, regardless of success or failure.
2204
- * Action can be a form submission, a route transition, or a custom action.
2205
- */
2206
- "react:action:end": {
2207
- type: string;
2208
- id?: string;
2209
- };
2210
- /**
2211
- * Fires when a route transition is starting.
2212
- */
2213
- "react:transition:begin": {
2214
- previous: ReactRouterState;
2215
- state: ReactRouterState;
2216
- animation?: PageAnimation;
2217
- };
2218
- /**
2219
- * Fires when a route transition has succeeded.
2220
- */
2221
- "react:transition:success": {
2222
- state: ReactRouterState;
2223
- };
2224
- /**
2225
- * Fires when a route transition has failed.
2226
- */
2227
- "react:transition:error": {
2228
- state: ReactRouterState;
2229
- error: Error;
2230
- };
2231
- /**
2232
- * Fires when a route transition has completed, regardless of success or failure.
2233
- */
2234
- "react:transition:end": {
2235
- state: ReactRouterState;
2236
- };
2237
- }
203
+ //#region ../../src/core/components/form/Control.d.ts
204
+ interface ControlProps extends GenericControlProps {
205
+ text?: TextInputProps;
206
+ area?: boolean | TextareaProps;
207
+ select?: boolean | Partial<ControlSelectProps>;
208
+ password?: boolean | PasswordInputProps;
209
+ switch?: boolean | SwitchProps;
210
+ number?: boolean | Partial<ControlNumberProps>;
211
+ file?: boolean | FileInputProps;
212
+ color?: boolean | ColorInputProps;
213
+ date?: boolean | DateInputProps;
214
+ datetime?: boolean | DateTimePickerProps;
215
+ time?: boolean | TimeInputProps;
216
+ query?: any;
217
+ object?: boolean | Partial<Omit<ControlObjectProps, "input">>;
218
+ array?: boolean | Partial<Omit<ControlArrayProps, "input">>;
219
+ custom?: ComponentType<CustomControlProps>;
2238
220
  }
2239
221
  /**
2240
- * Provides full-stack React development with declarative routing, server-side rendering, and client-side hydration.
222
+ * Generic form control that renders the appropriate input based on the schema and props.
2241
223
  *
2242
- * The React module enables building modern React applications using the `$page` primitive on class properties.
2243
- * It delivers seamless server-side rendering, automatic code splitting, and client-side navigation with full
2244
- * type safety and schema validation for route parameters and data.
224
+ * Supports:
225
+ * - TextInput (with format detection: email, url, tel)
226
+ * - Textarea
227
+ * - NumberInput (for number/integer types)
228
+ * - FileInput
229
+ * - ColorInput (for color format)
230
+ * - Select (for enum types)
231
+ * - Autocomplete
232
+ * - PasswordInput
233
+ * - Switch (for boolean types)
234
+ * - SegmentedControl (for enum types)
235
+ * - DateInput (for date format)
236
+ * - DateTimePicker (for date-time format)
237
+ * - TimeInput (for time format)
238
+ * - QueryBuilder (for building type-safe queries with autocomplete)
239
+ * - ControlObject (for nested object schemas)
240
+ * - ControlArray (for arrays of objects)
241
+ * - Custom component
2245
242
  *
2246
- * @see {@link $page}
2247
- * @module alepha.react
243
+ * Automatically handles labels, descriptions, error messages, required state, and default icons.
2248
244
  */
245
+ declare const Control: (_props: ControlProps) => react_jsx_runtime11.JSX.Element | null;
246
+ type CustomControlProps = {
247
+ defaultValue: any;
248
+ onChange: (value: any) => void;
249
+ };
250
+ //#endregion
251
+ //#region ../../src/core/atoms/alephaThemeListAtom.d.ts
252
+ declare const alephaThemeListAtom: alepha1.Atom<alepha1.TArray<alepha1.TRecord<string, alepha1.TAny>>, "alepha.ui.themeList">;
253
+ //#endregion
254
+ //#region ../../src/core/interfaces/AlephaTheme.d.ts
255
+ type AlephaTheme = MantineThemeOverride & {
256
+ name: string;
257
+ description: string;
258
+ defaultColorScheme?: "light" | "dark";
259
+ };
260
+ //#endregion
261
+ //#region ../../src/core/atoms/themes/default.d.ts
262
+ declare const defaultTheme: AlephaTheme;
263
+ //#endregion
264
+ //#region ../../src/core/atoms/themes/midnight.d.ts
265
+ declare const midnightTheme: AlephaTheme;
2249
266
  //#endregion
2250
267
  //#region ../../src/core/components/buttons/ActionButton.d.ts
2251
268
  interface ActionMenuItem {
@@ -2340,7 +357,7 @@ interface ActionCommonProps extends ButtonProps {
2340
357
  intent?: "primary" | "success" | "danger" | "warning" | "info" | "none";
2341
358
  }
2342
359
  type ActionProps = ActionCommonProps & (ActionNavigationButtonProps | ActionClickButtonProps | ActionSubmitButtonProps | ActionHookButtonProps | {});
2343
- declare const ActionButton: (_props: ActionProps) => react_jsx_runtime5.JSX.Element;
360
+ declare const ActionButton: (_props: ActionProps) => react_jsx_runtime11.JSX.Element;
2344
361
  interface ActionSubmitButtonProps extends ButtonProps {
2345
362
  form: FormModel<any>;
2346
363
  type?: "submit" | "reset";
@@ -2363,7 +380,7 @@ interface ActionNavigationButtonProps extends ButtonProps {
2363
380
  //#endregion
2364
381
  //#region ../../src/core/components/buttons/BurgerButton.d.ts
2365
382
  interface BurgerButtonProps extends BurgerProps {}
2366
- declare const BurgerButton: (props: BurgerButtonProps) => react_jsx_runtime5.JSX.Element;
383
+ declare const BurgerButton: (props: BurgerButtonProps) => react_jsx_runtime11.JSX.Element;
2367
384
  //#endregion
2368
385
  //#region ../../src/core/components/buttons/ClipboardButton.d.ts
2369
386
  interface ClipboardButtonProps extends Omit<ActionCommonProps, "onClick" | "icon"> {
@@ -2384,7 +401,7 @@ interface ClipboardButtonProps extends Omit<ActionCommonProps, "onClick" | "icon
2384
401
  */
2385
402
  copiedLabel?: string;
2386
403
  }
2387
- declare const ClipboardButton: (props: ClipboardButtonProps) => react_jsx_runtime5.JSX.Element;
404
+ declare const ClipboardButton: (props: ClipboardButtonProps) => react_jsx_runtime11.JSX.Element;
2388
405
  //#endregion
2389
406
  //#region ../../src/core/components/buttons/DarkModeButton.d.ts
2390
407
  interface DarkModeButtonProps {
@@ -2395,27 +412,27 @@ interface DarkModeButtonProps {
2395
412
  segmentedProps?: Partial<SegmentedControlProps>;
2396
413
  actionProps?: Partial<ActionProps>;
2397
414
  }
2398
- declare const DarkModeButton: (props: DarkModeButtonProps) => react_jsx_runtime5.JSX.Element;
415
+ declare const DarkModeButton: (props: DarkModeButtonProps) => react_jsx_runtime11.JSX.Element;
2399
416
  //#endregion
2400
417
  //#region ../../src/core/components/buttons/LanguageButton.d.ts
2401
418
  interface LanguageButtonProps {
2402
419
  languages?: string[];
2403
420
  actionProps?: ActionProps;
2404
421
  }
2405
- declare const LanguageButton: (props: LanguageButtonProps) => react_jsx_runtime5.JSX.Element;
422
+ declare const LanguageButton: (props: LanguageButtonProps) => react_jsx_runtime11.JSX.Element;
2406
423
  //#endregion
2407
424
  //#region ../../src/core/components/buttons/OmnibarButton.d.ts
2408
425
  interface OmnibarButtonProps {
2409
426
  actionProps?: ActionProps;
2410
427
  collapsed?: boolean;
2411
428
  }
2412
- declare const OmnibarButton: (props: OmnibarButtonProps) => react_jsx_runtime5.JSX.Element;
429
+ declare const OmnibarButton: (props: OmnibarButtonProps) => react_jsx_runtime11.JSX.Element;
2413
430
  //#endregion
2414
431
  //#region ../../src/core/components/buttons/ThemeButton.d.ts
2415
432
  interface ThemeButtonProps {
2416
433
  actionProps?: Partial<ActionProps>;
2417
434
  }
2418
- declare const ThemeButton: (props: ThemeButtonProps) => react_jsx_runtime5.JSX.Element;
435
+ declare const ThemeButton: (props: ThemeButtonProps) => react_jsx_runtime11.JSX.Element;
2419
436
  //#endregion
2420
437
  //#region ../../src/core/components/data/JsonViewer.d.ts
2421
438
  interface JsonViewerProps {
@@ -2431,7 +448,7 @@ declare const JsonViewer: ({
2431
448
  maxDepth,
2432
449
  copyable,
2433
450
  size
2434
- }: JsonViewerProps) => react_jsx_runtime5.JSX.Element;
451
+ }: JsonViewerProps) => react_jsx_runtime11.JSX.Element;
2435
452
  //#endregion
2436
453
  //#region ../../src/core/services/DialogService.d.ts
2437
454
  interface BaseDialogOptions extends Partial<ModalProps> {
@@ -2522,19 +539,19 @@ declare class DialogService {
2522
539
  declare const AlertDialog: ({
2523
540
  options,
2524
541
  onClose
2525
- }: AlertDialogProps) => react_jsx_runtime5.JSX.Element;
542
+ }: AlertDialogProps) => react_jsx_runtime11.JSX.Element;
2526
543
  //#endregion
2527
544
  //#region ../../src/core/components/dialogs/ConfirmDialog.d.ts
2528
545
  declare const ConfirmDialog: ({
2529
546
  options,
2530
547
  onConfirm
2531
- }: ConfirmDialogProps) => react_jsx_runtime5.JSX.Element;
548
+ }: ConfirmDialogProps) => react_jsx_runtime11.JSX.Element;
2532
549
  //#endregion
2533
550
  //#region ../../src/core/components/dialogs/PromptDialog.d.ts
2534
551
  declare const PromptDialog: ({
2535
552
  options,
2536
553
  onSubmit
2537
- }: PromptDialogProps) => react_jsx_runtime5.JSX.Element;
554
+ }: PromptDialogProps) => react_jsx_runtime11.JSX.Element;
2538
555
  //#endregion
2539
556
  //#region ../../src/core/components/form/ControlDate.d.ts
2540
557
  interface ControlDateProps extends GenericControlProps {
@@ -2552,7 +569,7 @@ interface ControlDateProps extends GenericControlProps {
2552
569
  *
2553
570
  * Automatically detects date formats from schema and renders appropriate picker.
2554
571
  */
2555
- declare const ControlDate: (props: ControlDateProps) => react_jsx_runtime5.JSX.Element | null;
572
+ declare const ControlDate: (props: ControlDateProps) => react_jsx_runtime11.JSX.Element | null;
2556
573
  //#endregion
2557
574
  //#region ../../src/core/components/form/ControlQueryBuilder.d.ts
2558
575
  interface ControlQueryBuilderProps extends Omit<TextInputProps, "value" | "onChange"> {
@@ -2571,11 +588,11 @@ declare const ControlQueryBuilder: ({
2571
588
  onChange,
2572
589
  placeholder,
2573
590
  ...textInputProps
2574
- }: ControlQueryBuilderProps) => react_jsx_runtime5.JSX.Element;
591
+ }: ControlQueryBuilderProps) => react_jsx_runtime11.JSX.Element;
2575
592
  //#endregion
2576
593
  //#region ../../src/core/components/form/TypeForm.d.ts
2577
- interface TypeFormProps<T$1 extends TObject> {
2578
- form: FormModel<T$1>;
594
+ interface TypeFormProps<T extends TObject> {
595
+ form: FormModel<T>;
2579
596
  columns?: number | {
2580
597
  base?: number;
2581
598
  xs?: number;
@@ -2585,7 +602,7 @@ interface TypeFormProps<T$1 extends TObject> {
2585
602
  xl?: number;
2586
603
  };
2587
604
  schema?: TObject;
2588
- children?: (input: FormModel<T$1>["input"]) => ReactNode;
605
+ children?: (input: FormModel<T>["input"]) => ReactNode;
2589
606
  /**
2590
607
  * Control props applied to all fields.
2591
608
  */
@@ -2643,7 +660,7 @@ interface TypeFormProps<T$1 extends TObject> {
2643
660
  * return <TypeForm form={form} columns={2} />;
2644
661
  * ```
2645
662
  */
2646
- declare const TypeForm: <T$1 extends TObject>(props: TypeFormProps<T$1>) => react_jsx_runtime5.JSX.Element | null;
663
+ declare const TypeForm: <T extends TObject>(props: TypeFormProps<T>) => react_jsx_runtime11.JSX.Element | null;
2647
664
  //#endregion
2648
665
  //#region ../../src/core/components/layout/AppBar.d.ts
2649
666
  type AppBarItem = AppBarElement | AppBarBurger | AppBarDark | AppBarSearch | AppBarLang | AppBarSpacer | AppBarDivider;
@@ -2682,7 +699,7 @@ interface AppBarProps {
2682
699
  flexProps?: FlexProps;
2683
700
  items?: AppBarItem[];
2684
701
  }
2685
- declare const AppBar: (props: AppBarProps) => react_jsx_runtime5.JSX.Element;
702
+ declare const AppBar: (props: AppBarProps) => react_jsx_runtime11.JSX.Element;
2686
703
  //#endregion
2687
704
  //#region ../../src/core/components/layout/Sidebar.d.ts
2688
705
  interface SidebarProps {
@@ -2705,7 +722,7 @@ interface SidebarProps {
2705
722
  startsWith: string;
2706
723
  };
2707
724
  }
2708
- declare const Sidebar: (props: SidebarProps) => react_jsx_runtime5.JSX.Element;
725
+ declare const Sidebar: (props: SidebarProps) => react_jsx_runtime11.JSX.Element;
2709
726
  interface SidebarItemProps {
2710
727
  item: SidebarMenuItem;
2711
728
  level: number;
@@ -2796,7 +813,7 @@ declare module "alepha" {
2796
813
  "alepha.ui.sidebar.collapsed"?: boolean;
2797
814
  }
2798
815
  }
2799
- declare const AdminShell: (props: AdminShellProps) => react_jsx_runtime5.JSX.Element;
816
+ declare const AdminShell: (props: AdminShellProps) => react_jsx_runtime11.JSX.Element;
2800
817
  //#endregion
2801
818
  //#region ../../src/core/components/layout/Omnibar.d.ts
2802
819
  interface OmnibarProps {
@@ -2804,7 +821,7 @@ interface OmnibarProps {
2804
821
  searchPlaceholder?: string;
2805
822
  nothingFound?: ReactNode;
2806
823
  }
2807
- declare const Omnibar: (props: OmnibarProps) => react_jsx_runtime5.JSX.Element;
824
+ declare const Omnibar: (props: OmnibarProps) => react_jsx_runtime11.JSX.Element;
2808
825
  //#endregion
2809
826
  //#region ../../src/core/components/layout/AlephaMantineProvider.d.ts
2810
827
  interface AlephaMantineProviderProps {
@@ -2816,7 +833,7 @@ interface AlephaMantineProviderProps {
2816
833
  modals?: ModalsProviderProps;
2817
834
  omnibar?: OmnibarProps | false;
2818
835
  }
2819
- declare const AlephaMantineProvider: (props: AlephaMantineProviderProps) => react_jsx_runtime5.JSX.Element;
836
+ declare const AlephaMantineProvider: (props: AlephaMantineProviderProps) => react_jsx_runtime11.JSX.Element;
2820
837
  //#endregion
2821
838
  //#region ../../src/core/components/table/types.d.ts
2822
839
  interface ColumnVisibility {
@@ -2830,9 +847,9 @@ interface DataTableColumnContext<Filters extends TObject> {
2830
847
  form: FormModel<Filters>;
2831
848
  alepha: Alepha;
2832
849
  }
2833
- interface DataTableColumn<T$1 extends object, Filters extends TObject> {
850
+ interface DataTableColumn<T extends object, Filters extends TObject> {
2834
851
  label: string;
2835
- value: (item: T$1, ctx: DataTableColumnContext<Filters>) => ReactNode;
852
+ value: (item: T, ctx: DataTableColumnContext<Filters>) => ReactNode;
2836
853
  fit?: boolean;
2837
854
  /**
2838
855
  * Enable sorting for this column. When true, clicking the header will sort by this column.
@@ -2844,36 +861,36 @@ interface DataTableColumn<T$1 extends object, Filters extends TObject> {
2844
861
  */
2845
862
  sortKey?: string;
2846
863
  }
2847
- type MaybePage<T$1> = Omit<Page<T$1>, "page"> & {
864
+ type MaybePage<T> = Omit<Page<T>, "page"> & {
2848
865
  page?: Partial<PageMetadata>;
2849
866
  };
2850
- interface DataTableSubmitContext<T$1 extends object> {
2851
- items: T$1[];
867
+ interface DataTableSubmitContext<T extends object> {
868
+ items: T[];
2852
869
  }
2853
- interface CheckboxActionContext<T$1 extends object> {
2854
- selectedItems: T$1[];
870
+ interface CheckboxActionContext<T extends object> {
871
+ selectedItems: T[];
2855
872
  clearSelection: () => void;
2856
873
  }
2857
- interface CheckboxAction<T$1 extends object> {
874
+ interface CheckboxAction<T extends object> {
2858
875
  label: ReactNode;
2859
876
  icon?: ReactNode;
2860
877
  intent?: "primary" | "success" | "danger" | "warning" | "info" | "none";
2861
- onClick: (ctx: CheckboxActionContext<T$1>) => void | Promise<void>;
878
+ onClick: (ctx: CheckboxActionContext<T>) => void | Promise<void>;
2862
879
  }
2863
- interface DataTableProps<T$1 extends object, Filters extends TObject> {
880
+ interface DataTableProps<T extends object, Filters extends TObject> {
2864
881
  /**
2865
882
  * The items to display in the table. Can be a static page of items or a function that returns a promise resolving to a page of items.
2866
883
  */
2867
- items: MaybePage<T$1> | ((filters: Static<Filters> & {
884
+ items: MaybePage<T> | ((filters: Static<Filters> & {
2868
885
  page: number;
2869
886
  size: number;
2870
887
  sort?: string;
2871
- }, ctx: DataTableSubmitContext<T$1>) => Async<MaybePage<T$1>>);
888
+ }, ctx: DataTableSubmitContext<T>) => Async<MaybePage<T>>);
2872
889
  /**
2873
890
  * The columns to display in the table. Each column is defined by a key and a DataTableColumn object.
2874
891
  */
2875
892
  columns: {
2876
- [key: string]: DataTableColumn<T$1, Filters>;
893
+ [key: string]: DataTableColumn<T, Filters>;
2877
894
  };
2878
895
  defaultSize?: number;
2879
896
  typeFormProps?: Partial<Omit<TypeFormProps<Filters>, "form">>;
@@ -2882,8 +899,8 @@ interface DataTableProps<T$1 extends object, Filters extends TObject> {
2882
899
  * Optional filters to apply to the data.
2883
900
  */
2884
901
  filters?: TObject;
2885
- panel?: (item: T$1) => ReactNode;
2886
- canPanel?: (item: T$1) => boolean;
902
+ panel?: (item: T) => ReactNode;
903
+ canPanel?: (item: T) => boolean;
2887
904
  submitOnInit?: boolean;
2888
905
  submitEvery?: DurationLike;
2889
906
  withLineNumbers?: boolean;
@@ -2895,11 +912,11 @@ interface DataTableProps<T$1 extends object, Filters extends TObject> {
2895
912
  * Function to get a unique key for each item. Required when withCheckbox is true.
2896
913
  * Used to track selected items across pagination.
2897
914
  */
2898
- getItemKey?: (item: T$1) => string;
915
+ getItemKey?: (item: T) => string;
2899
916
  /**
2900
917
  * Actions to display when items are selected. Each action receives the selected items.
2901
918
  */
2902
- checkboxActions?: Array<CheckboxAction<T$1>>;
919
+ checkboxActions?: Array<CheckboxAction<T>>;
2903
920
  actions?: Array<ActionProps & {
2904
921
  label?: ReactNode;
2905
922
  }>;
@@ -2934,11 +951,11 @@ interface DataTableProps<T$1 extends object, Filters extends TObject> {
2934
951
  /**
2935
952
  * Function to generate props for each table row based on the item.
2936
953
  */
2937
- tableTrProps?: (item: T$1) => TableTrProps;
954
+ tableTrProps?: (item: T) => TableTrProps;
2938
955
  }
2939
956
  //#endregion
2940
957
  //#region ../../src/core/components/table/DataTable.d.ts
2941
- declare const DataTable: <T$1 extends object, Filters extends TObject>(props: DataTableProps<T$1, Filters>) => react_jsx_runtime5.JSX.Element;
958
+ declare const DataTable: <T extends object, Filters extends TObject>(props: DataTableProps<T, Filters>) => react_jsx_runtime11.JSX.Element;
2942
959
  //#endregion
2943
960
  //#region ../../src/core/constants/ui.d.ts
2944
961
  declare const ui: {
@@ -3008,83 +1025,13 @@ declare class ToastService {
3008
1025
  */
3009
1026
  declare const useToast: () => ToastService;
3010
1027
  //#endregion
3011
- //#region ../../../alepha/src/server/cookies/primitives/$cookie.d.ts
3012
- interface CookiePrimitiveOptions<T$1 extends TSchema> {
3013
- /** The schema for the cookie's value, used for validation and type safety. */
3014
- schema: T$1;
3015
- /** The name of the cookie. */
3016
- name?: string;
3017
- /** The cookie's path. Defaults to "/". */
3018
- path?: string;
3019
- /** Time-to-live for the cookie. Maps to `Max-Age`. */
3020
- ttl?: DurationLike;
3021
- /** If true, the cookie is only sent over HTTPS. Defaults to true in production. */
3022
- secure?: boolean;
3023
- /** If true, the cookie cannot be accessed by client-side scripts. */
3024
- httpOnly?: boolean;
3025
- /** SameSite policy for the cookie. Defaults to "lax". */
3026
- sameSite?: "strict" | "lax" | "none";
3027
- /** The domain for the cookie. */
3028
- domain?: string;
3029
- /** If true, the cookie value will be compressed using zlib. */
3030
- compress?: boolean;
3031
- /** If true, the cookie value will be encrypted. Requires `COOKIE_SECRET` env var. */
3032
- encrypt?: boolean;
3033
- /** If true, the cookie will be signed to prevent tampering. Requires `COOKIE_SECRET` env var. */
3034
- sign?: boolean;
3035
- }
3036
- interface AbstractCookiePrimitive<T$1 extends TSchema> {
3037
- readonly name: string;
3038
- readonly options: CookiePrimitiveOptions<T$1>;
3039
- set(value: Static<T$1>, options?: {
3040
- cookies?: Cookies;
3041
- ttl?: DurationLike;
3042
- }): void;
3043
- get(options?: {
3044
- cookies?: Cookies;
3045
- }): Static<T$1> | undefined;
3046
- del(options?: {
3047
- cookies?: Cookies;
3048
- }): void;
3049
- }
3050
- interface Cookies {
3051
- req: Record<string, string>;
3052
- res: Record<string, Cookie | null>;
3053
- }
3054
- interface Cookie {
3055
- value: string;
3056
- path?: string;
3057
- maxAge?: number;
3058
- secure?: boolean;
3059
- httpOnly?: boolean;
3060
- sameSite?: "strict" | "lax" | "none";
3061
- domain?: string;
3062
- }
3063
- //#endregion
3064
- //#region ../../../alepha/src/server/cookies/index.d.ts
3065
- declare module "alepha/server" {
3066
- interface ServerRequest {
3067
- cookies: Cookies;
3068
- }
3069
- }
3070
- /**
3071
- * Provides HTTP cookie management capabilities for server requests and responses with type-safe cookie primitives.
3072
- *
3073
- * The server-cookies module enables declarative cookie handling using the `$cookie` primitive on class properties.
3074
- * It offers automatic cookie parsing, secure cookie configuration, and seamless integration with server routes
3075
- * for managing user sessions, preferences, and authentication tokens.
3076
- *
3077
- * @see {@link $cookie}
3078
- * @module alepha.server.cookies
3079
- */
3080
- //#endregion
3081
1028
  //#region ../../src/core/providers/ThemeProvider.d.ts
3082
1029
  declare class ThemeProvider {
3083
1030
  protected readonly alepha: Alepha;
3084
- protected readonly cookie: AbstractCookiePrimitive<alepha1.TObject<{
1031
+ protected readonly cookie: alepha_server_cookies0.AbstractCookiePrimitive<alepha1.TObject<{
3085
1032
  index: alepha1.TInteger;
3086
1033
  }>>;
3087
- protected readonly head: HeadPrimitive;
1034
+ protected readonly head: _alepha_react_head0.HeadPrimitive;
3088
1035
  setTheme(index: number): void;
3089
1036
  getTheme(): AlephaTheme;
3090
1037
  protected getThemeIndex(): number;
@@ -3092,7 +1039,7 @@ declare class ThemeProvider {
3092
1039
  //#endregion
3093
1040
  //#region ../../src/core/RootRouter.d.ts
3094
1041
  declare class RootRouter {
3095
- readonly root: PagePrimitive<PageConfigSchema, any, TPropsParentDefault>;
1042
+ readonly root: _alepha_react0.PagePrimitive<_alepha_react0.PageConfigSchema, any, _alepha_react0.TPropsParentDefault>;
3096
1043
  }
3097
1044
  //#endregion
3098
1045
  //#region ../../src/core/utils/extractSchemaFields.d.ts