adminizer 4.7.0-build.222 → 5.0.0-build.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.
- package/Readme.md +2 -1
- package/assets/add-a4odXvQk.js +1 -0
- package/assets/add-group-D-NleXth.js +1 -0
- package/assets/add-user-B4SVJT5P.js +1 -0
- package/assets/app-CtWuWD5N.css +1 -0
- package/assets/app-layout-eaSzcROf.js +1 -0
- package/assets/app.js +35 -39
- package/assets/catalog-ByUICd5z.js +6 -0
- package/assets/controls/chunks/_commonjsHelpers-C6fGbg64.js +6 -0
- package/assets/controls/chunks/index-CjiZ2FIa.js +93 -0
- package/assets/controls/chunks/jsx-runtime-jIxVPx5o.js +31 -0
- package/assets/controls/chunks/use-appearance-CFLOwiSX.js +38 -0
- package/assets/controls/chunks/use-window-size-BXgBKW65.js +19 -0
- package/assets/controls/chunks/vanilla-picker-Dg97NL4h.js +529 -0
- package/assets/{RelationDialogStack-CnHFOYyR.css → controls/ckeditor.css} +1 -1
- package/assets/controls/ckeditor.es.js +83663 -0
- package/assets/controls/handsontable.css +1 -0
- package/assets/controls/handsontable.es.js +70550 -0
- package/assets/controls/jsoneditor.css +1 -0
- package/assets/controls/jsoneditor.es.js +42009 -0
- package/assets/controls/leaflet.css +1 -0
- package/assets/controls/leaflet.es.js +10299 -0
- package/assets/controls/monaco.es.js +618 -0
- package/assets/controls/toast-ui.css +1 -0
- package/assets/controls/toast-ui.es.js +41768 -0
- package/assets/dashboard-BYd8G2cW.js +3 -0
- package/assets/debounce-BMmXVQ06.js +1 -0
- package/assets/history-B8KIDy44.js +1 -0
- package/assets/init-user-8aUohVDq.js +1 -0
- package/assets/list-ChmtBGjG.js +4 -0
- package/assets/login-CO4laf6m.js +1 -0
- package/assets/manifest.json +60 -615
- package/assets/{media-manager-WcKe1EvD.js → media-manager-BDbpSSjH.js} +3 -3
- package/assets/module-D59aE9uv.js +1 -0
- package/assets/notification-DNoyfNmT.js +20 -0
- package/assets/register-DBYIMXGQ.js +1 -0
- package/assets/{ru-eW0WKkga.js → ru-rYKdQbWF.js} +1 -1
- package/assets/use-appearance-_EbbjHTh.js +1 -0
- package/assets/user-filters-list-BMFRwkYF.js +1 -0
- package/assets/welcome-37rNVUHt.js +1 -0
- package/controllers/add.d.ts +1 -1
- package/controllers/addGroup.js +3 -3
- package/controllers/addUser.js +3 -3
- package/controllers/catalog/Catalog.d.ts +1 -1
- package/controllers/catalog/Catalog.js +2 -1
- package/controllers/catalog/FrontendCatalogAdapter.d.ts +2 -12
- package/controllers/catalog/FrontendCatalogAdapter.js +3 -16
- package/controllers/catalog/FrontentCatalogAdapter.d.ts +2 -12
- package/controllers/catalog/FrontentCatalogAdapter.js +0 -16
- package/controllers/edit.js +6 -11
- package/controllers/editGroup.d.ts +1 -1
- package/controllers/editGroup.js +3 -3
- package/controllers/editUser.d.ts +1 -1
- package/controllers/editUser.js +3 -3
- package/controllers/feed.js +1 -1
- package/controllers/filter-fields/columns.js +1 -1
- package/controllers/filter-fields/getAllUserFilters.js +2 -2
- package/controllers/filter-fields/groups.js +2 -2
- package/controllers/filter-fields/savedFilters.js +1 -1
- package/controllers/history-actions/HistoryController.js +1 -1
- package/controllers/initUser.js +2 -2
- package/controllers/list.d.ts +1 -1
- package/controllers/login.d.ts +1 -1
- package/controllers/login.js +3 -3
- package/controllers/media-manager/ThumbController.js +2 -2
- package/controllers/media-manager/mediaManagerApi.js +13 -15
- package/controllers/register.d.ts +1 -1
- package/controllers/register.js +5 -5
- package/controllers/remove.d.ts +1 -1
- package/controllers/userApiKey.js +2 -2
- package/controllers/view.d.ts +1 -1
- package/controllers/view.js +5 -5
- package/controllers/widgets/Action.js +5 -2
- package/controllers/widgets/Info.js +1 -1
- package/controllers/widgets/filterInfo.js +1 -1
- package/files/favicon.png +0 -0
- package/helpers/accessRightsHelper.d.ts +6 -4
- package/helpers/accessRightsHelper.js +13 -0
- package/helpers/diffHelpers.js +1 -1
- package/helpers/fieldsHelper.d.ts +1 -1
- package/helpers/fieldsHelper.js +8 -4
- package/helpers/filterDatetimeHelper.d.ts +1 -1
- package/helpers/inertiaAddHelper.d.ts +6 -5
- package/helpers/inertiaAddHelper.js +45 -37
- package/helpers/inertiaAutHelper.js +5 -5
- package/helpers/inertiaGroupHelper.d.ts +4 -4
- package/helpers/inertiaMenuHelper.js +1 -1
- package/helpers/inertiaUserHelper.d.ts +3 -3
- package/helpers/inertiaUserHelper.js +1 -1
- package/helpers/menuHelper.d.ts +2 -2
- package/index.d.ts +18 -6
- package/index.js +18 -6
- package/interfaces/adminpanelConfig.d.ts +10 -33
- package/interfaces/global.d.ts +10 -15
- package/interfaces/listQueryBuilder.d.ts +1 -1
- package/lib/Adminizer.d.ts +25 -2
- package/lib/Adminizer.js +124 -50
- package/lib/DataAccessor.d.ts +9 -5
- package/lib/DataAccessor.js +89 -42
- package/lib/access-rights/AccessRightsHandler.d.ts +17 -0
- package/lib/access-rights/AccessRightsHandler.js +63 -0
- package/lib/ai-assistant/AbstractAiModelService.d.ts +5 -8
- package/lib/ai-assistant/AbstractAiModelService.js +3 -14
- package/lib/ai-assistant/AiAssistantHandler.d.ts +2 -2
- package/lib/app-manager/AdminizerApp.d.ts +228 -0
- package/lib/app-manager/AdminizerApp.js +17 -0
- package/lib/app-manager/AppManager.d.ts +18 -0
- package/lib/app-manager/AppManager.js +537 -0
- package/lib/app-manager/AssetHandler.d.ts +17 -0
- package/lib/app-manager/AssetHandler.js +67 -0
- package/lib/app-manager/ConfigLayerHandler.d.ts +18 -0
- package/lib/app-manager/ConfigLayerHandler.js +119 -0
- package/lib/app-manager/ControllerHandler.d.ts +25 -0
- package/lib/app-manager/ControllerHandler.js +140 -0
- package/lib/catalog/AbstractCatalog.d.ts +28 -19
- package/lib/catalog/AbstractCatalog.js +41 -10
- package/lib/catalog/CatalogHandler.d.ts +13 -0
- package/lib/catalog/CatalogHandler.js +48 -2
- package/lib/catalog/CatalogTemplateComponentHandler.d.ts +23 -0
- package/lib/catalog/CatalogTemplateComponentHandler.js +59 -0
- package/lib/controls/Control.d.ts +17 -0
- package/lib/controls/Control.js +1 -0
- package/lib/controls/ControlsHandler.d.ts +5 -6
- package/lib/controls/ControlsHandler.js +0 -13
- package/lib/controls/codeEditor/MonacoEditor.d.ts +3 -4
- package/lib/controls/codeEditor/MonacoEditor.js +13 -8
- package/lib/controls/geojsoneditor/GeoEditor.d.ts +3 -4
- package/lib/controls/geojsoneditor/GeoEditor.js +14 -9
- package/lib/controls/jsoneditor/JsonEditor.d.ts +5 -6
- package/lib/controls/jsoneditor/JsonEditor.js +14 -13
- package/lib/controls/markdown/ToastUiEditor.d.ts +5 -6
- package/lib/controls/markdown/ToastUiEditor.js +14 -13
- package/lib/controls/table/Handsontable.d.ts +5 -6
- package/lib/controls/table/Handsontable.js +14 -13
- package/lib/controls/wysiwyg/CKeditor.d.ts +5 -6
- package/lib/controls/wysiwyg/CKeditor.js +14 -13
- package/lib/filters/ConditionValidator.d.ts +1 -1
- package/lib/filters/FilterService.d.ts +18 -18
- package/lib/filters/FilterService.js +11 -11
- package/lib/history-actions/AbstractHistoryAdapter.d.ts +14 -14
- package/lib/history-actions/AbstractHistoryAdapter.js +5 -6
- package/lib/history-actions/DefaultHistoryAdapter.d.ts +7 -7
- package/lib/history-actions/DefaultHistoryAdapter.js +2 -2
- package/lib/list-query-builder/ListQueryBuilder.d.ts +1 -1
- package/lib/media-manager/AbstractMediaManager.d.ts +14 -3
- package/lib/media-manager/AbstractMediaManager.js +16 -5
- package/lib/media-manager/MediaManagerHandler.d.ts +3 -0
- package/lib/media-manager/MediaManagerHandler.js +30 -5
- package/lib/media-manager/Thumb.js +7 -13
- package/lib/media-manager/helpers/MediaManagerHelper.d.ts +6 -4
- package/lib/media-manager/helpers/MediaManagerHelper.js +18 -18
- package/lib/model/AbstractModel.d.ts +9 -5
- package/lib/model/AbstractModel.js +9 -13
- package/lib/model/InternalModelAccessFactory.js +9 -10
- package/lib/model/ModelHandler.d.ts +45 -7
- package/lib/model/ModelHandler.js +168 -11
- package/lib/model/adapter/sequelize.d.ts +2 -4
- package/lib/model/adapter/sequelize.js +16 -193
- package/lib/model/adapter/typeorm.d.ts +2 -4
- package/lib/model/adapter/typeorm.js +2 -35
- package/lib/notifications/AbstractNotificationService.d.ts +9 -9
- package/lib/notifications/AbstractNotificationService.js +8 -8
- package/lib/notifications/GeneralNotificationService.js +1 -1
- package/lib/notifications/SystemNotificationService.js +1 -1
- package/lib/ui-i18n/uiTranslationKeys.d.ts +1 -1
- package/lib/ui-i18n/uiTranslationKeys.js +1 -0
- package/lib/widgets/abstractCustom.d.ts +7 -2
- package/lib/widgets/abstractCustom.js +6 -0
- package/lib/widgets/abstractInfo.d.ts +4 -1
- package/lib/widgets/abstractWidgetBase.d.ts +2 -0
- package/lib/widgets/abstractWidgetBase.js +2 -0
- package/lib/widgets/widgetHandler.d.ts +6 -2
- package/lib/widgets/widgetHandler.js +70 -19
- package/models/{FilterAP.d.ts → Filter.d.ts} +4 -70
- package/models/Filter.js +1 -0
- package/models/FilterColumn.d.ts +10 -0
- package/models/FilterColumn.js +1 -0
- package/models/Group.d.ts +8 -0
- package/models/Group.js +1 -0
- package/models/HistoryActions.d.ts +14 -0
- package/models/HistoryActions.js +1 -0
- package/models/MediaManagerAP.d.ts +2 -54
- package/models/MediaManagerAP.js +1 -51
- package/models/MediaManagerAssociationsAP.d.ts +1 -35
- package/models/MediaManagerAssociationsAP.js +1 -33
- package/models/MediaManagerMetaAP.d.ts +2 -30
- package/models/MediaManagerMetaAP.js +1 -27
- package/models/Notification.d.ts +13 -0
- package/models/Notification.js +1 -0
- package/models/User.d.ts +23 -0
- package/models/User.js +1 -0
- package/models/UserNotification.d.ts +7 -0
- package/models/UserNotification.js +1 -0
- package/package.json +25 -30
- package/services/FeedService.d.ts +5 -5
- package/services/FeedService.js +1 -1
- package/system/Router.js +2 -10
- package/system/bindAccessRights.js +1 -1
- package/system/bindAuthorization.js +2 -2
- package/system/bindControls.js +7 -6
- package/system/bindDashboardWidgets.js +3 -2
- package/system/bindDev.js +1 -1
- package/system/bindHistory.d.ts +1 -1
- package/system/bindHistory.js +1 -1
- package/system/bindInertia.js +0 -6
- package/system/bindMediaManager.js +4 -17
- package/system/bindNotifications.d.ts +1 -1
- package/system/bindNotifications.js +1 -1
- package/system/bindReqFunctions.d.ts +1 -0
- package/system/bindReqFunctions.js +20 -3
- package/system/buildInternalModelAccess.js +2 -15
- package/system/defaults.js +5 -10
- package/system/systemModelContracts.d.ts +22 -0
- package/system/systemModelContracts.js +155 -0
- package/system/validateSystemModels.d.ts +2 -0
- package/system/validateSystemModels.js +101 -0
- package/translations/ar.json +2 -1
- package/translations/cn.json +2 -1
- package/translations/de.json +2 -1
- package/translations/en.json +1 -0
- package/translations/es.json +2 -1
- package/translations/fr.json +2 -1
- package/translations/hi.json +2 -1
- package/translations/jp.json +2 -1
- package/translations/ko.json +2 -1
- package/translations/pt.json +2 -1
- package/translations/ru.json +2 -1
- package/translations/ua.json +2 -1
- package/translations/uz.json +2 -1
- package/translations/vi.json +2 -1
- package/ui/components/VanillaJSONEditor.d.ts +1 -1
- package/ui/components/handsontable.d.ts +1 -1
- package/ui/components/ui/avatar.d.ts +3 -3
- package/ui/components/ui/badge.d.ts +1 -1
- package/ui/components/ui/breadcrumb.d.ts +7 -7
- package/ui/components/ui/button.d.ts +1 -1
- package/ui/components/ui/calendar.d.ts +1 -1
- package/ui/components/ui/card.d.ts +7 -7
- package/ui/components/ui/checkbox.d.ts +1 -1
- package/ui/components/ui/collapsible.d.ts +3 -3
- package/ui/components/ui/command.d.ts +9 -9
- package/ui/components/ui/context-menu.d.ts +15 -15
- package/ui/components/ui/dialog-stack.d.ts +10 -10
- package/ui/components/ui/dialog.d.ts +10 -10
- package/ui/components/ui/dropdown-menu.d.ts +15 -15
- package/ui/components/ui/input.d.ts +1 -1
- package/ui/components/ui/label.d.ts +1 -1
- package/ui/components/ui/menubar.d.ts +16 -16
- package/ui/components/ui/pagination.d.ts +7 -7
- package/ui/components/ui/popover.d.ts +4 -4
- package/ui/components/ui/select.d.ts +10 -10
- package/ui/components/ui/separator.d.ts +1 -1
- package/ui/components/ui/sheet.d.ts +8 -8
- package/ui/components/ui/sidebar.d.ts +23 -23
- package/ui/components/ui/skeleton.d.ts +1 -1
- package/ui/components/ui/slider.d.ts +1 -1
- package/ui/components/ui/sonner.d.ts +1 -1
- package/ui/components/ui/switch.d.ts +1 -1
- package/ui/components/ui/table.d.ts +8 -8
- package/ui/components/ui/tabs.d.ts +4 -4
- package/ui/components/ui/textarea.d.ts +1 -1
- package/ui/components/ui/tooltip.d.ts +4 -4
- package/assets/RelationDialogStack-DI2bZxQX.js +0 -20
- package/assets/add-DCQ7ZW4B.js +0 -1
- package/assets/add-group-DCVPryBo.js +0 -1
- package/assets/add-group-form-DKRXC2n-.js +0 -1
- package/assets/add-user-B7OOiYxv.js +0 -1
- package/assets/add-user-form-UXAToWQd.js +0 -1
- package/assets/app-AKbNCggP.css +0 -1
- package/assets/app-layout-6EwNBvnR.js +0 -1
- package/assets/app-shell-D8wtkECO.js +0 -1
- package/assets/app-sidebar-DfGjL-2K.js +0 -1
- package/assets/app-sidebar-header-BZbIBQjq.js +0 -1
- package/assets/breadcrumbs-CODaqVkB.js +0 -1
- package/assets/catalog-DVvFGa2X.js +0 -6
- package/assets/dashboard-BadoiH_a.js +0 -3
- package/assets/date-picker-DSOkNiNo.js +0 -1
- package/assets/del-modal-Cd4M7af8.js +0 -1
- package/assets/dynamic-controls-BsrJhPDY.js +0 -1
- package/assets/geo-json-CzR5JBXL.js +0 -1
- package/assets/handsontable-BI98OF5R.js +0 -336
- package/assets/history-D1iLA6rs.js +0 -1
- package/assets/home-DbWj-W_k.js +0 -2
- package/assets/icon-C2JNaLxH.js +0 -1
- package/assets/init-user-D2HSyXup.js +0 -1
- package/assets/input-error-CH2caTtO.js +0 -1
- package/assets/jsoneditor-DVNQmA6G.js +0 -3869
- package/assets/list-CVoljVUw.js +0 -4
- package/assets/login-DFSLEO17.js +0 -1
- package/assets/material-icon-Bx9pGQiQ.js +0 -1
- package/assets/module-DJsC37CM.js +0 -1
- package/assets/monaco-Bl4zdWCn.js +0 -11
- package/assets/nav-footer-BiSQkPt4.js +0 -1
- package/assets/nav-main-rTH0PfDw.js +0 -1
- package/assets/nav-user-Bj6cWs0a.js +0 -1
- package/assets/notification-DKrNfaAB.js +0 -20
- package/assets/pagination-render-AKJvTIRA.js +0 -1
- package/assets/register-BTP4uxsK.js +0 -1
- package/assets/theme-switcher-Dm8EOGzx.js +0 -1
- package/assets/toast-editor-DOg_gvSp.js +0 -668
- package/assets/user-filters-list-C9R9J6Om.js +0 -1
- package/assets/user-info-BgSbT02v.js +0 -1
- package/assets/user-menu-content-TQTXHIv6.js +0 -1
- package/assets/vanilla-picker-B3LgXoKV.js +0 -2
- package/assets/vendor-l0sNRNKZ.js +0 -1
- package/assets/welcome-BwDlAOGh.js +0 -1
- package/controllers/navigation/edit.d.ts +0 -1
- package/controllers/navigation/edit.js +0 -8
- package/lib/ai-assistant/DummyAiModelService.d.ts +0 -8
- package/lib/ai-assistant/DummyAiModelService.js +0 -14
- package/lib/ai-assistant/OpenAiModelService.d.ts +0 -24
- package/lib/ai-assistant/OpenAiModelService.js +0 -184
- package/lib/catalog/Navigation.d.ts +0 -49
- package/lib/catalog/Navigation.js +0 -492
- package/lib/controls/AbstractControls.d.ts +0 -30
- package/lib/controls/AbstractControls.js +0 -14
- package/lib/media-manager/DefaultMediaManager.d.ts +0 -20
- package/lib/media-manager/DefaultMediaManager.js +0 -127
- package/lib/media-manager/Items.d.ts +0 -50
- package/lib/media-manager/Items.js +0 -296
- package/models/FilterAP.js +0 -68
- package/models/FilterColumnAP.d.ts +0 -32
- package/models/FilterColumnAP.js +0 -21
- package/models/GroupAP.d.ts +0 -31
- package/models/GroupAP.js +0 -22
- package/models/HistoryActionsAP.d.ts +0 -56
- package/models/HistoryActionsAP.js +0 -42
- package/models/NavigationAP.d.ts +0 -22
- package/models/NavigationAP.js +0 -16
- package/models/NotificationAP.d.ts +0 -44
- package/models/NotificationAP.js +0 -30
- package/models/UserAP.d.ts +0 -81
- package/models/UserAP.js +0 -57
- package/models/UserNotificationAP.d.ts +0 -26
- package/models/UserNotificationAP.js +0 -18
- package/system/bindAiAssistant.d.ts +0 -2
- package/system/bindAiAssistant.js +0 -30
- package/system/bindModels.d.ts +0 -2
- package/system/bindModels.js +0 -48
- package/system/bindNavigation.d.ts +0 -2
- package/system/bindNavigation.js +0 -38
|
@@ -1,38 +1,4 @@
|
|
|
1
|
-
import { MediaManagerAP } from "./MediaManagerAP";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
id: {
|
|
4
|
-
type: string;
|
|
5
|
-
autoIncrement: boolean;
|
|
6
|
-
primaryKey: boolean;
|
|
7
|
-
};
|
|
8
|
-
mediaManagerId: {
|
|
9
|
-
type: string;
|
|
10
|
-
};
|
|
11
|
-
model: {
|
|
12
|
-
type: string;
|
|
13
|
-
};
|
|
14
|
-
modelId: {
|
|
15
|
-
type: string;
|
|
16
|
-
};
|
|
17
|
-
widgetName: {
|
|
18
|
-
type: string;
|
|
19
|
-
};
|
|
20
|
-
sortOrder: {
|
|
21
|
-
type: string;
|
|
22
|
-
};
|
|
23
|
-
file: {
|
|
24
|
-
model: string;
|
|
25
|
-
};
|
|
26
|
-
createdAt: {
|
|
27
|
-
type: string;
|
|
28
|
-
autoCreatedAt: boolean;
|
|
29
|
-
};
|
|
30
|
-
updatedAt: {
|
|
31
|
-
type: string;
|
|
32
|
-
autoUpdatedAt: boolean;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export default _default;
|
|
1
|
+
import type { MediaManagerAP } from "./MediaManagerAP";
|
|
36
2
|
export interface MediaManagerAssociationsAP {
|
|
37
3
|
id: string;
|
|
38
4
|
mediaManagerId?: string;
|
|
@@ -1,33 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
id: {
|
|
3
|
-
type: "number",
|
|
4
|
-
autoIncrement: true,
|
|
5
|
-
primaryKey: true
|
|
6
|
-
},
|
|
7
|
-
mediaManagerId: {
|
|
8
|
-
type: "string"
|
|
9
|
-
},
|
|
10
|
-
model: {
|
|
11
|
-
type: "string"
|
|
12
|
-
},
|
|
13
|
-
modelId: {
|
|
14
|
-
type: "string" // ✅ Changed: support for strings and numbers via casting to string
|
|
15
|
-
},
|
|
16
|
-
widgetName: {
|
|
17
|
-
type: "string"
|
|
18
|
-
},
|
|
19
|
-
sortOrder: {
|
|
20
|
-
type: "number"
|
|
21
|
-
},
|
|
22
|
-
file: {
|
|
23
|
-
model: "MediaManagerAP"
|
|
24
|
-
},
|
|
25
|
-
createdAt: {
|
|
26
|
-
type: 'datetime',
|
|
27
|
-
autoCreatedAt: true
|
|
28
|
-
},
|
|
29
|
-
updatedAt: {
|
|
30
|
-
type: 'datetime',
|
|
31
|
-
autoUpdatedAt: true
|
|
32
|
-
}
|
|
33
|
-
};
|
|
1
|
+
export {};
|
|
@@ -1,36 +1,8 @@
|
|
|
1
|
-
import { MediaManagerAP } from "./MediaManagerAP";
|
|
2
|
-
declare const _default: {
|
|
3
|
-
id: {
|
|
4
|
-
type: string;
|
|
5
|
-
autoIncrement: boolean;
|
|
6
|
-
primaryKey: boolean;
|
|
7
|
-
};
|
|
8
|
-
key: {
|
|
9
|
-
type: string;
|
|
10
|
-
};
|
|
11
|
-
value: {
|
|
12
|
-
type: string;
|
|
13
|
-
};
|
|
14
|
-
isPublic: {
|
|
15
|
-
type: string;
|
|
16
|
-
};
|
|
17
|
-
parent: {
|
|
18
|
-
model: string;
|
|
19
|
-
};
|
|
20
|
-
createdAt: {
|
|
21
|
-
type: string;
|
|
22
|
-
autoCreatedAt: boolean;
|
|
23
|
-
};
|
|
24
|
-
updatedAt: {
|
|
25
|
-
type: string;
|
|
26
|
-
autoUpdatedAt: boolean;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export default _default;
|
|
1
|
+
import type { MediaManagerAP } from "./MediaManagerAP";
|
|
30
2
|
export interface MediaManagerMetaAP {
|
|
31
3
|
id?: string;
|
|
32
4
|
key?: string;
|
|
33
|
-
value?:
|
|
5
|
+
value?: unknown;
|
|
34
6
|
isPublic?: boolean;
|
|
35
7
|
parent?: MediaManagerAP;
|
|
36
8
|
}
|
|
@@ -1,27 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
id: {
|
|
3
|
-
type: "number",
|
|
4
|
-
autoIncrement: true,
|
|
5
|
-
primaryKey: true
|
|
6
|
-
},
|
|
7
|
-
key: {
|
|
8
|
-
type: "string"
|
|
9
|
-
},
|
|
10
|
-
value: {
|
|
11
|
-
type: "json"
|
|
12
|
-
},
|
|
13
|
-
isPublic: {
|
|
14
|
-
type: "boolean"
|
|
15
|
-
},
|
|
16
|
-
parent: {
|
|
17
|
-
model: "MediaManagerAP"
|
|
18
|
-
},
|
|
19
|
-
createdAt: {
|
|
20
|
-
type: 'datetime',
|
|
21
|
-
autoCreatedAt: true
|
|
22
|
-
},
|
|
23
|
-
updatedAt: {
|
|
24
|
-
type: 'datetime',
|
|
25
|
-
autoUpdatedAt: true
|
|
26
|
-
}
|
|
27
|
-
};
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Model } from "sequelize";
|
|
2
|
+
export interface Notification {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
message: string;
|
|
6
|
+
channel: string;
|
|
7
|
+
notificationClass: string;
|
|
8
|
+
metadata?: Record<string, unknown>;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
}
|
|
11
|
+
export interface NotificationModel extends Model<Notification>, Notification {
|
|
12
|
+
toJSON(): Notification;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/models/User.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { WidgetConfig, WidgetsLayouts } from "../lib/widgets/widgetHandler";
|
|
2
|
+
import type { Group } from "./Group";
|
|
3
|
+
export interface User {
|
|
4
|
+
id?: number;
|
|
5
|
+
login: string;
|
|
6
|
+
fullName?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
avatar?: string;
|
|
9
|
+
passwordHashed?: string;
|
|
10
|
+
timezone?: string;
|
|
11
|
+
expires?: string;
|
|
12
|
+
locale?: string;
|
|
13
|
+
isDeleted?: boolean;
|
|
14
|
+
isActive?: boolean;
|
|
15
|
+
isAdministrator?: boolean;
|
|
16
|
+
groups?: Group[];
|
|
17
|
+
widgets?: {
|
|
18
|
+
widgets: WidgetConfig[];
|
|
19
|
+
layout: WidgetsLayouts;
|
|
20
|
+
};
|
|
21
|
+
isConfirmed?: boolean;
|
|
22
|
+
apiKey?: string;
|
|
23
|
+
}
|
package/models/User.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adminizer",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "5.0.0-build.0",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./index.js",
|
|
@@ -13,6 +13,7 @@
|
|
|
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
|
+
"start:seed": "cross-env ORM=sequelize tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
16
17
|
"dev": "cross-env ADMINIZER_ENV=dev ORM=sequelize tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
17
18
|
"dev:no-seed": "cross-env ADMINIZER_ENV=dev NO_SEED_DATA=true ORM=sequelize tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
18
19
|
"start:typeorm": "cross-env NO_SEED_DATA=true ORM=typeorm tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
@@ -20,28 +21,23 @@
|
|
|
20
21
|
"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
22
|
"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
23
|
"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
|
-
"build:assets": "vite build",
|
|
24
|
+
"build:assets": "vite build && vite build --config vite.config.controls.ts && vite build --config fixture/widgets/vite.config.widget.ts",
|
|
25
|
+
"build:controls": "vite build --config vite.config.controls.ts",
|
|
24
26
|
"compile:backend": "tsc -p src/tsconfig.json && node ./scripts/appendJsExtension.js",
|
|
25
27
|
"compile:ui": "tsc -p tsconfig.ui.json",
|
|
26
28
|
"tsc:watch": "tsc -w -p src/tsconfig.json",
|
|
27
29
|
"copy:backend": "node copy-backend.js",
|
|
28
30
|
"build:backend": "npm run copy:backend && npm run compile:backend",
|
|
29
31
|
"build": "npm run copy:backend && npm run compile:backend && npm run compile:ui && npm run build:assets",
|
|
30
|
-
"build:
|
|
31
|
-
"build:react-quill": "vite build --config modules/controls/wysiwyg/vite.config.react-quill.ts",
|
|
32
|
-
"build:catalog-modules": "vite build --config modules/testCatalog/vite.config.module.ts",
|
|
33
|
-
"copy:modules": "node copy-modules.js",
|
|
34
|
-
"build:assets:modules": "npm run build:assets && npm run copy:modules",
|
|
35
|
-
"start:seed": "cross-env ORM=sequelize tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
32
|
+
"build:catalog-modules": "cross-env CATALOG_COMPONENT=catalogAction vite build --config fixture/virtual-catalog/vite.config.module.ts && cross-env CATALOG_COMPONENT=Group vite build --config fixture/virtual-catalog/vite.config.module.ts",
|
|
36
33
|
"start:typeorm:seed": "cross-env ORM=typeorm tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
37
|
-
"
|
|
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"
|
|
34
|
+
"build:apps": "vite build --config fixture/apps/notification-sender/vite.config.module.ts && vite build --config fixture/apps/module-manager/vite.config.module.ts && vite build --config fixture/apps/navigation/vite.config.module.ts && vite build --config fixture/apps/quill-editor/vite.config.module.ts && vite build --config fixture/apps/widgets/vite.config.module.ts && vite build --config fixture/apps/handsontable-test/vite.config.module.ts && npm run build:catalog-modules"
|
|
40
35
|
},
|
|
41
36
|
"keywords": [],
|
|
42
37
|
"author": "Siziy Ivan <xziy88@gmail.com>",
|
|
43
38
|
"contributors": [
|
|
44
|
-
"Serebriakov Roman <rserebryakov1902@gmail.com>"
|
|
39
|
+
"Serebriakov Roman <rserebryakov1902@gmail.com>",
|
|
40
|
+
"Dmitriy Tihonov"
|
|
45
41
|
],
|
|
46
42
|
"license": "MIT",
|
|
47
43
|
"description": "A modern, framework-agnostic admin panel for Node.js with TypeScript backend and React frontend",
|
|
@@ -50,41 +46,42 @@
|
|
|
50
46
|
"url": "https://github.com/adminization/adminizer"
|
|
51
47
|
},
|
|
52
48
|
"dependencies": {
|
|
53
|
-
"@handsontable/react-wrapper": "^17.0.1",
|
|
54
|
-
"@minoru/react-dnd-treeview": "^3.5.2",
|
|
55
|
-
"@radix-ui/react-context-menu": "^2.2.15",
|
|
56
|
-
"@radix-ui/react-tabs": "^1.1.12",
|
|
57
49
|
"body-parser": "^2.2.2",
|
|
58
50
|
"chalk": "^5.4.1",
|
|
59
|
-
"cmdk": "^1.1.1",
|
|
60
51
|
"cookie": "^1.0.2",
|
|
61
52
|
"cookie-parser": "^1.4.7",
|
|
62
53
|
"cors": "^2.8.6",
|
|
63
54
|
"crypto-puzzle": "^5.0.2",
|
|
64
|
-
"date-fns": "^3.6.0",
|
|
65
55
|
"deep-object-diff": "^1.1.9",
|
|
66
|
-
"dotenv": "^17.4.2",
|
|
67
56
|
"express": "^5.2.1",
|
|
68
57
|
"express-session": "^1.19.0",
|
|
69
58
|
"image-size": "^2.0.2",
|
|
70
59
|
"jsonwebtoken": "^9.0.3",
|
|
71
|
-
"material-icons": "^1.13.14",
|
|
72
60
|
"multer": "^2.1.1",
|
|
73
|
-
"next-themes": "^0.4.6",
|
|
74
61
|
"password-hash": "^1.2.2",
|
|
75
|
-
"react-cropper": "^2.3.3",
|
|
76
|
-
"react-dnd": "^16.0.1",
|
|
77
|
-
"reflect-metadata": "^0.2.2",
|
|
78
|
-
"sequelize": "^6.37.7",
|
|
79
62
|
"sharp": "^0.33.5",
|
|
80
63
|
"sprintf-js": "^1.1.3",
|
|
81
|
-
"
|
|
82
|
-
"uuid": "^11.0.5",
|
|
64
|
+
"uuid": "^14.0.0",
|
|
83
65
|
"winston": "^3.17.0",
|
|
84
66
|
"xlsx": "^0.18.5",
|
|
85
|
-
"zod": "^4.1.11"
|
|
67
|
+
"zod": "^4.1.11",
|
|
68
|
+
"sqlite3": "^5.1.7",
|
|
69
|
+
"typeorm": "^0.3.20"
|
|
86
70
|
},
|
|
87
71
|
"devDependencies": {
|
|
72
|
+
"reflect-metadata": "^0.2.2",
|
|
73
|
+
"react-dnd": "^16.0.1",
|
|
74
|
+
"react-cropper": "^2.3.3",
|
|
75
|
+
"material-icons": "^1.13.14",
|
|
76
|
+
"next-themes": "^0.4.6",
|
|
77
|
+
"dotenv": "^17.4.2",
|
|
78
|
+
"date-fns": "^3.6.0",
|
|
79
|
+
"cmdk": "^1.1.1",
|
|
80
|
+
"@handsontable/react-wrapper": "^17.0.1",
|
|
81
|
+
"@minoru/react-dnd-treeview": "^3.5.2",
|
|
82
|
+
"@radix-ui/react-context-menu": "^2.2.15",
|
|
83
|
+
"@radix-ui/react-tabs": "^1.1.12",
|
|
84
|
+
"typescript": "^6.0.3",
|
|
88
85
|
"@babel/plugin-proposal-decorators": "^7.27.1",
|
|
89
86
|
"@ckeditor/ckeditor5-react": "^9.5.0",
|
|
90
87
|
"@dnd-kit/core": "^6.3.1",
|
|
@@ -156,12 +153,10 @@
|
|
|
156
153
|
"sequelize-typescript": "^2.1.6",
|
|
157
154
|
"shelljs": "^0.9.2",
|
|
158
155
|
"sonner": "^2.0.3",
|
|
159
|
-
"sqlite3": "^5.1.7",
|
|
160
156
|
"tailwind-merge": "^3.0.2",
|
|
161
157
|
"tailwindcss": "^4.0.15",
|
|
162
158
|
"tsx": "^4.21.0",
|
|
163
159
|
"tw-animate-css": "^1.2.5",
|
|
164
|
-
"typescript": "^6.0.3",
|
|
165
160
|
"vanilla-jsoneditor": "^3.1.1",
|
|
166
161
|
"vite": "^7.3.2",
|
|
167
162
|
"vite-plugin-externals": "^0.6.2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Adminizer } from "../lib/Adminizer";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Filter } from "../models/Filter";
|
|
3
|
+
import { User } from "../models/User";
|
|
4
4
|
/**
|
|
5
5
|
* Feed export format types
|
|
6
6
|
*/
|
|
@@ -15,7 +15,7 @@ export declare class FeedService {
|
|
|
15
15
|
/**
|
|
16
16
|
* Find filter by apiKey and verify it's enabled
|
|
17
17
|
*/
|
|
18
|
-
findFilterByApiKey(apiKey: string): Promise<
|
|
18
|
+
findFilterByApiKey(apiKey: string): Promise<Filter | null>;
|
|
19
19
|
/**
|
|
20
20
|
* Fetch data for a filter (no auth required — public API)
|
|
21
21
|
* Bypasses permission checks by building fields directly from model config
|
|
@@ -29,11 +29,11 @@ export declare class FeedService {
|
|
|
29
29
|
/**
|
|
30
30
|
* Generate JSON feed
|
|
31
31
|
*/
|
|
32
|
-
generateJsonFeed(filter:
|
|
32
|
+
generateJsonFeed(filter: Filter, adminizer?: Adminizer, user?: User): Promise<any>;
|
|
33
33
|
/**
|
|
34
34
|
* Generate Atom XML feed
|
|
35
35
|
*/
|
|
36
|
-
generateAtomFeed(filter:
|
|
36
|
+
generateAtomFeed(filter: Filter, adminizer?: Adminizer, user?: User): Promise<string>;
|
|
37
37
|
/**
|
|
38
38
|
* Build Atom XML string
|
|
39
39
|
*/
|
package/services/FeedService.js
CHANGED
package/system/Router.js
CHANGED
|
@@ -28,11 +28,10 @@ import { thumbController } from "../controllers/media-manager/ThumbController.js
|
|
|
28
28
|
import { Adminizer } from "../lib/Adminizer.js";
|
|
29
29
|
import timezones from "../controllers/timezones.js";
|
|
30
30
|
import { NotificationController } from "../controllers/notifications/NotificationController.js";
|
|
31
|
-
import { AiAssistantController } from "../controllers/ai/AiAssistantController.js";
|
|
32
31
|
import { HistoryController } from "../controllers/history-actions/HistoryController.js";
|
|
33
32
|
import listUserFilters from "../controllers/listUserFilters.js";
|
|
34
33
|
import { requireAnyPermission, requireAuthAPI, requireAuthEnabled, requireAuthUI, requirePermission } from "../policies/authPolicies.js";
|
|
35
|
-
import {
|
|
34
|
+
import { catalogToken, groupFilterVisibilityToken, historyToken, mediaManagerToken, modelCreateToken, modelDeleteToken, modelReadToken, modelUpdateToken, widgetToken, widgetsToken } from "../policies/permissionResolvers.js";
|
|
36
35
|
import { bindWithMiddlewares } from "./routePolicies.js";
|
|
37
36
|
export default class Router {
|
|
38
37
|
adminizer;
|
|
@@ -118,7 +117,7 @@ export default class Router {
|
|
|
118
117
|
/**
|
|
119
118
|
* Widgets Custom
|
|
120
119
|
*/
|
|
121
|
-
adminizer.app.all(`${adminizer.config.routePrefix}/widgets-
|
|
120
|
+
adminizer.app.all(`${adminizer.config.routePrefix}/widgets-custom/:widgetId`, withPolicies(widgetCustomController, requireAuthUI(), requirePermission(widgetToken, { mode: "ui" })));
|
|
122
121
|
/**
|
|
123
122
|
* Create a base ModelResource route
|
|
124
123
|
*/
|
|
@@ -164,12 +163,6 @@ export default class Router {
|
|
|
164
163
|
adminizer.app.post(`${adminizer.config.routePrefix}/history/get-model-history`, withPolicies(HistoryController.getAllModelHistory, requireAuthAPI(), requirePermission(historyToken)));
|
|
165
164
|
adminizer.app.post(`${adminizer.config.routePrefix}/history/get-model-fields`, withPolicies(HistoryController.getModelFieldsHistory, requireAuthAPI(), requirePermission(historyToken)));
|
|
166
165
|
}
|
|
167
|
-
if (adminizer.config.aiAssistant?.enabled) {
|
|
168
|
-
adminizer.app.get(`${adminizer.config.routePrefix}/api/ai-assistant/models`, withPolicies(AiAssistantController.getModels, requireAuthAPI()));
|
|
169
|
-
adminizer.app.get(`${adminizer.config.routePrefix}/api/ai-assistant/history/:modelId`, withPolicies(AiAssistantController.getHistory, requireAuthAPI(), requirePermission(aiModelToken)));
|
|
170
|
-
adminizer.app.post(`${adminizer.config.routePrefix}/api/ai-assistant/query`, withPolicies(AiAssistantController.sendMessage, requireAuthAPI(), requirePermission(aiModelToken)));
|
|
171
|
-
adminizer.app.delete(`${adminizer.config.routePrefix}/api/ai-assistant/history/:modelId`, withPolicies(AiAssistantController.resetHistory, requireAuthAPI(), requirePermission(aiModelToken)));
|
|
172
|
-
}
|
|
173
166
|
/**
|
|
174
167
|
* List of records
|
|
175
168
|
*/
|
|
@@ -251,7 +244,6 @@ export default class Router {
|
|
|
251
244
|
else {
|
|
252
245
|
adminizer.app.all(adminizer.config.routePrefix, withPolicies(_welcome, requireAuthUI()));
|
|
253
246
|
}
|
|
254
|
-
// TODO emit can be used in tests
|
|
255
247
|
adminizer.emitter.emit("router:bound");
|
|
256
248
|
}
|
|
257
249
|
unbindModelRoutes(model) {
|
|
@@ -30,7 +30,7 @@ export default async function bindAccessRights(adminizer) {
|
|
|
30
30
|
});
|
|
31
31
|
// Default user group
|
|
32
32
|
if (adminizer.config.registration && adminizer.config.registration.enable) {
|
|
33
|
-
const groupModel = adminizer.modelHandler.internal("access-rights").get("
|
|
33
|
+
const groupModel = adminizer.modelHandler.internal("access-rights").get("Group");
|
|
34
34
|
let defaultUserGroupRecord = await groupModel.findOne({ where: { name: adminizer.config.registration.defaultUserGroup } });
|
|
35
35
|
if (!defaultUserGroupRecord) {
|
|
36
36
|
await groupModel.create({
|
|
@@ -5,7 +5,7 @@ import { Adminizer } from "../lib/Adminizer.js";
|
|
|
5
5
|
import { generate } from "password-hash";
|
|
6
6
|
import { generateUserApiKey } from "../helpers/apiKeyHelper.js";
|
|
7
7
|
export default async function bindAuthorization(adminizer) {
|
|
8
|
-
const userModel = adminizer.modelHandler.internal("auth").get("
|
|
8
|
+
const userModel = adminizer.modelHandler.internal("auth").get("User");
|
|
9
9
|
let admins;
|
|
10
10
|
try {
|
|
11
11
|
admins = await userModel.find({ where: { isAdministrator: true } });
|
|
@@ -96,7 +96,7 @@ function getRandomInt(min, max) {
|
|
|
96
96
|
return Math.floor(Math.random() * (max - min)) + min;
|
|
97
97
|
}
|
|
98
98
|
async function initUserPolicy(req, res, proceed) {
|
|
99
|
-
let admins = await req.adminizer.modelHandler.internal("auth").get("
|
|
99
|
+
let admins = await req.adminizer.modelHandler.internal("auth").get("User").find({ where: { isAdministrator: true } });
|
|
100
100
|
if (!admins || !admins.length) {
|
|
101
101
|
return res.redirect(`${req.adminizer.config.routePrefix}/init_user`);
|
|
102
102
|
}
|
package/system/bindControls.js
CHANGED
|
@@ -5,16 +5,17 @@ import { JsonEditor } from "../lib/controls/jsoneditor/JsonEditor.js";
|
|
|
5
5
|
import { MonacoEditor } from "../lib/controls/codeEditor/MonacoEditor.js";
|
|
6
6
|
import { GeoEditor } from "../lib/controls/geojsoneditor/GeoEditor.js";
|
|
7
7
|
export function bindControls(adminizer) {
|
|
8
|
+
const routePrefix = adminizer.config.routePrefix;
|
|
8
9
|
// bind wysiwyg
|
|
9
|
-
adminizer.controlsHandler.add(new CKeditor(
|
|
10
|
+
adminizer.controlsHandler.add(new CKeditor(routePrefix));
|
|
10
11
|
// bind markdown
|
|
11
|
-
adminizer.controlsHandler.add(new ToastUiEditor(
|
|
12
|
+
adminizer.controlsHandler.add(new ToastUiEditor(routePrefix));
|
|
12
13
|
// bind table
|
|
13
|
-
adminizer.controlsHandler.add(new Handsontable(
|
|
14
|
+
adminizer.controlsHandler.add(new Handsontable(routePrefix));
|
|
14
15
|
// bind json editor
|
|
15
|
-
adminizer.controlsHandler.add(new JsonEditor(
|
|
16
|
+
adminizer.controlsHandler.add(new JsonEditor(routePrefix));
|
|
16
17
|
// bind code editor
|
|
17
|
-
adminizer.controlsHandler.add(new MonacoEditor(
|
|
18
|
+
adminizer.controlsHandler.add(new MonacoEditor(routePrefix));
|
|
18
19
|
//bind geo json editor
|
|
19
|
-
adminizer.controlsHandler.add(new GeoEditor(
|
|
20
|
+
adminizer.controlsHandler.add(new GeoEditor(routePrefix));
|
|
20
21
|
}
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
|
+
import { pathToFileURL } from "url";
|
|
3
4
|
import { Adminizer } from '../lib/Adminizer.js';
|
|
4
5
|
export default async function bindDashboardWidgets(adminizer) {
|
|
5
6
|
if (adminizer.config.dashboard && typeof adminizer.config.dashboard !== "boolean" && adminizer.config.dashboard.autoloadWidgetsPath) {
|
|
6
7
|
try {
|
|
7
8
|
const files = fs.readdirSync(adminizer.config.dashboard.autoloadWidgetsPath);
|
|
8
|
-
const jsFiles = files.filter(file => file.endsWith('.js'));
|
|
9
|
+
const jsFiles = files.filter(file => file.endsWith('.js') && !file.endsWith('.es.js'));
|
|
9
10
|
for (const file of jsFiles) {
|
|
10
11
|
const filePath = path.join(process.cwd(), adminizer.config.dashboard.autoloadWidgetsPath, file);
|
|
11
12
|
try {
|
|
12
|
-
const _import = await import(filePath);
|
|
13
|
+
const _import = await import(pathToFileURL(filePath).href);
|
|
13
14
|
if (_import.default) {
|
|
14
15
|
const ImportedClass = _import.default;
|
|
15
16
|
const instance = new ImportedClass();
|
package/system/bindDev.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export default function bindDev(adminizer) {
|
|
2
2
|
if (adminizer.config.models) {
|
|
3
3
|
Object.keys(adminizer.config.models).forEach((modelname) => {
|
|
4
|
-
// if(["
|
|
4
|
+
// if(["User", "Group"].includes(modelname)) return;
|
|
5
5
|
if (typeof adminizer.config.models[modelname] !== "boolean") {
|
|
6
6
|
let modelName = adminizer.config.models[modelname].model;
|
|
7
7
|
adminizer.config.models[`dev-${modelName}`] = {
|
package/system/bindHistory.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Adminizer } from "../lib/Adminizer";
|
|
2
|
-
export default function bindHistory(adminizer: Adminizer):
|
|
2
|
+
export default function bindHistory(adminizer: Adminizer): void;
|
package/system/bindHistory.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DefaultHistoryAdapter } from "../lib/history-actions/DefaultHistoryAdapter.js";
|
|
2
2
|
import { HistoryHandler } from "../lib/history-actions/HistoryHandler.js";
|
|
3
|
-
export default
|
|
3
|
+
export default function bindHistory(adminizer) {
|
|
4
4
|
const adapter = adminizer.config?.history?.adapter;
|
|
5
5
|
if (adapter === undefined || adapter === null || adapter === "default") {
|
|
6
6
|
adminizer.historyHandler = new HistoryHandler();
|
package/system/bindInertia.js
CHANGED
|
@@ -76,12 +76,6 @@ export function bindInertia(adminizer) {
|
|
|
76
76
|
preloadLinks.push(`<link rel="modulepreload" href="${href}" as="script">`);
|
|
77
77
|
scripts.push(`<script type="module" src="${href}"></script>`);
|
|
78
78
|
}
|
|
79
|
-
// Load modules CSS
|
|
80
|
-
const modulesCss = adminizer.controlsHandler.collectAndGenerateStyleLinks();
|
|
81
|
-
modulesCss.forEach(cssPath => {
|
|
82
|
-
preloadLinks.push(`<link rel="preload" href="${cssPath}" as="style">`);
|
|
83
|
-
stylesheets.push(`<link rel="stylesheet" href="${cssPath}">`);
|
|
84
|
-
});
|
|
85
79
|
// Route prefix script
|
|
86
80
|
const routePrefixScript = `<script>window.routePrefix = "${adminizer.config.routePrefix}";</script>`;
|
|
87
81
|
const bindPublic = `<script>window.bindPublic = ${adminizer.config.bind?.public}</script>`;
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
import { DefaultMediaManager } from "../lib/media-manager/DefaultMediaManager.js";
|
|
2
1
|
import serveStatic from "serve-static";
|
|
3
2
|
import path from "path";
|
|
4
3
|
export default function bindMediaManager(adminizer) {
|
|
5
|
-
if (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let mediaManager = new DefaultMediaManager(adminizer, 'default', 'media-manager', adminizer.config.mediamanager.fileStoragePath);
|
|
10
|
-
adminizer.mediaManagerHandler.add(mediaManager);
|
|
11
|
-
}
|
|
12
|
-
catch (e) {
|
|
13
|
-
console.log(e);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
// Bind media manager public folder
|
|
17
|
-
if (adminizer.config.bind?.public && adminizer.config.mediamanager?.fileStoragePath)
|
|
18
|
-
adminizer.app.use(`/public`, serveStatic(adminizer.config.mediamanager.fileStoragePath));
|
|
19
|
-
// Bind file icons
|
|
20
|
-
adminizer.app.use(`${adminizer.config.routePrefix}/fileicons`, serveStatic(path.join(import.meta.dirname, '../fileicons')));
|
|
4
|
+
if (adminizer.config.bind?.public && adminizer.config.mediamanager?.fileStoragePath) {
|
|
5
|
+
adminizer.app.use("/public", serveStatic(adminizer.config.mediamanager.fileStoragePath));
|
|
6
|
+
}
|
|
7
|
+
adminizer.app.use(`${adminizer.config.routePrefix}/fileicons`, serveStatic(path.join(import.meta.dirname, "../fileicons")));
|
|
21
8
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Adminizer } from '../lib/Adminizer';
|
|
2
|
-
export declare function bindNotifications(adminizer: Adminizer):
|
|
2
|
+
export declare function bindNotifications(adminizer: Adminizer): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NotificationHandler } from '../lib/notifications/NotificationHandler.js';
|
|
2
2
|
import { GeneralNotificationService } from '../lib/notifications/GeneralNotificationService.js';
|
|
3
|
-
export
|
|
3
|
+
export function bindNotifications(adminizer) {
|
|
4
4
|
// Create a handler
|
|
5
5
|
adminizer.notificationHandler = new NotificationHandler();
|
|
6
6
|
// Registering services
|
|
@@ -2,12 +2,29 @@ import { Adminizer } from "../lib/Adminizer.js";
|
|
|
2
2
|
import { I18n } from "../lib/I18n.js";
|
|
3
3
|
import { parse } from "cookie";
|
|
4
4
|
import { verifyUser } from "../lib/helper/jwt.js";
|
|
5
|
+
const ADMINIZER_REQUEST_DEPRECATION_MESSAGE = "req.adminizer is deprecated and will no longer be available starting with Adminizer v6. Use req.runtime instead.";
|
|
6
|
+
export function createDeprecatedAdminizerProxy(adminizer, warn = (message) => Adminizer.log.warn(message)) {
|
|
7
|
+
let warned = false;
|
|
8
|
+
return new Proxy(adminizer, {
|
|
9
|
+
get(target, property, receiver) {
|
|
10
|
+
if (!warned) {
|
|
11
|
+
warned = true;
|
|
12
|
+
warn(ADMINIZER_REQUEST_DEPRECATION_MESSAGE);
|
|
13
|
+
}
|
|
14
|
+
return Reflect.get(target, property, receiver);
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
}
|
|
5
18
|
export default function bindReqFunctions(adminizer) {
|
|
19
|
+
const deprecatedAdminizer = createDeprecatedAdminizerProxy(adminizer);
|
|
6
20
|
let bindReqFunctionsF = async function (req, res, next) {
|
|
7
21
|
/**
|
|
8
22
|
* Add adminizer to use in controllers
|
|
9
23
|
* */
|
|
10
|
-
req.adminizer =
|
|
24
|
+
req.adminizer = deprecatedAdminizer;
|
|
25
|
+
// TODO Adminizer v6: replace this temporary base scope when req.adminizer is removed.
|
|
26
|
+
// App controllers receive an app-scoped runtime from ControllerHandler before execution.
|
|
27
|
+
req.runtime = adminizer.appManager.createRuntime("__request__");
|
|
11
28
|
/**
|
|
12
29
|
* Add i18n
|
|
13
30
|
* */
|
|
@@ -44,10 +61,10 @@ export default function bindReqFunctions(adminizer) {
|
|
|
44
61
|
const cookies = parse(req.headers.cookie || '');
|
|
45
62
|
const token = cookies.adminizer_jwt;
|
|
46
63
|
if (token) {
|
|
47
|
-
const user = verifyUser(token,
|
|
64
|
+
const user = verifyUser(token, adminizer.jwtSecret);
|
|
48
65
|
if (user) {
|
|
49
66
|
// Load user with groups (Sequelize adapter auto-populates associations in _findOne)
|
|
50
|
-
req.user = await
|
|
67
|
+
req.user = await adminizer.modelHandler.internal("auth").get("User").findOne({ where: { id: user.id } });
|
|
51
68
|
}
|
|
52
69
|
}
|
|
53
70
|
if (req.session.userPretended) {
|