adminforth 2.4.0-next.32 → 2.4.0-next.321
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/commands/callTsProxy.js +14 -4
- package/commands/createApp/templates/api.ts.hbs +10 -0
- package/commands/createApp/templates/custom/tsconfig.json.hbs +2 -3
- package/commands/createApp/templates/index.ts.hbs +12 -1
- package/commands/createApp/templates/package.json.hbs +1 -1
- package/commands/createApp/templates/prisma.config.ts.hbs +8 -0
- package/commands/createApp/templates/schema.prisma.hbs +0 -1
- package/commands/createApp/utils.js +10 -0
- package/commands/createCustomComponent/configLoader.js +17 -4
- package/commands/createCustomComponent/main.js +13 -7
- package/commands/createCustomComponent/templates/customCrud/beforeActionButtons.vue.hbs +38 -0
- package/commands/createCustomComponent/templates/customCrud/saveButton.vue.hbs +28 -0
- package/commands/createPlugin/templates/custom/tsconfig.json.hbs +2 -5
- package/commands/createPlugin/templates/package.json.hbs +1 -1
- package/commands/generateModels.js +30 -22
- package/dist/auth.d.ts +9 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +21 -2
- package/dist/auth.js.map +1 -1
- package/dist/dataConnectors/baseConnector.d.ts +1 -1
- package/dist/dataConnectors/baseConnector.d.ts.map +1 -1
- package/dist/dataConnectors/baseConnector.js +70 -18
- package/dist/dataConnectors/baseConnector.js.map +1 -1
- package/dist/dataConnectors/clickhouse.d.ts.map +1 -1
- package/dist/dataConnectors/clickhouse.js +15 -0
- package/dist/dataConnectors/clickhouse.js.map +1 -1
- package/dist/dataConnectors/mongo.d.ts.map +1 -1
- package/dist/dataConnectors/mongo.js +50 -15
- package/dist/dataConnectors/mongo.js.map +1 -1
- package/dist/dataConnectors/mysql.d.ts.map +1 -1
- package/dist/dataConnectors/mysql.js +11 -0
- package/dist/dataConnectors/mysql.js.map +1 -1
- package/dist/dataConnectors/postgres.d.ts.map +1 -1
- package/dist/dataConnectors/postgres.js +43 -14
- package/dist/dataConnectors/postgres.js.map +1 -1
- package/dist/dataConnectors/sqlite.d.ts.map +1 -1
- package/dist/dataConnectors/sqlite.js +11 -0
- package/dist/dataConnectors/sqlite.js.map +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +44 -21
- package/dist/index.js.map +1 -1
- package/dist/modules/codeInjector.d.ts +2 -0
- package/dist/modules/codeInjector.d.ts.map +1 -1
- package/dist/modules/codeInjector.js +62 -6
- package/dist/modules/codeInjector.js.map +1 -1
- package/dist/modules/configValidator.d.ts +6 -0
- package/dist/modules/configValidator.d.ts.map +1 -1
- package/dist/modules/configValidator.js +202 -25
- package/dist/modules/configValidator.js.map +1 -1
- package/dist/modules/restApi.d.ts +1 -1
- package/dist/modules/restApi.d.ts.map +1 -1
- package/dist/modules/restApi.js +184 -31
- package/dist/modules/restApi.js.map +1 -1
- package/dist/modules/styles.d.ts +499 -13
- package/dist/modules/styles.d.ts.map +1 -1
- package/dist/modules/styles.js +555 -31
- package/dist/modules/styles.js.map +1 -1
- package/dist/modules/utils.d.ts +7 -15
- package/dist/modules/utils.d.ts.map +1 -1
- package/dist/modules/utils.js +45 -68
- package/dist/modules/utils.js.map +1 -1
- package/dist/servers/express.d.ts +5 -0
- package/dist/servers/express.d.ts.map +1 -1
- package/dist/servers/express.js +40 -1
- package/dist/servers/express.js.map +1 -1
- package/dist/spa/index.html +1 -1
- package/dist/spa/package-lock.json +1208 -708
- package/dist/spa/package.json +34 -34
- package/dist/spa/src/App.vue +61 -173
- package/dist/spa/src/adminforth.ts +42 -18
- package/dist/spa/src/afcl/AreaChart.vue +0 -1
- package/dist/spa/src/afcl/BarChart.vue +2 -2
- package/dist/spa/src/afcl/Button.vue +6 -6
- package/dist/spa/src/afcl/ButtonGroup.vue +91 -0
- package/dist/spa/src/afcl/Card.vue +25 -0
- package/dist/spa/src/afcl/Checkbox.vue +21 -13
- package/dist/spa/src/afcl/CountryFlag.vue +4 -1
- package/dist/spa/src/{components/CustomDatePicker.vue → afcl/DatePicker.vue} +95 -9
- package/dist/spa/src/afcl/Dialog.vue +47 -27
- package/dist/spa/src/afcl/Dropzone.vue +145 -48
- package/dist/spa/src/afcl/Input.vue +14 -6
- package/dist/spa/src/afcl/JsonViewer.vue +25 -0
- package/dist/spa/src/afcl/LinkButton.vue +3 -3
- package/dist/spa/src/afcl/PieChart.vue +5 -5
- package/dist/spa/src/afcl/ProgressBar.vue +7 -7
- package/dist/spa/src/afcl/Select.vue +82 -34
- package/dist/spa/src/afcl/Skeleton.vue +6 -6
- package/dist/spa/src/afcl/Table.vue +313 -75
- package/dist/spa/src/afcl/Textarea.vue +31 -0
- package/dist/spa/src/afcl/Toggle.vue +32 -0
- package/dist/spa/src/afcl/Tooltip.vue +28 -18
- package/dist/spa/src/afcl/VerticalTabs.vue +21 -7
- package/dist/spa/src/afcl/index.ts +6 -3
- package/dist/spa/src/components/AcceptModal.vue +48 -14
- package/dist/spa/src/components/Breadcrumbs.vue +5 -5
- package/dist/spa/src/components/CallActionWrapper.vue +15 -0
- package/dist/spa/src/components/ColumnValueInput.vue +38 -18
- package/dist/spa/src/components/ColumnValueInputWrapper.vue +4 -3
- package/dist/spa/src/components/CustomDateRangePicker.vue +9 -8
- package/dist/spa/src/components/CustomRangePicker.vue +37 -21
- package/dist/spa/src/components/ErrorMessage.vue +21 -0
- package/dist/spa/src/components/Filters.vue +195 -132
- package/dist/spa/src/components/GroupsTable.vue +9 -8
- package/dist/spa/src/components/MenuLink.vue +95 -23
- package/dist/spa/src/components/ResourceForm.vue +94 -51
- package/dist/spa/src/components/ResourceListTable.vue +119 -94
- package/dist/spa/src/components/ResourceListTableVirtual.vue +118 -87
- package/dist/spa/src/components/ShowTable.vue +21 -15
- package/dist/spa/src/components/Sidebar.vue +472 -0
- package/dist/spa/src/components/SingleSkeletLoader.vue +6 -6
- package/dist/spa/src/components/SkeleteLoader.vue +3 -3
- package/dist/spa/src/components/ThreeDotsMenu.vue +84 -15
- package/dist/spa/src/components/Toast.vue +40 -29
- package/dist/spa/src/components/UserMenuSettingsButton.vue +69 -0
- package/dist/spa/src/components/ValueRenderer.vue +44 -17
- package/dist/spa/src/controls/BoolToggle.vue +34 -0
- package/dist/spa/src/i18n.ts +5 -3
- package/dist/spa/src/main.ts +1 -1
- package/dist/spa/src/renderers/CompactField.vue +1 -1
- package/dist/spa/src/renderers/CompactUUID.vue +1 -1
- package/dist/spa/src/router/index.ts +8 -0
- package/dist/spa/src/shims-vue.d.ts +5 -0
- package/dist/spa/src/spa_types/core.ts +13 -1
- package/dist/spa/src/stores/core.ts +13 -1
- package/dist/spa/src/stores/filters.ts +33 -2
- package/dist/spa/src/stores/modal.ts +6 -1
- package/dist/spa/src/stores/toast.ts +22 -3
- package/dist/spa/src/types/Back.ts +168 -23
- package/dist/spa/src/types/Common.ts +93 -32
- package/dist/spa/src/types/FrontendAPI.ts +31 -5
- package/dist/spa/src/types/adapters/CaptchaAdapter.ts +34 -0
- package/dist/spa/src/types/adapters/EmailAdapter.ts +2 -4
- package/dist/spa/src/types/adapters/ImageVisionAdapter.ts +30 -0
- package/dist/spa/src/types/adapters/KeyValueAdapter.ts +16 -0
- package/dist/spa/src/types/adapters/StorageAdapter.ts +4 -2
- package/dist/spa/src/types/adapters/index.ts +3 -0
- package/dist/spa/src/utils.ts +291 -11
- package/dist/spa/src/views/CreateView.vue +63 -21
- package/dist/spa/src/views/EditView.vue +55 -22
- package/dist/spa/src/views/ListView.vue +144 -87
- package/dist/spa/src/views/LoginView.vue +26 -35
- package/dist/spa/src/views/ResourceParent.vue +2 -2
- package/dist/spa/src/views/SettingsView.vue +121 -0
- package/dist/spa/src/views/ShowView.vue +83 -53
- package/dist/spa/src/websocket.ts +6 -1
- package/dist/spa/tsconfig.app.json +1 -1
- package/dist/spa/vite.config.ts +45 -2
- package/dist/types/Back.d.ts +151 -14
- package/dist/types/Back.d.ts.map +1 -1
- package/dist/types/Back.js +15 -0
- package/dist/types/Back.js.map +1 -1
- package/dist/types/Common.d.ts +108 -29
- package/dist/types/Common.d.ts.map +1 -1
- package/dist/types/Common.js.map +1 -1
- package/dist/types/FrontendAPI.d.ts +31 -3
- package/dist/types/FrontendAPI.d.ts.map +1 -1
- package/dist/types/FrontendAPI.js.map +1 -1
- package/dist/types/adapters/CaptchaAdapter.d.ts +30 -0
- package/dist/types/adapters/CaptchaAdapter.d.ts.map +1 -0
- package/dist/types/adapters/CaptchaAdapter.js +5 -0
- package/dist/types/adapters/CaptchaAdapter.js.map +1 -0
- package/dist/types/adapters/EmailAdapter.d.ts +2 -3
- package/dist/types/adapters/EmailAdapter.d.ts.map +1 -1
- package/dist/types/adapters/ImageVisionAdapter.d.ts +25 -0
- package/dist/types/adapters/ImageVisionAdapter.d.ts.map +1 -0
- package/dist/types/adapters/ImageVisionAdapter.js +2 -0
- package/dist/types/adapters/ImageVisionAdapter.js.map +1 -0
- package/dist/types/adapters/KeyValueAdapter.d.ts +10 -0
- package/dist/types/adapters/KeyValueAdapter.d.ts.map +1 -0
- package/dist/types/adapters/KeyValueAdapter.js +2 -0
- package/dist/types/adapters/KeyValueAdapter.js.map +1 -0
- package/dist/types/adapters/StorageAdapter.d.ts +2 -0
- package/dist/types/adapters/StorageAdapter.d.ts.map +1 -1
- package/dist/types/adapters/index.d.ts +3 -0
- package/dist/types/adapters/index.d.ts.map +1 -1
- package/package.json +4 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
/**
|
|
3
2
|
* Types that are common for both frontend side (SPA) and backend side (server).
|
|
4
3
|
*/
|
|
@@ -68,6 +67,11 @@ export type AllowedActionsResolved = {
|
|
|
68
67
|
[key in AllowedActionsEnum]: boolean
|
|
69
68
|
}
|
|
70
69
|
|
|
70
|
+
// conditional operators for predicates
|
|
71
|
+
type Value = any;
|
|
72
|
+
type Operators = { $eq: Value } | { $not: Value } | { $gt: Value } | { $gte: Value } | { $lt: Value } | { $lte: Value } | { $in: Value[] } | { $nin: Value[] } | { $includes: Value } | { $nincludes: Value };
|
|
73
|
+
export type Predicate = { $and: Predicate[] } | { $or: Predicate[] } | { [key: string]: Operators | Value };
|
|
74
|
+
|
|
71
75
|
export interface AdminUser {
|
|
72
76
|
/**
|
|
73
77
|
* primaryKey field value of user in table which is defined by {@link AdminForthConfig.auth.usersResourceId}
|
|
@@ -95,12 +99,9 @@ export interface AdminForthBulkActionCommon {
|
|
|
95
99
|
label: string,
|
|
96
100
|
|
|
97
101
|
/**
|
|
98
|
-
*
|
|
99
|
-
* * 'danger' - red button
|
|
100
|
-
* * 'success' - green button
|
|
101
|
-
* * 'active' - blue button
|
|
102
|
+
* Add custom class
|
|
102
103
|
**/
|
|
103
|
-
|
|
104
|
+
buttonCustomCssClass?: string;
|
|
104
105
|
|
|
105
106
|
/**
|
|
106
107
|
* Optional small badge for button which will be displayed in the list view
|
|
@@ -122,6 +123,10 @@ export interface AdminForthBulkActionCommon {
|
|
|
122
123
|
*/
|
|
123
124
|
successMessage?: string,
|
|
124
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Show in three dots dropdown menu in list view.
|
|
128
|
+
*/
|
|
129
|
+
showInThreeDotsDropdown?: boolean,
|
|
125
130
|
}
|
|
126
131
|
|
|
127
132
|
export interface AdminForthFieldComponents {
|
|
@@ -261,11 +266,29 @@ export interface AdminForthComponentDeclarationFull {
|
|
|
261
266
|
* </script>
|
|
262
267
|
*
|
|
263
268
|
*/
|
|
264
|
-
meta?:
|
|
269
|
+
meta?: {
|
|
270
|
+
/**
|
|
271
|
+
* Controls sidebar and header visibility for custom pages
|
|
272
|
+
* - 'default': Show both sidebar and header (default behavior)
|
|
273
|
+
* - 'none': Hide both sidebar and header (full custom layout)
|
|
274
|
+
* - 'preferIconOnly': Show header but prefer icon-only sidebar
|
|
275
|
+
*/
|
|
276
|
+
sidebarAndHeader?: 'default' | 'none' | 'preferIconOnly',
|
|
277
|
+
|
|
278
|
+
[key: string]: any,
|
|
279
|
+
}
|
|
265
280
|
}
|
|
281
|
+
import { type AdminForthActionInput } from './Back.js'
|
|
282
|
+
export { type AdminForthActionInput } from './Back.js'
|
|
266
283
|
|
|
267
284
|
export type AdminForthComponentDeclaration = AdminForthComponentDeclarationFull | string;
|
|
268
285
|
|
|
286
|
+
export type FieldGroup = {
|
|
287
|
+
groupName: string;
|
|
288
|
+
columns: string[];
|
|
289
|
+
noTitle?: boolean;
|
|
290
|
+
};
|
|
291
|
+
|
|
269
292
|
/**
|
|
270
293
|
* Resource describes one table or collection in database.
|
|
271
294
|
* AdminForth generates set of pages for 'list', 'show', 'edit', 'create', 'filter' operations for each resource.
|
|
@@ -347,6 +370,11 @@ export interface AdminForthResourceInputCommon {
|
|
|
347
370
|
direction: AdminForthSortDirections | string,
|
|
348
371
|
}
|
|
349
372
|
|
|
373
|
+
/*
|
|
374
|
+
* Custom actions list. Actions available in show, edit and create views.
|
|
375
|
+
*/
|
|
376
|
+
actions?: AdminForthActionInput[],
|
|
377
|
+
|
|
350
378
|
/**
|
|
351
379
|
* Custom bulk actions list. Bulk actions available in list view when user selects multiple records by
|
|
352
380
|
* using checkboxes.
|
|
@@ -374,26 +402,10 @@ export interface AdminForthResourceInputCommon {
|
|
|
374
402
|
/**
|
|
375
403
|
* Allows to make groups of columns in show, create and edit resource pages.
|
|
376
404
|
*/
|
|
377
|
-
fieldGroups?:
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}[];
|
|
382
|
-
createFieldGroups?: {
|
|
383
|
-
groupName: string;
|
|
384
|
-
columns: string[];
|
|
385
|
-
noTitle?: boolean;
|
|
386
|
-
}[];
|
|
387
|
-
editFieldGroups?: {
|
|
388
|
-
groupName: string;
|
|
389
|
-
columns: string[];
|
|
390
|
-
noTitle?: boolean;
|
|
391
|
-
}[];
|
|
392
|
-
showFieldGroups?: {
|
|
393
|
-
groupName: string;
|
|
394
|
-
columns: string[];
|
|
395
|
-
noTitle?: boolean;
|
|
396
|
-
}[];
|
|
405
|
+
fieldGroups?: FieldGroup[];
|
|
406
|
+
createFieldGroups?: FieldGroup[];
|
|
407
|
+
editFieldGroups?: FieldGroup[];
|
|
408
|
+
showFieldGroups?: FieldGroup[];
|
|
397
409
|
|
|
398
410
|
/**
|
|
399
411
|
* Page size for list view
|
|
@@ -471,6 +483,7 @@ export interface AdminForthResourceInputCommon {
|
|
|
471
483
|
list?: {
|
|
472
484
|
beforeBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
473
485
|
afterBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
486
|
+
beforeActionButtons?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
474
487
|
bottom?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
475
488
|
threeDotsDropdownItems?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
476
489
|
customActionIcons?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
@@ -499,6 +512,11 @@ export interface AdminForthResourceInputCommon {
|
|
|
499
512
|
afterBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
500
513
|
bottom?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
501
514
|
threeDotsDropdownItems?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
515
|
+
/**
|
|
516
|
+
* Custom Save button component for Edit page.
|
|
517
|
+
* Accepts props: [record, resource, adminUser, meta, saving, validating, isValid, disabled, saveRecord]
|
|
518
|
+
*/
|
|
519
|
+
saveButton?: AdminForthComponentDeclaration,
|
|
502
520
|
},
|
|
503
521
|
|
|
504
522
|
/**
|
|
@@ -511,6 +529,11 @@ export interface AdminForthResourceInputCommon {
|
|
|
511
529
|
afterBreadcrumbs?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
512
530
|
bottom?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
513
531
|
threeDotsDropdownItems?: AdminForthComponentDeclaration | Array<AdminForthComponentDeclaration>,
|
|
532
|
+
/**
|
|
533
|
+
* Custom Save button component for Create page.
|
|
534
|
+
* Accepts props: [record, resource, adminUser, meta, saving, validating, isValid, disabled, saveRecord]
|
|
535
|
+
*/
|
|
536
|
+
saveButton?: AdminForthComponentDeclaration,
|
|
514
537
|
},
|
|
515
538
|
}
|
|
516
539
|
},
|
|
@@ -584,6 +607,8 @@ export interface AdminForthForeignResourceCommon {
|
|
|
584
607
|
polymorphicResources?: Array<AdminForthPolymorphicForeignResource>,
|
|
585
608
|
polymorphicOn?: string,
|
|
586
609
|
unsetLabel?: string,
|
|
610
|
+
searchableFields?: string | string[],
|
|
611
|
+
searchIsCaseSensitive?: boolean,
|
|
587
612
|
}
|
|
588
613
|
|
|
589
614
|
export type FillOnCreateFunction = (params: {
|
|
@@ -810,9 +835,6 @@ export interface AdminForthResourceColumnInputCommon {
|
|
|
810
835
|
*/
|
|
811
836
|
minLength?: number,
|
|
812
837
|
|
|
813
|
-
min?: number,
|
|
814
|
-
max?: number,
|
|
815
|
-
|
|
816
838
|
/**
|
|
817
839
|
* Minimum value that can be entered in this field.
|
|
818
840
|
*/
|
|
@@ -865,6 +887,15 @@ export interface AdminForthResourceColumnInputCommon {
|
|
|
865
887
|
*/
|
|
866
888
|
masked?: boolean,
|
|
867
889
|
|
|
890
|
+
/**
|
|
891
|
+
* Sticky position for column
|
|
892
|
+
*/
|
|
893
|
+
listSticky?: boolean;
|
|
894
|
+
|
|
895
|
+
/**
|
|
896
|
+
* Show field only if certain conditions are met.
|
|
897
|
+
*/
|
|
898
|
+
showIf?: Predicate;
|
|
868
899
|
}
|
|
869
900
|
|
|
870
901
|
export interface AdminForthResourceColumnCommon extends AdminForthResourceColumnInputCommon {
|
|
@@ -878,6 +909,15 @@ export interface AdminForthResourceColumnCommon extends AdminForthResourceColumn
|
|
|
878
909
|
|
|
879
910
|
editingNote?: { create?: string, edit?: string },
|
|
880
911
|
|
|
912
|
+
/**
|
|
913
|
+
* Minimal value stored in this field.
|
|
914
|
+
*/
|
|
915
|
+
min?: number,
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Maximum value stored in this field.
|
|
919
|
+
*/
|
|
920
|
+
max?: number,
|
|
881
921
|
}
|
|
882
922
|
|
|
883
923
|
export enum AdminForthMenuTypes {
|
|
@@ -1055,16 +1095,24 @@ export interface AdminForthConfigForFrontend {
|
|
|
1055
1095
|
usernameFieldName: string,
|
|
1056
1096
|
loginBackgroundImage: string,
|
|
1057
1097
|
loginBackgroundPosition: string,
|
|
1098
|
+
removeBackgroundBlendMode: boolean,
|
|
1058
1099
|
title?: string,
|
|
1059
1100
|
demoCredentials?: string,
|
|
1060
|
-
loginPromptHTML?: string
|
|
1101
|
+
loginPromptHTML?: string | (() => string | Promise<string> | void | Promise<void> | Promise<undefined>) | undefined
|
|
1061
1102
|
loginPageInjections: {
|
|
1062
1103
|
underInputs: Array<AdminForthComponentDeclaration>,
|
|
1063
1104
|
panelHeader: Array<AdminForthComponentDeclaration>,
|
|
1064
1105
|
},
|
|
1065
1106
|
rememberMeDays: number,
|
|
1066
1107
|
showBrandNameInSidebar: boolean,
|
|
1108
|
+
showBrandLogoInSidebar: boolean,
|
|
1067
1109
|
brandLogo?: string,
|
|
1110
|
+
iconOnlySidebar?: {
|
|
1111
|
+
logo?: string,
|
|
1112
|
+
enabled?: boolean,
|
|
1113
|
+
expandedSidebarWidth?: string,
|
|
1114
|
+
},
|
|
1115
|
+
singleTheme?: 'light' | 'dark',
|
|
1068
1116
|
datesFormat: string,
|
|
1069
1117
|
timeFormat: string,
|
|
1070
1118
|
auth: any,
|
|
@@ -1079,8 +1127,21 @@ export interface AdminForthConfigForFrontend {
|
|
|
1079
1127
|
userMenu: Array<AdminForthComponentDeclarationFull>,
|
|
1080
1128
|
header: Array<AdminForthComponentDeclarationFull>,
|
|
1081
1129
|
sidebar: Array<AdminForthComponentDeclarationFull>,
|
|
1130
|
+
sidebarTop: Array<AdminForthComponentDeclarationFull>,
|
|
1082
1131
|
everyPageBottom: Array<AdminForthComponentDeclarationFull>,
|
|
1083
|
-
}
|
|
1132
|
+
},
|
|
1133
|
+
customHeadItems?: {
|
|
1134
|
+
tagName: string;
|
|
1135
|
+
attributes: Record<string, string | boolean>;
|
|
1136
|
+
innerCode?: string;
|
|
1137
|
+
}[],
|
|
1138
|
+
settingPages?:{
|
|
1139
|
+
icon?: string,
|
|
1140
|
+
pageLabel: string,
|
|
1141
|
+
slug?: string,
|
|
1142
|
+
component: string,
|
|
1143
|
+
isVisible?: boolean
|
|
1144
|
+
}[],
|
|
1084
1145
|
}
|
|
1085
1146
|
|
|
1086
1147
|
export interface GetBaseConfigResponse {
|
|
@@ -55,7 +55,7 @@ export interface FrontendAPIInterface {
|
|
|
55
55
|
*
|
|
56
56
|
* @param params - The parameters of the alert
|
|
57
57
|
*/
|
|
58
|
-
alert(params:AlertParams): void;
|
|
58
|
+
alert(params:AlertParams): void | Promise<string> | string;
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
list: {
|
|
@@ -82,27 +82,40 @@ export interface FrontendAPIInterface {
|
|
|
82
82
|
*/
|
|
83
83
|
closeThreeDotsDropdown(): void;
|
|
84
84
|
|
|
85
|
-
|
|
86
85
|
/**
|
|
87
|
-
* Set a filter in the list
|
|
88
|
-
* Works only when user located on the list page.
|
|
86
|
+
* Set a filter in the list.
|
|
87
|
+
* Works only when user located on the list page. If filter already exists, it will be replaced with the new one.
|
|
89
88
|
* Can be used to set filter from charts or other components in pageInjections.
|
|
90
89
|
*
|
|
90
|
+
* Filters are automatically marked as hidden (won't count in badge) if:
|
|
91
|
+
* - Column has showIn.filter: false
|
|
92
|
+
*
|
|
91
93
|
* Example:
|
|
92
94
|
*
|
|
93
95
|
* ```ts
|
|
94
96
|
* import adminforth from '@/adminforth'
|
|
95
97
|
*
|
|
98
|
+
* // Regular filter (will show in badge if column.showIn.filter !== false)
|
|
96
99
|
* adminforth.list.setFilter({field: 'name', operator: 'ilike', value: 'john'})
|
|
100
|
+
*
|
|
101
|
+
* // Hidden filter (won't show in badge if column.showIn.filter === false)
|
|
102
|
+
* adminforth.list.setFilter({field: 'internal_status', operator: 'eq', value: 'active'})
|
|
97
103
|
* ```
|
|
98
104
|
*
|
|
105
|
+
* Please note that you can set/update filter even for fields which have showIn.filter=false in resource configuration.
|
|
106
|
+
* Also you can set filter for virtual columns. For example Universal search plugin calls updateFilter for virtual column which has showIn.filter=false (because we dont want to show this column in filter dropdown, plugin renders its own filter UI)
|
|
107
|
+
*
|
|
99
108
|
* @param filter - The filter to set
|
|
100
109
|
*/
|
|
101
110
|
setFilter(filter: FilterParams): void;
|
|
102
111
|
|
|
103
112
|
/**
|
|
113
|
+
* DEPRECATED: does the same as setFilter, kept for backward compatibility
|
|
104
114
|
* Update a filter in the list
|
|
105
115
|
*
|
|
116
|
+
* Filters visibility in badge is automatically determined by column configuration:
|
|
117
|
+
* - Hidden if column has showIn.filter: false
|
|
118
|
+
*
|
|
106
119
|
* Example:
|
|
107
120
|
*
|
|
108
121
|
* ```ts
|
|
@@ -121,6 +134,14 @@ export interface FrontendAPIInterface {
|
|
|
121
134
|
clearFilters(): void;
|
|
122
135
|
}
|
|
123
136
|
|
|
137
|
+
show: {
|
|
138
|
+
/**
|
|
139
|
+
* Full refresh the current record on the show page. Loader may be shown during fetching.
|
|
140
|
+
* Fire-and-forget; you don't need to await it.
|
|
141
|
+
*/
|
|
142
|
+
refresh(): void;
|
|
143
|
+
}
|
|
144
|
+
|
|
124
145
|
menu: {
|
|
125
146
|
/**
|
|
126
147
|
* Refreshes the badges in the menu, by recalling the badge function for each menu item
|
|
@@ -171,7 +192,12 @@ export type AlertParams = {
|
|
|
171
192
|
* Default is 10 seconds;
|
|
172
193
|
*/
|
|
173
194
|
timeout?: number | 'unlimited';
|
|
174
|
-
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Optional buttons to display in the alert
|
|
198
|
+
*/
|
|
199
|
+
buttons?: {value: any, label: string}[];
|
|
200
|
+
|
|
175
201
|
}
|
|
176
202
|
|
|
177
203
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for Captcha adapters.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export interface CaptchaAdapter {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the script source URL for the captcha widget.
|
|
8
|
+
*/
|
|
9
|
+
getScriptSrc(): string;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Returns the site key for the captcha.
|
|
13
|
+
*/
|
|
14
|
+
getSiteKey(): string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Returns the widget ID for the captcha.
|
|
18
|
+
*/
|
|
19
|
+
getWidgetId(): string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Returns the script HTML for the captcha widget.
|
|
23
|
+
*/
|
|
24
|
+
getRenderWidgetCode(): string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Returns the function name to render the captcha widget.
|
|
28
|
+
*/
|
|
29
|
+
getRenderWidgetFunctionName(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Validates the captcha token.
|
|
32
|
+
*/
|
|
33
|
+
validate(token: string, ip: string): Promise<Record<string, any>>;
|
|
34
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
interface EmailAdapter {
|
|
1
|
+
export interface EmailAdapter {
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* This method is called to validate the configuration of the adapter
|
|
5
|
-
* and should throw a clear user-
|
|
5
|
+
* and should throw a clear user-readable error if the configuration is invalid.
|
|
6
6
|
*/
|
|
7
7
|
validate(): Promise<void>;
|
|
8
8
|
|
|
@@ -25,5 +25,3 @@ interface EmailAdapter {
|
|
|
25
25
|
ok?: boolean;
|
|
26
26
|
}>;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
export { EmailAdapter };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface ImageVisionAdapter {
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This method is called to validate the configuration of the adapter
|
|
5
|
+
* and should throw a clear user-readable error if the configuration is invalid.
|
|
6
|
+
*/
|
|
7
|
+
validate(): void;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Input file extension supported
|
|
11
|
+
*/
|
|
12
|
+
inputFileExtensionSupported(): string[];
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* This method should generate an image based on the provided prompt and input files.
|
|
16
|
+
* @param prompt - The prompt to generate the image
|
|
17
|
+
* @param inputFileUrls - An array of input file paths (optional)
|
|
18
|
+
* @returns A promise that resolves to an object containing the generated image and any error message
|
|
19
|
+
*/
|
|
20
|
+
generate({
|
|
21
|
+
prompt,
|
|
22
|
+
inputFileUrls,
|
|
23
|
+
}: {
|
|
24
|
+
prompt: string,
|
|
25
|
+
inputFileUrls: string[],
|
|
26
|
+
}): Promise<{
|
|
27
|
+
response: string;
|
|
28
|
+
error?: string;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Might have implementations like RAM, Redis, Memcached,
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export interface KeyValueAdapter {
|
|
7
|
+
|
|
8
|
+
get(key: string): Promise<string | null>;
|
|
9
|
+
|
|
10
|
+
set(key: string, value: string, expiresInSeconds?: number): Promise<void>;
|
|
11
|
+
|
|
12
|
+
delete(key: string): Promise<void>;
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
@@ -39,7 +39,8 @@ export interface StorageAdapter {
|
|
|
39
39
|
* This method should work even if the file does not exist yet (e.g. only presigned URL was generated).
|
|
40
40
|
* @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
|
|
41
41
|
*/
|
|
42
|
-
markKeyForDeletation(key: string): Promise<void>;
|
|
42
|
+
markKeyForDeletation(key: string): Promise<void>; //TODO delete after one year
|
|
43
|
+
markKeyForDeletion(key: string): Promise<void>;
|
|
43
44
|
|
|
44
45
|
|
|
45
46
|
/**
|
|
@@ -47,7 +48,8 @@ export interface StorageAdapter {
|
|
|
47
48
|
* This method should be used to cancel the deletion of the file if it was marked for deletion.
|
|
48
49
|
* @param key - The key of the file to be uploaded e.g. "uploads/file.txt"
|
|
49
50
|
*/
|
|
50
|
-
markKeyForNotDeletation(key: string): Promise<void>;
|
|
51
|
+
markKeyForNotDeletation(key: string): Promise<void>; //TODO delete after one year
|
|
52
|
+
markKeyForNotDeletion(key: string): Promise<void>;
|
|
51
53
|
|
|
52
54
|
|
|
53
55
|
/**
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export type { EmailAdapter } from './EmailAdapter.js';
|
|
2
2
|
export type { CompletionAdapter } from './CompletionAdapter.js';
|
|
3
3
|
export type { ImageGenerationAdapter } from './ImageGenerationAdapter.js';
|
|
4
|
+
export type { KeyValueAdapter } from './KeyValueAdapter.js';
|
|
5
|
+
export type { ImageVisionAdapter } from './ImageVisionAdapter.js';
|
|
4
6
|
export type { OAuth2Adapter } from './OAuth2Adapter.js';
|
|
5
7
|
export type { StorageAdapter } from './StorageAdapter.js';
|
|
8
|
+
export type { CaptchaAdapter } from './CaptchaAdapter.js';
|