@payloadcms/next 3.0.0-canary.92e4997 → 3.0.0-canary.a0b06af

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 (706) hide show
  1. package/dist/cjs/withPayload.cjs +52 -10
  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 +43 -0
  13. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -0
  14. package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts +6 -0
  15. package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -0
  16. package/dist/elements/DocumentHeader/Tabs/Tab/index.js +58 -0
  17. package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -0
  18. package/dist/elements/DocumentHeader/Tabs/Tab/index.scss +91 -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 +81 -0
  30. package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -0
  31. package/dist/elements/DocumentHeader/Tabs/index.scss +53 -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 +23 -0
  35. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -0
  36. package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts +7 -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 +51 -0
  45. package/dist/elements/LeaveWithoutSaving/index.d.ts.map +1 -1
  46. package/dist/elements/LeaveWithoutSaving/index.js +36 -20
  47. package/dist/elements/LeaveWithoutSaving/index.js.map +1 -1
  48. package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +1 -1
  49. package/dist/elements/Logo/index.d.ts +4 -0
  50. package/dist/elements/Logo/index.d.ts.map +1 -0
  51. package/dist/elements/Logo/index.js +24 -0
  52. package/dist/elements/Logo/index.js.map +1 -0
  53. package/dist/elements/Nav/NavHamburger/index.d.ts +5 -0
  54. package/dist/elements/Nav/NavHamburger/index.d.ts.map +1 -0
  55. package/dist/elements/Nav/NavHamburger/index.js +20 -0
  56. package/dist/elements/Nav/NavHamburger/index.js.map +1 -0
  57. package/dist/elements/Nav/NavWrapper/index.d.ts +7 -0
  58. package/dist/elements/Nav/NavWrapper/index.d.ts.map +1 -0
  59. package/dist/elements/Nav/NavWrapper/index.js +21 -0
  60. package/dist/elements/Nav/NavWrapper/index.js.map +1 -0
  61. package/dist/elements/Nav/NavWrapper/index.scss +17 -0
  62. package/dist/elements/Nav/index.client.d.ts +3 -0
  63. package/dist/elements/Nav/index.client.d.ts.map +1 -0
  64. package/dist/elements/Nav/index.client.js +79 -0
  65. package/dist/elements/Nav/index.client.js.map +1 -0
  66. package/dist/elements/Nav/index.d.ts +6 -0
  67. package/dist/elements/Nav/index.d.ts.map +1 -0
  68. package/dist/elements/Nav/index.js +67 -0
  69. package/dist/elements/Nav/index.js.map +1 -0
  70. package/dist/elements/Nav/index.scss +150 -0
  71. package/dist/exports/layouts.js.map +1 -1
  72. package/dist/exports/routes.js.map +1 -1
  73. package/dist/exports/templates.d.ts +3 -0
  74. package/dist/exports/templates.d.ts.map +1 -0
  75. package/dist/exports/templates.js +4 -0
  76. package/dist/exports/templates.js.map +1 -0
  77. package/dist/exports/utilities.d.ts +0 -2
  78. package/dist/exports/utilities.d.ts.map +1 -1
  79. package/dist/exports/utilities.js +0 -2
  80. package/dist/exports/utilities.js.map +1 -1
  81. package/dist/exports/views.d.ts +2 -1
  82. package/dist/exports/views.d.ts.map +1 -1
  83. package/dist/exports/views.js +2 -1
  84. package/dist/exports/views.js.map +1 -1
  85. package/dist/fetchAPI-multipart/fileFactory.d.ts +0 -1
  86. package/dist/fetchAPI-multipart/fileFactory.d.ts.map +1 -1
  87. package/dist/fetchAPI-multipart/fileFactory.js.map +1 -1
  88. package/dist/fetchAPI-multipart/handlers.d.ts +0 -1
  89. package/dist/fetchAPI-multipart/handlers.d.ts.map +1 -1
  90. package/dist/fetchAPI-multipart/handlers.js.map +1 -1
  91. package/dist/fetchAPI-multipart/index.d.ts +2 -5
  92. package/dist/fetchAPI-multipart/index.d.ts.map +1 -1
  93. package/dist/fetchAPI-multipart/index.js +2 -4
  94. package/dist/fetchAPI-multipart/index.js.map +1 -1
  95. package/dist/fetchAPI-multipart/isEligibleRequest.js.map +1 -1
  96. package/dist/fetchAPI-multipart/processMultipart.d.ts.map +1 -1
  97. package/dist/fetchAPI-multipart/processMultipart.js +18 -12
  98. package/dist/fetchAPI-multipart/processMultipart.js.map +1 -1
  99. package/dist/fetchAPI-multipart/processNested.js.map +1 -1
  100. package/dist/fetchAPI-multipart/uploadTimer.js.map +1 -1
  101. package/dist/fetchAPI-multipart/utilities.d.ts.map +1 -1
  102. package/dist/fetchAPI-multipart/utilities.js.map +1 -1
  103. package/dist/fetchAPI-stream-file/index.d.ts +0 -1
  104. package/dist/fetchAPI-stream-file/index.d.ts.map +1 -1
  105. package/dist/fetchAPI-stream-file/index.js.map +1 -1
  106. package/dist/index.js.map +1 -1
  107. package/dist/layouts/Root/index.d.ts +1 -2
  108. package/dist/layouts/Root/index.d.ts.map +1 -1
  109. package/dist/layouts/Root/index.js +39 -26
  110. package/dist/layouts/Root/index.js.map +1 -1
  111. package/dist/prod/styles.css +1 -1
  112. package/dist/routes/graphql/handler.d.ts +1 -1
  113. package/dist/routes/graphql/handler.d.ts.map +1 -1
  114. package/dist/routes/graphql/handler.js +14 -15
  115. package/dist/routes/graphql/handler.js.map +1 -1
  116. package/dist/routes/graphql/index.js.map +1 -1
  117. package/dist/routes/graphql/playground.d.ts +1 -1
  118. package/dist/routes/graphql/playground.d.ts.map +1 -1
  119. package/dist/routes/graphql/playground.js.map +1 -1
  120. package/dist/routes/index.js.map +1 -1
  121. package/dist/routes/rest/auth/access.d.ts.map +1 -1
  122. package/dist/routes/rest/auth/access.js +18 -8
  123. package/dist/routes/rest/auth/access.js.map +1 -1
  124. package/dist/routes/rest/auth/forgotPassword.d.ts.map +1 -1
  125. package/dist/routes/rest/auth/forgotPassword.js +8 -4
  126. package/dist/routes/rest/auth/forgotPassword.js.map +1 -1
  127. package/dist/routes/rest/auth/init.js +1 -1
  128. package/dist/routes/rest/auth/init.js.map +1 -1
  129. package/dist/routes/rest/auth/login.d.ts.map +1 -1
  130. package/dist/routes/rest/auth/login.js +11 -7
  131. package/dist/routes/rest/auth/login.js.map +1 -1
  132. package/dist/routes/rest/auth/logout.d.ts.map +1 -1
  133. package/dist/routes/rest/auth/logout.js +1 -2
  134. package/dist/routes/rest/auth/logout.js.map +1 -1
  135. package/dist/routes/rest/auth/me.d.ts.map +1 -1
  136. package/dist/routes/rest/auth/me.js +1 -2
  137. package/dist/routes/rest/auth/me.js.map +1 -1
  138. package/dist/routes/rest/auth/refresh.d.ts.map +1 -1
  139. package/dist/routes/rest/auth/refresh.js +12 -22
  140. package/dist/routes/rest/auth/refresh.js.map +1 -1
  141. package/dist/routes/rest/auth/registerFirstUser.d.ts.map +1 -1
  142. package/dist/routes/rest/auth/registerFirstUser.js +10 -4
  143. package/dist/routes/rest/auth/registerFirstUser.js.map +1 -1
  144. package/dist/routes/rest/auth/resetPassword.d.ts.map +1 -1
  145. package/dist/routes/rest/auth/resetPassword.js +1 -2
  146. package/dist/routes/rest/auth/resetPassword.js.map +1 -1
  147. package/dist/routes/rest/auth/unlock.js +1 -1
  148. package/dist/routes/rest/auth/unlock.js.map +1 -1
  149. package/dist/routes/rest/auth/verifyEmail.js +2 -2
  150. package/dist/routes/rest/auth/verifyEmail.js.map +1 -1
  151. package/dist/routes/rest/buildFormState.d.ts +2 -4
  152. package/dist/routes/rest/buildFormState.d.ts.map +1 -1
  153. package/dist/routes/rest/buildFormState.js +16 -166
  154. package/dist/routes/rest/buildFormState.js.map +1 -1
  155. package/dist/routes/rest/checkEndpoints.d.ts.map +1 -1
  156. package/dist/routes/rest/checkEndpoints.js.map +1 -1
  157. package/dist/routes/rest/collections/count.js +1 -1
  158. package/dist/routes/rest/collections/count.js.map +1 -1
  159. package/dist/routes/rest/collections/create.js +2 -2
  160. package/dist/routes/rest/collections/create.js.map +1 -1
  161. package/dist/routes/rest/collections/delete.js +2 -2
  162. package/dist/routes/rest/collections/delete.js.map +1 -1
  163. package/dist/routes/rest/collections/deleteByID.js +2 -2
  164. package/dist/routes/rest/collections/deleteByID.js.map +1 -1
  165. package/dist/routes/rest/collections/docAccess.js +1 -1
  166. package/dist/routes/rest/collections/docAccess.js.map +1 -1
  167. package/dist/routes/rest/collections/duplicate.js +2 -2
  168. package/dist/routes/rest/collections/duplicate.js.map +1 -1
  169. package/dist/routes/rest/collections/find.js +2 -2
  170. package/dist/routes/rest/collections/find.js.map +1 -1
  171. package/dist/routes/rest/collections/findByID.js +2 -2
  172. package/dist/routes/rest/collections/findByID.js.map +1 -1
  173. package/dist/routes/rest/collections/findVersionByID.js +2 -2
  174. package/dist/routes/rest/collections/findVersionByID.js.map +1 -1
  175. package/dist/routes/rest/collections/findVersions.js +2 -2
  176. package/dist/routes/rest/collections/findVersions.js.map +1 -1
  177. package/dist/routes/rest/collections/preview.d.ts.map +1 -1
  178. package/dist/routes/rest/collections/preview.js +2 -3
  179. package/dist/routes/rest/collections/preview.js.map +1 -1
  180. package/dist/routes/rest/collections/restoreVersion.js +2 -2
  181. package/dist/routes/rest/collections/restoreVersion.js.map +1 -1
  182. package/dist/routes/rest/collections/update.js +2 -2
  183. package/dist/routes/rest/collections/update.js.map +1 -1
  184. package/dist/routes/rest/collections/updateByID.js +2 -2
  185. package/dist/routes/rest/collections/updateByID.js.map +1 -1
  186. package/dist/routes/rest/files/checkFileAccess.d.ts +3 -3
  187. package/dist/routes/rest/files/checkFileAccess.d.ts.map +1 -1
  188. package/dist/routes/rest/files/checkFileAccess.js +2 -2
  189. package/dist/routes/rest/files/checkFileAccess.js.map +1 -1
  190. package/dist/routes/rest/files/getFile.d.ts +2 -2
  191. package/dist/routes/rest/files/getFile.d.ts.map +1 -1
  192. package/dist/routes/rest/files/getFile.js +12 -8
  193. package/dist/routes/rest/files/getFile.js.map +1 -1
  194. package/dist/routes/rest/files/getFileTypeFallback.js.map +1 -1
  195. package/dist/routes/rest/globals/docAccess.js +1 -1
  196. package/dist/routes/rest/globals/docAccess.js.map +1 -1
  197. package/dist/routes/rest/globals/findOne.js +2 -2
  198. package/dist/routes/rest/globals/findOne.js.map +1 -1
  199. package/dist/routes/rest/globals/findVersionByID.js +2 -2
  200. package/dist/routes/rest/globals/findVersionByID.js.map +1 -1
  201. package/dist/routes/rest/globals/findVersions.js +2 -2
  202. package/dist/routes/rest/globals/findVersions.js.map +1 -1
  203. package/dist/routes/rest/globals/preview.d.ts.map +1 -1
  204. package/dist/routes/rest/globals/preview.js +2 -3
  205. package/dist/routes/rest/globals/preview.js.map +1 -1
  206. package/dist/routes/rest/globals/restoreVersion.js +2 -2
  207. package/dist/routes/rest/globals/restoreVersion.js.map +1 -1
  208. package/dist/routes/rest/globals/update.js +2 -2
  209. package/dist/routes/rest/globals/update.js.map +1 -1
  210. package/dist/routes/rest/index.d.ts +1 -1
  211. package/dist/routes/rest/index.d.ts.map +1 -1
  212. package/dist/routes/rest/index.js +109 -94
  213. package/dist/routes/rest/index.js.map +1 -1
  214. package/dist/routes/rest/og/image.d.ts +9 -0
  215. package/dist/routes/rest/og/image.d.ts.map +1 -0
  216. package/dist/routes/rest/og/image.js +79 -0
  217. package/dist/routes/rest/og/image.js.map +1 -0
  218. package/dist/routes/rest/og/index.d.ts +11 -0
  219. package/dist/routes/rest/og/index.d.ts.map +1 -0
  220. package/dist/routes/rest/og/index.js +73 -0
  221. package/dist/routes/rest/og/index.js.map +1 -0
  222. package/dist/routes/rest/og/roboto-regular.woff +0 -0
  223. package/dist/routes/rest/routeError.d.ts +3 -3
  224. package/dist/routes/rest/routeError.d.ts.map +1 -1
  225. package/dist/routes/rest/routeError.js +1 -1
  226. package/dist/routes/rest/routeError.js.map +1 -1
  227. package/dist/routes/rest/types.d.ts +7 -7
  228. package/dist/routes/rest/types.d.ts.map +1 -1
  229. package/dist/routes/rest/types.js.map +1 -1
  230. package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts +1 -1
  231. package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts.map +1 -1
  232. package/dist/routes/rest/utilities/sanitizeCollectionID.js.map +1 -1
  233. package/dist/scss/app.scss +1 -1
  234. package/dist/scss/colors.scss +76 -76
  235. package/dist/scss/toasts.scss +111 -0
  236. package/dist/templates/Default/NavHamburger/index.d.ts +3 -0
  237. package/dist/templates/Default/NavHamburger/index.d.ts.map +1 -0
  238. package/dist/templates/Default/NavHamburger/index.js +13 -0
  239. package/dist/templates/Default/NavHamburger/index.js.map +1 -0
  240. package/dist/templates/Default/Wrapper/index.d.ts +8 -0
  241. package/dist/templates/Default/Wrapper/index.d.ts.map +1 -0
  242. package/dist/templates/Default/Wrapper/index.js +18 -0
  243. package/dist/templates/Default/Wrapper/index.js.map +1 -0
  244. package/dist/templates/Default/Wrapper/index.scss +25 -0
  245. package/dist/templates/Default/index.d.ts +10 -0
  246. package/dist/templates/Default/index.d.ts.map +1 -0
  247. package/dist/templates/Default/index.js +66 -0
  248. package/dist/templates/Default/index.js.map +1 -0
  249. package/dist/templates/Default/index.scss +67 -0
  250. package/dist/templates/Minimal/index.d.ts +10 -0
  251. package/dist/templates/Minimal/index.d.ts.map +1 -0
  252. package/dist/templates/Minimal/index.js +21 -0
  253. package/dist/templates/Minimal/index.js.map +1 -0
  254. package/dist/templates/Minimal/index.scss +28 -0
  255. package/dist/utilities/addDataAndFileToRequest.d.ts +3 -6
  256. package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
  257. package/dist/utilities/addDataAndFileToRequest.js +24 -56
  258. package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
  259. package/dist/utilities/addLocalesToRequest.d.ts +2 -5
  260. package/dist/utilities/addLocalesToRequest.d.ts.map +1 -1
  261. package/dist/utilities/addLocalesToRequest.js +12 -10
  262. package/dist/utilities/addLocalesToRequest.js.map +1 -1
  263. package/dist/utilities/createPayloadRequest.d.ts +1 -1
  264. package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
  265. package/dist/utilities/createPayloadRequest.js +13 -11
  266. package/dist/utilities/createPayloadRequest.js.map +1 -1
  267. package/dist/utilities/getNextRequestI18n.d.ts +2 -2
  268. package/dist/utilities/getNextRequestI18n.d.ts.map +1 -1
  269. package/dist/utilities/getNextRequestI18n.js +1 -1
  270. package/dist/utilities/getNextRequestI18n.js.map +1 -1
  271. package/dist/utilities/getPayloadHMR.d.ts +1 -2
  272. package/dist/utilities/getPayloadHMR.d.ts.map +1 -1
  273. package/dist/utilities/getPayloadHMR.js +23 -7
  274. package/dist/utilities/getPayloadHMR.js.map +1 -1
  275. package/dist/utilities/getRequestLanguage.d.ts +1 -1
  276. package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
  277. package/dist/utilities/getRequestLanguage.js +1 -1
  278. package/dist/utilities/getRequestLanguage.js.map +1 -1
  279. package/dist/utilities/getRequestLocales.js.map +1 -1
  280. package/dist/utilities/getRequestTheme.d.ts +11 -0
  281. package/dist/utilities/getRequestTheme.d.ts.map +1 -0
  282. package/dist/utilities/getRequestTheme.js +19 -0
  283. package/dist/utilities/getRequestTheme.js.map +1 -0
  284. package/dist/utilities/headersWithCors.d.ts +2 -2
  285. package/dist/utilities/headersWithCors.d.ts.map +1 -1
  286. package/dist/utilities/headersWithCors.js.map +1 -1
  287. package/dist/utilities/initPage/handleAdminPage.d.ts +1 -2
  288. package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -1
  289. package/dist/utilities/initPage/handleAdminPage.js +1 -1
  290. package/dist/utilities/initPage/handleAdminPage.js.map +1 -1
  291. package/dist/utilities/initPage/handleAuthRedirect.d.ts +2 -2
  292. package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -1
  293. package/dist/utilities/initPage/handleAuthRedirect.js +9 -8
  294. package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -1
  295. package/dist/utilities/initPage/index.d.ts +1 -1
  296. package/dist/utilities/initPage/index.d.ts.map +1 -1
  297. package/dist/utilities/initPage/index.js +54 -10
  298. package/dist/utilities/initPage/index.js.map +1 -1
  299. package/dist/utilities/initPage/shared.d.ts +2 -2
  300. package/dist/utilities/initPage/shared.d.ts.map +1 -1
  301. package/dist/utilities/initPage/shared.js +11 -9
  302. package/dist/utilities/initPage/shared.js.map +1 -1
  303. package/dist/utilities/initPage/types.d.ts +1 -1
  304. package/dist/utilities/initPage/types.d.ts.map +1 -1
  305. package/dist/utilities/initPage/types.js.map +1 -1
  306. package/dist/utilities/mergeHeaders.d.ts +2 -0
  307. package/dist/utilities/mergeHeaders.d.ts.map +1 -0
  308. package/dist/utilities/mergeHeaders.js +37 -0
  309. package/dist/utilities/mergeHeaders.js.map +1 -0
  310. package/dist/utilities/meta.d.ts +4 -8
  311. package/dist/utilities/meta.d.ts.map +1 -1
  312. package/dist/utilities/meta.js +63 -25
  313. package/dist/utilities/meta.js.map +1 -1
  314. package/dist/utilities/timestamp.js.map +1 -1
  315. package/dist/views/API/LocaleSelector/index.d.ts +9 -0
  316. package/dist/views/API/LocaleSelector/index.d.ts.map +1 -0
  317. package/dist/views/API/LocaleSelector/index.js +15 -0
  318. package/dist/views/API/LocaleSelector/index.js.map +1 -0
  319. package/dist/views/API/RenderJSON/index.js +101 -69
  320. package/dist/views/API/RenderJSON/index.js.map +1 -1
  321. package/dist/views/API/index.client.d.ts.map +1 -1
  322. package/dist/views/API/index.client.js +133 -112
  323. package/dist/views/API/index.client.js.map +1 -1
  324. package/dist/views/API/index.d.ts +1 -1
  325. package/dist/views/API/index.d.ts.map +1 -1
  326. package/dist/views/API/index.js +2 -1
  327. package/dist/views/API/index.js.map +1 -1
  328. package/dist/views/API/meta.d.ts.map +1 -1
  329. package/dist/views/API/meta.js +13 -6
  330. package/dist/views/API/meta.js.map +1 -1
  331. package/dist/views/Account/Settings/LanguageSelector.d.ts +6 -0
  332. package/dist/views/Account/Settings/LanguageSelector.d.ts.map +1 -0
  333. package/dist/views/Account/Settings/LanguageSelector.js +19 -0
  334. package/dist/views/Account/Settings/LanguageSelector.js.map +1 -0
  335. package/dist/views/Account/Settings/index.d.ts +4 -0
  336. package/dist/views/Account/Settings/index.d.ts.map +1 -1
  337. package/dist/views/Account/Settings/index.js +25 -21
  338. package/dist/views/Account/Settings/index.js.map +1 -1
  339. package/dist/views/Account/ToggleTheme/index.d.ts.map +1 -1
  340. package/dist/views/Account/ToggleTheme/index.js +3 -4
  341. package/dist/views/Account/ToggleTheme/index.js.map +1 -1
  342. package/dist/views/Account/index.d.ts +1 -1
  343. package/dist/views/Account/index.d.ts.map +1 -1
  344. package/dist/views/Account/index.js +69 -36
  345. package/dist/views/Account/index.js.map +1 -1
  346. package/dist/views/Account/meta.d.ts.map +1 -1
  347. package/dist/views/Account/meta.js +4 -5
  348. package/dist/views/Account/meta.js.map +1 -1
  349. package/dist/views/CreateFirstUser/index.client.d.ts +1 -1
  350. package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
  351. package/dist/views/CreateFirstUser/index.client.js +31 -29
  352. package/dist/views/CreateFirstUser/index.client.js.map +1 -1
  353. package/dist/views/CreateFirstUser/index.d.ts +1 -1
  354. package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
  355. package/dist/views/CreateFirstUser/index.js +16 -6
  356. package/dist/views/CreateFirstUser/index.js.map +1 -1
  357. package/dist/views/CreateFirstUser/meta.d.ts.map +1 -1
  358. package/dist/views/CreateFirstUser/meta.js +4 -5
  359. package/dist/views/CreateFirstUser/meta.js.map +1 -1
  360. package/dist/views/Dashboard/Default/index.d.ts +4 -4
  361. package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
  362. package/dist/views/Dashboard/Default/index.js +116 -23
  363. package/dist/views/Dashboard/Default/index.js.map +1 -1
  364. package/dist/views/Dashboard/index.d.ts +1 -1
  365. package/dist/views/Dashboard/index.d.ts.map +1 -1
  366. package/dist/views/Dashboard/index.js +52 -13
  367. package/dist/views/Dashboard/index.js.map +1 -1
  368. package/dist/views/Dashboard/meta.d.ts.map +1 -1
  369. package/dist/views/Dashboard/meta.js +8 -5
  370. package/dist/views/Dashboard/meta.js.map +1 -1
  371. package/dist/views/Document/getCustomViewByKey.d.ts +2 -3
  372. package/dist/views/Document/getCustomViewByKey.d.ts.map +1 -1
  373. package/dist/views/Document/getCustomViewByKey.js +2 -1
  374. package/dist/views/Document/getCustomViewByKey.js.map +1 -1
  375. package/dist/views/Document/getCustomViewByRoute.d.ts +2 -3
  376. package/dist/views/Document/getCustomViewByRoute.d.ts.map +1 -1
  377. package/dist/views/Document/getCustomViewByRoute.js.map +1 -1
  378. package/dist/views/Document/getDocumentData.d.ts +9 -0
  379. package/dist/views/Document/getDocumentData.d.ts.map +1 -0
  380. package/dist/views/Document/getDocumentData.js +31 -0
  381. package/dist/views/Document/getDocumentData.js.map +1 -0
  382. package/dist/views/Document/getDocumentPermissions.d.ts +13 -0
  383. package/dist/views/Document/getDocumentPermissions.d.ts.map +1 -0
  384. package/dist/views/Document/getDocumentPermissions.js +82 -0
  385. package/dist/views/Document/getDocumentPermissions.js.map +1 -0
  386. package/dist/views/Document/getMetaBySegment.d.ts +1 -2
  387. package/dist/views/Document/getMetaBySegment.d.ts.map +1 -1
  388. package/dist/views/Document/getMetaBySegment.js +1 -1
  389. package/dist/views/Document/getMetaBySegment.js.map +1 -1
  390. package/dist/views/Document/getViewsFromConfig.d.ts +1 -3
  391. package/dist/views/Document/getViewsFromConfig.d.ts.map +1 -1
  392. package/dist/views/Document/getViewsFromConfig.js +172 -171
  393. package/dist/views/Document/getViewsFromConfig.js.map +1 -1
  394. package/dist/views/Document/index.d.ts +1 -1
  395. package/dist/views/Document/index.d.ts.map +1 -1
  396. package/dist/views/Document/index.js +96 -63
  397. package/dist/views/Document/index.js.map +1 -1
  398. package/dist/views/Document/meta.js.map +1 -1
  399. package/dist/views/Edit/Default/Auth/APIKey.d.ts.map +1 -1
  400. package/dist/views/Edit/Default/Auth/APIKey.js +44 -34
  401. package/dist/views/Edit/Default/Auth/APIKey.js.map +1 -1
  402. package/dist/views/Edit/Default/Auth/index.d.ts.map +1 -1
  403. package/dist/views/Edit/Default/Auth/index.js +95 -64
  404. package/dist/views/Edit/Default/Auth/index.js.map +1 -1
  405. package/dist/views/Edit/Default/Auth/types.d.ts +2 -2
  406. package/dist/views/Edit/Default/Auth/types.d.ts.map +1 -1
  407. package/dist/views/Edit/Default/Auth/types.js.map +1 -1
  408. package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts +1 -2
  409. package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts.map +1 -1
  410. package/dist/views/Edit/Default/SetDocumentStepNav/index.js +26 -28
  411. package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +1 -1
  412. package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts +1 -2
  413. package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts.map +1 -1
  414. package/dist/views/Edit/Default/SetDocumentTitle/index.js +2 -4
  415. package/dist/views/Edit/Default/SetDocumentTitle/index.js.map +1 -1
  416. package/dist/views/Edit/Default/index.d.ts.map +1 -1
  417. package/dist/views/Edit/Default/index.js +87 -84
  418. package/dist/views/Edit/Default/index.js.map +1 -1
  419. package/dist/views/Edit/Default/types.d.ts +1 -1
  420. package/dist/views/Edit/Default/types.d.ts.map +1 -1
  421. package/dist/views/Edit/Default/types.js.map +1 -1
  422. package/dist/views/Edit/index.client.d.ts.map +1 -1
  423. package/dist/views/Edit/index.client.js +12 -10
  424. package/dist/views/Edit/index.client.js.map +1 -1
  425. package/dist/views/Edit/index.d.ts +1 -1
  426. package/dist/views/Edit/index.d.ts.map +1 -1
  427. package/dist/views/Edit/index.js +2 -1
  428. package/dist/views/Edit/index.js.map +1 -1
  429. package/dist/views/Edit/meta.d.ts.map +1 -1
  430. package/dist/views/Edit/meta.js +17 -15
  431. package/dist/views/Edit/meta.js.map +1 -1
  432. package/dist/views/Edit/sanitizeEditViewProps.d.ts +1 -1
  433. package/dist/views/Edit/sanitizeEditViewProps.d.ts.map +1 -1
  434. package/dist/views/Edit/sanitizeEditViewProps.js.map +1 -1
  435. package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -1
  436. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +77 -31
  437. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
  438. package/dist/views/ForgotPassword/index.d.ts +1 -1
  439. package/dist/views/ForgotPassword/index.d.ts.map +1 -1
  440. package/dist/views/ForgotPassword/index.js +39 -20
  441. package/dist/views/ForgotPassword/index.js.map +1 -1
  442. package/dist/views/ForgotPassword/meta.d.ts.map +1 -1
  443. package/dist/views/ForgotPassword/meta.js +4 -5
  444. package/dist/views/ForgotPassword/meta.js.map +1 -1
  445. package/dist/views/List/Default/index.d.ts.map +1 -1
  446. package/dist/views/List/Default/index.js +163 -112
  447. package/dist/views/List/Default/index.js.map +1 -1
  448. package/dist/views/List/Default/types.d.ts +2 -2
  449. package/dist/views/List/Default/types.d.ts.map +1 -1
  450. package/dist/views/List/Default/types.js.map +1 -1
  451. package/dist/views/List/index.d.ts +1 -1
  452. package/dist/views/List/index.d.ts.map +1 -1
  453. package/dist/views/List/index.js +62 -43
  454. package/dist/views/List/index.js.map +1 -1
  455. package/dist/views/List/meta.d.ts +1 -1
  456. package/dist/views/List/meta.d.ts.map +1 -1
  457. package/dist/views/List/meta.js +4 -2
  458. package/dist/views/List/meta.js.map +1 -1
  459. package/dist/views/LivePreview/Context/collisionDetection.js.map +1 -1
  460. package/dist/views/LivePreview/Context/context.d.ts +3 -3
  461. package/dist/views/LivePreview/Context/context.d.ts.map +1 -1
  462. package/dist/views/LivePreview/Context/context.js.map +1 -1
  463. package/dist/views/LivePreview/Context/index.d.ts +1 -2
  464. package/dist/views/LivePreview/Context/index.d.ts.map +1 -1
  465. package/dist/views/LivePreview/Context/index.js +10 -7
  466. package/dist/views/LivePreview/Context/index.js.map +1 -1
  467. package/dist/views/LivePreview/Context/sizeReducer.js.map +1 -1
  468. package/dist/views/LivePreview/Device/index.d.ts.map +1 -1
  469. package/dist/views/LivePreview/Device/index.js +48 -18
  470. package/dist/views/LivePreview/Device/index.js.map +1 -1
  471. package/dist/views/LivePreview/DeviceContainer/index.js +5 -3
  472. package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -1
  473. package/dist/views/LivePreview/IFrame/index.js +2 -1
  474. package/dist/views/LivePreview/IFrame/index.js.map +1 -1
  475. package/dist/views/LivePreview/Preview/index.d.ts +1 -1
  476. package/dist/views/LivePreview/Preview/index.d.ts.map +1 -1
  477. package/dist/views/LivePreview/Preview/index.js +27 -18
  478. package/dist/views/LivePreview/Preview/index.js.map +1 -1
  479. package/dist/views/LivePreview/Toolbar/Controls/index.d.ts +1 -1
  480. package/dist/views/LivePreview/Toolbar/Controls/index.d.ts.map +1 -1
  481. package/dist/views/LivePreview/Toolbar/Controls/index.js +106 -62
  482. package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
  483. package/dist/views/LivePreview/Toolbar/SizeInput/index.js +2 -1
  484. package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -1
  485. package/dist/views/LivePreview/Toolbar/index.d.ts +1 -1
  486. package/dist/views/LivePreview/Toolbar/index.d.ts.map +1 -1
  487. package/dist/views/LivePreview/Toolbar/index.js +30 -15
  488. package/dist/views/LivePreview/Toolbar/index.js.map +1 -1
  489. package/dist/views/LivePreview/ToolbarArea/index.js +5 -3
  490. package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -1
  491. package/dist/views/LivePreview/index.client.d.ts +1 -2
  492. package/dist/views/LivePreview/index.client.d.ts.map +1 -1
  493. package/dist/views/LivePreview/index.client.js +124 -99
  494. package/dist/views/LivePreview/index.client.js.map +1 -1
  495. package/dist/views/LivePreview/index.d.ts +1 -1
  496. package/dist/views/LivePreview/index.d.ts.map +1 -1
  497. package/dist/views/LivePreview/index.js +2 -1
  498. package/dist/views/LivePreview/index.js.map +1 -1
  499. package/dist/views/LivePreview/meta.d.ts.map +1 -1
  500. package/dist/views/LivePreview/meta.js +6 -22
  501. package/dist/views/LivePreview/meta.js.map +1 -1
  502. package/dist/views/LivePreview/usePopupWindow.d.ts +1 -1
  503. package/dist/views/LivePreview/usePopupWindow.d.ts.map +1 -1
  504. package/dist/views/LivePreview/usePopupWindow.js +1 -1
  505. package/dist/views/LivePreview/usePopupWindow.js.map +1 -1
  506. package/dist/views/Login/LoginForm/index.d.ts.map +1 -1
  507. package/dist/views/Login/LoginForm/index.js +96 -62
  508. package/dist/views/Login/LoginForm/index.js.map +1 -1
  509. package/dist/views/Login/index.d.ts +1 -1
  510. package/dist/views/Login/index.d.ts.map +1 -1
  511. package/dist/views/Login/index.js +51 -15
  512. package/dist/views/Login/index.js.map +1 -1
  513. package/dist/views/Login/meta.d.ts.map +1 -1
  514. package/dist/views/Login/meta.js +4 -5
  515. package/dist/views/Login/meta.js.map +1 -1
  516. package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
  517. package/dist/views/Logout/LogoutClient.js +22 -10
  518. package/dist/views/Logout/LogoutClient.js.map +1 -1
  519. package/dist/views/Logout/index.d.ts +1 -1
  520. package/dist/views/Logout/index.d.ts.map +1 -1
  521. package/dist/views/Logout/index.js +10 -11
  522. package/dist/views/Logout/index.js.map +1 -1
  523. package/dist/views/Logout/meta.d.ts.map +1 -1
  524. package/dist/views/Logout/meta.js +2 -4
  525. package/dist/views/Logout/meta.js.map +1 -1
  526. package/dist/views/NotFound/index.client.d.ts.map +1 -1
  527. package/dist/views/NotFound/index.client.js +23 -15
  528. package/dist/views/NotFound/index.client.js.map +1 -1
  529. package/dist/views/NotFound/index.d.ts +2 -2
  530. package/dist/views/NotFound/index.d.ts.map +1 -1
  531. package/dist/views/NotFound/index.js +24 -11
  532. package/dist/views/NotFound/index.js.map +1 -1
  533. package/dist/views/NotFound/meta.d.ts +1 -1
  534. package/dist/views/NotFound/meta.d.ts.map +1 -1
  535. package/dist/views/NotFound/meta.js +2 -4
  536. package/dist/views/NotFound/meta.js.map +1 -1
  537. package/dist/views/ResetPassword/index.client.d.ts.map +1 -1
  538. package/dist/views/ResetPassword/index.client.js +21 -23
  539. package/dist/views/ResetPassword/index.client.js.map +1 -1
  540. package/dist/views/ResetPassword/index.d.ts +1 -1
  541. package/dist/views/ResetPassword/index.d.ts.map +1 -1
  542. package/dist/views/ResetPassword/index.js +49 -29
  543. package/dist/views/ResetPassword/index.js.map +1 -1
  544. package/dist/views/ResetPassword/meta.d.ts.map +1 -1
  545. package/dist/views/ResetPassword/meta.js +4 -5
  546. package/dist/views/ResetPassword/meta.js.map +1 -1
  547. package/dist/views/Root/getCustomViewByRoute.d.ts +1 -1
  548. package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -1
  549. package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
  550. package/dist/views/Root/getViewFromConfig.d.ts +3 -4
  551. package/dist/views/Root/getViewFromConfig.d.ts.map +1 -1
  552. package/dist/views/Root/getViewFromConfig.js +29 -12
  553. package/dist/views/Root/getViewFromConfig.js.map +1 -1
  554. package/dist/views/Root/index.d.ts +2 -1
  555. package/dist/views/Root/index.d.ts.map +1 -1
  556. package/dist/views/Root/index.js +48 -17
  557. package/dist/views/Root/index.js.map +1 -1
  558. package/dist/views/Root/isPathMatchingRoute.js.map +1 -1
  559. package/dist/views/Root/meta.d.ts +1 -1
  560. package/dist/views/Root/meta.d.ts.map +1 -1
  561. package/dist/views/Root/meta.js +0 -19
  562. package/dist/views/Root/meta.js.map +1 -1
  563. package/dist/views/Unauthorized/index.d.ts +1 -1
  564. package/dist/views/Unauthorized/index.d.ts.map +1 -1
  565. package/dist/views/Unauthorized/index.js +21 -11
  566. package/dist/views/Unauthorized/index.js.map +1 -1
  567. package/dist/views/Unauthorized/meta.d.ts.map +1 -1
  568. package/dist/views/Unauthorized/meta.js +4 -5
  569. package/dist/views/Unauthorized/meta.js.map +1 -1
  570. package/dist/views/Verify/index.d.ts +1 -1
  571. package/dist/views/Verify/index.d.ts.map +1 -1
  572. package/dist/views/Verify/index.js +24 -9
  573. package/dist/views/Verify/index.js.map +1 -1
  574. package/dist/views/Verify/meta.d.ts.map +1 -1
  575. package/dist/views/Verify/meta.js +4 -5
  576. package/dist/views/Verify/meta.js.map +1 -1
  577. package/dist/views/Version/Default/SetStepNav.d.ts +1 -1
  578. package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
  579. package/dist/views/Version/Default/SetStepNav.js +2 -5
  580. package/dist/views/Version/Default/SetStepNav.js.map +1 -1
  581. package/dist/views/Version/Default/index.d.ts.map +1 -1
  582. package/dist/views/Version/Default/index.js +85 -65
  583. package/dist/views/Version/Default/index.js.map +1 -1
  584. package/dist/views/Version/Default/types.d.ts +1 -3
  585. package/dist/views/Version/Default/types.d.ts.map +1 -1
  586. package/dist/views/Version/Default/types.js.map +1 -1
  587. package/dist/views/Version/RenderFieldsToDiff/Label/index.js +5 -3
  588. package/dist/views/Version/RenderFieldsToDiff/Label/index.js.map +1 -1
  589. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +66 -51
  590. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
  591. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +30 -18
  592. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -1
  593. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -1
  594. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +25 -14
  595. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
  596. package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +2 -1
  597. package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js.map +1 -1
  598. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts +1 -1
  599. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +1 -1
  600. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +22 -11
  601. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
  602. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +1 -2
  603. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -1
  604. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +31 -30
  605. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
  606. package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +2 -1
  607. package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js.map +1 -1
  608. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +22 -11
  609. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
  610. package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js.map +1 -1
  611. package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts +3 -33
  612. package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -1
  613. package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
  614. package/dist/views/Version/RenderFieldsToDiff/fields/styles.js.map +1 -1
  615. package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts +3 -3
  616. package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts.map +1 -1
  617. package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +1 -1
  618. package/dist/views/Version/RenderFieldsToDiff/index.js +90 -87
  619. package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
  620. package/dist/views/Version/RenderFieldsToDiff/types.d.ts +3 -3
  621. package/dist/views/Version/RenderFieldsToDiff/types.d.ts.map +1 -1
  622. package/dist/views/Version/RenderFieldsToDiff/types.js.map +1 -1
  623. package/dist/views/Version/Restore/index.d.ts.map +1 -1
  624. package/dist/views/Version/Restore/index.js +42 -26
  625. package/dist/views/Version/Restore/index.js.map +1 -1
  626. package/dist/views/Version/Restore/types.d.ts +1 -1
  627. package/dist/views/Version/Restore/types.d.ts.map +1 -1
  628. package/dist/views/Version/Restore/types.js.map +1 -1
  629. package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
  630. package/dist/views/Version/SelectComparison/index.js +35 -31
  631. package/dist/views/Version/SelectComparison/index.js.map +1 -1
  632. package/dist/views/Version/SelectComparison/types.d.ts +1 -2
  633. package/dist/views/Version/SelectComparison/types.d.ts.map +1 -1
  634. package/dist/views/Version/SelectComparison/types.js.map +1 -1
  635. package/dist/views/Version/SelectLocales/index.d.ts.map +1 -1
  636. package/dist/views/Version/SelectLocales/index.js +19 -14
  637. package/dist/views/Version/SelectLocales/index.js.map +1 -1
  638. package/dist/views/Version/SelectLocales/types.d.ts +1 -1
  639. package/dist/views/Version/SelectLocales/types.d.ts.map +1 -1
  640. package/dist/views/Version/SelectLocales/types.js.map +1 -1
  641. package/dist/views/Version/index.d.ts +1 -1
  642. package/dist/views/Version/index.d.ts.map +1 -1
  643. package/dist/views/Version/index.js +9 -2
  644. package/dist/views/Version/index.js.map +1 -1
  645. package/dist/views/Version/meta.d.ts.map +1 -1
  646. package/dist/views/Version/meta.js +6 -3
  647. package/dist/views/Version/meta.js.map +1 -1
  648. package/dist/views/Version/shared.js.map +1 -1
  649. package/dist/views/Versions/buildColumns.d.ts +2 -2
  650. package/dist/views/Versions/buildColumns.d.ts.map +1 -1
  651. package/dist/views/Versions/buildColumns.js +8 -7
  652. package/dist/views/Versions/buildColumns.js.map +1 -1
  653. package/dist/views/Versions/cells/AutosaveCell/index.d.ts.map +1 -1
  654. package/dist/views/Versions/cells/AutosaveCell/index.js +26 -6
  655. package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
  656. package/dist/views/Versions/cells/CreatedAt/index.d.ts.map +1 -1
  657. package/dist/views/Versions/cells/CreatedAt/index.js +11 -11
  658. package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
  659. package/dist/views/Versions/cells/ID/index.js +5 -2
  660. package/dist/views/Versions/cells/ID/index.js.map +1 -1
  661. package/dist/views/Versions/index.client.d.ts +2 -2
  662. package/dist/views/Versions/index.client.d.ts.map +1 -1
  663. package/dist/views/Versions/index.client.js +62 -38
  664. package/dist/views/Versions/index.client.js.map +1 -1
  665. package/dist/views/Versions/index.d.ts +1 -1
  666. package/dist/views/Versions/index.d.ts.map +1 -1
  667. package/dist/views/Versions/index.js +36 -26
  668. package/dist/views/Versions/index.js.map +1 -1
  669. package/dist/views/Versions/meta.d.ts.map +1 -1
  670. package/dist/views/Versions/meta.js +8 -4
  671. package/dist/views/Versions/meta.js.map +1 -1
  672. package/dist/views/Versions/types.d.ts +1 -3
  673. package/dist/views/Versions/types.d.ts.map +1 -1
  674. package/dist/views/Versions/types.js.map +1 -1
  675. package/dist/withPayload.d.ts +1 -1
  676. package/dist/withPayload.d.ts.map +1 -1
  677. package/dist/withPayload.js +52 -10
  678. package/dist/withPayload.js.map +1 -1
  679. package/package.json +56 -39
  680. package/dist/prod/payload/favicon.svg +0 -15
  681. package/dist/prod/payload/og-image.png +0 -0
  682. package/dist/scss/toastify.scss +0 -58
  683. package/dist/utilities/buildFieldSchemaMap/index.d.ts +0 -4
  684. package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +0 -1
  685. package/dist/utilities/buildFieldSchemaMap/index.js +0 -28
  686. package/dist/utilities/buildFieldSchemaMap/index.js.map +0 -1
  687. package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts +0 -14
  688. package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +0 -1
  689. package/dist/utilities/buildFieldSchemaMap/traverseFields.js +0 -75
  690. package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +0 -1
  691. package/dist/utilities/buildFieldSchemaMap/types.d.ts +0 -3
  692. package/dist/utilities/buildFieldSchemaMap/types.d.ts.map +0 -1
  693. package/dist/utilities/buildFieldSchemaMap/types.js +0 -3
  694. package/dist/utilities/buildFieldSchemaMap/types.js.map +0 -1
  695. package/dist/utilities/getDataAndFile.d.ts +0 -12
  696. package/dist/utilities/getDataAndFile.d.ts.map +0 -1
  697. package/dist/utilities/getDataAndFile.js +0 -48
  698. package/dist/utilities/getDataAndFile.js.map +0 -1
  699. package/dist/views/Dashboard/Default/index.client.d.ts +0 -10
  700. package/dist/views/Dashboard/Default/index.client.d.ts.map +0 -1
  701. package/dist/views/Dashboard/Default/index.client.js +0 -103
  702. package/dist/views/Dashboard/Default/index.client.js.map +0 -1
  703. package/dist/webpackEntry.d.ts +0 -5
  704. package/dist/webpackEntry.d.ts.map +0 -1
  705. package/dist/webpackEntry.js +0 -6
  706. package/dist/webpackEntry.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import httpStatus from 'http-status';
