@payloadcms/next 3.0.0-beta.13 → 3.0.0-beta.130

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 (976) hide show
  1. package/dist/cjs/withPayload.cjs +89 -19
  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 +0 -1
  6. package/dist/config.js.map +1 -1
  7. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.d.ts +5 -0
  8. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.d.ts.map +1 -0
  9. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js +19 -0
  10. package/dist/elements/DocumentHeader/Tabs/ShouldRenderTabs.js.map +1 -0
  11. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.d.ts +13 -0
  12. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.d.ts.map +1 -0
  13. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js +113 -0
  14. package/dist/elements/DocumentHeader/Tabs/Tab/TabLink.js.map +1 -0
  15. package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts +8 -0
  16. package/dist/elements/DocumentHeader/Tabs/Tab/index.d.ts.map +1 -0
  17. package/dist/elements/DocumentHeader/Tabs/Tab/index.js +80 -0
  18. package/dist/elements/DocumentHeader/Tabs/Tab/index.js.map +1 -0
  19. package/dist/elements/DocumentHeader/Tabs/Tab/index.scss +95 -0
  20. package/dist/elements/DocumentHeader/Tabs/getCustomViews.d.ts +6 -0
  21. package/dist/elements/DocumentHeader/Tabs/getCustomViews.d.ts.map +1 -0
  22. package/dist/elements/DocumentHeader/Tabs/getCustomViews.js +34 -0
  23. package/dist/elements/DocumentHeader/Tabs/getCustomViews.js.map +1 -0
  24. package/dist/elements/DocumentHeader/Tabs/getViewConfig.d.ts +7 -0
  25. package/dist/elements/DocumentHeader/Tabs/getViewConfig.d.ts.map +1 -0
  26. package/dist/elements/DocumentHeader/Tabs/getViewConfig.js +17 -0
  27. package/dist/elements/DocumentHeader/Tabs/getViewConfig.js.map +1 -0
  28. package/dist/elements/DocumentHeader/Tabs/index.d.ts +12 -0
  29. package/dist/elements/DocumentHeader/Tabs/index.d.ts.map +1 -0
  30. package/dist/elements/DocumentHeader/Tabs/index.js +99 -0
  31. package/dist/elements/DocumentHeader/Tabs/index.js.map +1 -0
  32. package/dist/elements/DocumentHeader/Tabs/index.scss +54 -0
  33. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.d.ts +3 -0
  34. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.d.ts.map +1 -0
  35. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js +29 -0
  36. package/dist/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.js.map +1 -0
  37. package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts +9 -0
  38. package/dist/elements/DocumentHeader/Tabs/tabs/index.d.ts.map +1 -0
  39. package/dist/elements/DocumentHeader/Tabs/tabs/index.js +65 -0
  40. package/dist/elements/DocumentHeader/Tabs/tabs/index.js.map +1 -0
  41. package/dist/elements/DocumentHeader/index.d.ts +13 -0
  42. package/dist/elements/DocumentHeader/index.d.ts.map +1 -0
  43. package/dist/elements/DocumentHeader/index.js +28 -0
  44. package/dist/elements/DocumentHeader/index.js.map +1 -0
  45. package/dist/elements/DocumentHeader/index.scss +54 -0
  46. package/dist/elements/FormHeader/index.d.ts +9 -0
  47. package/dist/elements/FormHeader/index.d.ts.map +1 -0
  48. package/dist/elements/FormHeader/index.js +20 -0
  49. package/dist/elements/FormHeader/index.js.map +1 -0
  50. package/dist/elements/FormHeader/index.scss +8 -0
  51. package/dist/elements/Logo/index.d.ts +4 -0
  52. package/dist/elements/Logo/index.d.ts.map +1 -0
  53. package/dist/elements/Logo/index.js +41 -0
  54. package/dist/elements/Logo/index.js.map +1 -0
  55. package/dist/elements/Nav/NavHamburger/index.d.ts +5 -0
  56. package/dist/elements/Nav/NavHamburger/index.d.ts.map +1 -0
  57. package/dist/elements/Nav/NavHamburger/index.js +48 -0
  58. package/dist/elements/Nav/NavHamburger/index.js.map +1 -0
  59. package/dist/elements/Nav/NavWrapper/index.d.ts +7 -0
  60. package/dist/elements/Nav/NavWrapper/index.d.ts.map +1 -0
  61. package/dist/elements/Nav/NavWrapper/index.js +55 -0
  62. package/dist/elements/Nav/NavWrapper/index.js.map +1 -0
  63. package/dist/elements/Nav/NavWrapper/index.scss +27 -0
  64. package/dist/elements/Nav/getNavPrefs.d.ts +6 -0
  65. package/dist/elements/Nav/getNavPrefs.d.ts.map +1 -0
  66. package/dist/elements/Nav/getNavPrefs.js +26 -0
  67. package/dist/elements/Nav/getNavPrefs.js.map +1 -0
  68. package/dist/elements/Nav/index.client.d.ts +8 -0
  69. package/dist/elements/Nav/index.client.d.ts.map +1 -0
  70. package/dist/elements/Nav/index.client.js +111 -0
  71. package/dist/elements/Nav/index.client.js.map +1 -0
  72. package/dist/elements/Nav/index.d.ts +6 -0
  73. package/dist/elements/Nav/index.d.ts.map +1 -0
  74. package/dist/elements/Nav/index.js +110 -0
  75. package/dist/elements/Nav/index.js.map +1 -0
  76. package/dist/elements/Nav/index.scss +162 -0
  77. package/dist/exports/layouts.d.ts +2 -1
  78. package/dist/exports/layouts.d.ts.map +1 -1
  79. package/dist/exports/layouts.js +2 -2
  80. package/dist/exports/layouts.js.map +1 -1
  81. package/dist/exports/routes.d.ts +1 -1
  82. package/dist/exports/routes.d.ts.map +1 -1
  83. package/dist/exports/routes.js +1 -2
  84. package/dist/exports/routes.js.map +1 -1
  85. package/dist/exports/templates.d.ts +3 -0
  86. package/dist/exports/templates.d.ts.map +1 -0
  87. package/dist/exports/templates.js +3 -0
  88. package/dist/exports/templates.js.map +1 -0
  89. package/dist/exports/utilities.d.ts +3 -1
  90. package/dist/exports/utilities.d.ts.map +1 -1
  91. package/dist/exports/utilities.js +4 -2
  92. package/dist/exports/utilities.js.map +1 -1
  93. package/dist/exports/views.d.ts +1 -2
  94. package/dist/exports/views.d.ts.map +1 -1
  95. package/dist/exports/views.js +1 -3
  96. package/dist/exports/views.js.map +1 -1
  97. package/dist/{next-fileupload → fetchAPI-multipart}/fileFactory.d.ts +3 -3
  98. package/dist/fetchAPI-multipart/fileFactory.d.ts.map +1 -0
  99. package/dist/fetchAPI-multipart/fileFactory.js +44 -0
  100. package/dist/fetchAPI-multipart/fileFactory.js.map +1 -0
  101. package/dist/{next-fileupload → fetchAPI-multipart}/handlers.d.ts +2 -3
  102. package/dist/fetchAPI-multipart/handlers.d.ts.map +1 -0
  103. package/dist/fetchAPI-multipart/handlers.js +87 -0
  104. package/dist/fetchAPI-multipart/handlers.js.map +1 -0
  105. package/dist/fetchAPI-multipart/index.d.ts +32 -0
  106. package/dist/fetchAPI-multipart/index.d.ts.map +1 -0
  107. package/dist/fetchAPI-multipart/index.js +43 -0
  108. package/dist/fetchAPI-multipart/index.js.map +1 -0
  109. package/dist/fetchAPI-multipart/isEligibleRequest.d.ts.map +1 -0
  110. package/dist/fetchAPI-multipart/isEligibleRequest.js +18 -0
  111. package/dist/fetchAPI-multipart/isEligibleRequest.js.map +1 -0
  112. package/dist/fetchAPI-multipart/processMultipart.d.ts +9 -0
  113. package/dist/fetchAPI-multipart/processMultipart.d.ts.map +1 -0
  114. package/dist/fetchAPI-multipart/processMultipart.js +178 -0
  115. package/dist/fetchAPI-multipart/processMultipart.js.map +1 -0
  116. package/dist/fetchAPI-multipart/processNested.d.ts.map +1 -0
  117. package/dist/fetchAPI-multipart/processNested.js +31 -0
  118. package/dist/fetchAPI-multipart/processNested.js.map +1 -0
  119. package/dist/fetchAPI-multipart/uploadTimer.d.ts.map +1 -0
  120. package/dist/fetchAPI-multipart/uploadTimer.js +20 -0
  121. package/dist/fetchAPI-multipart/uploadTimer.js.map +1 -0
  122. package/dist/{next-fileupload → fetchAPI-multipart}/utilities.d.ts +4 -4
  123. package/dist/fetchAPI-multipart/utilities.d.ts.map +1 -0
  124. package/dist/fetchAPI-multipart/utilities.js +227 -0
  125. package/dist/fetchAPI-multipart/utilities.js.map +1 -0
  126. package/dist/{next-stream-file → fetchAPI-stream-file}/index.d.ts +0 -1
  127. package/dist/fetchAPI-stream-file/index.d.ts.map +1 -0
  128. package/dist/fetchAPI-stream-file/index.js +27 -0
  129. package/dist/fetchAPI-stream-file/index.js.map +1 -0
  130. package/dist/index.js +0 -1
  131. package/dist/index.js.map +1 -1
  132. package/dist/layouts/Root/NestProviders.d.ts +11 -0
  133. package/dist/layouts/Root/NestProviders.d.ts.map +1 -0
  134. package/dist/layouts/Root/NestProviders.js +21 -0
  135. package/dist/layouts/Root/NestProviders.js.map +1 -0
  136. package/dist/layouts/Root/index.d.ts +6 -5
  137. package/dist/layouts/Root/index.d.ts.map +1 -1
  138. package/dist/layouts/Root/index.js +134 -82
  139. package/dist/layouts/Root/index.js.map +1 -1
  140. package/dist/prod/styles.css +1 -1
  141. package/dist/routes/graphql/handler.d.ts +1 -1
  142. package/dist/routes/graphql/handler.d.ts.map +1 -1
  143. package/dist/routes/graphql/handler.js +122 -101
  144. package/dist/routes/graphql/handler.js.map +1 -1
  145. package/dist/routes/graphql/index.js +0 -1
  146. package/dist/routes/graphql/index.js.map +1 -1
  147. package/dist/routes/graphql/playground.d.ts +1 -1
  148. package/dist/routes/graphql/playground.d.ts.map +1 -1
  149. package/dist/routes/graphql/playground.js +23 -24
  150. package/dist/routes/graphql/playground.js.map +1 -1
  151. package/dist/routes/index.d.ts +1 -1
  152. package/dist/routes/index.d.ts.map +1 -1
  153. package/dist/routes/index.js +1 -2
  154. package/dist/routes/index.js.map +1 -1
  155. package/dist/routes/rest/auth/access.d.ts.map +1 -1
  156. package/dist/routes/rest/auth/access.js +20 -9
  157. package/dist/routes/rest/auth/access.js.map +1 -1
  158. package/dist/routes/rest/auth/forgotPassword.d.ts.map +1 -1
  159. package/dist/routes/rest/auth/forgotPassword.js +30 -22
  160. package/dist/routes/rest/auth/forgotPassword.js.map +1 -1
  161. package/dist/routes/rest/auth/init.js +17 -15
  162. package/dist/routes/rest/auth/init.js.map +1 -1
  163. package/dist/routes/rest/auth/login.d.ts.map +1 -1
  164. package/dist/routes/rest/auth/login.js +45 -36
  165. package/dist/routes/rest/auth/login.js.map +1 -1
  166. package/dist/routes/rest/auth/logout.d.ts.map +1 -1
  167. package/dist/routes/rest/auth/logout.js +33 -29
  168. package/dist/routes/rest/auth/logout.js.map +1 -1
  169. package/dist/routes/rest/auth/me.d.ts.map +1 -1
  170. package/dist/routes/rest/auth/me.js +24 -23
  171. package/dist/routes/rest/auth/me.js.map +1 -1
  172. package/dist/routes/rest/auth/refresh.d.ts.map +1 -1
  173. package/dist/routes/rest/auth/refresh.js +29 -35
  174. package/dist/routes/rest/auth/refresh.js.map +1 -1
  175. package/dist/routes/rest/auth/registerFirstUser.d.ts.map +1 -1
  176. package/dist/routes/rest/auth/registerFirstUser.js +44 -42
  177. package/dist/routes/rest/auth/registerFirstUser.js.map +1 -1
  178. package/dist/routes/rest/auth/resetPassword.d.ts.map +1 -1
  179. package/dist/routes/rest/auth/resetPassword.js +39 -35
  180. package/dist/routes/rest/auth/resetPassword.js.map +1 -1
  181. package/dist/routes/rest/auth/unlock.d.ts.map +1 -1
  182. package/dist/routes/rest/auth/unlock.js +28 -20
  183. package/dist/routes/rest/auth/unlock.js.map +1 -1
  184. package/dist/routes/rest/auth/verifyEmail.js +23 -18
  185. package/dist/routes/rest/auth/verifyEmail.js.map +1 -1
  186. package/dist/routes/rest/checkEndpoints.d.ts.map +1 -1
  187. package/dist/routes/rest/checkEndpoints.js +11 -9
  188. package/dist/routes/rest/checkEndpoints.js.map +1 -1
  189. package/dist/routes/rest/collections/count.js +16 -12
  190. package/dist/routes/rest/collections/count.js.map +1 -1
  191. package/dist/routes/rest/collections/create.d.ts.map +1 -1
  192. package/dist/routes/rest/collections/create.js +36 -28
  193. package/dist/routes/rest/collections/create.js.map +1 -1
  194. package/dist/routes/rest/collections/delete.d.ts.map +1 -1
  195. package/dist/routes/rest/collections/delete.js +50 -37
  196. package/dist/routes/rest/collections/delete.js.map +1 -1
  197. package/dist/routes/rest/collections/deleteByID.d.ts.map +1 -1
  198. package/dist/routes/rest/collections/deleteByID.js +44 -33
  199. package/dist/routes/rest/collections/deleteByID.js.map +1 -1
  200. package/dist/routes/rest/collections/docAccess.js +18 -15
  201. package/dist/routes/rest/collections/docAccess.js.map +1 -1
  202. package/dist/routes/rest/collections/duplicate.d.ts.map +1 -1
  203. package/dist/routes/rest/collections/duplicate.js +42 -33
  204. package/dist/routes/rest/collections/duplicate.js.map +1 -1
  205. package/dist/routes/rest/collections/find.d.ts.map +1 -1
  206. package/dist/routes/rest/collections/find.js +40 -22
  207. package/dist/routes/rest/collections/find.js.map +1 -1
  208. package/dist/routes/rest/collections/findByID.d.ts.map +1 -1
  209. package/dist/routes/rest/collections/findByID.js +36 -25
  210. package/dist/routes/rest/collections/findByID.js.map +1 -1
  211. package/dist/routes/rest/collections/findVersionByID.d.ts.map +1 -1
  212. package/dist/routes/rest/collections/findVersionByID.js +33 -24
  213. package/dist/routes/rest/collections/findVersionByID.js.map +1 -1
  214. package/dist/routes/rest/collections/findVersions.d.ts.map +1 -1
  215. package/dist/routes/rest/collections/findVersions.js +35 -21
  216. package/dist/routes/rest/collections/findVersions.js.map +1 -1
  217. package/dist/routes/rest/collections/preview.d.ts.map +1 -1
  218. package/dist/routes/rest/collections/preview.js +41 -37
  219. package/dist/routes/rest/collections/preview.js.map +1 -1
  220. package/dist/routes/rest/collections/restoreVersion.d.ts.map +1 -1
  221. package/dist/routes/rest/collections/restoreVersion.js +36 -27
  222. package/dist/routes/rest/collections/restoreVersion.js.map +1 -1
  223. package/dist/routes/rest/collections/update.d.ts.map +1 -1
  224. package/dist/routes/rest/collections/update.js +55 -39
  225. package/dist/routes/rest/collections/update.js.map +1 -1
  226. package/dist/routes/rest/collections/updateByID.d.ts.map +1 -1
  227. package/dist/routes/rest/collections/updateByID.js +52 -35
  228. package/dist/routes/rest/collections/updateByID.js.map +1 -1
  229. package/dist/routes/rest/files/checkFileAccess.d.ts +2 -2
  230. package/dist/routes/rest/files/checkFileAccess.d.ts.map +1 -1
  231. package/dist/routes/rest/files/checkFileAccess.js +52 -45
  232. package/dist/routes/rest/files/checkFileAccess.js.map +1 -1
  233. package/dist/routes/rest/files/getFile.d.ts +1 -1
  234. package/dist/routes/rest/files/getFile.d.ts.map +1 -1
  235. package/dist/routes/rest/files/getFile.js +59 -48
  236. package/dist/routes/rest/files/getFile.js.map +1 -1
  237. package/dist/routes/rest/files/getFileTypeFallback.js +16 -17
  238. package/dist/routes/rest/files/getFileTypeFallback.js.map +1 -1
  239. package/dist/routes/rest/globals/docAccess.js +16 -14
  240. package/dist/routes/rest/globals/docAccess.js.map +1 -1
  241. package/dist/routes/rest/globals/findOne.d.ts.map +1 -1
  242. package/dist/routes/rest/globals/findOne.js +28 -20
  243. package/dist/routes/rest/globals/findOne.js.map +1 -1
  244. package/dist/routes/rest/globals/findVersionByID.d.ts.map +1 -1
  245. package/dist/routes/rest/globals/findVersionByID.js +28 -19
  246. package/dist/routes/rest/globals/findVersionByID.js.map +1 -1
  247. package/dist/routes/rest/globals/findVersions.d.ts.map +1 -1
  248. package/dist/routes/rest/globals/findVersions.js +35 -21
  249. package/dist/routes/rest/globals/findVersions.js.map +1 -1
  250. package/dist/routes/rest/globals/preview.d.ts.map +1 -1
  251. package/dist/routes/rest/globals/preview.js +40 -37
  252. package/dist/routes/rest/globals/preview.js.map +1 -1
  253. package/dist/routes/rest/globals/restoreVersion.d.ts.map +1 -1
  254. package/dist/routes/rest/globals/restoreVersion.js +31 -22
  255. package/dist/routes/rest/globals/restoreVersion.js.map +1 -1
  256. package/dist/routes/rest/globals/update.d.ts.map +1 -1
  257. package/dist/routes/rest/globals/update.js +44 -30
  258. package/dist/routes/rest/globals/update.js.map +1 -1
  259. package/dist/routes/rest/index.d.ts +18 -13
  260. package/dist/routes/rest/index.d.ts.map +1 -1
  261. package/dist/routes/rest/index.js +751 -528
  262. package/dist/routes/rest/index.js.map +1 -1
  263. package/dist/routes/rest/og/image.d.ts +12 -0
  264. package/dist/routes/rest/og/image.d.ts.map +1 -0
  265. package/dist/routes/rest/og/image.js +85 -0
  266. package/dist/routes/rest/og/image.js.map +1 -0
  267. package/dist/routes/rest/og/index.d.ts +11 -0
  268. package/dist/routes/rest/og/index.d.ts.map +1 -0
  269. package/dist/routes/rest/og/index.js +73 -0
  270. package/dist/routes/rest/og/index.js.map +1 -0
  271. package/dist/routes/rest/og/roboto-regular.woff +0 -0
  272. package/dist/routes/rest/routeError.d.ts +4 -9
  273. package/dist/routes/rest/routeError.d.ts.map +1 -1
  274. package/dist/routes/rest/routeError.js +81 -99
  275. package/dist/routes/rest/routeError.js.map +1 -1
  276. package/dist/routes/rest/types.d.ts +1 -1
  277. package/dist/routes/rest/types.d.ts.map +1 -1
  278. package/dist/routes/rest/types.js +1 -2
  279. package/dist/routes/rest/types.js.map +1 -1
  280. package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts +1 -1
  281. package/dist/routes/rest/utilities/sanitizeCollectionID.d.ts.map +1 -1
  282. package/dist/routes/rest/utilities/sanitizeCollectionID.js +18 -11
  283. package/dist/routes/rest/utilities/sanitizeCollectionID.js.map +1 -1
  284. package/dist/routes/rest/utilities/sanitizeJoinParams.d.ts +13 -0
  285. package/dist/routes/rest/utilities/sanitizeJoinParams.d.ts.map +1 -0
  286. package/dist/routes/rest/utilities/sanitizeJoinParams.js +21 -0
  287. package/dist/routes/rest/utilities/sanitizeJoinParams.js.map +1 -0
  288. package/dist/routes/rest/utilities/sanitizePopulate.d.ts +3 -0
  289. package/dist/routes/rest/utilities/sanitizePopulate.d.ts.map +1 -0
  290. package/dist/routes/rest/utilities/sanitizePopulate.js +11 -0
  291. package/dist/routes/rest/utilities/sanitizePopulate.js.map +1 -0
  292. package/dist/routes/rest/utilities/sanitizeSelect.d.ts +6 -0
  293. package/dist/routes/rest/utilities/sanitizeSelect.d.ts.map +1 -0
  294. package/dist/routes/rest/utilities/sanitizeSelect.js +17 -0
  295. package/dist/routes/rest/utilities/sanitizeSelect.js.map +1 -0
  296. package/dist/scss/app.scss +167 -168
  297. package/dist/scss/colors.scss +256 -254
  298. package/dist/scss/resets.scss +9 -7
  299. package/dist/scss/toastify.scss +43 -40
  300. package/dist/scss/toasts.scss +144 -0
  301. package/dist/scss/type.scss +79 -86
  302. package/dist/scss/vars.scss +26 -47
  303. package/dist/templates/Default/NavHamburger/index.d.ts +3 -0
  304. package/dist/templates/Default/NavHamburger/index.d.ts.map +1 -0
  305. package/dist/templates/Default/NavHamburger/index.js +25 -0
  306. package/dist/templates/Default/NavHamburger/index.js.map +1 -0
  307. package/dist/templates/Default/Wrapper/index.d.ts +8 -0
  308. package/dist/templates/Default/Wrapper/index.d.ts.map +1 -0
  309. package/dist/templates/Default/Wrapper/index.js +49 -0
  310. package/dist/templates/Default/Wrapper/index.js.map +1 -0
  311. package/dist/templates/Default/Wrapper/index.scss +58 -0
  312. package/dist/templates/Default/index.d.ts +11 -0
  313. package/dist/templates/Default/index.d.ts.map +1 -0
  314. package/dist/templates/Default/index.js +136 -0
  315. package/dist/templates/Default/index.js.map +1 -0
  316. package/dist/templates/Default/index.scss +79 -0
  317. package/dist/templates/Minimal/index.d.ts +10 -0
  318. package/dist/templates/Minimal/index.d.ts.map +1 -0
  319. package/dist/templates/Minimal/index.js +21 -0
  320. package/dist/templates/Minimal/index.js.map +1 -0
  321. package/dist/templates/Minimal/index.scss +30 -0
  322. package/dist/utilities/addDataAndFileToRequest.d.ts +8 -0
  323. package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -0
  324. package/dist/utilities/addDataAndFileToRequest.js +47 -0
  325. package/dist/utilities/addDataAndFileToRequest.js.map +1 -0
  326. package/dist/utilities/addLocalesToRequest.d.ts +17 -0
  327. package/dist/utilities/addLocalesToRequest.d.ts.map +1 -0
  328. package/dist/utilities/addLocalesToRequest.js +65 -0
  329. package/dist/utilities/addLocalesToRequest.js.map +1 -0
  330. package/dist/utilities/createPayloadRequest.d.ts +1 -1
  331. package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
  332. package/dist/utilities/createPayloadRequest.js +95 -83
  333. package/dist/utilities/createPayloadRequest.js.map +1 -1
  334. package/dist/utilities/getClientConfig.d.ts +7 -0
  335. package/dist/utilities/getClientConfig.d.ts.map +1 -0
  336. package/dist/utilities/getClientConfig.js +14 -0
  337. package/dist/utilities/getClientConfig.js.map +1 -0
  338. package/dist/utilities/getNextRequestI18n.d.ts +5 -5
  339. package/dist/utilities/getNextRequestI18n.d.ts.map +1 -1
  340. package/dist/utilities/getNextRequestI18n.js +15 -11
  341. package/dist/utilities/getNextRequestI18n.js.map +1 -1
  342. package/dist/utilities/getPayloadHMR.d.ts +3 -4
  343. package/dist/utilities/getPayloadHMR.d.ts.map +1 -1
  344. package/dist/utilities/getPayloadHMR.js +90 -64
  345. package/dist/utilities/getPayloadHMR.js.map +1 -1
  346. package/dist/utilities/getRequestLanguage.d.ts +2 -2
  347. package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
  348. package/dist/utilities/getRequestLanguage.js +16 -14
  349. package/dist/utilities/getRequestLanguage.js.map +1 -1
  350. package/dist/utilities/getRequestLocales.d.ts.map +1 -1
  351. package/dist/utilities/getRequestLocales.js +30 -23
  352. package/dist/utilities/getRequestLocales.js.map +1 -1
  353. package/dist/utilities/getRequestTheme.d.ts +11 -0
  354. package/dist/utilities/getRequestTheme.d.ts.map +1 -0
  355. package/dist/utilities/getRequestTheme.js +22 -0
  356. package/dist/utilities/getRequestTheme.js.map +1 -0
  357. package/dist/utilities/handleServerFunctions.d.ts +3 -0
  358. package/dist/utilities/handleServerFunctions.d.ts.map +1 -0
  359. package/dist/utilities/handleServerFunctions.js +35 -0
  360. package/dist/utilities/handleServerFunctions.js.map +1 -0
  361. package/dist/utilities/headersWithCors.d.ts +1 -1
  362. package/dist/utilities/headersWithCors.d.ts.map +1 -1
  363. package/dist/utilities/headersWithCors.js +21 -14
  364. package/dist/utilities/headersWithCors.js.map +1 -1
  365. package/dist/utilities/initPage/handleAdminPage.d.ts +18 -0
  366. package/dist/utilities/initPage/handleAdminPage.d.ts.map +1 -0
  367. package/dist/utilities/initPage/handleAdminPage.js +48 -0
  368. package/dist/utilities/initPage/handleAdminPage.js.map +1 -0
  369. package/dist/utilities/initPage/handleAuthRedirect.d.ts +12 -0
  370. package/dist/utilities/initPage/handleAuthRedirect.d.ts.map +1 -0
  371. package/dist/utilities/initPage/handleAuthRedirect.js +41 -0
  372. package/dist/utilities/initPage/handleAuthRedirect.js.map +1 -0
  373. package/dist/utilities/initPage/index.d.ts +4 -0
  374. package/dist/utilities/initPage/index.d.ts.map +1 -0
  375. package/dist/utilities/initPage/index.js +170 -0
  376. package/dist/utilities/initPage/index.js.map +1 -0
  377. package/dist/utilities/initPage/isCustomAdminView.d.ts +10 -0
  378. package/dist/utilities/initPage/isCustomAdminView.d.ts.map +1 -0
  379. package/dist/utilities/initPage/isCustomAdminView.js +31 -0
  380. package/dist/utilities/initPage/isCustomAdminView.js.map +1 -0
  381. package/dist/utilities/initPage/shared.d.ts +16 -0
  382. package/dist/utilities/initPage/shared.d.ts.map +1 -0
  383. package/dist/utilities/initPage/shared.js +36 -0
  384. package/dist/utilities/initPage/shared.js.map +1 -0
  385. package/dist/utilities/initPage/types.d.ts +25 -0
  386. package/dist/utilities/initPage/types.d.ts.map +1 -0
  387. package/dist/utilities/initPage/types.js +2 -0
  388. package/dist/utilities/initPage/types.js.map +1 -0
  389. package/dist/utilities/initReq.d.ts +11 -0
  390. package/dist/utilities/initReq.d.ts.map +1 -0
  391. package/dist/utilities/initReq.js +46 -0
  392. package/dist/utilities/initReq.js.map +1 -0
  393. package/dist/utilities/mergeHeaders.d.ts +2 -0
  394. package/dist/utilities/mergeHeaders.d.ts.map +1 -0
  395. package/dist/utilities/mergeHeaders.js +10 -0
  396. package/dist/utilities/mergeHeaders.js.map +1 -0
  397. package/dist/utilities/meta.d.ts +3 -7
  398. package/dist/utilities/meta.d.ts.map +1 -1
  399. package/dist/utilities/meta.js +70 -33
  400. package/dist/utilities/meta.js.map +1 -1
  401. package/dist/utilities/timestamp.d.ts.map +1 -1
  402. package/dist/utilities/timestamp.js +6 -5
  403. package/dist/utilities/timestamp.js.map +1 -1
  404. package/dist/views/API/LocaleSelector/index.d.ts +9 -0
  405. package/dist/views/API/LocaleSelector/index.d.ts.map +1 -0
  406. package/dist/views/API/LocaleSelector/index.js +44 -0
  407. package/dist/views/API/LocaleSelector/index.js.map +1 -0
  408. package/dist/views/API/RenderJSON/index.d.ts +1 -1
  409. package/dist/views/API/RenderJSON/index.d.ts.map +1 -1
  410. package/dist/views/API/RenderJSON/index.js +116 -72
  411. package/dist/views/API/RenderJSON/index.js.map +1 -1
  412. package/dist/views/API/RenderJSON/index.scss +68 -66
  413. package/dist/views/API/index.client.d.ts.map +1 -1
  414. package/dist/views/API/index.client.js +193 -178
  415. package/dist/views/API/index.client.js.map +1 -1
  416. package/dist/views/API/index.d.ts +2 -2
  417. package/dist/views/API/index.d.ts.map +1 -1
  418. package/dist/views/API/index.js +3 -3
  419. package/dist/views/API/index.js.map +1 -1
  420. package/dist/views/API/index.scss +98 -97
  421. package/dist/views/API/meta.d.ts.map +1 -1
  422. package/dist/views/API/meta.js +23 -8
  423. package/dist/views/API/meta.js.map +1 -1
  424. package/dist/views/Account/Settings/LanguageSelector.d.ts +6 -0
  425. package/dist/views/Account/Settings/LanguageSelector.d.ts.map +1 -0
  426. package/dist/views/Account/Settings/LanguageSelector.js +52 -0
  427. package/dist/views/Account/Settings/LanguageSelector.js.map +1 -0
  428. package/dist/views/Account/Settings/index.d.ts +6 -1
  429. package/dist/views/Account/Settings/index.d.ts.map +1 -1
  430. package/dist/views/Account/Settings/index.js +23 -25
  431. package/dist/views/Account/Settings/index.js.map +1 -1
  432. package/dist/views/Account/Settings/index.scss +37 -35
  433. package/dist/views/Account/ToggleTheme/index.d.ts.map +1 -1
  434. package/dist/views/Account/ToggleTheme/index.js +54 -30
  435. package/dist/views/Account/ToggleTheme/index.js.map +1 -1
  436. package/dist/views/Account/index.client.d.ts +3 -0
  437. package/dist/views/Account/index.client.d.ts.map +1 -0
  438. package/dist/views/Account/index.client.js +37 -0
  439. package/dist/views/Account/index.client.js.map +1 -0
  440. package/dist/views/Account/index.d.ts +1 -1
  441. package/dist/views/Account/index.d.ts.map +1 -1
  442. package/dist/views/Account/index.js +163 -46
  443. package/dist/views/Account/index.js.map +1 -1
  444. package/dist/views/Account/meta.d.ts.map +1 -1
  445. package/dist/views/Account/meta.js +12 -9
  446. package/dist/views/Account/meta.js.map +1 -1
  447. package/dist/views/CreateFirstUser/index.client.d.ts +6 -3
  448. package/dist/views/CreateFirstUser/index.client.d.ts.map +1 -1
  449. package/dist/views/CreateFirstUser/index.client.js +96 -18
  450. package/dist/views/CreateFirstUser/index.client.js.map +1 -1
  451. package/dist/views/CreateFirstUser/index.d.ts +1 -1
  452. package/dist/views/CreateFirstUser/index.d.ts.map +1 -1
  453. package/dist/views/CreateFirstUser/index.js +76 -75
  454. package/dist/views/CreateFirstUser/index.js.map +1 -1
  455. package/dist/views/CreateFirstUser/index.scss +18 -12
  456. package/dist/views/CreateFirstUser/meta.d.ts.map +1 -1
  457. package/dist/views/CreateFirstUser/meta.js +12 -9
  458. package/dist/views/CreateFirstUser/meta.js.map +1 -1
  459. package/dist/views/Dashboard/Default/index.d.ts +13 -4
  460. package/dist/views/Dashboard/Default/index.d.ts.map +1 -1
  461. package/dist/views/Dashboard/Default/index.js +161 -25
  462. package/dist/views/Dashboard/Default/index.js.map +1 -1
  463. package/dist/views/Dashboard/Default/index.scss +53 -42
  464. package/dist/views/Dashboard/index.d.ts +1 -1
  465. package/dist/views/Dashboard/index.d.ts.map +1 -1
  466. package/dist/views/Dashboard/index.js +95 -17
  467. package/dist/views/Dashboard/index.js.map +1 -1
  468. package/dist/views/Dashboard/meta.d.ts.map +1 -1
  469. package/dist/views/Dashboard/meta.js +16 -9
  470. package/dist/views/Dashboard/meta.js.map +1 -1
  471. package/dist/views/Document/getCustomViewByKey.d.ts +2 -3
  472. package/dist/views/Document/getCustomViewByKey.d.ts.map +1 -1
  473. package/dist/views/Document/getCustomViewByKey.js +2 -3
  474. package/dist/views/Document/getCustomViewByKey.js.map +1 -1
  475. package/dist/views/Document/getCustomViewByRoute.d.ts +6 -4
  476. package/dist/views/Document/getCustomViewByRoute.d.ts.map +1 -1
  477. package/dist/views/Document/getCustomViewByRoute.js +30 -17
  478. package/dist/views/Document/getCustomViewByRoute.js.map +1 -1
  479. package/dist/views/Document/getDocPreferences.d.ts +11 -0
  480. package/dist/views/Document/getDocPreferences.d.ts.map +1 -0
  481. package/dist/views/Document/getDocPreferences.js +44 -0
  482. package/dist/views/Document/getDocPreferences.js.map +1 -0
  483. package/dist/views/Document/getDocumentData.d.ts +12 -0
  484. package/dist/views/Document/getDocumentData.d.ts.map +1 -0
  485. package/dist/views/Document/getDocumentData.js +39 -0
  486. package/dist/views/Document/getDocumentData.js.map +1 -0
  487. package/dist/views/Document/getDocumentPermissions.d.ts +13 -0
  488. package/dist/views/Document/getDocumentPermissions.d.ts.map +1 -0
  489. package/dist/views/Document/getDocumentPermissions.js +92 -0
  490. package/dist/views/Document/getDocumentPermissions.js.map +1 -0
  491. package/dist/views/Document/getIsLocked.d.ts +16 -0
  492. package/dist/views/Document/getIsLocked.d.ts.map +1 -0
  493. package/dist/views/Document/getIsLocked.js +55 -0
  494. package/dist/views/Document/getIsLocked.js.map +1 -0
  495. package/dist/views/Document/getMetaBySegment.d.ts +6 -6
  496. package/dist/views/Document/getMetaBySegment.d.ts.map +1 -1
  497. package/dist/views/Document/getMetaBySegment.js +114 -63
  498. package/dist/views/Document/getMetaBySegment.js.map +1 -1
  499. package/dist/views/Document/getVersions.d.ts +19 -0
  500. package/dist/views/Document/getVersions.d.ts.map +1 -0
  501. package/dist/views/Document/getVersions.js +181 -0
  502. package/dist/views/Document/getVersions.js.map +1 -0
  503. package/dist/views/Document/getViewsFromConfig.d.ts +18 -9
  504. package/dist/views/Document/getViewsFromConfig.d.ts.map +1 -1
  505. package/dist/views/Document/getViewsFromConfig.js +315 -226
  506. package/dist/views/Document/getViewsFromConfig.js.map +1 -1
  507. package/dist/views/Document/handleServerFunction.d.ts +24 -0
  508. package/dist/views/Document/handleServerFunction.d.ts.map +1 -0
  509. package/dist/views/Document/handleServerFunction.js +156 -0
  510. package/dist/views/Document/handleServerFunction.js.map +1 -0
  511. package/dist/views/Document/index.d.ts +5 -1
  512. package/dist/views/Document/index.d.ts.map +1 -1
  513. package/dist/views/Document/index.js +309 -141
  514. package/dist/views/Document/index.js.map +1 -1
  515. package/dist/views/Document/meta.js +1 -2
  516. package/dist/views/Document/meta.js.map +1 -1
  517. package/dist/views/Document/renderDocumentSlots.d.ts +12 -0
  518. package/dist/views/Document/renderDocumentSlots.d.ts.map +1 -0
  519. package/dist/views/Document/renderDocumentSlots.js +92 -0
  520. package/dist/views/Document/renderDocumentSlots.js.map +1 -0
  521. package/dist/views/Edit/index.d.ts +3 -2
  522. package/dist/views/Edit/index.d.ts.map +1 -1
  523. package/dist/views/Edit/index.js +8 -4
  524. package/dist/views/Edit/index.js.map +1 -1
  525. package/dist/views/Edit/meta.d.ts.map +1 -1
  526. package/dist/views/Edit/meta.js +43 -22
  527. package/dist/views/Edit/meta.js.map +1 -1
  528. package/dist/views/Edit/sanitizeEditViewProps.d.ts +1 -1
  529. package/dist/views/Edit/sanitizeEditViewProps.d.ts.map +1 -1
  530. package/dist/views/Edit/sanitizeEditViewProps.js +8 -9
  531. package/dist/views/Edit/sanitizeEditViewProps.js.map +1 -1
  532. package/dist/views/ForgotPassword/ForgotPasswordForm/index.d.ts.map +1 -1
  533. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js +163 -48
  534. package/dist/views/ForgotPassword/ForgotPasswordForm/index.js.map +1 -1
  535. package/dist/views/ForgotPassword/index.d.ts +1 -1
  536. package/dist/views/ForgotPassword/index.d.ts.map +1 -1
  537. package/dist/views/ForgotPassword/index.js +66 -24
  538. package/dist/views/ForgotPassword/index.js.map +1 -1
  539. package/dist/views/ForgotPassword/meta.d.ts.map +1 -1
  540. package/dist/views/ForgotPassword/meta.js +12 -9
  541. package/dist/views/ForgotPassword/meta.js.map +1 -1
  542. package/dist/views/List/handleServerFunction.d.ts +26 -0
  543. package/dist/views/List/handleServerFunction.d.ts.map +1 -0
  544. package/dist/views/List/handleServerFunction.js +155 -0
  545. package/dist/views/List/handleServerFunction.js.map +1 -0
  546. package/dist/views/List/index.d.ts +12 -2
  547. package/dist/views/List/index.d.ts.map +1 -1
  548. package/dist/views/List/index.js +221 -99
  549. package/dist/views/List/index.js.map +1 -1
  550. package/dist/views/List/meta.d.ts +3 -3
  551. package/dist/views/List/meta.d.ts.map +1 -1
  552. package/dist/views/List/meta.js +20 -15
  553. package/dist/views/List/meta.js.map +1 -1
  554. package/dist/views/List/renderListViewSlots.d.ts +12 -0
  555. package/dist/views/List/renderListViewSlots.d.ts.map +1 -0
  556. package/dist/views/List/renderListViewSlots.js +56 -0
  557. package/dist/views/List/renderListViewSlots.js.map +1 -0
  558. package/dist/views/LivePreview/Context/collisionDetection.js +24 -21
  559. package/dist/views/LivePreview/Context/collisionDetection.js.map +1 -1
  560. package/dist/views/LivePreview/Context/context.d.ts +6 -5
  561. package/dist/views/LivePreview/Context/context.d.ts.map +1 -1
  562. package/dist/views/LivePreview/Context/context.js +39 -36
  563. package/dist/views/LivePreview/Context/context.js.map +1 -1
  564. package/dist/views/LivePreview/Context/index.d.ts +3 -4
  565. package/dist/views/LivePreview/Context/index.d.ts.map +1 -1
  566. package/dist/views/LivePreview/Context/index.js +138 -141
  567. package/dist/views/LivePreview/Context/index.js.map +1 -1
  568. package/dist/views/LivePreview/Context/sizeReducer.d.ts +1 -1
  569. package/dist/views/LivePreview/Context/sizeReducer.d.ts.map +1 -1
  570. package/dist/views/LivePreview/Context/sizeReducer.js +18 -19
  571. package/dist/views/LivePreview/Context/sizeReducer.js.map +1 -1
  572. package/dist/views/LivePreview/Device/index.d.ts.map +1 -1
  573. package/dist/views/LivePreview/Device/index.js +84 -43
  574. package/dist/views/LivePreview/Device/index.js.map +1 -1
  575. package/dist/views/LivePreview/DeviceContainer/index.js +49 -23
  576. package/dist/views/LivePreview/DeviceContainer/index.js.map +1 -1
  577. package/dist/views/LivePreview/IFrame/index.js +22 -16
  578. package/dist/views/LivePreview/IFrame/index.js.map +1 -1
  579. package/dist/views/LivePreview/IFrame/index.scss +8 -6
  580. package/dist/views/LivePreview/Preview/index.d.ts +1 -1
  581. package/dist/views/LivePreview/Preview/index.d.ts.map +1 -1
  582. package/dist/views/LivePreview/Preview/index.js +152 -67
  583. package/dist/views/LivePreview/Preview/index.js.map +1 -1
  584. package/dist/views/LivePreview/Preview/index.scss +32 -30
  585. package/dist/views/LivePreview/Toolbar/Controls/index.d.ts +1 -1
  586. package/dist/views/LivePreview/Toolbar/Controls/index.d.ts.map +1 -1
  587. package/dist/views/LivePreview/Toolbar/Controls/index.js +128 -63
  588. package/dist/views/LivePreview/Toolbar/Controls/index.js.map +1 -1
  589. package/dist/views/LivePreview/Toolbar/Controls/index.scss +49 -47
  590. package/dist/views/LivePreview/Toolbar/SizeInput/index.d.ts.map +1 -1
  591. package/dist/views/LivePreview/Toolbar/SizeInput/index.js +90 -51
  592. package/dist/views/LivePreview/Toolbar/SizeInput/index.js.map +1 -1
  593. package/dist/views/LivePreview/Toolbar/SizeInput/index.scss +11 -9
  594. package/dist/views/LivePreview/Toolbar/index.d.ts +3 -3
  595. package/dist/views/LivePreview/Toolbar/index.d.ts.map +1 -1
  596. package/dist/views/LivePreview/Toolbar/index.js +82 -35
  597. package/dist/views/LivePreview/Toolbar/index.js.map +1 -1
  598. package/dist/views/LivePreview/Toolbar/index.scss +33 -31
  599. package/dist/views/LivePreview/ToolbarArea/index.js +33 -9
  600. package/dist/views/LivePreview/ToolbarArea/index.js.map +1 -1
  601. package/dist/views/LivePreview/ToolbarArea/index.scss +5 -3
  602. package/dist/views/LivePreview/index.client.d.ts +4 -5
  603. package/dist/views/LivePreview/index.client.d.ts.map +1 -1
  604. package/dist/views/LivePreview/index.client.js +335 -139
  605. package/dist/views/LivePreview/index.client.js.map +1 -1
  606. package/dist/views/LivePreview/index.d.ts +2 -2
  607. package/dist/views/LivePreview/index.d.ts.map +1 -1
  608. package/dist/views/LivePreview/index.js +68 -55
  609. package/dist/views/LivePreview/index.js.map +1 -1
  610. package/dist/views/LivePreview/index.scss +48 -46
  611. package/dist/views/LivePreview/meta.d.ts.map +1 -1
  612. package/dist/views/LivePreview/meta.js +15 -25
  613. package/dist/views/LivePreview/meta.js.map +1 -1
  614. package/dist/views/LivePreview/usePopupWindow.d.ts +3 -2
  615. package/dist/views/LivePreview/usePopupWindow.d.ts.map +1 -1
  616. package/dist/views/LivePreview/usePopupWindow.js +134 -92
  617. package/dist/views/LivePreview/usePopupWindow.js.map +1 -1
  618. package/dist/views/Login/LoginField/index.d.ts +9 -0
  619. package/dist/views/Login/LoginField/index.d.ts.map +1 -0
  620. package/dist/views/Login/LoginField/index.js +98 -0
  621. package/dist/views/Login/LoginField/index.js.map +1 -0
  622. package/dist/views/Login/LoginForm/index.d.ts +3 -0
  623. package/dist/views/Login/LoginForm/index.d.ts.map +1 -1
  624. package/dist/views/Login/LoginForm/index.js +156 -73
  625. package/dist/views/Login/LoginForm/index.js.map +1 -1
  626. package/dist/views/Login/LoginForm/index.scss +8 -6
  627. package/dist/views/Login/index.d.ts +1 -1
  628. package/dist/views/Login/index.d.ts.map +1 -1
  629. package/dist/views/Login/index.js +86 -20
  630. package/dist/views/Login/index.js.map +1 -1
  631. package/dist/views/Login/index.scss +8 -6
  632. package/dist/views/Login/meta.d.ts.map +1 -1
  633. package/dist/views/Login/meta.js +12 -9
  634. package/dist/views/Login/meta.js.map +1 -1
  635. package/dist/views/Logout/LogoutClient.d.ts +1 -0
  636. package/dist/views/Logout/LogoutClient.d.ts.map +1 -1
  637. package/dist/views/Logout/LogoutClient.js +114 -27
  638. package/dist/views/Logout/LogoutClient.js.map +1 -1
  639. package/dist/views/Logout/index.d.ts +3 -3
  640. package/dist/views/Logout/index.d.ts.map +1 -1
  641. package/dist/views/Logout/index.js +30 -18
  642. package/dist/views/Logout/index.js.map +1 -1
  643. package/dist/views/Logout/index.scss +19 -14
  644. package/dist/views/Logout/meta.d.ts.map +1 -1
  645. package/dist/views/Logout/meta.js +11 -9
  646. package/dist/views/Logout/meta.js.map +1 -1
  647. package/dist/views/NotFound/index.client.d.ts.map +1 -1
  648. package/dist/views/NotFound/index.client.js +84 -34
  649. package/dist/views/NotFound/index.client.js.map +1 -1
  650. package/dist/views/NotFound/index.d.ts +8 -7
  651. package/dist/views/NotFound/index.d.ts.map +1 -1
  652. package/dist/views/NotFound/index.js +57 -31
  653. package/dist/views/NotFound/index.js.map +1 -1
  654. package/dist/views/NotFound/index.scss +41 -21
  655. package/dist/views/NotFound/meta.d.ts +3 -3
  656. package/dist/views/NotFound/meta.d.ts.map +1 -1
  657. package/dist/views/NotFound/meta.js +9 -9
  658. package/dist/views/NotFound/meta.js.map +1 -1
  659. package/dist/views/ResetPassword/ResetPasswordForm/index.d.ts +7 -0
  660. package/dist/views/ResetPassword/ResetPasswordForm/index.d.ts.map +1 -0
  661. package/dist/views/ResetPassword/ResetPasswordForm/index.js +118 -0
  662. package/dist/views/ResetPassword/ResetPasswordForm/index.js.map +1 -0
  663. package/dist/views/ResetPassword/index.d.ts +1 -1
  664. package/dist/views/ResetPassword/index.d.ts.map +1 -1
  665. package/dist/views/ResetPassword/index.js +78 -61
  666. package/dist/views/ResetPassword/index.js.map +1 -1
  667. package/dist/views/ResetPassword/index.scss +7 -11
  668. package/dist/views/ResetPassword/meta.d.ts.map +1 -1
  669. package/dist/views/ResetPassword/meta.js +12 -9
  670. package/dist/views/ResetPassword/meta.js.map +1 -1
  671. package/dist/views/Root/generateCustomViewMetadata.d.ts +11 -0
  672. package/dist/views/Root/generateCustomViewMetadata.d.ts.map +1 -0
  673. package/dist/views/Root/generateCustomViewMetadata.js +25 -0
  674. package/dist/views/Root/generateCustomViewMetadata.js.map +1 -0
  675. package/dist/views/Root/getCustomViewByRoute.d.ts +7 -2
  676. package/dist/views/Root/getCustomViewByRoute.d.ts.map +1 -1
  677. package/dist/views/Root/getCustomViewByRoute.js +45 -16
  678. package/dist/views/Root/getCustomViewByRoute.js.map +1 -1
  679. package/dist/views/Root/getViewFromConfig.d.ts +14 -7
  680. package/dist/views/Root/getViewFromConfig.d.ts.map +1 -1
  681. package/dist/views/Root/getViewFromConfig.js +278 -119
  682. package/dist/views/Root/getViewFromConfig.js.map +1 -1
  683. package/dist/views/Root/index.d.ts +11 -9
  684. package/dist/views/Root/index.d.ts.map +1 -1
  685. package/dist/views/Root/index.js +128 -42
  686. package/dist/views/Root/index.js.map +1 -1
  687. package/dist/views/Root/isPathMatchingRoute.d.ts.map +1 -1
  688. package/dist/views/Root/isPathMatchingRoute.js +22 -13
  689. package/dist/views/Root/isPathMatchingRoute.js.map +1 -1
  690. package/dist/views/Root/meta.d.ts +6 -6
  691. package/dist/views/Root/meta.d.ts.map +1 -1
  692. package/dist/views/Root/meta.js +144 -140
  693. package/dist/views/Root/meta.js.map +1 -1
  694. package/dist/views/Unauthorized/index.d.ts +2 -2
  695. package/dist/views/Unauthorized/index.d.ts.map +1 -1
  696. package/dist/views/Unauthorized/index.js +41 -13
  697. package/dist/views/Unauthorized/index.js.map +1 -1
  698. package/dist/views/Unauthorized/index.scss +4 -31
  699. package/dist/views/Unauthorized/meta.d.ts.map +1 -1
  700. package/dist/views/Unauthorized/meta.js +12 -9
  701. package/dist/views/Unauthorized/meta.js.map +1 -1
  702. package/dist/views/Verify/index.client.d.ts +7 -0
  703. package/dist/views/Verify/index.client.d.ts.map +1 -0
  704. package/dist/views/Verify/index.client.js +46 -0
  705. package/dist/views/Verify/index.client.js.map +1 -0
  706. package/dist/views/Verify/index.d.ts +1 -1
  707. package/dist/views/Verify/index.d.ts.map +1 -1
  708. package/dist/views/Verify/index.js +65 -26
  709. package/dist/views/Verify/index.js.map +1 -1
  710. package/dist/views/Verify/index.scss +13 -11
  711. package/dist/views/Verify/meta.d.ts.map +1 -1
  712. package/dist/views/Verify/meta.js +12 -9
  713. package/dist/views/Verify/meta.js.map +1 -1
  714. package/dist/views/Version/Default/SetStepNav.d.ts +8 -10
  715. package/dist/views/Version/Default/SetStepNav.d.ts.map +1 -1
  716. package/dist/views/Version/Default/SetStepNav.js +150 -94
  717. package/dist/views/Version/Default/SetStepNav.js.map +1 -1
  718. package/dist/views/Version/Default/index.d.ts.map +1 -1
  719. package/dist/views/Version/Default/index.js +202 -103
  720. package/dist/views/Version/Default/index.js.map +1 -1
  721. package/dist/views/Version/Default/index.scss +52 -50
  722. package/dist/views/Version/Default/types.d.ts +9 -11
  723. package/dist/views/Version/Default/types.d.ts.map +1 -1
  724. package/dist/views/Version/Default/types.js +1 -2
  725. package/dist/views/Version/Default/types.js.map +1 -1
  726. package/dist/views/Version/RenderFieldsToDiff/Label/index.js +7 -4
  727. package/dist/views/Version/RenderFieldsToDiff/Label/index.js.map +1 -1
  728. package/dist/views/Version/RenderFieldsToDiff/Label/index.scss +5 -3
  729. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts +2 -2
  730. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.d.ts.map +1 -1
  731. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js +60 -47
  732. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.js.map +1 -1
  733. package/dist/views/Version/RenderFieldsToDiff/fields/Iterable/index.scss +29 -27
  734. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts +2 -2
  735. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.d.ts.map +1 -1
  736. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js +30 -15
  737. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.js.map +1 -1
  738. package/dist/views/Version/RenderFieldsToDiff/fields/Nested/index.scss +11 -9
  739. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts +3 -2
  740. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.d.ts.map +1 -1
  741. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js +113 -52
  742. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.js.map +1 -1
  743. package/dist/views/Version/RenderFieldsToDiff/fields/Relationship/index.scss +12 -10
  744. package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js +18 -11
  745. package/dist/views/Version/RenderFieldsToDiff/fields/Select/DiffViewer/index.js.map +1 -1
  746. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts +3 -6
  747. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.d.ts.map +1 -1
  748. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js +43 -28
  749. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.js.map +1 -1
  750. package/dist/views/Version/RenderFieldsToDiff/fields/Select/index.scss +12 -10
  751. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts +3 -6
  752. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.d.ts.map +1 -1
  753. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js +39 -28
  754. package/dist/views/Version/RenderFieldsToDiff/fields/Tabs/index.js.map +1 -1
  755. package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js +18 -11
  756. package/dist/views/Version/RenderFieldsToDiff/fields/Text/DiffViewer/index.js.map +1 -1
  757. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts +3 -2
  758. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.d.ts.map +1 -1
  759. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js +40 -20
  760. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.js.map +1 -1
  761. package/dist/views/Version/RenderFieldsToDiff/fields/Text/index.scss +12 -10
  762. package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js +4 -5
  763. package/dist/views/Version/RenderFieldsToDiff/fields/diffMethods.js.map +1 -1
  764. package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts +21 -58
  765. package/dist/views/Version/RenderFieldsToDiff/fields/index.d.ts.map +1 -1
  766. package/dist/views/Version/RenderFieldsToDiff/fields/index.js +22 -22
  767. package/dist/views/Version/RenderFieldsToDiff/fields/index.js.map +1 -1
  768. package/dist/views/Version/RenderFieldsToDiff/fields/styles.js +23 -24
  769. package/dist/views/Version/RenderFieldsToDiff/fields/styles.js.map +1 -1
  770. package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts +16 -17
  771. package/dist/views/Version/RenderFieldsToDiff/fields/types.d.ts.map +1 -1
  772. package/dist/views/Version/RenderFieldsToDiff/fields/types.js +1 -2
  773. package/dist/views/Version/RenderFieldsToDiff/fields/types.js.map +1 -1
  774. package/dist/views/Version/RenderFieldsToDiff/index.d.ts.map +1 -1
  775. package/dist/views/Version/RenderFieldsToDiff/index.js +107 -91
  776. package/dist/views/Version/RenderFieldsToDiff/index.js.map +1 -1
  777. package/dist/views/Version/RenderFieldsToDiff/index.scss +12 -10
  778. package/dist/views/Version/RenderFieldsToDiff/types.d.ts +12 -13
  779. package/dist/views/Version/RenderFieldsToDiff/types.d.ts.map +1 -1
  780. package/dist/views/Version/RenderFieldsToDiff/types.js +1 -2
  781. package/dist/views/Version/RenderFieldsToDiff/types.js.map +1 -1
  782. package/dist/views/Version/Restore/index.d.ts.map +1 -1
  783. package/dist/views/Version/Restore/index.js +115 -64
  784. package/dist/views/Version/Restore/index.js.map +1 -1
  785. package/dist/views/Version/Restore/index.scss +68 -17
  786. package/dist/views/Version/Restore/types.d.ts +2 -1
  787. package/dist/views/Version/Restore/types.d.ts.map +1 -1
  788. package/dist/views/Version/Restore/types.js +1 -2
  789. package/dist/views/Version/Restore/types.js.map +1 -1
  790. package/dist/views/Version/SelectComparison/index.d.ts.map +1 -1
  791. package/dist/views/Version/SelectComparison/index.js +157 -117
  792. package/dist/views/Version/SelectComparison/index.js.map +1 -1
  793. package/dist/views/Version/SelectComparison/index.scss +12 -10
  794. package/dist/views/Version/SelectComparison/types.d.ts +4 -3
  795. package/dist/views/Version/SelectComparison/types.d.ts.map +1 -1
  796. package/dist/views/Version/SelectComparison/types.js +1 -2
  797. package/dist/views/Version/SelectComparison/types.js.map +1 -1
  798. package/dist/views/Version/SelectLocales/index.d.ts.map +1 -1
  799. package/dist/views/Version/SelectLocales/index.js +59 -26
  800. package/dist/views/Version/SelectLocales/index.js.map +1 -1
  801. package/dist/views/Version/SelectLocales/index.scss +6 -4
  802. package/dist/views/Version/SelectLocales/types.d.ts +1 -1
  803. package/dist/views/Version/SelectLocales/types.d.ts.map +1 -1
  804. package/dist/views/Version/SelectLocales/types.js +1 -2
  805. package/dist/views/Version/SelectLocales/types.js.map +1 -1
  806. package/dist/views/Version/index.d.ts +2 -2
  807. package/dist/views/Version/index.d.ts.map +1 -1
  808. package/dist/views/Version/index.js +131 -95
  809. package/dist/views/Version/index.js.map +1 -1
  810. package/dist/views/Version/meta.d.ts.map +1 -1
  811. package/dist/views/Version/meta.js +51 -37
  812. package/dist/views/Version/meta.js.map +1 -1
  813. package/dist/views/Versions/buildColumns.d.ts +6 -3
  814. package/dist/views/Versions/buildColumns.d.ts.map +1 -1
  815. package/dist/views/Versions/buildColumns.js +76 -56
  816. package/dist/views/Versions/buildColumns.js.map +1 -1
  817. package/dist/views/Versions/cells/AutosaveCell/index.d.ts +14 -1
  818. package/dist/views/Versions/cells/AutosaveCell/index.d.ts.map +1 -1
  819. package/dist/views/Versions/cells/AutosaveCell/index.js +114 -10
  820. package/dist/views/Versions/cells/AutosaveCell/index.js.map +1 -1
  821. package/dist/views/Versions/cells/CreatedAt/index.d.ts +4 -0
  822. package/dist/views/Versions/cells/CreatedAt/index.d.ts.map +1 -1
  823. package/dist/views/Versions/cells/CreatedAt/index.js +75 -17
  824. package/dist/views/Versions/cells/CreatedAt/index.js.map +1 -1
  825. package/dist/views/Versions/cells/ID/index.d.ts +3 -1
  826. package/dist/views/Versions/cells/ID/index.d.ts.map +1 -1
  827. package/dist/views/Versions/cells/ID/index.js +9 -6
  828. package/dist/views/Versions/cells/ID/index.js.map +1 -1
  829. package/dist/views/Versions/getLatestVersion.d.ts +15 -0
  830. package/dist/views/Versions/getLatestVersion.d.ts.map +1 -0
  831. package/dist/views/Versions/getLatestVersion.js +49 -0
  832. package/dist/views/Versions/getLatestVersion.js.map +1 -0
  833. package/dist/views/Versions/index.client.d.ts +6 -6
  834. package/dist/views/Versions/index.client.d.ts.map +1 -1
  835. package/dist/views/Versions/index.client.js +83 -51
  836. package/dist/views/Versions/index.client.js.map +1 -1
  837. package/dist/views/Versions/index.d.ts +2 -2
  838. package/dist/views/Versions/index.d.ts.map +1 -1
  839. package/dist/views/Versions/index.js +175 -82
  840. package/dist/views/Versions/index.js.map +1 -1
  841. package/dist/views/Versions/index.scss +78 -76
  842. package/dist/views/Versions/meta.d.ts.map +1 -1
  843. package/dist/views/Versions/meta.js +44 -29
  844. package/dist/views/Versions/meta.js.map +1 -1
  845. package/dist/views/Versions/types.d.ts +1 -3
  846. package/dist/views/Versions/types.d.ts.map +1 -1
  847. package/dist/views/Versions/types.js +1 -2
  848. package/dist/views/Versions/types.js.map +1 -1
  849. package/dist/withPayload.d.ts +1 -1
  850. package/dist/withPayload.d.ts.map +1 -1
  851. package/dist/withPayload.js +102 -69
  852. package/dist/withPayload.js.map +1 -1
  853. package/license.md +22 -0
  854. package/package.json +97 -54
  855. package/dist/elements/LeaveWithoutSaving/index.d.ts +0 -4
  856. package/dist/elements/LeaveWithoutSaving/index.d.ts.map +0 -1
  857. package/dist/elements/LeaveWithoutSaving/index.js +0 -70
  858. package/dist/elements/LeaveWithoutSaving/index.js.map +0 -1
  859. package/dist/elements/LeaveWithoutSaving/index.scss +0 -36
  860. package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts +0 -8
  861. package/dist/elements/LeaveWithoutSaving/usePreventLeave.d.ts.map +0 -1
  862. package/dist/elements/LeaveWithoutSaving/usePreventLeave.js +0 -114
  863. package/dist/elements/LeaveWithoutSaving/usePreventLeave.js.map +0 -1
  864. package/dist/next-fileupload/fileFactory.d.ts.map +0 -1
  865. package/dist/next-fileupload/fileFactory.js +0 -43
  866. package/dist/next-fileupload/fileFactory.js.map +0 -1
  867. package/dist/next-fileupload/handlers.d.ts.map +0 -1
  868. package/dist/next-fileupload/handlers.js +0 -86
  869. package/dist/next-fileupload/handlers.js.map +0 -1
  870. package/dist/next-fileupload/index.d.ts +0 -135
  871. package/dist/next-fileupload/index.d.ts.map +0 -1
  872. package/dist/next-fileupload/index.js +0 -43
  873. package/dist/next-fileupload/index.js.map +0 -1
  874. package/dist/next-fileupload/isEligibleRequest.d.ts.map +0 -1
  875. package/dist/next-fileupload/isEligibleRequest.js +0 -26
  876. package/dist/next-fileupload/isEligibleRequest.js.map +0 -1
  877. package/dist/next-fileupload/processMultipart.d.ts +0 -8
  878. package/dist/next-fileupload/processMultipart.d.ts.map +0 -1
  879. package/dist/next-fileupload/processMultipart.js +0 -156
  880. package/dist/next-fileupload/processMultipart.js.map +0 -1
  881. package/dist/next-fileupload/processNested.d.ts.map +0 -1
  882. package/dist/next-fileupload/processNested.js +0 -24
  883. package/dist/next-fileupload/processNested.js.map +0 -1
  884. package/dist/next-fileupload/uploadTimer.d.ts.map +0 -1
  885. package/dist/next-fileupload/uploadTimer.js +0 -19
  886. package/dist/next-fileupload/uploadTimer.js.map +0 -1
  887. package/dist/next-fileupload/utilities.d.ts.map +0 -1
  888. package/dist/next-fileupload/utilities.js +0 -207
  889. package/dist/next-fileupload/utilities.js.map +0 -1
  890. package/dist/next-stream-file/index.d.ts.map +0 -1
  891. package/dist/next-stream-file/index.js +0 -25
  892. package/dist/next-stream-file/index.js.map +0 -1
  893. package/dist/prod/payload/favicon.svg +0 -15
  894. package/dist/prod/payload/og-image.png +0 -0
  895. package/dist/routes/rest/buildFormState.d.ts +0 -7
  896. package/dist/routes/rest/buildFormState.d.ts.map +0 -1
  897. package/dist/routes/rest/buildFormState.js +0 -175
  898. package/dist/routes/rest/buildFormState.js.map +0 -1
  899. package/dist/utilities/buildFieldSchemaMap/index.d.ts +0 -4
  900. package/dist/utilities/buildFieldSchemaMap/index.d.ts.map +0 -1
  901. package/dist/utilities/buildFieldSchemaMap/index.js +0 -28
  902. package/dist/utilities/buildFieldSchemaMap/index.js.map +0 -1
  903. package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts +0 -14
  904. package/dist/utilities/buildFieldSchemaMap/traverseFields.d.ts.map +0 -1
  905. package/dist/utilities/buildFieldSchemaMap/traverseFields.js +0 -72
  906. package/dist/utilities/buildFieldSchemaMap/traverseFields.js.map +0 -1
  907. package/dist/utilities/buildFieldSchemaMap/types.d.ts +0 -3
  908. package/dist/utilities/buildFieldSchemaMap/types.d.ts.map +0 -1
  909. package/dist/utilities/buildFieldSchemaMap/types.js +0 -3
  910. package/dist/utilities/buildFieldSchemaMap/types.js.map +0 -1
  911. package/dist/utilities/getDataAndFile.d.ts +0 -12
  912. package/dist/utilities/getDataAndFile.d.ts.map +0 -1
  913. package/dist/utilities/getDataAndFile.js +0 -48
  914. package/dist/utilities/getDataAndFile.js.map +0 -1
  915. package/dist/utilities/initPage.d.ts +0 -12
  916. package/dist/utilities/initPage.d.ts.map +0 -1
  917. package/dist/utilities/initPage.js +0 -111
  918. package/dist/utilities/initPage.js.map +0 -1
  919. package/dist/views/Dashboard/Default/index.client.d.ts +0 -10
  920. package/dist/views/Dashboard/Default/index.client.d.ts.map +0 -1
  921. package/dist/views/Dashboard/Default/index.client.js +0 -103
  922. package/dist/views/Dashboard/Default/index.client.js.map +0 -1
  923. package/dist/views/Edit/Default/Auth/APIKey.d.ts +0 -5
  924. package/dist/views/Edit/Default/Auth/APIKey.d.ts.map +0 -1
  925. package/dist/views/Edit/Default/Auth/APIKey.js +0 -99
  926. package/dist/views/Edit/Default/Auth/APIKey.js.map +0 -1
  927. package/dist/views/Edit/Default/Auth/index.d.ts +0 -5
  928. package/dist/views/Edit/Default/Auth/index.d.ts.map +0 -1
  929. package/dist/views/Edit/Default/Auth/index.js +0 -129
  930. package/dist/views/Edit/Default/Auth/index.js.map +0 -1
  931. package/dist/views/Edit/Default/Auth/index.scss +0 -61
  932. package/dist/views/Edit/Default/Auth/types.d.ts +0 -14
  933. package/dist/views/Edit/Default/Auth/types.d.ts.map +0 -1
  934. package/dist/views/Edit/Default/Auth/types.js +0 -3
  935. package/dist/views/Edit/Default/Auth/types.js.map +0 -1
  936. package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts +0 -12
  937. package/dist/views/Edit/Default/SetDocumentStepNav/index.d.ts.map +0 -1
  938. package/dist/views/Edit/Default/SetDocumentStepNav/index.js +0 -71
  939. package/dist/views/Edit/Default/SetDocumentStepNav/index.js.map +0 -1
  940. package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts +0 -9
  941. package/dist/views/Edit/Default/SetDocumentTitle/index.d.ts.map +0 -1
  942. package/dist/views/Edit/Default/SetDocumentTitle/index.js +0 -38
  943. package/dist/views/Edit/Default/SetDocumentTitle/index.js.map +0 -1
  944. package/dist/views/Edit/Default/index.d.ts +0 -4
  945. package/dist/views/Edit/Default/index.d.ts.map +0 -1
  946. package/dist/views/Edit/Default/index.js +0 -195
  947. package/dist/views/Edit/Default/index.js.map +0 -1
  948. package/dist/views/Edit/Default/index.scss +0 -21
  949. package/dist/views/Edit/Default/types.d.ts +0 -6
  950. package/dist/views/Edit/Default/types.d.ts.map +0 -1
  951. package/dist/views/Edit/Default/types.js +0 -3
  952. package/dist/views/Edit/Default/types.js.map +0 -1
  953. package/dist/views/Edit/index.client.d.ts +0 -3
  954. package/dist/views/Edit/index.client.d.ts.map +0 -1
  955. package/dist/views/Edit/index.client.js +0 -23
  956. package/dist/views/Edit/index.client.js.map +0 -1
  957. package/dist/views/List/Default/index.d.ts +0 -4
  958. package/dist/views/List/Default/index.d.ts.map +0 -1
  959. package/dist/views/List/Default/index.js +0 -149
  960. package/dist/views/List/Default/index.js.map +0 -1
  961. package/dist/views/List/Default/index.scss +0 -195
  962. package/dist/views/List/Default/types.d.ts +0 -15
  963. package/dist/views/List/Default/types.d.ts.map +0 -1
  964. package/dist/views/List/Default/types.js +0 -3
  965. package/dist/views/List/Default/types.js.map +0 -1
  966. package/dist/views/Version/shared.d.ts +0 -9
  967. package/dist/views/Version/shared.d.ts.map +0 -1
  968. package/dist/views/Version/shared.js +0 -10
  969. package/dist/views/Version/shared.js.map +0 -1
  970. package/dist/webpackEntry.d.ts +0 -5
  971. package/dist/webpackEntry.d.ts.map +0 -1
  972. package/dist/webpackEntry.js +0 -6
  973. package/dist/webpackEntry.js.map +0 -1
  974. /package/dist/{next-fileupload → fetchAPI-multipart}/isEligibleRequest.d.ts +0 -0
  975. /package/dist/{next-fileupload → fetchAPI-multipart}/processNested.d.ts +0 -0
  976. /package/dist/{next-fileupload → fetchAPI-multipart}/uploadTimer.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/login.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,KAAK,EAAE,sBAuCnB,CAAA"}
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/login.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,KAAK,EAAE,sBA+CnB,CAAA"}
@@ -1,40 +1,49 @@
1
1
  import httpStatus from 'http-status';
