@payloadcms/next 3.0.0-alpha.41 → 3.0.0-alpha.42
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/bin/index.js +1 -1
- package/dist/bin/index.js.map +1 -0
- package/dist/bin/install.js +1 -1
- package/dist/bin/install.js.map +1 -0
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -0
- package/dist/elements/ClearRouteCache/index.js +1 -1
- package/dist/elements/ClearRouteCache/index.js.map +1 -0
- package/dist/elements/LeaveWithoutSaving/index.js +1 -2
- package/dist/elements/LeaveWithoutSaving/index.js.map +1 -0
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js +1 -1
- package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -0
- package/dist/exports/index.js +1 -1
- package/dist/exports/index.js.map +1 -0
- package/dist/graphql/registerSchema.js +1 -1
- package/dist/graphql/registerSchema.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -0
- package/dist/layouts/Admin/index.js +1 -2
- package/dist/layouts/Admin/index.js.map +1 -0
- package/dist/layouts/Root/index.d.ts.map +1 -1
- package/dist/layouts/Root/index.js +2 -4
- package/dist/layouts/Root/index.js.map +1 -0
- package/dist/next-fileupload/fileFactory.js +1 -1
- package/dist/next-fileupload/fileFactory.js.map +1 -0
- package/dist/next-fileupload/handlers.js +1 -1
- package/dist/next-fileupload/handlers.js.map +1 -0
- package/dist/next-fileupload/index.js +1 -1
- package/dist/next-fileupload/index.js.map +1 -0
- package/dist/next-fileupload/isEligibleRequest.js +1 -1
- package/dist/next-fileupload/isEligibleRequest.js.map +1 -0
- package/dist/next-fileupload/processMultipart.js +1 -1
- package/dist/next-fileupload/processMultipart.js.map +1 -0
- package/dist/next-fileupload/processNested.js +1 -1
- package/dist/next-fileupload/processNested.js.map +1 -0
- package/dist/next-fileupload/uploadTimer.js +1 -1
- package/dist/next-fileupload/uploadTimer.js.map +1 -0
- package/dist/next-fileupload/utilities.js +1 -1
- package/dist/next-fileupload/utilities.js.map +1 -0
- package/dist/next-stream-file/index.js +1 -1
- package/dist/next-stream-file/index.js.map +1 -0
- package/dist/prod/payload/SuisseIntl-Bold.woff +0 -0
- package/dist/prod/payload/SuisseIntl-Bold.woff2 +0 -0
- package/dist/prod/payload/SuisseIntl-Medium.woff +0 -0
- package/dist/prod/payload/SuisseIntl-Medium.woff2 +0 -0
- package/dist/prod/payload/SuisseIntl-SemiBold.woff +0 -0
- package/dist/prod/payload/SuisseIntl-SemiBold.woff2 +0 -0
- package/dist/prod/payload/SuisseIntl.woff +0 -0
- package/dist/prod/payload/SuisseIntl.woff2 +0 -0
- package/dist/prod/payload/favicon.svg +15 -0
- package/dist/prod/payload/merriweather-v30-latin-900.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-900.woff2 +0 -0
- package/dist/prod/payload/merriweather-v30-latin-900italic.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-900italic.woff2 +0 -0
- package/dist/prod/payload/merriweather-v30-latin-italic.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-italic.woff2 +0 -0
- package/dist/prod/payload/merriweather-v30-latin-regular.woff +0 -0
- package/dist/prod/payload/merriweather-v30-latin-regular.woff2 +0 -0
- package/dist/prod/payload/og-image.png +0 -0
- package/dist/prod/styles.css +1 -0
- package/dist/routes/graphql/handler.js +1 -1
- package/dist/routes/graphql/handler.js.map +1 -0
- package/dist/routes/graphql/index.js +1 -1
- package/dist/routes/graphql/index.js.map +1 -0
- package/dist/routes/graphql/playground.js +1 -1
- package/dist/routes/graphql/playground.js.map +1 -0
- package/dist/routes/index.js +1 -1
- package/dist/routes/index.js.map +1 -0
- package/dist/routes/rest/RouteError.js +1 -1
- package/dist/routes/rest/RouteError.js.map +1 -0
- package/dist/routes/rest/auth/access.js +1 -1
- package/dist/routes/rest/auth/access.js.map +1 -0
- package/dist/routes/rest/auth/forgotPassword.js +1 -1
- package/dist/routes/rest/auth/forgotPassword.js.map +1 -0
- package/dist/routes/rest/auth/init.js +1 -1
- package/dist/routes/rest/auth/init.js.map +1 -0
- package/dist/routes/rest/auth/login.js +1 -1
- package/dist/routes/rest/auth/login.js.map +1 -0
- package/dist/routes/rest/auth/logout.js +1 -1
- package/dist/routes/rest/auth/logout.js.map +1 -0
- package/dist/routes/rest/auth/me.js +1 -1
- package/dist/routes/rest/auth/me.js.map +1 -0
- package/dist/routes/rest/auth/refresh.js +1 -1
- package/dist/routes/rest/auth/refresh.js.map +1 -0
- package/dist/routes/rest/auth/registerFirstUser.js +1 -1
- package/dist/routes/rest/auth/registerFirstUser.js.map +1 -0
- package/dist/routes/rest/auth/resetPassword.js +1 -1
- package/dist/routes/rest/auth/resetPassword.js.map +1 -0
- package/dist/routes/rest/auth/unlock.js +1 -1
- package/dist/routes/rest/auth/unlock.js.map +1 -0
- package/dist/routes/rest/auth/verifyEmail.js +1 -1
- package/dist/routes/rest/auth/verifyEmail.js.map +1 -0
- package/dist/routes/rest/buildFormState.js +1 -1
- package/dist/routes/rest/buildFormState.js.map +1 -0
- package/dist/routes/rest/checkEndpoints.js +1 -1
- package/dist/routes/rest/checkEndpoints.js.map +1 -0
- package/dist/routes/rest/collections/create.js +1 -1
- package/dist/routes/rest/collections/create.js.map +1 -0
- package/dist/routes/rest/collections/delete.js +1 -1
- package/dist/routes/rest/collections/delete.js.map +1 -0
- package/dist/routes/rest/collections/deleteByID.js +1 -1
- package/dist/routes/rest/collections/deleteByID.js.map +1 -0
- package/dist/routes/rest/collections/docAccess.js +1 -1
- package/dist/routes/rest/collections/docAccess.js.map +1 -0
- package/dist/routes/rest/collections/find.js +1 -1
- package/dist/routes/rest/collections/find.js.map +1 -0
- package/dist/routes/rest/collections/findByID.js +1 -1
- package/dist/routes/rest/collections/findByID.js.map +1 -0
- package/dist/routes/rest/collections/findVersionByID.js +1 -1
- package/dist/routes/rest/collections/findVersionByID.js.map +1 -0
- package/dist/routes/rest/collections/findVersions.js +1 -1
- package/dist/routes/rest/collections/findVersions.js.map +1 -0
- package/dist/routes/rest/collections/restoreVersion.js +1 -1
- package/dist/routes/rest/collections/restoreVersion.js.map +1 -0
- package/dist/routes/rest/collections/update.js +1 -1
- package/dist/routes/rest/collections/update.js.map +1 -0
- package/dist/routes/rest/collections/updateByID.js +1 -1
- package/dist/routes/rest/collections/updateByID.js.map +1 -0
- package/dist/routes/rest/files/checkFileAccess.js +1 -1
- package/dist/routes/rest/files/checkFileAccess.js.map +1 -0
- package/dist/routes/rest/files/getFile.js +1 -1
- package/dist/routes/rest/files/getFile.js.map +1 -0
- package/dist/routes/rest/globals/docAccess.js +1 -1
- package/dist/routes/rest/globals/docAccess.js.map +1 -0
- package/dist/routes/rest/globals/findOne.js +1 -1
- package/dist/routes/rest/globals/findOne.js.map +1 -0
- package/dist/routes/rest/globals/findVersionByID.js +1 -1
- package/dist/routes/rest/globals/findVersionByID.js.map +1 -0
- package/dist/routes/rest/globals/findVersions.js +1 -1
- package/dist/routes/rest/globals/findVersions.js.map +1 -0
- package/dist/routes/rest/globals/restoreVersion.js +1 -1
- package/dist/routes/rest/globals/restoreVersion.js.map +1 -0
- package/dist/routes/rest/globals/update.js +1 -1
- package/dist/routes/rest/globals/update.js.map +1 -0
- package/dist/routes/rest/index.js +1 -1
- package/dist/routes/rest/index.js.map +1 -0
- package/dist/routes/rest/types.js +1 -1
- package/dist/routes/rest/types.js.map +1 -0
- package/dist/scss/app.scss +2 -2
- package/dist/utilities/auth.js +1 -1
- package/dist/utilities/auth.js.map +1 -0
- package/dist/utilities/createPayloadRequest.js +1 -1
- package/dist/utilities/createPayloadRequest.js.map +1 -0
- package/dist/utilities/getDataAndFile.js +1 -1
- package/dist/utilities/getDataAndFile.js.map +1 -0
- package/dist/utilities/getNextI18n.js +1 -1
- package/dist/utilities/getNextI18n.js.map +1 -0
- package/dist/utilities/getNextT.js +1 -1
- package/dist/utilities/getNextT.js.map +1 -0
- package/dist/utilities/getPayload.d.ts.map +1 -1
- package/dist/utilities/getPayload.js +6 -2
- package/dist/utilities/getPayload.js.map +1 -0
- package/dist/utilities/getRequestLanguage.js +1 -1
- package/dist/utilities/getRequestLanguage.js.map +1 -0
- package/dist/utilities/getRequestLocales.js +1 -1
- package/dist/utilities/getRequestLocales.js.map +1 -0
- package/dist/utilities/initPage.js +1 -1
- package/dist/utilities/initPage.js.map +1 -0
- package/dist/utilities/meta.js +1 -1
- package/dist/utilities/meta.js.map +1 -0
- package/dist/utilities/timestamp.js +1 -1
- package/dist/utilities/timestamp.js.map +1 -0
- package/dist/views/API/RenderJSON/index.js +1 -2
- package/dist/views/API/RenderJSON/index.js.map +1 -0
- package/dist/views/API/index.client.js +1 -2
- package/dist/views/API/index.client.js.map +1 -0
- package/dist/views/API/index.js +1 -1
- package/dist/views/API/index.js.map +1 -0
- package/dist/views/API/meta.js +1 -1
- package/dist/views/API/meta.js.map +1 -0
- package/dist/views/Account/Settings/index.js +1 -2
- package/dist/views/Account/Settings/index.js.map +1 -0
- package/dist/views/Account/ToggleTheme/index.js +1 -1
- package/dist/views/Account/ToggleTheme/index.js.map +1 -0
- package/dist/views/Account/index.js +1 -1
- package/dist/views/Account/index.js.map +1 -0
- package/dist/views/Account/meta.js +1 -1
- package/dist/views/Account/meta.js.map +1 -0
- package/dist/views/CreateFirstUser/index.client.js +1 -1
- package/dist/views/CreateFirstUser/index.client.js.map +1 -0
- package/dist/views/CreateFirstUser/index.js +1 -2
- package/dist/views/CreateFirstUser/index.js.map +1 -0
- package/dist/views/CreateFirstUser/meta.js +1 -1
- package/dist/views/CreateFirstUser/meta.js.map +1 -0
- package/dist/views/Dashboard/Default/index.client.js +1 -2
- package/dist/views/Dashboard/Default/index.client.js.map +1 -0
- package/dist/views/Dashboard/Default/index.js +1 -2
- package/dist/views/Dashboard/Default/index.js.map +1 -0
- package/dist/views/Dashboard/index.js +1 -1
- package/dist/views/Dashboard/index.js.map +1 -0
- package/dist/views/Dashboard/meta.js +1 -1
- package/dist/views/Dashboard/meta.js.map +1 -0
- package/dist/views/Document/getCustomViewByKey.js +1 -1
- package/dist/views/Document/getCustomViewByKey.js.map +1 -0
- package/dist/views/Document/getCustomViewByPath.js +1 -1
- package/dist/views/Document/getCustomViewByPath.js.map +1 -0
- package/dist/views/Document/getMetaBySegment.js +1 -1
- package/dist/views/Document/getMetaBySegment.js.map +1 -0
- package/dist/views/Document/getViewsFromConfig.js +1 -1
- package/dist/views/Document/getViewsFromConfig.js.map +1 -0
- package/dist/views/Document/index.js +1 -1
- package/dist/views/Document/index.js.map +1 -0
- package/dist/views/Document/meta.js +1 -1
- package/dist/views/Document/meta.js.map +1 -0
- package/dist/views/Edit/Default/Auth/APIKey.js +1 -1
- package/dist/views/Edit/Default/Auth/APIKey.js.map +1 -0
- package/dist/views/Edit/Default/Auth/index.js +1 -2
- package/dist/views/Edit/Default/Auth/index.js.map +1 -0
- package/dist/views/Edit/Default/Auth/types.js +1 -1
- package/dist/views/Edit/Default/Auth/types.js.map +1 -0
- package/dist/views/Edit/Default/SetDocumentTitle/formatTitle.js +1 -1
- package/dist/views/Edit/Default/SetDocumentTitle/formatTitle.js.map +1 -0
- package/dist/views/Edit/Default/SetDocumentTitle/index.js +1 -1
- package/dist/views/Edit/Default/SetDocumentTitle/index.js.map +1 -0
- package/dist/views/Edit/Default/SetStepNav/index.js +1 -1
- package/dist/views/Edit/Default/SetStepNav/index.js.map +1 -0
- package/dist/views/Edit/Default/index.js +1 -2
- package/dist/views/Edit/Default/index.js.map +1 -0
- package/dist/views/Edit/Default/types.js +1 -1
- package/dist/views/Edit/Default/types.js.map +1 -0
- package/dist/views/Edit/index.client.js +1 -1
- package/dist/views/Edit/index.client.js.map +1 -0
- package/dist/views/Edit/index.js +1 -1
- package/dist/views/Edit/index.js.map +1 -0
- package/dist/views/Edit/meta.js +1 -1
- package/dist/views/Edit/meta.js.map +1 -0
- package/dist/views/Edit/sanitizeEditViewProps.js +1 -1
- package/dist/views/Edit/sanitizeEditViewProps.js.map +1 -0
- package/dist/views/ForgotPassword/index.js +1 -1
- package/dist/views/ForgotPassword/index.js.map +1 -0
- package/dist/views/ForgotPassword/meta.js +1 -1
- package/dist/views/ForgotPassword/meta.js.map +1 -0
- package/dist/views/List/Default/Cell/cellTypes.spec.js +1 -1
- package/dist/views/List/Default/Cell/cellTypes.spec.js.map +1 -0
- package/dist/views/List/Default/Cell/fields/Array/index.js +1 -1
- package/dist/views/List/Default/Cell/fields/Array/index.js.map +1 -0
- package/dist/views/List/Default/Cell/fields/Blocks/index.js +1 -1
- package/dist/views/List/Default/Cell/fields/Blocks/index.js.map +1 -0
- package/dist/views/List/Default/Cell/fields/Checkbox/index.js +1 -2
- package/dist/views/List/Default/Cell/fields/Checkbox/index.js.map +1 -0
- package/dist/views/List/Default/Cell/fields/Code/index.js +1 -2
- package/dist/views/List/Default/Cell/fields/Code/index.js.map +1 -0
- package/dist/views/List/Default/Cell/fields/Date/index.js +1 -1
- package/dist/views/List/Default/Cell/fields/Date/index.js.map +1 -0
- package/dist/views/List/Default/Cell/fields/File/index.js +1 -2
- package/dist/views/List/Default/Cell/fields/File/index.js.map +1 -0
- package/dist/views/List/Default/Cell/fields/JSON/index.js +1 -2
- package/dist/views/List/Default/Cell/fields/JSON/index.js.map +1 -0
- package/dist/views/List/Default/Cell/fields/Relationship/index.js +1 -2
- package/dist/views/List/Default/Cell/fields/Relationship/index.js.map +1 -0
- package/dist/views/List/Default/Cell/fields/Select/index.js +1 -1
- package/dist/views/List/Default/Cell/fields/Select/index.js.map +1 -0
- package/dist/views/List/Default/Cell/fields/Textarea/index.js +1 -1
- package/dist/views/List/Default/Cell/fields/Textarea/index.js.map +1 -0
- package/dist/views/List/Default/Cell/fields/index.js +1 -1
- package/dist/views/List/Default/Cell/fields/index.js.map +1 -0
- package/dist/views/List/Default/Cell/index.js +1 -1
- package/dist/views/List/Default/Cell/index.js.map +1 -0
- package/dist/views/List/Default/RelationshipProvider/index.js +1 -1
- package/dist/views/List/Default/RelationshipProvider/index.js.map +1 -0
- package/dist/views/List/Default/RelationshipProvider/reducer.js +1 -1
- package/dist/views/List/Default/RelationshipProvider/reducer.js.map +1 -0
- package/dist/views/List/Default/index.js +1 -2
- package/dist/views/List/Default/index.js.map +1 -0
- package/dist/views/List/Default/types.js +1 -1
- package/dist/views/List/Default/types.js.map +1 -0
- package/dist/views/List/index.js +1 -1
- package/dist/views/List/index.js.map +1 -0
- package/dist/views/List/meta.js +1 -1
- package/dist/views/List/meta.js.map +1 -0
- package/dist/views/LivePreview/Context/collisionDetection.js +1 -1
- package/dist/views/LivePreview/Context/collisionDetection.js.map +1 -0
- package/dist/views/LivePreview/Context/context.js +1 -1
- package/dist/views/LivePreview/Context/context.js.map +1 -0
- package/dist/views/LivePreview/Context/index.js +1 -1
- package/dist/views/LivePreview/Context/index.js.map +1 -0
- package/dist/views/LivePreview/Context/sizeReducer.js +1 -1
- package/dist/views/LivePreview/Context/sizeReducer.js.map +1 -0
- package/dist/views/LivePreview/Device/index.js +1 -1
- package/dist/views/LivePreview/Device/index.js.map +1 -0
- package/dist/views/LivePreview/DeviceContainer/index.js +1 -1
- package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -0
- package/dist/views/LivePreview/IFrame/index.js +1 -2
- package/dist/views/LivePreview/IFrame/index.js.map +1 -0
- package/dist/views/LivePreview/Preview/index.js +1 -2
- package/dist/views/LivePreview/Preview/index.js.map +1 -0
- package/dist/views/LivePreview/Toolbar/Controls/index.js +1 -2
- package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -0
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js +1 -2
- package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -0
- package/dist/views/LivePreview/Toolbar/index.js +1 -2
- package/dist/views/LivePreview/Toolbar/index.js.map +1 -0
- package/dist/views/LivePreview/ToolbarArea/index.js +1 -2
- package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -0
- package/dist/views/LivePreview/index.client.js +1 -2
- package/dist/views/LivePreview/index.client.js.map +1 -0
- package/dist/views/LivePreview/index.js +1 -2
- package/dist/views/LivePreview/index.js.map +1 -0
- package/dist/views/LivePreview/meta.js +1 -1
- package/dist/views/LivePreview/meta.js.map +1 -0
- package/dist/views/LivePreview/usePopupWindow.js +1 -1
- package/dist/views/LivePreview/usePopupWindow.js.map +1 -0
- package/dist/views/Login/LoginForm/index.js +1 -2
- package/dist/views/Login/LoginForm/index.js.map +1 -0
- package/dist/views/Login/index.js +1 -2
- package/dist/views/Login/index.js.map +1 -0
- package/dist/views/Login/meta.js +1 -1
- package/dist/views/Login/meta.js.map +1 -0
- package/dist/views/Logout/LogoutClient.js +1 -1
- package/dist/views/Logout/LogoutClient.js.map +1 -0
- package/dist/views/Logout/index.js +1 -2
- package/dist/views/Logout/index.js.map +1 -0
- package/dist/views/Logout/meta.js +1 -1
- package/dist/views/Logout/meta.js.map +1 -0
- package/dist/views/NotFound/index.client.js +1 -2
- package/dist/views/NotFound/index.client.js.map +1 -0
- package/dist/views/NotFound/index.js +1 -1
- package/dist/views/NotFound/index.js.map +1 -0
- package/dist/views/NotFound/meta.js +1 -1
- package/dist/views/NotFound/meta.js.map +1 -0
- package/dist/views/ResetPassword/index.js +1 -2
- package/dist/views/ResetPassword/index.js.map +1 -0
- package/dist/views/ResetPassword/meta.js +1 -1
- package/dist/views/ResetPassword/meta.js.map +1 -0
- package/dist/views/Root/index.js +1 -1
- package/dist/views/Root/index.js.map +1 -0
- package/dist/views/Root/meta.js +1 -1
- package/dist/views/Root/meta.js.map +1 -0
- package/dist/views/Unauthorized/UnauthorizedClient.js +1 -1
- package/dist/views/Unauthorized/UnauthorizedClient.js.map +1 -0
- package/dist/views/Unauthorized/index.js +1 -1
- package/dist/views/Unauthorized/index.js.map +1 -0
- package/dist/views/Unauthorized/meta.js +1 -1
- package/dist/views/Unauthorized/meta.js.map +1 -0
- package/dist/views/Verify/index.js +1 -2
- package/dist/views/Verify/index.js.map +1 -0
- package/dist/views/Verify/meta.js +1 -1
- package/dist/views/Verify/meta.js.map +1 -0
- package/dist/views/Version/Default/SetStepNav.js +1 -1
- package/dist/views/Version/Default/SetStepNav.js.map +1 -0
- package/dist/views/Version/Default/index.js +1 -2
- package/dist/views/Version/Default/index.js.map +1 -0
- package/dist/views/Version/Default/types.js +1 -1
- package/dist/views/Version/Default/types.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/Label/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/styles.js +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/styles.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js +1 -1
- package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/index.js +1 -2
- package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -0
- package/dist/views/Version/RenderFieldsToDiff/types.js +1 -1
- package/dist/views/Version/RenderFieldsToDiff/types.js.map +1 -0
- package/dist/views/Version/Restore/index.js +1 -3
- package/dist/views/Version/Restore/index.js.map +1 -0
- package/dist/views/Version/Restore/types.js +1 -1
- package/dist/views/Version/Restore/types.js.map +1 -0
- package/dist/views/Version/SelectComparison/index.js +1 -2
- package/dist/views/Version/SelectComparison/index.js.map +1 -0
- package/dist/views/Version/SelectComparison/types.js +1 -1
- package/dist/views/Version/SelectComparison/types.js.map +1 -0
- package/dist/views/Version/SelectLocales/index.js +1 -2
- package/dist/views/Version/SelectLocales/index.js.map +1 -0
- package/dist/views/Version/SelectLocales/types.js +1 -1
- package/dist/views/Version/SelectLocales/types.js.map +1 -0
- package/dist/views/Version/index.js +1 -1
- package/dist/views/Version/index.js.map +1 -0
- package/dist/views/Version/meta.js +1 -1
- package/dist/views/Version/meta.js.map +1 -0
- package/dist/views/Version/shared.js +1 -1
- package/dist/views/Version/shared.js.map +1 -0
- package/dist/views/Versions/buildColumns.js +1 -1
- package/dist/views/Versions/buildColumns.js.map +1 -0
- package/dist/views/Versions/cells/AutosaveCell/index.js +1 -1
- package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -0
- package/dist/views/Versions/cells/CreatedAt/index.js +1 -1
- package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -0
- package/dist/views/Versions/cells/ID/index.js +1 -1
- package/dist/views/Versions/cells/ID/index.js.map +1 -0
- package/dist/views/Versions/index.client.js +1 -1
- package/dist/views/Versions/index.client.js.map +1 -0
- package/dist/views/Versions/index.js +1 -2
- package/dist/views/Versions/index.js.map +1 -0
- package/dist/views/Versions/meta.js +1 -1
- package/dist/views/Versions/meta.js.map +1 -0
- package/dist/views/Versions/types.js +1 -1
- package/dist/views/Versions/types.js.map +1 -0
- package/dist/withPayload.js +1 -1
- package/dist/withPayload.js.map +1 -0
- package/package.json +24 -7
package/dist/routes/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { GRAPHQL_PLAYGROUND_GET, GRAPHQL_POST } from './graphql/index.js';
|
|
2
2
|
export { DELETE as REST_DELETE, GET as REST_GET, PATCH as REST_PATCH, POST as REST_POST } from './rest/index.js';
|
|
3
3
|
|
|
4
|
-
//# sourceMappingURL=
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/routes/index.ts"],"sourcesContent":["export { GRAPHQL_PLAYGROUND_GET, GRAPHQL_POST } from './graphql/index.js'\n\nexport {\n DELETE as REST_DELETE,\n GET as REST_GET,\n PATCH as REST_PATCH,\n POST as REST_POST,\n} from './rest/index.js'\n"],"names":["GRAPHQL_PLAYGROUND_GET","GRAPHQL_POST","DELETE","REST_DELETE","GET","REST_GET","PATCH","REST_PATCH","POST","REST_POST"],"mappings":"AAAA,SAASA,sBAAsB,EAAEC,YAAY,QAAQ,qBAAoB;AAEzE,SACEC,UAAUC,WAAW,EACrBC,OAAOC,QAAQ,EACfC,SAASC,UAAU,EACnBC,QAAQC,SAAS,QACZ,kBAAiB"}
|
|
@@ -86,4 +86,4 @@ export const RouteError = async ({ collection, err, req })=>{
|
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
//# sourceMappingURL=
|
|
89
|
+
//# sourceMappingURL=RouteError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/routes/rest/RouteError.ts"],"sourcesContent":["import type { Collection, PayloadRequest } from 'payload/types'\n\nimport httpStatus from 'http-status'\nimport { APIError } from 'payload/errors'\n\nexport type ErrorResponse = { data?: any; errors: unknown[]; stack?: string }\n\nconst formatErrors = (incoming: { [key: string]: unknown } | APIError | Error): ErrorResponse => {\n if (incoming) {\n if (incoming instanceof APIError && incoming.data) {\n return {\n errors: [\n {\n name: incoming.name,\n data: incoming.data,\n message: incoming.message,\n },\n ],\n }\n }\n\n // mongoose\n if (!(incoming instanceof APIError || incoming instanceof Error) && incoming.errors) {\n return {\n errors: Object.keys(incoming.errors).reduce((acc, key) => {\n acc.push({\n field: incoming.errors[key].path,\n message: incoming.errors[key].message,\n })\n return acc\n }, []),\n }\n }\n\n if (Array.isArray(incoming.message)) {\n return {\n errors: incoming.message,\n }\n }\n\n if (incoming.name) {\n return {\n errors: [\n {\n message: incoming.message,\n },\n ],\n }\n }\n }\n\n return {\n errors: [\n {\n message: 'An unknown error occurred.',\n },\n ],\n }\n}\n\nexport const RouteError = async ({\n collection,\n err,\n req,\n}: {\n collection?: Collection\n err: APIError\n req: PayloadRequest\n}) => {\n if (!req?.payload) {\n return Response.json(\n {\n message: err.message,\n stack: err.stack,\n },\n { status: httpStatus.INTERNAL_SERVER_ERROR },\n )\n }\n\n const { config, logger } = req.payload\n let response = formatErrors(err)\n let status = err.status || httpStatus.INTERNAL_SERVER_ERROR\n\n logger.error(err.stack)\n\n // Internal server errors can contain anything, including potentially sensitive data.\n // Therefore, error details will be hidden from the response unless `config.debug` is `true`\n if (!config.debug && status === httpStatus.INTERNAL_SERVER_ERROR) {\n response = formatErrors(new APIError('Something went wrong.'))\n }\n\n if (config.debug && config.debug === true) {\n response.stack = err.stack\n }\n\n if (collection && typeof collection.config.hooks.afterError === 'function') {\n ;({ response, status } = (await collection.config.hooks.afterError(\n err,\n response,\n req.context,\n collection.config,\n )) || { response, status })\n }\n\n if (typeof config.hooks.afterError === 'function') {\n ;({ response, status } = (await config.hooks.afterError(\n err,\n response,\n req.context,\n collection?.config,\n )) || {\n response,\n status,\n })\n }\n\n return Response.json(response, { status })\n}\n"],"names":["httpStatus","APIError","formatErrors","incoming","data","errors","name","message","Error","Object","keys","reduce","acc","key","push","field","path","Array","isArray","RouteError","collection","err","req","payload","Response","json","stack","status","INTERNAL_SERVER_ERROR","config","logger","response","error","debug","hooks","afterError","context"],"mappings":"AAEA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,MAAMC,eAAe,CAACC;IACpB,IAAIA,UAAU;QACZ,IAAIA,oBAAoBF,YAAYE,SAASC,IAAI,EAAE;YACjD,OAAO;gBACLC,QAAQ;oBACN;wBACEC,MAAMH,SAASG,IAAI;wBACnBF,MAAMD,SAASC,IAAI;wBACnBG,SAASJ,SAASI,OAAO;oBAC3B;iBACD;YACH;QACF;QAEA,WAAW;QACX,IAAI,CAAEJ,CAAAA,oBAAoBF,YAAYE,oBAAoBK,KAAI,KAAML,SAASE,MAAM,EAAE;YACnF,OAAO;gBACLA,QAAQI,OAAOC,IAAI,CAACP,SAASE,MAAM,EAAEM,MAAM,CAAC,CAACC,KAAKC;oBAChDD,IAAIE,IAAI,CAAC;wBACPC,OAAOZ,SAASE,MAAM,CAACQ,IAAI,CAACG,IAAI;wBAChCT,SAASJ,SAASE,MAAM,CAACQ,IAAI,CAACN,OAAO;oBACvC;oBACA,OAAOK;gBACT,GAAG,EAAE;YACP;QACF;QAEA,IAAIK,MAAMC,OAAO,CAACf,SAASI,OAAO,GAAG;YACnC,OAAO;gBACLF,QAAQF,SAASI,OAAO;YAC1B;QACF;QAEA,IAAIJ,SAASG,IAAI,EAAE;YACjB,OAAO;gBACLD,QAAQ;oBACN;wBACEE,SAASJ,SAASI,OAAO;oBAC3B;iBACD;YACH;QACF;IACF;IAEA,OAAO;QACLF,QAAQ;YACN;gBACEE,SAAS;YACX;SACD;IACH;AACF;AAEA,OAAO,MAAMY,aAAa,OAAO,EAC/BC,UAAU,EACVC,GAAG,EACHC,GAAG,EAKJ;IACC,IAAI,CAACA,KAAKC,SAAS;QACjB,OAAOC,SAASC,IAAI,CAClB;YACElB,SAASc,IAAId,OAAO;YACpBmB,OAAOL,IAAIK,KAAK;QAClB,GACA;YAAEC,QAAQ3B,WAAW4B,qBAAqB;QAAC;IAE/C;IAEA,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAE,GAAGR,IAAIC,OAAO;IACtC,IAAIQ,WAAW7B,aAAamB;IAC5B,IAAIM,SAASN,IAAIM,MAAM,IAAI3B,WAAW4B,qBAAqB;IAE3DE,OAAOE,KAAK,CAACX,IAAIK,KAAK;IAEtB,qFAAqF;IACrF,4FAA4F;IAC5F,IAAI,CAACG,OAAOI,KAAK,IAAIN,WAAW3B,WAAW4B,qBAAqB,EAAE;QAChEG,WAAW7B,aAAa,IAAID,SAAS;IACvC;IAEA,IAAI4B,OAAOI,KAAK,IAAIJ,OAAOI,KAAK,KAAK,MAAM;QACzCF,SAASL,KAAK,GAAGL,IAAIK,KAAK;IAC5B;IAEA,IAAIN,cAAc,OAAOA,WAAWS,MAAM,CAACK,KAAK,CAACC,UAAU,KAAK,YAAY;QACxE,CAAA,EAAEJ,QAAQ,EAAEJ,MAAM,EAAE,GAAG,AAAC,MAAMP,WAAWS,MAAM,CAACK,KAAK,CAACC,UAAU,CAChEd,KACAU,UACAT,IAAIc,OAAO,EACXhB,WAAWS,MAAM,KACb;YAAEE;YAAUJ;QAAO,CAAA;IAC3B;IAEA,IAAI,OAAOE,OAAOK,KAAK,CAACC,UAAU,KAAK,YAAY;QAC/C,CAAA,EAAEJ,QAAQ,EAAEJ,MAAM,EAAE,GAAG,AAAC,MAAME,OAAOK,KAAK,CAACC,UAAU,CACrDd,KACAU,UACAT,IAAIc,OAAO,EACXhB,YAAYS,WACR;YACJE;YACAJ;QACF,CAAA;IACF;IAEA,OAAOH,SAASC,IAAI,CAACM,UAAU;QAAEJ;IAAO;AAC1C,EAAC"}
|
|
@@ -9,4 +9,4 @@ export const access = async ({ req })=>{
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=access.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/access.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { accessOperation } from 'payload/operations'\n\nimport type { BaseRouteHandler } from '../types.js'\n\nexport const access: BaseRouteHandler = async ({ req }) => {\n const results = await accessOperation({\n req,\n })\n\n return Response.json(results, {\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","accessOperation","access","req","results","Response","json","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,eAAe,QAAQ,qBAAoB;AAIpD,OAAO,MAAMC,SAA2B,OAAO,EAAEC,GAAG,EAAE;IACpD,MAAMC,UAAU,MAAMH,gBAAgB;QACpCE;IACF;IAEA,OAAOE,SAASC,IAAI,CAACF,SAAS;QAC5BG,QAAQP,WAAWQ,EAAE;IACvB;AACF,EAAC"}
|
|
@@ -18,4 +18,4 @@ export const forgotPassword = async ({ collection, req })=>{
|
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=forgotPassword.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/forgotPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { forgotPasswordOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const forgotPassword: CollectionRouteHandler = async ({ collection, req }) => {\n await forgotPasswordOperation({\n collection,\n data: {\n email: req.data.email as string,\n },\n disableEmail: Boolean(req.data?.disableEmail),\n expiration: typeof req.data.expiration === 'number' ? req.data.expiration : undefined,\n req,\n })\n\n return Response.json(\n {\n // TODO(translate)\n message: 'Success',\n },\n {\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","forgotPasswordOperation","forgotPassword","collection","req","data","email","disableEmail","Boolean","expiration","undefined","Response","json","message","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,uBAAuB,QAAQ,qBAAoB;AAI5D,OAAO,MAAMC,iBAAyC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IAC9E,MAAMH,wBAAwB;QAC5BE;QACAE,MAAM;YACJC,OAAOF,IAAIC,IAAI,CAACC,KAAK;QACvB;QACAC,cAAcC,QAAQJ,IAAIC,IAAI,EAAEE;QAChCE,YAAY,OAAOL,IAAIC,IAAI,CAACI,UAAU,KAAK,WAAWL,IAAIC,IAAI,CAACI,UAAU,GAAGC;QAC5EN;IACF;IAEA,OAAOO,SAASC,IAAI,CAClB;QACE,kBAAkB;QAClBC,SAAS;IACX,GACA;QACEC,QAAQd,WAAWe,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -9,4 +9,4 @@ export const init = async ({ collection, req })=>{
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/init.ts"],"sourcesContent":["import { initOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const init: CollectionRouteHandler = async ({ collection, req }) => {\n const initialized = await initOperation({\n collection: collection.config.slug,\n req,\n })\n\n return Response.json({ initialized })\n}\n"],"names":["initOperation","init","collection","req","initialized","config","slug","Response","json"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAoB;AAIlD,OAAO,MAAMC,OAA+B,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACpE,MAAMC,cAAc,MAAMJ,cAAc;QACtCE,YAAYA,WAAWG,MAAM,CAACC,IAAI;QAClCH;IACF;IAEA,OAAOI,SAASC,IAAI,CAAC;QAAEJ;IAAY;AACrC,EAAC"}
|
|
@@ -34,4 +34,4 @@ export const login = async ({ collection, req })=>{
|
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
//# sourceMappingURL=
|
|
37
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/login.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie } from 'payload/auth'\nimport { loginOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const login: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const result = await loginOperation({\n collection,\n data: {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n },\n depth: isNumber(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 // TODO(translate)\n message: 'Auth Passed',\n ...result,\n },\n {\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","generatePayloadCookie","loginOperation","isNumber","login","collection","req","searchParams","depth","get","result","data","email","password","Number","undefined","cookie","collectionConfig","config","payload","token","auth","removeTokenFromResponses","Response","json","message","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,qBAAqB,QAAQ,eAAc;AACpD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,OAAO,MAAMC,QAAgC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACrE,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMC,SAAS,MAAMR,eAAe;QAClCG;QACAM,MAAM;YACJC,OAAO,OAAON,IAAIK,IAAI,EAAEC,UAAU,WAAWN,IAAIK,IAAI,CAACC,KAAK,GAAG;YAC9DC,UAAU,OAAOP,IAAIK,IAAI,EAAEE,aAAa,WAAWP,IAAIK,IAAI,CAACE,QAAQ,GAAG;QACzE;QACAL,OAAOL,SAASK,SAASM,OAAON,SAASO;QACzCT;IACF;IAEA,MAAMU,SAASf,sBAAsB;QACnCgB,kBAAkBZ,WAAWa,MAAM;QACnCC,SAASb,IAAIa,OAAO;QACpBC,OAAOV,OAAOU,KAAK;IACrB;IAEA,IAAIf,WAAWa,MAAM,CAACG,IAAI,CAACC,wBAAwB,EAAE;QACnD,OAAOZ,OAAOU,KAAK;IACrB;IAEA,OAAOG,SAASC,IAAI,CAClB;QACE,kBAAkB;QAClBC,SAAS;QACT,GAAGf,MAAM;IACX,GACA;QACEgB,SAAS,IAAIC,QAAQ;YACnB,cAAcX;QAChB;QACAY,QAAQ5B,WAAW6B,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -28,4 +28,4 @@ export const logout = async ({ collection, req })=>{
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
//# sourceMappingURL=
|
|
31
|
+
//# sourceMappingURL=logout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/logout.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generateExpiredPayloadCookie } from 'payload/auth'\nimport { logoutOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const logout: CollectionRouteHandler = async ({ collection, req }) => {\n const result = logoutOperation({\n collection,\n req,\n })\n\n if (!result) {\n return Response.json(\n {\n message: 'Logout failed.',\n },\n {\n status: httpStatus.BAD_REQUEST,\n },\n )\n }\n\n const expiredCookie = generateExpiredPayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n })\n\n return Response.json(\n {\n // TODO(translate)\n message: 'Logout successful.',\n },\n {\n headers: new Headers({\n 'Set-Cookie': expiredCookie,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","generateExpiredPayloadCookie","logoutOperation","logout","collection","req","result","Response","json","message","status","BAD_REQUEST","expiredCookie","collectionConfig","config","payload","headers","Headers","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,4BAA4B,QAAQ,eAAc;AAC3D,SAASC,eAAe,QAAQ,qBAAoB;AAIpD,OAAO,MAAMC,SAAiC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACtE,MAAMC,SAASJ,gBAAgB;QAC7BE;QACAC;IACF;IAEA,IAAI,CAACC,QAAQ;QACX,OAAOC,SAASC,IAAI,CAClB;YACEC,SAAS;QACX,GACA;YACEC,QAAQV,WAAWW,WAAW;QAChC;IAEJ;IAEA,MAAMC,gBAAgBX,6BAA6B;QACjDY,kBAAkBT,WAAWU,MAAM;QACnCC,SAASV,IAAIU,OAAO;IACtB;IAEA,OAAOR,SAASC,IAAI,CAClB;QACE,kBAAkB;QAClBC,SAAS;IACX,GACA;QACEO,SAAS,IAAIC,QAAQ;YACnB,cAAcL;QAChB;QACAF,QAAQV,WAAWkB,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -19,4 +19,4 @@ export const me = async ({ collection, req })=>{
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
//# sourceMappingURL=
|
|
22
|
+
//# sourceMappingURL=me.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/me.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { extractJWT } from 'payload/auth'\nimport { meOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const me: CollectionRouteHandler = async ({ collection, req }) => {\n const currentToken = extractJWT(req)\n\n const result = await meOperation({\n collection,\n currentToken,\n req,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n ...result,\n message: req.t('authentication:account'),\n },\n {\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","extractJWT","meOperation","me","collection","req","currentToken","result","config","auth","removeTokenFromResponses","token","Response","json","message","t","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,UAAU,QAAQ,eAAc;AACzC,SAASC,WAAW,QAAQ,qBAAoB;AAIhD,OAAO,MAAMC,KAA6B,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IAClE,MAAMC,eAAeL,WAAWI;IAEhC,MAAME,SAAS,MAAML,YAAY;QAC/BE;QACAE;QACAD;IACF;IAEA,IAAID,WAAWI,MAAM,CAACC,IAAI,CAACC,wBAAwB,EAAE;QACnD,OAAOH,OAAOI,KAAK;IACrB;IAEA,OAAOC,SAASC,IAAI,CAClB;QACE,GAAGN,MAAM;QACTO,SAAST,IAAIU,CAAC,CAAC;IACjB,GACA;QACEC,QAAQhB,WAAWiB,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -37,4 +37,4 @@ export const refresh = async ({ collection, req })=>{
|
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
//# sourceMappingURL=
|
|
40
|
+
//# sourceMappingURL=refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/refresh.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { extractJWT } from 'payload/auth'\nimport { generatePayloadCookie } from 'payload/auth'\nimport { refreshOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const refresh: CollectionRouteHandler = async ({ collection, req }) => {\n const token = typeof req.data?.token === 'string' ? req.data.token : extractJWT(req)\n\n if (!token) {\n return Response.json(\n {\n // TODO(translate)\n message: 'Token not provided.',\n },\n {\n status: httpStatus.UNAUTHORIZED,\n },\n )\n }\n\n const result = await refreshOperation({\n collection,\n req,\n token,\n })\n\n const cookie = generatePayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n token: result.refreshedToken,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.refreshedToken\n }\n\n return Response.json(\n {\n // TODO(translate)\n message: 'Token refresh successful',\n ...result,\n },\n {\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","extractJWT","generatePayloadCookie","refreshOperation","refresh","collection","req","token","data","Response","json","message","status","UNAUTHORIZED","result","cookie","collectionConfig","config","payload","refreshedToken","auth","removeTokenFromResponses","headers","Headers","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,UAAU,QAAQ,eAAc;AACzC,SAASC,qBAAqB,QAAQ,eAAc;AACpD,SAASC,gBAAgB,QAAQ,qBAAoB;AAIrD,OAAO,MAAMC,UAAkC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACvE,MAAMC,QAAQ,OAAOD,IAAIE,IAAI,EAAED,UAAU,WAAWD,IAAIE,IAAI,CAACD,KAAK,GAAGN,WAAWK;IAEhF,IAAI,CAACC,OAAO;QACV,OAAOE,SAASC,IAAI,CAClB;YACE,kBAAkB;YAClBC,SAAS;QACX,GACA;YACEC,QAAQZ,WAAWa,YAAY;QACjC;IAEJ;IAEA,MAAMC,SAAS,MAAMX,iBAAiB;QACpCE;QACAC;QACAC;IACF;IAEA,MAAMQ,SAASb,sBAAsB;QACnCc,kBAAkBX,WAAWY,MAAM;QACnCC,SAASZ,IAAIY,OAAO;QACpBX,OAAOO,OAAOK,cAAc;IAC9B;IAEA,IAAId,WAAWY,MAAM,CAACG,IAAI,CAACC,wBAAwB,EAAE;QACnD,OAAOP,OAAOK,cAAc;IAC9B;IAEA,OAAOV,SAASC,IAAI,CAClB;QACE,kBAAkB;QAClBC,SAAS;QACT,GAAGG,MAAM;IACX,GACA;QACEQ,SAAS,IAAIC,QAAQ;YACnB,cAAcR;QAChB;QACAH,QAAQZ,WAAWwB,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -29,4 +29,4 @@ export const registerFirstUser = async ({ collection, req })=>{
|
|
|
29
29
|
});
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
//# sourceMappingURL=
|
|
32
|
+
//# sourceMappingURL=registerFirstUser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/registerFirstUser.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie } from 'payload/auth'\nimport { registerFirstUserOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const registerFirstUser: CollectionRouteHandler = async ({ collection, req }) => {\n const result = await registerFirstUserOperation({\n collection,\n data: {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\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 // TODO(translate)\n message: 'Successfully registered first user.',\n token: result.token,\n user: result.user,\n },\n {\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","generatePayloadCookie","registerFirstUserOperation","registerFirstUser","collection","req","result","data","email","password","cookie","collectionConfig","config","payload","token","Response","json","exp","message","user","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,qBAAqB,QAAQ,eAAc;AACpD,SAASC,0BAA0B,QAAQ,qBAAoB;AAI/D,OAAO,MAAMC,oBAA4C,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACjF,MAAMC,SAAS,MAAMJ,2BAA2B;QAC9CE;QACAG,MAAM;YACJC,OAAO,OAAOH,IAAIE,IAAI,EAAEC,UAAU,WAAWH,IAAIE,IAAI,CAACC,KAAK,GAAG;YAC9DC,UAAU,OAAOJ,IAAIE,IAAI,EAAEE,aAAa,WAAWJ,IAAIE,IAAI,CAACE,QAAQ,GAAG;QACzE;QACAJ;IACF;IAEA,MAAMK,SAAST,sBAAsB;QACnCU,kBAAkBP,WAAWQ,MAAM;QACnCC,SAASR,IAAIQ,OAAO;QACpBC,OAAOR,OAAOQ,KAAK;IACrB;IAEA,OAAOC,SAASC,IAAI,CAClB;QACEC,KAAKX,OAAOW,GAAG;QACf,kBAAkB;QAClBC,SAAS;QACTJ,OAAOR,OAAOQ,KAAK;QACnBK,MAAMb,OAAOa,IAAI;IACnB,GACA;QACEC,SAAS,IAAIC,QAAQ;YACnB,cAAcX;QAChB;QACAY,QAAQtB,WAAWuB,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -33,4 +33,4 @@ export const resetPassword = async ({ collection, req })=>{
|
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
//# sourceMappingURL=
|
|
36
|
+
//# sourceMappingURL=resetPassword.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/resetPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie } from 'payload/auth'\nimport { resetPasswordOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const resetPassword: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams } = 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 // TODO(translate)\n message: 'Password reset successfully.',\n ...result,\n },\n {\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","generatePayloadCookie","resetPasswordOperation","resetPassword","collection","req","searchParams","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,QAAQ,eAAc;AACpD,SAASC,sBAAsB,QAAQ,qBAAoB;AAI3D,OAAO,MAAMC,gBAAwC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IAC7E,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMC,SAAS,MAAMP,uBAAuB;QAC1CE;QACAM,MAAM;YACJC,UAAU,OAAON,IAAIK,IAAI,EAAEC,aAAa,WAAWN,IAAIK,IAAI,CAACC,QAAQ,GAAG;YACvEC,OAAO,OAAOP,IAAIK,IAAI,EAAEE,UAAU,WAAWP,IAAIK,IAAI,CAACE,KAAK,GAAG;QAChE;QACAL,OAAOA,QAAQM,OAAON,SAASO;QAC/BT;IACF;IAEA,MAAMU,SAASd,sBAAsB;QACnCe,kBAAkBZ,WAAWa,MAAM;QACnCC,SAASb,IAAIa,OAAO;QACpBN,OAAOH,OAAOG,KAAK;IACrB;IAEA,IAAIR,WAAWa,MAAM,CAACE,IAAI,CAACC,wBAAwB,EAAE;QACnD,OAAOX,OAAOG,KAAK;IACrB;IAEA,OAAOS,SAASC,IAAI,CAClB;QACE,kBAAkB;QAClBC,SAAS;QACT,GAAGd,MAAM;IACX,GACA;QACEe,SAAS,IAAIC,QAAQ;YACnB,cAAcV;QAChB;QACAW,QAAQ1B,WAAW2B,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -16,4 +16,4 @@ export const unlock = async ({ collection, req })=>{
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
//# sourceMappingURL=
|
|
19
|
+
//# sourceMappingURL=unlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/unlock.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { unlockOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const unlock: CollectionRouteHandler = async ({ collection, req }) => {\n await unlockOperation({\n collection,\n data: { email: req.data.email as string },\n req,\n })\n\n return Response.json(\n {\n // TODO(translate)\n message: 'Success',\n },\n {\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","unlockOperation","unlock","collection","req","data","email","Response","json","message","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,eAAe,QAAQ,qBAAoB;AAIpD,OAAO,MAAMC,SAAiC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACtE,MAAMH,gBAAgB;QACpBE;QACAE,MAAM;YAAEC,OAAOF,IAAIC,IAAI,CAACC,KAAK;QAAW;QACxCF;IACF;IAEA,OAAOG,SAASC,IAAI,CAClB;QACE,kBAAkB;QAClBC,SAAS;IACX,GACA;QACEC,QAAQV,WAAWW,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -14,4 +14,4 @@ export const verifyEmail = async ({ id, collection, req })=>{
|
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=verifyEmail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/auth/verifyEmail.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { verifyEmailOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nexport const verifyEmail: CollectionRouteHandlerWithID = async ({ id, collection, req }) => {\n await verifyEmailOperation({\n collection,\n req,\n token: id,\n })\n\n return Response.json(\n {\n // TODO(translate)\n message: 'Email verified successfully.',\n },\n {\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","verifyEmailOperation","verifyEmail","id","collection","req","token","Response","json","message","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,oBAAoB,QAAQ,qBAAoB;AAIzD,OAAO,MAAMC,cAA4C,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACrF,MAAMJ,qBAAqB;QACzBG;QACAC;QACAC,OAAOH;IACT;IAEA,OAAOI,SAASC,IAAI,CAClB;QACE,kBAAkB;QAClBC,SAAS;IACX,GACA;QACEC,QAAQV,WAAWW,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -70,4 +70,4 @@ export const buildFormState = async ({ req })=>{
|
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
//# sourceMappingURL=
|
|
73
|
+
//# sourceMappingURL=buildFormState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/routes/rest/buildFormState.ts"],"sourcesContent":["import type { BuildFormStateArgs, FieldSchemaMap } from '@payloadcms/ui'\nimport type { DocumentPreferences, Field, PayloadRequest, SanitizedConfig } from 'payload/types'\n\nimport { buildFieldSchemaMap, buildStateFromSchema, reduceFieldsToValues } from '@payloadcms/ui'\nimport httpStatus from 'http-status'\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 = (config: SanitizedConfig): FieldSchemaMap => {\n if (cached && process.env.NODE_ENV !== 'development') {\n return cached\n }\n\n cached = buildFieldSchemaMap(config)\n\n return cached\n}\n\nexport const buildFormState = async ({ req }: { req: PayloadRequest }) => {\n const { locale, t, user } = req\n const reqData: BuildFormStateArgs = req.data as BuildFormStateArgs\n\n // TODO: run ADMIN access control for user\n\n const fieldSchemaMap = getFieldSchemaMap(req.payload.config)\n\n const {\n collectionSlug,\n data: incomingData,\n formState,\n globalSlug,\n operation,\n schemaPath,\n } = reqData\n\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((global) => global.slug === schemaPath)?.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 const data = incomingData || reduceFieldsToValues(formState || {}, true)\n\n let id: number | string | undefined\n let docPreferencesKey: string\n if (collectionSlug) {\n id = reqData.id\n docPreferencesKey = `collection-${collectionSlug}${id ? `-${id}` : ''}`\n } else {\n docPreferencesKey = `global-${globalSlug}`\n }\n\n const { docs: [{ value: docPreferences } = { value: null }] = [] } = (await req.payload.find({\n collection: 'payload-preferences',\n depth: 0,\n limit: 1,\n where: {\n key: {\n equals: docPreferencesKey,\n },\n },\n })) as any as { docs: { value: DocumentPreferences }[] }\n\n const result = await buildStateFromSchema({\n id,\n data,\n fieldSchema,\n operation,\n preferences: docPreferences,\n req,\n })\n\n return Response.json(result, {\n status: httpStatus.OK,\n })\n}\n"],"names":["buildFieldSchemaMap","buildStateFromSchema","reduceFieldsToValues","httpStatus","cached","global","_payload_fieldSchemaMap","getFieldSchemaMap","config","process","env","NODE_ENV","buildFormState","req","locale","t","user","reqData","data","fieldSchemaMap","payload","collectionSlug","incomingData","formState","globalSlug","operation","schemaPath","schemaPathSegments","split","fieldSchema","length","collections","fields","globals","find","slug","has","get","Response","json","message","status","BAD_REQUEST","id","docPreferencesKey","docs","value","docPreferences","collection","depth","limit","where","key","equals","result","preferences","OK"],"mappings":"AAGA,SAASA,mBAAmB,EAAEC,oBAAoB,EAAEC,oBAAoB,QAAQ,iBAAgB;AAChG,OAAOC,gBAAgB,cAAa;AAEpC,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,SAASJ,oBAAoBQ;IAE7B,OAAOJ;AACT,EAAC;AAED,OAAO,MAAMQ,iBAAiB,OAAO,EAAEC,GAAG,EAA2B;IACnE,MAAM,EAAEC,MAAM,EAAEC,CAAC,EAAEC,IAAI,EAAE,GAAGH;IAC5B,MAAMI,UAA8BJ,IAAIK,IAAI;IAE5C,0CAA0C;IAE1C,MAAMC,iBAAiBZ,kBAAkBM,IAAIO,OAAO,CAACZ,MAAM;IAE3D,MAAM,EACJa,cAAc,EACdH,MAAMI,YAAY,EAClBC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,UAAU,EACX,GAAGT;IAEJ,MAAMU,qBAAqBD,WAAWE,KAAK,CAAC;IAE5C,IAAIC;IAEJ,IAAIF,mBAAmBG,MAAM,KAAK,GAAG;QACnC,IAAIjB,IAAIO,OAAO,CAACW,WAAW,CAACL,WAAW,EAAE;YACvCG,cAAchB,IAAIO,OAAO,CAACW,WAAW,CAACL,WAAW,CAAClB,MAAM,CAACwB,MAAM;QACjE,OAAO;YACLH,cAAchB,IAAIO,OAAO,CAACZ,MAAM,CAACyB,OAAO,CAACC,IAAI,CAAC,CAAC7B,UAAWA,QAAO8B,IAAI,KAAKT,aAAaM;QACzF;IACF,OAAO,IAAIb,eAAeiB,GAAG,CAACV,aAAa;QACzCG,cAAcV,eAAekB,GAAG,CAACX;IACnC;IAEA,IAAI,CAACG,aAAa;QAChB,OAAOS,SAASC,IAAI,CAClB;YACEC,SAAS;QACX,GACA;YACEC,QAAQtC,WAAWuC,WAAW;QAChC;IAEJ;IAEA,MAAMxB,OAAOI,gBAAgBpB,qBAAqBqB,aAAa,CAAC,GAAG;IAEnE,IAAIoB;IACJ,IAAIC;IACJ,IAAIvB,gBAAgB;QAClBsB,KAAK1B,QAAQ0B,EAAE;QACfC,oBAAoB,CAAC,WAAW,EAAEvB,eAAe,EAAEsB,KAAK,CAAC,CAAC,EAAEA,GAAG,CAAC,GAAG,GAAG,CAAC;IACzE,OAAO;QACLC,oBAAoB,CAAC,OAAO,EAAEpB,WAAW,CAAC;IAC5C;IAEA,MAAM,EAAEqB,MAAM,CAAC,EAAEC,OAAOC,cAAc,EAAE,GAAG;QAAED,OAAO;IAAK,CAAC,CAAC,GAAG,EAAE,EAAE,GAAI,MAAMjC,IAAIO,OAAO,CAACc,IAAI,CAAC;QAC3Fc,YAAY;QACZC,OAAO;QACPC,OAAO;QACPC,OAAO;YACLC,KAAK;gBACHC,QAAQT;YACV;QACF;IACF;IAEA,MAAMU,SAAS,MAAMrD,qBAAqB;QACxC0C;QACAzB;QACAW;QACAJ;QACA8B,aAAaR;QACblC;IACF;IAEA,OAAOyB,SAASC,IAAI,CAACe,QAAQ;QAC3Bb,QAAQtC,WAAWqD,EAAE;IACvB;AACF,EAAC"}
|
|
@@ -9,4 +9,4 @@ export const endpointsAreDisabled = ({ endpoints, request })=>{
|
|
|
9
9
|
}
|
|
10
10
|
};
|
|
11
11
|
|
|
12
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=checkEndpoints.js.map
|
|
@@ -0,0 +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"],"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"}
|
|
@@ -24,4 +24,4 @@ export const create = async ({ collection, req })=>{
|
|
|
24
24
|
});
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
//# sourceMappingURL=
|
|
27
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/create.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { createOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandler } from '../types.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: collection.config.labels.singular,\n }),\n },\n {\n status: httpStatus.CREATED,\n },\n )\n}\n"],"names":["httpStatus","createOperation","isNumber","create","collection","req","searchParams","autosave","get","draft","depth","doc","data","undefined","Response","json","message","t","label","config","labels","singular","status","CREATED"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,eAAe,QAAQ,qBAAoB;AACpD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,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,MAAMV,gBAAgB;QAChCM;QACAH;QACAQ,MAAMP,IAAIO,IAAI;QACdF,OAAOR,SAASQ,SAASA,QAAQG;QACjCJ;QACAJ;IACF;IAEA,OAAOS,SAASC,IAAI,CAClB;QACEJ;QACAK,SAASX,IAAIY,CAAC,CAAC,+BAA+B;YAC5CC,OAAOd,WAAWe,MAAM,CAACC,MAAM,CAACC,QAAQ;QAC1C;IACF,GACA;QACEC,QAAQtB,WAAWuB,OAAO;IAC5B;AAEJ,EAAC"}
|
|
@@ -36,4 +36,4 @@ export const deleteDoc = async ({ collection, req })=>{
|
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
//# sourceMappingURL=
|
|
39
|
+
//# sourceMappingURL=delete.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/delete.ts"],"sourcesContent":["import type { Where } from 'payload/types'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { deleteOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandler } from '../types.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 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 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 status: httpStatus.BAD_REQUEST,\n },\n )\n}\n"],"names":["getTranslation","httpStatus","deleteOperation","isNumber","deleteDoc","collection","req","depth","where","query","result","Number","undefined","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,qBAAoB;AACpD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,OAAO,MAAMC,YAAoC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACzE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF,IAAIG,KAAK;IAKlC,MAAMC,SAAS,MAAMR,gBAAgB;QACnCG;QACAE,OAAOJ,SAASI,SAASI,OAAOJ,SAASK;QACzCN;QACAE;IACF;IAEA,IAAIE,OAAOG,MAAM,CAACC,MAAM,KAAK,GAAG;QAC9B,MAAMC,UAAUT,IAAIU,CAAC,CAAC,oCAAoC;YACxDC,OAAOP,OAAOQ,IAAI,CAACJ,MAAM;YACzBK,OAAOnB,eACLK,WAAWe,MAAM,CAACC,MAAM,CAACX,OAAOQ,IAAI,CAACJ,MAAM,GAAG,IAAI,WAAW,WAAW,EACxER,IAAIgB,IAAI;QAEZ;QAEA,OAAOC,SAASC,IAAI,CAClB;YACE,GAAGd,MAAM;YACTK;QACF,GACA;YACEU,QAAQxB,WAAWyB,EAAE;QACvB;IAEJ;IAEA,MAAMC,QAAQjB,OAAOQ,IAAI,CAACJ,MAAM,GAAGJ,OAAOG,MAAM,CAACC,MAAM;IAEvD,MAAMC,UAAUT,IAAIU,CAAC,CAAC,6BAA6B;QACjDC,OAAOP,OAAOG,MAAM,CAACC,MAAM;QAC3BK,OAAOnB,eAAeK,WAAWe,MAAM,CAACC,MAAM,CAACM,QAAQ,IAAI,WAAW,WAAW,EAAErB,IAAIgB,IAAI;QAC3FK;IACF;IAEA,OAAOJ,SAASC,IAAI,CAClB;QACE,GAAGd,MAAM;QACTK;IACF,GACA;QACEU,QAAQxB,WAAW2B,WAAW;IAChC;AAEJ,EAAC"}
|
|
@@ -25,4 +25,4 @@ export const deleteByID = async ({ id, collection, req })=>{
|
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=deleteByID.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/deleteByID.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { deleteByIDOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nexport const deleteByID: CollectionRouteHandlerWithID = async ({ id, collection, req }) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n const doc = await deleteByIDOperation({\n id,\n collection,\n depth: isNumber(depth) ? depth : undefined,\n req,\n })\n\n if (!doc) {\n return Response.json(\n {\n message: req.t('general:notFound'),\n },\n {\n status: httpStatus.NOT_FOUND,\n },\n )\n }\n\n return Response.json(\n {\n doc,\n message: req.t('general:deletedSuccessfully'),\n },\n {\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","deleteByIDOperation","isNumber","deleteByID","id","collection","req","searchParams","depth","get","doc","undefined","Response","json","message","t","status","NOT_FOUND","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,mBAAmB,QAAQ,qBAAoB;AACxD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,OAAO,MAAMC,aAA2C,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACpF,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAC/B,MAAMC,MAAM,MAAMT,oBAAoB;QACpCG;QACAC;QACAG,OAAON,SAASM,SAASA,QAAQG;QACjCL;IACF;IAEA,IAAI,CAACI,KAAK;QACR,OAAOE,SAASC,IAAI,CAClB;YACEC,SAASR,IAAIS,CAAC,CAAC;QACjB,GACA;YACEC,QAAQhB,WAAWiB,SAAS;QAC9B;IAEJ;IAEA,OAAOL,SAASC,IAAI,CAClB;QACEH;QACAI,SAASR,IAAIS,CAAC,CAAC;IACjB,GACA;QACEC,QAAQhB,WAAWkB,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -11,4 +11,4 @@ export const docAccess = async ({ id, collection, req })=>{
|
|
|
11
11
|
});
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
//# sourceMappingURL=
|
|
14
|
+
//# sourceMappingURL=docAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/docAccess.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { docAccessOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nexport const docAccess: CollectionRouteHandlerWithID = async ({ id, collection, req }) => {\n const result = await docAccessOperation({\n id,\n collection,\n req,\n })\n\n return Response.json(result, {\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","docAccessOperation","docAccess","id","collection","req","result","Response","json","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,kBAAkB,QAAQ,qBAAoB;AAIvD,OAAO,MAAMC,YAA0C,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACnF,MAAMC,SAAS,MAAML,mBAAmB;QACtCE;QACAC;QACAC;IACF;IAEA,OAAOE,SAASC,IAAI,CAACF,QAAQ;QAC3BG,QAAQT,WAAWU,EAAE;IACvB;AACF,EAAC"}
|
|
@@ -18,4 +18,4 @@ export const find = async ({ collection, req })=>{
|
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=find.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/find.ts"],"sourcesContent":["import type { Where } from 'payload/types'\n\nimport httpStatus from 'http-status'\nimport { findOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const find: CollectionRouteHandler = async ({ collection, req }) => {\n const { depth, draft, limit, page, sort, where } = req.query as {\n depth?: string\n draft?: string\n limit?: string\n page?: string\n sort?: string\n where?: Where\n }\n\n const result = await findOperation({\n collection,\n depth: isNumber(depth) ? Number(depth) : undefined,\n draft: draft === 'true',\n limit: isNumber(limit) ? Number(limit) : undefined,\n page: isNumber(page) ? Number(page) : undefined,\n req,\n sort,\n where,\n })\n\n return Response.json(result, {\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","findOperation","isNumber","find","collection","req","depth","draft","limit","page","sort","where","query","result","Number","undefined","Response","json","status","OK"],"mappings":"AAEA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,OAAO,MAAMC,OAA+B,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACpE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGN,IAAIO,KAAK;IAS5D,MAAMC,SAAS,MAAMZ,cAAc;QACjCG;QACAE,OAAOJ,SAASI,SAASQ,OAAOR,SAASS;QACzCR,OAAOA,UAAU;QACjBC,OAAON,SAASM,SAASM,OAAON,SAASO;QACzCN,MAAMP,SAASO,QAAQK,OAAOL,QAAQM;QACtCV;QACAK;QACAC;IACF;IAEA,OAAOK,SAASC,IAAI,CAACJ,QAAQ;QAC3BK,QAAQlB,WAAWmB,EAAE;IACvB;AACF,EAAC"}
|
|
@@ -16,4 +16,4 @@ export const findByID = async ({ id, collection, req })=>{
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
|
|
19
|
-
//# sourceMappingURL=
|
|
19
|
+
//# sourceMappingURL=findByID.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/findByID.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { findByIDOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nexport const findByID: CollectionRouteHandlerWithID = async ({ id, collection, req }) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const result = await findByIDOperation({\n id,\n collection,\n depth: isNumber(depth) ? Number(depth) : undefined,\n draft: searchParams.get('draft') === 'true',\n req,\n })\n\n return Response.json(result, {\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","findByIDOperation","isNumber","findByID","id","collection","req","searchParams","depth","get","result","Number","undefined","draft","Response","json","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,iBAAiB,QAAQ,qBAAoB;AACtD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,OAAO,MAAMC,WAAyC,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IAClF,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMC,SAAS,MAAMT,kBAAkB;QACrCG;QACAC;QACAG,OAAON,SAASM,SAASG,OAAOH,SAASI;QACzCC,OAAON,aAAaE,GAAG,CAAC,aAAa;QACrCH;IACF;IAEA,OAAOQ,SAASC,IAAI,CAACL,QAAQ;QAC3BM,QAAQhB,WAAWiB,EAAE;IACvB;AACF,EAAC"}
|
|
@@ -15,4 +15,4 @@ export const findVersionByID = async ({ id, collection, req })=>{
|
|
|
15
15
|
});
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=findVersionByID.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/findVersionByID.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { findVersionByIDOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nexport const findVersionByID: CollectionRouteHandlerWithID = async ({ id, collection, req }) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const result = await findVersionByIDOperation({\n id,\n collection,\n depth: isNumber(depth) ? Number(depth) : undefined,\n req,\n })\n\n return Response.json(result, {\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","findVersionByIDOperation","isNumber","findVersionByID","id","collection","req","searchParams","depth","get","result","Number","undefined","Response","json","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,wBAAwB,QAAQ,qBAAoB;AAC7D,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,OAAO,MAAMC,kBAAgD,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACzF,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMC,SAAS,MAAMT,yBAAyB;QAC5CG;QACAC;QACAG,OAAON,SAASM,SAASG,OAAOH,SAASI;QACzCN;IACF;IAEA,OAAOO,SAASC,IAAI,CAACJ,QAAQ;QAC3BK,QAAQf,WAAWgB,EAAE;IACvB;AACF,EAAC"}
|
|
@@ -17,4 +17,4 @@ export const findVersions = async ({ collection, req })=>{
|
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=
|
|
20
|
+
//# sourceMappingURL=findVersions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/findVersions.ts"],"sourcesContent":["import type { Where } from 'payload/types'\n\nimport httpStatus from 'http-status'\nimport { findVersionsOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const findVersions: CollectionRouteHandler = async ({ collection, req }) => {\n const { depth, limit, page, sort, where } = req.query as {\n depth?: string\n limit?: string\n page?: string\n sort?: string\n where?: Where\n }\n\n const result = await findVersionsOperation({\n collection,\n depth: isNumber(depth) ? Number(depth) : undefined,\n limit: isNumber(limit) ? Number(limit) : undefined,\n page: isNumber(page) ? Number(page) : undefined,\n req,\n sort,\n where,\n })\n\n return Response.json(result, {\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","findVersionsOperation","isNumber","findVersions","collection","req","depth","limit","page","sort","where","query","result","Number","undefined","Response","json","status","OK"],"mappings":"AAEA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,qBAAqB,QAAQ,qBAAoB;AAC1D,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,OAAO,MAAMC,eAAuC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IAC5E,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGL,IAAIM,KAAK;IAQrD,MAAMC,SAAS,MAAMX,sBAAsB;QACzCG;QACAE,OAAOJ,SAASI,SAASO,OAAOP,SAASQ;QACzCP,OAAOL,SAASK,SAASM,OAAON,SAASO;QACzCN,MAAMN,SAASM,QAAQK,OAAOL,QAAQM;QACtCT;QACAI;QACAC;IACF;IAEA,OAAOK,SAASC,IAAI,CAACJ,QAAQ;QAC3BK,QAAQjB,WAAWkB,EAAE;IACvB;AACF,EAAC"}
|
|
@@ -18,4 +18,4 @@ export const restoreVersion = async ({ id, collection, req })=>{
|
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=restoreVersion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/restoreVersion.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { restoreVersionOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nexport const restoreVersion: CollectionRouteHandlerWithID = async ({ id, collection, req }) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const result = await restoreVersionOperation({\n id,\n collection,\n depth: isNumber(depth) ? Number(depth) : undefined,\n req,\n })\n\n return Response.json(\n {\n ...result,\n message: req.t('version:restoredSuccessfully'),\n },\n {\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","restoreVersionOperation","isNumber","restoreVersion","id","collection","req","searchParams","depth","get","result","Number","undefined","Response","json","message","t","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,uBAAuB,QAAQ,qBAAoB;AAC5D,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,OAAO,MAAMC,iBAA+C,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACxF,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMC,SAAS,MAAMT,wBAAwB;QAC3CG;QACAC;QACAG,OAAON,SAASM,SAASG,OAAOH,SAASI;QACzCN;IACF;IAEA,OAAOO,SAASC,IAAI,CAClB;QACE,GAAGJ,MAAM;QACTK,SAAST,IAAIU,CAAC,CAAC;IACjB,GACA;QACEC,QAAQjB,WAAWkB,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -38,4 +38,4 @@ export const update = async ({ collection, req })=>{
|
|
|
38
38
|
});
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
//# sourceMappingURL=
|
|
41
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/update.ts"],"sourcesContent":["import type { Where } from 'payload/types'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { updateOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const update: CollectionRouteHandler = async ({ collection, req }) => {\n const { depth, draft, where } = req.query as {\n depth?: string\n draft?: string\n where?: Where\n }\n\n const result = await updateOperation({\n collection,\n data: req.data,\n depth: isNumber(depth) ? Number(depth) : undefined,\n draft: draft === 'true',\n req,\n where,\n })\n\n if (result.errors.length === 0) {\n const message = req.t('general:updatedCountSuccessfully', {\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 status: httpStatus.OK,\n },\n )\n }\n\n const total = result.docs.length + result.errors.length\n const message = req.t('error:unableToUpdateCount', {\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 status: httpStatus.BAD_REQUEST,\n },\n )\n}\n"],"names":["getTranslation","httpStatus","updateOperation","isNumber","update","collection","req","depth","draft","where","query","result","data","Number","undefined","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,qBAAoB;AACpD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,OAAO,MAAMC,SAAiC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACtE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGH,IAAII,KAAK;IAMzC,MAAMC,SAAS,MAAMT,gBAAgB;QACnCG;QACAO,MAAMN,IAAIM,IAAI;QACdL,OAAOJ,SAASI,SAASM,OAAON,SAASO;QACzCN,OAAOA,UAAU;QACjBF;QACAG;IACF;IAEA,IAAIE,OAAOI,MAAM,CAACC,MAAM,KAAK,GAAG;QAC9B,MAAMC,UAAUX,IAAIY,CAAC,CAAC,oCAAoC;YACxDC,OAAOR,OAAOS,IAAI,CAACJ,MAAM;YACzBK,OAAOrB,eACLK,WAAWiB,MAAM,CAACC,MAAM,CAACZ,OAAOS,IAAI,CAACJ,MAAM,GAAG,IAAI,WAAW,WAAW,EACxEV,IAAIkB,IAAI;QAEZ;QAEA,OAAOC,SAASC,IAAI,CAClB;YACE,GAAGf,MAAM;YACTM;QACF,GACA;YACEU,QAAQ1B,WAAW2B,EAAE;QACvB;IAEJ;IAEA,MAAMC,QAAQlB,OAAOS,IAAI,CAACJ,MAAM,GAAGL,OAAOI,MAAM,CAACC,MAAM;IACvD,MAAMC,UAAUX,IAAIY,CAAC,CAAC,6BAA6B;QACjDC,OAAOR,OAAOI,MAAM,CAACC,MAAM;QAC3BK,OAAOrB,eAAeK,WAAWiB,MAAM,CAACC,MAAM,CAACM,QAAQ,IAAI,WAAW,WAAW,EAAEvB,IAAIkB,IAAI;QAC3FK;IACF;IAEA,OAAOJ,SAASC,IAAI,CAClB;QACE,GAAGf,MAAM;QACTM;IACF,GACA;QACEU,QAAQ1B,WAAW6B,WAAW;IAChC;AAEJ,EAAC"}
|
|
@@ -26,4 +26,4 @@ export const updateByID = async ({ id, collection, req })=>{
|
|
|
26
26
|
});
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
//# sourceMappingURL=
|
|
29
|
+
//# sourceMappingURL=updateByID.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/collections/updateByID.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { updateByIDOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nexport const updateByID: CollectionRouteHandlerWithID = async ({ id, collection, req }) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n const autosave = searchParams.get('autosave') === 'true'\n const draft = searchParams.get('draft') === 'true'\n\n const doc = await updateByIDOperation({\n id,\n autosave,\n collection,\n data: req.data,\n depth: isNumber(depth) ? Number(depth) : undefined,\n draft,\n req,\n })\n\n let message = req.t('general:updatedSuccessfully')\n\n if (draft) message = req.t('version:draftSavedSuccessfully')\n if (autosave) message = req.t('version:autosavedSuccessfully')\n\n return Response.json(\n {\n doc,\n message,\n },\n {\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","updateByIDOperation","isNumber","updateByID","id","collection","req","searchParams","depth","get","autosave","draft","doc","data","Number","undefined","message","t","Response","json","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,mBAAmB,QAAQ,qBAAoB;AACxD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,OAAO,MAAMC,aAA2C,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACpF,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAC/B,MAAMC,WAAWH,aAAaE,GAAG,CAAC,gBAAgB;IAClD,MAAME,QAAQJ,aAAaE,GAAG,CAAC,aAAa;IAE5C,MAAMG,MAAM,MAAMX,oBAAoB;QACpCG;QACAM;QACAL;QACAQ,MAAMP,IAAIO,IAAI;QACdL,OAAON,SAASM,SAASM,OAAON,SAASO;QACzCJ;QACAL;IACF;IAEA,IAAIU,UAAUV,IAAIW,CAAC,CAAC;IAEpB,IAAIN,OAAOK,UAAUV,IAAIW,CAAC,CAAC;IAC3B,IAAIP,UAAUM,UAAUV,IAAIW,CAAC,CAAC;IAE9B,OAAOC,SAASC,IAAI,CAClB;QACEP;QACAI;IACF,GACA;QACEI,QAAQpB,WAAWqB,EAAE;IACvB;AAEJ,EAAC"}
|
|
@@ -47,4 +47,4 @@ export async function checkFileAccess({ collection, filename, req }) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
//# sourceMappingURL=
|
|
50
|
+
//# sourceMappingURL=checkFileAccess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/routes/rest/files/checkFileAccess.ts"],"sourcesContent":["import type { Collection, PayloadRequest, Where } from 'payload/types'\n\nimport { executeAccess } from 'payload/auth'\nimport { Forbidden } from 'payload/errors'\n\nimport { endpointsAreDisabled } from '../checkEndpoints.js'\n\nexport async function checkFileAccess({\n collection,\n filename,\n req,\n}: {\n collection: Collection\n filename: string\n req: PayloadRequest\n}) {\n const { config } = collection\n const disableEndpoints = endpointsAreDisabled({ endpoints: config.endpoints, request: req })\n if (disableEndpoints) return disableEndpoints\n\n const accessResult = await executeAccess({ isReadingStaticFile: true, req }, config.access.read)\n\n if (typeof accessResult === 'object') {\n const queryToBuild: Where = {\n and: [\n {\n or: [\n {\n filename: {\n equals: filename,\n },\n },\n ],\n },\n accessResult,\n ],\n }\n\n if (config.upload.imageSizes) {\n config.upload.imageSizes.forEach(({ name }) => {\n queryToBuild.and[0].or.push({\n [`sizes.${name}.filename`]: {\n equals: filename,\n },\n })\n })\n }\n\n const doc = await req.payload.db.findOne({\n collection: config.slug,\n req,\n where: queryToBuild,\n })\n\n if (!doc) {\n throw new Forbidden(req.t)\n }\n }\n}\n"],"names":["executeAccess","Forbidden","endpointsAreDisabled","checkFileAccess","collection","filename","req","config","disableEndpoints","endpoints","request","accessResult","isReadingStaticFile","access","read","queryToBuild","and","or","equals","upload","imageSizes","forEach","name","push","doc","payload","db","findOne","slug","where","t"],"mappings":"AAEA,SAASA,aAAa,QAAQ,eAAc;AAC5C,SAASC,SAAS,QAAQ,iBAAgB;AAE1C,SAASC,oBAAoB,QAAQ,uBAAsB;AAE3D,OAAO,eAAeC,gBAAgB,EACpCC,UAAU,EACVC,QAAQ,EACRC,GAAG,EAKJ;IACC,MAAM,EAAEC,MAAM,EAAE,GAAGH;IACnB,MAAMI,mBAAmBN,qBAAqB;QAAEO,WAAWF,OAAOE,SAAS;QAAEC,SAASJ;IAAI;IAC1F,IAAIE,kBAAkB,OAAOA;IAE7B,MAAMG,eAAe,MAAMX,cAAc;QAAEY,qBAAqB;QAAMN;IAAI,GAAGC,OAAOM,MAAM,CAACC,IAAI;IAE/F,IAAI,OAAOH,iBAAiB,UAAU;QACpC,MAAMI,eAAsB;YAC1BC,KAAK;gBACH;oBACEC,IAAI;wBACF;4BACEZ,UAAU;gCACRa,QAAQb;4BACV;wBACF;qBACD;gBACH;gBACAM;aACD;QACH;QAEA,IAAIJ,OAAOY,MAAM,CAACC,UAAU,EAAE;YAC5Bb,OAAOY,MAAM,CAACC,UAAU,CAACC,OAAO,CAAC,CAAC,EAAEC,IAAI,EAAE;gBACxCP,aAAaC,GAAG,CAAC,EAAE,CAACC,EAAE,CAACM,IAAI,CAAC;oBAC1B,CAAC,CAAC,MAAM,EAAED,KAAK,SAAS,CAAC,CAAC,EAAE;wBAC1BJ,QAAQb;oBACV;gBACF;YACF;QACF;QAEA,MAAMmB,MAAM,MAAMlB,IAAImB,OAAO,CAACC,EAAE,CAACC,OAAO,CAAC;YACvCvB,YAAYG,OAAOqB,IAAI;YACvBtB;YACAuB,OAAOd;QACT;QAEA,IAAI,CAACS,KAAK;YACR,MAAM,IAAIvB,UAAUK,IAAIwB,CAAC;QAC3B;IACF;AACF"}
|