@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,131 @@
|
|
|
1
|
+
import { ref, watch } from "vue";
|
|
2
|
+
import { consola as logger } from "consola";
|
|
3
|
+
import { CwaResourceTypes, getResourceTypeFromIri } from "#cwa/resources/resource-utils";
|
|
4
|
+
export default class ApiDocumentation {
|
|
5
|
+
cwaFetch;
|
|
6
|
+
_store;
|
|
7
|
+
apiDocsSet = ref(false);
|
|
8
|
+
apiDocPromise;
|
|
9
|
+
constructor(cwaFetch, store) {
|
|
10
|
+
this.cwaFetch = cwaFetch;
|
|
11
|
+
this._store = store.useStore();
|
|
12
|
+
}
|
|
13
|
+
setDocsPathFromLinkHeader(linkHeader) {
|
|
14
|
+
this.apiDocsSet.value = this.apiDocsSet.value || !!this.docsPath;
|
|
15
|
+
if (this.apiDocsSet.value) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
const matches = /<(.+)>; rel="http:\/\/www.w3.org\/ns\/hydra\/core#apiDocumentation"/.exec(
|
|
19
|
+
linkHeader
|
|
20
|
+
);
|
|
21
|
+
if (!matches || !matches[1]) {
|
|
22
|
+
logger.error(
|
|
23
|
+
'The "Link" HTTP header is not of the type "http://www.w3.org/ns/hydra/core#apiDocumentation".'
|
|
24
|
+
);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
this.store.$patch({
|
|
28
|
+
docsPath: matches[1]
|
|
29
|
+
});
|
|
30
|
+
this.apiDocsSet.value = true;
|
|
31
|
+
logger.debug("ApiDocumentation docsPath", this.docsPath);
|
|
32
|
+
}
|
|
33
|
+
async getApiDocumentation(refresh = false) {
|
|
34
|
+
if (!this.docsPath) {
|
|
35
|
+
logger.debug("Waiting for docsPath to bet set to fetch API Documentation");
|
|
36
|
+
return this.reRunGetApiDocumentationWhenReady(refresh);
|
|
37
|
+
}
|
|
38
|
+
const currentDocs = this.getCurrentApiDocs(refresh);
|
|
39
|
+
if (currentDocs) {
|
|
40
|
+
return currentDocs;
|
|
41
|
+
}
|
|
42
|
+
logger.debug("Fetching API Documentation");
|
|
43
|
+
return await this.fetchAllApiDocumentation(this.docsPath);
|
|
44
|
+
}
|
|
45
|
+
async getComponentMetadata(refresh = false, includePosition = false) {
|
|
46
|
+
const apiDocumentation = await this.getApiDocumentation(refresh);
|
|
47
|
+
const docs = apiDocumentation?.docs;
|
|
48
|
+
const entrypoint = apiDocumentation?.entrypoint;
|
|
49
|
+
if (!docs || !entrypoint) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
const properties = docs["supportedClass"].reduce(
|
|
53
|
+
(obj, supportedClass) => {
|
|
54
|
+
obj[supportedClass["title"]] = supportedClass["supportedProperty"].map((supportedProperty) => supportedProperty["title"]);
|
|
55
|
+
return obj;
|
|
56
|
+
},
|
|
57
|
+
{}
|
|
58
|
+
);
|
|
59
|
+
const metadata = {};
|
|
60
|
+
const typeCheckArray = [CwaResourceTypes.COMPONENT];
|
|
61
|
+
if (includePosition) {
|
|
62
|
+
typeCheckArray.push(CwaResourceTypes.COMPONENT_POSITION);
|
|
63
|
+
}
|
|
64
|
+
for (const [key, endpoint] of Object.entries(entrypoint)) {
|
|
65
|
+
const rType = getResourceTypeFromIri(endpoint);
|
|
66
|
+
if (rType && typeCheckArray.includes(rType)) {
|
|
67
|
+
const resourceName = key.charAt(0).toUpperCase() + key.slice(1);
|
|
68
|
+
const isPublishable = properties?.[resourceName]?.includes("publishedAt") || false;
|
|
69
|
+
metadata[resourceName] = {
|
|
70
|
+
resourceName,
|
|
71
|
+
endpoint,
|
|
72
|
+
isPublishable
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return metadata;
|
|
77
|
+
}
|
|
78
|
+
reRunGetApiDocumentationWhenReady(refresh = false) {
|
|
79
|
+
return new Promise((resolve) => {
|
|
80
|
+
watch(this.apiDocsSet, async (isSet) => {
|
|
81
|
+
if (isSet) {
|
|
82
|
+
const docs = await this.getApiDocumentation(refresh);
|
|
83
|
+
resolve(docs);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
getCurrentApiDocs(refresh) {
|
|
89
|
+
if (!this.apiDocPromise && !refresh && this.store.$state.apiDocumentation) {
|
|
90
|
+
logger.debug("Not refreshing API Documentation. Returning cached data.");
|
|
91
|
+
return this.store.$state.apiDocumentation;
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
async awaitApiDocPromise() {
|
|
96
|
+
logger.debug("Waiting for previous request to complete for API Documentation");
|
|
97
|
+
await this.apiDocPromise;
|
|
98
|
+
return this.store.$state.apiDocumentation;
|
|
99
|
+
}
|
|
100
|
+
async fetchAllApiDocumentation(docsPath) {
|
|
101
|
+
if (this.apiDocPromise) {
|
|
102
|
+
return await this.awaitApiDocPromise();
|
|
103
|
+
}
|
|
104
|
+
this.apiDocPromise = Promise.all([
|
|
105
|
+
this.doRequest("/"),
|
|
106
|
+
this.doRequest(docsPath),
|
|
107
|
+
this.doRequest("/_/page_data_metadatas")
|
|
108
|
+
]).then((responses) => {
|
|
109
|
+
this.store.$patch({
|
|
110
|
+
apiDocumentation: {
|
|
111
|
+
entrypoint: responses[0],
|
|
112
|
+
docs: responses[1],
|
|
113
|
+
pageDataMetadata: responses[2]
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
logger.debug("New API Documentation Saved");
|
|
117
|
+
this.apiDocPromise = void 0;
|
|
118
|
+
});
|
|
119
|
+
await this.apiDocPromise;
|
|
120
|
+
return this.store.$state.apiDocumentation;
|
|
121
|
+
}
|
|
122
|
+
async doRequest(path) {
|
|
123
|
+
return await this.cwaFetch.fetch(path);
|
|
124
|
+
}
|
|
125
|
+
get store() {
|
|
126
|
+
return this._store;
|
|
127
|
+
}
|
|
128
|
+
get docsPath() {
|
|
129
|
+
return this.store.$state.docsPath;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { CookieRef } from 'nuxt/app';
|
|
2
|
+
import { FetchError } from 'ofetch';
|
|
3
|
+
import type { ComputedRef } from 'vue';
|
|
4
|
+
import type { AuthStore } from '../storage/stores/auth/auth-store.js';
|
|
5
|
+
import { CwaUserRoles } from '../storage/stores/auth/state.js';
|
|
6
|
+
import type { CwaUser } from '../storage/stores/auth/state.js';
|
|
7
|
+
import type { ResourcesStore } from '../storage/stores/resources/resources-store.js';
|
|
8
|
+
import type { FetcherStore } from '../storage/stores/fetcher/fetcher-store.js';
|
|
9
|
+
import type CwaFetch from './fetcher/cwa-fetch.js';
|
|
10
|
+
import type Mercure from './mercure.js';
|
|
11
|
+
import type Fetcher from './fetcher/fetcher.js';
|
|
12
|
+
import type Admin from '#cwa/admin/admin';
|
|
13
|
+
import type ApiDocumentation from '#cwa/api/api-documentation';
|
|
14
|
+
interface Credentials {
|
|
15
|
+
username: string;
|
|
16
|
+
password: string;
|
|
17
|
+
}
|
|
18
|
+
export declare enum CwaAuthStatus {
|
|
19
|
+
SIGNED_OUT = 0,
|
|
20
|
+
LOADING = 1,
|
|
21
|
+
SIGNED_IN = 2
|
|
22
|
+
}
|
|
23
|
+
interface BaseTokenUserEvent {
|
|
24
|
+
username: string;
|
|
25
|
+
token: string;
|
|
26
|
+
}
|
|
27
|
+
interface ConfirmNewEmailEvent extends BaseTokenUserEvent {
|
|
28
|
+
newEmail: string;
|
|
29
|
+
}
|
|
30
|
+
interface ResetPasswordEvent extends BaseTokenUserEvent {
|
|
31
|
+
username: string;
|
|
32
|
+
token: string;
|
|
33
|
+
passwords: {
|
|
34
|
+
first: string;
|
|
35
|
+
second: string;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export default class Auth {
|
|
39
|
+
private readonly cwaFetch;
|
|
40
|
+
private readonly mercure;
|
|
41
|
+
private readonly fetcher;
|
|
42
|
+
private readonly admin;
|
|
43
|
+
private readonly apiDocumentation;
|
|
44
|
+
private readonly authCookie;
|
|
45
|
+
private loading;
|
|
46
|
+
private hasCheckedMeEndpointForInit;
|
|
47
|
+
private readonly _authStore;
|
|
48
|
+
private readonly _resourcesStore;
|
|
49
|
+
private readonly _fetcherStore;
|
|
50
|
+
constructor(cwaFetch: CwaFetch, mercure: Mercure, fetcher: Fetcher, admin: Admin, apiDocumentation: ApiDocumentation, authStoreDefinition: AuthStore, resourcesStoreDefinition: ResourcesStore, fetcherStoreDefinition: FetcherStore, authCookie: CookieRef<string | null>);
|
|
51
|
+
signIn(credentials: Credentials): Promise<CwaUser | FetchError<any> | undefined>;
|
|
52
|
+
forgotPassword(username: string): Promise<any>;
|
|
53
|
+
resendVerifyEmail(username: string): Promise<any>;
|
|
54
|
+
resendVerifyNewEmail(username: string): Promise<any>;
|
|
55
|
+
confirmEmail(event: ConfirmNewEmailEvent): Promise<any>;
|
|
56
|
+
verifyEmail(event: BaseTokenUserEvent): Promise<any>;
|
|
57
|
+
resetPassword(event: ResetPasswordEvent): Promise<any>;
|
|
58
|
+
signOut(): Promise<any>;
|
|
59
|
+
refreshUser(): Promise<CwaUser | FetchError<any> | undefined>;
|
|
60
|
+
init(): Promise<void>;
|
|
61
|
+
get user(): {
|
|
62
|
+
[x: string]: any;
|
|
63
|
+
emailAddress: string;
|
|
64
|
+
enabled: boolean;
|
|
65
|
+
roles: (string | CwaUserRoles)[];
|
|
66
|
+
username: string;
|
|
67
|
+
'@id': string;
|
|
68
|
+
'@type': string;
|
|
69
|
+
publishedResource?: string | undefined;
|
|
70
|
+
draftResource?: string | undefined;
|
|
71
|
+
uiComponent?: string | undefined;
|
|
72
|
+
sortValue?: number | undefined;
|
|
73
|
+
componentGroup?: string | undefined;
|
|
74
|
+
_metadata: {
|
|
75
|
+
[x: string]: any;
|
|
76
|
+
adding?: {
|
|
77
|
+
instantAdd: boolean;
|
|
78
|
+
endpoint: string;
|
|
79
|
+
isPublishable: boolean;
|
|
80
|
+
} | undefined;
|
|
81
|
+
persisted: boolean;
|
|
82
|
+
publishable?: {
|
|
83
|
+
published: boolean;
|
|
84
|
+
publishedAt: string;
|
|
85
|
+
} | undefined;
|
|
86
|
+
sortDisplayNumber?: number | undefined;
|
|
87
|
+
};
|
|
88
|
+
} | undefined;
|
|
89
|
+
get roles(): string[] | undefined;
|
|
90
|
+
get signedIn(): ComputedRef<boolean>;
|
|
91
|
+
hasRole(role: CwaUserRoles | string): boolean;
|
|
92
|
+
get isAdmin(): ComputedRef<boolean>;
|
|
93
|
+
private loginRequest;
|
|
94
|
+
get status(): ComputedRef<CwaAuthStatus>;
|
|
95
|
+
private clearSession;
|
|
96
|
+
private get authStore();
|
|
97
|
+
private get resourcesStore();
|
|
98
|
+
private get fetcherStore();
|
|
99
|
+
}
|
|
100
|
+
export {};
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { FetchError } from "ofetch";
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
import { CwaUserRoles } from "../storage/stores/auth/state.js";
|
|
4
|
+
import { useNuxtApp, useRoute, useRouter } from "#imports";
|
|
5
|
+
export var CwaAuthStatus = /* @__PURE__ */ ((CwaAuthStatus2) => {
|
|
6
|
+
CwaAuthStatus2[CwaAuthStatus2["SIGNED_OUT"] = 0] = "SIGNED_OUT";
|
|
7
|
+
CwaAuthStatus2[CwaAuthStatus2["LOADING"] = 1] = "LOADING";
|
|
8
|
+
CwaAuthStatus2[CwaAuthStatus2["SIGNED_IN"] = 2] = "SIGNED_IN";
|
|
9
|
+
return CwaAuthStatus2;
|
|
10
|
+
})(CwaAuthStatus || {});
|
|
11
|
+
export default class Auth {
|
|
12
|
+
constructor(cwaFetch, mercure, fetcher, admin, apiDocumentation, authStoreDefinition, resourcesStoreDefinition, fetcherStoreDefinition, authCookie) {
|
|
13
|
+
this.cwaFetch = cwaFetch;
|
|
14
|
+
this.mercure = mercure;
|
|
15
|
+
this.fetcher = fetcher;
|
|
16
|
+
this.admin = admin;
|
|
17
|
+
this.apiDocumentation = apiDocumentation;
|
|
18
|
+
this.authCookie = authCookie;
|
|
19
|
+
this.loading = ref(false);
|
|
20
|
+
this._authStore = authStoreDefinition.useStore();
|
|
21
|
+
this._resourcesStore = resourcesStoreDefinition.useStore();
|
|
22
|
+
this._fetcherStore = fetcherStoreDefinition.useStore();
|
|
23
|
+
}
|
|
24
|
+
cwaFetch;
|
|
25
|
+
mercure;
|
|
26
|
+
fetcher;
|
|
27
|
+
admin;
|
|
28
|
+
apiDocumentation;
|
|
29
|
+
authCookie;
|
|
30
|
+
loading;
|
|
31
|
+
hasCheckedMeEndpointForInit = false;
|
|
32
|
+
_authStore;
|
|
33
|
+
_resourcesStore;
|
|
34
|
+
_fetcherStore;
|
|
35
|
+
async signIn(credentials) {
|
|
36
|
+
const result = await this.loginRequest(credentials);
|
|
37
|
+
if (result instanceof FetchError) {
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
this.mercure.init(true);
|
|
41
|
+
return this.refreshUser();
|
|
42
|
+
}
|
|
43
|
+
async forgotPassword(username) {
|
|
44
|
+
try {
|
|
45
|
+
return await this.cwaFetch.fetch(`/password/reset/request/${encodeURIComponent(
|
|
46
|
+
username
|
|
47
|
+
)}`, {
|
|
48
|
+
retry: 0
|
|
49
|
+
});
|
|
50
|
+
} catch (error) {
|
|
51
|
+
if (!(error instanceof FetchError)) {
|
|
52
|
+
throw error;
|
|
53
|
+
}
|
|
54
|
+
return error;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async resendVerifyEmail(username) {
|
|
58
|
+
try {
|
|
59
|
+
return await this.cwaFetch.fetch(`/resend-verify-email/${encodeURIComponent(
|
|
60
|
+
username
|
|
61
|
+
)}`, {
|
|
62
|
+
retry: 0
|
|
63
|
+
});
|
|
64
|
+
} catch (error) {
|
|
65
|
+
if (!(error instanceof FetchError)) {
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
return error;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async resendVerifyNewEmail(username) {
|
|
72
|
+
try {
|
|
73
|
+
return await this.cwaFetch.fetch(`/resend-verify-new-email/${encodeURIComponent(
|
|
74
|
+
username
|
|
75
|
+
)}`, {
|
|
76
|
+
retry: 0
|
|
77
|
+
});
|
|
78
|
+
} catch (error) {
|
|
79
|
+
if (!(error instanceof FetchError)) {
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
return error;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async confirmEmail(event) {
|
|
86
|
+
try {
|
|
87
|
+
return await this.cwaFetch.fetch(`/confirm-email/${encodeURIComponent(
|
|
88
|
+
event.username
|
|
89
|
+
)}/${encodeURIComponent(
|
|
90
|
+
event.newEmail
|
|
91
|
+
)}/${encodeURIComponent(
|
|
92
|
+
event.token
|
|
93
|
+
)}`, {
|
|
94
|
+
retry: 0
|
|
95
|
+
});
|
|
96
|
+
} catch (error) {
|
|
97
|
+
if (!(error instanceof FetchError)) {
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
return error;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
async verifyEmail(event) {
|
|
104
|
+
try {
|
|
105
|
+
return await this.cwaFetch.fetch(`/verify-email/${encodeURIComponent(
|
|
106
|
+
event.username
|
|
107
|
+
)}/${encodeURIComponent(
|
|
108
|
+
event.token
|
|
109
|
+
)}`, {
|
|
110
|
+
retry: 0
|
|
111
|
+
});
|
|
112
|
+
} catch (error) {
|
|
113
|
+
if (!(error instanceof FetchError)) {
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
return error;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
async resetPassword(event) {
|
|
120
|
+
try {
|
|
121
|
+
return await this.cwaFetch.fetch("/component/forms/password_reset/submit", {
|
|
122
|
+
method: "POST",
|
|
123
|
+
body: {
|
|
124
|
+
password_update: {
|
|
125
|
+
username: event.username,
|
|
126
|
+
plainNewPasswordConfirmationToken: event.token,
|
|
127
|
+
plainPassword: event.passwords
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
} catch (error) {
|
|
132
|
+
if (!(error instanceof FetchError)) {
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
return error;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
async signOut() {
|
|
139
|
+
this.loading.value = true;
|
|
140
|
+
try {
|
|
141
|
+
const result = await this.cwaFetch.fetch("/logout", {
|
|
142
|
+
method: "POST"
|
|
143
|
+
});
|
|
144
|
+
await this.clearSession();
|
|
145
|
+
return result;
|
|
146
|
+
} catch (error) {
|
|
147
|
+
if (!(error instanceof FetchError)) {
|
|
148
|
+
throw error;
|
|
149
|
+
}
|
|
150
|
+
return error;
|
|
151
|
+
} finally {
|
|
152
|
+
this.loading.value = false;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
async refreshUser() {
|
|
156
|
+
this.loading.value = true;
|
|
157
|
+
try {
|
|
158
|
+
const { headers, _data: user } = await this.cwaFetch.fetch.raw("/me");
|
|
159
|
+
const linkHeader = headers.get("link");
|
|
160
|
+
if (linkHeader) {
|
|
161
|
+
this.mercure.setMercureHubFromLinkHeader(linkHeader);
|
|
162
|
+
this.apiDocumentation.setDocsPathFromLinkHeader(linkHeader);
|
|
163
|
+
}
|
|
164
|
+
this.authCookie.value = "1";
|
|
165
|
+
this.authStore.data.user = user;
|
|
166
|
+
return user;
|
|
167
|
+
} catch (error) {
|
|
168
|
+
if (!(error instanceof FetchError)) {
|
|
169
|
+
throw error;
|
|
170
|
+
}
|
|
171
|
+
await this.clearSession();
|
|
172
|
+
return error;
|
|
173
|
+
} finally {
|
|
174
|
+
this.loading.value = false;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
async init() {
|
|
178
|
+
if (!this.hasCheckedMeEndpointForInit || this.signedIn.value && !this.user) {
|
|
179
|
+
this.hasCheckedMeEndpointForInit = true;
|
|
180
|
+
await this.refreshUser();
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
get user() {
|
|
184
|
+
return this.authStore.data.user;
|
|
185
|
+
}
|
|
186
|
+
get roles() {
|
|
187
|
+
if (!this.user) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
return this.user.roles;
|
|
191
|
+
}
|
|
192
|
+
get signedIn() {
|
|
193
|
+
return computed(() => this.status.value === 2 /* SIGNED_IN */);
|
|
194
|
+
}
|
|
195
|
+
hasRole(role) {
|
|
196
|
+
if (!this.roles) {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
return this.roles.includes(role);
|
|
200
|
+
}
|
|
201
|
+
get isAdmin() {
|
|
202
|
+
return computed(() => this.hasRole(CwaUserRoles.ADMIN));
|
|
203
|
+
}
|
|
204
|
+
async loginRequest(credentials) {
|
|
205
|
+
this.loading.value = true;
|
|
206
|
+
try {
|
|
207
|
+
return await this.cwaFetch.fetch("/login", {
|
|
208
|
+
method: "POST",
|
|
209
|
+
body: credentials
|
|
210
|
+
});
|
|
211
|
+
} catch (error) {
|
|
212
|
+
this.loading.value = false;
|
|
213
|
+
if (!(error instanceof FetchError)) {
|
|
214
|
+
throw error;
|
|
215
|
+
}
|
|
216
|
+
return error;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
get status() {
|
|
220
|
+
return computed(() => {
|
|
221
|
+
if (this.loading.value) {
|
|
222
|
+
return 1 /* LOADING */;
|
|
223
|
+
}
|
|
224
|
+
return `${this.authCookie.value}` === "1" ? 2 /* SIGNED_IN */ : 0 /* SIGNED_OUT */;
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
async clearSession() {
|
|
228
|
+
this.authStore.data.user = void 0;
|
|
229
|
+
this.authCookie.value = "0";
|
|
230
|
+
this.admin.toggleEdit(false);
|
|
231
|
+
const isProcessingMiddleware = () => {
|
|
232
|
+
try {
|
|
233
|
+
if (useNuxtApp()._processingMiddleware) {
|
|
234
|
+
return true;
|
|
235
|
+
}
|
|
236
|
+
} catch {
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
return false;
|
|
240
|
+
};
|
|
241
|
+
if (isProcessingMiddleware()) {
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
this.mercure.init(true);
|
|
245
|
+
this.resourcesStore.clearResources();
|
|
246
|
+
this.fetcherStore.clearFetches();
|
|
247
|
+
const route = useRoute();
|
|
248
|
+
if (route.meta.cwa?.admin) {
|
|
249
|
+
const router = useRouter();
|
|
250
|
+
router.replace("/");
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
await this.fetcher.fetchRoute(route);
|
|
254
|
+
}
|
|
255
|
+
get authStore() {
|
|
256
|
+
return this._authStore;
|
|
257
|
+
}
|
|
258
|
+
get resourcesStore() {
|
|
259
|
+
return this._resourcesStore;
|
|
260
|
+
}
|
|
261
|
+
get fetcherStore() {
|
|
262
|
+
return this._fetcherStore;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { $Fetch } from 'ofetch';
|
|
2
|
+
import type { RequestHeaders } from 'h3';
|
|
3
|
+
interface RequestOptions {
|
|
4
|
+
headers: Partial<RequestHeaders>;
|
|
5
|
+
method: 'POST' | 'PATCH' | 'DELETE';
|
|
6
|
+
}
|
|
7
|
+
export default class CwaFetch {
|
|
8
|
+
readonly fetch: $Fetch;
|
|
9
|
+
constructor(baseURL: string);
|
|
10
|
+
getRequestOptions(method: 'POST' | 'PATCH' | 'DELETE'): RequestOptions;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { $fetch } from "ofetch";
|
|
2
|
+
import { useRequestHeaders } from "#imports";
|
|
3
|
+
export default class CwaFetch {
|
|
4
|
+
fetch;
|
|
5
|
+
constructor(baseURL) {
|
|
6
|
+
this.fetch = $fetch.create({
|
|
7
|
+
baseURL,
|
|
8
|
+
retryDelay: 200,
|
|
9
|
+
headers: {
|
|
10
|
+
accept: "application/ld+json,application/json"
|
|
11
|
+
},
|
|
12
|
+
credentials: "include",
|
|
13
|
+
onRequest(ctx) {
|
|
14
|
+
const baseUrlObj = new URL(baseURL);
|
|
15
|
+
const prefix = baseUrlObj.pathname;
|
|
16
|
+
const checkRequestForPrefix = (reqPath) => {
|
|
17
|
+
if (reqPath.startsWith(prefix)) {
|
|
18
|
+
ctx.options.baseURL = baseUrlObj.origin;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
if (typeof ctx.request === "string") {
|
|
22
|
+
checkRequestForPrefix(ctx.request);
|
|
23
|
+
} else {
|
|
24
|
+
checkRequestForPrefix(ctx.request.url);
|
|
25
|
+
}
|
|
26
|
+
if (import.meta.server) {
|
|
27
|
+
const { cookie } = useRequestHeaders(["cookie"]);
|
|
28
|
+
cookie && ctx.options.headers.append("cookie", cookie);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
getRequestOptions(method) {
|
|
34
|
+
const headers = {
|
|
35
|
+
accept: "application/ld+json,application/json"
|
|
36
|
+
};
|
|
37
|
+
headers["content-type"] = method === "PATCH" ? "application/merge-patch+json" : "application/ld+json";
|
|
38
|
+
return {
|
|
39
|
+
method,
|
|
40
|
+
headers
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type Mercure from '../mercure.js';
|
|
2
|
+
import type ApiDocumentation from '../api-documentation.js';
|
|
3
|
+
import type { FetcherStore } from '../../storage/stores/fetcher/fetcher-store.js';
|
|
4
|
+
import type { AddFetchResourceEvent, FinishFetchEvent, ManifestErrorFetchEvent, ManifestSuccessFetchEvent, SetManifestIrisByDepthEvent, StartFetchEvent, StartFetchResponse } from '../../storage/stores/fetcher/actions.js';
|
|
5
|
+
import type { ResourcesStore } from '../../storage/stores/resources/resources-store.js';
|
|
6
|
+
import type { CwaResourceError } from '../../errors/cwa-resource-error.js';
|
|
7
|
+
import type { CwaResource } from '../../resources/resource-utils.js';
|
|
8
|
+
import type { CwaFetchRequestHeaders, CwaFetchResponse } from './fetcher.js';
|
|
9
|
+
export interface FinishFetchResourceEvent {
|
|
10
|
+
resource: string;
|
|
11
|
+
userProvidedIri?: string;
|
|
12
|
+
success: boolean;
|
|
13
|
+
token: string;
|
|
14
|
+
path: string;
|
|
15
|
+
}
|
|
16
|
+
export interface FinishFetchResourceSuccessEvent extends FinishFetchResourceEvent {
|
|
17
|
+
success: true;
|
|
18
|
+
fetchResponse: CwaFetchResponse | any;
|
|
19
|
+
headers: CwaFetchRequestHeaders;
|
|
20
|
+
noSave?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface FinishFetchResourceErrorEvent extends FinishFetchResourceEvent {
|
|
23
|
+
success: false;
|
|
24
|
+
error?: CwaResourceError;
|
|
25
|
+
}
|
|
26
|
+
type _StartFetchEvent = Omit<StartFetchEvent, 'isCurrentSuccessResourcesResolved'>;
|
|
27
|
+
/**
|
|
28
|
+
* This class manages the state across the fetcher store, resources store and additional services for API Documentation and Mercure
|
|
29
|
+
*/
|
|
30
|
+
export default class FetchStatusManager {
|
|
31
|
+
private readonly mercure;
|
|
32
|
+
private readonly apiDocumentation;
|
|
33
|
+
private readonly _fetcherStore;
|
|
34
|
+
private readonly _resourcesStore;
|
|
35
|
+
private _iriToDepth;
|
|
36
|
+
private _depthPaths;
|
|
37
|
+
constructor(fetcherStoreDefinition: FetcherStore, mercure: Mercure, apiDocumentation: ApiDocumentation, resourcesStoreDefinition: ResourcesStore);
|
|
38
|
+
getFetchedCurrentResource(iri: string, timeout?: number): Promise<CwaResource | undefined>;
|
|
39
|
+
startFetch(event: _StartFetchEvent): StartFetchResponse;
|
|
40
|
+
startFetchResource(event: AddFetchResourceEvent): boolean;
|
|
41
|
+
finishFetchResource(event: FinishFetchResourceSuccessEvent | FinishFetchResourceErrorEvent): CwaResource | undefined;
|
|
42
|
+
finishFetch(event: FinishFetchEvent): Promise<void>;
|
|
43
|
+
private finishFetchShowError;
|
|
44
|
+
private computedFetchChainComplete;
|
|
45
|
+
private waitForFetchChainToComplete;
|
|
46
|
+
setManifestIrisByDepth(event: SetManifestIrisByDepthEvent): void;
|
|
47
|
+
getDepthForIri(iri: string): number | undefined;
|
|
48
|
+
getPathForDepth(depth: number): string | undefined;
|
|
49
|
+
registerIriDepth(iri: string, depth: number): void;
|
|
50
|
+
finishManifestFetch(event: ManifestSuccessFetchEvent | ManifestErrorFetchEvent): void;
|
|
51
|
+
isCurrentFetchingToken(token: string): boolean | undefined;
|
|
52
|
+
abortFetch(token: string): void;
|
|
53
|
+
clearPrimaryFetch(): void;
|
|
54
|
+
get primaryFetchPath(): string | undefined;
|
|
55
|
+
get isCurrentSuccessResourcesResolved(): boolean;
|
|
56
|
+
private get fetcherStore();
|
|
57
|
+
private get resourcesStore();
|
|
58
|
+
}
|
|
59
|
+
export {};
|