@cwa/nuxt-edge 1.0.0-29138192.e49c1a0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/README.template.md +32 -0
- package/dist/layer/error.vue +13 -0
- package/dist/layer/layouts/CwaRootLayout.vue +140 -0
- package/dist/layer/nuxt.config.spec.ts +10 -0
- package/dist/layer/nuxt.config.ts +3 -0
- package/dist/layer/pages/_cwa/composables/useDataList.ts +50 -0
- package/dist/layer/pages/_cwa/composables/useDataType.ts +30 -0
- package/dist/layer/pages/_cwa/composables/useDynamicPageLoader.ts +28 -0
- package/dist/layer/pages/_cwa/composables/useItemPage.ts +172 -0
- package/dist/layer/pages/_cwa/composables/useListPage.ts +43 -0
- package/dist/layer/pages/_cwa/data/[type]/[iri].vue +17 -0
- package/dist/layer/pages/_cwa/data/[type].vue +131 -0
- package/dist/layer/pages/_cwa/data/index.vue +84 -0
- package/dist/layer/pages/_cwa/layouts/[iri].vue +174 -0
- package/dist/layer/pages/_cwa/layouts.vue +77 -0
- package/dist/layer/pages/_cwa/pages/[iri].vue +11 -0
- package/dist/layer/pages/_cwa/pages.vue +129 -0
- package/dist/layer/pages/_cwa/routes.vue +72 -0
- package/dist/layer/pages/_cwa/users/[iri].vue +248 -0
- package/dist/layer/pages/_cwa/users.vue +86 -0
- package/dist/layer/pages/_cwa.vue +43 -0
- package/dist/layer/pages/forgot-password.vue +32 -0
- package/dist/layer/pages/login.vue +33 -0
- package/dist/layer/pages/reset-password/[username]/[token].vue +39 -0
- package/dist/module.d.mts +53 -0
- package/dist/module.json +13 -0
- package/dist/module.mjs +235 -0
- package/dist/runtime/admin/admin.d.ts +36 -0
- package/dist/runtime/admin/admin.js +65 -0
- package/dist/runtime/admin/manageable-resource.d.ts +41 -0
- package/dist/runtime/admin/manageable-resource.js +206 -0
- package/dist/runtime/admin/manager-tabs-resolver.d.ts +17 -0
- package/dist/runtime/admin/manager-tabs-resolver.js +51 -0
- package/dist/runtime/admin/navigation-guard.d.ts +18 -0
- package/dist/runtime/admin/navigation-guard.js +55 -0
- package/dist/runtime/admin/resource-stack-manager.d.ts +92 -0
- package/dist/runtime/admin/resource-stack-manager.js +355 -0
- package/dist/runtime/api/api-documentation.d.ts +28 -0
- package/dist/runtime/api/api-documentation.js +131 -0
- package/dist/runtime/api/auth.d.ts +85 -0
- package/dist/runtime/api/auth.js +183 -0
- package/dist/runtime/api/fetcher/cwa-fetch.d.ts +5 -0
- package/dist/runtime/api/fetcher/cwa-fetch.js +20 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.d.ts +51 -0
- package/dist/runtime/api/fetcher/fetch-status-manager.js +185 -0
- package/dist/runtime/api/fetcher/fetcher.d.ts +57 -0
- package/dist/runtime/api/fetcher/fetcher.js +222 -0
- package/dist/runtime/api/fetcher/preload-headers.d.ts +6 -0
- package/dist/runtime/api/fetcher/preload-headers.js +31 -0
- package/dist/runtime/api/forms.d.ts +40 -0
- package/dist/runtime/api/forms.js +40 -0
- package/dist/runtime/api/mercure.d.ts +33 -0
- package/dist/runtime/api/mercure.js +191 -0
- package/dist/runtime/composables/component/html-content.d.ts +2 -0
- package/dist/runtime/composables/component/html-content.js +82 -0
- package/dist/runtime/composables/cwa-collection-pagination.d.ts +13 -0
- package/dist/runtime/composables/cwa-collection-pagination.js +34 -0
- package/dist/runtime/composables/cwa-collection-resource.d.ts +16 -0
- package/dist/runtime/composables/cwa-collection-resource.js +92 -0
- package/dist/runtime/composables/cwa-image.d.ts +19 -0
- package/dist/runtime/composables/cwa-image.js +43 -0
- package/dist/runtime/composables/cwa-query-bound-model.d.ts +9 -0
- package/dist/runtime/composables/cwa-query-bound-model.js +108 -0
- package/dist/runtime/composables/cwa-resource-endpoint.d.ts +5 -0
- package/dist/runtime/composables/cwa-resource-endpoint.js +36 -0
- package/dist/runtime/composables/cwa-resource-manageable.d.ts +10 -0
- package/dist/runtime/composables/cwa-resource-manageable.js +32 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.d.ts +17 -0
- package/dist/runtime/composables/cwa-resource-manager-tab.js +30 -0
- package/dist/runtime/composables/cwa-resource-model.d.ts +21 -0
- package/dist/runtime/composables/cwa-resource-model.js +149 -0
- package/dist/runtime/composables/cwa-resource-upload.d.ts +8 -0
- package/dist/runtime/composables/cwa-resource-upload.js +70 -0
- package/dist/runtime/composables/cwa-resource.d.ts +24 -0
- package/dist/runtime/composables/cwa-resource.js +22 -0
- package/dist/runtime/composables/cwa-select-input.d.ts +21 -0
- package/dist/runtime/composables/cwa-select-input.js +37 -0
- package/dist/runtime/composables/cwa-select.d.ts +15 -0
- package/dist/runtime/composables/cwa-select.js +24 -0
- package/dist/runtime/composables/cwa.d.ts +2 -0
- package/dist/runtime/composables/cwa.js +2 -0
- package/dist/runtime/composables/forgot-password.d.ts +9 -0
- package/dist/runtime/composables/forgot-password.js +45 -0
- package/dist/runtime/composables/login.d.ts +9 -0
- package/dist/runtime/composables/login.js +30 -0
- package/dist/runtime/composables/popper.d.ts +529 -0
- package/dist/runtime/composables/popper.js +104 -0
- package/dist/runtime/composables/process.d.ts +4 -0
- package/dist/runtime/composables/process.js +6 -0
- package/dist/runtime/composables/reset-password.d.ts +14 -0
- package/dist/runtime/composables/reset-password.js +75 -0
- package/dist/runtime/composables/transitions.d.ts +12 -0
- package/dist/runtime/composables/transitions.js +12 -0
- package/dist/runtime/cwa.d.ts +61 -0
- package/dist/runtime/cwa.js +123 -0
- package/dist/runtime/errors/cwa-resource-error.d.ts +18 -0
- package/dist/runtime/errors/cwa-resource-error.js +54 -0
- package/dist/runtime/plugin.d.ts +7 -0
- package/dist/runtime/plugin.js +18 -0
- package/dist/runtime/resources/resource-utils.d.ts +44 -0
- package/dist/runtime/resources/resource-utils.js +73 -0
- package/dist/runtime/resources/resources-manager.d.ts +70 -0
- package/dist/runtime/resources/resources-manager.js +463 -0
- package/dist/runtime/resources/resources.d.ts +53 -0
- package/dist/runtime/resources/resources.js +300 -0
- package/dist/runtime/route-middleware.d.ts +2 -0
- package/dist/runtime/route-middleware.js +86 -0
- package/dist/runtime/storage/storage.d.ts +20 -0
- package/dist/runtime/storage/storage.js +25 -0
- package/dist/runtime/storage/stores/admin/actions.d.ts +5 -0
- package/dist/runtime/storage/stores/admin/actions.js +10 -0
- package/dist/runtime/storage/stores/admin/admin-store.d.ts +18 -0
- package/dist/runtime/storage/stores/admin/admin-store.js +20 -0
- package/dist/runtime/storage/stores/admin/state.d.ts +7 -0
- package/dist/runtime/storage/stores/admin/state.js +9 -0
- package/dist/runtime/storage/stores/api-documentation/api-documentation-store.d.ts +16 -0
- package/dist/runtime/storage/stores/api-documentation/api-documentation-store.js +18 -0
- package/dist/runtime/storage/stores/api-documentation/state.d.ts +74 -0
- package/dist/runtime/storage/stores/api-documentation/state.js +6 -0
- package/dist/runtime/storage/stores/auth/auth-store.d.ts +16 -0
- package/dist/runtime/storage/stores/auth/auth-store.js +18 -0
- package/dist/runtime/storage/stores/auth/state.d.ts +20 -0
- package/dist/runtime/storage/stores/auth/state.js +15 -0
- package/dist/runtime/storage/stores/cwa-store-types.d.ts +14 -0
- package/dist/runtime/storage/stores/error/actions.d.ts +11 -0
- package/dist/runtime/storage/stores/error/actions.js +69 -0
- package/dist/runtime/storage/stores/error/error-store.d.ts +13 -0
- package/dist/runtime/storage/stores/error/error-store.js +21 -0
- package/dist/runtime/storage/stores/error/getters.d.ts +7 -0
- package/dist/runtime/storage/stores/error/getters.js +11 -0
- package/dist/runtime/storage/stores/error/state.d.ts +35 -0
- package/dist/runtime/storage/stores/error/state.js +15 -0
- package/dist/runtime/storage/stores/fetcher/actions.d.ts +49 -0
- package/dist/runtime/storage/stores/fetcher/actions.js +125 -0
- package/dist/runtime/storage/stores/fetcher/fetcher-store.d.ts +19 -0
- package/dist/runtime/storage/stores/fetcher/fetcher-store.js +23 -0
- package/dist/runtime/storage/stores/fetcher/getter-utils.d.ts +7 -0
- package/dist/runtime/storage/stores/fetcher/getter-utils.js +27 -0
- package/dist/runtime/storage/stores/fetcher/getters.d.ts +13 -0
- package/dist/runtime/storage/stores/fetcher/getters.js +52 -0
- package/dist/runtime/storage/stores/fetcher/state.d.ts +25 -0
- package/dist/runtime/storage/stores/fetcher/state.js +7 -0
- package/dist/runtime/storage/stores/mercure/mercure-store.d.ts +16 -0
- package/dist/runtime/storage/stores/mercure/mercure-store.js +18 -0
- package/dist/runtime/storage/stores/mercure/state.d.ts +5 -0
- package/dist/runtime/storage/stores/mercure/state.js +6 -0
- package/dist/runtime/storage/stores/resources/actions.d.ts +54 -0
- package/dist/runtime/storage/stores/resources/actions.js +390 -0
- package/dist/runtime/storage/stores/resources/getter-utils.d.ts +7 -0
- package/dist/runtime/storage/stores/resources/getter-utils.js +27 -0
- package/dist/runtime/storage/stores/resources/getters.d.ts +38 -0
- package/dist/runtime/storage/stores/resources/getters.js +251 -0
- package/dist/runtime/storage/stores/resources/resources-store.d.ts +19 -0
- package/dist/runtime/storage/stores/resources/resources-store.js +23 -0
- package/dist/runtime/storage/stores/resources/state.d.ts +64 -0
- package/dist/runtime/storage/stores/resources/state.js +24 -0
- package/dist/runtime/templates/assets/base.css +1 -0
- package/dist/runtime/templates/assets/cwa.css +1 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue +18 -0
- package/dist/runtime/templates/components/core/ComponentPlaceholder.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/ComponentPosition.spec.ts.snap +16 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue +63 -0
- package/dist/runtime/templates/components/core/ComponentPosition.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue +41 -0
- package/dist/runtime/templates/components/core/ConfirmDialog.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/DialogBox.vue +95 -0
- package/dist/runtime/templates/components/core/DialogBox.vue.d.ts +38 -0
- package/dist/runtime/templates/components/core/README.md +1 -0
- package/dist/runtime/templates/components/core/ResourceLoader.spec.ts.snap +39 -0
- package/dist/runtime/templates/components/core/ResourceLoader.vue +151 -0
- package/dist/runtime/templates/components/core/ResourceLoader.vue.d.ts +13 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue +7 -0
- package/dist/runtime/templates/components/core/admin/ListContainer.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue +136 -0
- package/dist/runtime/templates/components/core/admin/ListContent.vue.d.ts +21 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue +49 -0
- package/dist/runtime/templates/components/core/admin/ListFilter.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue +53 -0
- package/dist/runtime/templates/components/core/admin/ListFilterButton.vue.d.ts +9 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue +32 -0
- package/dist/runtime/templates/components/core/admin/ListHeading.vue.d.ts +20 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue +87 -0
- package/dist/runtime/templates/components/core/admin/ListPagination.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue +18 -0
- package/dist/runtime/templates/components/core/admin/ListPaginationButton.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue +260 -0
- package/dist/runtime/templates/components/core/admin/PageAdminModal.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue +187 -0
- package/dist/runtime/templates/components/core/admin/PageDataAdminModal.vue.d.ts +13 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue +99 -0
- package/dist/runtime/templates/components/core/admin/ResourceModal.vue.d.ts +27 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue +27 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlay.vue.d.ts +6 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue +23 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalOverlayTemplate.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue +77 -0
- package/dist/runtime/templates/components/core/admin/ResourceModalTabs.vue.d.ts +19 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue +102 -0
- package/dist/runtime/templates/components/core/admin/RouteListRow.vue.d.ts +20 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue +52 -0
- package/dist/runtime/templates/components/core/admin/RouteRedirectsTree.vue.d.ts +10 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue +273 -0
- package/dist/runtime/templates/components/core/admin/RoutesTab.vue.d.ts +12 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue +18 -0
- package/dist/runtime/templates/components/core/admin/form/FilterFormWrapper.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue +86 -0
- package/dist/runtime/templates/components/core/admin/form/FilterSelect.vue.d.ts +3 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue +23 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInfo.vue.d.ts +16 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue +30 -0
- package/dist/runtime/templates/components/core/admin/form/ModalInput.vue.d.ts +15 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue +99 -0
- package/dist/runtime/templates/components/core/admin/form/ModalSelect.vue.d.ts +6 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue +112 -0
- package/dist/runtime/templates/components/core/admin/form/PageTypeSelect.vue.d.ts +4 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue +21 -0
- package/dist/runtime/templates/components/core/assets/CwaLogo.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue +15 -0
- package/dist/runtime/templates/components/core/assets/IconComponents.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue +24 -0
- package/dist/runtime/templates/components/core/assets/IconData.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue +20 -0
- package/dist/runtime/templates/components/core/assets/IconLayouts.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue +21 -0
- package/dist/runtime/templates/components/core/assets/IconPages.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue +23 -0
- package/dist/runtime/templates/components/core/assets/IconRoutes.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue +13 -0
- package/dist/runtime/templates/components/core/assets/IconUsers.vue.d.ts +2 -0
- package/dist/runtime/templates/components/core/useDataResolver.d.ts +12 -0
- package/dist/runtime/templates/components/core/useDataResolver.js +109 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.d.ts +6 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Positions.js +164 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.d.ts +20 -0
- package/dist/runtime/templates/components/main/ComponentGroup.Util.Synchronizer.js +69 -0
- package/dist/runtime/templates/components/main/ComponentGroup.spec.ts.snap +59 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue +107 -0
- package/dist/runtime/templates/components/main/ComponentGroup.vue.d.ts +9 -0
- package/dist/runtime/templates/components/main/CwaLink.vue +51 -0
- package/dist/runtime/templates/components/main/CwaLink.vue.d.ts +14 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue +8 -0
- package/dist/runtime/templates/components/main/DefaultLayout.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue +98 -0
- package/dist/runtime/templates/components/main/ErrorPage.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/Logo.vue +18 -0
- package/dist/runtime/templates/components/main/Logo.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/README.md +7 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue +41 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceContextItem.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue +48 -0
- package/dist/runtime/templates/components/main/admin/_common/ResourceLoadingIndicator.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.d.ts +5 -0
- package/dist/runtime/templates/components/main/admin/_common/useDynamicPositionSelectOptions.js +19 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue +207 -0
- package/dist/runtime/templates/components/main/admin/header/Header.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue +189 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Menu.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue +14 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuLink.vue.d.ts +16 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue +19 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/MenuPrimaryLink.vue.d.ts +15 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue +69 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/Notification.vue.d.ts +12 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue +19 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/OutdatedContentNotice.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue +79 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/PathSelector.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue +52 -0
- package/dist/runtime/templates/components/main/admin/header/_parts/RequestErrors.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue +151 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ComponentFocus.vue.d.ts +10 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue +192 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/LayoutPageOverlay.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue +186 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/ResourceManager.vue.d.ts +9 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue +205 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/AddComponentDialog.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue +38 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/CwaResourceManagerContextMenu.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue +15 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTab.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue +44 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_parts/ManagerTabs.vue.d.ts +13 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue +59 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/ResourceInfoTab.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue +75 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Order.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue +41 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Publish.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue +101 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/component/Ui.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue +34 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/group/Group.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue +121 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DataPage.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue +52 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/_tabs/position/DynamicPage.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue +99 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/CurrentResourceCta.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue +59 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/NewResourceCta.vue.d.ts +7 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue +28 -0
- package/dist/runtime/templates/components/main/admin/resource-manager/cta/ResourceManagerCtaButton.vue.d.ts +2 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue +55 -0
- package/dist/runtime/templates/components/main/auth/ForgotPasswordPage.vue.d.ts +20 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue +60 -0
- package/dist/runtime/templates/components/main/auth/LoginPage.vue.d.ts +23 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue +59 -0
- package/dist/runtime/templates/components/main/auth/ResetPasswordPage.vue.d.ts +27 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.spec.ts.snap +14 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue +17 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthPageLink.vue.d.ts +6 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.spec.ts.snap +90 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue +45 -0
- package/dist/runtime/templates/components/main/auth/_parts/AuthTemplate.vue.d.ts +17 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.spec.ts.snap +111 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.vue +50 -0
- package/dist/runtime/templates/components/main/auth/_parts/InputField.vue.d.ts +17 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue +960 -0
- package/dist/runtime/templates/components/ui/BackgroundParticles.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue +75 -0
- package/dist/runtime/templates/components/ui/Hamburger.vue.d.ts +9 -0
- package/dist/runtime/templates/components/ui/ProgressBar.spec.ts.snap +71 -0
- package/dist/runtime/templates/components/ui/ProgressBar.vue +29 -0
- package/dist/runtime/templates/components/ui/ProgressBar.vue.d.ts +9 -0
- package/dist/runtime/templates/components/ui/README.md +6 -0
- package/dist/runtime/templates/components/ui/alert/Info.spec.ts.snap +23 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue +13 -0
- package/dist/runtime/templates/components/ui/alert/Info.vue.d.ts +12 -0
- package/dist/runtime/templates/components/ui/alert/Warning.spec.ts.snap +14 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue +8 -0
- package/dist/runtime/templates/components/ui/alert/Warning.vue.d.ts +12 -0
- package/dist/runtime/templates/components/ui/form/Button.vue +139 -0
- package/dist/runtime/templates/components/ui/form/Button.vue.d.ts +52 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue +18 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverGroup.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue +15 -0
- package/dist/runtime/templates/components/ui/form/ButtonPopoverItem.vue.d.ts +10 -0
- package/dist/runtime/templates/components/ui/form/File.vue +72 -0
- package/dist/runtime/templates/components/ui/form/File.vue.d.ts +9 -0
- package/dist/runtime/templates/components/ui/form/Input.vue +22 -0
- package/dist/runtime/templates/components/ui/form/Input.vue.d.ts +5 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue +16 -0
- package/dist/runtime/templates/components/ui/form/LabelWrapper.vue.d.ts +15 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.vue +212 -0
- package/dist/runtime/templates/components/ui/form/SearchResource.vue.d.ts +14 -0
- package/dist/runtime/templates/components/ui/form/Select.vue +60 -0
- package/dist/runtime/templates/components/ui/form/Select.vue.d.ts +3 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue +39 -0
- package/dist/runtime/templates/components/ui/form/Toggle.vue.d.ts +6 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue +30 -0
- package/dist/runtime/templates/components/ui/icon/ArrowIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/BinIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/CogIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue +24 -0
- package/dist/runtime/templates/components/ui/icon/EyeIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue +12 -0
- package/dist/runtime/templates/components/ui/icon/PenIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue +9 -0
- package/dist/runtime/templates/components/ui/icon/PlusIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue +10 -0
- package/dist/runtime/templates/components/ui/icon/SearchIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue +23 -0
- package/dist/runtime/templates/components/ui/icon/TickIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue +11 -0
- package/dist/runtime/templates/components/ui/icon/WarningIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue +15 -0
- package/dist/runtime/templates/components/ui/icon/XMarkIcon.vue.d.ts +2 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue +59 -0
- package/dist/runtime/templates/components/utils/ContextMenu.vue.d.ts +21 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue +24 -0
- package/dist/runtime/templates/components/utils/HotSpot.vue.d.ts +9 -0
- package/dist/runtime/templates/components/utils/README.md +1 -0
- package/dist/runtime/templates/components/utils/Spinner.spec.ts.snap +56 -0
- package/dist/runtime/templates/components/utils/Spinner.vue +42 -0
- package/dist/runtime/templates/components/utils/Spinner.vue.d.ts +5 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue +43 -0
- package/dist/runtime/templates/components/utils/SpinnerTick.vue.d.ts +6 -0
- package/dist/runtime/templates/cwa-page.spec.ts.snap +20 -0
- package/dist/runtime/templates/cwa-page.vue +32 -0
- package/dist/runtime/templates/cwa-page.vue.d.ts +2 -0
- package/dist/runtime/types/popper.d.ts +14 -0
- package/dist/types.d.mts +9 -0
- package/package.json +108 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { computed, reactive, ref } from "vue";
|
|
2
|
+
import { FetchError } from "ofetch";
|
|
3
|
+
import { navigateTo, useRoute } from "#app";
|
|
4
|
+
import { useCwa } from "#cwa/runtime/composables/cwa";
|
|
5
|
+
export const useResetPassword = () => {
|
|
6
|
+
const route = useRoute();
|
|
7
|
+
const $cwa = useCwa();
|
|
8
|
+
const error = ref(null);
|
|
9
|
+
const submitting = ref(false);
|
|
10
|
+
const success = ref(false);
|
|
11
|
+
const submittedFormIri = ref(null);
|
|
12
|
+
const passwords = reactive({
|
|
13
|
+
first: "",
|
|
14
|
+
second: ""
|
|
15
|
+
});
|
|
16
|
+
const inputErrors = computed(() => {
|
|
17
|
+
const formIri = submittedFormIri.value;
|
|
18
|
+
if (!formIri) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
form: $cwa.forms.getFormViewErrors(formIri, "password_update").value,
|
|
23
|
+
password: $cwa.forms.getFormViewErrors(formIri, "password_update[plainPassword][first]").value
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
submittedFormIri.value && $cwa.forms.getFormViewErrors(submittedFormIri.value, "password_update[plainPassword][first]");
|
|
27
|
+
function getStringFromParam(paramName) {
|
|
28
|
+
const paramValue = route.params[paramName];
|
|
29
|
+
return Array.isArray(paramValue) ? paramValue[0] : paramValue;
|
|
30
|
+
}
|
|
31
|
+
function handleResetError(fetchError) {
|
|
32
|
+
if (fetchError.status === 404) {
|
|
33
|
+
return "The reset link is invalid or has expired. Please restart the reset password process.";
|
|
34
|
+
}
|
|
35
|
+
if (fetchError.status === 422) {
|
|
36
|
+
$cwa.resourcesManager.saveResource({
|
|
37
|
+
resource: fetchError.data
|
|
38
|
+
});
|
|
39
|
+
submittedFormIri.value = fetchError.data["@id"];
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
return fetchError.data?.message || fetchError.statusMessage || "Unexpected error";
|
|
43
|
+
}
|
|
44
|
+
async function resetPassword() {
|
|
45
|
+
if (success.value) {
|
|
46
|
+
navigateTo("/login");
|
|
47
|
+
}
|
|
48
|
+
const previousFormIri = submittedFormIri.value;
|
|
49
|
+
if (previousFormIri) {
|
|
50
|
+
$cwa.resourcesManager.removeResource({ resource: previousFormIri });
|
|
51
|
+
submittedFormIri.value = null;
|
|
52
|
+
}
|
|
53
|
+
submitting.value = true;
|
|
54
|
+
error.value = null;
|
|
55
|
+
const response = await $cwa.auth.resetPassword({
|
|
56
|
+
username: getStringFromParam("username"),
|
|
57
|
+
token: getStringFromParam("token"),
|
|
58
|
+
passwords
|
|
59
|
+
});
|
|
60
|
+
if (response instanceof FetchError) {
|
|
61
|
+
error.value = handleResetError(response);
|
|
62
|
+
} else {
|
|
63
|
+
success.value = true;
|
|
64
|
+
}
|
|
65
|
+
submitting.value = false;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
error,
|
|
69
|
+
submitting,
|
|
70
|
+
success,
|
|
71
|
+
passwords,
|
|
72
|
+
inputErrors,
|
|
73
|
+
resetPassword
|
|
74
|
+
};
|
|
75
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface Transitions {
|
|
2
|
+
[key: string]: {
|
|
3
|
+
enterActiveClass: string;
|
|
4
|
+
enterFromClass: string;
|
|
5
|
+
enterToClass: string;
|
|
6
|
+
leaveActiveClass: string;
|
|
7
|
+
leaveFromClass: string;
|
|
8
|
+
leaveToClass: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
export declare function useTransitions(): Transitions;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function useTransitions() {
|
|
2
|
+
return {
|
|
3
|
+
context: {
|
|
4
|
+
enterActiveClass: "cwa:transform-gpu cwa:transition-opacity-transform cwa:ease-out cwa:duration-200",
|
|
5
|
+
enterFromClass: "cwa:opacity-0 cwa:translate-y-0 cwa:scale-110",
|
|
6
|
+
enterToClass: "cwa:opacity-100 cwa:translate-y-0 cwa:scale-100",
|
|
7
|
+
leaveActiveClass: "cwa:duration-0",
|
|
8
|
+
leaveFromClass: "cwa:opacity-100 cwa:translate-y-0",
|
|
9
|
+
leaveToClass: "cwa:opacity-0 cwa:translate-y-0"
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { RouteLocationNormalizedLoaded } from 'vue-router';
|
|
2
|
+
import type { CwaModuleOptions, CwaResourcesMeta } from '../module.js';
|
|
3
|
+
import type { FetchEvent, FetchResourceEvent } from './api/fetcher/fetcher.js';
|
|
4
|
+
import { type ApiDocumentationComponentMetadataCollection } from './api/api-documentation.js';
|
|
5
|
+
import type { CwaApiDocumentationDataInterface } from './storage/stores/api-documentation/state.js';
|
|
6
|
+
import { ResourcesManager } from './resources/resources-manager.js';
|
|
7
|
+
import { Resources } from './resources/resources.js';
|
|
8
|
+
import Auth from './api/auth.js';
|
|
9
|
+
import Forms from './api/forms.js';
|
|
10
|
+
import Admin from './admin/admin.js';
|
|
11
|
+
import { type NuxtApp } from '#app/nuxt';
|
|
12
|
+
export default class Cwa {
|
|
13
|
+
private readonly apiUrl;
|
|
14
|
+
private readonly options;
|
|
15
|
+
private readonly storage;
|
|
16
|
+
private readonly apiDocumentation;
|
|
17
|
+
private readonly mercure;
|
|
18
|
+
private readonly fetcher;
|
|
19
|
+
private readonly fetchStatusManager;
|
|
20
|
+
private readonly cwaFetch;
|
|
21
|
+
readonly resources: Resources;
|
|
22
|
+
readonly resourcesManager: ResourcesManager;
|
|
23
|
+
readonly auth: Auth;
|
|
24
|
+
readonly forms: Forms;
|
|
25
|
+
readonly admin: Admin;
|
|
26
|
+
private readonly adminNavGuard;
|
|
27
|
+
readonly currentModulePackageInfo: {
|
|
28
|
+
version: string;
|
|
29
|
+
name: string;
|
|
30
|
+
};
|
|
31
|
+
constructor(nuxtApp: Pick<NuxtApp, '_route' | '_middleware' | '$router' | 'cwaResources'>, options: CwaModuleOptions, currentModulePackageInfo: {
|
|
32
|
+
version: string;
|
|
33
|
+
name: string;
|
|
34
|
+
});
|
|
35
|
+
get adminNavigationGuardFn(): (toRoute: import("vue-router").RouteLocationNormalized) => boolean | {
|
|
36
|
+
path: string;
|
|
37
|
+
query: import("vue-router").LocationQuery;
|
|
38
|
+
hash: string;
|
|
39
|
+
};
|
|
40
|
+
get navigationDisabled(): boolean;
|
|
41
|
+
getApiDocumentation(refresh?: boolean): Promise<CwaApiDocumentationDataInterface | undefined>;
|
|
42
|
+
getComponentMetadata(refresh?: boolean, includePosition?: boolean): Promise<undefined | ApiDocumentationComponentMetadataCollection>;
|
|
43
|
+
fetchResource(event: FetchResourceEvent): Promise<import("./resources/resource-utils.js").CwaResource | undefined>;
|
|
44
|
+
fetchRoute(route: RouteLocationNormalizedLoaded): Promise<import("./resources/resource-utils.js").CwaResource | undefined>;
|
|
45
|
+
fetch(event: FetchEvent): import("./api/fetcher/fetcher.js").CwaFetchResponseRaw;
|
|
46
|
+
clearPrimaryFetch(): void;
|
|
47
|
+
initClientSide(): Promise<void>;
|
|
48
|
+
get resourcesConfig(): CwaResourcesMeta;
|
|
49
|
+
setResourceMeta(meta: CwaResourcesMeta): void;
|
|
50
|
+
get layoutsConfig(): {
|
|
51
|
+
[type: string]: import("../module.js").CwaUiMeta;
|
|
52
|
+
} | undefined;
|
|
53
|
+
get pagesConfig(): {
|
|
54
|
+
[type: string]: import("../module.js").CwaUiMeta;
|
|
55
|
+
} | undefined;
|
|
56
|
+
get pageDataConfig(): {
|
|
57
|
+
[resourceClass: string]: Pick<import("../module.js").CwaUiMeta, "name">;
|
|
58
|
+
} | undefined;
|
|
59
|
+
get appName(): string;
|
|
60
|
+
get apiUrlBase(): string;
|
|
61
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { Storage } from "./storage/storage.js";
|
|
2
|
+
import Fetcher from "./api/fetcher/fetcher.js";
|
|
3
|
+
import Mercure from "./api/mercure.js";
|
|
4
|
+
import ApiDocumentation from "./api/api-documentation.js";
|
|
5
|
+
import CwaFetch from "./api/fetcher/cwa-fetch.js";
|
|
6
|
+
import FetchStatusManager from "./api/fetcher/fetch-status-manager.js";
|
|
7
|
+
import { ResourcesManager } from "./resources/resources-manager.js";
|
|
8
|
+
import { Resources } from "./resources/resources.js";
|
|
9
|
+
import Auth from "./api/auth.js";
|
|
10
|
+
import Forms from "./api/forms.js";
|
|
11
|
+
import { useProcess } from "./composables/process.js";
|
|
12
|
+
import Admin from "./admin/admin.js";
|
|
13
|
+
import NavigationGuard from "./admin/navigation-guard.js";
|
|
14
|
+
import { useRuntimeConfig } from "#app/nuxt";
|
|
15
|
+
import { useCookie } from "#app/composables/cookie.js";
|
|
16
|
+
export default class Cwa {
|
|
17
|
+
apiUrl;
|
|
18
|
+
options;
|
|
19
|
+
storage;
|
|
20
|
+
apiDocumentation;
|
|
21
|
+
mercure;
|
|
22
|
+
fetcher;
|
|
23
|
+
fetchStatusManager;
|
|
24
|
+
cwaFetch;
|
|
25
|
+
// public resources repository and utility getters
|
|
26
|
+
resources;
|
|
27
|
+
// public service for managing resources - CRUD functions etc.
|
|
28
|
+
resourcesManager;
|
|
29
|
+
// public service for authentication
|
|
30
|
+
auth;
|
|
31
|
+
forms;
|
|
32
|
+
admin;
|
|
33
|
+
adminNavGuard;
|
|
34
|
+
currentModulePackageInfo;
|
|
35
|
+
constructor(nuxtApp, options, currentModulePackageInfo) {
|
|
36
|
+
this.currentModulePackageInfo = currentModulePackageInfo;
|
|
37
|
+
const { isClient } = useProcess();
|
|
38
|
+
const { public: { cwa: { apiUrl, apiUrlBrowser } } } = useRuntimeConfig();
|
|
39
|
+
const defaultApiUrl = "https://api-url-not-set.com";
|
|
40
|
+
if (isClient) {
|
|
41
|
+
this.apiUrl = apiUrlBrowser || apiUrl || defaultApiUrl;
|
|
42
|
+
} else {
|
|
43
|
+
this.apiUrl = apiUrl || apiUrlBrowser || defaultApiUrl;
|
|
44
|
+
}
|
|
45
|
+
this.cwaFetch = new CwaFetch(this.apiUrl);
|
|
46
|
+
this.options = options;
|
|
47
|
+
this.storage = new Storage(this.options.storeName);
|
|
48
|
+
this.apiDocumentation = new ApiDocumentation(this.cwaFetch, this.storage.stores.apiDocumentation);
|
|
49
|
+
this.mercure = new Mercure(this.storage.stores.mercure, this.storage.stores.resources, this.storage.stores.fetcher);
|
|
50
|
+
this.fetchStatusManager = new FetchStatusManager(this.storage.stores.fetcher, this.mercure, this.apiDocumentation, this.storage.stores.resources);
|
|
51
|
+
this.fetcher = new Fetcher(this.cwaFetch, this.fetchStatusManager, nuxtApp._route, this.storage.stores.resources);
|
|
52
|
+
this.resources = new Resources(this.storage.stores.resources, this.storage.stores.fetcher);
|
|
53
|
+
this.admin = new Admin(this.storage.stores.admin, this.storage.stores.resources, this.resources);
|
|
54
|
+
this.resourcesManager = new ResourcesManager(this.cwaFetch, this.storage.stores.resources, this.fetchStatusManager, this.storage.stores.error, this.fetcher, this.admin, this.resources);
|
|
55
|
+
this.auth = new Auth(
|
|
56
|
+
this.cwaFetch,
|
|
57
|
+
this.mercure,
|
|
58
|
+
this.fetcher,
|
|
59
|
+
this.admin,
|
|
60
|
+
this.storage.stores.auth,
|
|
61
|
+
this.storage.stores.resources,
|
|
62
|
+
this.storage.stores.fetcher,
|
|
63
|
+
useCookie("cwa_auth", { sameSite: "strict" })
|
|
64
|
+
);
|
|
65
|
+
this.forms = new Forms(this.storage.stores.resources);
|
|
66
|
+
this.mercure.setFetcher(this.fetcher);
|
|
67
|
+
this.mercure.setRequestCount(this.resourcesManager.requestCount);
|
|
68
|
+
this.adminNavGuard = new NavigationGuard(nuxtApp.$router, this.storage.stores.admin);
|
|
69
|
+
}
|
|
70
|
+
get adminNavigationGuardFn() {
|
|
71
|
+
return this.adminNavGuard.adminNavigationGuardFn;
|
|
72
|
+
}
|
|
73
|
+
get navigationDisabled() {
|
|
74
|
+
return this.adminNavGuard.navigationDisabled;
|
|
75
|
+
}
|
|
76
|
+
// API Documentation service is private, exposing only function required by applications
|
|
77
|
+
async getApiDocumentation(refresh = false) {
|
|
78
|
+
return await this.apiDocumentation.getApiDocumentation(refresh);
|
|
79
|
+
}
|
|
80
|
+
async getComponentMetadata(refresh = false, includePosition = false) {
|
|
81
|
+
return await this.apiDocumentation.getComponentMetadata(refresh, includePosition);
|
|
82
|
+
}
|
|
83
|
+
// fetcher is private, exposing the only function required by applications
|
|
84
|
+
fetchResource(event) {
|
|
85
|
+
return this.fetcher.fetchResource(event);
|
|
86
|
+
}
|
|
87
|
+
fetchRoute(route) {
|
|
88
|
+
return this.fetcher.fetchRoute(route);
|
|
89
|
+
}
|
|
90
|
+
fetch(event) {
|
|
91
|
+
return this.fetcher.fetch(event);
|
|
92
|
+
}
|
|
93
|
+
clearPrimaryFetch() {
|
|
94
|
+
this.fetchStatusManager.clearPrimaryFetch();
|
|
95
|
+
}
|
|
96
|
+
// Added as utility to bridge primary functionality of initialising 2 CWA services - this is not required by an application though, perhaps could be moved
|
|
97
|
+
async initClientSide() {
|
|
98
|
+
await this.auth.init();
|
|
99
|
+
this.mercure.init();
|
|
100
|
+
}
|
|
101
|
+
get resourcesConfig() {
|
|
102
|
+
return this.options.resources || {};
|
|
103
|
+
}
|
|
104
|
+
// @internal
|
|
105
|
+
setResourceMeta(meta) {
|
|
106
|
+
this.options.resources = meta;
|
|
107
|
+
}
|
|
108
|
+
get layoutsConfig() {
|
|
109
|
+
return this.options.layouts;
|
|
110
|
+
}
|
|
111
|
+
get pagesConfig() {
|
|
112
|
+
return this.options.pages;
|
|
113
|
+
}
|
|
114
|
+
get pageDataConfig() {
|
|
115
|
+
return this.options.pageData;
|
|
116
|
+
}
|
|
117
|
+
get appName() {
|
|
118
|
+
return this.options.appName;
|
|
119
|
+
}
|
|
120
|
+
get apiUrlBase() {
|
|
121
|
+
return this.apiUrl;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface CwaResourceErrorObject {
|
|
2
|
+
message?: string;
|
|
3
|
+
statusCode?: number;
|
|
4
|
+
statusMessage?: string;
|
|
5
|
+
statusText?: string;
|
|
6
|
+
request?: string;
|
|
7
|
+
primaryMessage: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class CwaResourceError extends Error {
|
|
10
|
+
name: "CwaResourceError";
|
|
11
|
+
statusCode?: number;
|
|
12
|
+
statusMessage?: string;
|
|
13
|
+
statusText?: string;
|
|
14
|
+
request?: string;
|
|
15
|
+
primaryMessage?: string;
|
|
16
|
+
asObject?: CwaResourceErrorObject;
|
|
17
|
+
}
|
|
18
|
+
export declare function createCwaResourceError(error: any): CwaResourceError;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export class CwaResourceError extends Error {
|
|
2
|
+
name = "CwaResourceError";
|
|
3
|
+
statusCode;
|
|
4
|
+
statusMessage;
|
|
5
|
+
statusText;
|
|
6
|
+
request;
|
|
7
|
+
primaryMessage;
|
|
8
|
+
asObject;
|
|
9
|
+
}
|
|
10
|
+
export function createCwaResourceError(error) {
|
|
11
|
+
let message = error?.message;
|
|
12
|
+
if (!message || message === "") {
|
|
13
|
+
message = "An unknown error occurred";
|
|
14
|
+
}
|
|
15
|
+
const cwaResourceError = new CwaResourceError(message);
|
|
16
|
+
Object.defineProperty(cwaResourceError, "statusCode", {
|
|
17
|
+
get() {
|
|
18
|
+
return error?.statusCode;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
Object.defineProperty(cwaResourceError, "statusMessage", {
|
|
22
|
+
get() {
|
|
23
|
+
return error?.statusMessage;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(cwaResourceError, "statusText", {
|
|
27
|
+
get() {
|
|
28
|
+
return error?.statusText;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(cwaResourceError, "request", {
|
|
32
|
+
get() {
|
|
33
|
+
return error?.request ? error.request.toString() : void 0;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(cwaResourceError, "primaryMessage", {
|
|
37
|
+
get() {
|
|
38
|
+
return error?.statusText || error?.statusMessage || message;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
Object.defineProperty(cwaResourceError, "asObject", {
|
|
42
|
+
get() {
|
|
43
|
+
return {
|
|
44
|
+
message: this.message,
|
|
45
|
+
statusCode: this.statusCode,
|
|
46
|
+
statusMessage: this.statusMessage,
|
|
47
|
+
statusText: this.statusText,
|
|
48
|
+
primaryMessage: this.primaryMessage,
|
|
49
|
+
request: this.request
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return cwaResourceError;
|
|
54
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { addRouteMiddleware, defineNuxtPlugin } from "#app";
|
|
2
|
+
import CwaRouteMiddleware from "#cwa/runtime/route-middleware";
|
|
3
|
+
import Cwa from "#cwa/runtime/cwa";
|
|
4
|
+
import { options, currentModulePackageInfo } from "#build/cwa-options";
|
|
5
|
+
export default defineNuxtPlugin({
|
|
6
|
+
name: "cwa-plugin",
|
|
7
|
+
enforce: "post",
|
|
8
|
+
setup(nuxtApp) {
|
|
9
|
+
const cwa = new Cwa(nuxtApp, options, currentModulePackageInfo);
|
|
10
|
+
addRouteMiddleware("cwa-route-middleware", CwaRouteMiddleware, { global: true });
|
|
11
|
+
return {
|
|
12
|
+
provide: {
|
|
13
|
+
cwa
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
},
|
|
17
|
+
hooks: {}
|
|
18
|
+
});
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { CwaCurrentResourceInterface } from '#cwa/runtime/storage/stores/resources/state';
|
|
2
|
+
export declare enum CwaResourceTypes {
|
|
3
|
+
ROUTE = "ROUTE",
|
|
4
|
+
PAGE = "PAGE",
|
|
5
|
+
LAYOUT = "LAYOUT",
|
|
6
|
+
PAGE_DATA = "PAGE_DATA",
|
|
7
|
+
COMPONENT_GROUP = "COMPONENT_GROUP",
|
|
8
|
+
COMPONENT_POSITION = "COMPONENT_POSITION",
|
|
9
|
+
COMPONENT = "COMPONENT"
|
|
10
|
+
}
|
|
11
|
+
export interface CwaResource {
|
|
12
|
+
'@id': string;
|
|
13
|
+
'@type': string;
|
|
14
|
+
'publishedResource'?: string;
|
|
15
|
+
'draftResource'?: string;
|
|
16
|
+
'uiComponent'?: string;
|
|
17
|
+
'sortValue'?: number;
|
|
18
|
+
'componentGroup'?: string;
|
|
19
|
+
'_metadata': {
|
|
20
|
+
adding?: {
|
|
21
|
+
instantAdd: boolean;
|
|
22
|
+
endpoint: string;
|
|
23
|
+
isPublishable: boolean;
|
|
24
|
+
};
|
|
25
|
+
persisted: boolean;
|
|
26
|
+
publishable?: {
|
|
27
|
+
published: boolean;
|
|
28
|
+
publishedAt: string;
|
|
29
|
+
};
|
|
30
|
+
sortDisplayNumber?: number;
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
};
|
|
33
|
+
[key: string]: any;
|
|
34
|
+
}
|
|
35
|
+
type TypeToNestedPropertiesMap = {
|
|
36
|
+
[T in CwaResourceTypes]: Array<string>;
|
|
37
|
+
};
|
|
38
|
+
export declare function getResourceTypeFromIri(iri: string): CwaResourceTypes | undefined;
|
|
39
|
+
export declare function getPublishedResourceState(resource: Pick<CwaCurrentResourceInterface, 'data'>): undefined | boolean;
|
|
40
|
+
export declare function getPublishedResourceIri(resourceData: CwaResource): string | null;
|
|
41
|
+
export declare function isCwaResource(obj: any): obj is CwaResource;
|
|
42
|
+
export declare function isCwaResourceSame(resource1: CwaResource, resource2: CwaResource): boolean;
|
|
43
|
+
export declare const resourceTypeToNestedResourceProperties: TypeToNestedPropertiesMap;
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export var CwaResourceTypes = /* @__PURE__ */ ((CwaResourceTypes2) => {
|
|
2
|
+
CwaResourceTypes2["ROUTE"] = "ROUTE";
|
|
3
|
+
CwaResourceTypes2["PAGE"] = "PAGE";
|
|
4
|
+
CwaResourceTypes2["LAYOUT"] = "LAYOUT";
|
|
5
|
+
CwaResourceTypes2["PAGE_DATA"] = "PAGE_DATA";
|
|
6
|
+
CwaResourceTypes2["COMPONENT_GROUP"] = "COMPONENT_GROUP";
|
|
7
|
+
CwaResourceTypes2["COMPONENT_POSITION"] = "COMPONENT_POSITION";
|
|
8
|
+
CwaResourceTypes2["COMPONENT"] = "COMPONENT";
|
|
9
|
+
return CwaResourceTypes2;
|
|
10
|
+
})(CwaResourceTypes || {});
|
|
11
|
+
const resourceTypeToIriPrefix = {
|
|
12
|
+
["ROUTE" /* ROUTE */]: "/_/routes/",
|
|
13
|
+
["PAGE" /* PAGE */]: "/_/pages/",
|
|
14
|
+
["PAGE_DATA" /* PAGE_DATA */]: "/page_data/",
|
|
15
|
+
["LAYOUT" /* LAYOUT */]: "/_/layouts/",
|
|
16
|
+
["COMPONENT_GROUP" /* COMPONENT_GROUP */]: "/_/component_groups/",
|
|
17
|
+
["COMPONENT_POSITION" /* COMPONENT_POSITION */]: "/_/component_positions/",
|
|
18
|
+
["COMPONENT" /* COMPONENT */]: "/component/"
|
|
19
|
+
};
|
|
20
|
+
export function getResourceTypeFromIri(iri) {
|
|
21
|
+
for (const type of Object.values(CwaResourceTypes)) {
|
|
22
|
+
const prefix = resourceTypeToIriPrefix[type];
|
|
23
|
+
if (iri.startsWith(prefix) || iri === prefix.slice(0, -1)) {
|
|
24
|
+
return type;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function getPublishedResourceState(resource) {
|
|
29
|
+
const publishableMeta = resource.data?._metadata.publishable;
|
|
30
|
+
return publishableMeta?.published;
|
|
31
|
+
}
|
|
32
|
+
export function getPublishedResourceIri(resourceData) {
|
|
33
|
+
const publishableMetadata = resourceData._metadata?.publishable;
|
|
34
|
+
const resourceIri = resourceData["@id"];
|
|
35
|
+
if (!publishableMetadata) {
|
|
36
|
+
return resourceIri;
|
|
37
|
+
}
|
|
38
|
+
if (publishableMetadata.published) {
|
|
39
|
+
return resourceIri;
|
|
40
|
+
}
|
|
41
|
+
return resourceData.publishedResource || null;
|
|
42
|
+
}
|
|
43
|
+
export function isCwaResource(obj) {
|
|
44
|
+
if (typeof obj !== "object") {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return obj["@id"] !== void 0 && obj["@type"] !== void 0 && obj._metadata !== void 0 && typeof obj._metadata === "object";
|
|
48
|
+
}
|
|
49
|
+
export function isCwaResourceSame(resource1, resource2) {
|
|
50
|
+
const clearAndStringify = (obj) => {
|
|
51
|
+
const newObj = Object.assign({}, obj);
|
|
52
|
+
delete newObj.publishedResource;
|
|
53
|
+
delete newObj.draftResource;
|
|
54
|
+
delete newObj.modifiedAt;
|
|
55
|
+
delete newObj._metadata;
|
|
56
|
+
if (getResourceTypeFromIri(newObj["@id"]) === "COMPONENT" /* COMPONENT */) {
|
|
57
|
+
delete newObj.componentPositions;
|
|
58
|
+
}
|
|
59
|
+
Object.keys(newObj).forEach((k) => newObj[k] === null && delete newObj[k]);
|
|
60
|
+
return JSON.stringify(newObj);
|
|
61
|
+
};
|
|
62
|
+
return clearAndStringify(resource1) === clearAndStringify(resource2);
|
|
63
|
+
}
|
|
64
|
+
export const resourceTypeToNestedResourceProperties = {
|
|
65
|
+
["ROUTE" /* ROUTE */]: ["pageData", "page"],
|
|
66
|
+
["PAGE" /* PAGE */]: ["layout", "componentGroups"],
|
|
67
|
+
["PAGE_DATA" /* PAGE_DATA */]: ["page"],
|
|
68
|
+
["LAYOUT" /* LAYOUT */]: ["componentGroups"],
|
|
69
|
+
["COMPONENT_GROUP" /* COMPONENT_GROUP */]: ["componentPositions"],
|
|
70
|
+
["COMPONENT_POSITION" /* COMPONENT_POSITION */]: ["component"],
|
|
71
|
+
// draft will always be fetched by default if exists and auth to do, so we just need to fetch the associated published resource - will only be returned if we have auth
|
|
72
|
+
["COMPONENT" /* COMPONENT */]: ["componentGroups", "publishedResource"]
|
|
73
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type ComputedRef, type Ref } from 'vue';
|
|
2
|
+
import type { ResourcesStore } from '../storage/stores/resources/resources-store.js';
|
|
3
|
+
import type CwaFetch from '../api/fetcher/cwa-fetch.js';
|
|
4
|
+
import type FetchStatusManager from '../api/fetcher/fetch-status-manager.js';
|
|
5
|
+
import type { DeleteResourceEvent, SaveNewResourceEvent, SaveResourceEvent } from '../storage/stores/resources/actions.js';
|
|
6
|
+
import type { ErrorStore } from '../storage/stores/error/error-store.js';
|
|
7
|
+
import type { CwaErrorEvent } from '../storage/stores/error/state.js';
|
|
8
|
+
import { type CwaResource } from './resource-utils.js';
|
|
9
|
+
import type Fetcher from '#cwa/runtime/api/fetcher/fetcher';
|
|
10
|
+
import type { AddResourceEvent, ResourceStackItem } from '#cwa/runtime/admin/resource-stack-manager';
|
|
11
|
+
import type Admin from '#cwa/runtime/admin/admin';
|
|
12
|
+
import type { Resources } from '#cwa/runtime/resources/resources';
|
|
13
|
+
interface DeleteApiResourceEvent {
|
|
14
|
+
iri?: string;
|
|
15
|
+
endpoint: string;
|
|
16
|
+
requestCompleteFn?: (resource?: CwaResource) => void | Promise<void>;
|
|
17
|
+
saveCompleteFn?: (resource?: CwaResource) => void | Promise<void>;
|
|
18
|
+
refreshEndpoints?: string[];
|
|
19
|
+
}
|
|
20
|
+
interface DataApiResourceEvent extends DeleteApiResourceEvent {
|
|
21
|
+
data: any;
|
|
22
|
+
source?: string;
|
|
23
|
+
headers?: Record<string, string>;
|
|
24
|
+
}
|
|
25
|
+
export type ApiResourceEvent = DataApiResourceEvent | DeleteApiResourceEvent;
|
|
26
|
+
export declare class ResourcesManager {
|
|
27
|
+
private readonly fetcher;
|
|
28
|
+
private readonly admin;
|
|
29
|
+
private readonly resources;
|
|
30
|
+
private readonly cwaFetch;
|
|
31
|
+
private readonly resourcesStoreDefinition;
|
|
32
|
+
private readonly fetchStatusManager;
|
|
33
|
+
private readonly errorStoreDefinition;
|
|
34
|
+
private requestsInProgress;
|
|
35
|
+
private readonly reqCount;
|
|
36
|
+
private readonly _addResourceEvent;
|
|
37
|
+
private _requestCount?;
|
|
38
|
+
constructor(cwaFetch: CwaFetch, resourcesStoreDefinition: ResourcesStore, fetchStatusManager: FetchStatusManager, errorStoreDefinition: ErrorStore, fetcher: Fetcher, admin: Admin, resources: Resources);
|
|
39
|
+
mergeNewResources(): void;
|
|
40
|
+
get requestCount(): ComputedRef<number>;
|
|
41
|
+
getWaitForRequestPromise(endpoint: string, property: string, source?: string): Promise<void>;
|
|
42
|
+
createResource(event: DataApiResourceEvent): Promise<CwaResource | undefined>;
|
|
43
|
+
private confirmDelete;
|
|
44
|
+
private getEndpointForIri;
|
|
45
|
+
deleteResource(event: ApiResourceEvent): Promise<false | CwaResource | undefined>;
|
|
46
|
+
removeResource(event: DeleteResourceEvent): void;
|
|
47
|
+
updateResource(event: DataApiResourceEvent): Promise<CwaResource | undefined>;
|
|
48
|
+
private doResourceRequest;
|
|
49
|
+
addError(error: CwaErrorEvent): void;
|
|
50
|
+
get errors(): CwaErrorEvent[];
|
|
51
|
+
get hasErrors(): boolean;
|
|
52
|
+
removeError(id: number): void;
|
|
53
|
+
saveResource(event: SaveResourceEvent | SaveNewResourceEvent): void;
|
|
54
|
+
private requestOptions;
|
|
55
|
+
initAddResource(targetIri: string, addAfter: null | boolean, resourceStack: ResourceStackItem[], pageDataProperty?: string): Promise<void>;
|
|
56
|
+
setAddResourceEventResource(resourceType: string, endpoint: string, isPublishable: boolean, instantAdd: boolean, defaultData?: {
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}): Promise<void>;
|
|
59
|
+
clearAddResourceEventResource(): void;
|
|
60
|
+
clearAddResource(): void;
|
|
61
|
+
get addResourceEvent(): Ref<AddResourceEvent | undefined, AddResourceEvent | undefined>;
|
|
62
|
+
confirmDiscardAddingResource(): Promise<boolean>;
|
|
63
|
+
addResourceAction(publish?: boolean): Promise<CwaResource | undefined>;
|
|
64
|
+
private getRefreshPositions;
|
|
65
|
+
private get groupResource();
|
|
66
|
+
private get groupResourcePositions();
|
|
67
|
+
private get resourcesStore();
|
|
68
|
+
private get errorStore();
|
|
69
|
+
}
|
|
70
|
+
export {};
|