adminizer 4.6.0 → 4.7.0-build.222
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/Readme.md +12 -0
- package/assets/RelationDialogStack-CnHFOYyR.css +1 -0
- package/assets/RelationDialogStack-DI2bZxQX.js +20 -0
- package/assets/add-DCQ7ZW4B.js +1 -0
- package/assets/add-group-DCVPryBo.js +1 -0
- package/assets/add-group-form-DKRXC2n-.js +1 -0
- package/assets/add-user-B7OOiYxv.js +1 -0
- package/assets/add-user-form-UXAToWQd.js +1 -0
- package/assets/app-AKbNCggP.css +1 -0
- package/assets/app-layout-6EwNBvnR.js +1 -0
- package/assets/app-shell-D8wtkECO.js +1 -0
- package/assets/app-sidebar-DfGjL-2K.js +1 -0
- package/assets/app-sidebar-header-BZbIBQjq.js +1 -0
- package/assets/app.js +59 -7990
- package/assets/breadcrumbs-CODaqVkB.js +1 -0
- package/assets/catalog-DVvFGa2X.js +6 -0
- package/assets/dashboard-BadoiH_a.js +3 -0
- package/assets/date-picker-DSOkNiNo.js +1 -0
- package/assets/del-modal-Cd4M7af8.js +1 -0
- package/assets/dynamic-controls-BsrJhPDY.js +1 -0
- package/assets/geo-json-CzR5JBXL.js +1 -0
- package/assets/handsontable-BI98OF5R.js +336 -0
- package/assets/history-D1iLA6rs.js +1 -0
- package/assets/home-DbWj-W_k.js +2 -0
- package/assets/icon-C2JNaLxH.js +1 -0
- package/assets/init-user-D2HSyXup.js +1 -0
- package/assets/input-error-CH2caTtO.js +1 -0
- package/assets/jsoneditor-DVNQmA6G.js +3869 -0
- package/assets/list-CVoljVUw.js +4 -0
- package/assets/login-DFSLEO17.js +1 -0
- package/assets/manifest.json +246 -273
- package/assets/material-icon-Bx9pGQiQ.js +1 -0
- package/assets/media-manager-WcKe1EvD.js +6 -0
- package/assets/module-DJsC37CM.js +1 -0
- package/assets/monaco-Bl4zdWCn.js +11 -0
- package/assets/nav-footer-BiSQkPt4.js +1 -0
- package/assets/nav-main-rTH0PfDw.js +1 -0
- package/assets/nav-user-Bj6cWs0a.js +1 -0
- package/assets/notification-DKrNfaAB.js +20 -0
- package/assets/pagination-render-AKJvTIRA.js +1 -0
- package/assets/register-BTP4uxsK.js +1 -0
- package/assets/ru-eW0WKkga.js +1 -0
- package/assets/theme-switcher-Dm8EOGzx.js +1 -0
- package/assets/toast-editor-DOg_gvSp.js +668 -0
- package/assets/user-filters-list-C9R9J6Om.js +1 -0
- package/assets/user-info-BgSbT02v.js +1 -0
- package/assets/user-menu-content-TQTXHIv6.js +1 -0
- package/assets/{vanilla-picker-l5rcX3cq.js → vanilla-picker-B3LgXoKV.js} +1 -7
- package/assets/welcome-BwDlAOGh.js +1 -0
- package/controllers/add.d.ts +1 -1
- package/controllers/add.js +20 -26
- package/controllers/addGroup.d.ts +1 -1
- package/controllers/addGroup.js +7 -15
- package/controllers/addUser.d.ts +1 -1
- package/controllers/addUser.js +10 -16
- package/controllers/catalog/Catalog.d.ts +1 -1
- package/controllers/catalog/Catalog.js +1 -10
- package/controllers/catalog/FrontendCatalogAdapter.d.ts +3 -3
- package/controllers/catalog/FrontendCatalogAdapter.js +0 -6
- package/controllers/catalog/FrontentCatalogAdapter.d.ts +3 -3
- package/controllers/catalog/FrontentCatalogAdapter.js +0 -4
- package/controllers/ckeditorUpload.js +2 -18
- package/controllers/dashboard.d.ts +1 -1
- package/controllers/dashboard.js +2 -5
- package/controllers/edit.js +24 -37
- package/controllers/editGroup.d.ts +1 -1
- package/controllers/editGroup.js +10 -21
- package/controllers/editUser.d.ts +1 -1
- package/controllers/editUser.js +11 -23
- package/controllers/exportData.d.ts +6 -0
- package/controllers/exportData.js +315 -0
- package/controllers/feed.d.ts +6 -0
- package/controllers/feed.js +73 -0
- package/controllers/feedback/feedbackController.d.ts +1 -1
- package/controllers/feedback/feedbackController.js +5 -7
- package/controllers/filter-fields/columns.d.ts +11 -0
- package/controllers/filter-fields/columns.js +106 -0
- package/controllers/filter-fields/filterFields.d.ts +10 -0
- package/controllers/filter-fields/filterFields.js +141 -0
- package/controllers/filter-fields/getAllUserFilters.d.ts +6 -0
- package/controllers/filter-fields/getAllUserFilters.js +115 -0
- package/controllers/filter-fields/groups.d.ts +5 -0
- package/controllers/filter-fields/groups.js +26 -0
- package/controllers/filter-fields/savedFilters.d.ts +25 -0
- package/controllers/filter-fields/savedFilters.js +317 -0
- package/controllers/getAllWidgets.d.ts +1 -1
- package/controllers/getAllWidgets.js +1 -9
- package/controllers/history-actions/HistoryController.js +6 -31
- package/controllers/initUser.js +6 -5
- package/controllers/inlineUpdate.d.ts +7 -0
- package/controllers/inlineUpdate.js +148 -0
- package/controllers/list.d.ts +1 -1
- package/controllers/list.js +383 -70
- package/controllers/listUserFilters.d.ts +5 -0
- package/controllers/listUserFilters.js +26 -0
- package/controllers/login.js +2 -2
- package/controllers/media-manager/mediaManagerApi.js +0 -9
- package/controllers/navigation/edit.js +3 -9
- package/controllers/notifications/NotificationController.d.ts +1 -1
- package/controllers/notifications/NotificationController.js +12 -36
- package/controllers/register.js +10 -9
- package/controllers/remove.js +10 -19
- package/controllers/timezones.d.ts +1 -1
- package/controllers/timezones.js +0 -6
- package/controllers/userApiKey.d.ts +7 -0
- package/controllers/userApiKey.js +36 -0
- package/controllers/view.js +14 -26
- package/controllers/welcome.d.ts +1 -1
- package/controllers/welcome.js +0 -4
- package/controllers/widgets/Action.d.ts +1 -1
- package/controllers/widgets/Action.js +1 -9
- package/controllers/widgets/Custom.d.ts +1 -1
- package/controllers/widgets/Custom.js +1 -9
- package/controllers/widgets/Info.d.ts +1 -1
- package/controllers/widgets/Info.js +1 -9
- package/controllers/widgets/filterInfo.d.ts +1 -0
- package/controllers/widgets/filterInfo.js +44 -0
- package/controllers/widgets/switch.d.ts +1 -1
- package/controllers/widgets/switch.js +1 -9
- package/controllers/widgetsDB.d.ts +1 -1
- package/controllers/widgetsDB.js +2 -8
- package/helpers/accessRightsHelper.d.ts +1 -1
- package/helpers/accessRightsHelper.js +5 -4
- package/helpers/apiKeyHelper.d.ts +5 -0
- package/helpers/apiKeyHelper.js +8 -0
- package/helpers/configHelper.js +12 -15
- package/helpers/controllerHelper.d.ts +14 -21
- package/helpers/controllerHelper.js +50 -83
- package/helpers/fieldsHelper.js +3 -3
- package/helpers/filterDatetimeHelper.d.ts +5 -0
- package/helpers/filterDatetimeHelper.js +84 -0
- package/helpers/inertiaActionsHelper.d.ts +2 -2
- package/helpers/inertiaActionsHelper.js +5 -4
- package/helpers/inertiaAddHelper.d.ts +3 -414
- package/helpers/inertiaAddHelper.js +39 -15
- package/helpers/inertiaGroupHelper.d.ts +2 -2
- package/helpers/inertiaGroupHelper.js +3 -3
- package/helpers/inertiaListHelper.d.ts +7 -3
- package/helpers/inertiaListHelper.js +26 -12
- package/helpers/inertiaMenuHelper.d.ts +1 -0
- package/helpers/inertiaMenuHelper.js +15 -3
- package/helpers/inertiaUserHelper.d.ts +3 -2
- package/helpers/inertiaUserHelper.js +7 -3
- package/helpers/menuHelper.d.ts +5 -2
- package/helpers/menuHelper.js +64 -12
- package/helpers/viteHelper.js +1 -2
- package/index.d.ts +6 -2
- package/index.js +6 -2
- package/interfaces/adminpanelConfig.d.ts +126 -39
- package/interfaces/internalModelAccess.d.ts +37 -0
- package/interfaces/internalModelAccess.js +1 -0
- package/interfaces/listQueryBuilder.d.ts +22 -0
- package/interfaces/listQueryBuilder.js +1 -0
- package/interfaces/queryCriteria.d.ts +54 -0
- package/interfaces/queryCriteria.js +1 -0
- package/interfaces/types.d.ts +1 -13
- package/lib/Adminizer.d.ts +4 -2
- package/lib/Adminizer.js +29 -10
- package/lib/DataAccessor.d.ts +8 -5
- package/lib/DataAccessor.js +89 -42
- package/lib/I18n.d.ts +5 -1
- package/lib/I18n.js +45 -19
- package/lib/MiddlewareManager.d.ts +8 -0
- package/lib/MiddlewareManager.js +53 -0
- package/lib/ai-assistant/OpenAiModelService.d.ts +3 -3
- package/lib/ai-assistant/OpenAiModelService.js +23 -24
- package/lib/catalog/Navigation.d.ts +1 -0
- package/lib/catalog/Navigation.js +12 -11
- package/lib/controls/jsoneditor/JsonEditor.d.ts +1 -2
- package/lib/controls/markdown/ToastUiEditor.d.ts +1 -2
- package/lib/feedback/FeedbackHandler.js +2 -2
- package/lib/filters/ConditionValidator.d.ts +107 -0
- package/lib/filters/ConditionValidator.js +483 -0
- package/lib/filters/CustomFilterHandler.d.ts +122 -0
- package/lib/filters/CustomFilterHandler.js +131 -0
- package/lib/filters/FilterCustomFieldHandler.d.ts +2 -0
- package/lib/filters/FilterCustomFieldHandler.js +2 -0
- package/lib/filters/FilterService.d.ts +82 -0
- package/lib/filters/FilterService.js +323 -0
- package/lib/filters/index.d.ts +6 -0
- package/lib/filters/index.js +4 -0
- package/lib/history-actions/AbstractHistoryAdapter.d.ts +5 -4
- package/lib/history-actions/AbstractHistoryAdapter.js +45 -30
- package/lib/history-actions/DefaultHistoryAdapter.d.ts +2 -0
- package/lib/history-actions/DefaultHistoryAdapter.js +12 -6
- package/lib/history-actions/HistoryHandler.js +1 -1
- package/lib/list-query-builder/ListQueryBuilder.d.ts +117 -0
- package/lib/list-query-builder/ListQueryBuilder.js +707 -0
- package/lib/media-manager/AbstractMediaManager.d.ts +9 -8
- package/lib/media-manager/DefaultMediaManager.d.ts +2 -0
- package/lib/media-manager/DefaultMediaManager.js +27 -15
- package/lib/media-manager/Items.d.ts +4 -1
- package/lib/media-manager/Items.js +62 -59
- package/lib/media-manager/MediaManagerHandler.js +1 -1
- package/lib/media-manager/helpers/MediaManagerHelper.d.ts +5 -1
- package/lib/media-manager/helpers/MediaManagerHelper.js +38 -4
- package/lib/model/AbstractModel.d.ts +33 -25
- package/lib/model/AbstractModel.js +54 -2
- package/lib/model/InternalModelAccessFactory.d.ts +18 -0
- package/lib/model/InternalModelAccessFactory.js +82 -0
- package/lib/model/ModelHandler.d.ts +6 -0
- package/lib/model/ModelHandler.js +14 -0
- package/lib/model/adapter/sequelize.d.ts +32 -10
- package/lib/model/adapter/sequelize.js +409 -62
- package/lib/model/adapter/typeorm.d.ts +62 -0
- package/lib/model/adapter/typeorm.js +777 -0
- package/lib/model/internalModelAccessToken.d.ts +1 -0
- package/lib/model/internalModelAccessToken.js +1 -0
- package/lib/model/internalModelRepository.d.ts +3 -0
- package/lib/model/internalModelRepository.js +4 -0
- package/lib/notifications/AbstractNotificationService.d.ts +3 -0
- package/lib/notifications/AbstractNotificationService.js +42 -36
- package/lib/notifications/GeneralNotificationService.js +37 -40
- package/lib/notifications/SystemNotificationService.js +33 -36
- package/lib/requestProcessor.js +0 -3
- package/lib/ui-i18n/getUiTranslations.d.ts +1 -0
- package/lib/ui-i18n/getUiTranslations.js +3 -0
- package/lib/ui-i18n/uiTranslationKeys.d.ts +6 -0
- package/lib/ui-i18n/uiTranslationKeys.js +268 -0
- package/lib/widgets/widgetHandler.d.ts +7 -2
- package/lib/widgets/widgetHandler.js +98 -18
- package/models/FilterAP.d.ts +116 -0
- package/models/FilterAP.js +68 -0
- package/models/FilterColumnAP.d.ts +32 -0
- package/models/FilterColumnAP.js +21 -0
- package/models/GroupAP.d.ts +1 -1
- package/models/HistoryActionsAP.d.ts +3 -3
- package/models/MediaManagerMetaAP.d.ts +1 -1
- package/models/NavigationAP.d.ts +1 -1
- package/models/UserAP.d.ts +6 -1
- package/models/UserAP.js +4 -0
- package/package.json +39 -32
- package/policies/authPolicies.d.ts +12 -0
- package/policies/authPolicies.js +104 -0
- package/policies/permissionResolvers.d.ts +12 -0
- package/policies/permissionResolvers.js +52 -0
- package/services/FeedService.d.ts +70 -0
- package/services/FeedService.js +334 -0
- package/system/Router.d.ts +1 -0
- package/system/Router.js +136 -59
- package/system/bindAccessRights.js +11 -30
- package/system/bindAuthorization.js +18 -18
- package/system/bindCors.js +16 -1
- package/system/bindCustomFilterHandlers.d.ts +2 -0
- package/system/bindCustomFilterHandlers.js +4 -0
- package/system/bindInertia.js +18 -61
- package/system/bindReqFunctions.js +10 -2
- package/system/bindTranslations.js +7 -3
- package/system/buildInternalModelAccess.d.ts +4 -0
- package/system/buildInternalModelAccess.js +59 -0
- package/system/defaults.js +18 -14
- package/system/routePolicies.d.ts +2 -0
- package/system/routePolicies.js +29 -0
- package/translations/en.json +151 -39
- package/translations/ru.json +211 -64
- package/ui/components/handsontable.js +13 -27
- package/ui/components/ui/dialog-stack.js +1 -3
- package/ui/components/ui/popover.js +1 -1
- package/ui/components/ui/sidebar.js +1 -1
- package/assets/RelationDialogStack-D9UVEF9s.js +0 -407
- package/assets/RelationDialogStack-DV8OITPR.css +0 -4
- package/assets/add-BlvzWQKF.js +0 -1
- package/assets/add-group-1Uoq9NWe.js +0 -1
- package/assets/add-group-form-B01gwDGu.js +0 -1
- package/assets/add-user-BQCAsaRy.js +0 -1
- package/assets/add-user-form-Cgwc9JkI.js +0 -1
- package/assets/app-DaOMy1nl.css +0 -72
- package/assets/app-layout-CAm60qoE.js +0 -1
- package/assets/app-shell-QWCtn9ye.js +0 -1
- package/assets/app-sidebar-CfaYbnSy.js +0 -1
- package/assets/app-sidebar-header-BsPFDhZ8.js +0 -1
- package/assets/breadcrumbs-CZZirDj8.js +0 -1
- package/assets/catalog-k5myk7fk.js +0 -6
- package/assets/dashboard-BkL9ybBw.js +0 -3
- package/assets/date-picker-B5AZ_7Q9.js +0 -1
- package/assets/del-modal-BoyXZloG.js +0 -1
- package/assets/dynamic-controls-k61T9W2P.js +0 -1
- package/assets/form-1WGY0YgG.js +0 -1
- package/assets/form-DJapG3qF.js +0 -1
- package/assets/geo-json-DsMUHo0l.js +0 -4
- package/assets/handsontable-PxYdjN8c.js +0 -298
- package/assets/history-CluyR-yJ.js +0 -1
- package/assets/home-Dug9zBzM.js +0 -2
- package/assets/icon-DfDLMG5f.js +0 -1
- package/assets/init-user-CF80MEnT.js +0 -1
- package/assets/input-error-DuuqFgZa.js +0 -1
- package/assets/jsoneditor-De1FvcYu.js +0 -3882
- package/assets/list-CuexshNt.js +0 -1
- package/assets/list-table-BsEWjTKY.js +0 -22
- package/assets/login-eDemYzN-.js +0 -1
- package/assets/material-icon-DMT8KdmE.js +0 -1
- package/assets/media-manager-DfYa_mT_.js +0 -14
- package/assets/module-Cd4Tm6uq.js +0 -1
- package/assets/monaco-BhBYtg3d.js +0 -11
- package/assets/nav-footer-D3olYxtz.js +0 -1
- package/assets/nav-main-BctqyzeV.js +0 -1
- package/assets/nav-user-Bn1Lt-BZ.js +0 -1
- package/assets/notification-D64qvni-.js +0 -27
- package/assets/pagination-render-DxD78ahJ.js +0 -1
- package/assets/register-349PwYbe.js +0 -1
- package/assets/theme-switcher-DfExsHW2.js +0 -1
- package/assets/toast-editor-ESK5iWPx.js +0 -845
- package/assets/user-info-DtBK5Kh8.js +0 -1
- package/assets/user-menu-content-0XYOCMaA.js +0 -1
- package/assets/welcome-PDp-gUei.js +0 -1
- package/controllers/form.d.ts +0 -1
- package/controllers/form.js +0 -86
- package/helpers/formHelper.d.ts +0 -6
- package/helpers/formHelper.js +0 -38
- package/helpers/inertiaFromHelper.d.ts +0 -11
- package/helpers/inertiaFromHelper.js +0 -98
- package/helpers/runtimeMode.d.ts +0 -1
- package/helpers/runtimeMode.js +0 -3
- package/lib/PolicyManager.d.ts +0 -8
- package/lib/PolicyManager.js +0 -53
- package/lib/datatable/NodeTable.d.ts +0 -49
- package/lib/datatable/NodeTable.js +0 -207
- package/lib/model/adapter/waterline.d.ts +0 -32
- package/lib/model/adapter/waterline.js +0 -180
- package/migrations/index.d.ts +0 -3
- package/migrations/index.js +0 -4
- package/migrations/knex/20250106000001_adminizer_init.d.ts +0 -8
- package/migrations/knex/20250106000001_adminizer_init.js +0 -164
- package/migrations/umzug/0001.d.ts +0 -7
- package/migrations/umzug/0001.js +0 -121
- package/migrations/umzugExports.d.ts +0 -2
- package/migrations/umzugExports.js +0 -9
- package/system/bindForms.d.ts +0 -2
- package/system/bindForms.js +0 -20
- /package/{policies → middlewares}/addMessages.d.ts +0 -0
- /package/{policies → middlewares}/addMessages.js +0 -0
- /package/{policies → middlewares}/checkAuth.d.ts +0 -0
- /package/{policies → middlewares}/checkAuth.js +0 -0
- /package/{policies → middlewares}/setLocale.d.ts +0 -0
- /package/{policies → middlewares}/setLocale.js +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FilterColumnAP model schema
|
|
3
|
+
* Represents column configuration for a filter
|
|
4
|
+
*/
|
|
5
|
+
export default {
|
|
6
|
+
id: {
|
|
7
|
+
type: "number",
|
|
8
|
+
autoIncrement: true,
|
|
9
|
+
primaryKey: true
|
|
10
|
+
},
|
|
11
|
+
filter: {
|
|
12
|
+
model: 'FilterAP'
|
|
13
|
+
},
|
|
14
|
+
fieldName: {
|
|
15
|
+
type: "string",
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
18
|
+
order: {
|
|
19
|
+
type: "number"
|
|
20
|
+
}
|
|
21
|
+
};
|
package/models/GroupAP.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ declare const _default: {
|
|
|
42
42
|
};
|
|
43
43
|
export default _default;
|
|
44
44
|
export interface HistoryActionsAP {
|
|
45
|
-
id
|
|
45
|
+
id?: number;
|
|
46
46
|
modelId: number | string;
|
|
47
47
|
modelName: string;
|
|
48
48
|
action: string;
|
|
@@ -50,7 +50,7 @@ export interface HistoryActionsAP {
|
|
|
50
50
|
diff: any;
|
|
51
51
|
user: UserAP;
|
|
52
52
|
isCurrent: boolean;
|
|
53
|
-
createdAt
|
|
54
|
-
updatedAt
|
|
53
|
+
createdAt?: number;
|
|
54
|
+
updatedAt?: number;
|
|
55
55
|
preview: boolean;
|
|
56
56
|
}
|
package/models/NavigationAP.d.ts
CHANGED
package/models/UserAP.d.ts
CHANGED
|
@@ -52,10 +52,14 @@ declare const _default: {
|
|
|
52
52
|
isConfirmed: {
|
|
53
53
|
type: string;
|
|
54
54
|
};
|
|
55
|
+
apiKey: {
|
|
56
|
+
type: string;
|
|
57
|
+
field: string;
|
|
58
|
+
};
|
|
55
59
|
};
|
|
56
60
|
export default _default;
|
|
57
61
|
export interface UserAP {
|
|
58
|
-
id
|
|
62
|
+
id?: number;
|
|
59
63
|
login: string;
|
|
60
64
|
fullName?: string;
|
|
61
65
|
email?: string;
|
|
@@ -73,4 +77,5 @@ export interface UserAP {
|
|
|
73
77
|
layout: WidgetsLayouts;
|
|
74
78
|
};
|
|
75
79
|
isConfirmed?: boolean;
|
|
80
|
+
apiKey?: string;
|
|
76
81
|
}
|
package/models/UserAP.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adminizer",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.7.0-build.222",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./index.js",
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
"test": "vitest --watch=false",
|
|
14
14
|
"test:watch": "vitest --reporter verbose",
|
|
15
15
|
"start": "cross-env NO_SEED_DATA=true ORM=sequelize tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
16
|
-
"
|
|
17
|
-
"dev": "cross-env
|
|
18
|
-
"
|
|
19
|
-
"dev:
|
|
20
|
-
"dev:
|
|
21
|
-
"dev:
|
|
22
|
-
"dev:cors": "cross-env
|
|
16
|
+
"dev": "cross-env ADMINIZER_ENV=dev ORM=sequelize tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
17
|
+
"dev:no-seed": "cross-env ADMINIZER_ENV=dev NO_SEED_DATA=true ORM=sequelize tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
18
|
+
"start:typeorm": "cross-env NO_SEED_DATA=true ORM=typeorm tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
19
|
+
"dev:typeorm": "cross-env ADMINIZER_ENV=dev ORM=typeorm tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
20
|
+
"dev:typeorm:no-seed": "cross-env ADMINIZER_ENV=dev NO_SEED_DATA=true ORM=typeorm tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
21
|
+
"dev:no-seed-clean": "cross-env ADMINIZER_ENV=dev NO_SEED_DATA=true CLEAN_TMP=true ORM=sequelize tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
22
|
+
"dev:cors": "cross-env ADMINIZER_ENV=dev NO_SEED_DATA=true ORM=sequelize FRONTEND_URL=http://localhost:8080 tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
23
23
|
"build:assets": "vite build",
|
|
24
24
|
"compile:backend": "tsc -p src/tsconfig.json && node ./scripts/appendJsExtension.js",
|
|
25
25
|
"compile:ui": "tsc -p tsconfig.ui.json",
|
|
@@ -33,8 +33,10 @@
|
|
|
33
33
|
"copy:modules": "node copy-modules.js",
|
|
34
34
|
"build:assets:modules": "npm run build:assets && npm run copy:modules",
|
|
35
35
|
"start:seed": "cross-env ORM=sequelize tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
36
|
+
"start:typeorm:seed": "cross-env ORM=typeorm tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
36
37
|
"demo:build": "npm run copy:backend && npm run compile:backend && npm run build:assets && npm run copy:modules",
|
|
37
|
-
"demo": "cross-env ORM=sequelize tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts"
|
|
38
|
+
"demo": "cross-env ORM=sequelize tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
39
|
+
"demo:typeorm": "cross-env ORM=typeorm tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts"
|
|
38
40
|
},
|
|
39
41
|
"keywords": [],
|
|
40
42
|
"author": "Siziy Ivan <xziy88@gmail.com>",
|
|
@@ -48,25 +50,26 @@
|
|
|
48
50
|
"url": "https://github.com/adminization/adminizer"
|
|
49
51
|
},
|
|
50
52
|
"dependencies": {
|
|
53
|
+
"@handsontable/react-wrapper": "^17.0.1",
|
|
51
54
|
"@minoru/react-dnd-treeview": "^3.5.2",
|
|
52
55
|
"@radix-ui/react-context-menu": "^2.2.15",
|
|
53
56
|
"@radix-ui/react-tabs": "^1.1.12",
|
|
54
|
-
"body-parser": "^
|
|
57
|
+
"body-parser": "^2.2.2",
|
|
55
58
|
"chalk": "^5.4.1",
|
|
56
59
|
"cmdk": "^1.1.1",
|
|
57
60
|
"cookie": "^1.0.2",
|
|
58
61
|
"cookie-parser": "^1.4.7",
|
|
59
|
-
"cors": "^2.8.
|
|
62
|
+
"cors": "^2.8.6",
|
|
60
63
|
"crypto-puzzle": "^5.0.2",
|
|
61
64
|
"date-fns": "^3.6.0",
|
|
62
65
|
"deep-object-diff": "^1.1.9",
|
|
63
|
-
"dotenv": "^17.
|
|
64
|
-
"express": "^
|
|
65
|
-
"express-session": "^1.
|
|
66
|
+
"dotenv": "^17.4.2",
|
|
67
|
+
"express": "^5.2.1",
|
|
68
|
+
"express-session": "^1.19.0",
|
|
66
69
|
"image-size": "^2.0.2",
|
|
67
|
-
"jsonwebtoken": "^9.0.
|
|
70
|
+
"jsonwebtoken": "^9.0.3",
|
|
68
71
|
"material-icons": "^1.13.14",
|
|
69
|
-
"multer": "^1.
|
|
72
|
+
"multer": "^2.1.1",
|
|
70
73
|
"next-themes": "^0.4.6",
|
|
71
74
|
"password-hash": "^1.2.2",
|
|
72
75
|
"react-cropper": "^2.3.3",
|
|
@@ -77,8 +80,8 @@
|
|
|
77
80
|
"sprintf-js": "^1.1.3",
|
|
78
81
|
"typeorm": "^0.3.20",
|
|
79
82
|
"uuid": "^11.0.5",
|
|
80
|
-
"waterline": "^0.15.2",
|
|
81
83
|
"winston": "^3.17.0",
|
|
84
|
+
"xlsx": "^0.18.5",
|
|
82
85
|
"zod": "^4.1.11"
|
|
83
86
|
},
|
|
84
87
|
"devDependencies": {
|
|
@@ -88,8 +91,7 @@
|
|
|
88
91
|
"@dnd-kit/sortable": "^10.0.0",
|
|
89
92
|
"@eslint/compat": "^1.2.9",
|
|
90
93
|
"@faker-js/faker": "^9.7.0",
|
|
91
|
-
"@
|
|
92
|
-
"@inertiajs/react": "^2.2.0",
|
|
94
|
+
"@inertiajs/react": "^3.0.3",
|
|
93
95
|
"@monaco-editor/react": "^4.7.0",
|
|
94
96
|
"@openai/agents": "^0.3.2",
|
|
95
97
|
"@radix-ui/react-avatar": "^1.1.3",
|
|
@@ -112,15 +114,15 @@
|
|
|
112
114
|
"@toast-ui/react-editor": "^3.2.3",
|
|
113
115
|
"@types/cookie-parser": "^1.4.8",
|
|
114
116
|
"@types/cors": "^2.8.17",
|
|
115
|
-
"@types/express": "^5.0.
|
|
116
|
-
"@types/express-session": "^1.
|
|
117
|
+
"@types/express": "^5.0.6",
|
|
118
|
+
"@types/express-session": "^1.19.0",
|
|
117
119
|
"@types/he": "^1.2.3",
|
|
118
120
|
"@types/json-schema": "^7.0.15",
|
|
119
121
|
"@types/jsonwebtoken": "^9.0.9",
|
|
120
122
|
"@types/leaflet": "^1.9.17",
|
|
121
123
|
"@types/lodash": "^4.17.17",
|
|
122
124
|
"@types/lodash-es": "^4.17.12",
|
|
123
|
-
"@types/multer": "^1.
|
|
125
|
+
"@types/multer": "^2.1.0",
|
|
124
126
|
"@types/node": "^22.10.5",
|
|
125
127
|
"@types/password-hash": "^1.2.24",
|
|
126
128
|
"@types/react": "^19.0.3",
|
|
@@ -128,16 +130,14 @@
|
|
|
128
130
|
"@types/react-grid-layout": "^1.3.5",
|
|
129
131
|
"@types/sprintf-js": "^1.1.4",
|
|
130
132
|
"@types/uuid": "^10.0.0",
|
|
131
|
-
"@types/waterline": "^0.13.9",
|
|
132
133
|
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
133
|
-
"@vitejs/plugin-react": "^
|
|
134
|
-
"babel-plugin-react-compiler": "^19.0.0-beta-e993439-20250405",
|
|
134
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
135
135
|
"ckeditor5": "^45.0.0",
|
|
136
136
|
"class-variance-authority": "^0.7.1",
|
|
137
137
|
"clsx": "^2.1.1",
|
|
138
138
|
"cross-env": "^7.0.3",
|
|
139
139
|
"eslint": "^9.26.0",
|
|
140
|
-
"handsontable": "^
|
|
140
|
+
"handsontable": "^17.0.1",
|
|
141
141
|
"isomorphic-webcrypto": "^2.3.8",
|
|
142
142
|
"json-schema": "^0.4.0",
|
|
143
143
|
"leaflet": "^1.9.4",
|
|
@@ -152,8 +152,6 @@
|
|
|
152
152
|
"react-leaflet": "^5.0.0",
|
|
153
153
|
"react-quill-new": "^3.4.6",
|
|
154
154
|
"react-simple-wysiwyg": "^3.2.2",
|
|
155
|
-
"sails-disk": "^2.1.2",
|
|
156
|
-
"sails-postgresql": "^5.0.1",
|
|
157
155
|
"sequelize": "^6.37.7",
|
|
158
156
|
"sequelize-typescript": "^2.1.6",
|
|
159
157
|
"shelljs": "^0.9.2",
|
|
@@ -161,13 +159,22 @@
|
|
|
161
159
|
"sqlite3": "^5.1.7",
|
|
162
160
|
"tailwind-merge": "^3.0.2",
|
|
163
161
|
"tailwindcss": "^4.0.15",
|
|
164
|
-
"tsx": "^4.
|
|
162
|
+
"tsx": "^4.21.0",
|
|
165
163
|
"tw-animate-css": "^1.2.5",
|
|
166
|
-
"typescript": "^
|
|
164
|
+
"typescript": "^6.0.3",
|
|
167
165
|
"vanilla-jsoneditor": "^3.1.1",
|
|
168
|
-
"vite": "^
|
|
166
|
+
"vite": "^7.3.2",
|
|
169
167
|
"vite-plugin-externals": "^0.6.2",
|
|
170
|
-
"vite-plugin-full-reload": "^1.2.0",
|
|
171
168
|
"vitest": "^3.0.7"
|
|
169
|
+
},
|
|
170
|
+
"overrides": {
|
|
171
|
+
"@toast-ui/react-editor": {
|
|
172
|
+
"react": "$react",
|
|
173
|
+
"react-dom": "$react-dom"
|
|
174
|
+
},
|
|
175
|
+
"react-day-picker": {
|
|
176
|
+
"react": "$react",
|
|
177
|
+
"react-dom": "$react-dom"
|
|
178
|
+
}
|
|
172
179
|
}
|
|
173
180
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type PermissionResolver = string | ((req: ReqType) => string | undefined);
|
|
2
|
+
export type GuardMode = "ui" | "api";
|
|
3
|
+
type GuardOptions = {
|
|
4
|
+
mode?: GuardMode;
|
|
5
|
+
};
|
|
6
|
+
export declare function requireAuthEnabled(): MiddlewareType;
|
|
7
|
+
export declare function requireAuthUI(): MiddlewareType;
|
|
8
|
+
export declare function requireAuthAPI(): MiddlewareType;
|
|
9
|
+
export declare function requireAdmin(options?: GuardOptions): MiddlewareType;
|
|
10
|
+
export declare function requirePermission(token: PermissionResolver, options?: GuardOptions): MiddlewareType;
|
|
11
|
+
export declare function requireAnyPermission(tokens: PermissionResolver[], options?: GuardOptions): MiddlewareType;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { redirectToLogin } from "../helpers/inertiaAutHelper.js";
|
|
2
|
+
function unauthorized(req, res, mode) {
|
|
3
|
+
if (mode === "ui") {
|
|
4
|
+
redirectToLogin(req, res);
|
|
5
|
+
return;
|
|
6
|
+
}
|
|
7
|
+
res.status(401).json({ error: req.i18n?.__("Unauthorized") || "Unauthorized" });
|
|
8
|
+
}
|
|
9
|
+
function forbidden(req, res, mode) {
|
|
10
|
+
if (mode === "ui") {
|
|
11
|
+
res.sendStatus(403);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
res.status(403).json({ error: req.i18n?.__("Forbidden") || "Forbidden" });
|
|
15
|
+
}
|
|
16
|
+
function resolveToken(token, req) {
|
|
17
|
+
if (typeof token === "function") {
|
|
18
|
+
return token(req);
|
|
19
|
+
}
|
|
20
|
+
return token;
|
|
21
|
+
}
|
|
22
|
+
export function requireAuthEnabled() {
|
|
23
|
+
return (req, res, next) => {
|
|
24
|
+
if (!req.adminizer.config.auth.enable) {
|
|
25
|
+
return res.status(403).json({ error: "Auth is disabled" });
|
|
26
|
+
}
|
|
27
|
+
return next();
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export function requireAuthUI() {
|
|
31
|
+
return (req, res, next) => {
|
|
32
|
+
if (req.adminizer.config.auth.enable && !req.user) {
|
|
33
|
+
unauthorized(req, res, "ui");
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
return next();
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function requireAuthAPI() {
|
|
40
|
+
return (req, res, next) => {
|
|
41
|
+
if (req.adminizer.config.auth.enable && !req.user) {
|
|
42
|
+
unauthorized(req, res, "api");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
return next();
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export function requireAdmin(options = {}) {
|
|
49
|
+
const mode = options.mode || "api";
|
|
50
|
+
return (req, res, next) => {
|
|
51
|
+
if (!req.adminizer.config.auth.enable) {
|
|
52
|
+
return next();
|
|
53
|
+
}
|
|
54
|
+
if (!req.user) {
|
|
55
|
+
unauthorized(req, res, mode);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (!req.user.isAdministrator) {
|
|
59
|
+
forbidden(req, res, mode);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
return next();
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export function requirePermission(token, options = {}) {
|
|
66
|
+
const mode = options.mode || "api";
|
|
67
|
+
return (req, res, next) => {
|
|
68
|
+
if (!req.adminizer.config.auth.enable) {
|
|
69
|
+
return next();
|
|
70
|
+
}
|
|
71
|
+
if (!req.user) {
|
|
72
|
+
unauthorized(req, res, mode);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const tokenId = resolveToken(token, req);
|
|
76
|
+
const hasPermission = req.adminizer.accessRightsHelper.hasPermission(tokenId, req.user);
|
|
77
|
+
if (!hasPermission) {
|
|
78
|
+
forbidden(req, res, mode);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
return next();
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export function requireAnyPermission(tokens, options = {}) {
|
|
85
|
+
const mode = options.mode || "api";
|
|
86
|
+
return (req, res, next) => {
|
|
87
|
+
if (!req.adminizer.config.auth.enable) {
|
|
88
|
+
return next();
|
|
89
|
+
}
|
|
90
|
+
if (!req.user) {
|
|
91
|
+
unauthorized(req, res, mode);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const tokenIds = tokens
|
|
95
|
+
.map((token) => resolveToken(token, req))
|
|
96
|
+
.filter((token) => Boolean(token));
|
|
97
|
+
const hasPermission = req.adminizer.accessRightsHelper.enoughPermissions(tokenIds, req.user);
|
|
98
|
+
if (!hasPermission) {
|
|
99
|
+
forbidden(req, res, mode);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
return next();
|
|
103
|
+
};
|
|
104
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const GROUP_FILTER_VISIBILITY_TOKEN = "manage-group-filter-visibility";
|
|
2
|
+
export declare function modelReadToken(req: ReqType): string | undefined;
|
|
3
|
+
export declare function modelCreateToken(req: ReqType): string | undefined;
|
|
4
|
+
export declare function modelUpdateToken(req: ReqType): string | undefined;
|
|
5
|
+
export declare function modelDeleteToken(req: ReqType): string | undefined;
|
|
6
|
+
export declare function widgetToken(req: ReqType): string | undefined;
|
|
7
|
+
export declare function widgetsToken(): string;
|
|
8
|
+
export declare function catalogToken(req: ReqType): string | undefined;
|
|
9
|
+
export declare function mediaManagerToken(req: ReqType): string | undefined;
|
|
10
|
+
export declare function aiModelToken(req: ReqType): string | undefined;
|
|
11
|
+
export declare function historyToken(req: ReqType): string;
|
|
12
|
+
export declare function groupFilterVisibilityToken(): string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
function extractModelResourceName(req) {
|
|
2
|
+
if (req.params?.modelResourceName) {
|
|
3
|
+
return req.params.modelResourceName;
|
|
4
|
+
}
|
|
5
|
+
const path = req.path || req.originalUrl || "";
|
|
6
|
+
const match = path.match(/\/model\/([^/]+)/i);
|
|
7
|
+
return match?.[1];
|
|
8
|
+
}
|
|
9
|
+
export const GROUP_FILTER_VISIBILITY_TOKEN = "manage-group-filter-visibility";
|
|
10
|
+
export function modelReadToken(req) {
|
|
11
|
+
const modelResourceName = extractModelResourceName(req);
|
|
12
|
+
return modelResourceName ? `read-${modelResourceName}-model` : undefined;
|
|
13
|
+
}
|
|
14
|
+
export function modelCreateToken(req) {
|
|
15
|
+
const modelResourceName = extractModelResourceName(req);
|
|
16
|
+
return modelResourceName ? `create-${modelResourceName}-model` : undefined;
|
|
17
|
+
}
|
|
18
|
+
export function modelUpdateToken(req) {
|
|
19
|
+
const modelResourceName = extractModelResourceName(req);
|
|
20
|
+
return modelResourceName ? `update-${modelResourceName}-model` : undefined;
|
|
21
|
+
}
|
|
22
|
+
export function modelDeleteToken(req) {
|
|
23
|
+
const modelResourceName = extractModelResourceName(req);
|
|
24
|
+
return modelResourceName ? `delete-${modelResourceName}-model` : undefined;
|
|
25
|
+
}
|
|
26
|
+
export function widgetToken(req) {
|
|
27
|
+
const widgetId = req.params?.widgetId;
|
|
28
|
+
return widgetId ? `widget-${widgetId}` : undefined;
|
|
29
|
+
}
|
|
30
|
+
export function widgetsToken() {
|
|
31
|
+
return "widgets";
|
|
32
|
+
}
|
|
33
|
+
export function catalogToken(req) {
|
|
34
|
+
const slug = req.params?.slug;
|
|
35
|
+
if (!slug)
|
|
36
|
+
return undefined;
|
|
37
|
+
return `catalog-${slug}`;
|
|
38
|
+
}
|
|
39
|
+
export function mediaManagerToken(req) {
|
|
40
|
+
const id = req.params?.id;
|
|
41
|
+
return id ? `mediaManager-${id}` : undefined;
|
|
42
|
+
}
|
|
43
|
+
export function aiModelToken(req) {
|
|
44
|
+
const modelId = req.params?.modelId || (typeof req.body?.modelId === "string" ? req.body.modelId : undefined);
|
|
45
|
+
return modelId ? `ai-assistant-${modelId}` : undefined;
|
|
46
|
+
}
|
|
47
|
+
export function historyToken(req) {
|
|
48
|
+
return `history-${req.adminizer.config.history?.adapter ?? "default"}`;
|
|
49
|
+
}
|
|
50
|
+
export function groupFilterVisibilityToken() {
|
|
51
|
+
return GROUP_FILTER_VISIBILITY_TOKEN;
|
|
52
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Adminizer } from "../lib/Adminizer";
|
|
2
|
+
import { FilterAP } from "../models/FilterAP";
|
|
3
|
+
import { UserAP } from "../models/UserAP";
|
|
4
|
+
/**
|
|
5
|
+
* Feed export format types
|
|
6
|
+
*/
|
|
7
|
+
export type FeedFormat = 'json' | 'xml';
|
|
8
|
+
/**
|
|
9
|
+
* FeedService — generates public feed exports (Atom XML, JSON) by apiKey
|
|
10
|
+
* No authentication required — access is granted via apiKey alone
|
|
11
|
+
*/
|
|
12
|
+
export declare class FeedService {
|
|
13
|
+
private adminizer;
|
|
14
|
+
constructor(adminizer: Adminizer);
|
|
15
|
+
/**
|
|
16
|
+
* Find filter by apiKey and verify it's enabled
|
|
17
|
+
*/
|
|
18
|
+
findFilterByApiKey(apiKey: string): Promise<FilterAP | null>;
|
|
19
|
+
/**
|
|
20
|
+
* Fetch data for a filter (no auth required — public API)
|
|
21
|
+
* Bypasses permission checks by building fields directly from model config
|
|
22
|
+
* Also bypasses DataAccessor to avoid user-based filtering
|
|
23
|
+
*/
|
|
24
|
+
private fetchFilterData;
|
|
25
|
+
/**
|
|
26
|
+
* Build fields object directly from model attributes (bypasses permission checks)
|
|
27
|
+
*/
|
|
28
|
+
private buildFieldsFromAttributes;
|
|
29
|
+
/**
|
|
30
|
+
* Generate JSON feed
|
|
31
|
+
*/
|
|
32
|
+
generateJsonFeed(filter: FilterAP, adminizer?: Adminizer, user?: UserAP): Promise<any>;
|
|
33
|
+
/**
|
|
34
|
+
* Generate Atom XML feed
|
|
35
|
+
*/
|
|
36
|
+
generateAtomFeed(filter: FilterAP, adminizer?: Adminizer, user?: UserAP): Promise<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Build Atom XML string
|
|
39
|
+
*/
|
|
40
|
+
private buildAtomXml;
|
|
41
|
+
/**
|
|
42
|
+
* Escape XML special characters
|
|
43
|
+
*/
|
|
44
|
+
private escapeXml;
|
|
45
|
+
/**
|
|
46
|
+
* Prepare data for export — convert values to human-readable format
|
|
47
|
+
*/
|
|
48
|
+
private prepareExportData;
|
|
49
|
+
/**
|
|
50
|
+
* Format value for export based on type
|
|
51
|
+
*/
|
|
52
|
+
private formatExportValue;
|
|
53
|
+
/**
|
|
54
|
+
* Apply custom column configuration
|
|
55
|
+
*/
|
|
56
|
+
private applyCustomColumns;
|
|
57
|
+
/**
|
|
58
|
+
* Resolve the best field for "newest first" sorting.
|
|
59
|
+
* Priority: createdAt -> created_at -> id
|
|
60
|
+
*/
|
|
61
|
+
private resolveCreatedAtSortField;
|
|
62
|
+
/**
|
|
63
|
+
* Find title field in fields config
|
|
64
|
+
*/
|
|
65
|
+
private findTitleField;
|
|
66
|
+
/**
|
|
67
|
+
* Find date field in fields config
|
|
68
|
+
*/
|
|
69
|
+
private findDateField;
|
|
70
|
+
}
|