@cwa/nuxt-edge 1.0.0-29138192.e49c1a0
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 +38 -0
- package/README.template.md +32 -0
- package/dist/layer/error.vue +13 -0
- package/dist/layer/layouts/CwaRootLayout.vue +140 -0
- package/dist/layer/nuxt.config.spec.ts +10 -0
- package/dist/layer/nuxt.config.ts +3 -0
- package/dist/layer/pages/_cwa/composables/useDataList.ts +50 -0
- package/dist/layer/pages/_cwa/composables/useDataType.ts +30 -0
- package/dist/layer/pages/_cwa/composables/useDynamicPageLoader.ts +28 -0
- package/dist/layer/pages/_cwa/composables/useItemPage.ts +172 -0
- package/dist/layer/pages/_cwa/composables/useListPage.ts +43 -0
- package/dist/layer/pages/_cwa/data/[type]/[iri].vue +17 -0
- package/dist/layer/pages/_cwa/data/[type].vue +131 -0
- package/dist/layer/pages/_cwa/data/index.vue +84 -0
- package/dist/layer/pages/_cwa/layouts/[iri].vue +174 -0
- package/dist/layer/pages/_cwa/layouts.vue +77 -0
- package/dist/layer/pages/_cwa/pages/[iri].vue +11 -0
- package/dist/layer/pages/_cwa/pages.vue +129 -0
- package/dist/layer/pages/_cwa/routes.vue +72 -0
- package/dist/layer/pages/_cwa/users/[iri].vue +248 -0
- package/dist/layer/pages/_cwa/users.vue +86 -0
- package/dist/layer/pages/_cwa.vue +43 -0
- package/dist/layer/pages/forgot-password.vue +32 -0
- package/dist/layer/pages/login.vue +33 -0
- package/dist/layer/pages/reset-password/[username]/[token].vue +39 -0
- package/dist/module.d.mts +53 -0
- package/dist/module.json +13 -0
- package/dist/module.mjs +235 -0
- package/dist/runtime/admin/admin.d.ts +36 -0
- package/dist/runtime/admin/admin.js +65 -0
- package/dist/runtime/admin/manageable-resource.d.ts +41 -0
- package/dist/runtime/admin/manageable-resource.js +206 -0
- package/dist/runtime/admin/manager-tabs-resolver.d.ts +17 -0
- package/dist/runtime/admin/manager-tabs-resolver.js +51 -0
- package/dist/runtime/admin/navigation-guard.d.ts +18 -0
- package/dist/runtime/admin/navigation-guard.js +55 -0
- package/dist/runtime/admin/resource-stack-manager.d.ts +92 -0
- package/dist/runtime/admin/resource-stack-manager.js +355 -0
- package/dist/runtime/api/api-documentation.d.ts +28 -0
- package/dist/runtime/api/api-documentation.js +131 -0
- package/dist/runtime/api/auth.d.ts +85 -0
- package/dist/runtime/api/auth.js +183 -0
- package/dist/runtime/api/fetcher/cwa-fetch.d.ts +5 -0
- package/dist/runtime/api/fetcher/cwa-fetch.js +20 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.d.ts +51 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.js +185 -0
- package/dist/runtime/api/fetcher/fetcher.d.ts +57 -0
- package/dist/runtime/api/fetcher/fetcher.js +222 -0
- package/dist/runtime/api/fetcher/preload-headers.d.ts +6 -0
- package/dist/runtime/api/fetcher/preload-headers.js +31 -0
- package/dist/runtime/api/forms.d.ts +40 -0
- package/dist/runtime/api/forms.js +40 -0
- package/dist/runtime/api/mercure.d.ts +33 -0
- package/dist/runtime/api/mercure.js +191 -0
- package/dist/runtime/composables/component/html-content.d.ts +2 -0
- package/dist/runtime/composables/component/html-content.js +82 -0
- package/dist/runtime/composables/cwa-collection-pagination.d.ts +13 -0
- package/dist/runtime/composables/cwa-collection-pagination.js +34 -0
- package/dist/runtime/composables/cwa-collection-resource.d.ts +16 -0
- package/dist/runtime/composables/cwa-collection-resource.js +92 -0
- package/dist/runtime/composables/cwa-image.d.ts +19 -0
- package/dist/runtime/composables/cwa-image.js +43 -0
- package/dist/runtime/composables/cwa-query-bound-model.d.ts +9 -0
- package/dist/runtime/composables/cwa-query-bound-model.js +108 -0
- package/dist/runtime/composables/cwa-resource-endpoint.d.ts +5 -0
- package/dist/runtime/composables/cwa-resource-endpoint.js +36 -0
- package/dist/runtime/composables/cwa-resource-manageable.d.ts +10 -0
- package/dist/runtime/composables/cwa-resource-manageable.js +32 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.d.ts +17 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.js +30 -0
- package/dist/runtime/composables/cwa-resource-model.d.ts +21 -0
- package/dist/runtime/composables/cwa-resource-model.js +149 -0
- package/dist/runtime/composables/cwa-resource-upload.d.ts +8 -0
- package/dist/runtime/composables/cwa-resource-upload.js +70 -0
- package/dist/runtime/composables/cwa-resource.d.ts +24 -0
- package/dist/runtime/composables/cwa-resource.js +22 -0
- package/dist/runtime/composables/cwa-select-input.d.ts +21 -0
- package/dist/runtime/composables/cwa-select-input.js +37 -0
- package/dist/runtime/composables/cwa-select.d.ts +15 -0
- package/dist/runtime/composables/cwa-select.js +24 -0
- package/dist/runtime/composables/cwa.d.ts +2 -0
- package/dist/runtime/composables/cwa.js +2 -0
- package/dist/runtime/composables/forgot-password.d.ts +9 -0
- package/dist/runtime/composables/forgot-password.js +45 -0
- package/dist/runtime/composables/login.d.ts +9 -0
- package/dist/runtime/composables/login.js +30 -0
- package/dist/runtime/composables/popper.d.ts +529 -0
- package/dist/runtime/composables/popper.js +104 -0
- package/dist/runtime/composables/process.d.ts +4 -0
- package/dist/runtime/composables/process.js +6 -0
- package/dist/runtime/composables/reset-password.d.ts +14 -0
- package/dist/runtime/composables/reset-password.js +75 -0
- package/dist/runtime/composables/transitions.d.ts +12 -0
- package/dist/runtime/composables/transitions.js +12 -0
- package/dist/runtime/cwa.d.ts +61 -0
- package/dist/runtime/cwa.js +123 -0
- package/dist/runtime/errors/cwa-resource-error.d.ts +18 -0
- package/dist/runtime/errors/cwa-resource-error.js +54 -0
- package/dist/runtime/plugin.d.ts +7 -0
- package/dist/runtime/plugin.js +18 -0
- package/dist/runtime/resources/resource-utils.d.ts +44 -0
- package/dist/runtime/resources/resource-utils.js +73 -0
- package/dist/runtime/resources/resources-manager.d.ts +70 -0
- package/dist/runtime/resources/resources-manager.js +463 -0
- package/dist/runtime/resources/resources.d.ts +53 -0
- package/dist/runtime/resources/resources.js +300 -0
- package/dist/runtime/route-middleware.d.ts +2 -0
- package/dist/runtime/route-middleware.js +86 -0
- package/dist/runtime/storage/storage.d.ts +20 -0
- package/dist/runtime/storage/storage.js +25 -0
- package/dist/runtime/storage/stores/admin/actions.d.ts +5 -0
- package/dist/runtime/storage/stores/admin/actions.js +10 -0
- package/dist/runtime/storage/stores/admin/admin-store.d.ts +18 -0
- package/dist/runtime/storage/stores/admin/admin-store.js +20 -0
- package/dist/runtime/storage/stores/admin/state.d.ts +7 -0
- package/dist/runtime/storage/stores/admin/state.js +9 -0
- package/dist/runtime/storage/stores/api-documentation/api-documentation-store.d.ts +16 -0
- package/dist/runtime/storage/stores/api-documentation/api-documentation-store.js +18 -0
- package/dist/runtime/storage/stores/api-documentation/state.d.ts +74 -0
- package/dist/runtime/storage/stores/api-documentation/state.js +6 -0
- package/dist/runtime/storage/stores/auth/auth-store.d.ts +16 -0
- package/dist/runtime/storage/stores/auth/auth-store.js +18 -0
- package/dist/runtime/storage/stores/auth/state.d.ts +20 -0
- package/dist/runtime/storage/stores/auth/state.js +15 -0
- package/dist/runtime/storage/stores/cwa-store-types.d.ts +14 -0
- package/dist/runtime/storage/stores/error/actions.d.ts +11 -0
- package/dist/runtime/storage/stores/error/actions.js +69 -0
- package/dist/runtime/storage/stores/error/error-store.d.ts +13 -0
- package/dist/runtime/storage/stores/error/error-store.js +21 -0
- package/dist/runtime/storage/stores/error/getters.d.ts +7 -0
- package/dist/runtime/storage/stores/error/getters.js +11 -0
- package/dist/runtime/storage/stores/error/state.d.ts +35 -0
- package/dist/runtime/storage/stores/error/state.js +15 -0
- package/dist/runtime/storage/stores/fetcher/actions.d.ts +49 -0
- package/dist/runtime/storage/stores/fetcher/actions.js +125 -0
- package/dist/runtime/storage/stores/fetcher/fetcher-store.d.ts +19 -0
- package/dist/runtime/storage/stores/fetcher/fetcher-store.js +23 -0
- package/dist/runtime/storage/stores/fetcher/getter-utils.d.ts +7 -0
- package/dist/runtime/storage/stores/fetcher/getter-utils.js +27 -0
- package/dist/runtime/storage/stores/fetcher/getters.d.ts +13 -0
- package/dist/runtime/storage/stores/fetcher/getters.js +52 -0
- package/dist/runtime/storage/stores/fetcher/state.d.ts +25 -0
- package/dist/runtime/storage/stores/fetcher/state.js +7 -0
- package/dist/runtime/storage/stores/mercure/mercure-store.d.ts +16 -0
- package/dist/runtime/storage/stores/mercure/mercure-store.js +18 -0
- package/dist/runtime/storage/stores/mercure/state.d.ts +5 -0
- package/dist/runtime/storage/stores/mercure/state.js +6 -0
- package/dist/runtime/storage/stores/resources/actions.d.ts +54 -0
- package/dist/runtime/storage/stores/resources/actions.js +390 -0
- package/dist/runtime/storage/stores/resources/getter-utils.d.ts +7 -0
- package/dist/runtime/storage/stores/resources/getter-utils.js +27 -0
- package/dist/runtime/storage/stores/resources/getters.d.ts +38 -0
- package/dist/runtime/storage/stores/resources/getters.js +251 -0
- package/dist/runtime/storage/stores/resources/resources-store.d.ts +19 -0
- package/dist/runtime/storage/stores/resources/resources-store.js +23 -0
- package/dist/runtime/storage/stores/resources/state.d.ts +64 -0
- package/dist/runtime/storage/stores/resources/state.js +24 -0
- package/dist/runtime/templates/assets/base.css +1 -0
- package/dist/runtime/templates/assets/cwa.css +1 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue +18 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/ComponentPosition.spec.ts.snap +16 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue +63 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue +41 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/DialogBox.vue +95 -0
- package/dist/runtime/templates/components/core/DialogBox.vue.d.ts +38 -0
- package/dist/runtime/templates/components/core/README.md +1 -0
- package/dist/runtime/templates/components/core/ResourceLoader.spec.ts.snap +39 -0
- package/dist/runtime/templates/components/core/ResourceLoader.vue +151 -0
- package/dist/runtime/templates/components/core/ResourceLoader.vue.d.ts +13 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue +7 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue +136 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue.d.ts +21 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue +49 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue +53 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue +32 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue.d.ts +20 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue +87 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue +18 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue +260 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue +187 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue.d.ts +13 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue +99 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue.d.ts +27 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue +27 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue.d.ts +6 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue +23 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue +77 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue.d.ts +19 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue +102 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue.d.ts +20 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue +52 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue.d.ts +10 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue +273 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue +18 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue +86 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue +23 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue +30 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue +99 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue.d.ts +6 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue +112 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue.d.ts +4 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue +21 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue +15 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue +24 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue +20 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue +21 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue +23 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue +13 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/useDataResolver.d.ts +12 -0
- package/dist/runtime/templates/components/core/useDataResolver.js +109 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.d.ts +6 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.js +164 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.d.ts +20 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.js +69 -0
- package/dist/runtime/templates/components/main/ComponentGroup.spec.ts.snap +59 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue +107 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue.d.ts +9 -0
- package/dist/runtime/templates/components/main/CwaLink.vue +51 -0
- package/dist/runtime/templates/components/main/CwaLink.vue.d.ts +14 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue +8 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue +98 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/Logo.vue +18 -0
- package/dist/runtime/templates/components/main/Logo.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/README.md +7 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue +41 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue +48 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.d.ts +5 -0
- package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.js +19 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue +207 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue +189 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue +14 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue.d.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue +19 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue.d.ts +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue +69 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue +19 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue +79 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue +52 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue +151 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue.d.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue +192 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue +186 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue.d.ts +9 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue +205 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue +38 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue +15 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue +44 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue.d.ts +13 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue +59 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue +75 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue +41 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue +101 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue +34 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue +121 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue +52 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue +99 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue +59 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue +28 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue +55 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue.d.ts +20 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue +60 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue.d.ts +23 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue +59 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue.d.ts +27 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.spec.ts.snap +14 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue +17 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.spec.ts.snap +90 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue +45 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue.d.ts +17 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.spec.ts.snap +111 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.vue +50 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.vue.d.ts +17 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue +960 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue +75 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue.d.ts +9 -0
- package/dist/runtime/templates/components/ui/ProgressBar.spec.ts.snap +71 -0
- package/dist/runtime/templates/components/ui/ProgressBar.vue +29 -0
- package/dist/runtime/templates/components/ui/ProgressBar.vue.d.ts +9 -0
- package/dist/runtime/templates/components/ui/README.md +6 -0
- package/dist/runtime/templates/components/ui/alert/Info.spec.ts.snap +23 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue +13 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue.d.ts +12 -0
- package/dist/runtime/templates/components/ui/alert/Warning.spec.ts.snap +14 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue +8 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue.d.ts +12 -0
- package/dist/runtime/templates/components/ui/form/Button.vue +139 -0
- package/dist/runtime/templates/components/ui/form/Button.vue.d.ts +52 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue +18 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue +15 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/form/File.vue +72 -0
- package/dist/runtime/templates/components/ui/form/File.vue.d.ts +9 -0
- package/dist/runtime/templates/components/ui/form/Input.vue +22 -0
- package/dist/runtime/templates/components/ui/form/Input.vue.d.ts +5 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue +16 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue.d.ts +15 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.vue +212 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.vue.d.ts +14 -0
- package/dist/runtime/templates/components/ui/form/Select.vue +60 -0
- package/dist/runtime/templates/components/ui/form/Select.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue +39 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue.d.ts +6 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue +30 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue +12 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue +10 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue +23 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue +11 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue +15 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue +59 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue.d.ts +21 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue +24 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue.d.ts +9 -0
- package/dist/runtime/templates/components/utils/README.md +1 -0
- package/dist/runtime/templates/components/utils/Spinner.spec.ts.snap +56 -0
- package/dist/runtime/templates/components/utils/Spinner.vue +42 -0
- package/dist/runtime/templates/components/utils/Spinner.vue.d.ts +5 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue +43 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue.d.ts +6 -0
- package/dist/runtime/templates/cwa-page.spec.ts.snap +20 -0
- package/dist/runtime/templates/cwa-page.vue +32 -0
- package/dist/runtime/templates/cwa-page.vue.d.ts +2 -0
- package/dist/runtime/types/popper.d.ts +14 -0
- package/dist/types.d.mts +9 -0
- package/package.json +108 -0
|
@@ -0,0 +1,300 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
import { CwaResourceApiStatuses, NEW_RESOURCE_IRI } from "../storage/stores/resources/state.js";
|
|
3
|
+
import {
|
|
4
|
+
CwaResourceTypes,
|
|
5
|
+
getResourceTypeFromIri
|
|
6
|
+
} from "./resource-utils.js";
|
|
7
|
+
export class Resources {
|
|
8
|
+
constructor(resourcesStoreDefinition, fetcherStoreDefinition) {
|
|
9
|
+
this.resourcesStoreDefinition = resourcesStoreDefinition;
|
|
10
|
+
this.fetcherStoreDefinition = fetcherStoreDefinition;
|
|
11
|
+
}
|
|
12
|
+
get currentIds() {
|
|
13
|
+
return this.resourcesStore.current.currentIds;
|
|
14
|
+
}
|
|
15
|
+
isIriPublishableEquivalent(oldIri, newIri) {
|
|
16
|
+
return this.resourcesStore.isIriPublishableEquivalent(oldIri, newIri);
|
|
17
|
+
}
|
|
18
|
+
findAllPublishableIris(iri) {
|
|
19
|
+
return this.resourcesStore.findAllPublishableIris(iri);
|
|
20
|
+
}
|
|
21
|
+
getResource(id) {
|
|
22
|
+
return computed(() => {
|
|
23
|
+
return this.resourcesStore.getResource(id);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
getChildIris(iri, addResourceEvent) {
|
|
27
|
+
return this.resourcesStore.getChildIris(iri, addResourceEvent);
|
|
28
|
+
}
|
|
29
|
+
get newResource() {
|
|
30
|
+
return computed(() => this.resourcesStore.getResource(NEW_RESOURCE_IRI));
|
|
31
|
+
}
|
|
32
|
+
getComponentGroupByReference(reference) {
|
|
33
|
+
const componentGroups = this.resourcesStore.resourcesByType[CwaResourceTypes.COMPONENT_GROUP];
|
|
34
|
+
return componentGroups.find((componentGroupResource) => {
|
|
35
|
+
return componentGroupResource.data?.reference === reference;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
get currentResources() {
|
|
39
|
+
return this.resourcesStore.current.currentIds.reduce((obj, id) => {
|
|
40
|
+
const idResource = this.getResource(id).value;
|
|
41
|
+
if (idResource) {
|
|
42
|
+
obj[id] = idResource;
|
|
43
|
+
}
|
|
44
|
+
return obj;
|
|
45
|
+
}, {});
|
|
46
|
+
}
|
|
47
|
+
get displayFetchStatus() {
|
|
48
|
+
const fetchingToken = this.fetcherStore.primaryFetch.fetchingToken;
|
|
49
|
+
if (fetchingToken) {
|
|
50
|
+
const fetchingStatus = this.fetcherStore.fetches[fetchingToken];
|
|
51
|
+
if (fetchingStatus) {
|
|
52
|
+
const pageIri = this.getPageIriByFetchStatus(fetchingStatus);
|
|
53
|
+
if (pageIri && this.resourcesStore.current.currentIds.includes(pageIri)) {
|
|
54
|
+
const pageResource = this.getResource(pageIri).value;
|
|
55
|
+
if (pageResource?.data && pageResource.apiState.status === CwaResourceApiStatuses.SUCCESS) {
|
|
56
|
+
return fetchingStatus;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return this.fetcherStore.resolvedSuccessFetchStatus;
|
|
62
|
+
}
|
|
63
|
+
get pageLoadResources() {
|
|
64
|
+
const token = this.fetcherStore.primaryFetch.fetchingToken;
|
|
65
|
+
if (!token) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const fetchStatus = this.fetcherStore.fetches[token];
|
|
69
|
+
if (!fetchStatus) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const type = this.getFetchStatusType(fetchStatus);
|
|
73
|
+
if (!type) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const resources = [
|
|
77
|
+
this.getLayoutIriByFetchStatus(fetchStatus),
|
|
78
|
+
this.getPageIriByFetchStatus(fetchStatus)
|
|
79
|
+
];
|
|
80
|
+
if (type === CwaResourceTypes.ROUTE || type === CwaResourceTypes.PAGE_DATA) {
|
|
81
|
+
resources.push(fetchStatus.path);
|
|
82
|
+
}
|
|
83
|
+
if (type === CwaResourceTypes.ROUTE) {
|
|
84
|
+
const routeResource = this.getResource(fetchStatus.path).value;
|
|
85
|
+
if (routeResource) {
|
|
86
|
+
const pageDataIri = routeResource.data?.value?.pageData;
|
|
87
|
+
if (pageDataIri) {
|
|
88
|
+
resources.push(pageDataIri);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return resources;
|
|
93
|
+
}
|
|
94
|
+
get pageLoadProgress() {
|
|
95
|
+
return computed(() => {
|
|
96
|
+
const pageLoadResources = this.pageLoadResources;
|
|
97
|
+
if (!pageLoadResources) {
|
|
98
|
+
return {
|
|
99
|
+
resources: [],
|
|
100
|
+
total: 0,
|
|
101
|
+
complete: 0,
|
|
102
|
+
percent: 100
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const total = pageLoadResources.length;
|
|
106
|
+
let complete = 0;
|
|
107
|
+
for (const resourceIri of pageLoadResources) {
|
|
108
|
+
if (!resourceIri) {
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const resource = this.getResource(resourceIri).value;
|
|
112
|
+
if (resource?.apiState.status !== CwaResourceApiStatuses.IN_PROGRESS) {
|
|
113
|
+
complete++;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
const percent = complete ? Math.round(complete / total * 100) : 0;
|
|
117
|
+
return {
|
|
118
|
+
resources: pageLoadResources,
|
|
119
|
+
total,
|
|
120
|
+
complete,
|
|
121
|
+
percent
|
|
122
|
+
};
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
isPageDataResource(iri) {
|
|
126
|
+
return computed(() => {
|
|
127
|
+
if (!this.pageData?.value?.data || !iri) {
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
if (getResourceTypeFromIri(iri) !== CwaResourceTypes.COMPONENT) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
const allIris = this.findAllPublishableIris(iri);
|
|
134
|
+
for (const iri2 of allIris) {
|
|
135
|
+
if (Object.values(this.pageData.value.data).includes(iri2)) {
|
|
136
|
+
return true;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return false;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
getFetchStatusType(fetchStatus) {
|
|
143
|
+
if (!fetchStatus) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const type = getResourceTypeFromIri(fetchStatus.path);
|
|
147
|
+
if (!type) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
return type;
|
|
151
|
+
}
|
|
152
|
+
getLayoutIriByFetchStatus(fetchStatus) {
|
|
153
|
+
const pageIri = this.getPageIriByFetchStatus(fetchStatus);
|
|
154
|
+
if (!pageIri) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const pageResource = this.getResource(pageIri).value;
|
|
158
|
+
return pageResource?.data?.layout;
|
|
159
|
+
}
|
|
160
|
+
getPageIriByFetchStatus(fetchStatus) {
|
|
161
|
+
const type = this.getFetchStatusType(fetchStatus);
|
|
162
|
+
if (!type) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
if (!fetchStatus?.path) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (type === CwaResourceTypes.PAGE) {
|
|
169
|
+
return fetchStatus.path;
|
|
170
|
+
}
|
|
171
|
+
const successResource = this.getResource(fetchStatus.path).value;
|
|
172
|
+
if (!successResource) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
switch (type) {
|
|
176
|
+
case CwaResourceTypes.PAGE_DATA: {
|
|
177
|
+
return successResource.data?.page;
|
|
178
|
+
}
|
|
179
|
+
case CwaResourceTypes.ROUTE: {
|
|
180
|
+
const pageData = successResource.data?.pageData;
|
|
181
|
+
if (pageData) {
|
|
182
|
+
const pageDataResource = this.getResource(pageData).value;
|
|
183
|
+
return pageDataResource?.data?.page;
|
|
184
|
+
}
|
|
185
|
+
return successResource.data?.page;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
get pageDataIri() {
|
|
190
|
+
return computed(() => {
|
|
191
|
+
const fetchStatus = this.displayFetchStatus;
|
|
192
|
+
const type = this.getFetchStatusType(fetchStatus);
|
|
193
|
+
if (!type) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
if (!fetchStatus?.path) {
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
if (type === CwaResourceTypes.PAGE_DATA) {
|
|
200
|
+
return fetchStatus.path;
|
|
201
|
+
}
|
|
202
|
+
const successResource = this.getResource(fetchStatus.path).value;
|
|
203
|
+
return type === CwaResourceTypes.ROUTE ? successResource?.data?.pageData : void 0;
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
get pageData() {
|
|
207
|
+
if (!this.pageDataIri.value) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
return this.getResource(this.pageDataIri.value);
|
|
211
|
+
}
|
|
212
|
+
get pageIri() {
|
|
213
|
+
return computed(() => this.getPageIriByFetchStatus(this.displayFetchStatus));
|
|
214
|
+
}
|
|
215
|
+
get page() {
|
|
216
|
+
if (!this.pageIri.value) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
return this.getResource(this.pageIri.value);
|
|
220
|
+
}
|
|
221
|
+
get layoutIri() {
|
|
222
|
+
return computed(() => this.getLayoutIriByFetchStatus(this.displayFetchStatus));
|
|
223
|
+
}
|
|
224
|
+
get layout() {
|
|
225
|
+
return computed(() => {
|
|
226
|
+
const layoutIri = this.layoutIri.value;
|
|
227
|
+
if (!layoutIri) {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
return this.getResource(layoutIri).value;
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
findPublishedComponentIri(iri) {
|
|
234
|
+
return computed(() => {
|
|
235
|
+
return this.resourcesStore.findPublishedComponentIri(iri);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
findDraftComponentIri(iri) {
|
|
239
|
+
return computed(() => {
|
|
240
|
+
return this.resourcesStore.findDraftComponentIri(iri);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
get getOrderedPositionsForGroup() {
|
|
244
|
+
return this.resourcesStore.getOrderedPositionsForGroup;
|
|
245
|
+
}
|
|
246
|
+
get getPositionSortDisplayNumber() {
|
|
247
|
+
return this.resourcesStore.getPositionSortDisplayNumber;
|
|
248
|
+
}
|
|
249
|
+
getRefreshEndpointsForDelete(iri) {
|
|
250
|
+
const refreshEndpoints = [];
|
|
251
|
+
if (this.pageDataIri.value) {
|
|
252
|
+
refreshEndpoints.push(this.pageDataIri.value);
|
|
253
|
+
}
|
|
254
|
+
const allIris = this.resourcesStore.findAllPublishableIris(iri);
|
|
255
|
+
for (const checkIri of allIris) {
|
|
256
|
+
const componentPositions = this.resourcesStore.current.positionsByComponent[checkIri];
|
|
257
|
+
if (!componentPositions) {
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
refreshEndpoints.push(...componentPositions);
|
|
261
|
+
for (const posIri of componentPositions) {
|
|
262
|
+
const positionResource = this.getResource(posIri).value;
|
|
263
|
+
if (positionResource?.data?.componentGroup) {
|
|
264
|
+
refreshEndpoints.push(positionResource.data.componentGroup);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
return refreshEndpoints;
|
|
269
|
+
}
|
|
270
|
+
get isLoading() {
|
|
271
|
+
return computed(() => {
|
|
272
|
+
return !this.fetcherStore.fetchesResolved || !!this.resourceLoadStatus.pending;
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
get resourceLoadStatus() {
|
|
276
|
+
return this.resourcesStore.resourceLoadStatus;
|
|
277
|
+
}
|
|
278
|
+
get fetcherStore() {
|
|
279
|
+
return this.fetcherStoreDefinition.useStore();
|
|
280
|
+
}
|
|
281
|
+
get resourcesStore() {
|
|
282
|
+
return this.resourcesStoreDefinition.useStore();
|
|
283
|
+
}
|
|
284
|
+
get usesPageTemplate() {
|
|
285
|
+
return computed(() => !!this.page?.value?.data?.isTemplate);
|
|
286
|
+
}
|
|
287
|
+
get isDataPage() {
|
|
288
|
+
return computed(() => {
|
|
289
|
+
return this.usesPageTemplate.value && !!this.pageDataIri.value;
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
get isDynamicPage() {
|
|
293
|
+
return computed(() => {
|
|
294
|
+
return this.usesPageTemplate.value && !this.pageDataIri.value;
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
get hasNewResources() {
|
|
298
|
+
return this.resourcesStore.hasNewResources;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { v4 as uuidv4 } from "uuid";
|
|
2
|
+
import { consola as logger } from "consola";
|
|
3
|
+
import {
|
|
4
|
+
abortNavigation,
|
|
5
|
+
callWithNuxt,
|
|
6
|
+
createError,
|
|
7
|
+
defineNuxtRouteMiddleware,
|
|
8
|
+
navigateTo,
|
|
9
|
+
useNuxtApp
|
|
10
|
+
} from "#app";
|
|
11
|
+
import { useProcess } from "#cwa/runtime/composables/process";
|
|
12
|
+
let middlewareToken = "";
|
|
13
|
+
export default defineNuxtRouteMiddleware(async (to, from) => {
|
|
14
|
+
const { isClient } = useProcess();
|
|
15
|
+
middlewareToken = uuidv4();
|
|
16
|
+
const nuxtApp = useNuxtApp();
|
|
17
|
+
const adminRouteGuard = nuxtApp.$cwa.adminNavigationGuardFn(to);
|
|
18
|
+
if (adminRouteGuard === false) {
|
|
19
|
+
return abortNavigation();
|
|
20
|
+
}
|
|
21
|
+
const discardAddingSuccess = await nuxtApp.$cwa.resourcesManager.confirmDiscardAddingResource();
|
|
22
|
+
if (!discardAddingSuccess) {
|
|
23
|
+
return abortNavigation();
|
|
24
|
+
}
|
|
25
|
+
if (adminRouteGuard !== true) {
|
|
26
|
+
return navigateTo(adminRouteGuard);
|
|
27
|
+
}
|
|
28
|
+
if (isClient) {
|
|
29
|
+
await nuxtApp.$cwa.initClientSide();
|
|
30
|
+
}
|
|
31
|
+
if (to.meta.cwa?.disabled === true) {
|
|
32
|
+
nuxtApp.$cwa.clearPrimaryFetch();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const waitForMiddleware = () => {
|
|
36
|
+
return new Promise((resolve) => {
|
|
37
|
+
const checkInterval = setInterval(() => {
|
|
38
|
+
if (nuxtApp._processingMiddleware === void 0) {
|
|
39
|
+
resolve(true);
|
|
40
|
+
clearInterval(checkInterval);
|
|
41
|
+
}
|
|
42
|
+
}, 10);
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
const handleRouteRedirect = async (resource) => {
|
|
46
|
+
if (resource?.redirectPath) {
|
|
47
|
+
if (isClient && nuxtApp._processingMiddleware) {
|
|
48
|
+
await waitForMiddleware();
|
|
49
|
+
}
|
|
50
|
+
return callWithNuxt(nuxtApp, navigateTo, [resource.redirectPath, { redirectCode: 308 }]);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const isInternalPath = to.path.startsWith("/_/");
|
|
54
|
+
const throwInternalUnauthorisedError = () => {
|
|
55
|
+
throw createError({
|
|
56
|
+
statusCode: 401,
|
|
57
|
+
statusMessage: "Unauthorised",
|
|
58
|
+
message: "You are not authorised to load this resource"
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
if (!isClient) {
|
|
62
|
+
const resource = await nuxtApp.$cwa.fetchRoute(to);
|
|
63
|
+
return handleRouteRedirect(resource);
|
|
64
|
+
}
|
|
65
|
+
const isFirstClientSideRun = nuxtApp.isHydrating && nuxtApp.payload.serverRendered;
|
|
66
|
+
if (isFirstClientSideRun && !isInternalPath && from.fullPath === to.fullPath) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (isInternalPath) {
|
|
70
|
+
await nuxtApp.$cwa.auth.init();
|
|
71
|
+
if (!nuxtApp.$cwa.auth.isAdmin.value) {
|
|
72
|
+
throwInternalUnauthorisedError();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const startedMiddlewareToken = middlewareToken;
|
|
77
|
+
nuxtApp.$cwa.fetchRoute(to).then(async (resource) => {
|
|
78
|
+
if (startedMiddlewareToken !== middlewareToken && resource?.redirectPath) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
const response = await handleRouteRedirect(resource);
|
|
82
|
+
if (response) {
|
|
83
|
+
logger.info("Redirect handler failed", response);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ResourcesStore } from './stores/resources/resources-store.js';
|
|
2
|
+
import { FetcherStore } from './stores/fetcher/fetcher-store.js';
|
|
3
|
+
import { MercureStore } from './stores/mercure/mercure-store.js';
|
|
4
|
+
import { ApiDocumentationStore } from './stores/api-documentation/api-documentation-store.js';
|
|
5
|
+
import { AuthStore } from './stores/auth/auth-store.js';
|
|
6
|
+
import { AdminStore } from './stores/admin/admin-store.js';
|
|
7
|
+
import { ErrorStore } from './stores/error/error-store.js';
|
|
8
|
+
export interface CwaStores {
|
|
9
|
+
resources: ResourcesStore;
|
|
10
|
+
fetcher: FetcherStore;
|
|
11
|
+
mercure: MercureStore;
|
|
12
|
+
apiDocumentation: ApiDocumentationStore;
|
|
13
|
+
auth: AuthStore;
|
|
14
|
+
admin: AdminStore;
|
|
15
|
+
error: ErrorStore;
|
|
16
|
+
}
|
|
17
|
+
export declare class Storage {
|
|
18
|
+
readonly stores: CwaStores;
|
|
19
|
+
constructor(storeName: string);
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ResourcesStore
|
|
3
|
+
} from "./stores/resources/resources-store.js";
|
|
4
|
+
import { FetcherStore } from "./stores/fetcher/fetcher-store.js";
|
|
5
|
+
import { MercureStore } from "./stores/mercure/mercure-store.js";
|
|
6
|
+
import {
|
|
7
|
+
ApiDocumentationStore
|
|
8
|
+
} from "./stores/api-documentation/api-documentation-store.js";
|
|
9
|
+
import { AuthStore } from "./stores/auth/auth-store.js";
|
|
10
|
+
import { AdminStore } from "./stores/admin/admin-store.js";
|
|
11
|
+
import { ErrorStore } from "./stores/error/error-store.js";
|
|
12
|
+
export class Storage {
|
|
13
|
+
stores;
|
|
14
|
+
constructor(storeName) {
|
|
15
|
+
this.stores = {
|
|
16
|
+
resources: new ResourcesStore(storeName),
|
|
17
|
+
fetcher: new FetcherStore(storeName),
|
|
18
|
+
mercure: new MercureStore(storeName),
|
|
19
|
+
apiDocumentation: new ApiDocumentationStore(storeName),
|
|
20
|
+
auth: new AuthStore(storeName),
|
|
21
|
+
admin: new AdminStore(storeName),
|
|
22
|
+
error: new ErrorStore(storeName)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default function(adminState) {
|
|
2
|
+
return {
|
|
3
|
+
toggleEdit(isEditing) {
|
|
4
|
+
adminState.state.isEditing = isEditing !== void 0 ? isEditing : !adminState.state.isEditing;
|
|
5
|
+
if (!adminState.state.isEditing) {
|
|
6
|
+
adminState.state.navigationGuardDisabled = false;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CwaPiniaStoreDefinitionInterface, CwaPiniaStoreInterface, CwaStore } from '../cwa-store-types.js';
|
|
2
|
+
import type { CwaAdminStateInterface } from './state.js';
|
|
3
|
+
import type { CwaAdminActionsInterface } from './actions.js';
|
|
4
|
+
/**
|
|
5
|
+
* Interface Definitions
|
|
6
|
+
*/
|
|
7
|
+
export interface CwaAdminInterface extends CwaAdminStateInterface, CwaAdminActionsInterface {
|
|
8
|
+
}
|
|
9
|
+
export type CwaAdminStoreDefinitionInterface = CwaPiniaStoreDefinitionInterface<`${string}.admin`, CwaAdminInterface>;
|
|
10
|
+
export type CwaAdminStoreInterface = CwaPiniaStoreInterface<`${string}.admin`, CwaAdminInterface>;
|
|
11
|
+
/**
|
|
12
|
+
* Main Store Class
|
|
13
|
+
*/
|
|
14
|
+
export declare class AdminStore implements CwaStore {
|
|
15
|
+
private readonly storeDefinition;
|
|
16
|
+
constructor(storeName: string);
|
|
17
|
+
useStore(): CwaAdminStoreInterface;
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineStore
|
|
3
|
+
} from "pinia";
|
|
4
|
+
import CwaAdminState from "./state.js";
|
|
5
|
+
import CwaAdminActions from "./actions.js";
|
|
6
|
+
export class AdminStore {
|
|
7
|
+
storeDefinition;
|
|
8
|
+
constructor(storeName) {
|
|
9
|
+
this.storeDefinition = defineStore(`${storeName}.admin`, () => {
|
|
10
|
+
const adminState = CwaAdminState();
|
|
11
|
+
return {
|
|
12
|
+
...adminState,
|
|
13
|
+
...CwaAdminActions(adminState)
|
|
14
|
+
};
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
useStore() {
|
|
18
|
+
return this.storeDefinition();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CwaPiniaStoreDefinitionInterface, CwaPiniaStoreInterface, CwaStore } from '../cwa-store-types.js';
|
|
2
|
+
import type { CwaApiDocumentationStateInterface } from './state.js';
|
|
3
|
+
/**
|
|
4
|
+
* Interface Definitions
|
|
5
|
+
*/
|
|
6
|
+
export type CwaApiDocumentationInterface = CwaApiDocumentationStateInterface;
|
|
7
|
+
export type CwaApiDocumentationStoreDefinitionInterface = CwaPiniaStoreDefinitionInterface<`${string}.apiDocumentation`, CwaApiDocumentationInterface>;
|
|
8
|
+
export type CwaApiDocumentationStoreInterface = CwaPiniaStoreInterface<`${string}.apiDocumentation`, CwaApiDocumentationInterface>;
|
|
9
|
+
/**
|
|
10
|
+
* Main Store Class
|
|
11
|
+
*/
|
|
12
|
+
export declare class ApiDocumentationStore implements CwaStore {
|
|
13
|
+
private readonly storeDefinition;
|
|
14
|
+
constructor(storeName: string);
|
|
15
|
+
useStore(): CwaApiDocumentationStoreInterface;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineStore
|
|
3
|
+
} from "pinia";
|
|
4
|
+
import CwaApiDocumentationState from "./state.js";
|
|
5
|
+
export class ApiDocumentationStore {
|
|
6
|
+
storeDefinition;
|
|
7
|
+
constructor(storeName) {
|
|
8
|
+
this.storeDefinition = defineStore(`${storeName}.apiDocumentation`, () => {
|
|
9
|
+
const apiDocumentationState = CwaApiDocumentationState();
|
|
10
|
+
return {
|
|
11
|
+
...apiDocumentationState
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
useStore() {
|
|
16
|
+
return this.storeDefinition();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { CwaResource } from '#cwa/runtime/resources/resource-utils';
|
|
3
|
+
export interface PageDataMetadataResource extends CwaResource {
|
|
4
|
+
'@type': 'PageDataMetadata';
|
|
5
|
+
'resourceClass': string;
|
|
6
|
+
'properties': {
|
|
7
|
+
'property': string;
|
|
8
|
+
'componentShortName': string;
|
|
9
|
+
'@id': string;
|
|
10
|
+
'@type': 'PageDataPropertyMetadata';
|
|
11
|
+
}[];
|
|
12
|
+
}
|
|
13
|
+
export interface CwaApiDocumentationDataInterface {
|
|
14
|
+
entrypoint?: {
|
|
15
|
+
'@context': string;
|
|
16
|
+
'@id': string;
|
|
17
|
+
'@type': 'Entrypoint';
|
|
18
|
+
[key: string]: string;
|
|
19
|
+
};
|
|
20
|
+
docs?: {
|
|
21
|
+
'@context': any;
|
|
22
|
+
'@id': string;
|
|
23
|
+
'@type': 'hydra:ApiDocumentation';
|
|
24
|
+
'hydra:title': string;
|
|
25
|
+
'hydra:description': string;
|
|
26
|
+
'hydra:entrypoint': string;
|
|
27
|
+
'hydra:supportedClass': Array<{
|
|
28
|
+
'@id': string;
|
|
29
|
+
'@type': string;
|
|
30
|
+
'hydra:title': string;
|
|
31
|
+
'rdfs:label': string;
|
|
32
|
+
'hydra:description': string;
|
|
33
|
+
'hydra:supportedOperation': Array<{
|
|
34
|
+
'@type': Array<string> | string;
|
|
35
|
+
'hydra:method': string;
|
|
36
|
+
'hydra:title': string;
|
|
37
|
+
'rdfs:label': string;
|
|
38
|
+
'returns': string;
|
|
39
|
+
}>;
|
|
40
|
+
'hydra:supportedProperty': Array<{
|
|
41
|
+
'@type': 'hydra:SupportedProperty';
|
|
42
|
+
'hydra:title': string;
|
|
43
|
+
'hydra:required': boolean;
|
|
44
|
+
'hydra:readable': boolean;
|
|
45
|
+
'hydra:writeable': boolean;
|
|
46
|
+
'hydra:property': Array<{
|
|
47
|
+
'@id': string;
|
|
48
|
+
'@type': string;
|
|
49
|
+
'rdfs:label': string;
|
|
50
|
+
'domain': string;
|
|
51
|
+
'range': string;
|
|
52
|
+
}>;
|
|
53
|
+
}>;
|
|
54
|
+
}>;
|
|
55
|
+
'info': {
|
|
56
|
+
version: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
pageDataMetadata?: {
|
|
60
|
+
'@context': {
|
|
61
|
+
'@vocab': string;
|
|
62
|
+
'hydra': string;
|
|
63
|
+
'properties': 'PageDataMetadata/properties';
|
|
64
|
+
};
|
|
65
|
+
'@id': '/_/page_data_metadatas';
|
|
66
|
+
'@type': 'hydra:Collection';
|
|
67
|
+
'hydra:member': PageDataMetadataResource[];
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export interface CwaApiDocumentationStateInterface {
|
|
71
|
+
docsPath: Ref<string | null>;
|
|
72
|
+
apiDocumentation?: CwaApiDocumentationDataInterface;
|
|
73
|
+
}
|
|
74
|
+
export default function (): CwaApiDocumentationStateInterface;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CwaPiniaStoreDefinitionInterface, CwaPiniaStoreInterface, CwaStore } from '../cwa-store-types.js';
|
|
2
|
+
import type { CwaAuthStateInterface } from './state.js';
|
|
3
|
+
/**
|
|
4
|
+
* Interface Definitions
|
|
5
|
+
*/
|
|
6
|
+
export type CwaAuthInterface = CwaAuthStateInterface;
|
|
7
|
+
export type CwaAuthStoreDefinitionInterface = CwaPiniaStoreDefinitionInterface<`${string}.auth`, CwaAuthInterface>;
|
|
8
|
+
export type CwaAuthStoreInterface = CwaPiniaStoreInterface<`${string}.auth`, CwaAuthInterface>;
|
|
9
|
+
/**
|
|
10
|
+
* Main Store Class
|
|
11
|
+
*/
|
|
12
|
+
export declare class AuthStore implements CwaStore {
|
|
13
|
+
private readonly storeDefinition;
|
|
14
|
+
constructor(storeName: string);
|
|
15
|
+
useStore(): CwaAuthStoreInterface;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineStore
|
|
3
|
+
} from "pinia";
|
|
4
|
+
import CwaAuthState from "./state.js";
|
|
5
|
+
export class AuthStore {
|
|
6
|
+
storeDefinition;
|
|
7
|
+
constructor(storeName) {
|
|
8
|
+
this.storeDefinition = defineStore(`${storeName}.auth`, () => {
|
|
9
|
+
const fetcherState = CwaAuthState();
|
|
10
|
+
return {
|
|
11
|
+
...fetcherState
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
useStore() {
|
|
16
|
+
return this.storeDefinition();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CwaResource } from '../../../resources/resource-utils.js';
|
|
2
|
+
export declare enum CwaUserRoles {
|
|
3
|
+
SUPER_ADMIN = "ROLE_SUPER_ADMIN",
|
|
4
|
+
ADMIN = "ROLE_ADMIN",
|
|
5
|
+
ALLOWED_TO_SWITCH = "ROLE_ALLOWED_TO_SWITCH",
|
|
6
|
+
USER = "ROLE_USER"
|
|
7
|
+
}
|
|
8
|
+
interface CwaUser extends CwaResource {
|
|
9
|
+
emailAddress: string;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
roles: (string | CwaUserRoles)[];
|
|
12
|
+
username: string;
|
|
13
|
+
}
|
|
14
|
+
export interface CwaAuthStateInterface {
|
|
15
|
+
data: {
|
|
16
|
+
user?: CwaUser;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export default function (): CwaAuthStateInterface;
|
|
20
|
+
export {};
|