@payloadcms/next 3.0.0-beta.9 → 3.0.0-beta.90
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/dist/cjs/withPayload.cjs +68 -18
- package/dist/cjs/withPayload.cjs.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.d.ts +5 -0
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js +13 -0
- package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.d.ts +13 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +47 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts +8 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js +71 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/Tab/index.scss +93 -0
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.d.ts +6 -0
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.js +38 -0
- package/dist/elements/DocumentHeader/Tabs/getCustomViews.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.d.ts +7 -0
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.js +14 -0
- package/dist/elements/DocumentHeader/Tabs/getViewConfig.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/index.d.ts +12 -0
- package/dist/elements/DocumentHeader/Tabs/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/index.js +91 -0
- package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/index.scss +52 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.d.ts +3 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +21 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts +9 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js +57 -0
- package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -0
- package/dist/elements/DocumentHeader/index.d.ts +14 -0
- package/dist/elements/DocumentHeader/index.d.ts.map +1 -0
- package/dist/elements/DocumentHeader/index.js +30 -0
- package/dist/elements/DocumentHeader/index.js.map +1 -0
- package/dist/elements/DocumentHeader/index.scss +52 -0
- package/dist/elements/EmailAndUsername/index.d.ts +14 -0
- package/dist/elements/EmailAndUsername/index.d.ts.map +1 -0
- package/dist/elements/EmailAndUsername/index.js +89 -0
- package/dist/elements/EmailAndUsername/index.js.map +1 -0
- package/dist/elements/LeaveWithoutSaving/index.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/index.js +45 -20
- package/dist/elements/LeaveWithoutSaving/index.js.map +1 -1
- package/dist/elements/LeaveWithoutSaving/index.scss +1 -0
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts +2 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +1 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js +3 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -1
- package/dist/elements/Logo/index.d.ts +4 -0
- package/dist/elements/Logo/index.d.ts.map +1 -0
- package/dist/elements/Logo/index.js +27 -0
- package/dist/elements/Logo/index.js.map +1 -0
- package/dist/elements/Nav/NavHamburger/index.d.ts +5 -0
- package/dist/elements/Nav/NavHamburger/index.d.ts.map +1 -0
- package/dist/elements/Nav/NavHamburger/index.js +20 -0
- package/dist/elements/Nav/NavHamburger/index.js.map +1 -0
- package/dist/elements/Nav/NavWrapper/index.d.ts +7 -0
- package/dist/elements/Nav/NavWrapper/index.d.ts.map +1 -0
- package/dist/elements/Nav/NavWrapper/index.js +23 -0
- package/dist/elements/Nav/NavWrapper/index.js.map +1 -0
- package/dist/elements/Nav/NavWrapper/index.scss +20 -0
- package/dist/elements/Nav/index.client.d.ts +3 -0
- package/dist/elements/Nav/index.client.d.ts.map +1 -0
- package/dist/elements/Nav/index.client.js +88 -0
- package/dist/elements/Nav/index.client.js.map +1 -0
- package/dist/elements/Nav/index.d.ts +6 -0
- package/dist/elements/Nav/index.d.ts.map +1 -0
- package/dist/elements/Nav/index.js +61 -0
- package/dist/elements/Nav/index.js.map +1 -0
- package/dist/elements/Nav/index.scss +156 -0
- package/dist/exports/layouts.js.map +1 -1
- package/dist/exports/routes.d.ts +1 -1
- package/dist/exports/routes.d.ts.map +1 -1
- package/dist/exports/routes.js +1 -1
- package/dist/exports/routes.js.map +1 -1
- package/dist/exports/templates.d.ts +3 -0
- package/dist/exports/templates.d.ts.map +1 -0
- package/dist/exports/templates.js +4 -0
- package/dist/exports/templates.js.map +1 -0
- package/dist/exports/utilities.d.ts +5 -1
- package/dist/exports/utilities.d.ts.map +1 -1
- package/dist/exports/utilities.js +5 -1
- package/dist/exports/utilities.js.map +1 -1
- package/dist/exports/views.d.ts +2 -1
- package/dist/exports/views.d.ts.map +1 -1
- package/dist/exports/views.js +2 -1
- package/dist/exports/views.js.map +1 -1
- package/dist/{next-fileupload → fetchAPI-multipart}/fileFactory.d.ts +2 -3
- package/dist/fetchAPI-multipart/fileFactory.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/fileFactory.js.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/handlers.d.ts +2 -3
- package/dist/fetchAPI-multipart/handlers.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/handlers.js.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/index.d.ts +10 -13
- package/dist/fetchAPI-multipart/index.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/index.js +3 -5
- package/dist/fetchAPI-multipart/index.js.map +1 -0
- package/dist/fetchAPI-multipart/isEligibleRequest.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/isEligibleRequest.js +1 -1
- package/dist/fetchAPI-multipart/isEligibleRequest.js.map +1 -0
- package/dist/fetchAPI-multipart/processMultipart.d.ts +8 -0
- package/dist/fetchAPI-multipart/processMultipart.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/processMultipart.js +44 -15
- package/dist/fetchAPI-multipart/processMultipart.js.map +1 -0
- package/dist/fetchAPI-multipart/processNested.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/processNested.js +2 -1
- package/dist/fetchAPI-multipart/processNested.js.map +1 -0
- package/dist/fetchAPI-multipart/uploadTimer.d.ts.map +1 -0
- package/dist/fetchAPI-multipart/uploadTimer.js.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/utilities.d.ts +4 -4
- package/dist/fetchAPI-multipart/utilities.d.ts.map +1 -0
- package/dist/{next-fileupload → fetchAPI-multipart}/utilities.js +4 -4
- package/dist/fetchAPI-multipart/utilities.js.map +1 -0
- package/dist/{next-stream-file → fetchAPI-stream-file}/index.d.ts +0 -1
- package/dist/fetchAPI-stream-file/index.d.ts.map +1 -0
- package/dist/fetchAPI-stream-file/index.js.map +1 -0
- package/dist/index.js.map +1 -1
- package/dist/layouts/Root/index.d.ts +5 -5
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +84 -49
- package/dist/layouts/Root/index.js.map +1 -1
- package/dist/prod/styles.css +1 -1
- package/dist/routes/graphql/handler.d.ts +1 -1
- package/dist/routes/graphql/handler.d.ts.map +1 -1
- package/dist/routes/graphql/handler.js +17 -9
- package/dist/routes/graphql/handler.js.map +1 -1
- package/dist/routes/graphql/index.js.map +1 -1
- package/dist/routes/graphql/playground.d.ts +1 -1
- package/dist/routes/graphql/playground.d.ts.map +1 -1
- package/dist/routes/graphql/playground.js.map +1 -1
- package/dist/routes/index.d.ts +1 -1
- package/dist/routes/index.d.ts.map +1 -1
- package/dist/routes/index.js +1 -1
- package/dist/routes/index.js.map +1 -1
- package/dist/routes/rest/auth/access.d.ts.map +1 -1
- package/dist/routes/rest/auth/access.js +20 -5
- package/dist/routes/rest/auth/access.js.map +1 -1
- package/dist/routes/rest/auth/forgotPassword.d.ts.map +1 -1
- package/dist/routes/rest/auth/forgotPassword.js +15 -6
- package/dist/routes/rest/auth/forgotPassword.js.map +1 -1
- package/dist/routes/rest/auth/init.d.ts.map +1 -1
- package/dist/routes/rest/auth/init.js +7 -1
- package/dist/routes/rest/auth/init.js.map +1 -1
- package/dist/routes/rest/auth/login.d.ts.map +1 -1
- package/dist/routes/rest/auth/login.js +19 -12
- package/dist/routes/rest/auth/login.js.map +1 -1
- package/dist/routes/rest/auth/logout.d.ts.map +1 -1
- package/dist/routes/rest/auth/logout.js +12 -8
- package/dist/routes/rest/auth/logout.js.map +1 -1
- package/dist/routes/rest/auth/me.d.ts.map +1 -1
- package/dist/routes/rest/auth/me.js +6 -2
- package/dist/routes/rest/auth/me.js.map +1 -1
- package/dist/routes/rest/auth/refresh.d.ts.map +1 -1
- package/dist/routes/rest/auth/refresh.js +20 -26
- package/dist/routes/rest/auth/refresh.js.map +1 -1
- package/dist/routes/rest/auth/registerFirstUser.d.ts.map +1 -1
- package/dist/routes/rest/auth/registerFirstUser.js +18 -9
- package/dist/routes/rest/auth/registerFirstUser.js.map +1 -1
- package/dist/routes/rest/auth/resetPassword.d.ts.map +1 -1
- package/dist/routes/rest/auth/resetPassword.js +9 -7
- package/dist/routes/rest/auth/resetPassword.js.map +1 -1
- package/dist/routes/rest/auth/unlock.d.ts.map +1 -1
- package/dist/routes/rest/auth/unlock.js +15 -6
- package/dist/routes/rest/auth/unlock.js.map +1 -1
- package/dist/routes/rest/auth/verifyEmail.d.ts.map +1 -1
- package/dist/routes/rest/auth/verifyEmail.js +8 -3
- package/dist/routes/rest/auth/verifyEmail.js.map +1 -1
- package/dist/routes/rest/buildFormState.d.ts +1 -3
- package/dist/routes/rest/buildFormState.d.ts.map +1 -1
- package/dist/routes/rest/buildFormState.js +30 -145
- package/dist/routes/rest/buildFormState.js.map +1 -1
- package/dist/routes/rest/checkEndpoints.d.ts.map +1 -1
- package/dist/routes/rest/checkEndpoints.js.map +1 -1
- package/dist/routes/rest/collections/count.d.ts +3 -0
- package/dist/routes/rest/collections/count.d.ts.map +1 -0
- package/dist/routes/rest/collections/count.js +15 -0
- package/dist/routes/rest/collections/count.js.map +1 -0
- package/dist/routes/rest/collections/create.d.ts.map +1 -1
- package/dist/routes/rest/collections/create.js +7 -2
- package/dist/routes/rest/collections/create.js.map +1 -1
- package/dist/routes/rest/collections/delete.d.ts.map +1 -1
- package/dist/routes/rest/collections/delete.js +9 -2
- package/dist/routes/rest/collections/delete.js.map +1 -1
- package/dist/routes/rest/collections/deleteByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/deleteByID.js +9 -2
- package/dist/routes/rest/collections/deleteByID.js.map +1 -1
- package/dist/routes/rest/collections/docAccess.d.ts.map +1 -1
- package/dist/routes/rest/collections/docAccess.js +6 -1
- package/dist/routes/rest/collections/docAccess.js.map +1 -1
- package/dist/routes/rest/collections/duplicate.d.ts.map +1 -1
- package/dist/routes/rest/collections/duplicate.js +7 -2
- package/dist/routes/rest/collections/duplicate.js.map +1 -1
- package/dist/routes/rest/collections/find.d.ts.map +1 -1
- package/dist/routes/rest/collections/find.js +7 -2
- package/dist/routes/rest/collections/find.js.map +1 -1
- package/dist/routes/rest/collections/findByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/findByID.js +7 -2
- package/dist/routes/rest/collections/findByID.js.map +1 -1
- package/dist/routes/rest/collections/findVersionByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/findVersionByID.js +7 -2
- package/dist/routes/rest/collections/findVersionByID.js.map +1 -1
- package/dist/routes/rest/collections/findVersions.d.ts.map +1 -1
- package/dist/routes/rest/collections/findVersions.js +7 -2
- package/dist/routes/rest/collections/findVersions.js.map +1 -1
- package/dist/routes/rest/collections/preview.d.ts.map +1 -1
- package/dist/routes/rest/collections/preview.js +9 -4
- package/dist/routes/rest/collections/preview.js.map +1 -1
- package/dist/routes/rest/collections/restoreVersion.d.ts.map +1 -1
- package/dist/routes/rest/collections/restoreVersion.js +9 -2
- package/dist/routes/rest/collections/restoreVersion.js.map +1 -1
- package/dist/routes/rest/collections/update.d.ts.map +1 -1
- package/dist/routes/rest/collections/update.js +9 -2
- package/dist/routes/rest/collections/update.js.map +1 -1
- package/dist/routes/rest/collections/updateByID.d.ts.map +1 -1
- package/dist/routes/rest/collections/updateByID.js +7 -2
- package/dist/routes/rest/collections/updateByID.js.map +1 -1
- package/dist/routes/rest/files/checkFileAccess.d.ts +2 -2
- package/dist/routes/rest/files/checkFileAccess.d.ts.map +1 -1
- package/dist/routes/rest/files/checkFileAccess.js +2 -2
- package/dist/routes/rest/files/checkFileAccess.js.map +1 -1
- package/dist/routes/rest/files/getFile.d.ts +1 -1
- package/dist/routes/rest/files/getFile.d.ts.map +1 -1
- package/dist/routes/rest/files/getFile.js +24 -13
- package/dist/routes/rest/files/getFile.js.map +1 -1
- package/dist/routes/rest/files/getFileTypeFallback.d.ts +7 -0
- package/dist/routes/rest/files/getFileTypeFallback.d.ts.map +1 -0
- package/dist/routes/rest/files/getFileTypeFallback.js +21 -0
- package/dist/routes/rest/files/getFileTypeFallback.js.map +1 -0
- package/dist/routes/rest/globals/docAccess.d.ts.map +1 -1
- package/dist/routes/rest/globals/docAccess.js +6 -1
- package/dist/routes/rest/globals/docAccess.js.map +1 -1
- package/dist/routes/rest/globals/findOne.d.ts.map +1 -1
- package/dist/routes/rest/globals/findOne.js +7 -2
- package/dist/routes/rest/globals/findOne.js.map +1 -1
- package/dist/routes/rest/globals/findVersionByID.d.ts.map +1 -1
- package/dist/routes/rest/globals/findVersionByID.js +7 -2
- package/dist/routes/rest/globals/findVersionByID.js.map +1 -1
- package/dist/routes/rest/globals/findVersions.d.ts.map +1 -1
- package/dist/routes/rest/globals/findVersions.js +7 -2
- package/dist/routes/rest/globals/findVersions.js.map +1 -1
- package/dist/routes/rest/globals/preview.d.ts.map +1 -1
- package/dist/routes/rest/globals/preview.js +9 -4
- package/dist/routes/rest/globals/preview.js.map +1 -1
- package/dist/routes/rest/globals/restoreVersion.d.ts.map +1 -1
- package/dist/routes/rest/globals/restoreVersion.js +9 -2
- package/dist/routes/rest/globals/restoreVersion.js.map +1 -1
- package/dist/routes/rest/globals/update.d.ts.map +1 -1
- package/dist/routes/rest/globals/update.js +7 -2
- package/dist/routes/rest/globals/update.js.map +1 -1
- package/dist/routes/rest/index.d.ts +2 -1
- package/dist/routes/rest/index.d.ts.map +1 -1
- package/dist/routes/rest/index.js +379 -228
- package/dist/routes/rest/index.js.map +1 -1
- package/dist/routes/rest/og/image.d.ts +10 -0
- package/dist/routes/rest/og/image.d.ts.map +1 -0
- package/dist/routes/rest/og/image.js +83 -0
- package/dist/routes/rest/og/image.js.map +1 -0
- package/dist/routes/rest/og/index.d.ts +11 -0
- package/dist/routes/rest/og/index.d.ts.map +1 -0
- package/dist/routes/rest/og/index.js +77 -0
- package/dist/routes/rest/og/index.js.map +1 -0
- package/dist/routes/rest/og/roboto-regular.woff +0 -0
- package/dist/routes/rest/routeError.d.ts +6 -5
- package/dist/routes/rest/routeError.d.ts.map +1 -1
- package/dist/routes/rest/routeError.js +28 -14
- package/dist/routes/rest/routeError.js.map +1 -1
- package/dist/routes/rest/types.d.ts +1 -1
- package/dist/routes/rest/types.d.ts.map +1 -1
- package/dist/routes/rest/types.js.map +1 -1
- package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts +1 -1
- package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts.map +1 -1
- package/dist/routes/rest/utilities/sanitizeCollectionID.js.map +1 -1
- package/dist/scss/app.scss +11 -16
- package/dist/scss/colors.scss +76 -76
- package/dist/scss/toastify.scss +1 -0
- package/dist/scss/toasts.scss +142 -0
- package/dist/scss/type.scss +15 -23
- package/dist/scss/vars.scss +26 -47
- package/dist/templates/Default/NavHamburger/index.d.ts +3 -0
- package/dist/templates/Default/NavHamburger/index.d.ts.map +1 -0
- package/dist/templates/Default/NavHamburger/index.js +13 -0
- package/dist/templates/Default/NavHamburger/index.js.map +1 -0
- package/dist/templates/Default/Wrapper/index.d.ts +8 -0
- package/dist/templates/Default/Wrapper/index.d.ts.map +1 -0
- package/dist/templates/Default/Wrapper/index.js +20 -0
- package/dist/templates/Default/Wrapper/index.js.map +1 -0
- package/dist/templates/Default/Wrapper/index.scss +57 -0
- package/dist/templates/Default/index.d.ts +10 -0
- package/dist/templates/Default/index.d.ts.map +1 -0
- package/dist/templates/Default/index.js +59 -0
- package/dist/templates/Default/index.js.map +1 -0
- package/dist/templates/Default/index.scss +67 -0
- package/dist/templates/Minimal/index.d.ts +10 -0
- package/dist/templates/Minimal/index.d.ts.map +1 -0
- package/dist/templates/Minimal/index.js +21 -0
- package/dist/templates/Minimal/index.js.map +1 -0
- package/dist/templates/Minimal/index.scss +28 -0
- package/dist/utilities/addDataAndFileToRequest.d.ts +8 -0
- package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -0
- package/dist/utilities/addDataAndFileToRequest.js +42 -0
- package/dist/utilities/addDataAndFileToRequest.js.map +1 -0
- package/dist/utilities/addLocalesToRequest.d.ts +17 -0
- package/dist/utilities/addLocalesToRequest.d.ts.map +1 -0
- package/dist/utilities/addLocalesToRequest.js +43 -0
- package/dist/utilities/addLocalesToRequest.js.map +1 -0
- package/dist/utilities/createPayloadRequest.d.ts +1 -1
- package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
- package/dist/utilities/createPayloadRequest.js +31 -39
- package/dist/utilities/createPayloadRequest.js.map +1 -1
- package/dist/utilities/getNextRequestI18n.d.ts +5 -5
- package/dist/utilities/getNextRequestI18n.d.ts.map +1 -1
- package/dist/utilities/getNextRequestI18n.js +4 -2
- package/dist/utilities/getNextRequestI18n.js.map +1 -1
- package/dist/utilities/getPayloadHMR.d.ts +2 -2
- package/dist/utilities/getPayloadHMR.d.ts.map +1 -1
- package/dist/utilities/getPayloadHMR.js +60 -28
- package/dist/utilities/getPayloadHMR.js.map +1 -1
- package/dist/utilities/getRequestLanguage.d.ts +2 -2
- package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
- package/dist/utilities/getRequestLanguage.js +4 -5
- package/dist/utilities/getRequestLanguage.js.map +1 -1
- package/dist/utilities/getRequestLocales.js.map +1 -1
- package/dist/utilities/getRequestTheme.d.ts +11 -0
- package/dist/utilities/getRequestTheme.d.ts.map +1 -0
- package/dist/utilities/getRequestTheme.js +19 -0
- package/dist/utilities/getRequestTheme.js.map +1 -0
- package/dist/utilities/headersWithCors.d.ts +8 -0
- package/dist/utilities/headersWithCors.d.ts.map +1 -0
- package/dist/utilities/headersWithCors.js +33 -0
- package/dist/utilities/headersWithCors.js.map +1 -0
- package/dist/utilities/initPage/handleAdminPage.d.ts +16 -0
- package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -0
- package/dist/utilities/initPage/handleAdminPage.js +48 -0
- package/dist/utilities/initPage/handleAdminPage.js.map +1 -0
- package/dist/utilities/initPage/handleAuthRedirect.d.ts +9 -0
- package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -0
- package/dist/utilities/initPage/handleAuthRedirect.js +39 -0
- package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -0
- package/dist/utilities/initPage/index.d.ts +4 -0
- package/dist/utilities/initPage/index.d.ts.map +1 -0
- package/dist/utilities/initPage/index.js +134 -0
- package/dist/utilities/initPage/index.js.map +1 -0
- package/dist/utilities/initPage/shared.d.ts +16 -0
- package/dist/utilities/initPage/shared.d.ts.map +1 -0
- package/dist/utilities/initPage/shared.js +29 -0
- package/dist/utilities/initPage/shared.js.map +1 -0
- package/dist/utilities/initPage/types.d.ts +25 -0
- package/dist/utilities/initPage/types.d.ts.map +1 -0
- package/dist/utilities/initPage/types.js.map +1 -0
- package/dist/utilities/mergeHeaders.d.ts +2 -0
- package/dist/utilities/mergeHeaders.d.ts.map +1 -0
- package/dist/utilities/mergeHeaders.js +11 -0
- package/dist/utilities/mergeHeaders.js.map +1 -0
- package/dist/utilities/meta.d.ts +3 -7
- package/dist/utilities/meta.d.ts.map +1 -1
- package/dist/utilities/meta.js +64 -25
- package/dist/utilities/meta.js.map +1 -1
- package/dist/utilities/timestamp.js.map +1 -1
- package/dist/views/API/LocaleSelector/index.d.ts +9 -0
- package/dist/views/API/LocaleSelector/index.d.ts.map +1 -0
- package/dist/views/API/LocaleSelector/index.js +17 -0
- package/dist/views/API/LocaleSelector/index.js.map +1 -0
- package/dist/views/API/RenderJSON/index.js +101 -69
- package/dist/views/API/RenderJSON/index.js.map +1 -1
- package/dist/views/API/index.client.d.ts.map +1 -1
- package/dist/views/API/index.client.js +152 -125
- package/dist/views/API/index.client.js.map +1 -1
- package/dist/views/API/index.d.ts +2 -2
- package/dist/views/API/index.d.ts.map +1 -1
- package/dist/views/API/index.js +2 -1
- package/dist/views/API/index.js.map +1 -1
- package/dist/views/API/index.scss +1 -2
- package/dist/views/API/meta.d.ts.map +1 -1
- package/dist/views/API/meta.js +17 -6
- package/dist/views/API/meta.js.map +1 -1
- package/dist/views/Account/Settings/LanguageSelector.d.ts +6 -0
- package/dist/views/Account/Settings/LanguageSelector.d.ts.map +1 -0
- package/dist/views/Account/Settings/LanguageSelector.js +19 -0
- package/dist/views/Account/Settings/LanguageSelector.js.map +1 -0
- package/dist/views/Account/Settings/index.d.ts +5 -1
- package/dist/views/Account/Settings/index.d.ts.map +1 -1
- package/dist/views/Account/Settings/index.js +26 -21
- package/dist/views/Account/Settings/index.js.map +1 -1
- package/dist/views/Account/ToggleTheme/index.d.ts.map +1 -1
- package/dist/views/Account/ToggleTheme/index.js +21 -20
- package/dist/views/Account/ToggleTheme/index.js.map +1 -1
- package/dist/views/Account/index.client.d.ts +3 -0
- package/dist/views/Account/index.client.d.ts.map +1 -0
- package/dist/views/Account/index.client.js +21 -0
- package/dist/views/Account/index.client.js.map +1 -0
- package/dist/views/Account/index.d.ts +1 -1
- package/dist/views/Account/index.d.ts.map +1 -1
- package/dist/views/Account/index.js +69 -42
- package/dist/views/Account/index.js.map +1 -1
- package/dist/views/Account/meta.d.ts.map +1 -1
- package/dist/views/Account/meta.js +4 -5
- package/dist/views/Account/meta.js.map +1 -1
- package/dist/views/CreateFirstUser/index.client.d.ts +4 -3
- package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.client.js +59 -13
- package/dist/views/CreateFirstUser/index.client.js.map +1 -1
- package/dist/views/CreateFirstUser/index.d.ts +1 -1
- package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/index.js +27 -55
- package/dist/views/CreateFirstUser/index.js.map +1 -1
- package/dist/views/CreateFirstUser/index.scss +6 -12
- package/dist/views/CreateFirstUser/meta.d.ts.map +1 -1
- package/dist/views/CreateFirstUser/meta.js +4 -5
- package/dist/views/CreateFirstUser/meta.js.map +1 -1
- package/dist/views/Dashboard/Default/index.d.ts +4 -4
- package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
- package/dist/views/Dashboard/Default/index.js +119 -23
- package/dist/views/Dashboard/Default/index.js.map +1 -1
- package/dist/views/Dashboard/Default/index.scss +11 -7
- package/dist/views/Dashboard/index.d.ts +1 -1
- package/dist/views/Dashboard/index.d.ts.map +1 -1
- package/dist/views/Dashboard/index.js +53 -18
- package/dist/views/Dashboard/index.js.map +1 -1
- package/dist/views/Dashboard/meta.d.ts.map +1 -1
- package/dist/views/Dashboard/meta.js +8 -5
- package/dist/views/Dashboard/meta.js.map +1 -1
- package/dist/views/Document/getCustomViewByKey.d.ts +2 -3
- package/dist/views/Document/getCustomViewByKey.d.ts.map +1 -1
- package/dist/views/Document/getCustomViewByKey.js +1 -1
- package/dist/views/Document/getCustomViewByKey.js.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.d.ts +6 -4
- package/dist/views/Document/getCustomViewByRoute.d.ts.map +1 -1
- package/dist/views/Document/getCustomViewByRoute.js +16 -6
- package/dist/views/Document/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Document/getDocumentData.d.ts +10 -0
- package/dist/views/Document/getDocumentData.d.ts.map +1 -0
- package/dist/views/Document/getDocumentData.js +32 -0
- package/dist/views/Document/getDocumentData.js.map +1 -0
- package/dist/views/Document/getDocumentPermissions.d.ts +13 -0
- package/dist/views/Document/getDocumentPermissions.d.ts.map +1 -0
- package/dist/views/Document/getDocumentPermissions.js +82 -0
- package/dist/views/Document/getDocumentPermissions.js.map +1 -0
- package/dist/views/Document/getMetaBySegment.d.ts +4 -4
- package/dist/views/Document/getMetaBySegment.d.ts.map +1 -1
- package/dist/views/Document/getMetaBySegment.js +74 -29
- package/dist/views/Document/getMetaBySegment.js.map +1 -1
- package/dist/views/Document/getViewsFromConfig.d.ts +18 -9
- package/dist/views/Document/getViewsFromConfig.d.ts.map +1 -1
- package/dist/views/Document/getViewsFromConfig.js +169 -63
- package/dist/views/Document/getViewsFromConfig.js.map +1 -1
- package/dist/views/Document/index.d.ts +1 -1
- package/dist/views/Document/index.d.ts.map +1 -1
- package/dist/views/Document/index.js +108 -84
- package/dist/views/Document/index.js.map +1 -1
- package/dist/views/Document/meta.js.map +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.d.ts +2 -1
- package/dist/views/Edit/Default/Auth/APIKey.d.ts.map +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.js +88 -42
- package/dist/views/Edit/Default/Auth/APIKey.js.map +1 -1
- package/dist/views/Edit/Default/Auth/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/Auth/index.js +152 -71
- package/dist/views/Edit/Default/Auth/index.js.map +1 -1
- package/dist/views/Edit/Default/Auth/index.scss +17 -2
- package/dist/views/Edit/Default/Auth/types.d.ts +5 -2
- package/dist/views/Edit/Default/Auth/types.d.ts.map +1 -1
- package/dist/views/Edit/Default/Auth/types.js.map +1 -1
- package/dist/views/Edit/Default/{SetStepNav → SetDocumentStepNav}/index.d.ts +2 -3
- package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts.map +1 -0
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js +79 -0
- package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +1 -0
- package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts +1 -2
- package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/SetDocumentTitle/index.js +2 -4
- package/dist/views/Edit/Default/SetDocumentTitle/index.js.map +1 -1
- package/dist/views/Edit/Default/index.d.ts.map +1 -1
- package/dist/views/Edit/Default/index.js +127 -112
- package/dist/views/Edit/Default/index.js.map +1 -1
- package/dist/views/Edit/Default/index.scss +2 -2
- package/dist/views/Edit/Default/types.d.ts +1 -1
- package/dist/views/Edit/Default/types.d.ts.map +1 -1
- package/dist/views/Edit/Default/types.js.map +1 -1
- package/dist/views/Edit/index.client.d.ts.map +1 -1
- package/dist/views/Edit/index.client.js +20 -13
- package/dist/views/Edit/index.client.js.map +1 -1
- package/dist/views/Edit/index.d.ts +2 -2
- package/dist/views/Edit/index.d.ts.map +1 -1
- package/dist/views/Edit/index.js +2 -1
- package/dist/views/Edit/index.js.map +1 -1
- package/dist/views/Edit/meta.d.ts.map +1 -1
- package/dist/views/Edit/meta.js +31 -18
- package/dist/views/Edit/meta.js.map +1 -1
- package/dist/views/Edit/sanitizeEditViewProps.d.ts +1 -1
- package/dist/views/Edit/sanitizeEditViewProps.d.ts.map +1 -1
- package/dist/views/Edit/sanitizeEditViewProps.js.map +1 -1
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts +3 -0
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -0
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +108 -0
- package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -0
- package/dist/views/ForgotPassword/index.d.ts +1 -1
- package/dist/views/ForgotPassword/index.d.ts.map +1 -1
- package/dist/views/ForgotPassword/index.js +48 -57
- package/dist/views/ForgotPassword/index.js.map +1 -1
- package/dist/views/ForgotPassword/meta.d.ts.map +1 -1
- package/dist/views/ForgotPassword/meta.js +4 -5
- package/dist/views/ForgotPassword/meta.js.map +1 -1
- package/dist/views/List/Default/index.d.ts.map +1 -1
- package/dist/views/List/Default/index.js +195 -121
- package/dist/views/List/Default/index.js.map +1 -1
- package/dist/views/List/Default/index.scss +9 -27
- package/dist/views/List/Default/types.d.ts +2 -2
- package/dist/views/List/Default/types.d.ts.map +1 -1
- package/dist/views/List/Default/types.js.map +1 -1
- package/dist/views/List/index.d.ts +1 -1
- package/dist/views/List/index.d.ts.map +1 -1
- package/dist/views/List/index.js +104 -59
- package/dist/views/List/index.js.map +1 -1
- package/dist/views/List/meta.d.ts +3 -3
- package/dist/views/List/meta.d.ts.map +1 -1
- package/dist/views/List/meta.js +4 -2
- package/dist/views/List/meta.js.map +1 -1
- package/dist/views/LivePreview/Context/collisionDetection.js.map +1 -1
- package/dist/views/LivePreview/Context/context.d.ts +4 -4
- package/dist/views/LivePreview/Context/context.d.ts.map +1 -1
- package/dist/views/LivePreview/Context/context.js.map +1 -1
- package/dist/views/LivePreview/Context/index.d.ts +3 -4
- package/dist/views/LivePreview/Context/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Context/index.js +10 -7
- package/dist/views/LivePreview/Context/index.js.map +1 -1
- package/dist/views/LivePreview/Context/sizeReducer.js.map +1 -1
- package/dist/views/LivePreview/Device/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Device/index.js +48 -18
- package/dist/views/LivePreview/Device/index.js.map +1 -1
- package/dist/views/LivePreview/DeviceContainer/index.js +5 -3
- package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -1
- package/dist/views/LivePreview/IFrame/index.js +2 -1
- package/dist/views/LivePreview/IFrame/index.js.map +1 -1
- package/dist/views/LivePreview/Preview/index.d.ts +1 -1
- package/dist/views/LivePreview/Preview/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Preview/index.js +50 -18
- package/dist/views/LivePreview/Preview/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.d.ts +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/Controls/index.js +111 -65
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js +2 -1
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.d.ts +3 -3
- package/dist/views/LivePreview/Toolbar/index.d.ts.map +1 -1
- package/dist/views/LivePreview/Toolbar/index.js +30 -15
- package/dist/views/LivePreview/Toolbar/index.js.map +1 -1
- package/dist/views/LivePreview/ToolbarArea/index.js +5 -3
- package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -1
- package/dist/views/LivePreview/index.client.d.ts +4 -5
- package/dist/views/LivePreview/index.client.d.ts.map +1 -1
- package/dist/views/LivePreview/index.client.js +129 -113
- package/dist/views/LivePreview/index.client.js.map +1 -1
- package/dist/views/LivePreview/index.d.ts +2 -2
- package/dist/views/LivePreview/index.d.ts.map +1 -1
- package/dist/views/LivePreview/index.js +2 -1
- package/dist/views/LivePreview/index.js.map +1 -1
- package/dist/views/LivePreview/meta.d.ts.map +1 -1
- package/dist/views/LivePreview/meta.js +7 -22
- package/dist/views/LivePreview/meta.js.map +1 -1
- package/dist/views/LivePreview/usePopupWindow.d.ts +3 -2
- package/dist/views/LivePreview/usePopupWindow.d.ts.map +1 -1
- package/dist/views/LivePreview/usePopupWindow.js +2 -2
- package/dist/views/LivePreview/usePopupWindow.js.map +1 -1
- package/dist/views/Login/LoginField/index.d.ts +9 -0
- package/dist/views/Login/LoginField/index.d.ts.map +1 -0
- package/dist/views/Login/LoginField/index.js +49 -0
- package/dist/views/Login/LoginField/index.js.map +1 -0
- package/dist/views/Login/LoginForm/index.d.ts +3 -0
- package/dist/views/Login/LoginForm/index.d.ts.map +1 -1
- package/dist/views/Login/LoginForm/index.js +65 -40
- package/dist/views/Login/LoginForm/index.js.map +1 -1
- package/dist/views/Login/index.d.ts +1 -1
- package/dist/views/Login/index.d.ts.map +1 -1
- package/dist/views/Login/index.js +52 -15
- package/dist/views/Login/index.js.map +1 -1
- package/dist/views/Login/meta.d.ts.map +1 -1
- package/dist/views/Login/meta.js +4 -5
- package/dist/views/Login/meta.js.map +1 -1
- package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
- package/dist/views/Logout/LogoutClient.js +28 -12
- package/dist/views/Logout/LogoutClient.js.map +1 -1
- package/dist/views/Logout/index.d.ts +3 -3
- package/dist/views/Logout/index.d.ts.map +1 -1
- package/dist/views/Logout/index.js +11 -12
- package/dist/views/Logout/index.js.map +1 -1
- package/dist/views/Logout/meta.d.ts.map +1 -1
- package/dist/views/Logout/meta.js +2 -4
- package/dist/views/Logout/meta.js.map +1 -1
- package/dist/views/NotFound/index.client.d.ts.map +1 -1
- package/dist/views/NotFound/index.client.js +25 -16
- package/dist/views/NotFound/index.client.js.map +1 -1
- package/dist/views/NotFound/index.d.ts +4 -3
- package/dist/views/NotFound/index.d.ts.map +1 -1
- package/dist/views/NotFound/index.js +25 -14
- package/dist/views/NotFound/index.js.map +1 -1
- package/dist/views/NotFound/meta.d.ts +3 -3
- package/dist/views/NotFound/meta.d.ts.map +1 -1
- package/dist/views/NotFound/meta.js +2 -4
- package/dist/views/NotFound/meta.js.map +1 -1
- package/dist/views/ResetPassword/index.client.d.ts +7 -0
- package/dist/views/ResetPassword/index.client.d.ts.map +1 -0
- package/dist/views/ResetPassword/index.client.js +72 -0
- package/dist/views/ResetPassword/index.client.js.map +1 -0
- package/dist/views/ResetPassword/index.d.ts +1 -1
- package/dist/views/ResetPassword/index.d.ts.map +1 -1
- package/dist/views/ResetPassword/index.js +55 -56
- package/dist/views/ResetPassword/index.js.map +1 -1
- package/dist/views/ResetPassword/index.scss +2 -12
- package/dist/views/ResetPassword/meta.d.ts.map +1 -1
- package/dist/views/ResetPassword/meta.js +4 -5
- package/dist/views/ResetPassword/meta.js.map +1 -1
- package/dist/views/Root/generateCustomViewMetadata.d.ts +11 -0
- package/dist/views/Root/generateCustomViewMetadata.d.ts.map +1 -0
- package/dist/views/Root/generateCustomViewMetadata.js +23 -0
- package/dist/views/Root/generateCustomViewMetadata.js.map +1 -0
- package/dist/views/Root/getCustomViewByRoute.d.ts +7 -2
- package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -1
- package/dist/views/Root/getCustomViewByRoute.js +29 -11
- package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
- package/dist/views/Root/getViewFromConfig.d.ts +12 -7
- package/dist/views/Root/getViewFromConfig.d.ts.map +1 -1
- package/dist/views/Root/getViewFromConfig.js +59 -21
- package/dist/views/Root/getViewFromConfig.js.map +1 -1
- package/dist/views/Root/index.d.ts +9 -7
- package/dist/views/Root/index.d.ts.map +1 -1
- package/dist/views/Root/index.js +64 -19
- package/dist/views/Root/index.js.map +1 -1
- package/dist/views/Root/isPathMatchingRoute.js.map +1 -1
- package/dist/views/Root/meta.d.ts +1 -1
- package/dist/views/Root/meta.d.ts.map +1 -1
- package/dist/views/Root/meta.js +19 -21
- package/dist/views/Root/meta.js.map +1 -1
- package/dist/views/Unauthorized/index.d.ts +2 -2
- package/dist/views/Unauthorized/index.d.ts.map +1 -1
- package/dist/views/Unauthorized/index.js +22 -11
- package/dist/views/Unauthorized/index.js.map +1 -1
- package/dist/views/Unauthorized/meta.d.ts.map +1 -1
- package/dist/views/Unauthorized/meta.js +4 -5
- package/dist/views/Unauthorized/meta.js.map +1 -1
- package/dist/views/Verify/index.d.ts +1 -1
- package/dist/views/Verify/index.d.ts.map +1 -1
- package/dist/views/Verify/index.js +33 -11
- package/dist/views/Verify/index.js.map +1 -1
- package/dist/views/Verify/meta.d.ts.map +1 -1
- package/dist/views/Verify/meta.js +4 -5
- package/dist/views/Verify/meta.js.map +1 -1
- package/dist/views/Version/Default/SetStepNav.d.ts +8 -10
- package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
- package/dist/views/Version/Default/SetStepNav.js +35 -23
- package/dist/views/Version/Default/SetStepNav.js.map +1 -1
- package/dist/views/Version/Default/index.d.ts.map +1 -1
- package/dist/views/Version/Default/index.js +100 -85
- package/dist/views/Version/Default/index.js.map +1 -1
- package/dist/views/Version/Default/types.d.ts +9 -11
- package/dist/views/Version/Default/types.d.ts.map +1 -1
- package/dist/views/Version/Default/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js +5 -3
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts +2 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +66 -51
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts +2 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +31 -19
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts +3 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +67 -36
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +2 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts +3 -6
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +23 -12
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +3 -6
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +31 -30
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +2 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts +3 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +22 -11
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts +21 -58
- package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js +4 -3
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/styles.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts +16 -17
- package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/index.js +95 -88
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts +12 -13
- package/dist/views/Version/RenderFieldsToDiff/types.d.ts.map +1 -1
- package/dist/views/Version/RenderFieldsToDiff/types.js.map +1 -1
- package/dist/views/Version/Restore/index.d.ts.map +1 -1
- package/dist/views/Version/Restore/index.js +92 -40
- package/dist/views/Version/Restore/index.js.map +1 -1
- package/dist/views/Version/Restore/index.scss +35 -2
- package/dist/views/Version/Restore/types.d.ts +2 -1
- package/dist/views/Version/Restore/types.d.ts.map +1 -1
- package/dist/views/Version/Restore/types.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/index.js +77 -52
- package/dist/views/Version/SelectComparison/index.js.map +1 -1
- package/dist/views/Version/SelectComparison/index.scss +1 -1
- package/dist/views/Version/SelectComparison/types.d.ts +3 -3
- package/dist/views/Version/SelectComparison/types.d.ts.map +1 -1
- package/dist/views/Version/SelectComparison/types.js.map +1 -1
- package/dist/views/Version/SelectLocales/index.d.ts.map +1 -1
- package/dist/views/Version/SelectLocales/index.js +19 -14
- package/dist/views/Version/SelectLocales/index.js.map +1 -1
- package/dist/views/Version/SelectLocales/types.d.ts +1 -1
- package/dist/views/Version/SelectLocales/types.d.ts.map +1 -1
- package/dist/views/Version/SelectLocales/types.js.map +1 -1
- package/dist/views/Version/index.d.ts +2 -2
- package/dist/views/Version/index.d.ts.map +1 -1
- package/dist/views/Version/index.js +57 -44
- package/dist/views/Version/index.js.map +1 -1
- package/dist/views/Version/meta.d.ts.map +1 -1
- package/dist/views/Version/meta.js +25 -17
- package/dist/views/Version/meta.js.map +1 -1
- package/dist/views/Versions/buildColumns.d.ts +5 -3
- package/dist/views/Versions/buildColumns.d.ts.map +1 -1
- package/dist/views/Versions/buildColumns.js +48 -20
- package/dist/views/Versions/buildColumns.js.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.d.ts +7 -1
- package/dist/views/Versions/cells/AutosaveCell/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js +45 -7
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.d.ts.map +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js +20 -14
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
- package/dist/views/Versions/cells/ID/index.js +5 -2
- package/dist/views/Versions/cells/ID/index.js.map +1 -1
- package/dist/views/Versions/getLatestVersion.d.ts +14 -0
- package/dist/views/Versions/getLatestVersion.d.ts.map +1 -0
- package/dist/views/Versions/getLatestVersion.js +34 -0
- package/dist/views/Versions/getLatestVersion.js.map +1 -0
- package/dist/views/Versions/index.client.d.ts +6 -6
- package/dist/views/Versions/index.client.d.ts.map +1 -1
- package/dist/views/Versions/index.client.js +69 -42
- package/dist/views/Versions/index.client.js.map +1 -1
- package/dist/views/Versions/index.d.ts +2 -2
- package/dist/views/Versions/index.d.ts.map +1 -1
- package/dist/views/Versions/index.js +79 -29
- package/dist/views/Versions/index.js.map +1 -1
- package/dist/views/Versions/meta.d.ts.map +1 -1
- package/dist/views/Versions/meta.js +25 -16
- package/dist/views/Versions/meta.js.map +1 -1
- package/dist/views/Versions/types.d.ts +1 -3
- package/dist/views/Versions/types.d.ts.map +1 -1
- package/dist/views/Versions/types.js.map +1 -1
- package/dist/withPayload.d.ts +1 -1
- package/dist/withPayload.d.ts.map +1 -1
- package/dist/withPayload.js +68 -18
- package/dist/withPayload.js.map +1 -1
- package/package.json +68 -50
- package/dist/next-fileupload/fileFactory.d.ts.map +0 -1
- package/dist/next-fileupload/fileFactory.js.map +0 -1
- package/dist/next-fileupload/handlers.d.ts.map +0 -1
- package/dist/next-fileupload/handlers.js.map +0 -1
- package/dist/next-fileupload/index.d.ts.map +0 -1
- package/dist/next-fileupload/index.js.map +0 -1
- package/dist/next-fileupload/isEligibleRequest.d.ts.map +0 -1
- package/dist/next-fileupload/isEligibleRequest.js.map +0 -1
- package/dist/next-fileupload/processMultipart.d.ts +0 -8
- package/dist/next-fileupload/processMultipart.d.ts.map +0 -1
- package/dist/next-fileupload/processMultipart.js.map +0 -1
- package/dist/next-fileupload/processNested.d.ts.map +0 -1
- package/dist/next-fileupload/processNested.js.map +0 -1
- package/dist/next-fileupload/uploadTimer.d.ts.map +0 -1
- package/dist/next-fileupload/uploadTimer.js.map +0 -1
- package/dist/next-fileupload/utilities.d.ts.map +0 -1
- package/dist/next-fileupload/utilities.js.map +0 -1
- package/dist/next-stream-file/index.d.ts.map +0 -1
- package/dist/next-stream-file/index.js.map +0 -1
- package/dist/prod/payload/favicon.svg +0 -15
- package/dist/prod/payload/og-image.png +0 -0
- package/dist/utilities/buildFieldSchemaMap/index.d.ts +0 -4
- package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +0 -1
- package/dist/utilities/buildFieldSchemaMap/index.js +0 -28
- package/dist/utilities/buildFieldSchemaMap/index.js.map +0 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts +0 -14
- package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +0 -1
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js +0 -72
- package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +0 -1
- package/dist/utilities/buildFieldSchemaMap/types.d.ts +0 -3
- package/dist/utilities/buildFieldSchemaMap/types.d.ts.map +0 -1
- package/dist/utilities/buildFieldSchemaMap/types.js.map +0 -1
- package/dist/utilities/getDataAndFile.d.ts +0 -12
- package/dist/utilities/getDataAndFile.d.ts.map +0 -1
- package/dist/utilities/getDataAndFile.js +0 -68
- package/dist/utilities/getDataAndFile.js.map +0 -1
- package/dist/utilities/initPage.d.ts +0 -12
- package/dist/utilities/initPage.d.ts.map +0 -1
- package/dist/utilities/initPage.js +0 -98
- package/dist/utilities/initPage.js.map +0 -1
- package/dist/views/Dashboard/Default/index.client.d.ts +0 -10
- package/dist/views/Dashboard/Default/index.client.d.ts.map +0 -1
- package/dist/views/Dashboard/Default/index.client.js +0 -103
- package/dist/views/Dashboard/Default/index.client.js.map +0 -1
- package/dist/views/Edit/Default/SetStepNav/index.d.ts.map +0 -1
- package/dist/views/Edit/Default/SetStepNav/index.js +0 -64
- package/dist/views/Edit/Default/SetStepNav/index.js.map +0 -1
- package/dist/views/Version/shared.d.ts +0 -9
- package/dist/views/Version/shared.d.ts.map +0 -1
- package/dist/views/Version/shared.js +0 -10
- package/dist/views/Version/shared.js.map +0 -1
- package/dist/webpackEntry.d.ts +0 -5
- package/dist/webpackEntry.d.ts.map +0 -1
- package/dist/webpackEntry.js +0 -6
- package/dist/webpackEntry.js.map +0 -1
- package/src/index.js +0 -1
- /package/dist/{next-fileupload → fetchAPI-multipart}/fileFactory.js +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/handlers.js +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/isEligibleRequest.d.ts +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/processNested.d.ts +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/uploadTimer.d.ts +0 -0
- /package/dist/{next-fileupload → fetchAPI-multipart}/uploadTimer.js +0 -0
- /package/dist/{next-stream-file → fetchAPI-stream-file}/index.js +0 -0
- /package/dist/utilities/{buildFieldSchemaMap → initPage}/types.js +0 -0
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import httpStatus from 'http-status';
|
|
2
|
-
import { generatePayloadCookie } from 'payload
|
|
3
|
-
import {
|
|
2
|
+
import { generatePayloadCookie, registerFirstUserOperation } from 'payload';
|
|
3
|
+
import { headersWithCors } from '../../../utilities/headersWithCors.js';
|
|
4
4
|
export const registerFirstUser = async ({ collection, req })=>{
|
|
5
|
-
const data = req
|
|
5
|
+
const { data, t } = req;
|
|
6
|
+
const authData = collection.config.auth?.loginWithUsername ? {
|
|
7
|
+
email: typeof req.data?.email === 'string' ? req.data.email : '',
|
|
8
|
+
password: typeof req.data?.password === 'string' ? req.data.password : '',
|
|
9
|
+
username: typeof req.data?.username === 'string' ? req.data.username : ''
|
|
10
|
+
} : {
|
|
11
|
+
email: typeof req.data?.email === 'string' ? req.data.email : '',
|
|
12
|
+
password: typeof req.data?.password === 'string' ? req.data.password : ''
|
|
13
|
+
};
|
|
6
14
|
const result = await registerFirstUserOperation({
|
|
7
15
|
collection,
|
|
8
16
|
data: {
|
|
9
17
|
...data,
|
|
10
|
-
|
|
11
|
-
password: typeof data?.password === 'string' ? data.password : ''
|
|
18
|
+
...authData
|
|
12
19
|
},
|
|
13
20
|
req
|
|
14
21
|
});
|
|
@@ -19,13 +26,15 @@ export const registerFirstUser = async ({ collection, req })=>{
|
|
|
19
26
|
});
|
|
20
27
|
return Response.json({
|
|
21
28
|
exp: result.exp,
|
|
22
|
-
|
|
23
|
-
message: 'Successfully registered first user.',
|
|
29
|
+
message: t('authentication:successfullyRegisteredFirstUser'),
|
|
24
30
|
token: result.token,
|
|
25
31
|
user: result.user
|
|
26
32
|
}, {
|
|
27
|
-
headers:
|
|
28
|
-
|
|
33
|
+
headers: headersWithCors({
|
|
34
|
+
headers: new Headers({
|
|
35
|
+
'Set-Cookie': cookie
|
|
36
|
+
}),
|
|
37
|
+
req
|
|
29
38
|
}),
|
|
30
39
|
status: httpStatus.OK
|
|
31
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/routes/rest/auth/registerFirstUser.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/registerFirstUser.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, registerFirstUserOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const registerFirstUser: CollectionRouteHandler = async ({ collection, req }) => {\n const { data, t } = req\n const authData = collection.config.auth?.loginWithUsername\n ? {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n username: typeof req.data?.username === 'string' ? req.data.username : '',\n }\n : {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n }\n\n const result = await registerFirstUserOperation({\n collection,\n data: {\n ...data,\n ...authData,\n },\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n token: result.token,\n })\n\n return Response.json(\n {\n exp: result.exp,\n message: t('authentication:successfullyRegisteredFirstUser'),\n token: result.token,\n user: result.user,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","generatePayloadCookie","registerFirstUserOperation","headersWithCors","registerFirstUser","collection","req","data","t","authData","config","auth","loginWithUsername","email","password","username","result","cookie","collectionConfig","payload","token","Response","json","exp","message","user","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,qBAAqB,EAAEC,0BAA0B,QAAQ,UAAS;AAI3E,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,oBAA4C,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACjF,MAAM,EAAEC,IAAI,EAAEC,CAAC,EAAE,GAAGF;IACpB,MAAMG,WAAWJ,WAAWK,MAAM,CAACC,IAAI,EAAEC,oBACrC;QACEC,OAAO,OAAOP,IAAIC,IAAI,EAAEM,UAAU,WAAWP,IAAIC,IAAI,CAACM,KAAK,GAAG;QAC9DC,UAAU,OAAOR,IAAIC,IAAI,EAAEO,aAAa,WAAWR,IAAIC,IAAI,CAACO,QAAQ,GAAG;QACvEC,UAAU,OAAOT,IAAIC,IAAI,EAAEQ,aAAa,WAAWT,IAAIC,IAAI,CAACQ,QAAQ,GAAG;IACzE,IACA;QACEF,OAAO,OAAOP,IAAIC,IAAI,EAAEM,UAAU,WAAWP,IAAIC,IAAI,CAACM,KAAK,GAAG;QAC9DC,UAAU,OAAOR,IAAIC,IAAI,EAAEO,aAAa,WAAWR,IAAIC,IAAI,CAACO,QAAQ,GAAG;IACzE;IAEJ,MAAME,SAAS,MAAMd,2BAA2B;QAC9CG;QACAE,MAAM;YACJ,GAAGA,IAAI;YACP,GAAGE,QAAQ;QACb;QACAH;IACF;IAEA,MAAMW,SAAShB,sBAAsB;QACnCiB,kBAAkBb,WAAWK,MAAM;QACnCS,SAASb,IAAIa,OAAO;QACpBC,OAAOJ,OAAOI,KAAK;IACrB;IAEA,OAAOC,SAASC,IAAI,CAClB;QACEC,KAAKP,OAAOO,GAAG;QACfC,SAAShB,EAAE;QACXY,OAAOJ,OAAOI,KAAK;QACnBK,MAAMT,OAAOS,IAAI;IACnB,GACA;QACEC,SAASvB,gBAAgB;YACvBuB,SAAS,IAAIC,QAAQ;gBACnB,cAAcV;YAChB;YACAX;QACF;QACAsB,QAAQ5B,WAAW6B,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resetPassword.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/resetPassword.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resetPassword.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/resetPassword.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,aAAa,EAAE,sBAuC3B,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import httpStatus from 'http-status';
|
|
2
|
-
import { generatePayloadCookie } from 'payload
|
|
3
|
-
import {
|
|
2
|
+
import { generatePayloadCookie, resetPasswordOperation } from 'payload';
|
|
3
|
+
import { headersWithCors } from '../../../utilities/headersWithCors.js';
|
|
4
4
|
export const resetPassword = async ({ collection, req })=>{
|
|
5
|
-
const { searchParams } = req;
|
|
5
|
+
const { searchParams, t } = req;
|
|
6
6
|
const depth = searchParams.get('depth');
|
|
7
7
|
const result = await resetPasswordOperation({
|
|
8
8
|
collection,
|
|
@@ -22,12 +22,14 @@ export const resetPassword = async ({ collection, req })=>{
|
|
|
22
22
|
delete result.token;
|
|
23
23
|
}
|
|
24
24
|
return Response.json({
|
|
25
|
-
|
|
26
|
-
message: 'Password reset successfully.',
|
|
25
|
+
message: t('authentication:passwordResetSuccessfully'),
|
|
27
26
|
...result
|
|
28
27
|
}, {
|
|
29
|
-
headers:
|
|
30
|
-
|
|
28
|
+
headers: headersWithCors({
|
|
29
|
+
headers: new Headers({
|
|
30
|
+
'Set-Cookie': cookie
|
|
31
|
+
}),
|
|
32
|
+
req
|
|
31
33
|
}),
|
|
32
34
|
status: httpStatus.OK
|
|
33
35
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/routes/rest/auth/resetPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/resetPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, resetPasswordOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const resetPassword: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams, t } = req\n const depth = searchParams.get('depth')\n\n const result = await resetPasswordOperation({\n collection,\n data: {\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n token: typeof req.data?.token === 'string' ? req.data.token : '',\n },\n depth: depth ? Number(depth) : undefined,\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n token: result.token,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n message: t('authentication:passwordResetSuccessfully'),\n ...result,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","generatePayloadCookie","resetPasswordOperation","headersWithCors","resetPassword","collection","req","searchParams","t","depth","get","result","data","password","token","Number","undefined","cookie","collectionConfig","config","payload","auth","removeTokenFromResponses","Response","json","message","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,qBAAqB,EAAEC,sBAAsB,QAAQ,UAAS;AAIvE,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,gBAAwC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IAC7E,MAAM,EAAEC,YAAY,EAAEC,CAAC,EAAE,GAAGF;IAC5B,MAAMG,QAAQF,aAAaG,GAAG,CAAC;IAE/B,MAAMC,SAAS,MAAMT,uBAAuB;QAC1CG;QACAO,MAAM;YACJC,UAAU,OAAOP,IAAIM,IAAI,EAAEC,aAAa,WAAWP,IAAIM,IAAI,CAACC,QAAQ,GAAG;YACvEC,OAAO,OAAOR,IAAIM,IAAI,EAAEE,UAAU,WAAWR,IAAIM,IAAI,CAACE,KAAK,GAAG;QAChE;QACAL,OAAOA,QAAQM,OAAON,SAASO;QAC/BV;IACF;IAEA,MAAMW,SAAShB,sBAAsB;QACnCiB,kBAAkBb,WAAWc,MAAM;QACnCC,SAASd,IAAIc,OAAO;QACpBN,OAAOH,OAAOG,KAAK;IACrB;IAEA,IAAIT,WAAWc,MAAM,CAACE,IAAI,CAACC,wBAAwB,EAAE;QACnD,OAAOX,OAAOG,KAAK;IACrB;IAEA,OAAOS,SAASC,IAAI,CAClB;QACEC,SAASjB,EAAE;QACX,GAAGG,MAAM;IACX,GACA;QACEe,SAASvB,gBAAgB;YACvBuB,SAAS,IAAIC,QAAQ;gBACnB,cAAcV;YAChB;YACAX;QACF;QACAsB,QAAQ5B,WAAW6B,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unlock.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/unlock.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"unlock.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/unlock.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,MAAM,EAAE,sBA+BpB,CAAA"}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import httpStatus from 'http-status';
|
|
2
|
-
import { unlockOperation } from 'payload
|
|
2
|
+
import { unlockOperation } from 'payload';
|
|
3
|
+
import { headersWithCors } from '../../../utilities/headersWithCors.js';
|
|
3
4
|
export const unlock = async ({ collection, req })=>{
|
|
5
|
+
const { t } = req;
|
|
6
|
+
const authData = collection.config.auth?.loginWithUsername !== false ? {
|
|
7
|
+
email: typeof req.data?.email === 'string' ? req.data.email : '',
|
|
8
|
+
username: typeof req.data?.username === 'string' ? req.data.username : ''
|
|
9
|
+
} : {
|
|
10
|
+
email: typeof req.data?.email === 'string' ? req.data.email : ''
|
|
11
|
+
};
|
|
4
12
|
await unlockOperation({
|
|
5
13
|
collection,
|
|
6
|
-
data:
|
|
7
|
-
email: req.data.email
|
|
8
|
-
},
|
|
14
|
+
data: authData,
|
|
9
15
|
req
|
|
10
16
|
});
|
|
11
17
|
return Response.json({
|
|
12
|
-
|
|
13
|
-
message: 'Success'
|
|
18
|
+
message: t('general:success')
|
|
14
19
|
}, {
|
|
20
|
+
headers: headersWithCors({
|
|
21
|
+
headers: new Headers(),
|
|
22
|
+
req
|
|
23
|
+
}),
|
|
15
24
|
status: httpStatus.OK
|
|
16
25
|
});
|
|
17
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/routes/rest/auth/unlock.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { unlockOperation } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/unlock.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { unlockOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const unlock: CollectionRouteHandler = async ({ collection, req }) => {\n const { t } = req\n\n const authData =\n collection.config.auth?.loginWithUsername !== false\n ? {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n username: typeof req.data?.username === 'string' ? req.data.username : '',\n }\n : {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n }\n\n await unlockOperation({\n collection,\n data: authData,\n req,\n })\n\n return Response.json(\n {\n message: t('general:success'),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","unlockOperation","headersWithCors","unlock","collection","req","t","authData","config","auth","loginWithUsername","email","data","username","Response","json","message","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,eAAe,QAAQ,UAAS;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,SAAiC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACtE,MAAM,EAAEC,CAAC,EAAE,GAAGD;IAEd,MAAME,WACJH,WAAWI,MAAM,CAACC,IAAI,EAAEC,sBAAsB,QAC1C;QACEC,OAAO,OAAON,IAAIO,IAAI,EAAED,UAAU,WAAWN,IAAIO,IAAI,CAACD,KAAK,GAAG;QAC9DE,UAAU,OAAOR,IAAIO,IAAI,EAAEC,aAAa,WAAWR,IAAIO,IAAI,CAACC,QAAQ,GAAG;IACzE,IACA;QACEF,OAAO,OAAON,IAAIO,IAAI,EAAED,UAAU,WAAWN,IAAIO,IAAI,CAACD,KAAK,GAAG;IAChE;IAEN,MAAMV,gBAAgB;QACpBG;QACAQ,MAAML;QACNF;IACF;IAEA,OAAOS,SAASC,IAAI,CAClB;QACEC,SAASV,EAAE;IACb,GACA;QACEW,SAASf,gBAAgB;YACvBe,SAAS,IAAIC;YACbb;QACF;QACAc,QAAQnB,WAAWoB,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verifyEmail.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/verifyEmail.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"verifyEmail.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/verifyEmail.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAI/D,eAAO,MAAM,WAAW,EAAE,4BAoBzB,CAAA"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import httpStatus from 'http-status';
|
|
2
|
-
import { verifyEmailOperation } from 'payload
|
|
2
|
+
import { verifyEmailOperation } from 'payload';
|
|
3
|
+
import { headersWithCors } from '../../../utilities/headersWithCors.js';
|
|
3
4
|
export const verifyEmail = async ({ id, collection, req })=>{
|
|
5
|
+
const { t } = req;
|
|
4
6
|
await verifyEmailOperation({
|
|
5
7
|
collection,
|
|
6
8
|
req,
|
|
7
9
|
token: id
|
|
8
10
|
});
|
|
9
11
|
return Response.json({
|
|
10
|
-
|
|
11
|
-
message: 'Email verified successfully.'
|
|
12
|
+
message: t('authentication:accountVerified')
|
|
12
13
|
}, {
|
|
14
|
+
headers: headersWithCors({
|
|
15
|
+
headers: new Headers(),
|
|
16
|
+
req
|
|
17
|
+
}),
|
|
13
18
|
status: httpStatus.OK
|
|
14
19
|
});
|
|
15
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/routes/rest/auth/verifyEmail.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { verifyEmailOperation } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/verifyEmail.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { verifyEmailOperation } from 'payload'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const verifyEmail: CollectionRouteHandlerWithID = async ({ id, collection, req }) => {\n const { t } = req\n await verifyEmailOperation({\n collection,\n req,\n token: id,\n })\n\n return Response.json(\n {\n message: t('authentication:accountVerified'),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","verifyEmailOperation","headersWithCors","verifyEmail","id","collection","req","t","token","Response","json","message","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,oBAAoB,QAAQ,UAAS;AAI9C,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,cAA4C,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACrF,MAAM,EAAEC,CAAC,EAAE,GAAGD;IACd,MAAML,qBAAqB;QACzBI;QACAC;QACAE,OAAOJ;IACT;IAEA,OAAOK,SAASC,IAAI,CAClB;QACEC,SAASJ,EAAE;IACb,GACA;QACEK,SAASV,gBAAgB;YACvBU,SAAS,IAAIC;YACbP;QACF;QACAQ,QAAQd,WAAWe,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type { PayloadRequest } from 'payload
|
|
2
|
-
import type { FieldSchemaMap } from '../../utilities/buildFieldSchemaMap/types.js';
|
|
3
|
-
export declare const getFieldSchemaMap: (req: PayloadRequest) => FieldSchemaMap;
|
|
1
|
+
import type { PayloadRequest } from 'payload';
|
|
4
2
|
export declare const buildFormState: ({ req }: {
|
|
5
3
|
req: PayloadRequest;
|
|
6
4
|
}) => Promise<Response>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildFormState.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/buildFormState.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"buildFormState.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/buildFormState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAQ7C,eAAO,MAAM,cAAc,YAAmB;IAAE,GAAG,EAAE,cAAc,CAAA;CAAE,sBAyCpE,CAAA"}
|
|
@@ -1,159 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { reduceFieldsToValues } from '@payloadcms/ui/utilities/reduceFieldsToValues';
|
|
1
|
+
import { buildFormState as buildFormStateFn } from '@payloadcms/ui/utilities/buildFormState';
|
|
3
2
|
import httpStatus from 'http-status';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
if (!cached) {
|
|
7
|
-
// eslint-disable-next-line no-multi-assign
|
|
8
|
-
cached = global._payload_fieldSchemaMap = null;
|
|
9
|
-
}
|
|
10
|
-
export const getFieldSchemaMap = (req)=>{
|
|
11
|
-
if (cached && process.env.NODE_ENV !== 'development') {
|
|
12
|
-
return cached;
|
|
13
|
-
}
|
|
14
|
-
cached = buildFieldSchemaMap(req);
|
|
15
|
-
return cached;
|
|
16
|
-
};
|
|
3
|
+
import { headersWithCors } from '../../utilities/headersWithCors.js';
|
|
4
|
+
import { routeError } from './routeError.js';
|
|
17
5
|
export const buildFormState = async ({ req })=>{
|
|
6
|
+
const headers = headersWithCors({
|
|
7
|
+
headers: new Headers(),
|
|
8
|
+
req
|
|
9
|
+
});
|
|
18
10
|
try {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return Response.json(null, {
|
|
33
|
-
status: httpStatus.UNAUTHORIZED
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
// Match the user collection to the global admin config
|
|
37
|
-
} else if (adminUserSlug !== incomingUserSlug) {
|
|
38
|
-
return Response.json(null, {
|
|
39
|
-
status: httpStatus.UNAUTHORIZED
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
return Response.json(null, {
|
|
44
|
-
status: httpStatus.UNAUTHORIZED
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
const fieldSchemaMap = getFieldSchemaMap(req);
|
|
48
|
-
const id = collectionSlug ? reqData.id : undefined;
|
|
49
|
-
const schemaPathSegments = schemaPath.split('.');
|
|
50
|
-
let fieldSchema;
|
|
51
|
-
if (schemaPathSegments.length === 1) {
|
|
52
|
-
if (req.payload.collections[schemaPath]) {
|
|
53
|
-
fieldSchema = req.payload.collections[schemaPath].config.fields;
|
|
54
|
-
} else {
|
|
55
|
-
fieldSchema = req.payload.config.globals.find((global1)=>global1.slug === schemaPath)?.fields;
|
|
56
|
-
}
|
|
57
|
-
} else if (fieldSchemaMap.has(schemaPath)) {
|
|
58
|
-
fieldSchema = fieldSchemaMap.get(schemaPath);
|
|
59
|
-
}
|
|
60
|
-
if (!fieldSchema) {
|
|
11
|
+
const result = await buildFormStateFn({
|
|
12
|
+
req
|
|
13
|
+
});
|
|
14
|
+
return Response.json(result, {
|
|
15
|
+
headers,
|
|
16
|
+
status: httpStatus.OK
|
|
17
|
+
});
|
|
18
|
+
} catch (err) {
|
|
19
|
+
req.payload.logger.error({
|
|
20
|
+
err,
|
|
21
|
+
msg: `There was an error building form state`
|
|
22
|
+
});
|
|
23
|
+
if (err.message === 'Could not find field schema for given path') {
|
|
61
24
|
return Response.json({
|
|
62
|
-
message:
|
|
25
|
+
message: err.message
|
|
63
26
|
}, {
|
|
27
|
+
headers,
|
|
64
28
|
status: httpStatus.BAD_REQUEST
|
|
65
29
|
});
|
|
66
30
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
// as it reduces the amount of client-side fetches necessary
|
|
73
|
-
// when we fetch data for the Edit view
|
|
74
|
-
if (!docPreferences) {
|
|
75
|
-
let preferencesKey;
|
|
76
|
-
if (collectionSlug && id) {
|
|
77
|
-
preferencesKey = `collection-${collectionSlug}-${id}`;
|
|
78
|
-
}
|
|
79
|
-
if (globalSlug) {
|
|
80
|
-
preferencesKey = `global-${globalSlug}`;
|
|
81
|
-
}
|
|
82
|
-
if (preferencesKey) {
|
|
83
|
-
const fetchPreferences = async ()=>{
|
|
84
|
-
const preferencesResult = await req.payload.find({
|
|
85
|
-
collection: 'payload-preferences',
|
|
86
|
-
depth: 0,
|
|
87
|
-
limit: 1,
|
|
88
|
-
where: {
|
|
89
|
-
key: {
|
|
90
|
-
equals: preferencesKey
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
if (preferencesResult?.docs?.[0]?.value) docPreferences = preferencesResult.docs[0].value;
|
|
95
|
-
};
|
|
96
|
-
promises.preferences = fetchPreferences();
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
// If there is a form state,
|
|
100
|
-
// then we can deduce data from that form state
|
|
101
|
-
if (formState) data = reduceFieldsToValues(formState, true);
|
|
102
|
-
// If we do not have data at this point,
|
|
103
|
-
// we can fetch it. This is useful for DocumentInfoProvider
|
|
104
|
-
// to reduce the amount of fetches required
|
|
105
|
-
if (!data) {
|
|
106
|
-
const fetchData = async ()=>{
|
|
107
|
-
let resolvedData;
|
|
108
|
-
if (collectionSlug && id) {
|
|
109
|
-
resolvedData = await req.payload.findByID({
|
|
110
|
-
id,
|
|
111
|
-
collection: collectionSlug,
|
|
112
|
-
depth: 0,
|
|
113
|
-
draft: true,
|
|
114
|
-
fallbackLocale: null,
|
|
115
|
-
locale,
|
|
116
|
-
overrideAccess: false,
|
|
117
|
-
user: req.user
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
if (globalSlug && schemaPath === globalSlug) {
|
|
121
|
-
resolvedData = await req.payload.findGlobal({
|
|
122
|
-
slug: globalSlug,
|
|
123
|
-
depth: 0,
|
|
124
|
-
draft: true,
|
|
125
|
-
fallbackLocale: null,
|
|
126
|
-
locale,
|
|
127
|
-
overrideAccess: false,
|
|
128
|
-
user: req.user
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
data = resolvedData;
|
|
132
|
-
};
|
|
133
|
-
promises.data = fetchData();
|
|
134
|
-
}
|
|
135
|
-
if (Object.keys(promises).length > 0) {
|
|
136
|
-
await Promise.all(Object.values(promises));
|
|
31
|
+
if (err.message === 'Unauthorized') {
|
|
32
|
+
return Response.json(null, {
|
|
33
|
+
headers,
|
|
34
|
+
status: httpStatus.UNAUTHORIZED
|
|
35
|
+
});
|
|
137
36
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
fieldSchema,
|
|
142
|
-
operation,
|
|
143
|
-
preferences: docPreferences || {
|
|
144
|
-
fields: {}
|
|
145
|
-
},
|
|
37
|
+
return routeError({
|
|
38
|
+
config: req.payload.config,
|
|
39
|
+
err,
|
|
146
40
|
req
|
|
147
41
|
});
|
|
148
|
-
return Response.json(result, {
|
|
149
|
-
status: httpStatus.OK
|
|
150
|
-
});
|
|
151
|
-
} catch (err) {
|
|
152
|
-
return Response.json({
|
|
153
|
-
message: 'There was an error building form state'
|
|
154
|
-
}, {
|
|
155
|
-
status: httpStatus.BAD_REQUEST
|
|
156
|
-
});
|
|
157
42
|
}
|
|
158
43
|
};
|
|
159
44
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/routes/rest/buildFormState.ts"],"sourcesContent":["import type { BuildFormStateArgs } from '@payloadcms/ui/forms/buildStateFromSchema'\nimport type { DocumentPreferences, Field, PayloadRequest, TypeWithID } from 'payload/types'\n\nimport { buildStateFromSchema } from '@payloadcms/ui/forms/buildStateFromSchema'\nimport { reduceFieldsToValues } from '@payloadcms/ui/utilities/reduceFieldsToValues'\nimport httpStatus from 'http-status'\n\nimport type { FieldSchemaMap } from '../../utilities/buildFieldSchemaMap/types.js'\n\nimport { buildFieldSchemaMap } from '../../utilities/buildFieldSchemaMap/index.js'\n\nlet cached = global._payload_fieldSchemaMap\n\nif (!cached) {\n // eslint-disable-next-line no-multi-assign\n cached = global._payload_fieldSchemaMap = null\n}\n\nexport const getFieldSchemaMap = (req: PayloadRequest): FieldSchemaMap => {\n if (cached && process.env.NODE_ENV !== 'development') {\n return cached\n }\n\n cached = buildFieldSchemaMap(req)\n\n return cached\n}\n\nexport const buildFormState = async ({ req }: { req: PayloadRequest }) => {\n try {\n const reqData: BuildFormStateArgs = req.data as BuildFormStateArgs\n const { collectionSlug, formState, globalSlug, locale, operation, schemaPath } = reqData\n\n const incomingUserSlug = req.user?.collection\n const adminUserSlug = req.payload.config.admin.user\n\n // If we have a user slug, test it against the functions\n if (incomingUserSlug) {\n const adminAccessFunction = req.payload.collections[incomingUserSlug].config.access?.admin\n\n // Run the admin access function from the config if it exists\n if (adminAccessFunction) {\n const canAccessAdmin = await adminAccessFunction({ req })\n\n if (!canAccessAdmin) {\n return Response.json(null, {\n status: httpStatus.UNAUTHORIZED,\n })\n }\n // Match the user collection to the global admin config\n } else if (adminUserSlug !== incomingUserSlug) {\n return Response.json(null, {\n status: httpStatus.UNAUTHORIZED,\n })\n }\n } else {\n return Response.json(null, {\n status: httpStatus.UNAUTHORIZED,\n })\n }\n\n const fieldSchemaMap = getFieldSchemaMap(req)\n\n const id = collectionSlug ? reqData.id : undefined\n const schemaPathSegments = schemaPath.split('.')\n\n let fieldSchema: Field[]\n\n if (schemaPathSegments.length === 1) {\n if (req.payload.collections[schemaPath]) {\n fieldSchema = req.payload.collections[schemaPath].config.fields\n } else {\n fieldSchema = req.payload.config.globals.find(\n (global) => global.slug === schemaPath,\n )?.fields\n }\n } else if (fieldSchemaMap.has(schemaPath)) {\n fieldSchema = fieldSchemaMap.get(schemaPath)\n }\n\n if (!fieldSchema) {\n return Response.json(\n {\n message: 'Could not find field schema for given path',\n },\n {\n status: httpStatus.BAD_REQUEST,\n },\n )\n }\n\n let docPreferences = reqData.docPreferences\n let data = reqData.data\n\n const promises: {\n data?: Promise<void>\n preferences?: Promise<void>\n } = {}\n\n // If the request does not include doc preferences,\n // we should fetch them. This is useful for DocumentInfoProvider\n // as it reduces the amount of client-side fetches necessary\n // when we fetch data for the Edit view\n if (!docPreferences) {\n let preferencesKey\n\n if (collectionSlug && id) {\n preferencesKey = `collection-${collectionSlug}-${id}`\n }\n\n if (globalSlug) {\n preferencesKey = `global-${globalSlug}`\n }\n\n if (preferencesKey) {\n const fetchPreferences = async () => {\n const preferencesResult = (await req.payload.find({\n collection: 'payload-preferences',\n depth: 0,\n limit: 1,\n where: {\n key: {\n equals: preferencesKey,\n },\n },\n })) as unknown as { docs: { value: DocumentPreferences }[] }\n\n if (preferencesResult?.docs?.[0]?.value) docPreferences = preferencesResult.docs[0].value\n }\n\n promises.preferences = fetchPreferences()\n }\n }\n\n // If there is a form state,\n // then we can deduce data from that form state\n if (formState) data = reduceFieldsToValues(formState, true)\n\n // If we do not have data at this point,\n // we can fetch it. This is useful for DocumentInfoProvider\n // to reduce the amount of fetches required\n if (!data) {\n const fetchData = async () => {\n let resolvedData: TypeWithID\n\n if (collectionSlug && id) {\n resolvedData = await req.payload.findByID({\n id,\n collection: collectionSlug,\n depth: 0,\n draft: true,\n fallbackLocale: null,\n locale,\n overrideAccess: false,\n user: req.user,\n })\n }\n\n if (globalSlug && schemaPath === globalSlug) {\n resolvedData = await req.payload.findGlobal({\n slug: globalSlug,\n depth: 0,\n draft: true,\n fallbackLocale: null,\n locale,\n overrideAccess: false,\n user: req.user,\n })\n }\n\n data = resolvedData\n }\n\n promises.data = fetchData()\n }\n\n if (Object.keys(promises).length > 0) {\n await Promise.all(Object.values(promises))\n }\n\n const result = await buildStateFromSchema({\n id,\n data,\n fieldSchema,\n operation,\n preferences: docPreferences || { fields: {} },\n req,\n })\n\n return Response.json(result, {\n status: httpStatus.OK,\n })\n } catch (err) {\n return Response.json(\n {\n message: 'There was an error building form state',\n },\n {\n status: httpStatus.BAD_REQUEST,\n },\n )\n }\n}\n"],"names":["buildStateFromSchema","reduceFieldsToValues","httpStatus","buildFieldSchemaMap","cached","global","_payload_fieldSchemaMap","getFieldSchemaMap","req","process","env","NODE_ENV","buildFormState","reqData","data","collectionSlug","formState","globalSlug","locale","operation","schemaPath","incomingUserSlug","user","collection","adminUserSlug","payload","config","admin","adminAccessFunction","collections","access","canAccessAdmin","Response","json","status","UNAUTHORIZED","fieldSchemaMap","id","undefined","schemaPathSegments","split","fieldSchema","length","fields","globals","find","slug","has","get","message","BAD_REQUEST","docPreferences","promises","preferencesKey","fetchPreferences","preferencesResult","depth","limit","where","key","equals","docs","value","preferences","fetchData","resolvedData","findByID","draft","fallbackLocale","overrideAccess","findGlobal","Object","keys","Promise","all","values","result","OK","err"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,oBAAoB,QAAQ,4CAA2C;AAChF,SAASC,oBAAoB,QAAQ,gDAA+C;AACpF,OAAOC,gBAAgB,cAAa;AAIpC,SAASC,mBAAmB,QAAQ,+CAA8C;AAElF,IAAIC,SAASC,OAAOC,uBAAuB;AAE3C,IAAI,CAACF,QAAQ;IACX,2CAA2C;IAC3CA,SAASC,OAAOC,uBAAuB,GAAG;AAC5C;AAEA,OAAO,MAAMC,oBAAoB,CAACC;IAChC,IAAIJ,UAAUK,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;QACpD,OAAOP;IACT;IAEAA,SAASD,oBAAoBK;IAE7B,OAAOJ;AACT,EAAC;AAED,OAAO,MAAMQ,iBAAiB,OAAO,EAAEJ,GAAG,EAA2B;IACnE,IAAI;QACF,MAAMK,UAA8BL,IAAIM,IAAI;QAC5C,MAAM,EAAEC,cAAc,EAAEC,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAEC,SAAS,EAAEC,UAAU,EAAE,GAAGP;QAEjF,MAAMQ,mBAAmBb,IAAIc,IAAI,EAAEC;QACnC,MAAMC,gBAAgBhB,IAAIiB,OAAO,CAACC,MAAM,CAACC,KAAK,CAACL,IAAI;QAEnD,wDAAwD;QACxD,IAAID,kBAAkB;YACpB,MAAMO,sBAAsBpB,IAAIiB,OAAO,CAACI,WAAW,CAACR,iBAAiB,CAACK,MAAM,CAACI,MAAM,EAAEH;YAErF,6DAA6D;YAC7D,IAAIC,qBAAqB;gBACvB,MAAMG,iBAAiB,MAAMH,oBAAoB;oBAAEpB;gBAAI;gBAEvD,IAAI,CAACuB,gBAAgB;oBACnB,OAAOC,SAASC,IAAI,CAAC,MAAM;wBACzBC,QAAQhC,WAAWiC,YAAY;oBACjC;gBACF;YACA,uDAAuD;YACzD,OAAO,IAAIX,kBAAkBH,kBAAkB;gBAC7C,OAAOW,SAASC,IAAI,CAAC,MAAM;oBACzBC,QAAQhC,WAAWiC,YAAY;gBACjC;YACF;QACF,OAAO;YACL,OAAOH,SAASC,IAAI,CAAC,MAAM;gBACzBC,QAAQhC,WAAWiC,YAAY;YACjC;QACF;QAEA,MAAMC,iBAAiB7B,kBAAkBC;QAEzC,MAAM6B,KAAKtB,iBAAiBF,QAAQwB,EAAE,GAAGC;QACzC,MAAMC,qBAAqBnB,WAAWoB,KAAK,CAAC;QAE5C,IAAIC;QAEJ,IAAIF,mBAAmBG,MAAM,KAAK,GAAG;YACnC,IAAIlC,IAAIiB,OAAO,CAACI,WAAW,CAACT,WAAW,EAAE;gBACvCqB,cAAcjC,IAAIiB,OAAO,CAACI,WAAW,CAACT,WAAW,CAACM,MAAM,CAACiB,MAAM;YACjE,OAAO;gBACLF,cAAcjC,IAAIiB,OAAO,CAACC,MAAM,CAACkB,OAAO,CAACC,IAAI,CAC3C,CAACxC,UAAWA,QAAOyC,IAAI,KAAK1B,aAC3BuB;YACL;QACF,OAAO,IAAIP,eAAeW,GAAG,CAAC3B,aAAa;YACzCqB,cAAcL,eAAeY,GAAG,CAAC5B;QACnC;QAEA,IAAI,CAACqB,aAAa;YAChB,OAAOT,SAASC,IAAI,CAClB;gBACEgB,SAAS;YACX,GACA;gBACEf,QAAQhC,WAAWgD,WAAW;YAChC;QAEJ;QAEA,IAAIC,iBAAiBtC,QAAQsC,cAAc;QAC3C,IAAIrC,OAAOD,QAAQC,IAAI;QAEvB,MAAMsC,WAGF,CAAC;QAEL,mDAAmD;QACnD,gEAAgE;QAChE,4DAA4D;QAC5D,uCAAuC;QACvC,IAAI,CAACD,gBAAgB;YACnB,IAAIE;YAEJ,IAAItC,kBAAkBsB,IAAI;gBACxBgB,iBAAiB,CAAC,WAAW,EAAEtC,eAAe,CAAC,EAAEsB,GAAG,CAAC;YACvD;YAEA,IAAIpB,YAAY;gBACdoC,iBAAiB,CAAC,OAAO,EAAEpC,WAAW,CAAC;YACzC;YAEA,IAAIoC,gBAAgB;gBAClB,MAAMC,mBAAmB;oBACvB,MAAMC,oBAAqB,MAAM/C,IAAIiB,OAAO,CAACoB,IAAI,CAAC;wBAChDtB,YAAY;wBACZiC,OAAO;wBACPC,OAAO;wBACPC,OAAO;4BACLC,KAAK;gCACHC,QAAQP;4BACV;wBACF;oBACF;oBAEA,IAAIE,mBAAmBM,MAAM,CAAC,EAAE,EAAEC,OAAOX,iBAAiBI,kBAAkBM,IAAI,CAAC,EAAE,CAACC,KAAK;gBAC3F;gBAEAV,SAASW,WAAW,GAAGT;YACzB;QACF;QAEA,4BAA4B;QAC5B,+CAA+C;QAC/C,IAAItC,WAAWF,OAAOb,qBAAqBe,WAAW;QAEtD,wCAAwC;QACxC,2DAA2D;QAC3D,2CAA2C;QAC3C,IAAI,CAACF,MAAM;YACT,MAAMkD,YAAY;gBAChB,IAAIC;gBAEJ,IAAIlD,kBAAkBsB,IAAI;oBACxB4B,eAAe,MAAMzD,IAAIiB,OAAO,CAACyC,QAAQ,CAAC;wBACxC7B;wBACAd,YAAYR;wBACZyC,OAAO;wBACPW,OAAO;wBACPC,gBAAgB;wBAChBlD;wBACAmD,gBAAgB;wBAChB/C,MAAMd,IAAIc,IAAI;oBAChB;gBACF;gBAEA,IAAIL,cAAcG,eAAeH,YAAY;oBAC3CgD,eAAe,MAAMzD,IAAIiB,OAAO,CAAC6C,UAAU,CAAC;wBAC1CxB,MAAM7B;wBACNuC,OAAO;wBACPW,OAAO;wBACPC,gBAAgB;wBAChBlD;wBACAmD,gBAAgB;wBAChB/C,MAAMd,IAAIc,IAAI;oBAChB;gBACF;gBAEAR,OAAOmD;YACT;YAEAb,SAAStC,IAAI,GAAGkD;QAClB;QAEA,IAAIO,OAAOC,IAAI,CAACpB,UAAUV,MAAM,GAAG,GAAG;YACpC,MAAM+B,QAAQC,GAAG,CAACH,OAAOI,MAAM,CAACvB;QAClC;QAEA,MAAMwB,SAAS,MAAM5E,qBAAqB;YACxCqC;YACAvB;YACA2B;YACAtB;YACA4C,aAAaZ,kBAAkB;gBAAER,QAAQ,CAAC;YAAE;YAC5CnC;QACF;QAEA,OAAOwB,SAASC,IAAI,CAAC2C,QAAQ;YAC3B1C,QAAQhC,WAAW2E,EAAE;QACvB;IACF,EAAE,OAAOC,KAAK;QACZ,OAAO9C,SAASC,IAAI,CAClB;YACEgB,SAAS;QACX,GACA;YACEf,QAAQhC,WAAWgD,WAAW;QAChC;IAEJ;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/routes/rest/buildFormState.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\n\nimport { buildFormState as buildFormStateFn } from '@payloadcms/ui/utilities/buildFormState'\nimport httpStatus from 'http-status'\n\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { routeError } from './routeError.js'\n\nexport const buildFormState = async ({ req }: { req: PayloadRequest }) => {\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n try {\n const result = await buildFormStateFn({ req })\n\n return Response.json(result, {\n headers,\n status: httpStatus.OK,\n })\n } catch (err) {\n req.payload.logger.error({ err, msg: `There was an error building form state` })\n\n if (err.message === 'Could not find field schema for given path') {\n return Response.json(\n {\n message: err.message,\n },\n {\n headers,\n status: httpStatus.BAD_REQUEST,\n },\n )\n }\n\n if (err.message === 'Unauthorized') {\n return Response.json(null, {\n headers,\n status: httpStatus.UNAUTHORIZED,\n })\n }\n\n return routeError({\n config: req.payload.config,\n err,\n req,\n })\n }\n}\n"],"names":["buildFormState","buildFormStateFn","httpStatus","headersWithCors","routeError","req","headers","Headers","result","Response","json","status","OK","err","payload","logger","error","msg","message","BAD_REQUEST","UNAUTHORIZED","config"],"mappings":"AAEA,SAASA,kBAAkBC,gBAAgB,QAAQ,0CAAyC;AAC5F,OAAOC,gBAAgB,cAAa;AAEpC,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,UAAU,QAAQ,kBAAiB;AAE5C,OAAO,MAAMJ,iBAAiB,OAAO,EAAEK,GAAG,EAA2B;IACnE,MAAMC,UAAUH,gBAAgB;QAC9BG,SAAS,IAAIC;QACbF;IACF;IAEA,IAAI;QACF,MAAMG,SAAS,MAAMP,iBAAiB;YAAEI;QAAI;QAE5C,OAAOI,SAASC,IAAI,CAACF,QAAQ;YAC3BF;YACAK,QAAQT,WAAWU,EAAE;QACvB;IACF,EAAE,OAAOC,KAAK;QACZR,IAAIS,OAAO,CAACC,MAAM,CAACC,KAAK,CAAC;YAAEH;YAAKI,KAAK,CAAC,sCAAsC,CAAC;QAAC;QAE9E,IAAIJ,IAAIK,OAAO,KAAK,8CAA8C;YAChE,OAAOT,SAASC,IAAI,CAClB;gBACEQ,SAASL,IAAIK,OAAO;YACtB,GACA;gBACEZ;gBACAK,QAAQT,WAAWiB,WAAW;YAChC;QAEJ;QAEA,IAAIN,IAAIK,OAAO,KAAK,gBAAgB;YAClC,OAAOT,SAASC,IAAI,CAAC,MAAM;gBACzBJ;gBACAK,QAAQT,WAAWkB,YAAY;YACjC;QACF;QAEA,OAAOhB,WAAW;YAChBiB,QAAQhB,IAAIS,OAAO,CAACO,MAAM;YAC1BR;YACAR;QACF;IACF;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkEndpoints.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/checkEndpoints.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,4BAG9B;IACD,SAAS,EAAE,KAAK,GAAG,OAAO,EAAE,CAAA;IAC5B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"checkEndpoints.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/checkEndpoints.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,4BAG9B;IACD,SAAS,EAAE,KAAK,GAAG,OAAO,EAAE,CAAA;IAC5B,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;CAC1B,aAWA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/routes/rest/checkEndpoints.ts"],"sourcesContent":["import httpStatus from 'http-status'\n\nexport const endpointsAreDisabled = ({\n endpoints,\n request,\n}: {\n endpoints: false | unknown[]\n request: Partial<Request>\n}) => {\n if (!endpoints) {\n return Response.json(\n {\n message: `Cannot ${request.method.toUpperCase()} ${request.url}`,\n },\n {\n status: httpStatus.NOT_IMPLEMENTED,\n },\n )\n }\n}\n"],"names":["httpStatus","endpointsAreDisabled","endpoints","request","Response","json","message","method","toUpperCase","url","status","NOT_IMPLEMENTED"],"
|
|
1
|
+
{"version":3,"sources":["../../../src/routes/rest/checkEndpoints.ts"],"sourcesContent":["import httpStatus from 'http-status'\n\nexport const endpointsAreDisabled = ({\n endpoints,\n request,\n}: {\n endpoints: false | unknown[]\n request: Partial<Request>\n}) => {\n if (!endpoints) {\n return Response.json(\n {\n message: `Cannot ${request.method.toUpperCase()} ${request.url}`,\n },\n {\n status: httpStatus.NOT_IMPLEMENTED,\n },\n )\n }\n}\n"],"names":["httpStatus","endpointsAreDisabled","endpoints","request","Response","json","message","method","toUpperCase","url","status","NOT_IMPLEMENTED"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AAEpC,OAAO,MAAMC,uBAAuB,CAAC,EACnCC,SAAS,EACTC,OAAO,EAIR;IACC,IAAI,CAACD,WAAW;QACd,OAAOE,SAASC,IAAI,CAClB;YACEC,SAAS,CAAC,OAAO,EAAEH,QAAQI,MAAM,CAACC,WAAW,GAAG,CAAC,EAAEL,QAAQM,GAAG,CAAC,CAAC;QAClE,GACA;YACEC,QAAQV,WAAWW,eAAe;QACpC;IAEJ;AACF,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/count.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEzD,eAAO,MAAM,KAAK,EAAE,sBAcnB,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import httpStatus from 'http-status';
|
|
2
|
+
import { countOperation } from 'payload';
|
|
3
|
+
export const count = async ({ collection, req })=>{
|
|
4
|
+
const { where } = req.query;
|
|
5
|
+
const result = await countOperation({
|
|
6
|
+
collection,
|
|
7
|
+
req,
|
|
8
|
+
where
|
|
9
|
+
});
|
|
10
|
+
return Response.json(result, {
|
|
11
|
+
status: httpStatus.OK
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=count.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/count.ts"],"sourcesContent":["import type { Where } from 'payload'\n\nimport httpStatus from 'http-status'\nimport { countOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const count: CollectionRouteHandler = async ({ collection, req }) => {\n const { where } = req.query as {\n where?: Where\n }\n\n const result = await countOperation({\n collection,\n req,\n where,\n })\n\n return Response.json(result, {\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","countOperation","count","collection","req","where","query","result","Response","json","status","OK"],"mappings":"AAEA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,cAAc,QAAQ,UAAS;AAIxC,OAAO,MAAMC,QAAgC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACrE,MAAM,EAAEC,KAAK,EAAE,GAAGD,IAAIE,KAAK;IAI3B,MAAMC,SAAS,MAAMN,eAAe;QAClCE;QACAC;QACAC;IACF;IAEA,OAAOG,SAASC,IAAI,CAACF,QAAQ;QAC3BG,QAAQV,WAAWW,EAAE;IACvB;AACF,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/create.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/create.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,MAAM,EAAE,sBA8BpB,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getTranslation } from '@payloadcms/translations';
|
|
2
2
|
import httpStatus from 'http-status';
|
|
3
|
-
import { createOperation } from 'payload
|
|
4
|
-
import { isNumber } from 'payload/
|
|
3
|
+
import { createOperation } from 'payload';
|
|
4
|
+
import { isNumber } from 'payload/shared';
|
|
5
|
+
import { headersWithCors } from '../../../utilities/headersWithCors.js';
|
|
5
6
|
export const create = async ({ collection, req })=>{
|
|
6
7
|
const { searchParams } = req;
|
|
7
8
|
const autosave = searchParams.get('autosave') === 'true';
|
|
@@ -21,6 +22,10 @@ export const create = async ({ collection, req })=>{
|
|
|
21
22
|
label: getTranslation(collection.config.labels.singular, req.i18n)
|
|
22
23
|
})
|
|
23
24
|
}, {
|
|
25
|
+
headers: headersWithCors({
|
|
26
|
+
headers: new Headers(),
|
|
27
|
+
req
|
|
28
|
+
}),
|
|
24
29
|
status: httpStatus.CREATED
|
|
25
30
|
});
|
|
26
31
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/routes/rest/collections/create.ts"],"sourcesContent":["import { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { createOperation } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/create.ts"],"sourcesContent":["import { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { createOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const create: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams } = req\n const autosave = searchParams.get('autosave') === 'true'\n const draft = searchParams.get('draft') === 'true'\n const depth = searchParams.get('depth')\n\n const doc = await createOperation({\n autosave,\n collection,\n data: req.data,\n depth: isNumber(depth) ? depth : undefined,\n draft,\n req,\n })\n\n return Response.json(\n {\n doc,\n message: req.t('general:successfullyCreated', {\n label: getTranslation(collection.config.labels.singular, req.i18n),\n }),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.CREATED,\n },\n )\n}\n"],"names":["getTranslation","httpStatus","createOperation","isNumber","headersWithCors","create","collection","req","searchParams","autosave","get","draft","depth","doc","data","undefined","Response","json","message","t","label","config","labels","singular","i18n","headers","Headers","status","CREATED"],"mappings":"AAAA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,gBAAgB,cAAa;AACpC,SAASC,eAAe,QAAQ,UAAS;AACzC,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,SAAiC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACtE,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,WAAWD,aAAaE,GAAG,CAAC,gBAAgB;IAClD,MAAMC,QAAQH,aAAaE,GAAG,CAAC,aAAa;IAC5C,MAAME,QAAQJ,aAAaE,GAAG,CAAC;IAE/B,MAAMG,MAAM,MAAMX,gBAAgB;QAChCO;QACAH;QACAQ,MAAMP,IAAIO,IAAI;QACdF,OAAOT,SAASS,SAASA,QAAQG;QACjCJ;QACAJ;IACF;IAEA,OAAOS,SAASC,IAAI,CAClB;QACEJ;QACAK,SAASX,IAAIY,CAAC,CAAC,+BAA+B;YAC5CC,OAAOpB,eAAeM,WAAWe,MAAM,CAACC,MAAM,CAACC,QAAQ,EAAEhB,IAAIiB,IAAI;QACnE;IACF,GACA;QACEC,SAASrB,gBAAgB;YACvBqB,SAAS,IAAIC;YACbnB;QACF;QACAoB,QAAQ1B,WAAW2B,OAAO;IAC5B;AAEJ,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/delete.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/delete.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,SAAS,EAAE,sBAyDvB,CAAA"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { getTranslation } from '@payloadcms/translations';
|
|
2
2
|
import httpStatus from 'http-status';
|
|
3
|
-
import { deleteOperation } from 'payload
|
|
4
|
-
import { isNumber } from 'payload/
|
|
3
|
+
import { deleteOperation } from 'payload';
|
|
4
|
+
import { isNumber } from 'payload/shared';
|
|
5
|
+
import { headersWithCors } from '../../../utilities/headersWithCors.js';
|
|
5
6
|
export const deleteDoc = async ({ collection, req })=>{
|
|
6
7
|
const { depth, where } = req.query;
|
|
7
8
|
const result = await deleteOperation({
|
|
@@ -10,6 +11,10 @@ export const deleteDoc = async ({ collection, req })=>{
|
|
|
10
11
|
req,
|
|
11
12
|
where
|
|
12
13
|
});
|
|
14
|
+
const headers = headersWithCors({
|
|
15
|
+
headers: new Headers(),
|
|
16
|
+
req
|
|
17
|
+
});
|
|
13
18
|
if (result.errors.length === 0) {
|
|
14
19
|
const message = req.t('general:deletedCountSuccessfully', {
|
|
15
20
|
count: result.docs.length,
|
|
@@ -19,6 +24,7 @@ export const deleteDoc = async ({ collection, req })=>{
|
|
|
19
24
|
...result,
|
|
20
25
|
message
|
|
21
26
|
}, {
|
|
27
|
+
headers,
|
|
22
28
|
status: httpStatus.OK
|
|
23
29
|
});
|
|
24
30
|
}
|
|
@@ -32,6 +38,7 @@ export const deleteDoc = async ({ collection, req })=>{
|
|
|
32
38
|
...result,
|
|
33
39
|
message
|
|
34
40
|
}, {
|
|
41
|
+
headers,
|
|
35
42
|
status: httpStatus.BAD_REQUEST
|
|
36
43
|
});
|
|
37
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/routes/rest/collections/delete.ts"],"sourcesContent":["import type { Where } from 'payload
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/delete.ts"],"sourcesContent":["import type { Where } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { deleteOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const deleteDoc: CollectionRouteHandler = async ({ collection, req }) => {\n const { depth, where } = req.query as {\n depth?: string\n where?: Where\n }\n\n const result = await deleteOperation({\n collection,\n depth: isNumber(depth) ? Number(depth) : undefined,\n req,\n where,\n })\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n if (result.errors.length === 0) {\n const message = req.t('general:deletedCountSuccessfully', {\n count: result.docs.length,\n label: getTranslation(\n collection.config.labels[result.docs.length > 1 ? 'plural' : 'singular'],\n req.i18n,\n ),\n })\n\n return Response.json(\n {\n ...result,\n message,\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n }\n\n const total = result.docs.length + result.errors.length\n\n const message = req.t('error:unableToDeleteCount', {\n count: result.errors.length,\n label: getTranslation(collection.config.labels[total > 1 ? 'plural' : 'singular'], req.i18n),\n total,\n })\n\n return Response.json(\n {\n ...result,\n message,\n },\n {\n headers,\n status: httpStatus.BAD_REQUEST,\n },\n )\n}\n"],"names":["getTranslation","httpStatus","deleteOperation","isNumber","headersWithCors","deleteDoc","collection","req","depth","where","query","result","Number","undefined","headers","Headers","errors","length","message","t","count","docs","label","config","labels","i18n","Response","json","status","OK","total","BAD_REQUEST"],"mappings":"AAEA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,gBAAgB,cAAa;AACpC,SAASC,eAAe,QAAQ,UAAS;AACzC,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,YAAoC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACzE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF,IAAIG,KAAK;IAKlC,MAAMC,SAAS,MAAMT,gBAAgB;QACnCI;QACAE,OAAOL,SAASK,SAASI,OAAOJ,SAASK;QACzCN;QACAE;IACF;IAEA,MAAMK,UAAUV,gBAAgB;QAC9BU,SAAS,IAAIC;QACbR;IACF;IAEA,IAAII,OAAOK,MAAM,CAACC,MAAM,KAAK,GAAG;QAC9B,MAAMC,UAAUX,IAAIY,CAAC,CAAC,oCAAoC;YACxDC,OAAOT,OAAOU,IAAI,CAACJ,MAAM;YACzBK,OAAOtB,eACLM,WAAWiB,MAAM,CAACC,MAAM,CAACb,OAAOU,IAAI,CAACJ,MAAM,GAAG,IAAI,WAAW,WAAW,EACxEV,IAAIkB,IAAI;QAEZ;QAEA,OAAOC,SAASC,IAAI,CAClB;YACE,GAAGhB,MAAM;YACTO;QACF,GACA;YACEJ;YACAc,QAAQ3B,WAAW4B,EAAE;QACvB;IAEJ;IAEA,MAAMC,QAAQnB,OAAOU,IAAI,CAACJ,MAAM,GAAGN,OAAOK,MAAM,CAACC,MAAM;IAEvD,MAAMC,UAAUX,IAAIY,CAAC,CAAC,6BAA6B;QACjDC,OAAOT,OAAOK,MAAM,CAACC,MAAM;QAC3BK,OAAOtB,eAAeM,WAAWiB,MAAM,CAACC,MAAM,CAACM,QAAQ,IAAI,WAAW,WAAW,EAAEvB,IAAIkB,IAAI;QAC3FK;IACF;IAEA,OAAOJ,SAASC,IAAI,CAClB;QACE,GAAGhB,MAAM;QACTO;IACF,GACA;QACEJ;QACAc,QAAQ3B,WAAW8B,WAAW;IAChC;AAEJ,EAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteByID.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/deleteByID.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"deleteByID.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/deleteByID.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAK/D,eAAO,MAAM,UAAU,EAAE,4BAgDxB,CAAA"}
|