@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.
Files changed (835) hide show
  1. package/dist/cjs/withPayload.cjs +68 -18
  2. package/dist/cjs/withPayload.cjs.map +1 -1
  3. package/dist/config.d.ts +1 -1
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/config.js.map +1 -1
  6. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.d.ts +5 -0
  7. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.d.ts.map +1 -0
  8. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js +13 -0
  9. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js.map +1 -0
  10. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.d.ts +13 -0
  11. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.d.ts.map +1 -0
  12. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +47 -0
  13. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -0
  14. package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts +8 -0
  15. package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -0
  16. package/dist/elements/DocumentHeader/Tabs/Tab/index.js +71 -0
  17. package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -0
  18. package/dist/elements/DocumentHeader/Tabs/Tab/index.scss +93 -0
  19. package/dist/elements/DocumentHeader/Tabs/getCustomViews.d.ts +6 -0
  20. package/dist/elements/DocumentHeader/Tabs/getCustomViews.d.ts.map +1 -0
  21. package/dist/elements/DocumentHeader/Tabs/getCustomViews.js +38 -0
  22. package/dist/elements/DocumentHeader/Tabs/getCustomViews.js.map +1 -0
  23. package/dist/elements/DocumentHeader/Tabs/getViewConfig.d.ts +7 -0
  24. package/dist/elements/DocumentHeader/Tabs/getViewConfig.d.ts.map +1 -0
  25. package/dist/elements/DocumentHeader/Tabs/getViewConfig.js +14 -0
  26. package/dist/elements/DocumentHeader/Tabs/getViewConfig.js.map +1 -0
  27. package/dist/elements/DocumentHeader/Tabs/index.d.ts +12 -0
  28. package/dist/elements/DocumentHeader/Tabs/index.d.ts.map +1 -0
  29. package/dist/elements/DocumentHeader/Tabs/index.js +91 -0
  30. package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -0
  31. package/dist/elements/DocumentHeader/Tabs/index.scss +52 -0
  32. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.d.ts +3 -0
  33. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.d.ts.map +1 -0
  34. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +21 -0
  35. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -0
  36. package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts +9 -0
  37. package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.map +1 -0
  38. package/dist/elements/DocumentHeader/Tabs/tabs/index.js +57 -0
  39. package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -0
  40. package/dist/elements/DocumentHeader/index.d.ts +14 -0
  41. package/dist/elements/DocumentHeader/index.d.ts.map +1 -0
  42. package/dist/elements/DocumentHeader/index.js +30 -0
  43. package/dist/elements/DocumentHeader/index.js.map +1 -0
  44. package/dist/elements/DocumentHeader/index.scss +52 -0
  45. package/dist/elements/EmailAndUsername/index.d.ts +14 -0
  46. package/dist/elements/EmailAndUsername/index.d.ts.map +1 -0
  47. package/dist/elements/EmailAndUsername/index.js +89 -0
  48. package/dist/elements/EmailAndUsername/index.js.map +1 -0
  49. package/dist/elements/LeaveWithoutSaving/index.d.ts.map +1 -1
  50. package/dist/elements/LeaveWithoutSaving/index.js +45 -20
  51. package/dist/elements/LeaveWithoutSaving/index.js.map +1 -1
  52. package/dist/elements/LeaveWithoutSaving/index.scss +1 -0
  53. package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts +2 -1
  54. package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +1 -1
  55. package/dist/elements/LeaveWithoutSaving/usePreventLeave.js +3 -1
  56. package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -1
  57. package/dist/elements/Logo/index.d.ts +4 -0
  58. package/dist/elements/Logo/index.d.ts.map +1 -0
  59. package/dist/elements/Logo/index.js +27 -0
  60. package/dist/elements/Logo/index.js.map +1 -0
  61. package/dist/elements/Nav/NavHamburger/index.d.ts +5 -0
  62. package/dist/elements/Nav/NavHamburger/index.d.ts.map +1 -0
  63. package/dist/elements/Nav/NavHamburger/index.js +20 -0
  64. package/dist/elements/Nav/NavHamburger/index.js.map +1 -0
  65. package/dist/elements/Nav/NavWrapper/index.d.ts +7 -0
  66. package/dist/elements/Nav/NavWrapper/index.d.ts.map +1 -0
  67. package/dist/elements/Nav/NavWrapper/index.js +23 -0
  68. package/dist/elements/Nav/NavWrapper/index.js.map +1 -0
  69. package/dist/elements/Nav/NavWrapper/index.scss +20 -0
  70. package/dist/elements/Nav/index.client.d.ts +3 -0
  71. package/dist/elements/Nav/index.client.d.ts.map +1 -0
  72. package/dist/elements/Nav/index.client.js +88 -0
  73. package/dist/elements/Nav/index.client.js.map +1 -0
  74. package/dist/elements/Nav/index.d.ts +6 -0
  75. package/dist/elements/Nav/index.d.ts.map +1 -0
  76. package/dist/elements/Nav/index.js +61 -0
  77. package/dist/elements/Nav/index.js.map +1 -0
  78. package/dist/elements/Nav/index.scss +156 -0
  79. package/dist/exports/layouts.js.map +1 -1
  80. package/dist/exports/routes.d.ts +1 -1
  81. package/dist/exports/routes.d.ts.map +1 -1
  82. package/dist/exports/routes.js +1 -1
  83. package/dist/exports/routes.js.map +1 -1
  84. package/dist/exports/templates.d.ts +3 -0
  85. package/dist/exports/templates.d.ts.map +1 -0
  86. package/dist/exports/templates.js +4 -0
  87. package/dist/exports/templates.js.map +1 -0
  88. package/dist/exports/utilities.d.ts +5 -1
  89. package/dist/exports/utilities.d.ts.map +1 -1
  90. package/dist/exports/utilities.js +5 -1
  91. package/dist/exports/utilities.js.map +1 -1
  92. package/dist/exports/views.d.ts +2 -1
  93. package/dist/exports/views.d.ts.map +1 -1
  94. package/dist/exports/views.js +2 -1
  95. package/dist/exports/views.js.map +1 -1
  96. package/dist/{next-fileupload → fetchAPI-multipart}/fileFactory.d.ts +2 -3
  97. package/dist/fetchAPI-multipart/fileFactory.d.ts.map +1 -0
  98. package/dist/fetchAPI-multipart/fileFactory.js.map +1 -0
  99. package/dist/{next-fileupload → fetchAPI-multipart}/handlers.d.ts +2 -3
  100. package/dist/fetchAPI-multipart/handlers.d.ts.map +1 -0
  101. package/dist/fetchAPI-multipart/handlers.js.map +1 -0
  102. package/dist/{next-fileupload → fetchAPI-multipart}/index.d.ts +10 -13
  103. package/dist/fetchAPI-multipart/index.d.ts.map +1 -0
  104. package/dist/{next-fileupload → fetchAPI-multipart}/index.js +3 -5
  105. package/dist/fetchAPI-multipart/index.js.map +1 -0
  106. package/dist/fetchAPI-multipart/isEligibleRequest.d.ts.map +1 -0
  107. package/dist/{next-fileupload → fetchAPI-multipart}/isEligibleRequest.js +1 -1
  108. package/dist/fetchAPI-multipart/isEligibleRequest.js.map +1 -0
  109. package/dist/fetchAPI-multipart/processMultipart.d.ts +8 -0
  110. package/dist/fetchAPI-multipart/processMultipart.d.ts.map +1 -0
  111. package/dist/{next-fileupload → fetchAPI-multipart}/processMultipart.js +44 -15
  112. package/dist/fetchAPI-multipart/processMultipart.js.map +1 -0
  113. package/dist/fetchAPI-multipart/processNested.d.ts.map +1 -0
  114. package/dist/{next-fileupload → fetchAPI-multipart}/processNested.js +2 -1
  115. package/dist/fetchAPI-multipart/processNested.js.map +1 -0
  116. package/dist/fetchAPI-multipart/uploadTimer.d.ts.map +1 -0
  117. package/dist/fetchAPI-multipart/uploadTimer.js.map +1 -0
  118. package/dist/{next-fileupload → fetchAPI-multipart}/utilities.d.ts +4 -4
  119. package/dist/fetchAPI-multipart/utilities.d.ts.map +1 -0
  120. package/dist/{next-fileupload → fetchAPI-multipart}/utilities.js +4 -4
  121. package/dist/fetchAPI-multipart/utilities.js.map +1 -0
  122. package/dist/{next-stream-file → fetchAPI-stream-file}/index.d.ts +0 -1
  123. package/dist/fetchAPI-stream-file/index.d.ts.map +1 -0
  124. package/dist/fetchAPI-stream-file/index.js.map +1 -0
  125. package/dist/index.js.map +1 -1
  126. package/dist/layouts/Root/index.d.ts +5 -5
  127. package/dist/layouts/Root/index.d.ts.map +1 -1
  128. package/dist/layouts/Root/index.js +84 -49
  129. package/dist/layouts/Root/index.js.map +1 -1
  130. package/dist/prod/styles.css +1 -1
  131. package/dist/routes/graphql/handler.d.ts +1 -1
  132. package/dist/routes/graphql/handler.d.ts.map +1 -1
  133. package/dist/routes/graphql/handler.js +17 -9
  134. package/dist/routes/graphql/handler.js.map +1 -1
  135. package/dist/routes/graphql/index.js.map +1 -1
  136. package/dist/routes/graphql/playground.d.ts +1 -1
  137. package/dist/routes/graphql/playground.d.ts.map +1 -1
  138. package/dist/routes/graphql/playground.js.map +1 -1
  139. package/dist/routes/index.d.ts +1 -1
  140. package/dist/routes/index.d.ts.map +1 -1
  141. package/dist/routes/index.js +1 -1
  142. package/dist/routes/index.js.map +1 -1
  143. package/dist/routes/rest/auth/access.d.ts.map +1 -1
  144. package/dist/routes/rest/auth/access.js +20 -5
  145. package/dist/routes/rest/auth/access.js.map +1 -1
  146. package/dist/routes/rest/auth/forgotPassword.d.ts.map +1 -1
  147. package/dist/routes/rest/auth/forgotPassword.js +15 -6
  148. package/dist/routes/rest/auth/forgotPassword.js.map +1 -1
  149. package/dist/routes/rest/auth/init.d.ts.map +1 -1
  150. package/dist/routes/rest/auth/init.js +7 -1
  151. package/dist/routes/rest/auth/init.js.map +1 -1
  152. package/dist/routes/rest/auth/login.d.ts.map +1 -1
  153. package/dist/routes/rest/auth/login.js +19 -12
  154. package/dist/routes/rest/auth/login.js.map +1 -1
  155. package/dist/routes/rest/auth/logout.d.ts.map +1 -1
  156. package/dist/routes/rest/auth/logout.js +12 -8
  157. package/dist/routes/rest/auth/logout.js.map +1 -1
  158. package/dist/routes/rest/auth/me.d.ts.map +1 -1
  159. package/dist/routes/rest/auth/me.js +6 -2
  160. package/dist/routes/rest/auth/me.js.map +1 -1
  161. package/dist/routes/rest/auth/refresh.d.ts.map +1 -1
  162. package/dist/routes/rest/auth/refresh.js +20 -26
  163. package/dist/routes/rest/auth/refresh.js.map +1 -1
  164. package/dist/routes/rest/auth/registerFirstUser.d.ts.map +1 -1
  165. package/dist/routes/rest/auth/registerFirstUser.js +18 -9
  166. package/dist/routes/rest/auth/registerFirstUser.js.map +1 -1
  167. package/dist/routes/rest/auth/resetPassword.d.ts.map +1 -1
  168. package/dist/routes/rest/auth/resetPassword.js +9 -7
  169. package/dist/routes/rest/auth/resetPassword.js.map +1 -1
  170. package/dist/routes/rest/auth/unlock.d.ts.map +1 -1
  171. package/dist/routes/rest/auth/unlock.js +15 -6
  172. package/dist/routes/rest/auth/unlock.js.map +1 -1
  173. package/dist/routes/rest/auth/verifyEmail.d.ts.map +1 -1
  174. package/dist/routes/rest/auth/verifyEmail.js +8 -3
  175. package/dist/routes/rest/auth/verifyEmail.js.map +1 -1
  176. package/dist/routes/rest/buildFormState.d.ts +1 -3
  177. package/dist/routes/rest/buildFormState.d.ts.map +1 -1
  178. package/dist/routes/rest/buildFormState.js +30 -145
  179. package/dist/routes/rest/buildFormState.js.map +1 -1
  180. package/dist/routes/rest/checkEndpoints.d.ts.map +1 -1
  181. package/dist/routes/rest/checkEndpoints.js.map +1 -1
  182. package/dist/routes/rest/collections/count.d.ts +3 -0
  183. package/dist/routes/rest/collections/count.d.ts.map +1 -0
  184. package/dist/routes/rest/collections/count.js +15 -0
  185. package/dist/routes/rest/collections/count.js.map +1 -0
  186. package/dist/routes/rest/collections/create.d.ts.map +1 -1
  187. package/dist/routes/rest/collections/create.js +7 -2
  188. package/dist/routes/rest/collections/create.js.map +1 -1
  189. package/dist/routes/rest/collections/delete.d.ts.map +1 -1
  190. package/dist/routes/rest/collections/delete.js +9 -2
  191. package/dist/routes/rest/collections/delete.js.map +1 -1
  192. package/dist/routes/rest/collections/deleteByID.d.ts.map +1 -1
  193. package/dist/routes/rest/collections/deleteByID.js +9 -2
  194. package/dist/routes/rest/collections/deleteByID.js.map +1 -1
  195. package/dist/routes/rest/collections/docAccess.d.ts.map +1 -1
  196. package/dist/routes/rest/collections/docAccess.js +6 -1
  197. package/dist/routes/rest/collections/docAccess.js.map +1 -1
  198. package/dist/routes/rest/collections/duplicate.d.ts.map +1 -1
  199. package/dist/routes/rest/collections/duplicate.js +7 -2
  200. package/dist/routes/rest/collections/duplicate.js.map +1 -1
  201. package/dist/routes/rest/collections/find.d.ts.map +1 -1
  202. package/dist/routes/rest/collections/find.js +7 -2
  203. package/dist/routes/rest/collections/find.js.map +1 -1
  204. package/dist/routes/rest/collections/findByID.d.ts.map +1 -1
  205. package/dist/routes/rest/collections/findByID.js +7 -2
  206. package/dist/routes/rest/collections/findByID.js.map +1 -1
  207. package/dist/routes/rest/collections/findVersionByID.d.ts.map +1 -1
  208. package/dist/routes/rest/collections/findVersionByID.js +7 -2
  209. package/dist/routes/rest/collections/findVersionByID.js.map +1 -1
  210. package/dist/routes/rest/collections/findVersions.d.ts.map +1 -1
  211. package/dist/routes/rest/collections/findVersions.js +7 -2
  212. package/dist/routes/rest/collections/findVersions.js.map +1 -1
  213. package/dist/routes/rest/collections/preview.d.ts.map +1 -1
  214. package/dist/routes/rest/collections/preview.js +9 -4
  215. package/dist/routes/rest/collections/preview.js.map +1 -1
  216. package/dist/routes/rest/collections/restoreVersion.d.ts.map +1 -1
  217. package/dist/routes/rest/collections/restoreVersion.js +9 -2
  218. package/dist/routes/rest/collections/restoreVersion.js.map +1 -1
  219. package/dist/routes/rest/collections/update.d.ts.map +1 -1
  220. package/dist/routes/rest/collections/update.js +9 -2
  221. package/dist/routes/rest/collections/update.js.map +1 -1
  222. package/dist/routes/rest/collections/updateByID.d.ts.map +1 -1
  223. package/dist/routes/rest/collections/updateByID.js +7 -2
  224. package/dist/routes/rest/collections/updateByID.js.map +1 -1
  225. package/dist/routes/rest/files/checkFileAccess.d.ts +2 -2
  226. package/dist/routes/rest/files/checkFileAccess.d.ts.map +1 -1
  227. package/dist/routes/rest/files/checkFileAccess.js +2 -2
  228. package/dist/routes/rest/files/checkFileAccess.js.map +1 -1
  229. package/dist/routes/rest/files/getFile.d.ts +1 -1
  230. package/dist/routes/rest/files/getFile.d.ts.map +1 -1
  231. package/dist/routes/rest/files/getFile.js +24 -13
  232. package/dist/routes/rest/files/getFile.js.map +1 -1
  233. package/dist/routes/rest/files/getFileTypeFallback.d.ts +7 -0
  234. package/dist/routes/rest/files/getFileTypeFallback.d.ts.map +1 -0
  235. package/dist/routes/rest/files/getFileTypeFallback.js +21 -0
  236. package/dist/routes/rest/files/getFileTypeFallback.js.map +1 -0
  237. package/dist/routes/rest/globals/docAccess.d.ts.map +1 -1
  238. package/dist/routes/rest/globals/docAccess.js +6 -1
  239. package/dist/routes/rest/globals/docAccess.js.map +1 -1
  240. package/dist/routes/rest/globals/findOne.d.ts.map +1 -1
  241. package/dist/routes/rest/globals/findOne.js +7 -2
  242. package/dist/routes/rest/globals/findOne.js.map +1 -1
  243. package/dist/routes/rest/globals/findVersionByID.d.ts.map +1 -1
  244. package/dist/routes/rest/globals/findVersionByID.js +7 -2
  245. package/dist/routes/rest/globals/findVersionByID.js.map +1 -1
  246. package/dist/routes/rest/globals/findVersions.d.ts.map +1 -1
  247. package/dist/routes/rest/globals/findVersions.js +7 -2
  248. package/dist/routes/rest/globals/findVersions.js.map +1 -1
  249. package/dist/routes/rest/globals/preview.d.ts.map +1 -1
  250. package/dist/routes/rest/globals/preview.js +9 -4
  251. package/dist/routes/rest/globals/preview.js.map +1 -1
  252. package/dist/routes/rest/globals/restoreVersion.d.ts.map +1 -1
  253. package/dist/routes/rest/globals/restoreVersion.js +9 -2
  254. package/dist/routes/rest/globals/restoreVersion.js.map +1 -1
  255. package/dist/routes/rest/globals/update.d.ts.map +1 -1
  256. package/dist/routes/rest/globals/update.js +7 -2
  257. package/dist/routes/rest/globals/update.js.map +1 -1
  258. package/dist/routes/rest/index.d.ts +2 -1
  259. package/dist/routes/rest/index.d.ts.map +1 -1
  260. package/dist/routes/rest/index.js +379 -228
  261. package/dist/routes/rest/index.js.map +1 -1
  262. package/dist/routes/rest/og/image.d.ts +10 -0
  263. package/dist/routes/rest/og/image.d.ts.map +1 -0
  264. package/dist/routes/rest/og/image.js +83 -0
  265. package/dist/routes/rest/og/image.js.map +1 -0
  266. package/dist/routes/rest/og/index.d.ts +11 -0
  267. package/dist/routes/rest/og/index.d.ts.map +1 -0
  268. package/dist/routes/rest/og/index.js +77 -0
  269. package/dist/routes/rest/og/index.js.map +1 -0
  270. package/dist/routes/rest/og/roboto-regular.woff +0 -0
  271. package/dist/routes/rest/routeError.d.ts +6 -5
  272. package/dist/routes/rest/routeError.d.ts.map +1 -1
  273. package/dist/routes/rest/routeError.js +28 -14
  274. package/dist/routes/rest/routeError.js.map +1 -1
  275. package/dist/routes/rest/types.d.ts +1 -1
  276. package/dist/routes/rest/types.d.ts.map +1 -1
  277. package/dist/routes/rest/types.js.map +1 -1
  278. package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts +1 -1
  279. package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts.map +1 -1
  280. package/dist/routes/rest/utilities/sanitizeCollectionID.js.map +1 -1
  281. package/dist/scss/app.scss +11 -16
  282. package/dist/scss/colors.scss +76 -76
  283. package/dist/scss/toastify.scss +1 -0
  284. package/dist/scss/toasts.scss +142 -0
  285. package/dist/scss/type.scss +15 -23
  286. package/dist/scss/vars.scss +26 -47
  287. package/dist/templates/Default/NavHamburger/index.d.ts +3 -0
  288. package/dist/templates/Default/NavHamburger/index.d.ts.map +1 -0
  289. package/dist/templates/Default/NavHamburger/index.js +13 -0
  290. package/dist/templates/Default/NavHamburger/index.js.map +1 -0
  291. package/dist/templates/Default/Wrapper/index.d.ts +8 -0
  292. package/dist/templates/Default/Wrapper/index.d.ts.map +1 -0
  293. package/dist/templates/Default/Wrapper/index.js +20 -0
  294. package/dist/templates/Default/Wrapper/index.js.map +1 -0
  295. package/dist/templates/Default/Wrapper/index.scss +57 -0
  296. package/dist/templates/Default/index.d.ts +10 -0
  297. package/dist/templates/Default/index.d.ts.map +1 -0
  298. package/dist/templates/Default/index.js +59 -0
  299. package/dist/templates/Default/index.js.map +1 -0
  300. package/dist/templates/Default/index.scss +67 -0
  301. package/dist/templates/Minimal/index.d.ts +10 -0
  302. package/dist/templates/Minimal/index.d.ts.map +1 -0
  303. package/dist/templates/Minimal/index.js +21 -0
  304. package/dist/templates/Minimal/index.js.map +1 -0
  305. package/dist/templates/Minimal/index.scss +28 -0
  306. package/dist/utilities/addDataAndFileToRequest.d.ts +8 -0
  307. package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -0
  308. package/dist/utilities/addDataAndFileToRequest.js +42 -0
  309. package/dist/utilities/addDataAndFileToRequest.js.map +1 -0
  310. package/dist/utilities/addLocalesToRequest.d.ts +17 -0
  311. package/dist/utilities/addLocalesToRequest.d.ts.map +1 -0
  312. package/dist/utilities/addLocalesToRequest.js +43 -0
  313. package/dist/utilities/addLocalesToRequest.js.map +1 -0
  314. package/dist/utilities/createPayloadRequest.d.ts +1 -1
  315. package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
  316. package/dist/utilities/createPayloadRequest.js +31 -39
  317. package/dist/utilities/createPayloadRequest.js.map +1 -1
  318. package/dist/utilities/getNextRequestI18n.d.ts +5 -5
  319. package/dist/utilities/getNextRequestI18n.d.ts.map +1 -1
  320. package/dist/utilities/getNextRequestI18n.js +4 -2
  321. package/dist/utilities/getNextRequestI18n.js.map +1 -1
  322. package/dist/utilities/getPayloadHMR.d.ts +2 -2
  323. package/dist/utilities/getPayloadHMR.d.ts.map +1 -1
  324. package/dist/utilities/getPayloadHMR.js +60 -28
  325. package/dist/utilities/getPayloadHMR.js.map +1 -1
  326. package/dist/utilities/getRequestLanguage.d.ts +2 -2
  327. package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
  328. package/dist/utilities/getRequestLanguage.js +4 -5
  329. package/dist/utilities/getRequestLanguage.js.map +1 -1
  330. package/dist/utilities/getRequestLocales.js.map +1 -1
  331. package/dist/utilities/getRequestTheme.d.ts +11 -0
  332. package/dist/utilities/getRequestTheme.d.ts.map +1 -0
  333. package/dist/utilities/getRequestTheme.js +19 -0
  334. package/dist/utilities/getRequestTheme.js.map +1 -0
  335. package/dist/utilities/headersWithCors.d.ts +8 -0
  336. package/dist/utilities/headersWithCors.d.ts.map +1 -0
  337. package/dist/utilities/headersWithCors.js +33 -0
  338. package/dist/utilities/headersWithCors.js.map +1 -0
  339. package/dist/utilities/initPage/handleAdminPage.d.ts +16 -0
  340. package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -0
  341. package/dist/utilities/initPage/handleAdminPage.js +48 -0
  342. package/dist/utilities/initPage/handleAdminPage.js.map +1 -0
  343. package/dist/utilities/initPage/handleAuthRedirect.d.ts +9 -0
  344. package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -0
  345. package/dist/utilities/initPage/handleAuthRedirect.js +39 -0
  346. package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -0
  347. package/dist/utilities/initPage/index.d.ts +4 -0
  348. package/dist/utilities/initPage/index.d.ts.map +1 -0
  349. package/dist/utilities/initPage/index.js +134 -0
  350. package/dist/utilities/initPage/index.js.map +1 -0
  351. package/dist/utilities/initPage/shared.d.ts +16 -0
  352. package/dist/utilities/initPage/shared.d.ts.map +1 -0
  353. package/dist/utilities/initPage/shared.js +29 -0
  354. package/dist/utilities/initPage/shared.js.map +1 -0
  355. package/dist/utilities/initPage/types.d.ts +25 -0
  356. package/dist/utilities/initPage/types.d.ts.map +1 -0
  357. package/dist/utilities/initPage/types.js.map +1 -0
  358. package/dist/utilities/mergeHeaders.d.ts +2 -0
  359. package/dist/utilities/mergeHeaders.d.ts.map +1 -0
  360. package/dist/utilities/mergeHeaders.js +11 -0
  361. package/dist/utilities/mergeHeaders.js.map +1 -0
  362. package/dist/utilities/meta.d.ts +3 -7
  363. package/dist/utilities/meta.d.ts.map +1 -1
  364. package/dist/utilities/meta.js +64 -25
  365. package/dist/utilities/meta.js.map +1 -1
  366. package/dist/utilities/timestamp.js.map +1 -1
  367. package/dist/views/API/LocaleSelector/index.d.ts +9 -0
  368. package/dist/views/API/LocaleSelector/index.d.ts.map +1 -0
  369. package/dist/views/API/LocaleSelector/index.js +17 -0
  370. package/dist/views/API/LocaleSelector/index.js.map +1 -0
  371. package/dist/views/API/RenderJSON/index.js +101 -69
  372. package/dist/views/API/RenderJSON/index.js.map +1 -1
  373. package/dist/views/API/index.client.d.ts.map +1 -1
  374. package/dist/views/API/index.client.js +152 -125
  375. package/dist/views/API/index.client.js.map +1 -1
  376. package/dist/views/API/index.d.ts +2 -2
  377. package/dist/views/API/index.d.ts.map +1 -1
  378. package/dist/views/API/index.js +2 -1
  379. package/dist/views/API/index.js.map +1 -1
  380. package/dist/views/API/index.scss +1 -2
  381. package/dist/views/API/meta.d.ts.map +1 -1
  382. package/dist/views/API/meta.js +17 -6
  383. package/dist/views/API/meta.js.map +1 -1
  384. package/dist/views/Account/Settings/LanguageSelector.d.ts +6 -0
  385. package/dist/views/Account/Settings/LanguageSelector.d.ts.map +1 -0
  386. package/dist/views/Account/Settings/LanguageSelector.js +19 -0
  387. package/dist/views/Account/Settings/LanguageSelector.js.map +1 -0
  388. package/dist/views/Account/Settings/index.d.ts +5 -1
  389. package/dist/views/Account/Settings/index.d.ts.map +1 -1
  390. package/dist/views/Account/Settings/index.js +26 -21
  391. package/dist/views/Account/Settings/index.js.map +1 -1
  392. package/dist/views/Account/ToggleTheme/index.d.ts.map +1 -1
  393. package/dist/views/Account/ToggleTheme/index.js +21 -20
  394. package/dist/views/Account/ToggleTheme/index.js.map +1 -1
  395. package/dist/views/Account/index.client.d.ts +3 -0
  396. package/dist/views/Account/index.client.d.ts.map +1 -0
  397. package/dist/views/Account/index.client.js +21 -0
  398. package/dist/views/Account/index.client.js.map +1 -0
  399. package/dist/views/Account/index.d.ts +1 -1
  400. package/dist/views/Account/index.d.ts.map +1 -1
  401. package/dist/views/Account/index.js +69 -42
  402. package/dist/views/Account/index.js.map +1 -1
  403. package/dist/views/Account/meta.d.ts.map +1 -1
  404. package/dist/views/Account/meta.js +4 -5
  405. package/dist/views/Account/meta.js.map +1 -1
  406. package/dist/views/CreateFirstUser/index.client.d.ts +4 -3
  407. package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
  408. package/dist/views/CreateFirstUser/index.client.js +59 -13
  409. package/dist/views/CreateFirstUser/index.client.js.map +1 -1
  410. package/dist/views/CreateFirstUser/index.d.ts +1 -1
  411. package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
  412. package/dist/views/CreateFirstUser/index.js +27 -55
  413. package/dist/views/CreateFirstUser/index.js.map +1 -1
  414. package/dist/views/CreateFirstUser/index.scss +6 -12
  415. package/dist/views/CreateFirstUser/meta.d.ts.map +1 -1
  416. package/dist/views/CreateFirstUser/meta.js +4 -5
  417. package/dist/views/CreateFirstUser/meta.js.map +1 -1
  418. package/dist/views/Dashboard/Default/index.d.ts +4 -4
  419. package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
  420. package/dist/views/Dashboard/Default/index.js +119 -23
  421. package/dist/views/Dashboard/Default/index.js.map +1 -1
  422. package/dist/views/Dashboard/Default/index.scss +11 -7
  423. package/dist/views/Dashboard/index.d.ts +1 -1
  424. package/dist/views/Dashboard/index.d.ts.map +1 -1
  425. package/dist/views/Dashboard/index.js +53 -18
  426. package/dist/views/Dashboard/index.js.map +1 -1
  427. package/dist/views/Dashboard/meta.d.ts.map +1 -1
  428. package/dist/views/Dashboard/meta.js +8 -5
  429. package/dist/views/Dashboard/meta.js.map +1 -1
  430. package/dist/views/Document/getCustomViewByKey.d.ts +2 -3
  431. package/dist/views/Document/getCustomViewByKey.d.ts.map +1 -1
  432. package/dist/views/Document/getCustomViewByKey.js +1 -1
  433. package/dist/views/Document/getCustomViewByKey.js.map +1 -1
  434. package/dist/views/Document/getCustomViewByRoute.d.ts +6 -4
  435. package/dist/views/Document/getCustomViewByRoute.d.ts.map +1 -1
  436. package/dist/views/Document/getCustomViewByRoute.js +16 -6
  437. package/dist/views/Document/getCustomViewByRoute.js.map +1 -1
  438. package/dist/views/Document/getDocumentData.d.ts +10 -0
  439. package/dist/views/Document/getDocumentData.d.ts.map +1 -0
  440. package/dist/views/Document/getDocumentData.js +32 -0
  441. package/dist/views/Document/getDocumentData.js.map +1 -0
  442. package/dist/views/Document/getDocumentPermissions.d.ts +13 -0
  443. package/dist/views/Document/getDocumentPermissions.d.ts.map +1 -0
  444. package/dist/views/Document/getDocumentPermissions.js +82 -0
  445. package/dist/views/Document/getDocumentPermissions.js.map +1 -0
  446. package/dist/views/Document/getMetaBySegment.d.ts +4 -4
  447. package/dist/views/Document/getMetaBySegment.d.ts.map +1 -1
  448. package/dist/views/Document/getMetaBySegment.js +74 -29
  449. package/dist/views/Document/getMetaBySegment.js.map +1 -1
  450. package/dist/views/Document/getViewsFromConfig.d.ts +18 -9
  451. package/dist/views/Document/getViewsFromConfig.d.ts.map +1 -1
  452. package/dist/views/Document/getViewsFromConfig.js +169 -63
  453. package/dist/views/Document/getViewsFromConfig.js.map +1 -1
  454. package/dist/views/Document/index.d.ts +1 -1
  455. package/dist/views/Document/index.d.ts.map +1 -1
  456. package/dist/views/Document/index.js +108 -84
  457. package/dist/views/Document/index.js.map +1 -1
  458. package/dist/views/Document/meta.js.map +1 -1
  459. package/dist/views/Edit/Default/Auth/APIKey.d.ts +2 -1
  460. package/dist/views/Edit/Default/Auth/APIKey.d.ts.map +1 -1
  461. package/dist/views/Edit/Default/Auth/APIKey.js +88 -42
  462. package/dist/views/Edit/Default/Auth/APIKey.js.map +1 -1
  463. package/dist/views/Edit/Default/Auth/index.d.ts.map +1 -1
  464. package/dist/views/Edit/Default/Auth/index.js +152 -71
  465. package/dist/views/Edit/Default/Auth/index.js.map +1 -1
  466. package/dist/views/Edit/Default/Auth/index.scss +17 -2
  467. package/dist/views/Edit/Default/Auth/types.d.ts +5 -2
  468. package/dist/views/Edit/Default/Auth/types.d.ts.map +1 -1
  469. package/dist/views/Edit/Default/Auth/types.js.map +1 -1
  470. package/dist/views/Edit/Default/{SetStepNav → SetDocumentStepNav}/index.d.ts +2 -3
  471. package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts.map +1 -0
  472. package/dist/views/Edit/Default/SetDocumentStepNav/index.js +79 -0
  473. package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +1 -0
  474. package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts +1 -2
  475. package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts.map +1 -1
  476. package/dist/views/Edit/Default/SetDocumentTitle/index.js +2 -4
  477. package/dist/views/Edit/Default/SetDocumentTitle/index.js.map +1 -1
  478. package/dist/views/Edit/Default/index.d.ts.map +1 -1
  479. package/dist/views/Edit/Default/index.js +127 -112
  480. package/dist/views/Edit/Default/index.js.map +1 -1
  481. package/dist/views/Edit/Default/index.scss +2 -2
  482. package/dist/views/Edit/Default/types.d.ts +1 -1
  483. package/dist/views/Edit/Default/types.d.ts.map +1 -1
  484. package/dist/views/Edit/Default/types.js.map +1 -1
  485. package/dist/views/Edit/index.client.d.ts.map +1 -1
  486. package/dist/views/Edit/index.client.js +20 -13
  487. package/dist/views/Edit/index.client.js.map +1 -1
  488. package/dist/views/Edit/index.d.ts +2 -2
  489. package/dist/views/Edit/index.d.ts.map +1 -1
  490. package/dist/views/Edit/index.js +2 -1
  491. package/dist/views/Edit/index.js.map +1 -1
  492. package/dist/views/Edit/meta.d.ts.map +1 -1
  493. package/dist/views/Edit/meta.js +31 -18
  494. package/dist/views/Edit/meta.js.map +1 -1
  495. package/dist/views/Edit/sanitizeEditViewProps.d.ts +1 -1
  496. package/dist/views/Edit/sanitizeEditViewProps.d.ts.map +1 -1
  497. package/dist/views/Edit/sanitizeEditViewProps.js.map +1 -1
  498. package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts +3 -0
  499. package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -0
  500. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +108 -0
  501. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -0
  502. package/dist/views/ForgotPassword/index.d.ts +1 -1
  503. package/dist/views/ForgotPassword/index.d.ts.map +1 -1
  504. package/dist/views/ForgotPassword/index.js +48 -57
  505. package/dist/views/ForgotPassword/index.js.map +1 -1
  506. package/dist/views/ForgotPassword/meta.d.ts.map +1 -1
  507. package/dist/views/ForgotPassword/meta.js +4 -5
  508. package/dist/views/ForgotPassword/meta.js.map +1 -1
  509. package/dist/views/List/Default/index.d.ts.map +1 -1
  510. package/dist/views/List/Default/index.js +195 -121
  511. package/dist/views/List/Default/index.js.map +1 -1
  512. package/dist/views/List/Default/index.scss +9 -27
  513. package/dist/views/List/Default/types.d.ts +2 -2
  514. package/dist/views/List/Default/types.d.ts.map +1 -1
  515. package/dist/views/List/Default/types.js.map +1 -1
  516. package/dist/views/List/index.d.ts +1 -1
  517. package/dist/views/List/index.d.ts.map +1 -1
  518. package/dist/views/List/index.js +104 -59
  519. package/dist/views/List/index.js.map +1 -1
  520. package/dist/views/List/meta.d.ts +3 -3
  521. package/dist/views/List/meta.d.ts.map +1 -1
  522. package/dist/views/List/meta.js +4 -2
  523. package/dist/views/List/meta.js.map +1 -1
  524. package/dist/views/LivePreview/Context/collisionDetection.js.map +1 -1
  525. package/dist/views/LivePreview/Context/context.d.ts +4 -4
  526. package/dist/views/LivePreview/Context/context.d.ts.map +1 -1
  527. package/dist/views/LivePreview/Context/context.js.map +1 -1
  528. package/dist/views/LivePreview/Context/index.d.ts +3 -4
  529. package/dist/views/LivePreview/Context/index.d.ts.map +1 -1
  530. package/dist/views/LivePreview/Context/index.js +10 -7
  531. package/dist/views/LivePreview/Context/index.js.map +1 -1
  532. package/dist/views/LivePreview/Context/sizeReducer.js.map +1 -1
  533. package/dist/views/LivePreview/Device/index.d.ts.map +1 -1
  534. package/dist/views/LivePreview/Device/index.js +48 -18
  535. package/dist/views/LivePreview/Device/index.js.map +1 -1
  536. package/dist/views/LivePreview/DeviceContainer/index.js +5 -3
  537. package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -1
  538. package/dist/views/LivePreview/IFrame/index.js +2 -1
  539. package/dist/views/LivePreview/IFrame/index.js.map +1 -1
  540. package/dist/views/LivePreview/Preview/index.d.ts +1 -1
  541. package/dist/views/LivePreview/Preview/index.d.ts.map +1 -1
  542. package/dist/views/LivePreview/Preview/index.js +50 -18
  543. package/dist/views/LivePreview/Preview/index.js.map +1 -1
  544. package/dist/views/LivePreview/Toolbar/Controls/index.d.ts +1 -1
  545. package/dist/views/LivePreview/Toolbar/Controls/index.d.ts.map +1 -1
  546. package/dist/views/LivePreview/Toolbar/Controls/index.js +111 -65
  547. package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
  548. package/dist/views/LivePreview/Toolbar/SizeInput/index.js +2 -1
  549. package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -1
  550. package/dist/views/LivePreview/Toolbar/index.d.ts +3 -3
  551. package/dist/views/LivePreview/Toolbar/index.d.ts.map +1 -1
  552. package/dist/views/LivePreview/Toolbar/index.js +30 -15
  553. package/dist/views/LivePreview/Toolbar/index.js.map +1 -1
  554. package/dist/views/LivePreview/ToolbarArea/index.js +5 -3
  555. package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -1
  556. package/dist/views/LivePreview/index.client.d.ts +4 -5
  557. package/dist/views/LivePreview/index.client.d.ts.map +1 -1
  558. package/dist/views/LivePreview/index.client.js +129 -113
  559. package/dist/views/LivePreview/index.client.js.map +1 -1
  560. package/dist/views/LivePreview/index.d.ts +2 -2
  561. package/dist/views/LivePreview/index.d.ts.map +1 -1
  562. package/dist/views/LivePreview/index.js +2 -1
  563. package/dist/views/LivePreview/index.js.map +1 -1
  564. package/dist/views/LivePreview/meta.d.ts.map +1 -1
  565. package/dist/views/LivePreview/meta.js +7 -22
  566. package/dist/views/LivePreview/meta.js.map +1 -1
  567. package/dist/views/LivePreview/usePopupWindow.d.ts +3 -2
  568. package/dist/views/LivePreview/usePopupWindow.d.ts.map +1 -1
  569. package/dist/views/LivePreview/usePopupWindow.js +2 -2
  570. package/dist/views/LivePreview/usePopupWindow.js.map +1 -1
  571. package/dist/views/Login/LoginField/index.d.ts +9 -0
  572. package/dist/views/Login/LoginField/index.d.ts.map +1 -0
  573. package/dist/views/Login/LoginField/index.js +49 -0
  574. package/dist/views/Login/LoginField/index.js.map +1 -0
  575. package/dist/views/Login/LoginForm/index.d.ts +3 -0
  576. package/dist/views/Login/LoginForm/index.d.ts.map +1 -1
  577. package/dist/views/Login/LoginForm/index.js +65 -40
  578. package/dist/views/Login/LoginForm/index.js.map +1 -1
  579. package/dist/views/Login/index.d.ts +1 -1
  580. package/dist/views/Login/index.d.ts.map +1 -1
  581. package/dist/views/Login/index.js +52 -15
  582. package/dist/views/Login/index.js.map +1 -1
  583. package/dist/views/Login/meta.d.ts.map +1 -1
  584. package/dist/views/Login/meta.js +4 -5
  585. package/dist/views/Login/meta.js.map +1 -1
  586. package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
  587. package/dist/views/Logout/LogoutClient.js +28 -12
  588. package/dist/views/Logout/LogoutClient.js.map +1 -1
  589. package/dist/views/Logout/index.d.ts +3 -3
  590. package/dist/views/Logout/index.d.ts.map +1 -1
  591. package/dist/views/Logout/index.js +11 -12
  592. package/dist/views/Logout/index.js.map +1 -1
  593. package/dist/views/Logout/meta.d.ts.map +1 -1
  594. package/dist/views/Logout/meta.js +2 -4
  595. package/dist/views/Logout/meta.js.map +1 -1
  596. package/dist/views/NotFound/index.client.d.ts.map +1 -1
  597. package/dist/views/NotFound/index.client.js +25 -16
  598. package/dist/views/NotFound/index.client.js.map +1 -1
  599. package/dist/views/NotFound/index.d.ts +4 -3
  600. package/dist/views/NotFound/index.d.ts.map +1 -1
  601. package/dist/views/NotFound/index.js +25 -14
  602. package/dist/views/NotFound/index.js.map +1 -1
  603. package/dist/views/NotFound/meta.d.ts +3 -3
  604. package/dist/views/NotFound/meta.d.ts.map +1 -1
  605. package/dist/views/NotFound/meta.js +2 -4
  606. package/dist/views/NotFound/meta.js.map +1 -1
  607. package/dist/views/ResetPassword/index.client.d.ts +7 -0
  608. package/dist/views/ResetPassword/index.client.d.ts.map +1 -0
  609. package/dist/views/ResetPassword/index.client.js +72 -0
  610. package/dist/views/ResetPassword/index.client.js.map +1 -0
  611. package/dist/views/ResetPassword/index.d.ts +1 -1
  612. package/dist/views/ResetPassword/index.d.ts.map +1 -1
  613. package/dist/views/ResetPassword/index.js +55 -56
  614. package/dist/views/ResetPassword/index.js.map +1 -1
  615. package/dist/views/ResetPassword/index.scss +2 -12
  616. package/dist/views/ResetPassword/meta.d.ts.map +1 -1
  617. package/dist/views/ResetPassword/meta.js +4 -5
  618. package/dist/views/ResetPassword/meta.js.map +1 -1
  619. package/dist/views/Root/generateCustomViewMetadata.d.ts +11 -0
  620. package/dist/views/Root/generateCustomViewMetadata.d.ts.map +1 -0
  621. package/dist/views/Root/generateCustomViewMetadata.js +23 -0
  622. package/dist/views/Root/generateCustomViewMetadata.js.map +1 -0
  623. package/dist/views/Root/getCustomViewByRoute.d.ts +7 -2
  624. package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -1
  625. package/dist/views/Root/getCustomViewByRoute.js +29 -11
  626. package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
  627. package/dist/views/Root/getViewFromConfig.d.ts +12 -7
  628. package/dist/views/Root/getViewFromConfig.d.ts.map +1 -1
  629. package/dist/views/Root/getViewFromConfig.js +59 -21
  630. package/dist/views/Root/getViewFromConfig.js.map +1 -1
  631. package/dist/views/Root/index.d.ts +9 -7
  632. package/dist/views/Root/index.d.ts.map +1 -1
  633. package/dist/views/Root/index.js +64 -19
  634. package/dist/views/Root/index.js.map +1 -1
  635. package/dist/views/Root/isPathMatchingRoute.js.map +1 -1
  636. package/dist/views/Root/meta.d.ts +1 -1
  637. package/dist/views/Root/meta.d.ts.map +1 -1
  638. package/dist/views/Root/meta.js +19 -21
  639. package/dist/views/Root/meta.js.map +1 -1
  640. package/dist/views/Unauthorized/index.d.ts +2 -2
  641. package/dist/views/Unauthorized/index.d.ts.map +1 -1
  642. package/dist/views/Unauthorized/index.js +22 -11
  643. package/dist/views/Unauthorized/index.js.map +1 -1
  644. package/dist/views/Unauthorized/meta.d.ts.map +1 -1
  645. package/dist/views/Unauthorized/meta.js +4 -5
  646. package/dist/views/Unauthorized/meta.js.map +1 -1
  647. package/dist/views/Verify/index.d.ts +1 -1
  648. package/dist/views/Verify/index.d.ts.map +1 -1
  649. package/dist/views/Verify/index.js +33 -11
  650. package/dist/views/Verify/index.js.map +1 -1
  651. package/dist/views/Verify/meta.d.ts.map +1 -1
  652. package/dist/views/Verify/meta.js +4 -5
  653. package/dist/views/Verify/meta.js.map +1 -1
  654. package/dist/views/Version/Default/SetStepNav.d.ts +8 -10
  655. package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
  656. package/dist/views/Version/Default/SetStepNav.js +35 -23
  657. package/dist/views/Version/Default/SetStepNav.js.map +1 -1
  658. package/dist/views/Version/Default/index.d.ts.map +1 -1
  659. package/dist/views/Version/Default/index.js +100 -85
  660. package/dist/views/Version/Default/index.js.map +1 -1
  661. package/dist/views/Version/Default/types.d.ts +9 -11
  662. package/dist/views/Version/Default/types.d.ts.map +1 -1
  663. package/dist/views/Version/Default/types.js.map +1 -1
  664. package/dist/views/Version/RenderFieldsToDiff/Label/index.js +5 -3
  665. package/dist/views/Version/RenderFieldsToDiff/Label/index.js.map +1 -1
  666. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts +2 -2
  667. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
  668. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +66 -51
  669. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
  670. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts +2 -2
  671. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts.map +1 -1
  672. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +31 -19
  673. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -1
  674. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts +3 -2
  675. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -1
  676. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +67 -36
  677. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
  678. package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +2 -1
  679. package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js.map +1 -1
  680. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts +3 -6
  681. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +1 -1
  682. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +23 -12
  683. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
  684. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +3 -6
  685. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -1
  686. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +31 -30
  687. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
  688. package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +2 -1
  689. package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js.map +1 -1
  690. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts +3 -2
  691. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts.map +1 -1
  692. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +22 -11
  693. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
  694. package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js.map +1 -1
  695. package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts +21 -58
  696. package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -1
  697. package/dist/views/Version/RenderFieldsToDiff/fields/index.js +4 -3
  698. package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
  699. package/dist/views/Version/RenderFieldsToDiff/fields/styles.js.map +1 -1
  700. package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts +16 -17
  701. package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts.map +1 -1
  702. package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +1 -1
  703. package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -1
  704. package/dist/views/Version/RenderFieldsToDiff/index.js +95 -88
  705. package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
  706. package/dist/views/Version/RenderFieldsToDiff/types.d.ts +12 -13
  707. package/dist/views/Version/RenderFieldsToDiff/types.d.ts.map +1 -1
  708. package/dist/views/Version/RenderFieldsToDiff/types.js.map +1 -1
  709. package/dist/views/Version/Restore/index.d.ts.map +1 -1
  710. package/dist/views/Version/Restore/index.js +92 -40
  711. package/dist/views/Version/Restore/index.js.map +1 -1
  712. package/dist/views/Version/Restore/index.scss +35 -2
  713. package/dist/views/Version/Restore/types.d.ts +2 -1
  714. package/dist/views/Version/Restore/types.d.ts.map +1 -1
  715. package/dist/views/Version/Restore/types.js.map +1 -1
  716. package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
  717. package/dist/views/Version/SelectComparison/index.js +77 -52
  718. package/dist/views/Version/SelectComparison/index.js.map +1 -1
  719. package/dist/views/Version/SelectComparison/index.scss +1 -1
  720. package/dist/views/Version/SelectComparison/types.d.ts +3 -3
  721. package/dist/views/Version/SelectComparison/types.d.ts.map +1 -1
  722. package/dist/views/Version/SelectComparison/types.js.map +1 -1
  723. package/dist/views/Version/SelectLocales/index.d.ts.map +1 -1
  724. package/dist/views/Version/SelectLocales/index.js +19 -14
  725. package/dist/views/Version/SelectLocales/index.js.map +1 -1
  726. package/dist/views/Version/SelectLocales/types.d.ts +1 -1
  727. package/dist/views/Version/SelectLocales/types.d.ts.map +1 -1
  728. package/dist/views/Version/SelectLocales/types.js.map +1 -1
  729. package/dist/views/Version/index.d.ts +2 -2
  730. package/dist/views/Version/index.d.ts.map +1 -1
  731. package/dist/views/Version/index.js +57 -44
  732. package/dist/views/Version/index.js.map +1 -1
  733. package/dist/views/Version/meta.d.ts.map +1 -1
  734. package/dist/views/Version/meta.js +25 -17
  735. package/dist/views/Version/meta.js.map +1 -1
  736. package/dist/views/Versions/buildColumns.d.ts +5 -3
  737. package/dist/views/Versions/buildColumns.d.ts.map +1 -1
  738. package/dist/views/Versions/buildColumns.js +48 -20
  739. package/dist/views/Versions/buildColumns.js.map +1 -1
  740. package/dist/views/Versions/cells/AutosaveCell/index.d.ts +7 -1
  741. package/dist/views/Versions/cells/AutosaveCell/index.d.ts.map +1 -1
  742. package/dist/views/Versions/cells/AutosaveCell/index.js +45 -7
  743. package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
  744. package/dist/views/Versions/cells/CreatedAt/index.d.ts.map +1 -1
  745. package/dist/views/Versions/cells/CreatedAt/index.js +20 -14
  746. package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
  747. package/dist/views/Versions/cells/ID/index.js +5 -2
  748. package/dist/views/Versions/cells/ID/index.js.map +1 -1
  749. package/dist/views/Versions/getLatestVersion.d.ts +14 -0
  750. package/dist/views/Versions/getLatestVersion.d.ts.map +1 -0
  751. package/dist/views/Versions/getLatestVersion.js +34 -0
  752. package/dist/views/Versions/getLatestVersion.js.map +1 -0
  753. package/dist/views/Versions/index.client.d.ts +6 -6
  754. package/dist/views/Versions/index.client.d.ts.map +1 -1
  755. package/dist/views/Versions/index.client.js +69 -42
  756. package/dist/views/Versions/index.client.js.map +1 -1
  757. package/dist/views/Versions/index.d.ts +2 -2
  758. package/dist/views/Versions/index.d.ts.map +1 -1
  759. package/dist/views/Versions/index.js +79 -29
  760. package/dist/views/Versions/index.js.map +1 -1
  761. package/dist/views/Versions/meta.d.ts.map +1 -1
  762. package/dist/views/Versions/meta.js +25 -16
  763. package/dist/views/Versions/meta.js.map +1 -1
  764. package/dist/views/Versions/types.d.ts +1 -3
  765. package/dist/views/Versions/types.d.ts.map +1 -1
  766. package/dist/views/Versions/types.js.map +1 -1
  767. package/dist/withPayload.d.ts +1 -1
  768. package/dist/withPayload.d.ts.map +1 -1
  769. package/dist/withPayload.js +68 -18
  770. package/dist/withPayload.js.map +1 -1
  771. package/package.json +68 -50
  772. package/dist/next-fileupload/fileFactory.d.ts.map +0 -1
  773. package/dist/next-fileupload/fileFactory.js.map +0 -1
  774. package/dist/next-fileupload/handlers.d.ts.map +0 -1
  775. package/dist/next-fileupload/handlers.js.map +0 -1
  776. package/dist/next-fileupload/index.d.ts.map +0 -1
  777. package/dist/next-fileupload/index.js.map +0 -1
  778. package/dist/next-fileupload/isEligibleRequest.d.ts.map +0 -1
  779. package/dist/next-fileupload/isEligibleRequest.js.map +0 -1
  780. package/dist/next-fileupload/processMultipart.d.ts +0 -8
  781. package/dist/next-fileupload/processMultipart.d.ts.map +0 -1
  782. package/dist/next-fileupload/processMultipart.js.map +0 -1
  783. package/dist/next-fileupload/processNested.d.ts.map +0 -1
  784. package/dist/next-fileupload/processNested.js.map +0 -1
  785. package/dist/next-fileupload/uploadTimer.d.ts.map +0 -1
  786. package/dist/next-fileupload/uploadTimer.js.map +0 -1
  787. package/dist/next-fileupload/utilities.d.ts.map +0 -1
  788. package/dist/next-fileupload/utilities.js.map +0 -1
  789. package/dist/next-stream-file/index.d.ts.map +0 -1
  790. package/dist/next-stream-file/index.js.map +0 -1
  791. package/dist/prod/payload/favicon.svg +0 -15
  792. package/dist/prod/payload/og-image.png +0 -0
  793. package/dist/utilities/buildFieldSchemaMap/index.d.ts +0 -4
  794. package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +0 -1
  795. package/dist/utilities/buildFieldSchemaMap/index.js +0 -28
  796. package/dist/utilities/buildFieldSchemaMap/index.js.map +0 -1
  797. package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts +0 -14
  798. package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +0 -1
  799. package/dist/utilities/buildFieldSchemaMap/traverseFields.js +0 -72
  800. package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +0 -1
  801. package/dist/utilities/buildFieldSchemaMap/types.d.ts +0 -3
  802. package/dist/utilities/buildFieldSchemaMap/types.d.ts.map +0 -1
  803. package/dist/utilities/buildFieldSchemaMap/types.js.map +0 -1
  804. package/dist/utilities/getDataAndFile.d.ts +0 -12
  805. package/dist/utilities/getDataAndFile.d.ts.map +0 -1
  806. package/dist/utilities/getDataAndFile.js +0 -68
  807. package/dist/utilities/getDataAndFile.js.map +0 -1
  808. package/dist/utilities/initPage.d.ts +0 -12
  809. package/dist/utilities/initPage.d.ts.map +0 -1
  810. package/dist/utilities/initPage.js +0 -98
  811. package/dist/utilities/initPage.js.map +0 -1
  812. package/dist/views/Dashboard/Default/index.client.d.ts +0 -10
  813. package/dist/views/Dashboard/Default/index.client.d.ts.map +0 -1
  814. package/dist/views/Dashboard/Default/index.client.js +0 -103
  815. package/dist/views/Dashboard/Default/index.client.js.map +0 -1
  816. package/dist/views/Edit/Default/SetStepNav/index.d.ts.map +0 -1
  817. package/dist/views/Edit/Default/SetStepNav/index.js +0 -64
  818. package/dist/views/Edit/Default/SetStepNav/index.js.map +0 -1
  819. package/dist/views/Version/shared.d.ts +0 -9
  820. package/dist/views/Version/shared.d.ts.map +0 -1
  821. package/dist/views/Version/shared.js +0 -10
  822. package/dist/views/Version/shared.js.map +0 -1
  823. package/dist/webpackEntry.d.ts +0 -5
  824. package/dist/webpackEntry.d.ts.map +0 -1
  825. package/dist/webpackEntry.js +0 -6
  826. package/dist/webpackEntry.js.map +0 -1
  827. package/src/index.js +0 -1
  828. /package/dist/{next-fileupload → fetchAPI-multipart}/fileFactory.js +0 -0
  829. /package/dist/{next-fileupload → fetchAPI-multipart}/handlers.js +0 -0
  830. /package/dist/{next-fileupload → fetchAPI-multipart}/isEligibleRequest.d.ts +0 -0
  831. /package/dist/{next-fileupload → fetchAPI-multipart}/processNested.d.ts +0 -0
  832. /package/dist/{next-fileupload → fetchAPI-multipart}/uploadTimer.d.ts +0 -0
  833. /package/dist/{next-fileupload → fetchAPI-multipart}/uploadTimer.js +0 -0
  834. /package/dist/{next-stream-file → fetchAPI-stream-file}/index.js +0 -0
  835. /package/dist/utilities/{buildFieldSchemaMap → initPage}/types.js +0 -0