2
- import { verifyEmailOperation } from 'payload/operations';
2
+ import { verifyEmailOperation } from 'payload';
3
3
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
4
4
  export const verifyEmail = async ({ id, collection, req })=>{
5
5
  const { t } = req;
@@ -9,7 +9,7 @@ export const verifyEmail = async ({ id, collection, req })=>{
9
9
  token: id
10
10
  });
11
11
  return Response.json({
12
- message: t('authentication:emailVerified')
12
+ message: t('authentication:accountVerified')
13
13
  }, {
14
14
  headers: headersWithCors({
15
15
  headers: new Headers(),
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/auth/verifyEmail.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { verifyEmailOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const verifyEmail: CollectionRouteHandlerWithID = async ({ id, collection, req }) => {\n const { t } = req\n await verifyEmailOperation({\n collection,\n req,\n token: id,\n })\n\n return Response.json(\n {\n message: t('authentication:emailVerified'),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","verifyEmailOperation","headersWithCors","verifyEmail","id","collection","req","t","token","Response","json","message","headers","Headers","status","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,oBAAoB,QAAQ,qBAAoB;AAIzD,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,cAA4C,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACrF,MAAM,EAAEC,CAAC,EAAE,GAAGD;IACd,MAAML,qBAAqB;QACzBI;QACAC;QACAE,OAAOJ;IACT;IAEA,OAAOK,SAASC,IAAI,CAClB;QACEC,SAASJ,EAAE;IACb,GACA;QACEK,SAASV,gBAAgB;YACvBU,SAAS,IAAIC;YACbP;QACF;QACAQ,QAAQd,WAAWe,EAAE;IACvB;AAEJ,EAAC"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/auth/verifyEmail.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { verifyEmailOperation } from 'payload'\n\nimport type { CollectionRouteHandlerWithID } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const verifyEmail: CollectionRouteHandlerWithID = async ({ id, collection, req }) => {\n const { t } = req\n await verifyEmailOperation({\n collection,\n req,\n token: id,\n })\n\n return Response.json(\n {\n message: t('authentication:accountVerified'),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","verifyEmailOperation","headersWithCors","verifyEmail","id","collection","req","t","token","Response","json","message","headers","Headers","status","OK"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,oBAAoB,QAAQ,UAAS;AAI9C,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,cAA4C,OAAO,EAAEC,EAAE,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACrF,MAAM,EAAEC,CAAC,EAAE,GAAGD;IACd,MAAML,qBAAqB;QACzBI;QACAC;QACAE,OAAOJ;IACT;IAEA,OAAOK,SAASC,IAAI,CAClB;QACEC,SAASJ,EAAE;IACb,GACA;QACEK,SAASV,gBAAgB;YACvBU,SAAS,IAAIC;YACbP;QACF;QACAQ,QAAQd,WAAWe,EAAE;IACvB;AAEJ,EAAC"}
@@ -1,7 +1,5 @@
1
- import type { PayloadRequestWithData } from 'payload/types';
2
- import type { FieldSchemaMap } from '../../utilities/buildFieldSchemaMap/types.js';
3
- export declare const getFieldSchemaMap: (req: PayloadRequestWithData) => FieldSchemaMap;
1
+ import type { PayloadRequest } from 'payload';
4
2
  export declare const buildFormState: ({ req }: {
5
- req: PayloadRequestWithData;
3
+ req: PayloadRequest;
6
4
  }) => Promise<Response>;
7
5
  //# sourceMappingURL=buildFormState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildFormState.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/buildFormState.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA8B,sBAAsB,EAAc,MAAM,eAAe,CAAA;AAMnG,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAA;AAalF,eAAO,MAAM,iBAAiB,QAAS,sBAAsB,mBAQ5D,CAAA;AAED,eAAO,MAAM,cAAc,YAAmB;IAAE,GAAG,EAAE,sBAAsB,CAAA;CAAE,sBAiN5E,CAAA"}
1
+ {"version":3,"file":"buildFormState.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/buildFormState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAQ7C,eAAO,MAAM,cAAc,YAAmB;IAAE,GAAG,EAAE,cAAc,CAAA;CAAE,sBAyCpE,CAAA"}
@@ -1,185 +1,35 @@
1
- import { buildStateFromSchema } from '@payloadcms/ui/forms/buildStateFromSchema';
2
- import { reduceFieldsToValues } from '@payloadcms/ui/utilities/reduceFieldsToValues';
1
+ import { buildFormState as buildFormStateFn } from '@payloadcms/ui/utilities/buildFormState';
3
2
  import httpStatus from 'http-status';
4
- import { buildFieldSchemaMap } from '../../utilities/buildFieldSchemaMap/index.js';
5
3
  import { headersWithCors } from '../../utilities/headersWithCors.js';
6
4
  import { routeError } from './routeError.js';
7
- let cached = global._payload_fieldSchemaMap;
8
- if (!cached) {
9
- // eslint-disable-next-line no-multi-assign
10
- cached = global._payload_fieldSchemaMap = null;
11
- }
12
- export const getFieldSchemaMap = (req)=>{
13
- if (cached && process.env.NODE_ENV !== 'development') {
14
- return cached;
15
- }
16
- cached = buildFieldSchemaMap(req);
17
- return cached;
18
- };
19
5
  export const buildFormState = async ({ req })=>{
20
6
  const headers = headersWithCors({
21
7
  headers: new Headers(),
22
8
  req
23
9
  });
24
10
  try {
25
- const reqData = req.data;
26
- const { collectionSlug, formState, globalSlug, locale, operation, schemaPath } = reqData;
27
- const incomingUserSlug = req.user?.collection;
28
- const adminUserSlug = req.payload.config.admin.user;
29
- // If we have a user slug, test it against the functions
30
- if (incomingUserSlug) {
31
- const adminAccessFunction = req.payload.collections[incomingUserSlug].config.access?.admin;
32
- // Run the admin access function from the config if it exists
33
- if (adminAccessFunction) {
34
- const canAccessAdmin = await adminAccessFunction({
35
- req
36
- });
37
- if (!canAccessAdmin) {
38
- return Response.json(null, {
39
- headers,
40
- status: httpStatus.UNAUTHORIZED
41
- });
42
- }
43
- // Match the user collection to the global admin config
44
- } else if (adminUserSlug !== incomingUserSlug) {
45
- return Response.json(null, {
46
- headers,
47
- status: httpStatus.UNAUTHORIZED
48
- });
49
- }
50
- } else {
51
- const hasUsers = await req.payload.find({
52
- collection: adminUserSlug,
53
- depth: 0,
54
- limit: 1,
55
- pagination: false
56
- });
57
- // If there are users, we should not allow access because of /create-first-user
58
- if (hasUsers.docs.length) {
59
- return Response.json(null, {
60
- headers,
61
- status: httpStatus.UNAUTHORIZED
62
- });
63
- }
64
- }
65
- const fieldSchemaMap = getFieldSchemaMap(req);
66
- const id = collectionSlug ? reqData.id : undefined;
67
- const schemaPathSegments = schemaPath.split('.');
68
- let fieldSchema;
69
- if (schemaPathSegments.length === 1) {
70
- if (req.payload.collections[schemaPath]) {
71
- fieldSchema = req.payload.collections[schemaPath].config.fields;
72
- } else {
73
- fieldSchema = req.payload.config.globals.find((global1)=>global1.slug === schemaPath)?.fields;
74
- }
75
- } else if (fieldSchemaMap.has(schemaPath)) {
76
- fieldSchema = fieldSchemaMap.get(schemaPath);
77
- }
78
- if (!fieldSchema) {
79
- return Response.json({
80
- message: 'Could not find field schema for given path'
81
- }, {
82
- headers,
83
- status: httpStatus.BAD_REQUEST
84
- });
85
- }
86
- let docPreferences = reqData.docPreferences;
87
- let data = reqData.data;
88
- const promises = {};
89
- // If the request does not include doc preferences,
90
- // we should fetch them. This is useful for DocumentInfoProvider
91
- // as it reduces the amount of client-side fetches necessary
92
- // when we fetch data for the Edit view
93
- if (!docPreferences) {
94
- let preferencesKey;
95
- if (collectionSlug && id) {
96
- preferencesKey = `collection-${collectionSlug}-${id}`;
97
- }
98
- if (globalSlug) {
99
- preferencesKey = `global-${globalSlug}`;
100
- }
101
- if (preferencesKey) {
102
- const fetchPreferences = async ()=>{
103
- const preferencesResult = await req.payload.find({
104
- collection: 'payload-preferences',
105
- depth: 0,
106
- limit: 1,
107
- where: {
108
- key: {
109
- equals: preferencesKey
110
- }
111
- }
112
- });
113
- if (preferencesResult?.docs?.[0]?.value) docPreferences = preferencesResult.docs[0].value;
114
- };
115
- promises.preferences = fetchPreferences();
116
- }
117
- }
118
- // If there is a form state,
119
- // then we can deduce data from that form state
120
- if (formState) data = reduceFieldsToValues(formState, true);
121
- // If we do not have data at this point,
122
- // we can fetch it. This is useful for DocumentInfoProvider
123
- // to reduce the amount of fetches required
124
- if (!data) {
125
- const fetchData = async ()=>{
126
- let resolvedData;
127
- if (collectionSlug && id) {
128
- resolvedData = await req.payload.findByID({
129
- id,
130
- collection: collectionSlug,
131
- depth: 0,
132
- draft: true,
133
- fallbackLocale: null,
134
- locale,
135
- overrideAccess: false,
136
- user: req.user
137
- });
138
- }
139
- if (globalSlug && schemaPath === globalSlug) {
140
- resolvedData = await req.payload.findGlobal({
141
- slug: globalSlug,
142
- depth: 0,
143
- draft: true,
144
- fallbackLocale: null,
145
- locale,
146
- overrideAccess: false,
147
- user: req.user
148
- });
149
- }
150
- data = resolvedData;
151
- };
152
- promises.data = fetchData();
153
- }
154
- if (Object.keys(promises).length > 0) {
155
- await Promise.all(Object.values(promises));
156
- }
157
- const result = await buildStateFromSchema({
158
- id,
159
- data,
160
- fieldSchema,
161
- operation,
162
- preferences: docPreferences || {
163
- fields: {}
164
- },
11
+ const result = await buildFormStateFn({
165
12
  req
166
13
  });
167
- // Maintain form state of auth / upload fields
168
- if (collectionSlug && formState) {
169
- if (req.payload.collections[collectionSlug]?.config?.upload && formState.file) {
170
- result.file = formState.file;
171
- }
172
- if (req.payload.collections[collectionSlug]?.config?.auth && !req.payload.collections[collectionSlug].config.auth.disableLocalStrategy) {
173
- if (formState.password) result.password = formState.password;
174
- if (formState['confirm-password']) result['confirm-password'] = formState['confirm-password'];
175
- if (formState.email) result.email = formState.email;
176
- }
177
- }
178
14
  return Response.json(result, {
179
15
  headers,
180
16
  status: httpStatus.OK
181
17
  });
182
18
  } catch (err) {
19
+ if (err.message === 'Could not find field schema for given path') {
20
+ return Response.json({
21
+ message: err.message
22
+ }, {
23
+ headers,
24
+ status: httpStatus.BAD_REQUEST
25
+ });
26
+ }
27
+ if (err.message === 'Unauthorized') {
28
+ return Response.json(null, {
29
+ headers,
30
+ status: httpStatus.UNAUTHORIZED
31
+ });
32
+ }
183
33
  req.payload.logger.error({
184
34
  err,
185
35
  msg: `There was an error building form state`
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/routes/rest/buildFormState.ts"],"sourcesContent":["import type { BuildFormStateArgs } from '@payloadcms/ui/forms/buildStateFromSchema'\nimport type { DocumentPreferences, Field, PayloadRequestWithData, TypeWithID } from 'payload/types'\n\nimport { buildStateFromSchema } from '@payloadcms/ui/forms/buildStateFromSchema'\nimport { reduceFieldsToValues } from '@payloadcms/ui/utilities/reduceFieldsToValues'\nimport httpStatus from 'http-status'\n\nimport type { FieldSchemaMap } from '../../utilities/buildFieldSchemaMap/types.js'\n\nimport { buildFieldSchemaMap } from '../../utilities/buildFieldSchemaMap/index.js'\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { routeError } from './routeError.js'\n\nlet cached = global._payload_fieldSchemaMap\n\nif (!cached) {\n // eslint-disable-next-line no-multi-assign\n cached = global._payload_fieldSchemaMap = null\n}\n\nexport const getFieldSchemaMap = (req: PayloadRequestWithData): FieldSchemaMap => {\n if (cached && process.env.NODE_ENV !== 'development') {\n return cached\n }\n\n cached = buildFieldSchemaMap(req)\n\n return cached\n}\n\nexport const buildFormState = async ({ req }: { req: PayloadRequestWithData }) => {\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n try {\n const reqData: BuildFormStateArgs = req.data as BuildFormStateArgs\n const { collectionSlug, formState, globalSlug, locale, operation, schemaPath } = reqData\n\n const incomingUserSlug = req.user?.collection\n const adminUserSlug = req.payload.config.admin.user\n\n // If we have a user slug, test it against the functions\n if (incomingUserSlug) {\n const adminAccessFunction = req.payload.collections[incomingUserSlug].config.access?.admin\n\n // Run the admin access function from the config if it exists\n if (adminAccessFunction) {\n const canAccessAdmin = await adminAccessFunction({ req })\n\n if (!canAccessAdmin) {\n return Response.json(null, {\n headers,\n status: httpStatus.UNAUTHORIZED,\n })\n }\n // Match the user collection to the global admin config\n } else if (adminUserSlug !== incomingUserSlug) {\n return Response.json(null, {\n headers,\n status: httpStatus.UNAUTHORIZED,\n })\n }\n } else {\n const hasUsers = await req.payload.find({\n collection: adminUserSlug,\n depth: 0,\n limit: 1,\n pagination: false,\n })\n // If there are users, we should not allow access because of /create-first-user\n if (hasUsers.docs.length) {\n return Response.json(null, {\n headers,\n status: httpStatus.UNAUTHORIZED,\n })\n }\n }\n\n const fieldSchemaMap = getFieldSchemaMap(req)\n\n const id = collectionSlug ? reqData.id : undefined\n const schemaPathSegments = schemaPath.split('.')\n\n let fieldSchema: Field[]\n\n if (schemaPathSegments.length === 1) {\n if (req.payload.collections[schemaPath]) {\n fieldSchema = req.payload.collections[schemaPath].config.fields\n } else {\n fieldSchema = req.payload.config.globals.find(\n (global) => global.slug === schemaPath,\n )?.fields\n }\n } else if (fieldSchemaMap.has(schemaPath)) {\n fieldSchema = fieldSchemaMap.get(schemaPath)\n }\n\n if (!fieldSchema) {\n return Response.json(\n {\n message: 'Could not find field schema for given path',\n },\n {\n headers,\n status: httpStatus.BAD_REQUEST,\n },\n )\n }\n\n let docPreferences = reqData.docPreferences\n let data = reqData.data\n\n const promises: {\n data?: Promise<void>\n preferences?: Promise<void>\n } = {}\n\n // If the request does not include doc preferences,\n // we should fetch them. This is useful for DocumentInfoProvider\n // as it reduces the amount of client-side fetches necessary\n // when we fetch data for the Edit view\n if (!docPreferences) {\n let preferencesKey\n\n if (collectionSlug && id) {\n preferencesKey = `collection-${collectionSlug}-${id}`\n }\n\n if (globalSlug) {\n preferencesKey = `global-${globalSlug}`\n }\n\n if (preferencesKey) {\n const fetchPreferences = async () => {\n const preferencesResult = (await req.payload.find({\n collection: 'payload-preferences',\n depth: 0,\n limit: 1,\n where: {\n key: {\n equals: preferencesKey,\n },\n },\n })) as unknown as { docs: { value: DocumentPreferences }[] }\n\n if (preferencesResult?.docs?.[0]?.value) docPreferences = preferencesResult.docs[0].value\n }\n\n promises.preferences = fetchPreferences()\n }\n }\n\n // If there is a form state,\n // then we can deduce data from that form state\n if (formState) data = reduceFieldsToValues(formState, true)\n\n // If we do not have data at this point,\n // we can fetch it. This is useful for DocumentInfoProvider\n // to reduce the amount of fetches required\n if (!data) {\n const fetchData = async () => {\n let resolvedData: TypeWithID\n\n if (collectionSlug && id) {\n resolvedData = await req.payload.findByID({\n id,\n collection: collectionSlug,\n depth: 0,\n draft: true,\n fallbackLocale: null,\n locale,\n overrideAccess: false,\n user: req.user,\n })\n }\n\n if (globalSlug && schemaPath === globalSlug) {\n resolvedData = await req.payload.findGlobal({\n slug: globalSlug,\n depth: 0,\n draft: true,\n fallbackLocale: null,\n locale,\n overrideAccess: false,\n user: req.user,\n })\n }\n\n data = resolvedData\n }\n\n promises.data = fetchData()\n }\n\n if (Object.keys(promises).length > 0) {\n await Promise.all(Object.values(promises))\n }\n\n const result = await buildStateFromSchema({\n id,\n data,\n fieldSchema,\n operation,\n preferences: docPreferences || { fields: {} },\n req,\n })\n\n // Maintain form state of auth / upload fields\n if (collectionSlug && formState) {\n if (req.payload.collections[collectionSlug]?.config?.upload && formState.file) {\n result.file = formState.file\n }\n\n if (\n req.payload.collections[collectionSlug]?.config?.auth &&\n !req.payload.collections[collectionSlug].config.auth.disableLocalStrategy\n ) {\n if (formState.password) result.password = formState.password\n if (formState['confirm-password'])\n result['confirm-password'] = formState['confirm-password']\n if (formState.email) result.email = formState.email\n }\n }\n\n return Response.json(result, {\n headers,\n status: httpStatus.OK,\n })\n } catch (err) {\n req.payload.logger.error({ err, msg: `There was an error building form state` })\n\n return routeError({\n config: req.payload.config,\n err,\n req,\n })\n }\n}\n"],"names":["buildStateFromSchema","reduceFieldsToValues","httpStatus","buildFieldSchemaMap","headersWithCors","routeError","cached","global","_payload_fieldSchemaMap","getFieldSchemaMap","req","process","env","NODE_ENV","buildFormState","headers","Headers","reqData","data","collectionSlug","formState","globalSlug","locale","operation","schemaPath","incomingUserSlug","user","collection","adminUserSlug","payload","config","admin","adminAccessFunction","collections","access","canAccessAdmin","Response","json","status","UNAUTHORIZED","hasUsers","find","depth","limit","pagination","docs","length","fieldSchemaMap","id","undefined","schemaPathSegments","split","fieldSchema","fields","globals","slug","has","get","message","BAD_REQUEST","docPreferences","promises","preferencesKey","fetchPreferences","preferencesResult","where","key","equals","value","preferences","fetchData","resolvedData","findByID","draft","fallbackLocale","overrideAccess","findGlobal","Object","keys","Promise","all","values","result","upload","file","auth","disableLocalStrategy","password","email","OK","err","logger","error","msg"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,oBAAoB,QAAQ,4CAA2C;AAChF,SAASC,oBAAoB,QAAQ,gDAA+C;AACpF,OAAOC,gBAAgB,cAAa;AAIpC,SAASC,mBAAmB,QAAQ,+CAA8C;AAClF,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,UAAU,QAAQ,kBAAiB;AAE5C,IAAIC,SAASC,OAAOC,uBAAuB;AAE3C,IAAI,CAACF,QAAQ;IACX,2CAA2C;IAC3CA,SAASC,OAAOC,uBAAuB,GAAG;AAC5C;AAEA,OAAO,MAAMC,oBAAoB,CAACC;IAChC,IAAIJ,UAAUK,QAAQC,GAAG,CAACC,QAAQ,KAAK,eAAe;QACpD,OAAOP;IACT;IAEAA,SAASH,oBAAoBO;IAE7B,OAAOJ;AACT,EAAC;AAED,OAAO,MAAMQ,iBAAiB,OAAO,EAAEJ,GAAG,EAAmC;IAC3E,MAAMK,UAAUX,gBAAgB;QAC9BW,SAAS,IAAIC;QACbN;IACF;IAEA,IAAI;QACF,MAAMO,UAA8BP,IAAIQ,IAAI;QAC5C,MAAM,EAAEC,cAAc,EAAEC,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAEC,SAAS,EAAEC,UAAU,EAAE,GAAGP;QAEjF,MAAMQ,mBAAmBf,IAAIgB,IAAI,EAAEC;QACnC,MAAMC,gBAAgBlB,IAAImB,OAAO,CAACC,MAAM,CAACC,KAAK,CAACL,IAAI;QAEnD,wDAAwD;QACxD,IAAID,kBAAkB;YACpB,MAAMO,sBAAsBtB,IAAImB,OAAO,CAACI,WAAW,CAACR,iBAAiB,CAACK,MAAM,CAACI,MAAM,EAAEH;YAErF,6DAA6D;YAC7D,IAAIC,qBAAqB;gBACvB,MAAMG,iBAAiB,MAAMH,oBAAoB;oBAAEtB;gBAAI;gBAEvD,IAAI,CAACyB,gBAAgB;oBACnB,OAAOC,SAASC,IAAI,CAAC,MAAM;wBACzBtB;wBACAuB,QAAQpC,WAAWqC,YAAY;oBACjC;gBACF;YACA,uDAAuD;YACzD,OAAO,IAAIX,kBAAkBH,kBAAkB;gBAC7C,OAAOW,SAASC,IAAI,CAAC,MAAM;oBACzBtB;oBACAuB,QAAQpC,WAAWqC,YAAY;gBACjC;YACF;QACF,OAAO;YACL,MAAMC,WAAW,MAAM9B,IAAImB,OAAO,CAACY,IAAI,CAAC;gBACtCd,YAAYC;gBACZc,OAAO;gBACPC,OAAO;gBACPC,YAAY;YACd;YACA,+EAA+E;YAC/E,IAAIJ,SAASK,IAAI,CAACC,MAAM,EAAE;gBACxB,OAAOV,SAASC,IAAI,CAAC,MAAM;oBACzBtB;oBACAuB,QAAQpC,WAAWqC,YAAY;gBACjC;YACF;QACF;QAEA,MAAMQ,iBAAiBtC,kBAAkBC;QAEzC,MAAMsC,KAAK7B,iBAAiBF,QAAQ+B,EAAE,GAAGC;QACzC,MAAMC,qBAAqB1B,WAAW2B,KAAK,CAAC;QAE5C,IAAIC;QAEJ,IAAIF,mBAAmBJ,MAAM,KAAK,GAAG;YACnC,IAAIpC,IAAImB,OAAO,CAACI,WAAW,CAACT,WAAW,EAAE;gBACvC4B,cAAc1C,IAAImB,OAAO,CAACI,WAAW,CAACT,WAAW,CAACM,MAAM,CAACuB,MAAM;YACjE,OAAO;gBACLD,cAAc1C,IAAImB,OAAO,CAACC,MAAM,CAACwB,OAAO,CAACb,IAAI,CAC3C,CAAClC,UAAWA,QAAOgD,IAAI,KAAK/B,aAC3B6B;YACL;QACF,OAAO,IAAIN,eAAeS,GAAG,CAAChC,aAAa;YACzC4B,cAAcL,eAAeU,GAAG,CAACjC;QACnC;QAEA,IAAI,CAAC4B,aAAa;YAChB,OAAOhB,SAASC,IAAI,CAClB;gBACEqB,SAAS;YACX,GACA;gBACE3C;gBACAuB,QAAQpC,WAAWyD,WAAW;YAChC;QAEJ;QAEA,IAAIC,iBAAiB3C,QAAQ2C,cAAc;QAC3C,IAAI1C,OAAOD,QAAQC,IAAI;QAEvB,MAAM2C,WAGF,CAAC;QAEL,mDAAmD;QACnD,gEAAgE;QAChE,4DAA4D;QAC5D,uCAAuC;QACvC,IAAI,CAACD,gBAAgB;YACnB,IAAIE;YAEJ,IAAI3C,kBAAkB6B,IAAI;gBACxBc,iBAAiB,CAAC,WAAW,EAAE3C,eAAe,CAAC,EAAE6B,GAAG,CAAC;YACvD;YAEA,IAAI3B,YAAY;gBACdyC,iBAAiB,CAAC,OAAO,EAAEzC,WAAW,CAAC;YACzC;YAEA,IAAIyC,gBAAgB;gBAClB,MAAMC,mBAAmB;oBACvB,MAAMC,oBAAqB,MAAMtD,IAAImB,OAAO,CAACY,IAAI,CAAC;wBAChDd,YAAY;wBACZe,OAAO;wBACPC,OAAO;wBACPsB,OAAO;4BACLC,KAAK;gCACHC,QAAQL;4BACV;wBACF;oBACF;oBAEA,IAAIE,mBAAmBnB,MAAM,CAAC,EAAE,EAAEuB,OAAOR,iBAAiBI,kBAAkBnB,IAAI,CAAC,EAAE,CAACuB,KAAK;gBAC3F;gBAEAP,SAASQ,WAAW,GAAGN;YACzB;QACF;QAEA,4BAA4B;QAC5B,+CAA+C;QAC/C,IAAI3C,WAAWF,OAAOjB,qBAAqBmB,WAAW;QAEtD,wCAAwC;QACxC,2DAA2D;QAC3D,2CAA2C;QAC3C,IAAI,CAACF,MAAM;YACT,MAAMoD,YAAY;gBAChB,IAAIC;gBAEJ,IAAIpD,kBAAkB6B,IAAI;oBACxBuB,eAAe,MAAM7D,IAAImB,OAAO,CAAC2C,QAAQ,CAAC;wBACxCxB;wBACArB,YAAYR;wBACZuB,OAAO;wBACP+B,OAAO;wBACPC,gBAAgB;wBAChBpD;wBACAqD,gBAAgB;wBAChBjD,MAAMhB,IAAIgB,IAAI;oBAChB;gBACF;gBAEA,IAAIL,cAAcG,eAAeH,YAAY;oBAC3CkD,eAAe,MAAM7D,IAAImB,OAAO,CAAC+C,UAAU,CAAC;wBAC1CrB,MAAMlC;wBACNqB,OAAO;wBACP+B,OAAO;wBACPC,gBAAgB;wBAChBpD;wBACAqD,gBAAgB;wBAChBjD,MAAMhB,IAAIgB,IAAI;oBAChB;gBACF;gBAEAR,OAAOqD;YACT;YAEAV,SAAS3C,IAAI,GAAGoD;QAClB;QAEA,IAAIO,OAAOC,IAAI,CAACjB,UAAUf,MAAM,GAAG,GAAG;YACpC,MAAMiC,QAAQC,GAAG,CAACH,OAAOI,MAAM,CAACpB;QAClC;QAEA,MAAMqB,SAAS,MAAMlF,qBAAqB;YACxCgD;YACA9B;YACAkC;YACA7B;YACA8C,aAAaT,kBAAkB;gBAAEP,QAAQ,CAAC;YAAE;YAC5C3C;QACF;QAEA,8CAA8C;QAC9C,IAAIS,kBAAkBC,WAAW;YAC/B,IAAIV,IAAImB,OAAO,CAACI,WAAW,CAACd,eAAe,EAAEW,QAAQqD,UAAU/D,UAAUgE,IAAI,EAAE;gBAC7EF,OAAOE,IAAI,GAAGhE,UAAUgE,IAAI;YAC9B;YAEA,IACE1E,IAAImB,OAAO,CAACI,WAAW,CAACd,eAAe,EAAEW,QAAQuD,QACjD,CAAC3E,IAAImB,OAAO,CAACI,WAAW,CAACd,eAAe,CAACW,MAAM,CAACuD,IAAI,CAACC,oBAAoB,EACzE;gBACA,IAAIlE,UAAUmE,QAAQ,EAAEL,OAAOK,QAAQ,GAAGnE,UAAUmE,QAAQ;gBAC5D,IAAInE,SAAS,CAAC,mBAAmB,EAC/B8D,MAAM,CAAC,mBAAmB,GAAG9D,SAAS,CAAC,mBAAmB;gBAC5D,IAAIA,UAAUoE,KAAK,EAAEN,OAAOM,KAAK,GAAGpE,UAAUoE,KAAK;YACrD;QACF;QAEA,OAAOpD,SAASC,IAAI,CAAC6C,QAAQ;YAC3BnE;YACAuB,QAAQpC,WAAWuF,EAAE;QACvB;IACF,EAAE,OAAOC,KAAK;QACZhF,IAAImB,OAAO,CAAC8D,MAAM,CAACC,KAAK,CAAC;YAAEF;YAAKG,KAAK,CAAC,sCAAsC,CAAC;QAAC;QAE9E,OAAOxF,WAAW;YAChByB,QAAQpB,IAAImB,OAAO,CAACC,MAAM;YAC1B4D;YACAhF;QACF;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/routes/rest/buildFormState.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\n\nimport { buildFormState as buildFormStateFn } from '@payloadcms/ui/utilities/buildFormState'\nimport httpStatus from 'http-status'\n\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { routeError } from './routeError.js'\n\nexport const buildFormState = async ({ req }: { req: PayloadRequest }) => {\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n try {\n const result = await buildFormStateFn({ req })\n\n return Response.json(result, {\n headers,\n status: httpStatus.OK,\n })\n } catch (err) {\n if (err.message === 'Could not find field schema for given path') {\n return Response.json(\n {\n message: err.message,\n },\n {\n headers,\n status: httpStatus.BAD_REQUEST,\n },\n )\n }\n\n if (err.message === 'Unauthorized') {\n return Response.json(null, {\n headers,\n status: httpStatus.UNAUTHORIZED,\n })\n }\n\n req.payload.logger.error({ err, msg: `There was an error building form state` })\n\n return routeError({\n config: req.payload.config,\n err,\n req,\n })\n }\n}\n"],"names":["buildFormState","buildFormStateFn","httpStatus","headersWithCors","routeError","req","headers","Headers","result","Response","json","status","OK","err","message","BAD_REQUEST","UNAUTHORIZED","payload","logger","error","msg","config"],"mappings":"AAEA,SAASA,kBAAkBC,gBAAgB,QAAQ,0CAAyC;AAC5F,OAAOC,gBAAgB,cAAa;AAEpC,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,UAAU,QAAQ,kBAAiB;AAE5C,OAAO,MAAMJ,iBAAiB,OAAO,EAAEK,GAAG,EAA2B;IACnE,MAAMC,UAAUH,gBAAgB;QAC9BG,SAAS,IAAIC;QACbF;IACF;IAEA,IAAI;QACF,MAAMG,SAAS,MAAMP,iBAAiB;YAAEI;QAAI;QAE5C,OAAOI,SAASC,IAAI,CAACF,QAAQ;YAC3BF;YACAK,QAAQT,WAAWU,EAAE;QACvB;IACF,EAAE,OAAOC,KAAK;QACZ,IAAIA,IAAIC,OAAO,KAAK,8CAA8C;YAChE,OAAOL,SAASC,IAAI,CAClB;gBACEI,SAASD,IAAIC,OAAO;YACtB,GACA;gBACER;gBACAK,QAAQT,WAAWa,WAAW;YAChC;QAEJ;QAEA,IAAIF,IAAIC,OAAO,KAAK,gBAAgB;YAClC,OAAOL,SAASC,IAAI,CAAC,MAAM;gBACzBJ;gBACAK,QAAQT,WAAWc,YAAY;YACjC;QACF;QAEAX,IAAIY,OAAO,CAACC,MAAM,CAACC,KAAK,CAAC;YAAEN;YAAKO,KAAK,CAAC,sCAAsC,CAAC;QAAC;QAE9E,OAAOhB,WAAW;YAChBiB,QAAQhB,IAAIY,OAAO,CAACI,MAAM;YAC1BR;YACAR;QACF;IACF;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"checkEndpoints.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/checkEndpoints.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,4BAG9B;IACD,SAAS,EAAE,KAAK,GAAG,OAAO,EAAE,CAAA;IAC5B,OAAO,EAAE,QAAQ,OAAO,CAAC,CAAA;CAC1B,aAWA,CAAA"}
1
+ {"version":3,"file":"checkEndpoints.d.ts","sourceRoot":"","sources":["../../../src/routes/rest/checkEndpoints.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,4BAG9B;IACD,SAAS,EAAE,KAAK,GAAG,OAAO,EAAE,CAAA;IAC5B,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;CAC1B,aAWA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/routes/rest/checkEndpoints.ts"],"sourcesContent":["import httpStatus from 'http-status'\n\nexport const endpointsAreDisabled = ({\n endpoints,\n request,\n}: {\n endpoints: false | unknown[]\n request: Partial<Request>\n}) => {\n if (!endpoints) {\n return Response.json(\n {\n message: `Cannot ${request.method.toUpperCase()} ${request.url}`,\n },\n {\n status: httpStatus.NOT_IMPLEMENTED,\n },\n )\n }\n}\n"],"names":["httpStatus","endpointsAreDisabled","endpoints","request","Response","json","message","method","toUpperCase","url","status","NOT_IMPLEMENTED"],"rangeMappings":";;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AAEpC,OAAO,MAAMC,uBAAuB,CAAC,EACnCC,SAAS,EACTC,OAAO,EAIR;IACC,IAAI,CAACD,WAAW;QACd,OAAOE,SAASC,IAAI,CAClB;YACEC,SAAS,CAAC,OAAO,EAAEH,QAAQI,MAAM,CAACC,WAAW,GAAG,CAAC,EAAEL,QAAQM,GAAG,CAAC,CAAC;QAClE,GACA;YACEC,QAAQV,WAAWW,eAAe;QACpC;IAEJ;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/routes/rest/checkEndpoints.ts"],"sourcesContent":["import httpStatus from 'http-status'\n\nexport const endpointsAreDisabled = ({\n endpoints,\n request,\n}: {\n endpoints: false | unknown[]\n request: Partial<Request>\n}) => {\n if (!endpoints) {\n return Response.json(\n {\n message: `Cannot ${request.method.toUpperCase()} ${request.url}`,\n },\n {\n status: httpStatus.NOT_IMPLEMENTED,\n },\n )\n }\n}\n"],"names":["httpStatus","endpointsAreDisabled","endpoints","request","Response","json","message","method","toUpperCase","url","status","NOT_IMPLEMENTED"],"mappings":"AAAA,OAAOA,gBAAgB,cAAa;AAEpC,OAAO,MAAMC,uBAAuB,CAAC,EACnCC,SAAS,EACTC,OAAO,EAIR;IACC,IAAI,CAACD,WAAW;QACd,OAAOE,SAASC,IAAI,CAClB;YACEC,SAAS,CAAC,OAAO,EAAEH,QAAQI,MAAM,CAACC,WAAW,GAAG,CAAC,EAAEL,QAAQM,GAAG,CAAC,CAAC;QAClE,GACA;YACEC,QAAQV,WAAWW,eAAe;QACpC;IAEJ;AACF,EAAC"}
@@ -1,5 +1,5 @@
1
1
  import httpStatus from 'http-status';
2
- import { countOperation } from 'payload/operations';
2
+ import { countOperation } from 'payload';
3
3
  export const count = async ({ collection, req })=>{
4
4
  const { where } = req.query;
5
5
  const result = await countOperation({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/collections/count.ts"],"sourcesContent":["import type { Where } from 'payload/types'\n\nimport httpStatus from 'http-status'\nimport { countOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const count: CollectionRouteHandler = async ({ collection, req }) => {\n const { where } = req.query as {\n where?: Where\n }\n\n const result = await countOperation({\n collection,\n req,\n where,\n })\n\n return Response.json(result, {\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","countOperation","count","collection","req","where","query","result","Response","json","status","OK"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAEA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,cAAc,QAAQ,qBAAoB;AAInD,OAAO,MAAMC,QAAgC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACrE,MAAM,EAAEC,KAAK,EAAE,GAAGD,IAAIE,KAAK;IAI3B,MAAMC,SAAS,MAAMN,eAAe;QAClCE;QACAC;QACAC;IACF;IAEA,OAAOG,SAASC,IAAI,CAACF,QAAQ;QAC3BG,QAAQV,WAAWW,EAAE;IACvB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/count.ts"],"sourcesContent":["import type { Where } from 'payload'\n\nimport httpStatus from 'http-status'\nimport { countOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nexport const count: CollectionRouteHandler = async ({ collection, req }) => {\n const { where } = req.query as {\n where?: Where\n }\n\n const result = await countOperation({\n collection,\n req,\n where,\n })\n\n return Response.json(result, {\n status: httpStatus.OK,\n })\n}\n"],"names":["httpStatus","countOperation","count","collection","req","where","query","result","Response","json","status","OK"],"mappings":"AAEA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,cAAc,QAAQ,UAAS;AAIxC,OAAO,MAAMC,QAAgC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACrE,MAAM,EAAEC,KAAK,EAAE,GAAGD,IAAIE,KAAK;IAI3B,MAAMC,SAAS,MAAMN,eAAe;QAClCE;QACAC;QACAC;IACF;IAEA,OAAOG,SAASC,IAAI,CAACF,QAAQ;QAC3BG,QAAQV,WAAWW,EAAE;IACvB;AACF,EAAC"}
@@ -1,7 +1,7 @@
1
1
  import { getTranslation } from '@payloadcms/translations';
2
2
  import httpStatus from 'http-status';
3
- import { createOperation } from 'payload/operations';
4
- import { isNumber } from 'payload/utilities';
3
+ import { createOperation } from 'payload';
4
+ import { isNumber } from 'payload/shared';
5
5
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
6
6
  export const create = async ({ collection, req })=>{
7
7
  const { searchParams } = req;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/collections/create.ts"],"sourcesContent":["import { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { createOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const create: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams } = req\n const autosave = searchParams.get('autosave') === 'true'\n const draft = searchParams.get('draft') === 'true'\n const depth = searchParams.get('depth')\n\n const doc = await createOperation({\n autosave,\n collection,\n data: req.data,\n depth: isNumber(depth) ? depth : undefined,\n draft,\n req,\n })\n\n return Response.json(\n {\n doc,\n message: req.t('general:successfullyCreated', {\n label: getTranslation(collection.config.labels.singular, req.i18n),\n }),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.CREATED,\n },\n )\n}\n"],"names":["getTranslation","httpStatus","createOperation","isNumber","headersWithCors","create","collection","req","searchParams","autosave","get","draft","depth","doc","data","undefined","Response","json","message","t","label","config","labels","singular","i18n","headers","Headers","status","CREATED"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,gBAAgB,cAAa;AACpC,SAASC,eAAe,QAAQ,qBAAoB;AACpD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,SAAiC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACtE,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,WAAWD,aAAaE,GAAG,CAAC,gBAAgB;IAClD,MAAMC,QAAQH,aAAaE,GAAG,CAAC,aAAa;IAC5C,MAAME,QAAQJ,aAAaE,GAAG,CAAC;IAE/B,MAAMG,MAAM,MAAMX,gBAAgB;QAChCO;QACAH;QACAQ,MAAMP,IAAIO,IAAI;QACdF,OAAOT,SAASS,SAASA,QAAQG;QACjCJ;QACAJ;IACF;IAEA,OAAOS,SAASC,IAAI,CAClB;QACEJ;QACAK,SAASX,IAAIY,CAAC,CAAC,+BAA+B;YAC5CC,OAAOpB,eAAeM,WAAWe,MAAM,CAACC,MAAM,CAACC,QAAQ,EAAEhB,IAAIiB,IAAI;QACnE;IACF,GACA;QACEC,SAASrB,gBAAgB;YACvBqB,SAAS,IAAIC;YACbnB;QACF;QACAoB,QAAQ1B,WAAW2B,OAAO;IAC5B;AAEJ,EAAC"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/create.ts"],"sourcesContent":["import { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { createOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const create: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams } = req\n const autosave = searchParams.get('autosave') === 'true'\n const draft = searchParams.get('draft') === 'true'\n const depth = searchParams.get('depth')\n\n const doc = await createOperation({\n autosave,\n collection,\n data: req.data,\n depth: isNumber(depth) ? depth : undefined,\n draft,\n req,\n })\n\n return Response.json(\n {\n doc,\n message: req.t('general:successfullyCreated', {\n label: getTranslation(collection.config.labels.singular, req.i18n),\n }),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.CREATED,\n },\n )\n}\n"],"names":["getTranslation","httpStatus","createOperation","isNumber","headersWithCors","create","collection","req","searchParams","autosave","get","draft","depth","doc","data","undefined","Response","json","message","t","label","config","labels","singular","i18n","headers","Headers","status","CREATED"],"mappings":"AAAA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,gBAAgB,cAAa;AACpC,SAASC,eAAe,QAAQ,UAAS;AACzC,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,SAAiC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACtE,MAAM,EAAEC,YAAY,EAAE,GAAGD;IACzB,MAAME,WAAWD,aAAaE,GAAG,CAAC,gBAAgB;IAClD,MAAMC,QAAQH,aAAaE,GAAG,CAAC,aAAa;IAC5C,MAAME,QAAQJ,aAAaE,GAAG,CAAC;IAE/B,MAAMG,MAAM,MAAMX,gBAAgB;QAChCO;QACAH;QACAQ,MAAMP,IAAIO,IAAI;QACdF,OAAOT,SAASS,SAASA,QAAQG;QACjCJ;QACAJ;IACF;IAEA,OAAOS,SAASC,IAAI,CAClB;QACEJ;QACAK,SAASX,IAAIY,CAAC,CAAC,+BAA+B;YAC5CC,OAAOpB,eAAeM,WAAWe,MAAM,CAACC,MAAM,CAACC,QAAQ,EAAEhB,IAAIiB,IAAI;QACnE;IACF,GACA;QACEC,SAASrB,gBAAgB;YACvBqB,SAAS,IAAIC;YACbnB;QACF;QACAoB,QAAQ1B,WAAW2B,OAAO;IAC5B;AAEJ,EAAC"}
@@ -1,7 +1,7 @@
1
1
  import { getTranslation } from '@payloadcms/translations';
2
2
  import httpStatus from 'http-status';
3
- import { deleteOperation } from 'payload/operations';
4
- import { isNumber } from 'payload/utilities';
3
+ import { deleteOperation } from 'payload';
4
+ import { isNumber } from 'payload/shared';
5
5
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
6
6
  export const deleteDoc = async ({ collection, req })=>{
7
7
  const { depth, where } = req.query;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/collections/delete.ts"],"sourcesContent":["import type { Where } from 'payload/types'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { deleteOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const deleteDoc: CollectionRouteHandler = async ({ collection, req }) => {\n const { depth, where } = req.query as {\n depth?: string\n where?: Where\n }\n\n const result = await deleteOperation({\n collection,\n depth: isNumber(depth) ? Number(depth) : undefined,\n req,\n where,\n })\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n if (result.errors.length === 0) {\n const message = req.t('general:deletedCountSuccessfully', {\n count: result.docs.length,\n label: getTranslation(\n collection.config.labels[result.docs.length > 1 ? 'plural' : 'singular'],\n req.i18n,\n ),\n })\n\n return Response.json(\n {\n ...result,\n message,\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n }\n\n const total = result.docs.length + result.errors.length\n\n const message = req.t('error:unableToDeleteCount', {\n count: result.errors.length,\n label: getTranslation(collection.config.labels[total > 1 ? 'plural' : 'singular'], req.i18n),\n total,\n })\n\n return Response.json(\n {\n ...result,\n message,\n },\n {\n headers,\n status: httpStatus.BAD_REQUEST,\n },\n )\n}\n"],"names":["getTranslation","httpStatus","deleteOperation","isNumber","headersWithCors","deleteDoc","collection","req","depth","where","query","result","Number","undefined","headers","Headers","errors","length","message","t","count","docs","label","config","labels","i18n","Response","json","status","OK","total","BAD_REQUEST"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,gBAAgB,cAAa;AACpC,SAASC,eAAe,QAAQ,qBAAoB;AACpD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,YAAoC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACzE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF,IAAIG,KAAK;IAKlC,MAAMC,SAAS,MAAMT,gBAAgB;QACnCI;QACAE,OAAOL,SAASK,SAASI,OAAOJ,SAASK;QACzCN;QACAE;IACF;IAEA,MAAMK,UAAUV,gBAAgB;QAC9BU,SAAS,IAAIC;QACbR;IACF;IAEA,IAAII,OAAOK,MAAM,CAACC,MAAM,KAAK,GAAG;QAC9B,MAAMC,UAAUX,IAAIY,CAAC,CAAC,oCAAoC;YACxDC,OAAOT,OAAOU,IAAI,CAACJ,MAAM;YACzBK,OAAOtB,eACLM,WAAWiB,MAAM,CAACC,MAAM,CAACb,OAAOU,IAAI,CAACJ,MAAM,GAAG,IAAI,WAAW,WAAW,EACxEV,IAAIkB,IAAI;QAEZ;QAEA,OAAOC,SAASC,IAAI,CAClB;YACE,GAAGhB,MAAM;YACTO;QACF,GACA;YACEJ;YACAc,QAAQ3B,WAAW4B,EAAE;QACvB;IAEJ;IAEA,MAAMC,QAAQnB,OAAOU,IAAI,CAACJ,MAAM,GAAGN,OAAOK,MAAM,CAACC,MAAM;IAEvD,MAAMC,UAAUX,IAAIY,CAAC,CAAC,6BAA6B;QACjDC,OAAOT,OAAOK,MAAM,CAACC,MAAM;QAC3BK,OAAOtB,eAAeM,WAAWiB,MAAM,CAACC,MAAM,CAACM,QAAQ,IAAI,WAAW,WAAW,EAAEvB,IAAIkB,IAAI;QAC3FK;IACF;IAEA,OAAOJ,SAASC,IAAI,CAClB;QACE,GAAGhB,MAAM;QACTO;IACF,GACA;QACEJ;QACAc,QAAQ3B,WAAW8B,WAAW;IAChC;AAEJ,EAAC"}
1
+ {"version":3,"sources":["../../../../src/routes/rest/collections/delete.ts"],"sourcesContent":["import type { Where } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport httpStatus from 'http-status'\nimport { deleteOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const deleteDoc: CollectionRouteHandler = async ({ collection, req }) => {\n const { depth, where } = req.query as {\n depth?: string\n where?: Where\n }\n\n const result = await deleteOperation({\n collection,\n depth: isNumber(depth) ? Number(depth) : undefined,\n req,\n where,\n })\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n if (result.errors.length === 0) {\n const message = req.t('general:deletedCountSuccessfully', {\n count: result.docs.length,\n label: getTranslation(\n collection.config.labels[result.docs.length > 1 ? 'plural' : 'singular'],\n req.i18n,\n ),\n })\n\n return Response.json(\n {\n ...result,\n message,\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n }\n\n const total = result.docs.length + result.errors.length\n\n const message = req.t('error:unableToDeleteCount', {\n count: result.errors.length,\n label: getTranslation(collection.config.labels[total > 1 ? 'plural' : 'singular'], req.i18n),\n total,\n })\n\n return Response.json(\n {\n ...result,\n message,\n },\n {\n headers,\n status: httpStatus.BAD_REQUEST,\n },\n )\n}\n"],"names":["getTranslation","httpStatus","deleteOperation","isNumber","headersWithCors","deleteDoc","collection","req","depth","where","query","result","Number","undefined","headers","Headers","errors","length","message","t","count","docs","label","config","labels","i18n","Response","json","status","OK","total","BAD_REQUEST"],"mappings":"AAEA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,gBAAgB,cAAa;AACpC,SAASC,eAAe,QAAQ,UAAS;AACzC,SAASC,QAAQ,QAAQ,iBAAgB;AAIzC,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,YAAoC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACzE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF,IAAIG,KAAK;IAKlC,MAAMC,SAAS,MAAMT,gBAAgB;QACnCI;QACAE,OAAOL,SAASK,SAASI,OAAOJ,SAASK;QACzCN;QACAE;IACF;IAEA,MAAMK,UAAUV,gBAAgB;QAC9BU,SAAS,IAAIC;QACbR;IACF;IAEA,IAAII,OAAOK,MAAM,CAACC,MAAM,KAAK,GAAG;QAC9B,MAAMC,UAAUX,IAAIY,CAAC,CAAC,oCAAoC;YACxDC,OAAOT,OAAOU,IAAI,CAACJ,MAAM;YACzBK,OAAOtB,eACLM,WAAWiB,MAAM,CAACC,MAAM,CAACb,OAAOU,IAAI,CAACJ,MAAM,GAAG,IAAI,WAAW,WAAW,EACxEV,IAAIkB,IAAI;QAEZ;QAEA,OAAOC,SAASC,IAAI,CAClB;YACE,GAAGhB,MAAM;YACTO;QACF,GACA;YACEJ;YACAc,QAAQ3B,WAAW4B,EAAE;QACvB;IAEJ;IAEA,MAAMC,QAAQnB,OAAOU,IAAI,CAACJ,MAAM,GAAGN,OAAOK,MAAM,CAACC,MAAM;IAEvD,MAAMC,UAAUX,IAAIY,CAAC,CAAC,6BAA6B;QACjDC,OAAOT,OAAOK,MAAM,CAACC,MAAM;QAC3BK,OAAOtB,eAAeM,WAAWiB,MAAM,CAACC,MAAM,CAACM,QAAQ,IAAI,WAAW,WAAW,EAAEvB,IAAIkB,IAAI;QAC3FK;IACF;IAEA,OAAOJ,SAASC,IAAI,CAClB;QACE,GAAGhB,MAAM;QACTO;IACF,GACA;QACEJ;QACAc,QAAQ3B,WAAW8B,WAAW;IAChC;AAEJ,EAAC"}
@@ -1,6 +1,6 @@
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
4
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
5
  import { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js';
6
6
  export const deleteByID = async ({ id: incomingID, collection, req })=>{
@@ -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 { 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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,mBAAmB,QAAQ,qBAAoB;AACxD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,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
+ {"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,5 +1,5 @@
1
1
  import httpStatus from 'http-status';
2
- import { docAccessOperation } from 'payload/operations';
2
+ import { docAccessOperation } from 'payload';
3
3
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
4
4
  export const docAccess = async ({ id, collection, req })=>{
5
5
  const result = await docAccessOperation({
@@ -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\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"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,kBAAkB,QAAQ,qBAAoB;AAIvD,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
+ {"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,7 +1,7 @@
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
5
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
6
6
  import { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js';
7
7
  export const duplicate = async ({ id: incomingID, collection, req })=>{
@@ -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 { 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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,gBAAgB,cAAa;AACpC,SAASC,kBAAkB,QAAQ,qBAAoB;AACvD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,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
+ {"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,6 +1,6 @@
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
4
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
5
  export const find = async ({ collection, req })=>{
6
6
  const { depth, draft, limit, page, sort, where } = req.query;
@@ -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\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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,aAAa,QAAQ,qBAAoB;AAClD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,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
+ {"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,6 +1,6 @@
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
4
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
5
  import { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js';
6
6
  export const findByID = async ({ id: incomingID, collection, req })=>{
@@ -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 { 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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,iBAAiB,QAAQ,qBAAoB;AACtD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,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
+ {"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,6 +1,6 @@
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
4
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
5
  import { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js';
6
6
  export const findVersionByID = async ({ id: incomingID, collection, req })=>{
@@ -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 { 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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,wBAAwB,QAAQ,qBAAoB;AAC7D,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,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
+ {"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,6 +1,6 @@
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
4
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
5
  export const findVersions = async ({ collection, req })=>{
6
6
  const { depth, limit, page, sort, where } = req.query;
@@ -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\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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,qBAAqB,QAAQ,qBAAoB;AAC1D,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,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
+ {"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;AAK/D,eAAO,MAAM,OAAO,EAAE,4BA4CrB,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,6 @@
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';
5
4
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
6
5
  import { routeError } from '../routeError.js';
7
6
  export const preview = async ({ id, collection, req })=>{
@@ -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 { 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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,UAAU,QAAQ,eAAc;AACzC,SAASC,iBAAiB,QAAQ,qBAAoB;AACtD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,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
+ {"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,6 +1,6 @@
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
4
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
5
  import { sanitizeCollectionID } from '../utilities/sanitizeCollectionID.js';
6
6
  export const restoreVersion = async ({ id: incomingID, collection, req })=>{