alepha 0.11.5 → 0.11.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +15 -100
- package/api/files.d.ts +168 -169
- package/api/jobs.d.ts +263 -154
- package/api/notifications.d.ts +28 -29
- package/api/users.d.ts +476 -477
- package/batch.d.ts +59 -493
- package/bucket.d.ts +20 -11
- package/cache/redis.d.ts +1 -1
- package/cache.d.ts +1 -1
- package/command.d.ts +24 -7
- package/core.d.ts +299 -222
- package/datetime.d.ts +4 -29
- package/devtools.d.ts +166 -284
- package/email.d.ts +45 -2
- package/fake.d.ts +1 -1
- package/file.d.ts +1 -1
- package/lock/redis.d.ts +1 -1
- package/lock.d.ts +1 -1
- package/logger.d.ts +11 -9
- package/package.json +51 -51
- package/postgres.d.ts +480 -198
- package/queue/redis.d.ts +1 -1
- package/queue.d.ts +1 -1
- package/react/auth.d.ts +7 -2
- package/react/form.d.ts +39 -16
- package/react/head.d.ts +1 -1
- package/react/i18n.d.ts +2 -2
- package/react.d.ts +66 -41
- package/redis.d.ts +1 -1
- package/retry.d.ts +84 -21
- package/scheduler.d.ts +1 -1
- package/security.d.ts +29 -29
- package/server/cache.d.ts +1 -1
- package/server/compress.d.ts +9 -3
- package/server/cookies.d.ts +1 -1
- package/server/cors.d.ts +28 -10
- package/server/health.d.ts +18 -19
- package/server/helmet.d.ts +44 -15
- package/server/links.d.ts +37 -31
- package/server/metrics.d.ts +1 -1
- package/server/multipart.d.ts +1 -1
- package/server/proxy.d.ts +1 -1
- package/server/security.d.ts +8 -3
- package/server/static.d.ts +1 -1
- package/server/swagger.d.ts +19 -6
- package/server.d.ts +1 -1
- package/topic/redis.d.ts +1 -1
- package/topic.d.ts +1 -1
- package/ui.d.ts +142 -12
- package/vite.d.ts +2 -2
package/ui.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import * as _alepha_core0 from "alepha";
|
|
2
|
-
import { Async, TObject } from "alepha";
|
|
2
|
+
import { Alepha, Async, Page, PageMetadata, Static, TObject, TProperties } from "alepha";
|
|
3
3
|
import { FormModel, InputField } from "alepha/react/form";
|
|
4
4
|
import * as _alepha_react0 from "alepha/react";
|
|
5
5
|
import { RouterGoOptions, UseActionReturn, UseActiveOptions } from "alepha/react";
|
|
6
|
+
import { AppShellFooterProps, AppShellHeaderProps, AppShellMainProps, AppShellNavbarProps, AppShellProps, AutocompleteProps, ButtonProps, ColorInputProps, ColorSchemeScriptProps, FileInputProps, Flex, FlexProps, MantineBreakpoint, MantineProviderProps, MantineSize, MenuProps, MenuTargetProps, ModalProps, MultiSelectProps, NumberInputProps, PasswordInputProps, SegmentedControlProps, SelectProps, SliderProps, SwitchProps, TableProps, TableTrProps, TagsInputProps, Text, TextInputProps, TextareaProps, ThemeIconProps, TooltipProps } from "@mantine/core";
|
|
6
7
|
import { ModalsProviderProps } from "@mantine/modals";
|
|
7
|
-
import { AppShellFooterProps, AppShellHeaderProps, AppShellMainProps, AppShellNavbarProps, AppShellProps, AutocompleteProps, ButtonProps, ColorInputProps, ColorSchemeScriptProps, FileInputProps, Flex, FlexProps, MantineBreakpoint, MantineProviderProps, MenuProps, MenuTargetProps, ModalProps, MultiSelectProps, NumberInputProps, PasswordInputProps, SegmentedControlProps, SelectProps, SwitchProps, TableProps, TableTrProps, TagsInputProps, Text, TextInputProps, TextareaProps, ThemeIconProps, TooltipProps } from "@mantine/core";
|
|
8
|
-
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
9
8
|
import { ComponentType, ReactNode } from "react";
|
|
9
|
+
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
10
10
|
import * as _mantine_notifications0 from "@mantine/notifications";
|
|
11
11
|
import { NotificationData, NotificationsProps } from "@mantine/notifications";
|
|
12
12
|
import { DateInputProps, DateTimePickerProps, TimeInputProps } from "@mantine/dates";
|
|
13
13
|
import { NavigationProgressProps } from "@mantine/nprogress";
|
|
14
|
+
import { DurationLike } from "alepha/datetime";
|
|
14
15
|
|
|
15
16
|
//#region src/utils/parseInput.d.ts
|
|
16
17
|
interface GenericControlProps {
|
|
@@ -20,6 +21,12 @@ interface GenericControlProps {
|
|
|
20
21
|
icon?: ReactNode;
|
|
21
22
|
}
|
|
22
23
|
//#endregion
|
|
24
|
+
//#region src/components/form/ControlNumber.d.ts
|
|
25
|
+
interface ControlNumberProps extends GenericControlProps {
|
|
26
|
+
numberInputProps?: Partial<NumberInputProps>;
|
|
27
|
+
sliderProps?: Partial<SliderProps>;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
23
30
|
//#region src/components/form/ControlSelect.d.ts
|
|
24
31
|
type SelectValueLabel = string | {
|
|
25
32
|
value: string;
|
|
@@ -56,12 +63,13 @@ interface ControlProps extends GenericControlProps {
|
|
|
56
63
|
select?: boolean | Partial<ControlSelectProps>;
|
|
57
64
|
password?: boolean | PasswordInputProps;
|
|
58
65
|
switch?: boolean | SwitchProps;
|
|
59
|
-
number?: boolean |
|
|
66
|
+
number?: boolean | Partial<ControlNumberProps>;
|
|
60
67
|
file?: boolean | FileInputProps;
|
|
61
68
|
color?: boolean | ColorInputProps;
|
|
62
69
|
date?: boolean | DateInputProps;
|
|
63
70
|
datetime?: boolean | DateTimePickerProps;
|
|
64
71
|
time?: boolean | TimeInputProps;
|
|
72
|
+
query?: any;
|
|
65
73
|
custom?: ComponentType<CustomControlProps>;
|
|
66
74
|
}
|
|
67
75
|
/**
|
|
@@ -81,6 +89,7 @@ interface ControlProps extends GenericControlProps {
|
|
|
81
89
|
* - DateInput (for date format)
|
|
82
90
|
* - DateTimePicker (for date-time format)
|
|
83
91
|
* - TimeInput (for time format)
|
|
92
|
+
* - QueryBuilder (for building type-safe queries with autocomplete)
|
|
84
93
|
* - Custom component
|
|
85
94
|
*
|
|
86
95
|
* Automatically handles labels, descriptions, error messages, required state, and default icons.
|
|
@@ -183,6 +192,7 @@ type ActionProps = ActionCommonProps & (ActionNavigationButtonProps | ActionClic
|
|
|
183
192
|
declare const ActionButton: (_props: ActionProps) => react_jsx_runtime9.JSX.Element;
|
|
184
193
|
interface ActionSubmitButtonProps extends ButtonProps {
|
|
185
194
|
form: FormModel<any>;
|
|
195
|
+
type?: "submit" | "reset";
|
|
186
196
|
}
|
|
187
197
|
interface ActionHookButtonProps extends ButtonProps {
|
|
188
198
|
action: UseActionReturn<any[], any>;
|
|
@@ -217,6 +227,22 @@ interface OmnibarButtonProps {
|
|
|
217
227
|
}
|
|
218
228
|
declare const OmnibarButton: (props: OmnibarButtonProps) => react_jsx_runtime9.JSX.Element;
|
|
219
229
|
//#endregion
|
|
230
|
+
//#region src/components/data/JsonViewer.d.ts
|
|
231
|
+
interface JsonViewerProps {
|
|
232
|
+
data: any;
|
|
233
|
+
defaultExpanded?: boolean;
|
|
234
|
+
maxDepth?: number;
|
|
235
|
+
copyable?: boolean;
|
|
236
|
+
size?: MantineSize;
|
|
237
|
+
}
|
|
238
|
+
declare const JsonViewer: ({
|
|
239
|
+
data,
|
|
240
|
+
defaultExpanded,
|
|
241
|
+
maxDepth,
|
|
242
|
+
copyable,
|
|
243
|
+
size
|
|
244
|
+
}: JsonViewerProps) => react_jsx_runtime9.JSX.Element;
|
|
245
|
+
//#endregion
|
|
220
246
|
//#region src/services/DialogService.d.ts
|
|
221
247
|
interface BaseDialogOptions extends Partial<ModalProps> {
|
|
222
248
|
title?: ReactNode;
|
|
@@ -332,6 +358,25 @@ interface ControlDateProps extends GenericControlProps {
|
|
|
332
358
|
*/
|
|
333
359
|
declare const ControlDate: (props: ControlDateProps) => react_jsx_runtime9.JSX.Element | null;
|
|
334
360
|
//#endregion
|
|
361
|
+
//#region src/components/form/ControlQueryBuilder.d.ts
|
|
362
|
+
interface ControlQueryBuilderProps extends Omit<TextInputProps, "value" | "onChange"> {
|
|
363
|
+
schema?: TObject;
|
|
364
|
+
value?: string;
|
|
365
|
+
onChange?: (value: string) => void;
|
|
366
|
+
placeholder?: string;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Query builder with text input and help popover.
|
|
370
|
+
* Generates query strings for parseQueryString syntax.
|
|
371
|
+
*/
|
|
372
|
+
declare const ControlQueryBuilder: ({
|
|
373
|
+
schema,
|
|
374
|
+
value,
|
|
375
|
+
onChange,
|
|
376
|
+
placeholder,
|
|
377
|
+
...textInputProps
|
|
378
|
+
}: ControlQueryBuilderProps) => react_jsx_runtime9.JSX.Element;
|
|
379
|
+
//#endregion
|
|
335
380
|
//#region src/components/form/TypeForm.d.ts
|
|
336
381
|
interface TypeFormProps<T extends TObject> {
|
|
337
382
|
form: FormModel<T>;
|
|
@@ -343,6 +388,7 @@ interface TypeFormProps<T extends TObject> {
|
|
|
343
388
|
lg?: number;
|
|
344
389
|
xl?: number;
|
|
345
390
|
};
|
|
391
|
+
schema?: TObject;
|
|
346
392
|
children?: (input: FormModel<T>["input"]) => ReactNode;
|
|
347
393
|
controlProps?: Partial<Omit<ControlProps, "input">>;
|
|
348
394
|
skipFormElement?: boolean;
|
|
@@ -466,12 +512,14 @@ interface SidebarSearch extends SidebarAbstractItem {
|
|
|
466
512
|
interface SidebarSection extends SidebarAbstractItem {
|
|
467
513
|
type: "section";
|
|
468
514
|
label: string;
|
|
515
|
+
icon?: ReactNode;
|
|
469
516
|
}
|
|
470
517
|
interface SidebarMenuItem extends SidebarAbstractItem {
|
|
471
518
|
label: string | ReactNode;
|
|
472
519
|
description?: string;
|
|
473
520
|
icon?: ReactNode;
|
|
474
521
|
href?: string;
|
|
522
|
+
target?: "_blank" | "_self" | "_parent" | "_top";
|
|
475
523
|
activeStartsWith?: boolean;
|
|
476
524
|
onClick?: () => void;
|
|
477
525
|
children?: SidebarMenuItem[];
|
|
@@ -503,7 +551,13 @@ interface AdminShellProps {
|
|
|
503
551
|
}
|
|
504
552
|
declare module "alepha" {
|
|
505
553
|
interface State {
|
|
554
|
+
/**
|
|
555
|
+
* Whether the sidebar is opened or closed.
|
|
556
|
+
*/
|
|
506
557
|
"alepha.ui.sidebar.opened"?: boolean;
|
|
558
|
+
/**
|
|
559
|
+
* Whether the sidebar is collapsed (narrow) or expanded (wide).
|
|
560
|
+
*/
|
|
507
561
|
"alepha.ui.sidebar.collapsed"?: boolean;
|
|
508
562
|
}
|
|
509
563
|
}
|
|
@@ -530,19 +584,66 @@ interface AlephaMantineProviderProps {
|
|
|
530
584
|
declare const AlephaMantineProvider: (props: AlephaMantineProviderProps) => react_jsx_runtime9.JSX.Element;
|
|
531
585
|
//#endregion
|
|
532
586
|
//#region src/components/table/DataTable.d.ts
|
|
533
|
-
interface
|
|
587
|
+
interface DataTableColumnContext<Filters extends TObject> {
|
|
588
|
+
index: number;
|
|
589
|
+
form: FormModel<Filters>;
|
|
590
|
+
alepha: Alepha;
|
|
591
|
+
}
|
|
592
|
+
interface DataTableColumn<T extends object, Filters extends TObject> {
|
|
534
593
|
label: string;
|
|
535
|
-
value: (item: T) => ReactNode;
|
|
594
|
+
value: (item: T, ctx: DataTableColumnContext<Filters>) => ReactNode;
|
|
595
|
+
fit?: boolean;
|
|
536
596
|
}
|
|
537
|
-
|
|
538
|
-
|
|
597
|
+
type MaybePage<T> = Omit<Page<T>, "page"> & {
|
|
598
|
+
page?: Partial<PageMetadata>;
|
|
599
|
+
};
|
|
600
|
+
interface DataTableSubmitContext<T extends object> {
|
|
601
|
+
items: T[];
|
|
602
|
+
}
|
|
603
|
+
interface DataTableProps<T extends object, Filters extends TObject> {
|
|
604
|
+
/**
|
|
605
|
+
* 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.
|
|
606
|
+
*/
|
|
607
|
+
items: MaybePage<T> | ((filters: Static<Filters> & {
|
|
608
|
+
page: number;
|
|
609
|
+
size: number;
|
|
610
|
+
sort?: string;
|
|
611
|
+
}, ctx: DataTableSubmitContext<T>) => Async<MaybePage<T>>);
|
|
612
|
+
/**
|
|
613
|
+
* The columns to display in the table. Each column is defined by a key and a DataTableColumn object.
|
|
614
|
+
*/
|
|
539
615
|
columns: {
|
|
540
|
-
[key: string]: DataTableColumn<T>;
|
|
616
|
+
[key: string]: DataTableColumn<T, Filters>;
|
|
541
617
|
};
|
|
618
|
+
defaultSize?: number;
|
|
619
|
+
typeFormProps?: Partial<Omit<TypeFormProps<Filters>, "form">>;
|
|
620
|
+
onFilterChange?: (key: string, value: unknown, form: FormModel<Filters>) => void;
|
|
621
|
+
/**
|
|
622
|
+
* Optional filters to apply to the data.
|
|
623
|
+
*/
|
|
624
|
+
filters?: TObject;
|
|
625
|
+
panel?: (item: T) => ReactNode;
|
|
626
|
+
canPanel?: (item: T) => boolean;
|
|
627
|
+
submitOnInit?: boolean;
|
|
628
|
+
submitEvery?: DurationLike;
|
|
629
|
+
withLineNumbers?: boolean;
|
|
630
|
+
withCheckbox?: boolean;
|
|
631
|
+
checkboxActions?: any[];
|
|
632
|
+
actions?: any[];
|
|
633
|
+
/**
|
|
634
|
+
* Enable infinity scroll mode. When true, pagination controls are hidden and new items are loaded automatically when scrolling to the bottom.
|
|
635
|
+
*/
|
|
636
|
+
infinityScroll?: boolean;
|
|
637
|
+
/**
|
|
638
|
+
* Props to pass to the Mantine Table component.
|
|
639
|
+
*/
|
|
542
640
|
tableProps?: TableProps;
|
|
641
|
+
/**
|
|
642
|
+
* Function to generate props for each table row based on the item.
|
|
643
|
+
*/
|
|
543
644
|
tableTrProps?: (item: T) => TableTrProps;
|
|
544
645
|
}
|
|
545
|
-
declare const DataTable: <T extends object>(props: DataTableProps<T>) => react_jsx_runtime9.JSX.Element;
|
|
646
|
+
declare const DataTable: <T extends object, Filters extends TObject>(props: DataTableProps<T, Filters>) => react_jsx_runtime9.JSX.Element;
|
|
546
647
|
//#endregion
|
|
547
648
|
//#region src/constants/ui.d.ts
|
|
548
649
|
declare const ui: {
|
|
@@ -551,6 +652,7 @@ declare const ui: {
|
|
|
551
652
|
background: string;
|
|
552
653
|
surface: string;
|
|
553
654
|
elevated: string;
|
|
655
|
+
border: string;
|
|
554
656
|
};
|
|
555
657
|
};
|
|
556
658
|
//#endregion
|
|
@@ -603,6 +705,34 @@ declare class RootRouter {
|
|
|
603
705
|
readonly root: _alepha_react0.PageDescriptor<_alepha_react0.PageConfigSchema, any, _alepha_react0.TPropsParentDefault>;
|
|
604
706
|
}
|
|
605
707
|
//#endregion
|
|
708
|
+
//#region src/utils/extractSchemaFields.d.ts
|
|
709
|
+
interface SchemaField {
|
|
710
|
+
name: string;
|
|
711
|
+
path: string;
|
|
712
|
+
type: string;
|
|
713
|
+
enum?: readonly any[];
|
|
714
|
+
format?: string;
|
|
715
|
+
description?: string;
|
|
716
|
+
nested?: SchemaField[];
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Extract field information from a TypeBox schema for query building.
|
|
720
|
+
* Supports nested objects and provides field metadata for autocomplete.
|
|
721
|
+
*/
|
|
722
|
+
declare function extractSchemaFields(schema: TObject | TProperties, prefix?: string): SchemaField[];
|
|
723
|
+
/**
|
|
724
|
+
* Get suggested operators based on field type
|
|
725
|
+
*/
|
|
726
|
+
declare function getOperatorsForField(field: SchemaField): string[];
|
|
727
|
+
/**
|
|
728
|
+
* Get operator symbol and description
|
|
729
|
+
*/
|
|
730
|
+
declare const OPERATOR_INFO: Record<string, {
|
|
731
|
+
symbol: string;
|
|
732
|
+
label: string;
|
|
733
|
+
example: string;
|
|
734
|
+
}>;
|
|
735
|
+
//#endregion
|
|
606
736
|
//#region src/utils/icons.d.ts
|
|
607
737
|
/**
|
|
608
738
|
* Icon size presets following Mantine's size conventions
|
|
@@ -677,7 +807,7 @@ declare module "alepha/react" {
|
|
|
677
807
|
*
|
|
678
808
|
* @module alepha.ui
|
|
679
809
|
*/
|
|
680
|
-
declare const AlephaUI: _alepha_core0.Service<_alepha_core0.Module
|
|
810
|
+
declare const AlephaUI: _alepha_core0.Service<_alepha_core0.Module>;
|
|
681
811
|
//#endregion
|
|
682
|
-
export { ActionButton, type ActionClickButtonProps, type ActionCommonProps, type ActionMenuConfig, type ActionMenuItem, type ActionNavigationButtonProps, type ActionProps, type ActionSubmitButtonProps, AdminShell, AlephaMantineProvider, AlephaUI, AlertDialog, type AlertDialogOptions, type AlertDialogProps, AppBar, type AppBarBurger, type AppBarDark, type AppBarDivider, type AppBarElement, type AppBarItem, type AppBarLang, type AppBarProps, type AppBarSearch, type AppBarSpacer, type BaseDialogOptions, ConfirmDialog, type ConfirmDialogOptions, type ConfirmDialogProps, Control, ControlDate, ControlSelect, DarkModeButton, DataTable, type DataTableColumn, type DataTableProps, DialogService, Flex, ICON_SIZES, IconSize, Omnibar, OmnibarButton, PromptDialog, type PromptDialogOptions, type PromptDialogProps, RootRouter, Sidebar, type SidebarAbstractItem, type SidebarButtonTheme, type SidebarDivider, type SidebarElement, type SidebarItemProps, type SidebarMenuItem, type SidebarNode, type SidebarProps, type SidebarSearch, type SidebarSection, type SidebarSpacer, type SidebarTheme, Text, ToastService, TypeForm, capitalize, getDefaultIcon, prettyName, ui, useDialog, useToast };
|
|
812
|
+
export { ActionButton, type ActionClickButtonProps, type ActionCommonProps, type ActionMenuConfig, type ActionMenuItem, type ActionNavigationButtonProps, type ActionProps, type ActionSubmitButtonProps, AdminShell, AlephaMantineProvider, AlephaUI, AlertDialog, type AlertDialogOptions, type AlertDialogProps, AppBar, type AppBarBurger, type AppBarDark, type AppBarDivider, type AppBarElement, type AppBarItem, type AppBarLang, type AppBarProps, type AppBarSearch, type AppBarSpacer, type BaseDialogOptions, ConfirmDialog, type ConfirmDialogOptions, type ConfirmDialogProps, Control, ControlDate, ControlQueryBuilder, ControlSelect, DarkModeButton, DataTable, type DataTableColumn, type DataTableProps, DialogService, Flex, ICON_SIZES, IconSize, JsonViewer, OPERATOR_INFO, Omnibar, OmnibarButton, PromptDialog, type PromptDialogOptions, type PromptDialogProps, RootRouter, SchemaField, Sidebar, type SidebarAbstractItem, type SidebarButtonTheme, type SidebarDivider, type SidebarElement, type SidebarItemProps, type SidebarMenuItem, type SidebarNode, type SidebarProps, type SidebarSearch, type SidebarSection, type SidebarSpacer, type SidebarTheme, Text, ToastService, TypeForm, capitalize, extractSchemaFields, getDefaultIcon, getOperatorsForField, prettyName, ui, useDialog, useToast };
|
|
683
813
|
//# sourceMappingURL=index.d.ts.map
|
package/vite.d.ts
CHANGED
|
@@ -126,7 +126,7 @@ interface ViteAlephaBuildOptions {
|
|
|
126
126
|
* Path to the entry file for the server build.
|
|
127
127
|
* If empty, SSR build will be skipped.
|
|
128
128
|
*/
|
|
129
|
-
serverEntry?: string;
|
|
129
|
+
serverEntry?: string | false;
|
|
130
130
|
/**
|
|
131
131
|
* Set false to skip the client build.
|
|
132
132
|
* This is useful if you only want to build the server-side application.
|
|
@@ -158,7 +158,7 @@ interface ViteAlephaDevOptions {
|
|
|
158
158
|
* Path to the entry file for the server build.
|
|
159
159
|
* If empty, plugin will be disabled.
|
|
160
160
|
*/
|
|
161
|
-
serverEntry?: string;
|
|
161
|
+
serverEntry?: string | false;
|
|
162
162
|
/**
|
|
163
163
|
* If true, enables debug logging.
|
|
164
164
|
*
|