@cwa/nuxt-edge 0.0.0-29696494.72f11a4
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/_components/TextButton.vue +13 -0
- package/dist/layer/error.vue +13 -0
- package/dist/layer/layouts/CwaRootLayout.vue +172 -0
- package/dist/layer/nuxt.config.ts +8 -0
- package/dist/layer/pages/_cwa/[cwaPage0].vue +18 -0
- package/dist/layer/pages/_cwa/index/composables/useDataList.ts +50 -0
- package/dist/layer/pages/_cwa/index/composables/useDataType.ts +41 -0
- package/dist/layer/pages/_cwa/index/composables/useDynamicPageLoader.ts +28 -0
- package/dist/layer/pages/_cwa/index/composables/useItemPage.ts +200 -0
- package/dist/layer/pages/_cwa/index/composables/useListPage.ts +44 -0
- package/dist/layer/pages/_cwa/index/composables/useParentPageDataLoader.ts +51 -0
- package/dist/layer/pages/_cwa/index/composables/useParentPageLoader.ts +25 -0
- package/dist/layer/pages/_cwa/index/data/[type]/[iri].vue +22 -0
- package/dist/layer/pages/_cwa/index/data/[type].vue +132 -0
- package/dist/layer/pages/_cwa/index/data/index.vue +84 -0
- package/dist/layer/pages/_cwa/index/layouts/[iri].vue +180 -0
- package/dist/layer/pages/_cwa/index/layouts.vue +77 -0
- package/dist/layer/pages/_cwa/index/pages/[iri].vue +16 -0
- package/dist/layer/pages/_cwa/index/pages.vue +130 -0
- package/dist/layer/pages/_cwa/index/routes.vue +56 -0
- package/dist/layer/pages/_cwa/index/settings.vue +398 -0
- package/dist/layer/pages/_cwa/index/users/[iri].vue +337 -0
- package/dist/layer/pages/_cwa/index/users.vue +90 -0
- package/dist/layer/pages/_cwa/index.vue +43 -0
- package/dist/layer/pages/confirm-new-email/[username]/[newEmail]/[token].vue +49 -0
- package/dist/layer/pages/forgot-password.vue +31 -0
- package/dist/layer/pages/login.vue +32 -0
- package/dist/layer/pages/reset-password/[username]/[token].vue +38 -0
- package/dist/layer/pages/verify-email/[username]/[token].vue +48 -0
- package/dist/module.d.mts +15 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +292 -0
- package/dist/runtime/admin/admin.d.ts +35 -0
- package/dist/runtime/admin/admin.js +65 -0
- package/dist/runtime/admin/manageable-resource.d.ts +42 -0
- package/dist/runtime/admin/manageable-resource.js +241 -0
- package/dist/runtime/admin/manager-tabs-resolver.d.ts +17 -0
- package/dist/runtime/admin/manager-tabs-resolver.js +55 -0
- package/dist/runtime/admin/navigation-guard.d.ts +18 -0
- package/dist/runtime/admin/navigation-guard.js +57 -0
- package/dist/runtime/admin/resource-stack-manager.d.ts +93 -0
- package/dist/runtime/admin/resource-stack-manager.js +388 -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 +100 -0
- package/dist/runtime/api/auth.js +264 -0
- package/dist/runtime/api/fetcher/cwa-fetch.d.ts +12 -0
- package/dist/runtime/api/fetcher/cwa-fetch.js +43 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.d.ts +59 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.js +225 -0
- package/dist/runtime/api/fetcher/fetcher.d.ts +57 -0
- package/dist/runtime/api/fetcher/fetcher.js +263 -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 +32 -0
- package/dist/runtime/api/mercure.js +196 -0
- package/dist/runtime/api/site-config.d.ts +36 -0
- package/dist/runtime/api/site-config.js +135 -0
- package/dist/runtime/composables/component/html-content.d.ts +2 -0
- package/dist/runtime/composables/component/html-content.js +74 -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 +18 -0
- package/dist/runtime/composables/cwa-collection-resource.js +105 -0
- package/dist/runtime/composables/cwa-image-resource.d.ts +15 -0
- package/dist/runtime/composables/cwa-image-resource.js +26 -0
- package/dist/runtime/composables/cwa-image.d.ts +24 -0
- package/dist/runtime/composables/cwa-image.js +38 -0
- package/dist/runtime/composables/cwa-query-bound-model.d.ts +9 -0
- package/dist/runtime/composables/cwa-query-bound-model.js +109 -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 +53 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.d.ts +16 -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 +156 -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 +26 -0
- package/dist/runtime/composables/cwa-resource.js +42 -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 +105 -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/composables/useCwaResourceRoute.d.ts +10 -0
- package/dist/runtime/composables/useCwaResourceRoute.js +17 -0
- package/dist/runtime/composables/useCwaSiteConfig.d.ts +15 -0
- package/dist/runtime/composables/useCwaSiteConfig.js +78 -0
- package/dist/runtime/composables/useResendVerifyEmail.d.ts +6 -0
- package/dist/runtime/composables/useResendVerifyEmail.js +43 -0
- package/dist/runtime/composables/useVerifyEmail.d.ts +8 -0
- package/dist/runtime/composables/useVerifyEmail.js +84 -0
- package/dist/runtime/cwa.d.ts +70 -0
- package/dist/runtime/cwa.js +133 -0
- package/dist/runtime/errors/cwa-resource-error.d.ts +20 -0
- package/dist/runtime/errors/cwa-resource-error.js +61 -0
- package/dist/runtime/plugin.d.ts +8 -0
- package/dist/runtime/plugin.js +20 -0
- package/dist/runtime/resources/resource-utils.d.ts +52 -0
- package/dist/runtime/resources/resource-utils.js +86 -0
- package/dist/runtime/resources/resources-manager.d.ts +70 -0
- package/dist/runtime/resources/resources-manager.js +482 -0
- package/dist/runtime/resources/resources.d.ts +61 -0
- package/dist/runtime/resources/resources.js +360 -0
- package/dist/runtime/route-middleware.d.ts +2 -0
- package/dist/runtime/route-middleware.js +71 -0
- package/dist/runtime/server/cwa-custom-sitemap.get.d.ts +2 -0
- package/dist/runtime/server/cwa-custom-sitemap.get.js +29 -0
- package/dist/runtime/server/cwa-healthcheck.get.d.ts +4 -0
- package/dist/runtime/server/cwa-healthcheck.get.js +10 -0
- package/dist/runtime/server/cwa-urls.get.d.ts +3 -0
- package/dist/runtime/server/cwa-urls.get.js +15 -0
- package/dist/runtime/server/server-middleware.d.ts +2 -0
- package/dist/runtime/server/server-middleware.js +63 -0
- package/dist/runtime/server/server-plugin.d.ts +2 -0
- package/dist/runtime/server/server-plugin.js +59 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/useFetcher.d.ts +7 -0
- package/dist/runtime/server/useFetcher.js +40 -0
- package/dist/runtime/storage/storage.d.ts +25 -0
- package/dist/runtime/storage/storage.js +48 -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 +71 -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 +19 -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 +73 -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 +56 -0
- package/dist/runtime/storage/stores/fetcher/actions.js +138 -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 +27 -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 +59 -0
- package/dist/runtime/storage/stores/resources/actions.js +449 -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 +254 -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 +67 -0
- package/dist/runtime/storage/stores/resources/state.js +24 -0
- package/dist/runtime/storage/stores/site-config/actions.d.ts +9 -0
- package/dist/runtime/storage/stores/site-config/actions.js +20 -0
- package/dist/runtime/storage/stores/site-config/getters.d.ts +7 -0
- package/dist/runtime/storage/stores/site-config/getters.js +10 -0
- package/dist/runtime/storage/stores/site-config/site-config-store.d.ts +19 -0
- package/dist/runtime/storage/stores/site-config/site-config-store.js +23 -0
- package/dist/runtime/storage/stores/site-config/state.d.ts +13 -0
- package/dist/runtime/storage/stores/site-config/state.js +8 -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.d.vue.ts +7 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue +27 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue.d.ts +7 -0
- package/dist/runtime/templates/components/core/ComponentPosition.d.vue.ts +4 -0
- package/dist/runtime/templates/components/core/ComponentPosition.spec.ts.snap +16 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue +64 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue.d.ts +4 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue +41 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/DialogBox.d.vue.ts +38 -0
- package/dist/runtime/templates/components/core/DialogBox.vue +96 -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.d.vue.ts +14 -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 +14 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.vue +7 -0
- package/dist/runtime/templates/components/core/admin/CwaCode.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue +11 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContent.d.vue.ts +24 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue +137 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue.d.ts +24 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.d.vue.ts +10 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue +49 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue.d.ts +10 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue +53 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.d.vue.ts +20 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue +33 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue.d.ts +20 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue +94 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue +19 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.d.vue.ts +13 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue +404 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue.d.ts +13 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue +368 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.vue +439 -0
- package/dist/runtime/templates/components/core/admin/PageResourceAdminModal.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.d.vue.ts +35 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue +110 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue.d.ts +35 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.d.vue.ts +7 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue +27 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue.d.ts +7 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.d.vue.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue +24 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.d.vue.ts +0 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue +81 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue.d.ts +0 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.vue +42 -0
- package/dist/runtime/templates/components/core/admin/RouteHierarchyNode.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.d.vue.ts +21 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue +102 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue.d.ts +21 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.d.vue.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue +62 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue.d.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue +264 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.d.vue.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.vue +45 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabAddRedirect.vue.d.ts +11 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.d.vue.ts +24 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.vue +139 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabManage.vue.d.ts +24 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.vue +74 -0
- package/dist/runtime/templates/components/core/admin/RoutesTabView.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue +19 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.d.vue.ts +8 -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 +8 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.d.vue.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue +24 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.d.vue.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue +57 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue.d.ts +17 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.d.vue.ts +14 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.vue +23 -0
- package/dist/runtime/templates/components/core/admin/form/ModalRadioTabs.vue.d.ts +14 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.d.vue.ts +12 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue +100 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.d.vue.ts +9 -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 +9 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue +21 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue +15 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconData.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue +24 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue +20 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconPages.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue +21 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue +23 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.d.vue.ts +3 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue +13 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/useDataResolver.d.ts +12 -0
- package/dist/runtime/templates/components/core/useDataResolver.js +113 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.d.ts +6 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.js +166 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.d.ts +22 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.js +102 -0
- package/dist/runtime/templates/components/main/ComponentGroup.d.vue.ts +13 -0
- package/dist/runtime/templates/components/main/ComponentGroup.spec.ts.snap +68 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue +138 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue.d.ts +13 -0
- package/dist/runtime/templates/components/main/CwaLink.d.vue.ts +14 -0
- package/dist/runtime/templates/components/main/CwaLink.vue +55 -0
- package/dist/runtime/templates/components/main/CwaLink.vue.d.ts +14 -0
- package/dist/runtime/templates/components/main/CwaPage.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/CwaPage.vue +22 -0
- package/dist/runtime/templates/components/main/CwaPage.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/DefaultLayout.d.vue.ts +12 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue +12 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/ErrorPage.d.vue.ts +7 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue +134 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/Logo.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/Logo.vue +18 -0
- package/dist/runtime/templates/components/main/Logo.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/README.md +7 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.d.vue.ts +12 -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 +12 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.d.vue.ts +3 -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 +3 -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.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue +209 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue +155 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.d.vue.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue +15 -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.d.vue.ts +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue +20 -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.d.vue.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue +70 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue.d.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.d.vue.ts +3 -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 +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.d.vue.ts +3 -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 +3 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.d.vue.ts +3 -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 +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.d.vue.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue +159 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue.d.ts +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.d.vue.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue +198 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue.d.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.d.vue.ts +10 -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 +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue +208 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.d.vue.ts +11 -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 +11 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.d.vue.ts +8 -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 +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.d.vue.ts +14 -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 +14 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue +67 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.d.vue.ts +3 -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 +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.d.vue.ts +3 -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 +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue +114 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.d.vue.ts +3 -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 +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.d.vue.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue +104 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue.d.ts +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.d.vue.ts +3 -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 +3 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.d.vue.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue +94 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue.d.ts +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.d.vue.ts +8 -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 +8 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.d.vue.ts +3 -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 +3 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.d.vue.ts +26 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue +56 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue.d.ts +26 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.d.vue.ts +28 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue +61 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue.d.ts +28 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.d.vue.ts +28 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue +59 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue.d.ts +28 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.d.vue.ts +7 -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 +7 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.d.vue.ts +25 -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 +59 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue.d.ts +25 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.d.vue.ts +22 -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 +22 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue +1071 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/Hamburger.d.vue.ts +10 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue +75 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/ProgressBar.d.vue.ts +10 -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 +10 -0
- package/dist/runtime/templates/components/ui/README.md +6 -0
- package/dist/runtime/templates/components/ui/alert/Info.d.vue.ts +12 -0
- package/dist/runtime/templates/components/ui/alert/Info.spec.ts.snap +23 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue +17 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue.d.ts +12 -0
- package/dist/runtime/templates/components/ui/alert/Warning.d.vue.ts +13 -0
- package/dist/runtime/templates/components/ui/alert/Warning.spec.ts.snap +18 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue +13 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue.d.ts +13 -0
- package/dist/runtime/templates/components/ui/form/Button.d.vue.ts +53 -0
- package/dist/runtime/templates/components/ui/form/Button.vue +139 -0
- package/dist/runtime/templates/components/ui/form/Button.vue.d.ts +53 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue +18 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue +15 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/form/File.d.vue.ts +18 -0
- package/dist/runtime/templates/components/ui/form/File.vue +72 -0
- package/dist/runtime/templates/components/ui/form/File.vue.d.ts +18 -0
- package/dist/runtime/templates/components/ui/form/Input.d.vue.ts +10 -0
- package/dist/runtime/templates/components/ui/form/Input.vue +17 -0
- package/dist/runtime/templates/components/ui/form/Input.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.d.vue.ts +15 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue +17 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue.d.ts +15 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.d.vue.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 +15 -0
- package/dist/runtime/templates/components/ui/form/Select.d.vue.ts +8 -0
- package/dist/runtime/templates/components/ui/form/Select.vue +60 -0
- package/dist/runtime/templates/components/ui/form/Select.vue.d.ts +8 -0
- package/dist/runtime/templates/components/ui/form/Toggle.d.vue.ts +11 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue +48 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue.d.ts +11 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue +30 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue +12 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue +10 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue +23 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue +11 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.d.vue.ts +3 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue +15 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue.d.ts +3 -0
- package/dist/runtime/templates/components/utils/ContextMenu.d.vue.ts +27 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue +60 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue.d.ts +27 -0
- package/dist/runtime/templates/components/utils/HotSpot.d.vue.ts +12 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue +28 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue.d.ts +12 -0
- package/dist/runtime/templates/components/utils/README.md +1 -0
- package/dist/runtime/templates/components/utils/Spinner.d.vue.ts +7 -0
- package/dist/runtime/templates/components/utils/Spinner.spec.ts.snap +56 -0
- package/dist/runtime/templates/components/utils/Spinner.vue +44 -0
- package/dist/runtime/templates/components/utils/Spinner.vue.d.ts +7 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.d.vue.ts +7 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue +43 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue.d.ts +7 -0
- package/dist/runtime/templates/cwa-page.d.vue.ts +3 -0
- package/dist/runtime/templates/cwa-page.spec.ts.snap +9 -0
- package/dist/runtime/templates/cwa-page.vue +55 -0
- package/dist/runtime/templates/cwa-page.vue.d.ts +3 -0
- package/dist/runtime/types/index.d.ts +59 -0
- package/dist/runtime/types/index.js +0 -0
- package/dist/runtime/types/popper.d.ts +14 -0
- package/dist/types.d.mts +7 -0
- package/package.json +132 -0
|
@@ -0,0 +1,360 @@
|
|
|
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
|
+
this._resourcesStore = resourcesStoreDefinition.useStore();
|
|
12
|
+
this._fetcherStore = fetcherStoreDefinition.useStore();
|
|
13
|
+
}
|
|
14
|
+
resourcesStoreDefinition;
|
|
15
|
+
fetcherStoreDefinition;
|
|
16
|
+
_resourcesStore;
|
|
17
|
+
_fetcherStore;
|
|
18
|
+
get currentIds() {
|
|
19
|
+
return this.resourcesStore.current.currentIds;
|
|
20
|
+
}
|
|
21
|
+
isIriPublishableEquivalent(oldIri, newIri) {
|
|
22
|
+
return this.resourcesStore.isIriPublishableEquivalent(oldIri, newIri);
|
|
23
|
+
}
|
|
24
|
+
findAllPublishableIris(iri) {
|
|
25
|
+
return this.resourcesStore.findAllPublishableIris(iri);
|
|
26
|
+
}
|
|
27
|
+
getResource(id) {
|
|
28
|
+
return computed(() => {
|
|
29
|
+
return this.resourcesStore.getResource(id);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
getChildIris(iri, addResourceEvent) {
|
|
33
|
+
return this.resourcesStore.getChildIris(iri, addResourceEvent);
|
|
34
|
+
}
|
|
35
|
+
get newResource() {
|
|
36
|
+
return computed(() => this.resourcesStore.getResource(NEW_RESOURCE_IRI));
|
|
37
|
+
}
|
|
38
|
+
getComponentGroupByReference(reference) {
|
|
39
|
+
const componentGroups = this.resourcesStore.resourcesByType[CwaResourceTypes.COMPONENT_GROUP];
|
|
40
|
+
return componentGroups.find((componentGroupResource) => {
|
|
41
|
+
return componentGroupResource.data?.reference === reference;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
get currentResources() {
|
|
45
|
+
return this.resourcesStore.current.currentIds.reduce((obj, id) => {
|
|
46
|
+
const idResource = this.getResource(id).value;
|
|
47
|
+
if (idResource) {
|
|
48
|
+
obj[id] = idResource;
|
|
49
|
+
}
|
|
50
|
+
return obj;
|
|
51
|
+
}, {});
|
|
52
|
+
}
|
|
53
|
+
get displayFetchStatus() {
|
|
54
|
+
const fetchingToken = this.fetcherStore.primaryFetch.fetchingToken;
|
|
55
|
+
if (fetchingToken) {
|
|
56
|
+
const fetchingStatus = this.fetcherStore.fetches[fetchingToken];
|
|
57
|
+
if (fetchingStatus) {
|
|
58
|
+
const irisByDepth = fetchingStatus.manifest?.irisByDepth;
|
|
59
|
+
const pageIri = irisByDepth?.[0] ? this.getPageIriFromDepthGroup(irisByDepth[0]) : this.getPageIriByFetchStatus(fetchingStatus);
|
|
60
|
+
if (pageIri && this.resourcesStore.current.currentIds.includes(pageIri)) {
|
|
61
|
+
const pageResource = this.getResource(pageIri).value;
|
|
62
|
+
if (pageResource?.data && pageResource.apiState.status === CwaResourceApiStatuses.SUCCESS) {
|
|
63
|
+
const layoutIri = this.getLayoutIriByFetchStatus(fetchingStatus);
|
|
64
|
+
const layoutReady = !layoutIri || !!this.getResource(layoutIri).value?.data;
|
|
65
|
+
if (layoutReady) {
|
|
66
|
+
return fetchingStatus;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return this.fetcherStore.resolvedSuccessFetchStatus;
|
|
73
|
+
}
|
|
74
|
+
get pageLoadResources() {
|
|
75
|
+
const token = this.fetcherStore.primaryFetch.fetchingToken;
|
|
76
|
+
if (!token) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
const fetchStatus = this.fetcherStore.fetches[token];
|
|
80
|
+
if (!fetchStatus) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const type = this.getFetchStatusType(fetchStatus);
|
|
84
|
+
if (!type) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const resources = [
|
|
88
|
+
this.getLayoutIriByFetchStatus(fetchStatus),
|
|
89
|
+
this.getPageIriByFetchStatus(fetchStatus)
|
|
90
|
+
];
|
|
91
|
+
if (type === CwaResourceTypes.ROUTE || type === CwaResourceTypes.PAGE_DATA) {
|
|
92
|
+
resources.push(fetchStatus.path);
|
|
93
|
+
}
|
|
94
|
+
if (type === CwaResourceTypes.ROUTE) {
|
|
95
|
+
const routeResource = this.getResource(fetchStatus.path).value;
|
|
96
|
+
if (routeResource) {
|
|
97
|
+
const pageDataIri = routeResource.data?.value?.pageData;
|
|
98
|
+
if (pageDataIri) {
|
|
99
|
+
resources.push(pageDataIri);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return resources;
|
|
104
|
+
}
|
|
105
|
+
get pageLoadProgress() {
|
|
106
|
+
return computed(() => {
|
|
107
|
+
const pageLoadResources = this.pageLoadResources;
|
|
108
|
+
if (!pageLoadResources) {
|
|
109
|
+
return {
|
|
110
|
+
resources: [],
|
|
111
|
+
total: 0,
|
|
112
|
+
complete: 0,
|
|
113
|
+
percent: 100
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
const total = pageLoadResources.length;
|
|
117
|
+
let complete = 0;
|
|
118
|
+
for (const resourceIri of pageLoadResources) {
|
|
119
|
+
if (!resourceIri) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
122
|
+
const resource = this.getResource(resourceIri).value;
|
|
123
|
+
if (resource?.apiState.status !== CwaResourceApiStatuses.IN_PROGRESS) {
|
|
124
|
+
complete++;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const percent = complete ? Math.round(complete / total * 100) : 0;
|
|
128
|
+
return {
|
|
129
|
+
resources: pageLoadResources,
|
|
130
|
+
total,
|
|
131
|
+
complete,
|
|
132
|
+
percent
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
isPageDataResource(iri) {
|
|
137
|
+
return computed(() => {
|
|
138
|
+
if (!this.pageData?.value?.data || !iri) {
|
|
139
|
+
return false;
|
|
140
|
+
}
|
|
141
|
+
if (getResourceTypeFromIri(iri) !== CwaResourceTypes.COMPONENT) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
const allIris = this.findAllPublishableIris(iri);
|
|
145
|
+
for (const iri2 of allIris) {
|
|
146
|
+
if (Object.values(this.pageData.value.data).includes(iri2)) {
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return false;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
getFetchStatusType(fetchStatus) {
|
|
154
|
+
if (!fetchStatus) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const type = getResourceTypeFromIri(fetchStatus.path);
|
|
158
|
+
if (!type) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
return type;
|
|
162
|
+
}
|
|
163
|
+
getLayoutIriByFetchStatus(fetchStatus) {
|
|
164
|
+
const irisByDepth = fetchStatus?.manifest?.irisByDepth;
|
|
165
|
+
const pageIri = irisByDepth?.[0] ? this.getPageIriFromDepthGroup(irisByDepth[0]) : this.getPageIriByFetchStatus(fetchStatus);
|
|
166
|
+
if (!pageIri) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
const pageResource = this.getResource(pageIri).value;
|
|
170
|
+
return pageResource?.data?.layout;
|
|
171
|
+
}
|
|
172
|
+
getPageIriFromDepthGroup(group) {
|
|
173
|
+
return group.find((iri) => getResourceTypeFromIri(iri) === CwaResourceTypes.PAGE);
|
|
174
|
+
}
|
|
175
|
+
getPageDataIriFromDepthGroup(group) {
|
|
176
|
+
return group.find((iri) => getResourceTypeFromIri(iri) === CwaResourceTypes.PAGE_DATA);
|
|
177
|
+
}
|
|
178
|
+
pageIriAtDepth(depth) {
|
|
179
|
+
return computed(() => {
|
|
180
|
+
const fetchStatus = this.displayFetchStatus;
|
|
181
|
+
const irisByDepth = fetchStatus?.manifest?.irisByDepth;
|
|
182
|
+
if (irisByDepth?.[depth]) {
|
|
183
|
+
return this.getPageIriFromDepthGroup(irisByDepth[depth]);
|
|
184
|
+
}
|
|
185
|
+
if (depth === 0) {
|
|
186
|
+
return this.getPageIriByFetchStatus(fetchStatus);
|
|
187
|
+
}
|
|
188
|
+
return void 0;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
pageDataIriAtDepth(depth) {
|
|
192
|
+
return computed(() => {
|
|
193
|
+
const irisByDepth = this.displayFetchStatus?.manifest?.irisByDepth;
|
|
194
|
+
if (irisByDepth?.[depth]) {
|
|
195
|
+
return this.getPageDataIriFromDepthGroup(irisByDepth[depth]);
|
|
196
|
+
}
|
|
197
|
+
return void 0;
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
getPageIriByFetchStatus(fetchStatus) {
|
|
201
|
+
const type = this.getFetchStatusType(fetchStatus);
|
|
202
|
+
if (!type) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
if (!fetchStatus?.path) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
const successResource = this.getResource(fetchStatus.path).value;
|
|
209
|
+
if (!successResource) {
|
|
210
|
+
if (type === CwaResourceTypes.PAGE) {
|
|
211
|
+
return fetchStatus.path;
|
|
212
|
+
}
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (type === CwaResourceTypes.PAGE) {
|
|
216
|
+
if (!("iri" in successResource.apiState)) {
|
|
217
|
+
return fetchStatus.path;
|
|
218
|
+
}
|
|
219
|
+
return successResource.apiState.responseIri || successResource.apiState.iri || fetchStatus.path;
|
|
220
|
+
}
|
|
221
|
+
switch (type) {
|
|
222
|
+
case CwaResourceTypes.PAGE_DATA: {
|
|
223
|
+
return successResource.data?.page;
|
|
224
|
+
}
|
|
225
|
+
case CwaResourceTypes.ROUTE: {
|
|
226
|
+
const pageData = successResource.data?.pageData;
|
|
227
|
+
if (pageData) {
|
|
228
|
+
const pageDataResource = this.getResource(pageData).value;
|
|
229
|
+
return pageDataResource?.data?.page;
|
|
230
|
+
}
|
|
231
|
+
return successResource.data?.page;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
get pageDataIri() {
|
|
236
|
+
return computed(() => {
|
|
237
|
+
const fetchStatus = this.displayFetchStatus;
|
|
238
|
+
const type = this.getFetchStatusType(fetchStatus);
|
|
239
|
+
if (!type) {
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
if (!fetchStatus?.path) {
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
if (type === CwaResourceTypes.PAGE_DATA) {
|
|
246
|
+
return fetchStatus.path;
|
|
247
|
+
}
|
|
248
|
+
const successResource = this.getResource(fetchStatus.path).value;
|
|
249
|
+
return type === CwaResourceTypes.ROUTE ? successResource?.data?.pageData : void 0;
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
get pageData() {
|
|
253
|
+
if (!this.pageDataIri.value) {
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
return this.getResource(this.pageDataIri.value);
|
|
257
|
+
}
|
|
258
|
+
get pageIri() {
|
|
259
|
+
return computed(() => this.getPageIriByFetchStatus(this.displayFetchStatus));
|
|
260
|
+
}
|
|
261
|
+
get page() {
|
|
262
|
+
if (!this.pageIri.value) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
return this.getResource(this.pageIri.value);
|
|
266
|
+
}
|
|
267
|
+
get displayPageIri() {
|
|
268
|
+
return computed(() => {
|
|
269
|
+
if (this.isDataPage.value) {
|
|
270
|
+
return this.pageDataIri.value;
|
|
271
|
+
}
|
|
272
|
+
return this.pageIri.value;
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
get displayPage() {
|
|
276
|
+
if (!this.displayPageIri.value) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
return this.getResource(this.displayPageIri.value);
|
|
280
|
+
}
|
|
281
|
+
get layoutIri() {
|
|
282
|
+
return computed(() => this.getLayoutIriByFetchStatus(this.displayFetchStatus));
|
|
283
|
+
}
|
|
284
|
+
get layout() {
|
|
285
|
+
return computed(() => {
|
|
286
|
+
const layoutIri = this.layoutIri.value;
|
|
287
|
+
if (!layoutIri) {
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
return this.getResource(layoutIri).value;
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
findPublishedComponentIri(iri) {
|
|
294
|
+
return computed(() => {
|
|
295
|
+
return this.resourcesStore.findPublishedComponentIri(iri);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
findDraftComponentIri(iri) {
|
|
299
|
+
return computed(() => {
|
|
300
|
+
return this.resourcesStore.findDraftComponentIri(iri);
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
get getOrderedPositionsForGroup() {
|
|
304
|
+
return this.resourcesStore.getOrderedPositionsForGroup;
|
|
305
|
+
}
|
|
306
|
+
get getPositionSortDisplayNumber() {
|
|
307
|
+
return this.resourcesStore.getPositionSortDisplayNumber;
|
|
308
|
+
}
|
|
309
|
+
getRefreshEndpointsForDelete(iri) {
|
|
310
|
+
const refreshEndpoints = [];
|
|
311
|
+
if (this.pageDataIri.value) {
|
|
312
|
+
refreshEndpoints.push(this.pageDataIri.value);
|
|
313
|
+
}
|
|
314
|
+
const allIris = this.resourcesStore.findAllPublishableIris(iri);
|
|
315
|
+
for (const checkIri of allIris) {
|
|
316
|
+
const componentPositions = this.resourcesStore.current.positionsByComponent[checkIri];
|
|
317
|
+
if (!componentPositions) {
|
|
318
|
+
continue;
|
|
319
|
+
}
|
|
320
|
+
refreshEndpoints.push(...componentPositions);
|
|
321
|
+
for (const posIri of componentPositions) {
|
|
322
|
+
const positionResource = this.getResource(posIri).value;
|
|
323
|
+
if (positionResource?.data?.componentGroup) {
|
|
324
|
+
refreshEndpoints.push(positionResource.data.componentGroup);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
return refreshEndpoints;
|
|
329
|
+
}
|
|
330
|
+
get isLoading() {
|
|
331
|
+
return computed(() => {
|
|
332
|
+
return !this.fetcherStore.fetchesResolved || !!this.resourceLoadStatus.pending;
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
get resourceLoadStatus() {
|
|
336
|
+
return this.resourcesStore.resourceLoadStatus;
|
|
337
|
+
}
|
|
338
|
+
get fetcherStore() {
|
|
339
|
+
return this._fetcherStore;
|
|
340
|
+
}
|
|
341
|
+
get resourcesStore() {
|
|
342
|
+
return this._resourcesStore;
|
|
343
|
+
}
|
|
344
|
+
get usesPageTemplate() {
|
|
345
|
+
return computed(() => !!this.page?.value?.data?.isTemplate);
|
|
346
|
+
}
|
|
347
|
+
get isDataPage() {
|
|
348
|
+
return computed(() => {
|
|
349
|
+
return this.usesPageTemplate.value && !!this.pageDataIri.value;
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
get isDynamicPage() {
|
|
353
|
+
return computed(() => {
|
|
354
|
+
return this.usesPageTemplate.value && !this.pageDataIri.value;
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
get hasNewResources() {
|
|
358
|
+
return this.resourcesStore.hasNewResources;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { v4 as uuidv4 } from "uuid";
|
|
2
|
+
import { consola as logger } from "consola";
|
|
3
|
+
import {
|
|
4
|
+
abortNavigation,
|
|
5
|
+
defineNuxtRouteMiddleware,
|
|
6
|
+
navigateTo,
|
|
7
|
+
useNuxtApp
|
|
8
|
+
} from "nuxt/app";
|
|
9
|
+
import { useProcess } from "#cwa/composables/process";
|
|
10
|
+
let middlewareToken = "";
|
|
11
|
+
export default defineNuxtRouteMiddleware(async (to, from) => {
|
|
12
|
+
const { isClient } = useProcess();
|
|
13
|
+
middlewareToken = uuidv4();
|
|
14
|
+
const nuxtApp = useNuxtApp();
|
|
15
|
+
const adminRouteGuard = nuxtApp.$cwa.adminNavigationGuardFn(to);
|
|
16
|
+
if (adminRouteGuard === false) {
|
|
17
|
+
return abortNavigation();
|
|
18
|
+
}
|
|
19
|
+
const discardAddingSuccess = await nuxtApp.$cwa.resourcesManager.confirmDiscardAddingResource();
|
|
20
|
+
if (!discardAddingSuccess) {
|
|
21
|
+
return abortNavigation();
|
|
22
|
+
}
|
|
23
|
+
if (adminRouteGuard !== true) {
|
|
24
|
+
return navigateTo(adminRouteGuard);
|
|
25
|
+
}
|
|
26
|
+
if (isClient) {
|
|
27
|
+
await nuxtApp.$cwa.initClientSide();
|
|
28
|
+
}
|
|
29
|
+
if (to.meta.cwa?.disabled === true) {
|
|
30
|
+
nuxtApp.$cwa.clearPrimaryFetch();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const waitForMiddleware = () => {
|
|
34
|
+
return new Promise((resolve) => {
|
|
35
|
+
const checkInterval = setInterval(() => {
|
|
36
|
+
if (nuxtApp._processingMiddleware === void 0) {
|
|
37
|
+
resolve(true);
|
|
38
|
+
clearInterval(checkInterval);
|
|
39
|
+
}
|
|
40
|
+
}, 10);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const handleRouteRedirect = async (resource) => {
|
|
44
|
+
if (resource?.redirectPath) {
|
|
45
|
+
if (isClient && nuxtApp._processingMiddleware) {
|
|
46
|
+
await waitForMiddleware();
|
|
47
|
+
}
|
|
48
|
+
logger.info(`Handling route redirect to: '${resource.redirectPath}'`);
|
|
49
|
+
return navigateTo(resource.redirectPath, { redirectCode: 308 });
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
if (!isClient) {
|
|
53
|
+
nuxtApp.$cwa.siteConfig.loadConfig();
|
|
54
|
+
const resource = await nuxtApp.$cwa.fetchRoute(to);
|
|
55
|
+
return handleRouteRedirect(resource);
|
|
56
|
+
}
|
|
57
|
+
const isFirstClientSideRun = nuxtApp.isHydrating && nuxtApp.payload.serverRendered;
|
|
58
|
+
if (isFirstClientSideRun && from.fullPath === to.fullPath) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const startedMiddlewareToken = middlewareToken;
|
|
62
|
+
nuxtApp.$cwa.fetchRoute(to).then(async (resource) => {
|
|
63
|
+
if (startedMiddlewareToken !== middlewareToken && resource?.redirectPath) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const response = await handleRouteRedirect(resource);
|
|
67
|
+
if (response) {
|
|
68
|
+
logger.info("Redirect handler failed", response);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defaultContentType, defineEventHandler } from "h3";
|
|
2
|
+
import { consola } from "consola";
|
|
3
|
+
import useFetcher from "#cwa/server/useFetcher";
|
|
4
|
+
import useCwaSiteConfig from "#cwa/composables/useCwaSiteConfig";
|
|
5
|
+
import { createError } from "#imports";
|
|
6
|
+
export default defineEventHandler(async (event) => {
|
|
7
|
+
const { fetcher, options } = useFetcher();
|
|
8
|
+
const { mergeConfig, responseToConfig } = useCwaSiteConfig();
|
|
9
|
+
try {
|
|
10
|
+
const data = await fetcher("/_/site_config_parameters", {
|
|
11
|
+
credentials: "omit"
|
|
12
|
+
});
|
|
13
|
+
const resolvedConfig = mergeConfig(options.siteConfig, responseToConfig(data, true));
|
|
14
|
+
defaultContentType(event, "application/xml");
|
|
15
|
+
const sitemapXml = resolvedConfig.sitemapXml;
|
|
16
|
+
if (!sitemapXml || sitemapXml === "") {
|
|
17
|
+
return `<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="/__sitemap__/style.xsl"?>
|
|
18
|
+
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
19
|
+
</urlset>`;
|
|
20
|
+
}
|
|
21
|
+
return sitemapXml;
|
|
22
|
+
} catch (e) {
|
|
23
|
+
consola.error(e);
|
|
24
|
+
throw createError({
|
|
25
|
+
statusCode: 500,
|
|
26
|
+
statusMessage: "Server error"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineSitemapEventHandler } from "#sitemap/server/composables/defineSitemapEventHandler";
|
|
2
|
+
import useFetcher, { resolveConfigEventHandler } from "./useFetcher.js";
|
|
3
|
+
export default defineSitemapEventHandler(async (e) => {
|
|
4
|
+
const resolvedConfig = await resolveConfigEventHandler(e);
|
|
5
|
+
if (!resolvedConfig || !resolvedConfig.sitemapEnabled) {
|
|
6
|
+
return [];
|
|
7
|
+
}
|
|
8
|
+
const { fetcher } = useFetcher();
|
|
9
|
+
const data = await fetcher("/_/routes?pagination=false");
|
|
10
|
+
return data["member"].map((r) => {
|
|
11
|
+
return {
|
|
12
|
+
loc: r.path
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { defineEventHandler, parseCookies, getRequestURL, createError } from "h3";
|
|
2
|
+
import { jwtDecode } from "jwt-decode";
|
|
3
|
+
import useCwaSiteConfig from "#cwa/composables/useCwaSiteConfig";
|
|
4
|
+
import { updateSiteConfig } from "#site-config/server/composables";
|
|
5
|
+
import { resolveConfigEventHandler } from "#cwa/server/useFetcher";
|
|
6
|
+
export default defineEventHandler(async (e) => {
|
|
7
|
+
const skipMaintenanceChecks = () => {
|
|
8
|
+
if (e.context.skipMaintenanceChecks === true) return true;
|
|
9
|
+
const allowedPaths = ["/sitemap.xml", "/sitemap_index.xml", "/robots.txt"];
|
|
10
|
+
if (allowedPaths.includes(e.path)) return true;
|
|
11
|
+
const allowedRegex = [new RegExp("^/__sitemap__/.+")];
|
|
12
|
+
for (const re of allowedRegex) {
|
|
13
|
+
const match = e.path.match(re);
|
|
14
|
+
if (match) return true;
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
};
|
|
18
|
+
const resolvedConfig = await resolveConfigEventHandler(e);
|
|
19
|
+
if (resolvedConfig) {
|
|
20
|
+
const { resolvedConfigToSiteConfig } = useCwaSiteConfig();
|
|
21
|
+
updateSiteConfig(e, resolvedConfigToSiteConfig(resolvedConfig));
|
|
22
|
+
if (skipMaintenanceChecks()) return;
|
|
23
|
+
if (resolvedConfig.maintenanceModeEnabled) {
|
|
24
|
+
const isUserAllowedToBypassMaintenance = () => {
|
|
25
|
+
const cookies = parseCookies(e);
|
|
26
|
+
if (cookies.cwa_auth !== "1" || !cookies.api_component) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const decoded = jwtDecode(cookies.api_component);
|
|
31
|
+
if (!decoded.roles || !Array.isArray(decoded.roles)) {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
const includesAny = (arr, values) => values.some((v) => arr.includes(v));
|
|
35
|
+
if (!includesAny(decoded.roles, ["ROLE_ADMIN", "ROLE_SUPER_ADMIN"])) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (!decoded.exp) {
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
const expiry = new Date(decoded.exp * 1e3);
|
|
42
|
+
const expired = (/* @__PURE__ */ new Date()).getTime() >= expiry.getTime();
|
|
43
|
+
return !expired;
|
|
44
|
+
} catch (e2) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
if (isUserAllowedToBypassMaintenance()) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
const url = getRequestURL(e);
|
|
52
|
+
const allowedPaths2 = ["/__nuxt_error", "/login"];
|
|
53
|
+
if (!allowedPaths2.includes(url.pathname) && !url.pathname.startsWith("/_cwa")) {
|
|
54
|
+
const maintenanceError = createError({
|
|
55
|
+
statusCode: 503,
|
|
56
|
+
statusMessage: "Website under maintenance"
|
|
57
|
+
});
|
|
58
|
+
maintenanceError.message = "We will be back up and running as soon as possible";
|
|
59
|
+
throw maintenanceError;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { parseRobotsTxt, NonHelpfulBots, AiBots } from "#robots/util";
|
|
2
|
+
import { resolveConfigEventHandler } from "#cwa/server/useFetcher";
|
|
3
|
+
import { defineNitroPlugin } from "nitropack/runtime";
|
|
4
|
+
export default defineNitroPlugin(async (nitroApp) => {
|
|
5
|
+
nitroApp.hooks.hook("beforeResponse", (event) => {
|
|
6
|
+
const response = event.node.res;
|
|
7
|
+
if (!response) return;
|
|
8
|
+
if (response.hasHeader("set-cookie")) {
|
|
9
|
+
response.removeHeader("set-cookie");
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
nitroApp.hooks.hook("sitemap:index-resolved", async (ctx) => {
|
|
13
|
+
const resolvedConfig = await resolveConfigEventHandler(ctx.event);
|
|
14
|
+
if (!resolvedConfig || !resolvedConfig.sitemapXml || resolvedConfig.sitemapXml === "") {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
ctx.sitemaps.push({
|
|
18
|
+
_sitemapName: "cwa-custom",
|
|
19
|
+
sitemap: "/__sitemap__/cwa-custom.xml"
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
nitroApp.hooks.hook("robots:config", async (ctx) => {
|
|
23
|
+
const resolvedConfig = await resolveConfigEventHandler();
|
|
24
|
+
if (!resolvedConfig) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
ctx.groups.push({
|
|
28
|
+
userAgent: ["*"],
|
|
29
|
+
comment: ["Block all from operational endpoints"],
|
|
30
|
+
allow: [],
|
|
31
|
+
disallow: ["/_cwa/*"]
|
|
32
|
+
// _api was disallowed but is needed when client only '/_api/*',
|
|
33
|
+
});
|
|
34
|
+
if (!resolvedConfig.robotsAllowNonSeoCrawlers) {
|
|
35
|
+
ctx.groups.push({
|
|
36
|
+
userAgent: NonHelpfulBots,
|
|
37
|
+
comment: ["Block non helpful bots"],
|
|
38
|
+
allow: [],
|
|
39
|
+
disallow: ["/"]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (!resolvedConfig.robotsAllowAiBots) {
|
|
43
|
+
ctx.groups.push({
|
|
44
|
+
userAgent: AiBots,
|
|
45
|
+
comment: ["Block AI crawlers"],
|
|
46
|
+
allow: [],
|
|
47
|
+
disallow: ["/"]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (resolvedConfig.robotsRemoveSitemap) {
|
|
51
|
+
ctx.sitemaps = [];
|
|
52
|
+
}
|
|
53
|
+
if (resolvedConfig.robotsText && resolvedConfig.robotsText !== "") {
|
|
54
|
+
const parsedRobotsTxt = parseRobotsTxt(resolvedConfig.robotsText);
|
|
55
|
+
ctx.groups.push(...parsedRobotsTxt.groups);
|
|
56
|
+
ctx.sitemaps.push(...parsedRobotsTxt.sitemaps);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
});
|