@@ -1,6 +1,7 @@
1
1
  import httpStatus from 'http-status';
2
- import { deleteByIDOperation } from 'payload/operations';
3
- import { isNumber } from 'payload/utilities';
2
+ import { deleteByIDOperation } from 'payload';
3
+ import { isNumber } from 'payload/shared';
4
+ import { headersWithCors } from '../../../utilities/headersWithCors.js';
4
5
  import { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js';
5
6
  export const deleteByID = async ({ id: incomingID, collection, req })=>{
6
7
  const { searchParams } = req;
@@ -16,10 +17,15 @@ export const deleteByID = async ({ id: incomingID, collection, req })=>{
16
17
  depth: isNumber(depth) ? depth : undefined,
17
18
  req
18
19
  });
20
+ const headers = headersWithCors({
21
+ headers: new Headers(),
22
+ req
23
+ });
19
24
  if (!doc) {
20
25
  return Response.json({
21
26
  message: req.t('general:notFound')
22
27
  }, {
28
+ headers,
23
29
  status: httpStatus.NOT_FOUND
24
30
  });
25
31
  }
@@ -27,6 +33,7 @@ export const deleteByID = async ({ id: incomingID, collection, req })=>{
27
33
  doc,
28
34
  message: req.t('general:deletedSuccessfully')
29
35
  }, {
36
+ headers,
30
37
  status: httpStatus.OK
31
38
  });