2
- import { generatePayloadCookie } from 'payload/auth';
3
- import { loginOperation } from 'payload/operations';
4
- import { isNumber } from 'payload/utilities';
2
+ import { generatePayloadCookie, loginOperation } from 'payload';
3
+ import { isNumber } from 'payload/shared';
5
4
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
6
- export const login = async ({ collection, req })=>{
7
- const { searchParams, t } = req;
8
- const depth = searchParams.get('depth');
9
- const result = await loginOperation({
10
- collection,
11
- data: {
12
- email: typeof req.data?.email === 'string' ? req.data.email : '',
13
- password: typeof req.data?.password === 'string' ? req.data.password : ''
14
- },
15
- depth: isNumber(depth) ? Number(depth) : undefined,
16
- req
17
- });
18
- const cookie = generatePayloadCookie({
19
- collectionConfig: collection.config,
20
- payload: req.payload,
21
- token: result.token
22
- });
23
- if (collection.config.auth.removeTokenFromResponses) {
24
- delete result.token;
25
- }
26
- return Response.json({
27
- message: t('authentication:passed'),
28
- ...result
29
- }, {
30
- headers: headersWithCors({
31
- headers: new Headers({
32
- 'Set-Cookie': cookie
33
- }),
34
- req
35
- }),
36
- status: httpStatus.OK
37
- });
5
+ export const login = async ({
6
+ collection,
7
+ req
8
+ }) => {
9
+ const {
10
+ searchParams,
11
+ t
12
+ } = req;
13
+ const depth = searchParams.get('depth');
14
+ const authData = collection.config.auth?.loginWithUsername !== false ? {
15
+ email: typeof req.data?.email === 'string' ? req.data.email : '',
16
+ password: typeof req.data?.password === 'string' ? req.data.password : '',
17
+ username: typeof req.data?.username === 'string' ? req.data.username : ''
18
+ } : {
19
+ email: typeof req.data?.email === 'string' ? req.data.email : '',
20
+ password: typeof req.data?.password === 'string' ? req.data.password : ''
21
+ };
22
+ const result = await loginOperation({
23
+ collection,
24
+ data: authData,
25
+ depth: isNumber(depth) ? Number(depth) : undefined,
26
+ req
27
+ });
28
+ const cookie = generatePayloadCookie({
29
+ collectionAuthConfig: collection.config.auth,
30
+ cookiePrefix: req.payload.config.cookiePrefix,
31
+ token: result.token
32
+ });
33
+ if (collection.config.auth.removeTokenFromResponses) {
34
+ delete result.token;
35
+ }
36
+ return Response.json({
37
+ message: t('authentication:passed'),
38
+ ...result
39
+ }, {
40
+ headers: headersWithCors({
41
+ headers: new Headers({
42
+ 'Set-Cookie': cookie
43
+ }),
44
+ req
45
+ }),
46
+ status: httpStatus.OK
47
+ });
38
48
  };
39
-
40
49
  //# sourceMappingURL=login.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/auth/login.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie } from 'payload/auth'\nimport { loginOperation } from 'payload/operations'\nimport { isNumber } from 'payload/utilities'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const login: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams, t } = req\n const depth = searchParams.get('depth')\n\n const result = await loginOperation({\n collection,\n data: {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n },\n depth: isNumber(depth) ? Number(depth) : undefined,\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n token: result.token,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n message: t('authentication:passed'),\n ...result,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","generatePayloadCookie","loginOperation","isNumber","headersWithCors","login","collection","req","searchParams","t","depth","get","result","data","email","password","Number","undefined","cookie","collectionConfig","config","payload","token","auth","removeTokenFromResponses","Response","json","message","headers","Headers","status","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,qBAAqB,QAAQ,eAAc;AACpD,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,QAAQ,QAAQ,oBAAmB;AAI5C,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,QAAgC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACrE,MAAM,EAAEC,YAAY,EAAEC,CAAC,EAAE,GAAGF;IAC5B,MAAMG,QAAQF,aAAaG,GAAG,CAAC;IAE/B,MAAMC,SAAS,MAAMV,eAAe;QAClCI;QACAO,MAAM;YACJC,OAAO,OAAOP,IAAIM,IAAI,EAAEC,UAAU,WAAWP,IAAIM,IAAI,CAACC,KAAK,GAAG;YAC9DC,UAAU,OAAOR,IAAIM,IAAI,EAAEE,aAAa,WAAWR,IAAIM,IAAI,CAACE,QAAQ,GAAG;QACzE;QACAL,OAAOP,SAASO,SAASM,OAAON,SAASO;QACzCV;IACF;IAEA,MAAMW,SAASjB,sBAAsB;QACnCkB,kBAAkBb,WAAWc,MAAM;QACnCC,SAASd,IAAIc,OAAO;QACpBC,OAAOV,OAAOU,KAAK;IACrB;IAEA,IAAIhB,WAAWc,MAAM,CAACG,IAAI,CAACC,wBAAwB,EAAE;QACnD,OAAOZ,OAAOU,KAAK;IACrB;IAEA,OAAOG,SAASC,IAAI,CAClB;QACEC,SAASlB,EAAE;QACX,GAAGG,MAAM;IACX,GACA;QACEgB,SAASxB,gBAAgB;YACvBwB,SAAS,IAAIC,QAAQ;gBACnB,cAAcX;YAChB;YACAX;QACF;QACAuB,QAAQ9B,WAAW+B,EAAE;IACvB;AAEJ,EAAC"}
1
+ {"version":3,"file":"login.js","names":["httpStatus","generatePayloadCookie","loginOperation","isNumber","headersWithCors","login","collection","req","searchParams","t","depth","get","authData","config","auth","loginWithUsername","email","data","password","username","result","Number","undefined","cookie","collectionAuthConfig","cookiePrefix","payload","token","removeTokenFromResponses","Response","json","message","headers","Headers","status","OK"],"sources":["../../../../src/routes/rest/auth/login.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, loginOperation } from 'payload'\nimport { isNumber } from 'payload/shared'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const login: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams, t } = req\n const depth = searchParams.get('depth')\n const authData =\n collection.config.auth?.loginWithUsername !== false\n ? {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n username: typeof req.data?.username === 'string' ? req.data.username : '',\n }\n : {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n }\n\n const result = await loginOperation({\n collection,\n data: authData,\n depth: isNumber(depth) ? Number(depth) : undefined,\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token: result.token,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n message: t('authentication:passed'),\n ...result,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,qBAAqB,EAAEC,cAAc,QAAQ;AACtD,SAASC,QAAQ,QAAQ;AAIzB,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,KAAA,GAAgC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EACrE,MAAM;IAAEC,YAAY;IAAEC;EAAC,CAAE,GAAGF,GAAA;EAC5B,MAAMG,KAAA,GAAQF,YAAA,CAAaG,GAAG,CAAC;EAC/B,MAAMC,QAAA,GACJN,UAAA,CAAWO,MAAM,CAACC,IAAI,EAAEC,iBAAA,KAAsB,QAC1C;IACEC,KAAA,EAAO,OAAOT,GAAA,CAAIU,IAAI,EAAED,KAAA,KAAU,WAAWT,GAAA,CAAIU,IAAI,CAACD,KAAK,GAAG;IAC9DE,QAAA,EAAU,OAAOX,GAAA,CAAIU,IAAI,EAAEC,QAAA,KAAa,WAAWX,GAAA,CAAIU,IAAI,CAACC,QAAQ,GAAG;IACvEC,QAAA,EAAU,OAAOZ,GAAA,CAAIU,IAAI,EAAEE,QAAA,KAAa,WAAWZ,GAAA,CAAIU,IAAI,CAACE,QAAQ,GAAG;EACzE,IACA;IACEH,KAAA,EAAO,OAAOT,GAAA,CAAIU,IAAI,EAAED,KAAA,KAAU,WAAWT,GAAA,CAAIU,IAAI,CAACD,KAAK,GAAG;IAC9DE,QAAA,EAAU,OAAOX,GAAA,CAAIU,IAAI,EAAEC,QAAA,KAAa,WAAWX,GAAA,CAAIU,IAAI,CAACC,QAAQ,GAAG;EACzE;EAEN,MAAME,MAAA,GAAS,MAAMlB,cAAA,CAAe;IAClCI,UAAA;IACAW,IAAA,EAAML,QAAA;IACNF,KAAA,EAAOP,QAAA,CAASO,KAAA,IAASW,MAAA,CAAOX,KAAA,IAASY,SAAA;IACzCf;EACF;EAEA,MAAMgB,MAAA,GAAStB,qBAAA,CAAsB;IACnCuB,oBAAA,EAAsBlB,UAAA,CAAWO,MAAM,CAACC,IAAI;IAC5CW,YAAA,EAAclB,GAAA,CAAImB,OAAO,CAACb,MAAM,CAACY,YAAY;IAC7CE,KAAA,EAAOP,MAAA,CAAOO;EAChB;EAEA,IAAIrB,UAAA,CAAWO,MAAM,CAACC,IAAI,CAACc,wBAAwB,EAAE;IACnD,OAAOR,MAAA,CAAOO,KAAK;EACrB;EAEA,OAAOE,QAAA,CAASC,IAAI,CAClB;IACEC,OAAA,EAAStB,CAAA,CAAE;IACX,GAAGW;EACL,GACA;IACEY,OAAA,EAAS5B,eAAA,CAAgB;MACvB4B,OAAA,EAAS,IAAIC,OAAA,CAAQ;QACnB,cAAcV;MAChB;MACAhB;IACF;IACA2B,MAAA,EAAQlC,UAAA,CAAWmC;EACrB;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/logout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,MAAM,EAAE,sBAwCpB,CAAA"}
1
+ {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/logout.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,MAAM,EAAE,sBAyCpB,CAAA"}
@@ -1,36 +1,40 @@
1
1
  import httpStatus from 'http-status';
2
- import { generateExpiredPayloadCookie } from 'payload/auth';
3
- import { logoutOperation } from 'payload/operations';
2
+ import { generateExpiredPayloadCookie, logoutOperation } from 'payload';
4
3
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
- export const logout = async ({ collection, req })=>{
6
- const { t } = req;
7
- const result = await logoutOperation({
8
- collection,
9
- req
10
- });
11
- const headers = headersWithCors({
12
- headers: new Headers(),
13
- req
14
- });
15
- if (!result) {
16
- return Response.json({
17
- message: t('error:logoutFailed')
18
- }, {
19
- headers,
20
- status: httpStatus.BAD_REQUEST
21
- });
22
- }
23
- const expiredCookie = generateExpiredPayloadCookie({
24
- collectionConfig: collection.config,
25
- payload: req.payload
26
- });
27
- headers.set('Set-Cookie', expiredCookie);
4
+ export const logout = async ({
5
+ collection,
6
+ req
7
+ }) => {
8
+ const {
9
+ t
10
+ } = req;
11
+ const result = await logoutOperation({
12
+ collection,
13
+ req
14
+ });
15
+ const headers = headersWithCors({
16
+ headers: new Headers(),
17
+ req
18
+ });
19
+ if (!result) {
28
20
  return Response.json({
29
- message: t('authentication:logoutSuccessful')
21
+ message: t('error:logoutFailed')
30
22
  }, {
31
- headers,
32
- status: httpStatus.OK
23
+ headers,
24
+ status: httpStatus.BAD_REQUEST
33
25
  });
26
+ }
27
+ const expiredCookie = generateExpiredPayloadCookie({
28
+ collectionAuthConfig: collection.config.auth,
29
+ config: req.payload.config,
30
+ cookiePrefix: req.payload.config.cookiePrefix
31
+ });
32
+ headers.set('Set-Cookie', expiredCookie);
33
+ return Response.json({
34
+ message: t('authentication:logoutSuccessful')
35
+ }, {
36
+ headers,
37
+ status: httpStatus.OK
38
+ });
34
39
  };
35
-
36
40
  //# sourceMappingURL=logout.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/auth/logout.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generateExpiredPayloadCookie } from 'payload/auth'\nimport { logoutOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const logout: CollectionRouteHandler = async ({ collection, req }) => {\n const { t } = req\n const result = await logoutOperation({\n collection,\n req,\n })\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n if (!result) {\n return Response.json(\n {\n message: t('error:logoutFailed'),\n },\n {\n headers,\n status: httpStatus.BAD_REQUEST,\n },\n )\n }\n\n const expiredCookie = generateExpiredPayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n })\n\n headers.set('Set-Cookie', expiredCookie)\n\n return Response.json(\n {\n message: t('authentication:logoutSuccessful'),\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","generateExpiredPayloadCookie","logoutOperation","headersWithCors","logout","collection","req","t","result","headers","Headers","Response","json","message","status","BAD_REQUEST","expiredCookie","collectionConfig","config","payload","set","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,4BAA4B,QAAQ,eAAc;AAC3D,SAASC,eAAe,QAAQ,qBAAoB;AAIpD,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,SAAiC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACtE,MAAM,EAAEC,CAAC,EAAE,GAAGD;IACd,MAAME,SAAS,MAAMN,gBAAgB;QACnCG;QACAC;IACF;IAEA,MAAMG,UAAUN,gBAAgB;QAC9BM,SAAS,IAAIC;QACbJ;IACF;IAEA,IAAI,CAACE,QAAQ;QACX,OAAOG,SAASC,IAAI,CAClB;YACEC,SAASN,EAAE;QACb,GACA;YACEE;YACAK,QAAQd,WAAWe,WAAW;QAChC;IAEJ;IAEA,MAAMC,gBAAgBf,6BAA6B;QACjDgB,kBAAkBZ,WAAWa,MAAM;QACnCC,SAASb,IAAIa,OAAO;IACtB;IAEAV,QAAQW,GAAG,CAAC,cAAcJ;IAE1B,OAAOL,SAASC,IAAI,CAClB;QACEC,SAASN,EAAE;IACb,GACA;QACEE;QACAK,QAAQd,WAAWqB,EAAE;IACvB;AAEJ,EAAC"}
1
+ {"version":3,"file":"logout.js","names":["httpStatus","generateExpiredPayloadCookie","logoutOperation","headersWithCors","logout","collection","req","t","result","headers","Headers","Response","json","message","status","BAD_REQUEST","expiredCookie","collectionAuthConfig","config","auth","payload","cookiePrefix","set","OK"],"sources":["../../../../src/routes/rest/auth/logout.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generateExpiredPayloadCookie, logoutOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const logout: CollectionRouteHandler = async ({ collection, req }) => {\n const { t } = req\n const result = await logoutOperation({\n collection,\n req,\n })\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n if (!result) {\n return Response.json(\n {\n message: t('error:logoutFailed'),\n },\n {\n headers,\n status: httpStatus.BAD_REQUEST,\n },\n )\n }\n\n const expiredCookie = generateExpiredPayloadCookie({\n collectionAuthConfig: collection.config.auth,\n config: req.payload.config,\n cookiePrefix: req.payload.config.cookiePrefix,\n })\n\n headers.set('Set-Cookie', expiredCookie)\n\n return Response.json(\n {\n message: t('authentication:logoutSuccessful'),\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,4BAA4B,EAAEC,eAAe,QAAQ;AAI9D,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,MAAA,GAAiC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EACtE,MAAM;IAAEC;EAAC,CAAE,GAAGD,GAAA;EACd,MAAME,MAAA,GAAS,MAAMN,eAAA,CAAgB;IACnCG,UAAA;IACAC;EACF;EAEA,MAAMG,OAAA,GAAUN,eAAA,CAAgB;IAC9BM,OAAA,EAAS,IAAIC,OAAA;IACbJ;EACF;EAEA,IAAI,CAACE,MAAA,EAAQ;IACX,OAAOG,QAAA,CAASC,IAAI,CAClB;MACEC,OAAA,EAASN,CAAA,CAAE;IACb,GACA;MACEE,OAAA;MACAK,MAAA,EAAQd,UAAA,CAAWe;IACrB;EAEJ;EAEA,MAAMC,aAAA,GAAgBf,4BAAA,CAA6B;IACjDgB,oBAAA,EAAsBZ,UAAA,CAAWa,MAAM,CAACC,IAAI;IAC5CD,MAAA,EAAQZ,GAAA,CAAIc,OAAO,CAACF,MAAM;IAC1BG,YAAA,EAAcf,GAAA,CAAIc,OAAO,CAACF,MAAM,CAACG;EACnC;EAEAZ,OAAA,CAAQa,GAAG,CAAC,cAAcN,aAAA;EAE1B,OAAOL,QAAA,CAASC,IAAI,CAClB;IACEC,OAAA,EAASN,CAAA,CAAE;EACb,GACA;IACEE,OAAA;IACAK,MAAA,EAAQd,UAAA,CAAWuB;EACrB;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/me.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,EAAE,EAAE,sBA0BhB,CAAA"}
1
+ {"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/me.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,EAAE,EAAE,sBA0BhB,CAAA"}
@@ -1,27 +1,28 @@
1
1
  import httpStatus from 'http-status';
2
- import { extractJWT } from 'payload/auth';
3
- import { meOperation } from 'payload/operations';
2
+ import { extractJWT, meOperation } from 'payload';
4
3
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
- export const me = async ({ collection, req })=>{
6
- const currentToken = extractJWT(req);
7
- const result = await meOperation({
8
- collection,
9
- currentToken,
10
- req
11
- });
12
- if (collection.config.auth.removeTokenFromResponses) {
13
- delete result.token;
14
- }
15
- return Response.json({
16
- ...result,
17
- message: req.t('authentication:account')
18
- }, {
19
- headers: headersWithCors({
20
- headers: new Headers(),
21
- req
22
- }),
23
- status: httpStatus.OK
24
- });
4
+ export const me = async ({
5
+ collection,
6
+ req
7
+ }) => {
8
+ const currentToken = extractJWT(req);
9
+ const result = await meOperation({
10
+ collection,
11
+ currentToken,
12
+ req
13
+ });
14
+ if (collection.config.auth.removeTokenFromResponses) {
15
+ delete result.token;
16
+ }
17
+ return Response.json({
18
+ ...result,
19
+ message: req.t('authentication:account')
20
+ }, {
21
+ headers: headersWithCors({
22
+ headers: new Headers(),
23
+ req
24
+ }),
25
+ status: httpStatus.OK
26
+ });
25
27
  };
26
-
27
28
  //# sourceMappingURL=me.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/auth/me.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { extractJWT } from 'payload/auth'\nimport { meOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const me: CollectionRouteHandler = async ({ collection, req }) => {\n const currentToken = extractJWT(req)\n\n const result = await meOperation({\n collection,\n currentToken,\n req,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n ...result,\n message: req.t('authentication:account'),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","extractJWT","meOperation","headersWithCors","me","collection","req","currentToken","result","config","auth","removeTokenFromResponses","token","Response","json","message","t","headers","Headers","status","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,UAAU,QAAQ,eAAc;AACzC,SAASC,WAAW,QAAQ,qBAAoB;AAIhD,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,KAA6B,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IAClE,MAAMC,eAAeN,WAAWK;IAEhC,MAAME,SAAS,MAAMN,YAAY;QAC/BG;QACAE;QACAD;IACF;IAEA,IAAID,WAAWI,MAAM,CAACC,IAAI,CAACC,wBAAwB,EAAE;QACnD,OAAOH,OAAOI,KAAK;IACrB;IAEA,OAAOC,SAASC,IAAI,CAClB;QACE,GAAGN,MAAM;QACTO,SAAST,IAAIU,CAAC,CAAC;IACjB,GACA;QACEC,SAASd,gBAAgB;YACvBc,SAAS,IAAIC;YACbZ;QACF;QACAa,QAAQnB,WAAWoB,EAAE;IACvB;AAEJ,EAAC"}
1
+ {"version":3,"file":"me.js","names":["httpStatus","extractJWT","meOperation","headersWithCors","me","collection","req","currentToken","result","config","auth","removeTokenFromResponses","token","Response","json","message","t","headers","Headers","status","OK"],"sources":["../../../../src/routes/rest/auth/me.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { extractJWT, meOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const me: CollectionRouteHandler = async ({ collection, req }) => {\n const currentToken = extractJWT(req)\n\n const result = await meOperation({\n collection,\n currentToken,\n req,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n ...result,\n message: req.t('authentication:account'),\n },\n {\n headers: headersWithCors({\n headers: new Headers(),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,UAAU,EAAEC,WAAW,QAAQ;AAIxC,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,EAAA,GAA6B,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EAClE,MAAMC,YAAA,GAAeN,UAAA,CAAWK,GAAA;EAEhC,MAAME,MAAA,GAAS,MAAMN,WAAA,CAAY;IAC/BG,UAAA;IACAE,YAAA;IACAD;EACF;EAEA,IAAID,UAAA,CAAWI,MAAM,CAACC,IAAI,CAACC,wBAAwB,EAAE;IACnD,OAAOH,MAAA,CAAOI,KAAK;EACrB;EAEA,OAAOC,QAAA,CAASC,IAAI,CAClB;IACE,GAAGN,MAAM;IACTO,OAAA,EAAST,GAAA,CAAIU,CAAC,CAAC;EACjB,GACA;IACEC,OAAA,EAASd,eAAA,CAAgB;MACvBc,OAAA,EAAS,IAAIC,OAAA;MACbZ;IACF;IACAa,MAAA,EAAQnB,UAAA,CAAWoB;EACrB;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/refresh.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,OAAO,EAAE,sBAiDrB,CAAA"}
1
+ {"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/refresh.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,OAAO,EAAE,sBAqCrB,CAAA"}
@@ -1,44 +1,38 @@
1
1
  import httpStatus from 'http-status';
2
- import { extractJWT } from 'payload/auth';
3
- import { generatePayloadCookie } from 'payload/auth';
4
- import { refreshOperation } from 'payload/operations';
2
+ import { generatePayloadCookie, refreshOperation } from 'payload';
5
3
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
6
- export const refresh = async ({ collection, req })=>{
7
- const { t } = req;
8
- const token = typeof req.data?.token === 'string' ? req.data.token : extractJWT(req);
9
- const headers = headersWithCors({
10
- headers: new Headers(),
11
- req
12
- });
13
- if (!token) {
14
- return Response.json({
15
- message: t('error:tokenNotProvided')
16
- }, {
17
- headers,
18
- status: httpStatus.UNAUTHORIZED
19
- });
20
- }
21
- const result = await refreshOperation({
22
- collection,
23
- req,
24
- token
25
- });
4
+ export const refresh = async ({
5
+ collection,
6
+ req
7
+ }) => {
8
+ const {
9
+ t
10
+ } = req;
11
+ const headers = headersWithCors({
12
+ headers: new Headers(),
13
+ req
14
+ });
15
+ const result = await refreshOperation({
16
+ collection,
17
+ req
18
+ });
19
+ if (result.setCookie) {
26
20
  const cookie = generatePayloadCookie({
27
- collectionConfig: collection.config,
28
- payload: req.payload,
29
- token: result.refreshedToken
21
+ collectionAuthConfig: collection.config.auth,
22
+ cookiePrefix: req.payload.config.cookiePrefix,
23
+ token: result.refreshedToken
30
24
  });
31
25
  if (collection.config.auth.removeTokenFromResponses) {
32
- delete result.refreshedToken;
26
+ delete result.refreshedToken;
33
27
  }
34
28
  headers.set('Set-Cookie', cookie);
35
- return Response.json({
36
- message: t('authentication:tokenRefreshSuccessful'),
37
- ...result
38
- }, {
39
- headers,
40
- status: httpStatus.OK
41
- });
29
+ }
30
+ return Response.json({
31
+ message: t('authentication:tokenRefreshSuccessful'),
32
+ ...result
33
+ }, {
34
+ headers,
35
+ status: httpStatus.OK
36
+ });
42
37
  };
43
-
44
38
  //# sourceMappingURL=refresh.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/auth/refresh.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { extractJWT } from 'payload/auth'\nimport { generatePayloadCookie } from 'payload/auth'\nimport { refreshOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const refresh: CollectionRouteHandler = async ({ collection, req }) => {\n const { t } = req\n const token = typeof req.data?.token === 'string' ? req.data.token : extractJWT(req)\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n if (!token) {\n return Response.json(\n {\n message: t('error:tokenNotProvided'),\n },\n {\n headers,\n status: httpStatus.UNAUTHORIZED,\n },\n )\n }\n\n const result = await refreshOperation({\n collection,\n req,\n token,\n })\n\n const cookie = generatePayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n token: result.refreshedToken,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.refreshedToken\n }\n\n headers.set('Set-Cookie', cookie)\n\n return Response.json(\n {\n message: t('authentication:tokenRefreshSuccessful'),\n ...result,\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","extractJWT","generatePayloadCookie","refreshOperation","headersWithCors","refresh","collection","req","t","token","data","headers","Headers","Response","json","message","status","UNAUTHORIZED","result","cookie","collectionConfig","config","payload","refreshedToken","auth","removeTokenFromResponses","set","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,UAAU,QAAQ,eAAc;AACzC,SAASC,qBAAqB,QAAQ,eAAc;AACpD,SAASC,gBAAgB,QAAQ,qBAAoB;AAIrD,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,UAAkC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACvE,MAAM,EAAEC,CAAC,EAAE,GAAGD;IACd,MAAME,QAAQ,OAAOF,IAAIG,IAAI,EAAED,UAAU,WAAWF,IAAIG,IAAI,CAACD,KAAK,GAAGR,WAAWM;IAEhF,MAAMI,UAAUP,gBAAgB;QAC9BO,SAAS,IAAIC;QACbL;IACF;IAEA,IAAI,CAACE,OAAO;QACV,OAAOI,SAASC,IAAI,CAClB;YACEC,SAASP,EAAE;QACb,GACA;YACEG;YACAK,QAAQhB,WAAWiB,YAAY;QACjC;IAEJ;IAEA,MAAMC,SAAS,MAAMf,iBAAiB;QACpCG;QACAC;QACAE;IACF;IAEA,MAAMU,SAASjB,sBAAsB;QACnCkB,kBAAkBd,WAAWe,MAAM;QACnCC,SAASf,IAAIe,OAAO;QACpBb,OAAOS,OAAOK,cAAc;IAC9B;IAEA,IAAIjB,WAAWe,MAAM,CAACG,IAAI,CAACC,wBAAwB,EAAE;QACnD,OAAOP,OAAOK,cAAc;IAC9B;IAEAZ,QAAQe,GAAG,CAAC,cAAcP;IAE1B,OAAON,SAASC,IAAI,CAClB;QACEC,SAASP,EAAE;QACX,GAAGU,MAAM;IACX,GACA;QACEP;QACAK,QAAQhB,WAAW2B,EAAE;IACvB;AAEJ,EAAC"}
1
+ {"version":3,"file":"refresh.js","names":["httpStatus","generatePayloadCookie","refreshOperation","headersWithCors","refresh","collection","req","t","headers","Headers","result","setCookie","cookie","collectionAuthConfig","config","auth","cookiePrefix","payload","token","refreshedToken","removeTokenFromResponses","set","Response","json","message","status","OK"],"sources":["../../../../src/routes/rest/auth/refresh.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, refreshOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const refresh: CollectionRouteHandler = async ({ collection, req }) => {\n const { t } = req\n\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n const result = await refreshOperation({\n collection,\n req,\n })\n\n if (result.setCookie) {\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token: result.refreshedToken,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.refreshedToken\n }\n\n headers.set('Set-Cookie', cookie)\n }\n\n return Response.json(\n {\n message: t('authentication:tokenRefreshSuccessful'),\n ...result,\n },\n {\n headers,\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,qBAAqB,EAAEC,gBAAgB,QAAQ;AAIxD,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,OAAA,GAAkC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EACvE,MAAM;IAAEC;EAAC,CAAE,GAAGD,GAAA;EAEd,MAAME,OAAA,GAAUL,eAAA,CAAgB;IAC9BK,OAAA,EAAS,IAAIC,OAAA;IACbH;EACF;EAEA,MAAMI,MAAA,GAAS,MAAMR,gBAAA,CAAiB;IACpCG,UAAA;IACAC;EACF;EAEA,IAAII,MAAA,CAAOC,SAAS,EAAE;IACpB,MAAMC,MAAA,GAASX,qBAAA,CAAsB;MACnCY,oBAAA,EAAsBR,UAAA,CAAWS,MAAM,CAACC,IAAI;MAC5CC,YAAA,EAAcV,GAAA,CAAIW,OAAO,CAACH,MAAM,CAACE,YAAY;MAC7CE,KAAA,EAAOR,MAAA,CAAOS;IAChB;IAEA,IAAId,UAAA,CAAWS,MAAM,CAACC,IAAI,CAACK,wBAAwB,EAAE;MACnD,OAAOV,MAAA,CAAOS,cAAc;IAC9B;IAEAX,OAAA,CAAQa,GAAG,CAAC,cAAcT,MAAA;EAC5B;EAEA,OAAOU,QAAA,CAASC,IAAI,CAClB;IACEC,OAAA,EAASjB,CAAA,CAAE;IACX,GAAGG;EACL,GACA;IACEF,OAAA;IACAiB,MAAA,EAAQzB,UAAA,CAAW0B;EACrB;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"registerFirstUser.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/registerFirstUser.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,iBAAiB,EAAE,sBA6C/B,CAAA"}
1
+ {"version":3,"file":"registerFirstUser.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/registerFirstUser.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,iBAAiB,EAAE,sBA6C/B,CAAA"}
@@ -1,46 +1,48 @@
1
1
  import httpStatus from 'http-status';
2
- import { generatePayloadCookie } from 'payload/auth';
3
- import { ValidationError } from 'payload/errors';
4
- import { registerFirstUserOperation } from 'payload/operations';
2
+ import { generatePayloadCookie, registerFirstUserOperation } from 'payload';
5
3
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
6
- export const registerFirstUser = async ({ collection, req })=>{
7
- const { data, t } = req;
8
- if (data?.password !== data['confirm-password']) {
9
- throw new ValidationError([
10
- {
11
- field: 'confirm-password',
12
- message: req.t('Password and confirm password fields do not match.')
13
- }
14
- ]);
15
- }
16
- const result = await registerFirstUserOperation({
17
- collection,
18
- data: {
19
- ...data,
20
- email: typeof data?.email === 'string' ? data.email : '',
21
- password: typeof data?.password === 'string' ? data.password : ''
22
- },
23
- req
24
- });
25
- const cookie = generatePayloadCookie({
26
- collectionConfig: collection.config,
27
- payload: req.payload,
28
- token: result.token
29
- });
30
- return Response.json({
31
- exp: result.exp,
32
- message: t('authentication:successfullyRegisteredFirstUser'),
33
- token: result.token,
34
- user: result.user
35
- }, {
36
- headers: headersWithCors({
37
- headers: new Headers({
38
- 'Set-Cookie': cookie
39
- }),
40
- req
41
- }),
42
- status: httpStatus.OK
43
- });
4
+ export const registerFirstUser = async ({
5
+ collection,
6
+ req
7
+ }) => {
8
+ const {
9
+ data,
10
+ t
11
+ } = req;
12
+ const authData = collection.config.auth?.loginWithUsername ? {
13
+ email: typeof req.data?.email === 'string' ? req.data.email : '',
14
+ password: typeof req.data?.password === 'string' ? req.data.password : '',
15
+ username: typeof req.data?.username === 'string' ? req.data.username : ''
16
+ } : {
17
+ email: typeof req.data?.email === 'string' ? req.data.email : '',
18
+ password: typeof req.data?.password === 'string' ? req.data.password : ''
19
+ };
20
+ const result = await registerFirstUserOperation({
21
+ collection,
22
+ data: {
23
+ ...data,
24
+ ...authData
25
+ },
26
+ req
27
+ });
28
+ const cookie = generatePayloadCookie({
29
+ collectionAuthConfig: collection.config.auth,
30
+ cookiePrefix: req.payload.config.cookiePrefix,
31
+ token: result.token
32
+ });
33
+ return Response.json({
34
+ exp: result.exp,
35
+ message: t('authentication:successfullyRegisteredFirstUser'),
36
+ token: result.token,
37
+ user: result.user
38
+ }, {
39
+ headers: headersWithCors({
40
+ headers: new Headers({
41
+ 'Set-Cookie': cookie
42
+ }),
43
+ req
44
+ }),
45
+ status: httpStatus.OK
46
+ });
44
47
  };
45
-
46
48
  //# sourceMappingURL=registerFirstUser.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/auth/registerFirstUser.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie } from 'payload/auth'\nimport { ValidationError } from 'payload/errors'\nimport { registerFirstUserOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const registerFirstUser: CollectionRouteHandler = async ({ collection, req }) => {\n const { data, t } = req\n\n if (data?.password !== data['confirm-password']) {\n throw new ValidationError([\n {\n field: 'confirm-password',\n message: req.t('Password and confirm password fields do not match.'),\n },\n ])\n }\n\n const result = await registerFirstUserOperation({\n collection,\n data: {\n ...data,\n email: typeof data?.email === 'string' ? data.email : '',\n password: typeof data?.password === 'string' ? data.password : '',\n },\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n token: result.token,\n })\n\n return Response.json(\n {\n exp: result.exp,\n message: t('authentication:successfullyRegisteredFirstUser'),\n token: result.token,\n user: result.user,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","generatePayloadCookie","ValidationError","registerFirstUserOperation","headersWithCors","registerFirstUser","collection","req","data","t","password","field","message","result","email","cookie","collectionConfig","config","payload","token","Response","json","exp","user","headers","Headers","status","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,qBAAqB,QAAQ,eAAc;AACpD,SAASC,eAAe,QAAQ,iBAAgB;AAChD,SAASC,0BAA0B,QAAQ,qBAAoB;AAI/D,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,oBAA4C,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IACjF,MAAM,EAAEC,IAAI,EAAEC,CAAC,EAAE,GAAGF;IAEpB,IAAIC,MAAME,aAAaF,IAAI,CAAC,mBAAmB,EAAE;QAC/C,MAAM,IAAIN,gBAAgB;YACxB;gBACES,OAAO;gBACPC,SAASL,IAAIE,CAAC,CAAC;YACjB;SACD;IACH;IAEA,MAAMI,SAAS,MAAMV,2BAA2B;QAC9CG;QACAE,MAAM;YACJ,GAAGA,IAAI;YACPM,OAAO,OAAON,MAAMM,UAAU,WAAWN,KAAKM,KAAK,GAAG;YACtDJ,UAAU,OAAOF,MAAME,aAAa,WAAWF,KAAKE,QAAQ,GAAG;QACjE;QACAH;IACF;IAEA,MAAMQ,SAASd,sBAAsB;QACnCe,kBAAkBV,WAAWW,MAAM;QACnCC,SAASX,IAAIW,OAAO;QACpBC,OAAON,OAAOM,KAAK;IACrB;IAEA,OAAOC,SAASC,IAAI,CAClB;QACEC,KAAKT,OAAOS,GAAG;QACfV,SAASH,EAAE;QACXU,OAAON,OAAOM,KAAK;QACnBI,MAAMV,OAAOU,IAAI;IACnB,GACA;QACEC,SAASpB,gBAAgB;YACvBoB,SAAS,IAAIC,QAAQ;gBACnB,cAAcV;YAChB;YACAR;QACF;QACAmB,QAAQ1B,WAAW2B,EAAE;IACvB;AAEJ,EAAC"}
1
+ {"version":3,"file":"registerFirstUser.js","names":["httpStatus","generatePayloadCookie","registerFirstUserOperation","headersWithCors","registerFirstUser","collection","req","data","t","authData","config","auth","loginWithUsername","email","password","username","result","cookie","collectionAuthConfig","cookiePrefix","payload","token","Response","json","exp","message","user","headers","Headers","status","OK"],"sources":["../../../../src/routes/rest/auth/registerFirstUser.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, registerFirstUserOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const registerFirstUser: CollectionRouteHandler = async ({ collection, req }) => {\n const { data, t } = req\n const authData = collection.config.auth?.loginWithUsername\n ? {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n username: typeof req.data?.username === 'string' ? req.data.username : '',\n }\n : {\n email: typeof req.data?.email === 'string' ? req.data.email : '',\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n }\n\n const result = await registerFirstUserOperation({\n collection,\n data: {\n ...data,\n ...authData,\n },\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token: result.token,\n })\n\n return Response.json(\n {\n exp: result.exp,\n message: t('authentication:successfullyRegisteredFirstUser'),\n token: result.token,\n user: result.user,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,qBAAqB,EAAEC,0BAA0B,QAAQ;AAIlE,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,iBAAA,GAA4C,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EACjF,MAAM;IAAEC,IAAI;IAAEC;EAAC,CAAE,GAAGF,GAAA;EACpB,MAAMG,QAAA,GAAWJ,UAAA,CAAWK,MAAM,CAACC,IAAI,EAAEC,iBAAA,GACrC;IACEC,KAAA,EAAO,OAAOP,GAAA,CAAIC,IAAI,EAAEM,KAAA,KAAU,WAAWP,GAAA,CAAIC,IAAI,CAACM,KAAK,GAAG;IAC9DC,QAAA,EAAU,OAAOR,GAAA,CAAIC,IAAI,EAAEO,QAAA,KAAa,WAAWR,GAAA,CAAIC,IAAI,CAACO,QAAQ,GAAG;IACvEC,QAAA,EAAU,OAAOT,GAAA,CAAIC,IAAI,EAAEQ,QAAA,KAAa,WAAWT,GAAA,CAAIC,IAAI,CAACQ,QAAQ,GAAG;EACzE,IACA;IACEF,KAAA,EAAO,OAAOP,GAAA,CAAIC,IAAI,EAAEM,KAAA,KAAU,WAAWP,GAAA,CAAIC,IAAI,CAACM,KAAK,GAAG;IAC9DC,QAAA,EAAU,OAAOR,GAAA,CAAIC,IAAI,EAAEO,QAAA,KAAa,WAAWR,GAAA,CAAIC,IAAI,CAACO,QAAQ,GAAG;EACzE;EAEJ,MAAME,MAAA,GAAS,MAAMd,0BAAA,CAA2B;IAC9CG,UAAA;IACAE,IAAA,EAAM;MACJ,GAAGA,IAAI;MACP,GAAGE;IACL;IACAH;EACF;EAEA,MAAMW,MAAA,GAAShB,qBAAA,CAAsB;IACnCiB,oBAAA,EAAsBb,UAAA,CAAWK,MAAM,CAACC,IAAI;IAC5CQ,YAAA,EAAcb,GAAA,CAAIc,OAAO,CAACV,MAAM,CAACS,YAAY;IAC7CE,KAAA,EAAOL,MAAA,CAAOK;EAChB;EAEA,OAAOC,QAAA,CAASC,IAAI,CAClB;IACEC,GAAA,EAAKR,MAAA,CAAOQ,GAAG;IACfC,OAAA,EAASjB,CAAA,CAAE;IACXa,KAAA,EAAOL,MAAA,CAAOK,KAAK;IACnBK,IAAA,EAAMV,MAAA,CAAOU;EACf,GACA;IACEC,OAAA,EAASxB,eAAA,CAAgB;MACvBwB,OAAA,EAAS,IAAIC,OAAA,CAAQ;QACnB,cAAcX;MAChB;MACAX;IACF;IACAuB,MAAA,EAAQ7B,UAAA,CAAW8B;EACrB;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"resetPassword.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/resetPassword.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,aAAa,EAAE,sBAuC3B,CAAA"}
1
+ {"version":3,"file":"resetPassword.d.ts","sourceRoot":"","sources":["../../../../src/routes/rest/auth/resetPassword.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAIzD,eAAO,MAAM,aAAa,EAAE,sBAuC3B,CAAA"}
@@ -1,39 +1,43 @@
1
1
  import httpStatus from 'http-status';
2
- import { generatePayloadCookie } from 'payload/auth';
3
- import { resetPasswordOperation } from 'payload/operations';
2
+ import { generatePayloadCookie, resetPasswordOperation } from 'payload';
4
3
  import { headersWithCors } from '../../../utilities/headersWithCors.js';
5
- export const resetPassword = async ({ collection, req })=>{
6
- const { searchParams, t } = req;
7
- const depth = searchParams.get('depth');
8
- const result = await resetPasswordOperation({
9
- collection,
10
- data: {
11
- password: typeof req.data?.password === 'string' ? req.data.password : '',
12
- token: typeof req.data?.token === 'string' ? req.data.token : ''
13
- },
14
- depth: depth ? Number(depth) : undefined,
15
- req
16
- });
17
- const cookie = generatePayloadCookie({
18
- collectionConfig: collection.config,
19
- payload: req.payload,
20
- token: result.token
21
- });
22
- if (collection.config.auth.removeTokenFromResponses) {
23
- delete result.token;
24
- }
25
- return Response.json({
26
- message: t('authentication:passwordResetSuccessfully'),
27
- ...result
28
- }, {
29
- headers: headersWithCors({
30
- headers: new Headers({
31
- 'Set-Cookie': cookie
32
- }),
33
- req
34
- }),
35
- status: httpStatus.OK
36
- });
4
+ export const resetPassword = async ({
5
+ collection,
6
+ req
7
+ }) => {
8
+ const {
9
+ searchParams,
10
+ t
11
+ } = req;
12
+ const depth = searchParams.get('depth');
13
+ const result = await resetPasswordOperation({
14
+ collection,
15
+ data: {
16
+ password: typeof req.data?.password === 'string' ? req.data.password : '',
17
+ token: typeof req.data?.token === 'string' ? req.data.token : ''
18
+ },
19
+ depth: depth ? Number(depth) : undefined,
20
+ req
21
+ });
22
+ const cookie = generatePayloadCookie({
23
+ collectionAuthConfig: collection.config.auth,
24
+ cookiePrefix: req.payload.config.cookiePrefix,
25
+ token: result.token
26
+ });
27
+ if (collection.config.auth.removeTokenFromResponses) {
28
+ delete result.token;
29
+ }
30
+ return Response.json({
31
+ message: t('authentication:passwordResetSuccessfully'),
32
+ ...result
33
+ }, {
34
+ headers: headersWithCors({
35
+ headers: new Headers({
36
+ 'Set-Cookie': cookie
37
+ }),
38
+ req
39
+ }),
40
+ status: httpStatus.OK
41
+ });
37
42
  };
38
-
39
43
  //# sourceMappingURL=resetPassword.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/routes/rest/auth/resetPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie } from 'payload/auth'\nimport { resetPasswordOperation } from 'payload/operations'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const resetPassword: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams, t } = req\n const depth = searchParams.get('depth')\n\n const result = await resetPasswordOperation({\n collection,\n data: {\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n token: typeof req.data?.token === 'string' ? req.data.token : '',\n },\n depth: depth ? Number(depth) : undefined,\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionConfig: collection.config,\n payload: req.payload,\n token: result.token,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n message: t('authentication:passwordResetSuccessfully'),\n ...result,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["httpStatus","generatePayloadCookie","resetPasswordOperation","headersWithCors","resetPassword","collection","req","searchParams","t","depth","get","result","data","password","token","Number","undefined","cookie","collectionConfig","config","payload","auth","removeTokenFromResponses","Response","json","message","headers","Headers","status","OK"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAOA,gBAAgB,cAAa;AACpC,SAASC,qBAAqB,QAAQ,eAAc;AACpD,SAASC,sBAAsB,QAAQ,qBAAoB;AAI3D,SAASC,eAAe,QAAQ,wCAAuC;AAEvE,OAAO,MAAMC,gBAAwC,OAAO,EAAEC,UAAU,EAAEC,GAAG,EAAE;IAC7E,MAAM,EAAEC,YAAY,EAAEC,CAAC,EAAE,GAAGF;IAC5B,MAAMG,QAAQF,aAAaG,GAAG,CAAC;IAE/B,MAAMC,SAAS,MAAMT,uBAAuB;QAC1CG;QACAO,MAAM;YACJC,UAAU,OAAOP,IAAIM,IAAI,EAAEC,aAAa,WAAWP,IAAIM,IAAI,CAACC,QAAQ,GAAG;YACvEC,OAAO,OAAOR,IAAIM,IAAI,EAAEE,UAAU,WAAWR,IAAIM,IAAI,CAACE,KAAK,GAAG;QAChE;QACAL,OAAOA,QAAQM,OAAON,SAASO;QAC/BV;IACF;IAEA,MAAMW,SAAShB,sBAAsB;QACnCiB,kBAAkBb,WAAWc,MAAM;QACnCC,SAASd,IAAIc,OAAO;QACpBN,OAAOH,OAAOG,KAAK;IACrB;IAEA,IAAIT,WAAWc,MAAM,CAACE,IAAI,CAACC,wBAAwB,EAAE;QACnD,OAAOX,OAAOG,KAAK;IACrB;IAEA,OAAOS,SAASC,IAAI,CAClB;QACEC,SAASjB,EAAE;QACX,GAAGG,MAAM;IACX,GACA;QACEe,SAASvB,gBAAgB;YACvBuB,SAAS,IAAIC,QAAQ;gBACnB,cAAcV;YAChB;YACAX;QACF;QACAsB,QAAQ5B,WAAW6B,EAAE;IACvB;AAEJ,EAAC"}
1
+ {"version":3,"file":"resetPassword.js","names":["httpStatus","generatePayloadCookie","resetPasswordOperation","headersWithCors","resetPassword","collection","req","searchParams","t","depth","get","result","data","password","token","Number","undefined","cookie","collectionAuthConfig","config","auth","cookiePrefix","payload","removeTokenFromResponses","Response","json","message","headers","Headers","status","OK"],"sources":["../../../../src/routes/rest/auth/resetPassword.ts"],"sourcesContent":["import httpStatus from 'http-status'\nimport { generatePayloadCookie, resetPasswordOperation } from 'payload'\n\nimport type { CollectionRouteHandler } from '../types.js'\n\nimport { headersWithCors } from '../../../utilities/headersWithCors.js'\n\nexport const resetPassword: CollectionRouteHandler = async ({ collection, req }) => {\n const { searchParams, t } = req\n const depth = searchParams.get('depth')\n\n const result = await resetPasswordOperation({\n collection,\n data: {\n password: typeof req.data?.password === 'string' ? req.data.password : '',\n token: typeof req.data?.token === 'string' ? req.data.token : '',\n },\n depth: depth ? Number(depth) : undefined,\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n token: result.token,\n })\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return Response.json(\n {\n message: t('authentication:passwordResetSuccessfully'),\n ...result,\n },\n {\n headers: headersWithCors({\n headers: new Headers({\n 'Set-Cookie': cookie,\n }),\n req,\n }),\n status: httpStatus.OK,\n },\n )\n}\n"],"mappings":"AAAA,OAAOA,UAAA,MAAgB;AACvB,SAASC,qBAAqB,EAAEC,sBAAsB,QAAQ;AAI9D,SAASC,eAAe,QAAQ;AAEhC,OAAO,MAAMC,aAAA,GAAwC,MAAAA,CAAO;EAAEC,UAAU;EAAEC;AAAG,CAAE;EAC7E,MAAM;IAAEC,YAAY;IAAEC;EAAC,CAAE,GAAGF,GAAA;EAC5B,MAAMG,KAAA,GAAQF,YAAA,CAAaG,GAAG,CAAC;EAE/B,MAAMC,MAAA,GAAS,MAAMT,sBAAA,CAAuB;IAC1CG,UAAA;IACAO,IAAA,EAAM;MACJC,QAAA,EAAU,OAAOP,GAAA,CAAIM,IAAI,EAAEC,QAAA,KAAa,WAAWP,GAAA,CAAIM,IAAI,CAACC,QAAQ,GAAG;MACvEC,KAAA,EAAO,OAAOR,GAAA,CAAIM,IAAI,EAAEE,KAAA,KAAU,WAAWR,GAAA,CAAIM,IAAI,CAACE,KAAK,GAAG;IAChE;IACAL,KAAA,EAAOA,KAAA,GAAQM,MAAA,CAAON,KAAA,IAASO,SAAA;IAC/BV;EACF;EAEA,MAAMW,MAAA,GAAShB,qBAAA,CAAsB;IACnCiB,oBAAA,EAAsBb,UAAA,CAAWc,MAAM,CAACC,IAAI;IAC5CC,YAAA,EAAcf,GAAA,CAAIgB,OAAO,CAACH,MAAM,CAACE,YAAY;IAC7CP,KAAA,EAAOH,MAAA,CAAOG;EAChB;EAEA,IAAIT,UAAA,CAAWc,MAAM,CAACC,IAAI,CAACG,wBAAwB,EAAE;IACnD,OAAOZ,MAAA,CAAOG,KAAK;EACrB;EAEA,OAAOU,QAAA,CAASC,IAAI,CAClB;IACEC,OAAA,EAASlB,CAAA,CAAE;IACX,GAAGG;EACL,GACA;IACEgB,OAAA,EAASxB,eAAA,CAAgB;MACvBwB,OAAA,EAAS,IAAIC,OAAA,CAAQ;QACnB,cAAcX;MAChB;MACAX;IACF;IACAuB,MAAA,EAAQ7B,UAAA,CAAW8B;EACrB;AAEJ","ignoreList":[]}