32
39
  };
@@ -1 +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\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const deleteByID: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\n\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","sanitizeCollectionID","deleteByID","id","incomingID","collection","req","searchParams","depth","get","collectionSlug","config","slug","payload","doc","undefined","Response","json","message","t","status","NOT_FOUND","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,mBAAmB,QAAQ,qBAAoB;AACxD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,aAA2C,OAAO,EAC7DC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJM,gBAAgBL,WAAWM,MAAM,CAACC,IAAI;QACtCC,SAASP,IAAIO,OAAO;IACtB;IAEA,MAAMC,MAAM,MAAMf,oBAAoB;QACpCI;QACAE;QACAG,OAAOR,SAASQ,SAASA,QAAQO;QACjCT;IACF;IAEA,IAAI,CAACQ,KAAK;QACR,OAAOE,SAASC,IAAI,CAClB;YACEC,SAASZ,IAAIa,CAAC,CAAC;QACjB,GACA;YACEC,QAAQtB,WAAWuB,SAAS;QAC9B;IAEJ;IAEA,OAAOL,SAASC,IAAI,CAClB;QACEH;QACAI,SAASZ,IAAIa,CAAC,CAAC;IACjB,GACA;QACEC,QAAQtB,WAAWwB,EAAE;IACvB;AAEJ,EAAC"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/deleteByID.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { deleteByIDOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const deleteByID: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\n\n const doc = await deleteByIDOperation({\n id,\n collection,\n depth: isNumber(depth) ? depth : undefined,\n req,\n })\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n if (!doc) {\n return Response.json(\n {\n message: req.t('general:notFound'),\n },\n {\n headers,\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 headers,\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","deleteByIDOperation","isNumber","headersWithCors","sanitizeCollectionID","deleteByID","id","incomingID","collection","req","searchParams","depth","get","collectionSlug","config","slug","payload","doc","undefined","headers","Headers","Response","json","message","t","status","NOT_FOUND","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,mBAAmB,QAAQ,UAAS;AAC7C,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,aAA2C,OAAO,EAC7DC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJM,gBAAgBL,WAAWM,MAAM,CAACC,IAAI;QACtCC,SAASP,IAAIO,OAAO;IACtB;IAEA,MAAMC,MAAM,MAAMhB,oBAAoB;QACpCK;QACAE;QACAG,OAAOT,SAASS,SAASA,QAAQO;QACjCT;IACF;IAEA,MAAMU,UAAUhB,gBAAgB;QAC9BgB,SAAS,IAAIC;QACbX;IACF;IAEA,IAAI,CAACQ,KAAK;QACR,OAAOI,SAASC,IAAI,CAClB;YACEC,SAASd,IAAIe,CAAC,CAAC;QACjB,GACA;YACEL;YACAM,QAAQzB,WAAW0B,SAAS;QAC9B;IAEJ;IAEA,OAAOL,SAASC,IAAI,CAClB;QACEL;QACAM,SAASd,IAAIe,CAAC,CAAC;IACjB,GACA;QACEL;QACAM,QAAQzB,WAAW2B,EAAE;IACvB;AAEJ,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"docAccess.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/docAccess.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAE/D,eAAO,MAAM,SAAS,EAAE,4BAUvB,CAAA"}
1
+ {"version":3,"file":"docAccess.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/docAccess.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAI/D,eAAO,MAAM,SAAS,EAAE,4BAcvB,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import httpStatus from 'http-status';
2
- import { docAccessOperation } from 'payload/operations';
2
+ import { docAccessOperation } from 'payload';
3
+ import { headersWithCors } from '../../../utilities/headersWithCors.js';
3
4
  export const docAccess = async ({ id, collection, req })=>{
4
5
  const result = await docAccessOperation({
5
6
  id,
@@ -7,6 +8,10 @@ export const docAccess = async ({ id, collection, req })=>{
7
8
  req
8
9
  });
9
10
  return Response.json(result, {
11
+ headers: headersWithCors({
12
+ headers: new Headers(),
13
+ req
14
+ }),
10
15
  status: httpStatus.OK
11
16
  });
12
17
  };
@@ -1 +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"],"rangeMappings":";;;;;;;;;;;","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"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/docAccess.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { docAccessOperation } from 'payload'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.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 headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","docAccessOperation","headersWithCors","docAccess","id","collection","req","result","Response","json","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,kBAAkB,QAAQ,UAAS;AAI5C,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,YAA0C,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACnF,MAAMC,SAAS,MAAMN,mBAAmB;QACtCG;QACAC;QACAC;IACF;IAEA,OAAOE,SAASC,IAAI,CAACF,QAAQ;QAC3BG,SAASR,gBAAgB;YACvBQ,SAAS,IAAIC;YACbL;QACF;QACAM,QAAQZ,WAAWa,EAAE;IACvB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"duplicate.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/duplicate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAI/D,eAAO,MAAM,SAAS,EAAE,4BAqCvB,CAAA"}
1
+ {"version":3,"file":"duplicate.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/duplicate.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAK/D,eAAO,MAAM,SAAS,EAAE,4BAyCvB,CAAA"}
@@ -1,7 +1,8 @@
1
1
  import { getTranslation } from '@payloadcms/translations';
2
2
  import httpStatus from 'http-status';
3
- import { duplicateOperation } from 'payload/operations';
4
- import { isNumber } from 'payload/utilities';
3
+ import { duplicateOperation } from 'payload';
4
+ import { isNumber } from 'payload/shared';
5
+ import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
6
  import { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js';
6
7
  export const duplicate = async ({ id: incomingID, collection, req })=>{
7
8
  const { searchParams } = req;
@@ -27,6 +28,10 @@ export const duplicate = async ({ id: incomingID, collection, req })=>{
27
28
  doc,
28
29
  message
29
30
  }, {
31
+ headers: headersWithCors({
32
+ headers: new Headers(),
33
+ req
34
+ }),
30
35
  status: httpStatus.OK
31
36
  });
32
37
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/collections/duplicate.ts"],"sourcesContent":["import { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { duplicateOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const duplicate: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n // draft defaults to true, unless explicitly set requested as false to prevent the newly duplicated document from being published\n const draft = searchParams.get('draft') !== 'false'\n\n const id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\n\n const doc = await duplicateOperation({\n id,\n collection,\n depth: isNumber(depth) ? Number(depth) : undefined,\n draft,\n req,\n })\n\n const message = req.t('general:successfullyDuplicated', {\n label: getTranslation(collection.config.labels.singular, req.i18n),\n })\n\n return Response.json(\n {\n doc,\n message,\n },\n {\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["getTranslation","httpStatus","duplicateOperation","isNumber","sanitizeCollectionID","duplicate","id","incomingID","collection","req","searchParams","depth","get","draft","collectionSlug","config","slug","payload","doc","Number","undefined","message","t","label","labels","singular","i18n","Response","json","status","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,gBAAgB,cAAa;AACpC,SAASC,kBAAkB,QAAQ,qBAAoB;AACvD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,YAA0C,OAAO,EAC5DC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAC/B,iIAAiI;IACjI,MAAMC,QAAQH,aAAaE,GAAG,CAAC,aAAa;IAE5C,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJO,gBAAgBN,WAAWO,MAAM,CAACC,IAAI;QACtCC,SAASR,IAAIQ,OAAO;IACtB;IAEA,MAAMC,MAAM,MAAMhB,mBAAmB;QACnCI;QACAE;QACAG,OAAOR,SAASQ,SAASQ,OAAOR,SAASS;QACzCP;QACAJ;IACF;IAEA,MAAMY,UAAUZ,IAAIa,CAAC,CAAC,kCAAkC;QACtDC,OAAOvB,eAAeQ,WAAWO,MAAM,CAACS,MAAM,CAACC,QAAQ,EAAEhB,IAAIiB,IAAI;IACnE;IAEA,OAAOC,SAASC,IAAI,CAClB;QACEV;QACAG;IACF,GACA;QACEQ,QAAQ5B,WAAW6B,EAAE;IACvB;AAEJ,EAAC"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/duplicate.ts"],"sourcesContent":["import { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { duplicateOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const duplicate: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n // draft defaults to true, unless explicitly set requested as false to prevent the newly duplicated document from being published\n const draft = searchParams.get('draft') !== 'false'\n\n const id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\n\n const doc = await duplicateOperation({\n id,\n collection,\n depth: isNumber(depth) ? Number(depth) : undefined,\n draft,\n req,\n })\n\n const message = req.t('general:successfullyDuplicated', {\n label: getTranslation(collection.config.labels.singular, req.i18n),\n })\n\n return Response.json(\n {\n doc,\n message,\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["getTranslation","httpStatus","duplicateOperation","isNumber","headersWithCors","sanitizeCollectionID","duplicate","id","incomingID","collection","req","searchParams","depth","get","draft","collectionSlug","config","slug","payload","doc","Number","undefined","message","t","label","labels","singular","i18n","Response","json","headers","Headers","status","OK"],"mappings":"AAAA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,gBAAgB,cAAa;AACpC,SAASC,kBAAkB,QAAQ,UAAS;AAC5C,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,YAA0C,OAAO,EAC5DC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAC/B,iIAAiI;IACjI,MAAMC,QAAQH,aAAaE,GAAG,CAAC,aAAa;IAE5C,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJO,gBAAgBN,WAAWO,MAAM,CAACC,IAAI;QACtCC,SAASR,IAAIQ,OAAO;IACtB;IAEA,MAAMC,MAAM,MAAMjB,mBAAmB;QACnCK;QACAE;QACAG,OAAOT,SAASS,SAASQ,OAAOR,SAASS;QACzCP;QACAJ;IACF;IAEA,MAAMY,UAAUZ,IAAIa,CAAC,CAAC,kCAAkC;QACtDC,OAAOxB,eAAeS,WAAWO,MAAM,CAACS,MAAM,CAACC,QAAQ,EAAEhB,IAAIiB,IAAI;IACnE;IAEA,OAAOC,SAASC,IAAI,CAClB;QACEV;QACAG;IACF,GACA;QACEQ,SAAS1B,gBAAgB;YACvB0B,SAAS,IAAIC;YACbrB;QACF;QACAsB,QAAQ/B,WAAWgC,EAAE;IACvB;AAEJ,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/find.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEzD,eAAO,MAAM,IAAI,EAAE,sBAwBlB,CAAA"}
1
+ {"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/find.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,IAAI,EAAE,sBA4BlB,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import httpStatus from 'http-status';
2
- import { findOperation } from 'payload/operations';
3
- import { isNumber } from 'payload/utilities';
2
+ import { findOperation } from 'payload';
3
+ import { isNumber } from 'payload/shared';
4
+ import { headersWithCors } from '../../../utilities/headersWithCors.js';
4
5
  export const find = async ({ collection, req })=>{
5
6
  const { depth, draft, limit, page, sort, where } = req.query;
6
7
  const result = await findOperation({
@@ -14,6 +15,10 @@ export const find = async ({ collection, req })=>{
14
15
  where
15
16
  });
16
17
  return Response.json(result, {
18
+ headers: headersWithCors({
19
+ headers: new Headers(),
20
+ req
21
+ }),
17
22
  status: httpStatus.OK
18
23
  });
19
24
  };
@@ -1 +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"],"rangeMappings":";;;;;;;;;;;;;;;;;;","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"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/find.ts"],"sourcesContent":["import type { Where } from 'payload'\n\nimport httpStatus from 'http-status'\nimport { findOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.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 headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","findOperation","isNumber","headersWithCors","find","collection","req","depth","draft","limit","page","sort","where","query","result","Number","undefined","Response","json","headers","Headers","status","OK"],"mappings":"AAEA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,aAAa,QAAQ,UAAS;AACvC,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,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,MAAMb,cAAc;QACjCI;QACAE,OAAOL,SAASK,SAASQ,OAAOR,SAASS;QACzCR,OAAOA,UAAU;QACjBC,OAAOP,SAASO,SAASM,OAAON,SAASO;QACzCN,MAAMR,SAASQ,QAAQK,OAAOL,QAAQM;QACtCV;QACAK;QACAC;IACF;IAEA,OAAOK,SAASC,IAAI,CAACJ,QAAQ;QAC3BK,SAAShB,gBAAgB;YACvBgB,SAAS,IAAIC;YACbd;QACF;QACAe,QAAQrB,WAAWsB,EAAE;IACvB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"findByID.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/findByID.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAI/D,eAAO,MAAM,QAAQ,EAAE,4BAyBtB,CAAA"}
1
+ {"version":3,"file":"findByID.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/findByID.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAK/D,eAAO,MAAM,QAAQ,EAAE,4BA6BtB,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import httpStatus from 'http-status';
2
- import { findByIDOperation } from 'payload/operations';
3
- import { isNumber } from 'payload/utilities';
2
+ import { findByIDOperation } from 'payload';
3
+ import { isNumber } from 'payload/shared';
4
+ import { headersWithCors } from '../../../utilities/headersWithCors.js';
4
5
  import { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js';
5
6
  export const findByID = async ({ id: incomingID, collection, req })=>{
6
7
  const { searchParams } = req;
@@ -18,6 +19,10 @@ export const findByID = async ({ id: incomingID, collection, req })=>{
18
19
  req
19
20
  });
20
21
  return Response.json(result, {
22
+ headers: headersWithCors({
23
+ headers: new Headers(),
24
+ req
25
+ }),
21
26
  status: httpStatus.OK
22
27
  });
23
28
  };
@@ -1 +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\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const findByID: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\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","sanitizeCollectionID","findByID","id","incomingID","collection","req","searchParams","depth","get","collectionSlug","config","slug","payload","result","Number","undefined","draft","Response","json","status","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,iBAAiB,QAAQ,qBAAoB;AACtD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,WAAyC,OAAO,EAC3DC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJM,gBAAgBL,WAAWM,MAAM,CAACC,IAAI;QACtCC,SAASP,IAAIO,OAAO;IACtB;IAEA,MAAMC,SAAS,MAAMf,kBAAkB;QACrCI;QACAE;QACAG,OAAOR,SAASQ,SAASO,OAAOP,SAASQ;QACzCC,OAAOV,aAAaE,GAAG,CAAC,aAAa;QACrCH;IACF;IAEA,OAAOY,SAASC,IAAI,CAACL,QAAQ;QAC3BM,QAAQtB,WAAWuB,EAAE;IACvB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/findByID.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { findByIDOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const findByID: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\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 headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","findByIDOperation","isNumber","headersWithCors","sanitizeCollectionID","findByID","id","incomingID","collection","req","searchParams","depth","get","collectionSlug","config","slug","payload","result","Number","undefined","draft","Response","json","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,iBAAiB,QAAQ,UAAS;AAC3C,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,WAAyC,OAAO,EAC3DC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJM,gBAAgBL,WAAWM,MAAM,CAACC,IAAI;QACtCC,SAASP,IAAIO,OAAO;IACtB;IAEA,MAAMC,SAAS,MAAMhB,kBAAkB;QACrCK;QACAE;QACAG,OAAOT,SAASS,SAASO,OAAOP,SAASQ;QACzCC,OAAOV,aAAaE,GAAG,CAAC,aAAa;QACrCH;IACF;IAEA,OAAOY,SAASC,IAAI,CAACL,QAAQ;QAC3BM,SAASpB,gBAAgB;YACvBoB,SAAS,IAAIC;YACbf;QACF;QACAgB,QAAQzB,WAAW0B,EAAE;IACvB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/findVersionByID.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAI/D,eAAO,MAAM,eAAe,EAAE,4BAwB7B,CAAA"}
1
+ {"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/findVersionByID.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAK/D,eAAO,MAAM,eAAe,EAAE,4BA4B7B,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import httpStatus from 'http-status';
2
- import { findVersionByIDOperation } from 'payload/operations';
3
- import { isNumber } from 'payload/utilities';
2
+ import { findVersionByIDOperation } from 'payload';
3
+ import { isNumber } from 'payload/shared';
4
+ import { headersWithCors } from '../../../utilities/headersWithCors.js';
4
5
  import { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js';
5
6
  export const findVersionByID = async ({ id: incomingID, collection, req })=>{
6
7
  const { searchParams } = req;
@@ -17,6 +18,10 @@ export const findVersionByID = async ({ id: incomingID, collection, req })=>{
17
18
  req
18
19
  });
19
20
  return Response.json(result, {
21
+ headers: headersWithCors({
22
+ headers: new Headers(),
23
+ req
24
+ }),
20
25
  status: httpStatus.OK
21
26
  });
22
27
  };
@@ -1 +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\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const findVersionByID: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\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","sanitizeCollectionID","findVersionByID","id","incomingID","collection","req","searchParams","depth","get","collectionSlug","config","slug","payload","result","Number","undefined","Response","json","status","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,wBAAwB,QAAQ,qBAAoB;AAC7D,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,kBAAgD,OAAO,EAClEC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJM,gBAAgBL,WAAWM,MAAM,CAACC,IAAI;QACtCC,SAASP,IAAIO,OAAO;IACtB;IAEA,MAAMC,SAAS,MAAMf,yBAAyB;QAC5CI;QACAE;QACAG,OAAOR,SAASQ,SAASO,OAAOP,SAASQ;QACzCV;IACF;IAEA,OAAOW,SAASC,IAAI,CAACJ,QAAQ;QAC3BK,QAAQrB,WAAWsB,EAAE;IACvB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/findVersionByID.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { findVersionByIDOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const findVersionByID: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\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 headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","findVersionByIDOperation","isNumber","headersWithCors","sanitizeCollectionID","findVersionByID","id","incomingID","collection","req","searchParams","depth","get","collectionSlug","config","slug","payload","result","Number","undefined","Response","json","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,wBAAwB,QAAQ,UAAS;AAClD,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,kBAAgD,OAAO,EAClEC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJM,gBAAgBL,WAAWM,MAAM,CAACC,IAAI;QACtCC,SAASP,IAAIO,OAAO;IACtB;IAEA,MAAMC,SAAS,MAAMhB,yBAAyB;QAC5CK;QACAE;QACAG,OAAOT,SAASS,SAASO,OAAOP,SAASQ;QACzCV;IACF;IAEA,OAAOW,SAASC,IAAI,CAACJ,QAAQ;QAC3BK,SAASnB,gBAAgB;YACvBmB,SAAS,IAAIC;YACbd;QACF;QACAe,QAAQxB,WAAWyB,EAAE;IACvB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/findVersions.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEzD,eAAO,MAAM,YAAY,EAAE,sBAsB1B,CAAA"}
1
+ {"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/findVersions.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,YAAY,EAAE,sBA0B1B,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import httpStatus from 'http-status';
2
- import { findVersionsOperation } from 'payload/operations';
3
- import { isNumber } from 'payload/utilities';
2
+ import { findVersionsOperation } from 'payload';
3
+ import { isNumber } from 'payload/shared';
4
+ import { headersWithCors } from '../../../utilities/headersWithCors.js';
4
5
  export const findVersions = async ({ collection, req })=>{
5
6
  const { depth, limit, page, sort, where } = req.query;
6
7
  const result = await findVersionsOperation({
@@ -13,6 +14,10 @@ export const findVersions = async ({ collection, req })=>{
13
14
  where
14
15
  });
15
16
  return Response.json(result, {
17
+ headers: headersWithCors({
18
+ headers: new Headers(),
19
+ req
20
+ }),
16
21
  status: httpStatus.OK
17
22
  });
18
23
  };
@@ -1 +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"],"rangeMappings":";;;;;;;;;;;;;;;;;","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"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/findVersions.ts"],"sourcesContent":["import type { Where } from 'payload'\n\nimport httpStatus from 'http-status'\nimport { findVersionsOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.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 headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","findVersionsOperation","isNumber","headersWithCors","findVersions","collection","req","depth","limit","page","sort","where","query","result","Number","undefined","Response","json","headers","Headers","status","OK"],"mappings":"AAEA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,qBAAqB,QAAQ,UAAS;AAC/C,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,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,MAAMZ,sBAAsB;QACzCI;QACAE,OAAOL,SAASK,SAASO,OAAOP,SAASQ;QACzCP,OAAON,SAASM,SAASM,OAAON,SAASO;QACzCN,MAAMP,SAASO,QAAQK,OAAOL,QAAQM;QACtCT;QACAI;QACAC;IACF;IAEA,OAAOK,SAASC,IAAI,CAACJ,QAAQ;QAC3BK,SAASf,gBAAgB;YACvBe,SAAS,IAAIC;YACbb;QACF;QACAc,QAAQpB,WAAWqB,EAAE;IACvB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/preview.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAI/D,eAAO,MAAM,OAAO,EAAE,4BAuCrB,CAAA"}
1
+ {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/preview.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAK/D,eAAO,MAAM,OAAO,EAAE,4BA4CrB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import httpStatus from 'http-status';
2
- import { extractJWT } from 'payload/auth';
3
- import { findByIDOperation } from 'payload/operations';
4
- import { isNumber } from 'payload/utilities';
2
+ import { extractJWT, findByIDOperation } from 'payload';
3
+ import { isNumber } from 'payload/shared';
4
+ import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
5
  import { routeError } from '../routeError.js';
6
6
  export const preview = async ({ id, collection, req })=>{
7
7
  const { searchParams } = req;
@@ -24,14 +24,19 @@ export const preview = async ({ id, collection, req })=>{
24
24
  token
25
25
  });
26
26
  } catch (err) {
27
- routeError({
27
+ return routeError({
28
28
  collection,
29
+ config: req.payload.config,
29
30
  err,
30
31
  req
31
32
  });
32
33
  }
33
34
  }
34
35
  return Response.json(previewURL, {
36
+ headers: headersWithCors({
37
+ headers: new Headers(),
38
+ req
39
+ }),
35
40
  status: httpStatus.OK
36
41
  });
37
42
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/collections/preview.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { extractJWT } from 'payload/auth'\nimport { findByIDOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { routeError } from '../routeError.js'\n\nexport const preview: 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 let previewURL: string\n\n const generatePreviewURL = req.payload.config.collections.find(\n (config) => config.slug === collection.config.slug,\n )?.admin?.preview\n\n const token = extractJWT(req)\n\n if (typeof generatePreviewURL === 'function') {\n try {\n previewURL = await generatePreviewURL(result, {\n locale: req.locale,\n req,\n token,\n })\n } catch (err) {\n routeError({\n collection,\n err,\n req,\n })\n }\n }\n\n return Response.json(previewURL, {\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","extractJWT","findByIDOperation","isNumber","routeError","preview","id","collection","req","searchParams","depth","get","result","Number","undefined","draft","previewURL","generatePreviewURL","payload","config","collections","find","slug","admin","token","locale","err","Response","json","status","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,UAAU,QAAQ,eAAc;AACzC,SAASC,iBAAiB,QAAQ,qBAAoB;AACtD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,SAASC,UAAU,QAAQ,mBAAkB;AAE7C,OAAO,MAAMC,UAAwC,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACjF,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMC,SAAS,MAAMV,kBAAkB;QACrCI;QACAC;QACAG,OAAOP,SAASO,SAASG,OAAOH,SAASI;QACzCC,OAAON,aAAaE,GAAG,CAAC,aAAa;QACrCH;IACF;IAEA,IAAIQ;IAEJ,MAAMC,qBAAqBT,IAAIU,OAAO,CAACC,MAAM,CAACC,WAAW,CAACC,IAAI,CAC5D,CAACF,SAAWA,OAAOG,IAAI,KAAKf,WAAWY,MAAM,CAACG,IAAI,GACjDC,OAAOlB;IAEV,MAAMmB,QAAQvB,WAAWO;IAEzB,IAAI,OAAOS,uBAAuB,YAAY;QAC5C,IAAI;YACFD,aAAa,MAAMC,mBAAmBL,QAAQ;gBAC5Ca,QAAQjB,IAAIiB,MAAM;gBAClBjB;gBACAgB;YACF;QACF,EAAE,OAAOE,KAAK;YACZtB,WAAW;gBACTG;gBACAmB;gBACAlB;YACF;QACF;IACF;IAEA,OAAOmB,SAASC,IAAI,CAACZ,YAAY;QAC/Ba,QAAQ7B,WAAW8B,EAAE;IACvB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/preview.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { extractJWT, findByIDOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\nimport { routeError } from '../routeError.js'\n\nexport const preview: 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 let previewURL: string\n\n const generatePreviewURL = req.payload.config.collections.find(\n (config) => config.slug === collection.config.slug,\n )?.admin?.preview\n\n const token = extractJWT(req)\n\n if (typeof generatePreviewURL === 'function') {\n try {\n previewURL = await generatePreviewURL(result, {\n locale: req.locale,\n req,\n token,\n })\n } catch (err) {\n return routeError({\n collection,\n config: req.payload.config,\n err,\n req,\n })\n }\n }\n\n return Response.json(previewURL, {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","extractJWT","findByIDOperation","isNumber","headersWithCors","routeError","preview","id","collection","req","searchParams","depth","get","result","Number","undefined","draft","previewURL","generatePreviewURL","payload","config","collections","find","slug","admin","token","locale","err","Response","json","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,UAAU,EAAEC,iBAAiB,QAAQ,UAAS;AACvD,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,UAAU,QAAQ,mBAAkB;AAE7C,OAAO,MAAMC,UAAwC,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACjF,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMC,SAAS,MAAMX,kBAAkB;QACrCK;QACAC;QACAG,OAAOR,SAASQ,SAASG,OAAOH,SAASI;QACzCC,OAAON,aAAaE,GAAG,CAAC,aAAa;QACrCH;IACF;IAEA,IAAIQ;IAEJ,MAAMC,qBAAqBT,IAAIU,OAAO,CAACC,MAAM,CAACC,WAAW,CAACC,IAAI,CAC5D,CAACF,SAAWA,OAAOG,IAAI,KAAKf,WAAWY,MAAM,CAACG,IAAI,GACjDC,OAAOlB;IAEV,MAAMmB,QAAQxB,WAAWQ;IAEzB,IAAI,OAAOS,uBAAuB,YAAY;QAC5C,IAAI;YACFD,aAAa,MAAMC,mBAAmBL,QAAQ;gBAC5Ca,QAAQjB,IAAIiB,MAAM;gBAClBjB;gBACAgB;YACF;QACF,EAAE,OAAOE,KAAK;YACZ,OAAOtB,WAAW;gBAChBG;gBACAY,QAAQX,IAAIU,OAAO,CAACC,MAAM;gBAC1BO;gBACAlB;YACF;QACF;IACF;IAEA,OAAOmB,SAASC,IAAI,CAACZ,YAAY;QAC/Ba,SAAS1B,gBAAgB;YACvB0B,SAAS,IAAIC;YACbtB;QACF;QACAuB,QAAQhC,WAAWiC,EAAE;IACvB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/restoreVersion.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAI/D,eAAO,MAAM,cAAc,EAAE,4BA8B5B,CAAA"}
1
+ {"version":3,"file":"restoreVersion.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/restoreVersion.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAK/D,eAAO,MAAM,cAAc,EAAE,4BAoC5B,CAAA"}
@@ -1,10 +1,12 @@
1
1
  import httpStatus from 'http-status';
2
- import { restoreVersionOperation } from 'payload/operations';
3
- import { isNumber } from 'payload/utilities';
2
+ import { restoreVersionOperation } from 'payload';
3
+ import { isNumber } from 'payload/shared';
4
+ import { headersWithCors } from '../../../utilities/headersWithCors.js';
4
5
  import { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js';
5
6
  export const restoreVersion = async ({ id: incomingID, collection, req })=>{
6
7
  const { searchParams } = req;
7
8
  const depth = searchParams.get('depth');
9
+ const draft = searchParams.get('draft');
8
10
  const id = sanitizeCollectionID({
9
11
  id: incomingID,
10
12
  collectionSlug: collection.config.slug,
@@ -14,12 +16,17 @@ export const restoreVersion = async ({ id: incomingID, collection, req })=>{
14
16
  id,
15
17
  collection,
16
18
  depth: isNumber(depth) ? Number(depth) : undefined,
19
+ draft: draft === 'true' ? true : undefined,
17
20
  req
18
21
  });
19
22
  return Response.json({
20
23
  ...result,
21
24
  message: req.t('version:restoredSuccessfully')
22
25
  }, {
26
+ headers: headersWithCors({
27
+ headers: new Headers(),
28
+ req
29
+ }),
23
30
  status: httpStatus.OK
24
31
  });
25
32
  };
@@ -1 +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\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const restoreVersion: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n\n const id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\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","sanitizeCollectionID","restoreVersion","id","incomingID","collection","req","searchParams","depth","get","collectionSlug","config","slug","payload","result","Number","undefined","Response","json","message","t","status","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,uBAAuB,QAAQ,qBAAoB;AAC5D,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,iBAA+C,OAAO,EACjEC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAE/B,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJM,gBAAgBL,WAAWM,MAAM,CAACC,IAAI;QACtCC,SAASP,IAAIO,OAAO;IACtB;IAEA,MAAMC,SAAS,MAAMf,wBAAwB;QAC3CI;QACAE;QACAG,OAAOR,SAASQ,SAASO,OAAOP,SAASQ;QACzCV;IACF;IAEA,OAAOW,SAASC,IAAI,CAClB;QACE,GAAGJ,MAAM;QACTK,SAASb,IAAIc,CAAC,CAAC;IACjB,GACA;QACEC,QAAQvB,WAAWwB,EAAE;IACvB;AAEJ,EAAC"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/restoreVersion.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { restoreVersionOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const restoreVersion: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\n const { searchParams } = req\n const depth = searchParams.get('depth')\n const draft = searchParams.get('draft')\n\n const id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\n\n const result = await restoreVersionOperation({\n id,\n collection,\n depth: isNumber(depth) ? Number(depth) : undefined,\n draft: draft === 'true' ? true : undefined,\n req,\n })\n\n return Response.json(\n {\n ...result,\n message: req.t('version:restoredSuccessfully'),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","restoreVersionOperation","isNumber","headersWithCors","sanitizeCollectionID","restoreVersion","id","incomingID","collection","req","searchParams","depth","get","draft","collectionSlug","config","slug","payload","result","Number","undefined","Response","json","message","t","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,uBAAuB,QAAQ,UAAS;AACjD,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,iBAA+C,OAAO,EACjEC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,QAAQD,aAAaE,GAAG,CAAC;IAC/B,MAAMC,QAAQH,aAAaE,GAAG,CAAC;IAE/B,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJO,gBAAgBN,WAAWO,MAAM,CAACC,IAAI;QACtCC,SAASR,IAAIQ,OAAO;IACtB;IAEA,MAAMC,SAAS,MAAMjB,wBAAwB;QAC3CK;QACAE;QACAG,OAAOT,SAASS,SAASQ,OAAOR,SAASS;QACzCP,OAAOA,UAAU,SAAS,OAAOO;QACjCX;IACF;IAEA,OAAOY,SAASC,IAAI,CAClB;QACE,GAAGJ,MAAM;QACTK,SAASd,IAAIe,CAAC,CAAC;IACjB,GACA;QACEC,SAAStB,gBAAgB;YACvBsB,SAAS,IAAIC;YACbjB;QACF;QACAkB,QAAQ3B,WAAW4B,EAAE;IACvB;AAEJ,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/update.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAEzD,eAAO,MAAM,MAAM,EAAE,sBAoDpB,CAAA"}
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/update.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,MAAM,EAAE,sBA2DpB,CAAA"}
@@ -1,7 +1,8 @@
1
1
  import { getTranslation } from '@payloadcms/translations';
2
2
  import httpStatus from 'http-status';
3
- import { updateOperation } from 'payload/operations';
4
- import { isNumber } from 'payload/utilities';
3
+ import { updateOperation } from 'payload';
4
+ import { isNumber } from 'payload/shared';
5
+ import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
6
  export const update = async ({ collection, req })=>{
6
7
  const { depth, draft, where } = req.query;
7
8
  const result = await updateOperation({
@@ -12,6 +13,10 @@ export const update = async ({ collection, req })=>{
12
13
  req,
13
14
  where
14
15
  });
16
+ const headers = headersWithCors({
17
+ headers: new Headers(),
18
+ req
19
+ });
15
20
  if (result.errors.length === 0) {
16
21
  const message = req.t('general:updatedCountSuccessfully', {
17
22
  count: result.docs.length,
@@ -21,6 +26,7 @@ export const update = async ({ collection, req })=>{
21
26
  ...result,
22
27
  message
23
28
  }, {
29
+ headers,
24
30
  status: httpStatus.OK
25
31
  });
26
32
  }
@@ -34,6 +40,7 @@ export const update = async ({ collection, req })=>{
34
40
  ...result,
35
41
  message
36
42
  }, {
43
+ headers,
37
44
  status: httpStatus.BAD_REQUEST
38
45
  });
39
46
  };
@@ -1 +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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/update.ts"],"sourcesContent":["import type { Where } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { updateOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.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 const headers = headersWithCors({\n headers: new Headers(),\n req,\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 headers,\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 headers,\n status: httpStatus.BAD_REQUEST,\n },\n )\n}\n"],"names":["getTranslation","httpStatus","updateOperation","isNumber","headersWithCors","update","collection","req","depth","draft","where","query","result","data","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,SAAiC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACtE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGH,IAAII,KAAK;IAMzC,MAAMC,SAAS,MAAMV,gBAAgB;QACnCI;QACAO,MAAMN,IAAIM,IAAI;QACdL,OAAOL,SAASK,SAASM,OAAON,SAASO;QACzCN,OAAOA,UAAU;QACjBF;QACAG;IACF;IAEA,MAAMM,UAAUZ,gBAAgB;QAC9BY,SAAS,IAAIC;QACbV;IACF;IAEA,IAAIK,OAAOM,MAAM,CAACC,MAAM,KAAK,GAAG;QAC9B,MAAMC,UAAUb,IAAIc,CAAC,CAAC,oCAAoC;YACxDC,OAAOV,OAAOW,IAAI,CAACJ,MAAM;YACzBK,OAAOxB,eACLM,WAAWmB,MAAM,CAACC,MAAM,CAACd,OAAOW,IAAI,CAACJ,MAAM,GAAG,IAAI,WAAW,WAAW,EACxEZ,IAAIoB,IAAI;QAEZ;QAEA,OAAOC,SAASC,IAAI,CAClB;YACE,GAAGjB,MAAM;YACTQ;QACF,GACA;YACEJ;YACAc,QAAQ7B,WAAW8B,EAAE;QACvB;IAEJ;IAEA,MAAMC,QAAQpB,OAAOW,IAAI,CAACJ,MAAM,GAAGP,OAAOM,MAAM,CAACC,MAAM;IACvD,MAAMC,UAAUb,IAAIc,CAAC,CAAC,6BAA6B;QACjDC,OAAOV,OAAOM,MAAM,CAACC,MAAM;QAC3BK,OAAOxB,eAAeM,WAAWmB,MAAM,CAACC,MAAM,CAACM,QAAQ,IAAI,WAAW,WAAW,EAAEzB,IAAIoB,IAAI;QAC3FK;IACF;IAEA,OAAOJ,SAASC,IAAI,CAClB;QACE,GAAGjB,MAAM;QACTQ;IACF,GACA;QACEJ;QACAc,QAAQ7B,WAAWgC,WAAW;IAChC;AAEJ,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"updateByID.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/updateByID.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAI/D,eAAO,MAAM,UAAU,EAAE,4BAwCxB,CAAA"}
1
+ {"version":3,"file":"updateByID.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/collections/updateByID.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,aAAa,CAAA;AAK/D,eAAO,MAAM,UAAU,EAAE,4BA4CxB,CAAA"}
@@ -1,6 +1,7 @@
1
1
  import httpStatus from 'http-status';
2
- import { updateByIDOperation } from 'payload/operations';
3
- import { isNumber } from 'payload/utilities';
2
+ import { updateByIDOperation } from 'payload';
3
+ import { isNumber } from 'payload/shared';
4
+ import { headersWithCors } from '../../../utilities/headersWithCors.js';
4
5
  import { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js';
5
6
  export const updateByID = async ({ id: incomingID, collection, req })=>{
6
7
  const { searchParams } = req;
@@ -28,6 +29,10 @@ export const updateByID = async ({ id: incomingID, collection, req })=>{
28
29
  doc,
29
30
  message
30
31
  }, {
32
+ headers: headersWithCors({
33
+ headers: new Headers(),
34
+ req
35
+ }),
31
36
  status: httpStatus.OK
32
37
  });
33
38
  };
@@ -1 +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\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const updateByID: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\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 id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\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","sanitizeCollectionID","updateByID","id","incomingID","collection","req","searchParams","depth","get","autosave","draft","collectionSlug","config","slug","payload","doc","data","Number","undefined","message","t","Response","json","status","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,mBAAmB,QAAQ,qBAAoB;AACxD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,aAA2C,OAAO,EAC7DC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,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,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJQ,gBAAgBP,WAAWQ,MAAM,CAACC,IAAI;QACtCC,SAAST,IAAIS,OAAO;IACtB;IAEA,MAAMC,MAAM,MAAMjB,oBAAoB;QACpCI;QACAO;QACAL;QACAY,MAAMX,IAAIW,IAAI;QACdT,OAAOR,SAASQ,SAASU,OAAOV,SAASW;QACzCR;QACAL;IACF;IAEA,IAAIc,UAAUd,IAAIe,CAAC,CAAC;IAEpB,IAAIV,OAAOS,UAAUd,IAAIe,CAAC,CAAC;IAC3B,IAAIX,UAAUU,UAAUd,IAAIe,CAAC,CAAC;IAE9B,OAAOC,SAASC,IAAI,CAClB;QACEP;QACAI;IACF,GACA;QACEI,QAAQ1B,WAAW2B,EAAE;IACvB;AAEJ,EAAC"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/updateByID.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { updateByIDOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\nimport { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js'\n\nexport const updateByID: CollectionRouteHandlerWithID = async ({\n id: incomingID,\n collection,\n req,\n}) => {\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 id = sanitizeCollectionID({\n id: incomingID,\n collectionSlug: collection.config.slug,\n payload: req.payload,\n })\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 headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","updateByIDOperation","isNumber","headersWithCors","sanitizeCollectionID","updateByID","id","incomingID","collection","req","searchParams","depth","get","autosave","draft","collectionSlug","config","slug","payload","doc","data","Number","undefined","message","t","Response","json","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,mBAAmB,QAAQ,UAAS;AAC7C,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,oBAAoB,QAAQ,uCAAsC;AAE3E,OAAO,MAAMC,aAA2C,OAAO,EAC7DC,IAAIC,UAAU,EACdC,UAAU,EACVC,GAAG,EACJ;IACC,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,MAAMN,KAAKF,qBAAqB;QAC9BE,IAAIC;QACJQ,gBAAgBP,WAAWQ,MAAM,CAACC,IAAI;QACtCC,SAAST,IAAIS,OAAO;IACtB;IAEA,MAAMC,MAAM,MAAMlB,oBAAoB;QACpCK;QACAO;QACAL;QACAY,MAAMX,IAAIW,IAAI;QACdT,OAAOT,SAASS,SAASU,OAAOV,SAASW;QACzCR;QACAL;IACF;IAEA,IAAIc,UAAUd,IAAIe,CAAC,CAAC;IAEpB,IAAIV,OAAOS,UAAUd,IAAIe,CAAC,CAAC;IAC3B,IAAIX,UAAUU,UAAUd,IAAIe,CAAC,CAAC;IAE9B,OAAOC,SAASC,IAAI,CAClB;QACEP;QACAI;IACF,GACA;QACEI,SAASxB,gBAAgB;YACvBwB,SAAS,IAAIC;YACbnB;QACF;QACAoB,QAAQ7B,WAAW8B,EAAE;IACvB;AAEJ,EAAC"}
@@ -1,7 +1,7 @@
1
- import type { Collection, PayloadRequest } from 'payload/types';
1
+ import type { Collection, PayloadRequest, TypeWithID } from 'payload';
2
2
  export declare function checkFileAccess({ collection, filename, req, }: {
3
3
  collection: Collection;
4
4
  filename: string;
5
5
  req: PayloadRequest;
6
- }): Promise<Response>;
6
+ }): Promise<Response | TypeWithID>;
7
7
  //# sourceMappingURL=checkFileAccess.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkFileAccess.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/files/checkFileAccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAS,MAAM,eAAe,CAAA;AAOtE,wBAAsB,eAAe,CAAC,EACpC,UAAU,EACV,QAAQ,EACR,GAAG,GACJ,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;CACpB,qBA2CA"}
1
+ {"version":3,"file":"checkFileAccess.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/files/checkFileAccess.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAS,MAAM,SAAS,CAAA;AAM5E,wBAAsB,eAAe,CAAC,EACpC,UAAU,EACV,QAAQ,EACR,GAAG,GACJ,EAAE;IACD,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;CACpB,GAAG,OAAO,CAAC,QAAQ,GAAG,UAAU,CAAC,CA6CjC"}
@@ -1,5 +1,4 @@
1
- import { executeAccess } from 'payload/auth';
2
- import { Forbidden } from 'payload/errors';
1
+ import { Forbidden, executeAccess } from 'payload';
3
2
  import { endpointsAreDisabled } from '../checkEndpoints.js';
4
3
  export async function checkFileAccess({ collection, filename, req }) {
5
4
  const { config } = collection;
@@ -44,6 +43,7 @@ export async function checkFileAccess({ collection, filename, req }) {
44
43
  if (!doc) {
45
44
  throw new Forbidden(req.t);
46
45
  }
46
+ return doc;
47
47
  }
48
48
  }
49
49
 
@@ -1 +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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","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"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/files/checkFileAccess.ts"],"sourcesContent":["import type { Collection, PayloadRequest, TypeWithID, Where } from 'payload'\n\nimport { Forbidden, executeAccess } from 'payload'\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}): Promise<Response | TypeWithID> {\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 return doc\n }\n}\n"],"names":["Forbidden","executeAccess","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,SAAS,EAAEC,aAAa,QAAQ,UAAS;AAElD,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,MAAMV,cAAc;QAAEW,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,IAAIxB,UAAUM,IAAIwB,CAAC;QAC3B;QAEA,OAAON;IACT;AACF"}
@@ -1,4 +1,4 @@
1
- import type { Collection, PayloadRequest } from 'payload/types';
1
+ import type { Collection, PayloadRequest } from 'payload';
2
2
  type Args = {
3
3
  collection: Collection;
4
4
  filename: string;
@@ -1 +1 @@
1
- {"version":3,"file":"getFile.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/files/getFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAY/D,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AACD,eAAO,MAAM,OAAO,kCAAyC,IAAI,KAAG,QAAQ,QAAQ,CAuDnF,CAAA"}
1
+ {"version":3,"file":"getFile.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/files/getFile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAezD,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,UAAU,CAAA;IACtB,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,cAAc,CAAA;CACpB,CAAA;AACD,eAAO,MAAM,OAAO,kCAAyC,IAAI,KAAG,OAAO,CAAC,QAAQ,CA4DnF,CAAA"}