payload 4.0.0-internal.40de3ec → 4.0.0-internal.45cfa3d

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 (381) hide show
  1. package/LICENSE.md +1 -1
  2. package/bin.js +11 -0
  3. package/dist/admin/RichText.d.ts +1 -21
  4. package/dist/admin/RichText.d.ts.map +1 -1
  5. package/dist/admin/RichText.js.map +1 -1
  6. package/dist/admin/fields/Row.d.ts +2 -2
  7. package/dist/admin/fields/Row.d.ts.map +1 -1
  8. package/dist/admin/fields/Row.js.map +1 -1
  9. package/dist/admin/forms/Description.d.ts +2 -2
  10. package/dist/admin/forms/Description.d.ts.map +1 -1
  11. package/dist/admin/forms/Description.js.map +1 -1
  12. package/dist/admin/forms/Field.d.ts +3 -5
  13. package/dist/admin/forms/Field.d.ts.map +1 -1
  14. package/dist/admin/forms/Field.js.map +1 -1
  15. package/dist/admin/forms/Form.d.ts +0 -29
  16. package/dist/admin/forms/Form.d.ts.map +1 -1
  17. package/dist/admin/forms/Form.js.map +1 -1
  18. package/dist/admin/types.d.ts +2 -1
  19. package/dist/admin/types.d.ts.map +1 -1
  20. package/dist/admin/types.js.map +1 -1
  21. package/dist/admin/views/document.d.ts +0 -4
  22. package/dist/admin/views/document.d.ts.map +1 -1
  23. package/dist/admin/views/document.js.map +1 -1
  24. package/dist/admin/views/list.d.ts +5 -0
  25. package/dist/admin/views/list.d.ts.map +1 -1
  26. package/dist/admin/views/list.js.map +1 -1
  27. package/dist/auth/baseFields/apiKey.d.ts +10 -2
  28. package/dist/auth/baseFields/apiKey.d.ts.map +1 -1
  29. package/dist/auth/baseFields/apiKey.js +35 -24
  30. package/dist/auth/baseFields/apiKey.js.map +1 -1
  31. package/dist/auth/getAuthFields.js +2 -2
  32. package/dist/auth/getAuthFields.js.map +1 -1
  33. package/dist/auth/operations/auth.d.ts +2 -2
  34. package/dist/auth/operations/auth.d.ts.map +1 -1
  35. package/dist/auth/operations/auth.js.map +1 -1
  36. package/dist/auth/operations/login.d.ts +2 -1
  37. package/dist/auth/operations/login.d.ts.map +1 -1
  38. package/dist/auth/operations/login.js.map +1 -1
  39. package/dist/auth/operations/me.js.map +1 -1
  40. package/dist/auth/operations/refresh.d.ts.map +1 -1
  41. package/dist/auth/operations/refresh.js +9 -3
  42. package/dist/auth/operations/refresh.js.map +1 -1
  43. package/dist/auth/operations/resetPassword.d.ts.map +1 -1
  44. package/dist/auth/operations/resetPassword.js.map +1 -1
  45. package/dist/auth/sendVerificationEmail.d.ts +2 -2
  46. package/dist/auth/sendVerificationEmail.d.ts.map +1 -1
  47. package/dist/auth/sendVerificationEmail.js +1 -1
  48. package/dist/auth/sendVerificationEmail.js.map +1 -1
  49. package/dist/auth/sessions.d.ts +4 -5
  50. package/dist/auth/sessions.d.ts.map +1 -1
  51. package/dist/auth/sessions.js +5 -3
  52. package/dist/auth/sessions.js.map +1 -1
  53. package/dist/auth/strategies/apiKey.js.map +1 -1
  54. package/dist/auth/strategies/local/incrementLoginAttempts.d.ts +2 -2
  55. package/dist/auth/strategies/local/incrementLoginAttempts.d.ts.map +1 -1
  56. package/dist/auth/strategies/local/incrementLoginAttempts.js +1 -1
  57. package/dist/auth/strategies/local/incrementLoginAttempts.js.map +1 -1
  58. package/dist/auth/types.d.ts +28 -21
  59. package/dist/auth/types.d.ts.map +1 -1
  60. package/dist/auth/types.js.map +1 -1
  61. package/dist/bin/generateImportMap/iterateCollections.d.ts.map +1 -1
  62. package/dist/bin/generateImportMap/iterateCollections.js +11 -0
  63. package/dist/bin/generateImportMap/iterateCollections.js.map +1 -1
  64. package/dist/bin/generateImportMap/iterateConfig.d.ts.map +1 -1
  65. package/dist/bin/generateImportMap/iterateConfig.js +12 -0
  66. package/dist/bin/generateImportMap/iterateConfig.js.map +1 -1
  67. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts.map +1 -1
  68. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js +11 -3
  69. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js.map +1 -1
  70. package/dist/collections/config/client.d.ts +1 -1
  71. package/dist/collections/config/client.d.ts.map +1 -1
  72. package/dist/collections/config/client.js +1 -0
  73. package/dist/collections/config/client.js.map +1 -1
  74. package/dist/collections/config/defaults.d.ts +0 -4
  75. package/dist/collections/config/defaults.d.ts.map +1 -1
  76. package/dist/collections/config/defaults.js +0 -15
  77. package/dist/collections/config/defaults.js.map +1 -1
  78. package/dist/collections/config/sanitize.d.ts.map +1 -1
  79. package/dist/collections/config/sanitize.js +1 -11
  80. package/dist/collections/config/sanitize.js.map +1 -1
  81. package/dist/collections/config/types.d.ts +7 -0
  82. package/dist/collections/config/types.d.ts.map +1 -1
  83. package/dist/collections/config/types.js.map +1 -1
  84. package/dist/collections/endpoints/create.d.ts.map +1 -1
  85. package/dist/collections/endpoints/create.js +0 -2
  86. package/dist/collections/endpoints/create.js.map +1 -1
  87. package/dist/collections/endpoints/updateByID.d.ts.map +1 -1
  88. package/dist/collections/endpoints/updateByID.js +1 -2
  89. package/dist/collections/endpoints/updateByID.js.map +1 -1
  90. package/dist/collections/operations/count.d.ts.map +1 -1
  91. package/dist/collections/operations/count.js +1 -0
  92. package/dist/collections/operations/count.js.map +1 -1
  93. package/dist/collections/operations/create.d.ts +0 -1
  94. package/dist/collections/operations/create.d.ts.map +1 -1
  95. package/dist/collections/operations/create.js +14 -6
  96. package/dist/collections/operations/create.js.map +1 -1
  97. package/dist/collections/operations/findDistinct.d.ts.map +1 -1
  98. package/dist/collections/operations/findDistinct.js +1 -0
  99. package/dist/collections/operations/findDistinct.js.map +1 -1
  100. package/dist/collections/operations/local/count.d.ts +3 -3
  101. package/dist/collections/operations/local/count.d.ts.map +1 -1
  102. package/dist/collections/operations/local/count.js.map +1 -1
  103. package/dist/collections/operations/local/countVersions.d.ts +3 -3
  104. package/dist/collections/operations/local/countVersions.d.ts.map +1 -1
  105. package/dist/collections/operations/local/countVersions.js.map +1 -1
  106. package/dist/collections/operations/local/create.d.ts +3 -3
  107. package/dist/collections/operations/local/create.d.ts.map +1 -1
  108. package/dist/collections/operations/local/create.js.map +1 -1
  109. package/dist/collections/operations/local/delete.d.ts +3 -3
  110. package/dist/collections/operations/local/delete.d.ts.map +1 -1
  111. package/dist/collections/operations/local/delete.js.map +1 -1
  112. package/dist/collections/operations/local/duplicate.d.ts +3 -3
  113. package/dist/collections/operations/local/duplicate.d.ts.map +1 -1
  114. package/dist/collections/operations/local/duplicate.js.map +1 -1
  115. package/dist/collections/operations/local/find.d.ts +3 -3
  116. package/dist/collections/operations/local/find.d.ts.map +1 -1
  117. package/dist/collections/operations/local/find.js.map +1 -1
  118. package/dist/collections/operations/local/findByID.d.ts +3 -3
  119. package/dist/collections/operations/local/findByID.d.ts.map +1 -1
  120. package/dist/collections/operations/local/findByID.js.map +1 -1
  121. package/dist/collections/operations/local/findDistinct.d.ts +2 -2
  122. package/dist/collections/operations/local/findDistinct.d.ts.map +1 -1
  123. package/dist/collections/operations/local/findDistinct.js.map +1 -1
  124. package/dist/collections/operations/local/findVersionByID.d.ts +3 -3
  125. package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
  126. package/dist/collections/operations/local/findVersionByID.js.map +1 -1
  127. package/dist/collections/operations/local/findVersions.d.ts +3 -3
  128. package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
  129. package/dist/collections/operations/local/findVersions.js.map +1 -1
  130. package/dist/collections/operations/local/restoreVersion.d.ts +3 -3
  131. package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
  132. package/dist/collections/operations/local/restoreVersion.js.map +1 -1
  133. package/dist/collections/operations/local/update.d.ts +7 -11
  134. package/dist/collections/operations/local/update.d.ts.map +1 -1
  135. package/dist/collections/operations/local/update.js +1 -2
  136. package/dist/collections/operations/local/update.js.map +1 -1
  137. package/dist/collections/operations/update.d.ts +0 -1
  138. package/dist/collections/operations/update.d.ts.map +1 -1
  139. package/dist/collections/operations/update.js +8 -4
  140. package/dist/collections/operations/update.js.map +1 -1
  141. package/dist/collections/operations/updateByID.d.ts +0 -1
  142. package/dist/collections/operations/updateByID.d.ts.map +1 -1
  143. package/dist/collections/operations/updateByID.js +1 -5
  144. package/dist/collections/operations/updateByID.js.map +1 -1
  145. package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.d.ts +9 -0
  146. package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.d.ts.map +1 -0
  147. package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.js +170 -0
  148. package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.js.map +1 -0
  149. package/dist/collections/operations/utilities/types.d.ts +0 -9
  150. package/dist/collections/operations/utilities/types.d.ts.map +1 -1
  151. package/dist/collections/operations/utilities/types.js.map +1 -1
  152. package/dist/collections/operations/utilities/update.d.ts +1 -2
  153. package/dist/collections/operations/utilities/update.d.ts.map +1 -1
  154. package/dist/collections/operations/utilities/update.js +48 -57
  155. package/dist/collections/operations/utilities/update.js.map +1 -1
  156. package/dist/config/client.d.ts +2 -2
  157. package/dist/config/client.d.ts.map +1 -1
  158. package/dist/config/client.js.map +1 -1
  159. package/dist/config/defaults.d.ts +0 -4
  160. package/dist/config/defaults.d.ts.map +1 -1
  161. package/dist/config/defaults.js +0 -78
  162. package/dist/config/defaults.js.map +1 -1
  163. package/dist/config/definePlugin.d.ts +10 -10
  164. package/dist/config/definePlugin.d.ts.map +1 -1
  165. package/dist/config/definePlugin.js +7 -11
  166. package/dist/config/definePlugin.js.map +1 -1
  167. package/dist/config/orderable/index.d.ts.map +1 -1
  168. package/dist/config/orderable/index.js +23 -0
  169. package/dist/config/orderable/index.js.map +1 -1
  170. package/dist/config/sanitize.d.ts.map +1 -1
  171. package/dist/config/sanitize.js +137 -13
  172. package/dist/config/sanitize.js.map +1 -1
  173. package/dist/config/types.d.ts +49 -20
  174. package/dist/config/types.d.ts.map +1 -1
  175. package/dist/config/types.js +1 -0
  176. package/dist/config/types.js.map +1 -1
  177. package/dist/errors/ValidationError.d.ts +1 -0
  178. package/dist/errors/ValidationError.d.ts.map +1 -1
  179. package/dist/errors/ValidationError.js.map +1 -1
  180. package/dist/exports/migrations.d.ts +5 -13
  181. package/dist/exports/migrations.d.ts.map +1 -1
  182. package/dist/exports/migrations.js +5 -13
  183. package/dist/exports/migrations.js.map +1 -1
  184. package/dist/exports/shared.d.ts +3 -2
  185. package/dist/exports/shared.d.ts.map +1 -1
  186. package/dist/exports/shared.js +3 -2
  187. package/dist/exports/shared.js.map +1 -1
  188. package/dist/fields/config/client.d.ts.map +1 -1
  189. package/dist/fields/config/client.js +10 -3
  190. package/dist/fields/config/client.js.map +1 -1
  191. package/dist/fields/config/types.d.ts +13 -1
  192. package/dist/fields/config/types.d.ts.map +1 -1
  193. package/dist/fields/config/types.js.map +1 -1
  194. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
  195. package/dist/fields/hooks/afterRead/promise.js +10 -1
  196. package/dist/fields/hooks/afterRead/promise.js.map +1 -1
  197. package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
  198. package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
  199. package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
  200. package/dist/fields/hooks/beforeValidate/promise.js +10 -1
  201. package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
  202. package/dist/globals/config/sanitize.d.ts.map +1 -1
  203. package/dist/globals/config/sanitize.js +1 -6
  204. package/dist/globals/config/sanitize.js.map +1 -1
  205. package/dist/globals/endpoints/update.d.ts.map +1 -1
  206. package/dist/globals/endpoints/update.js +0 -2
  207. package/dist/globals/endpoints/update.js.map +1 -1
  208. package/dist/globals/operations/local/countVersions.d.ts +3 -3
  209. package/dist/globals/operations/local/countVersions.d.ts.map +1 -1
  210. package/dist/globals/operations/local/countVersions.js.map +1 -1
  211. package/dist/globals/operations/local/findOne.d.ts +3 -3
  212. package/dist/globals/operations/local/findOne.d.ts.map +1 -1
  213. package/dist/globals/operations/local/findOne.js.map +1 -1
  214. package/dist/globals/operations/local/findVersionByID.d.ts +3 -3
  215. package/dist/globals/operations/local/findVersionByID.d.ts.map +1 -1
  216. package/dist/globals/operations/local/findVersionByID.js.map +1 -1
  217. package/dist/globals/operations/local/findVersions.d.ts +3 -3
  218. package/dist/globals/operations/local/findVersions.d.ts.map +1 -1
  219. package/dist/globals/operations/local/findVersions.js.map +1 -1
  220. package/dist/globals/operations/local/restoreVersion.d.ts +3 -3
  221. package/dist/globals/operations/local/restoreVersion.d.ts.map +1 -1
  222. package/dist/globals/operations/local/restoreVersion.js.map +1 -1
  223. package/dist/globals/operations/local/update.d.ts +7 -9
  224. package/dist/globals/operations/local/update.d.ts.map +1 -1
  225. package/dist/globals/operations/local/update.js +1 -2
  226. package/dist/globals/operations/local/update.js.map +1 -1
  227. package/dist/globals/operations/update.d.ts +0 -1
  228. package/dist/globals/operations/update.d.ts.map +1 -1
  229. package/dist/globals/operations/update.js +52 -58
  230. package/dist/globals/operations/update.js.map +1 -1
  231. package/dist/index.bundled.d.ts +441 -311
  232. package/dist/index.d.ts +62 -15
  233. package/dist/index.d.ts.map +1 -1
  234. package/dist/index.js +4 -3
  235. package/dist/index.js.map +1 -1
  236. package/dist/preferences/keys.d.ts +4 -0
  237. package/dist/preferences/keys.d.ts.map +1 -1
  238. package/dist/preferences/keys.js +4 -1
  239. package/dist/preferences/keys.js.map +1 -1
  240. package/dist/preferences/types.d.ts +15 -0
  241. package/dist/preferences/types.d.ts.map +1 -1
  242. package/dist/preferences/types.js +3 -1
  243. package/dist/preferences/types.js.map +1 -1
  244. package/dist/query-presets/config.d.ts.map +1 -1
  245. package/dist/query-presets/config.js +73 -34
  246. package/dist/query-presets/config.js.map +1 -1
  247. package/dist/query-presets/constraints.d.ts.map +1 -1
  248. package/dist/query-presets/constraints.js +2 -1
  249. package/dist/query-presets/constraints.js.map +1 -1
  250. package/dist/types/index.d.ts +8 -3
  251. package/dist/types/index.d.ts.map +1 -1
  252. package/dist/types/index.js.map +1 -1
  253. package/dist/uploads/fetchAPI-multipart/processMultipart.d.ts.map +1 -1
  254. package/dist/uploads/fetchAPI-multipart/processMultipart.js +1 -14
  255. package/dist/uploads/fetchAPI-multipart/processMultipart.js.map +1 -1
  256. package/dist/uploads/matchMimeType.d.ts +8 -0
  257. package/dist/uploads/matchMimeType.d.ts.map +1 -0
  258. package/dist/uploads/matchMimeType.js +19 -0
  259. package/dist/uploads/matchMimeType.js.map +1 -0
  260. package/dist/uploads/matchMimeType.spec.js +66 -0
  261. package/dist/uploads/matchMimeType.spec.js.map +1 -0
  262. package/dist/uploads/types.d.ts +21 -0
  263. package/dist/uploads/types.d.ts.map +1 -1
  264. package/dist/uploads/types.js.map +1 -1
  265. package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
  266. package/dist/utilities/addDataAndFileToRequest.js +6 -0
  267. package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
  268. package/dist/utilities/configToJSONSchema.d.ts +13 -4
  269. package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
  270. package/dist/utilities/configToJSONSchema.js +138 -61
  271. package/dist/utilities/configToJSONSchema.js.map +1 -1
  272. package/dist/utilities/configToJSONSchema.spec.js +319 -0
  273. package/dist/utilities/configToJSONSchema.spec.js.map +1 -1
  274. package/dist/utilities/createLocalReq.d.ts +2 -2
  275. package/dist/utilities/createLocalReq.d.ts.map +1 -1
  276. package/dist/utilities/createLocalReq.js.map +1 -1
  277. package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
  278. package/dist/utilities/createPayloadRequest.js +1 -0
  279. package/dist/utilities/createPayloadRequest.js.map +1 -1
  280. package/dist/utilities/deepCopyObject.d.ts.map +1 -1
  281. package/dist/utilities/deepCopyObject.js +8 -0
  282. package/dist/utilities/deepCopyObject.js.map +1 -1
  283. package/dist/utilities/getEntityPermissions/getEntityPermissions.d.ts.map +1 -1
  284. package/dist/utilities/getEntityPermissions/getEntityPermissions.js +2 -0
  285. package/dist/utilities/getEntityPermissions/getEntityPermissions.js.map +1 -1
  286. package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts +7 -1
  287. package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts.map +1 -1
  288. package/dist/utilities/getEntityPermissions/populateFieldPermissions.js +19 -2
  289. package/dist/utilities/getEntityPermissions/populateFieldPermissions.js.map +1 -1
  290. package/dist/utilities/getFieldByPath.d.ts.map +1 -1
  291. package/dist/utilities/getFieldByPath.js.map +1 -1
  292. package/dist/utilities/getVersionsConfig.js.map +1 -1
  293. package/dist/utilities/mergeLocalizedData.d.ts +14 -4
  294. package/dist/utilities/mergeLocalizedData.d.ts.map +1 -1
  295. package/dist/utilities/mergeLocalizedData.js +49 -34
  296. package/dist/utilities/mergeLocalizedData.js.map +1 -1
  297. package/dist/utilities/mergeLocalizedData.spec.js +23 -23
  298. package/dist/utilities/mergeLocalizedData.spec.js.map +1 -1
  299. package/dist/utilities/parseParams/index.d.ts +2 -5
  300. package/dist/utilities/parseParams/index.d.ts.map +1 -1
  301. package/dist/utilities/parseParams/index.js.map +1 -1
  302. package/dist/utilities/parseParams/index.spec.js +0 -9
  303. package/dist/utilities/parseParams/index.spec.js.map +1 -1
  304. package/dist/utilities/telemetry/conf/envPaths.d.ts.map +1 -1
  305. package/dist/utilities/telemetry/conf/envPaths.js +40 -31
  306. package/dist/utilities/telemetry/conf/envPaths.js.map +1 -1
  307. package/dist/utilities/traverseFields.d.ts.map +1 -1
  308. package/dist/utilities/traverseFields.js.map +1 -1
  309. package/dist/versions/baseFields.d.ts +1 -2
  310. package/dist/versions/baseFields.d.ts.map +1 -1
  311. package/dist/versions/baseFields.js +0 -13
  312. package/dist/versions/baseFields.js.map +1 -1
  313. package/dist/versions/buildCollectionFields.d.ts.map +1 -1
  314. package/dist/versions/buildCollectionFields.js +0 -2
  315. package/dist/versions/buildCollectionFields.js.map +1 -1
  316. package/dist/versions/buildGlobalFields.d.ts.map +1 -1
  317. package/dist/versions/buildGlobalFields.js +0 -2
  318. package/dist/versions/buildGlobalFields.js.map +1 -1
  319. package/dist/versions/buildSingleLocalePublishData.d.ts +32 -0
  320. package/dist/versions/buildSingleLocalePublishData.d.ts.map +1 -0
  321. package/dist/versions/buildSingleLocalePublishData.js +37 -0
  322. package/dist/versions/buildSingleLocalePublishData.js.map +1 -0
  323. package/dist/versions/saveVersion.d.ts +0 -2
  324. package/dist/versions/saveVersion.d.ts.map +1 -1
  325. package/dist/versions/saveVersion.js +12 -17
  326. package/dist/versions/saveVersion.js.map +1 -1
  327. package/dist/versions/schedule/job.d.ts.map +1 -1
  328. package/dist/versions/schedule/job.js +2 -9
  329. package/dist/versions/schedule/job.js.map +1 -1
  330. package/dist/versions/types.d.ts +2 -15
  331. package/dist/versions/types.d.ts.map +1 -1
  332. package/dist/versions/types.js.map +1 -1
  333. package/package.json +3 -3
  334. package/dist/database/migrations/templates/localizeStatus.d.ts +0 -10
  335. package/dist/database/migrations/templates/localizeStatus.d.ts.map +0 -1
  336. package/dist/database/migrations/templates/localizeStatus.js +0 -54
  337. package/dist/database/migrations/templates/localizeStatus.js.map +0 -1
  338. package/dist/utilities/isRSCEnabled.d.ts +0 -12
  339. package/dist/utilities/isRSCEnabled.d.ts.map +0 -1
  340. package/dist/utilities/isRSCEnabled.js +0 -14
  341. package/dist/utilities/isRSCEnabled.js.map +0 -1
  342. package/dist/versions/migrations/localizeStatus/index.d.ts +0 -12
  343. package/dist/versions/migrations/localizeStatus/index.d.ts.map +0 -1
  344. package/dist/versions/migrations/localizeStatus/index.js +0 -33
  345. package/dist/versions/migrations/localizeStatus/index.js.map +0 -1
  346. package/dist/versions/migrations/localizeStatus/mongo/down.d.ts +0 -9
  347. package/dist/versions/migrations/localizeStatus/mongo/down.d.ts.map +0 -1
  348. package/dist/versions/migrations/localizeStatus/mongo/down.js +0 -112
  349. package/dist/versions/migrations/localizeStatus/mongo/down.js.map +0 -1
  350. package/dist/versions/migrations/localizeStatus/mongo/index.d.ts +0 -8
  351. package/dist/versions/migrations/localizeStatus/mongo/index.d.ts.map +0 -1
  352. package/dist/versions/migrations/localizeStatus/mongo/index.js +0 -8
  353. package/dist/versions/migrations/localizeStatus/mongo/index.js.map +0 -1
  354. package/dist/versions/migrations/localizeStatus/mongo/up.d.ts +0 -9
  355. package/dist/versions/migrations/localizeStatus/mongo/up.d.ts.map +0 -1
  356. package/dist/versions/migrations/localizeStatus/mongo/up.js +0 -220
  357. package/dist/versions/migrations/localizeStatus/mongo/up.js.map +0 -1
  358. package/dist/versions/migrations/localizeStatus/sql/down.d.ts +0 -11
  359. package/dist/versions/migrations/localizeStatus/sql/down.d.ts.map +0 -1
  360. package/dist/versions/migrations/localizeStatus/sql/down.js +0 -213
  361. package/dist/versions/migrations/localizeStatus/sql/down.js.map +0 -1
  362. package/dist/versions/migrations/localizeStatus/sql/index.d.ts +0 -8
  363. package/dist/versions/migrations/localizeStatus/sql/index.d.ts.map +0 -1
  364. package/dist/versions/migrations/localizeStatus/sql/index.js +0 -8
  365. package/dist/versions/migrations/localizeStatus/sql/index.js.map +0 -1
  366. package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.d.ts +0 -13
  367. package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.d.ts.map +0 -1
  368. package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.js +0 -51
  369. package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.js.map +0 -1
  370. package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.d.ts +0 -13
  371. package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.d.ts.map +0 -1
  372. package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.js +0 -54
  373. package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.js.map +0 -1
  374. package/dist/versions/migrations/localizeStatus/sql/up.d.ts +0 -11
  375. package/dist/versions/migrations/localizeStatus/sql/up.d.ts.map +0 -1
  376. package/dist/versions/migrations/localizeStatus/sql/up.js +0 -277
  377. package/dist/versions/migrations/localizeStatus/sql/up.js.map +0 -1
  378. package/dist/versions/saveSnapshot.d.ts +0 -18
  379. package/dist/versions/saveSnapshot.d.ts.map +0 -1
  380. package/dist/versions/saveSnapshot.js +0 -38
  381. package/dist/versions/saveSnapshot.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/types.ts"],"sourcesContent":["import type { AcceptedLanguages, I18nClient } from '@payloadcms/translations'\nimport type React from 'react'\n\nimport type { ImportMap } from '../bin/generateImportMap/index.js'\nimport type { TypeWithID } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type {\n Block,\n ClientBlock,\n ClientField,\n Field,\n FieldTypes,\n Tab,\n} from '../fields/config/types.js'\nimport type { JsonObject } from '../types/index.js'\nimport type { ClientTab } from './fields/Tabs.js'\nimport type {\n BuildFormStateArgs,\n Data,\n FieldState,\n FieldStateWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n} from './forms/Form.js'\n\nexport type {\n /**\n * @deprecated\n * The `CustomPreviewButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomPreviewButton,\n /**\n * @deprecated\n * The `CustomPublishButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomPublishButton,\n /**\n * @deprecated\n * The `CustomSaveButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomSaveButton,\n /**\n * @deprecated\n * The `CustomSaveDraftButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomSaveDraftButton,\n} from '../config/types.js'\nexport type { DefaultCellComponentProps, DefaultServerCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type {\n EditMenuItemsClientProps,\n EditMenuItemsServerProps,\n EditMenuItemsServerPropsOnly,\n} from './elements/EditMenuItems.js'\nexport type {\n NavGroupPreferences,\n NavPreferences,\n SidebarTabClientProps,\n SidebarTabServerProps,\n SidebarTabServerPropsOnly,\n} from './elements/Nav.js'\nexport type {\n PreviewButtonClientProps,\n PreviewButtonServerProps,\n PreviewButtonServerPropsOnly,\n} from './elements/PreviewButton.js'\nexport type {\n PublishButtonClientProps,\n PublishButtonServerProps,\n PublishButtonServerPropsOnly,\n} from './elements/PublishButton.js'\nexport type {\n SaveButtonClientProps,\n SaveButtonServerProps,\n SaveButtonServerPropsOnly,\n} from './elements/SaveButton.js'\nexport type {\n SaveDraftButtonClientProps,\n SaveDraftButtonServerProps,\n SaveDraftButtonServerPropsOnly,\n} from './elements/SaveDraftButton.js'\nexport type { CustomStatus } from './elements/Status.js'\n\nexport type { Column } from './elements/Table.js'\n\nexport type {\n UnpublishButtonClientProps,\n UnpublishButtonServerProps,\n UnpublishButtonServerPropsOnly,\n} from './elements/UnpublishButton.js'\n\nexport type { CustomUpload } from './elements/Upload.js'\n\nexport type {\n WithServerSidePropsComponent,\n WithServerSidePropsComponentProps,\n} from './elements/WithServerSideProps.js'\n\nexport type {\n ArrayFieldClientComponent,\n ArrayFieldClientProps,\n ArrayFieldDescriptionClientComponent,\n ArrayFieldDescriptionServerComponent,\n ArrayFieldDiffClientComponent,\n ArrayFieldDiffServerComponent,\n ArrayFieldErrorClientComponent,\n ArrayFieldErrorServerComponent,\n ArrayFieldLabelClientComponent,\n ArrayFieldLabelServerComponent,\n ArrayFieldServerComponent,\n ArrayFieldServerProps,\n} from './fields/Array.js'\n\nexport type {\n BlockRowLabelClientComponent,\n BlockRowLabelServerComponent,\n BlocksFieldClientComponent,\n BlocksFieldClientProps,\n BlocksFieldDescriptionClientComponent,\n BlocksFieldDescriptionServerComponent,\n BlocksFieldDiffClientComponent,\n BlocksFieldDiffServerComponent,\n BlocksFieldErrorClientComponent,\n BlocksFieldErrorServerComponent,\n BlocksFieldLabelClientComponent,\n BlocksFieldLabelServerComponent,\n BlocksFieldServerComponent,\n BlocksFieldServerProps,\n} from './fields/Blocks.js'\n\nexport type {\n CheckboxFieldClientComponent,\n CheckboxFieldClientProps,\n CheckboxFieldDescriptionClientComponent,\n CheckboxFieldDescriptionServerComponent,\n CheckboxFieldDiffClientComponent,\n CheckboxFieldDiffServerComponent,\n CheckboxFieldErrorClientComponent,\n CheckboxFieldErrorServerComponent,\n CheckboxFieldLabelClientComponent,\n CheckboxFieldLabelServerComponent,\n CheckboxFieldServerComponent,\n CheckboxFieldServerProps,\n} from './fields/Checkbox.js'\n\nexport type {\n CodeFieldClientComponent,\n CodeFieldClientProps,\n CodeFieldDescriptionClientComponent,\n CodeFieldDescriptionServerComponent,\n CodeFieldDiffClientComponent,\n CodeFieldDiffServerComponent,\n CodeFieldErrorClientComponent,\n CodeFieldErrorServerComponent,\n CodeFieldLabelClientComponent,\n CodeFieldLabelServerComponent,\n CodeFieldServerComponent,\n CodeFieldServerProps,\n} from './fields/Code.js'\n\nexport type {\n CollapsibleFieldClientComponent,\n CollapsibleFieldClientProps,\n CollapsibleFieldDescriptionClientComponent,\n CollapsibleFieldDescriptionServerComponent,\n CollapsibleFieldDiffClientComponent,\n CollapsibleFieldDiffServerComponent,\n CollapsibleFieldErrorClientComponent,\n CollapsibleFieldErrorServerComponent,\n CollapsibleFieldLabelClientComponent,\n CollapsibleFieldLabelServerComponent,\n CollapsibleFieldServerComponent,\n CollapsibleFieldServerProps,\n} from './fields/Collapsible.js'\n\nexport type {\n DateFieldClientComponent,\n DateFieldClientProps,\n DateFieldDescriptionClientComponent,\n DateFieldDescriptionServerComponent,\n DateFieldDiffClientComponent,\n DateFieldDiffServerComponent,\n DateFieldErrorClientComponent,\n DateFieldErrorServerComponent,\n DateFieldLabelClientComponent,\n DateFieldLabelServerComponent,\n DateFieldServerComponent,\n DateFieldServerProps,\n} from './fields/Date.js'\n\nexport type {\n EmailFieldClientComponent,\n EmailFieldClientProps,\n EmailFieldDescriptionClientComponent,\n EmailFieldDescriptionServerComponent,\n EmailFieldDiffClientComponent,\n EmailFieldDiffServerComponent,\n EmailFieldErrorClientComponent,\n EmailFieldErrorServerComponent,\n EmailFieldLabelClientComponent,\n EmailFieldLabelServerComponent,\n EmailFieldServerComponent,\n EmailFieldServerProps,\n} from './fields/Email.js'\n\nexport type {\n GroupFieldClientComponent,\n GroupFieldClientProps,\n GroupFieldDescriptionClientComponent,\n GroupFieldDescriptionServerComponent,\n GroupFieldDiffClientComponent,\n GroupFieldDiffServerComponent,\n GroupFieldErrorClientComponent,\n GroupFieldErrorServerComponent,\n GroupFieldLabelClientComponent,\n GroupFieldLabelServerComponent,\n GroupFieldServerComponent,\n GroupFieldServerProps,\n} from './fields/Group.js'\n\nexport type { HiddenFieldProps } from './fields/Hidden.js'\n\nexport type {\n JoinFieldClientComponent,\n JoinFieldClientProps,\n JoinFieldDescriptionClientComponent,\n JoinFieldDescriptionServerComponent,\n JoinFieldDiffClientComponent,\n JoinFieldDiffServerComponent,\n JoinFieldErrorClientComponent,\n JoinFieldErrorServerComponent,\n JoinFieldLabelClientComponent,\n JoinFieldLabelServerComponent,\n JoinFieldServerComponent,\n JoinFieldServerProps,\n} from './fields/Join.js'\n\nexport type {\n JSONFieldClientComponent,\n JSONFieldClientProps,\n JSONFieldDescriptionClientComponent,\n JSONFieldDescriptionServerComponent,\n JSONFieldDiffClientComponent,\n JSONFieldDiffServerComponent,\n JSONFieldErrorClientComponent,\n JSONFieldErrorServerComponent,\n JSONFieldLabelClientComponent,\n JSONFieldLabelServerComponent,\n JSONFieldServerComponent,\n JSONFieldServerProps,\n} from './fields/JSON.js'\n\nexport type {\n NumberFieldClientComponent,\n NumberFieldClientProps,\n NumberFieldDescriptionClientComponent,\n NumberFieldDescriptionServerComponent,\n NumberFieldDiffClientComponent,\n NumberFieldDiffServerComponent,\n NumberFieldErrorClientComponent,\n NumberFieldErrorServerComponent,\n NumberFieldLabelClientComponent,\n NumberFieldLabelServerComponent,\n NumberFieldServerComponent,\n NumberFieldServerProps,\n} from './fields/Number.js'\n\nexport type {\n PointFieldClientComponent,\n PointFieldClientProps,\n PointFieldDescriptionClientComponent,\n PointFieldDescriptionServerComponent,\n PointFieldDiffClientComponent,\n PointFieldDiffServerComponent,\n PointFieldErrorClientComponent,\n PointFieldErrorServerComponent,\n PointFieldLabelClientComponent,\n PointFieldLabelServerComponent,\n PointFieldServerComponent,\n PointFieldServerProps,\n} from './fields/Point.js'\n\nexport type {\n RadioFieldClientComponent,\n RadioFieldClientProps,\n RadioFieldDescriptionClientComponent,\n RadioFieldDescriptionServerComponent,\n RadioFieldDiffClientComponent,\n RadioFieldDiffServerComponent,\n RadioFieldErrorClientComponent,\n RadioFieldErrorServerComponent,\n RadioFieldLabelClientComponent,\n RadioFieldLabelServerComponent,\n RadioFieldServerComponent,\n RadioFieldServerProps,\n} from './fields/Radio.js'\n\nexport type {\n RelationshipFieldClientComponent,\n RelationshipFieldClientProps,\n RelationshipFieldDescriptionClientComponent,\n RelationshipFieldDescriptionServerComponent,\n RelationshipFieldDiffClientComponent,\n RelationshipFieldDiffServerComponent,\n RelationshipFieldErrorClientComponent,\n RelationshipFieldErrorServerComponent,\n RelationshipFieldLabelClientComponent,\n RelationshipFieldLabelServerComponent,\n RelationshipFieldServerComponent,\n RelationshipFieldServerProps,\n} from './fields/Relationship.js'\n\nexport type {\n RichTextFieldClientComponent,\n RichTextFieldClientProps,\n RichTextFieldDescriptionClientComponent,\n RichTextFieldDescriptionServerComponent,\n RichTextFieldDiffClientComponent,\n RichTextFieldDiffServerComponent,\n RichTextFieldErrorClientComponent,\n RichTextFieldErrorServerComponent,\n RichTextFieldLabelClientComponent,\n RichTextFieldLabelServerComponent,\n RichTextFieldServerComponent,\n RichTextFieldServerProps,\n} from './fields/RichText.js'\n\nexport type {\n RowFieldClientComponent,\n RowFieldClientProps,\n RowFieldDescriptionClientComponent,\n RowFieldDescriptionServerComponent,\n RowFieldDiffClientComponent,\n RowFieldDiffServerComponent,\n RowFieldErrorClientComponent,\n RowFieldErrorServerComponent,\n RowFieldLabelClientComponent,\n RowFieldLabelServerComponent,\n RowFieldServerComponent,\n RowFieldServerProps,\n} from './fields/Row.js'\n\nexport type {\n SelectFieldClientComponent,\n SelectFieldClientProps,\n SelectFieldDescriptionClientComponent,\n SelectFieldDescriptionServerComponent,\n SelectFieldDiffClientComponent,\n SelectFieldDiffServerComponent,\n SelectFieldErrorClientComponent,\n SelectFieldErrorServerComponent,\n SelectFieldLabelClientComponent,\n SelectFieldLabelServerComponent,\n SelectFieldServerComponent,\n SelectFieldServerProps,\n} from './fields/Select.js'\n\nexport type {\n ClientTab,\n TabsFieldClientComponent,\n TabsFieldClientProps,\n TabsFieldDescriptionClientComponent,\n TabsFieldDescriptionServerComponent,\n TabsFieldDiffClientComponent,\n TabsFieldDiffServerComponent,\n TabsFieldErrorClientComponent,\n TabsFieldErrorServerComponent,\n TabsFieldLabelClientComponent,\n TabsFieldLabelServerComponent,\n TabsFieldServerComponent,\n TabsFieldServerProps,\n} from './fields/Tabs.js'\n\nexport type {\n TextFieldClientComponent,\n TextFieldClientProps,\n TextFieldDescriptionClientComponent,\n TextFieldDescriptionServerComponent,\n TextFieldDiffClientComponent,\n TextFieldDiffServerComponent,\n TextFieldErrorClientComponent,\n TextFieldErrorServerComponent,\n TextFieldLabelClientComponent,\n TextFieldLabelServerComponent,\n TextFieldServerComponent,\n TextFieldServerProps,\n} from './fields/Text.js'\n\nexport type {\n TextareaFieldClientComponent,\n TextareaFieldClientProps,\n TextareaFieldDescriptionClientComponent,\n TextareaFieldDescriptionServerComponent,\n TextareaFieldDiffClientComponent,\n TextareaFieldDiffServerComponent,\n TextareaFieldErrorClientComponent,\n TextareaFieldErrorServerComponent,\n TextareaFieldLabelClientComponent,\n TextareaFieldLabelServerComponent,\n TextareaFieldServerComponent,\n TextareaFieldServerProps,\n} from './fields/Textarea.js'\n\nexport type {\n UIFieldClientComponent,\n UIFieldClientProps,\n UIFieldDiffClientComponent,\n UIFieldDiffServerComponent,\n UIFieldServerComponent,\n UIFieldServerProps,\n} from './fields/UI.js'\n\nexport type {\n UploadFieldClientComponent,\n UploadFieldClientProps,\n UploadFieldDescriptionClientComponent,\n UploadFieldDescriptionServerComponent,\n UploadFieldDiffClientComponent,\n UploadFieldDiffServerComponent,\n UploadFieldErrorClientComponent,\n UploadFieldErrorServerComponent,\n UploadFieldLabelClientComponent,\n UploadFieldLabelServerComponent,\n UploadFieldServerComponent,\n UploadFieldServerProps,\n} from './fields/Upload.js'\n\nexport type {\n Description,\n DescriptionFunction,\n FieldDescriptionClientComponent,\n FieldDescriptionClientProps,\n FieldDescriptionServerComponent,\n FieldDescriptionServerProps,\n GenericDescriptionProps,\n StaticDescription,\n} from './forms/Description.js'\n\nexport type {\n BaseVersionField,\n DiffMethod,\n FieldDiffClientComponent,\n FieldDiffClientProps,\n FieldDiffServerComponent,\n FieldDiffServerProps,\n VersionField,\n VersionTab,\n} from './forms/Diff.js'\n\nexport type {\n BuildFormStateArgs,\n Data,\n FieldState as FormField,\n FieldStateWithoutComponents as FormFieldWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n}\n\nexport type {\n FieldErrorClientComponent,\n FieldErrorClientProps,\n FieldErrorServerComponent,\n FieldErrorServerProps,\n GenericErrorProps,\n} from './forms/Error.js'\n\nexport type {\n ClientComponentProps,\n ClientFieldBase,\n ClientFieldWithOptionalType,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerComponentProps,\n ServerFieldBase,\n} from './forms/Field.js'\n\nexport type {\n FieldLabelClientComponent,\n FieldLabelClientProps,\n FieldLabelServerComponent,\n FieldLabelServerProps,\n GenericLabelProps,\n SanitizedLabelProps,\n} from './forms/Label.js'\n\nexport type { RowLabel, RowLabelComponent } from './forms/RowLabel.js'\n\nexport type MappedServerComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component?: React.ComponentType<TComponentClientProps>\n props?: Partial<any>\n RenderedComponent: React.ReactNode\n type: 'server'\n}\n\nexport type MappedClientComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component?: React.ComponentType<TComponentClientProps>\n props?: Partial<TComponentClientProps>\n RenderedComponent?: React.ReactNode\n type: 'client'\n}\n\nexport type MappedEmptyComponent = {\n type: 'empty'\n}\n\nexport enum Action {\n RenderConfig = 'render-config',\n}\n\nexport type RenderEntityConfigArgs = {\n collectionSlug?: string\n data?: Data\n globalSlug?: string\n}\n\nexport type RenderRootConfigArgs = {}\n\nexport type RenderFieldConfigArgs = {\n collectionSlug?: string\n formState?: FormState\n globalSlug?: string\n schemaPath: string\n}\n\nexport type RenderConfigArgs = {\n action: Action.RenderConfig\n config: Promise<SanitizedConfig> | SanitizedConfig\n i18n: I18nClient\n importMap: ImportMap\n languageCode: AcceptedLanguages\n serverProps?: any\n} & (RenderEntityConfigArgs | RenderFieldConfigArgs | RenderRootConfigArgs)\n\nexport type PayloadServerAction = (\n args:\n | {\n [key: string]: any\n action: Action\n i18n: I18nClient\n }\n | RenderConfigArgs,\n) => Promise<string>\n\nexport type RenderedField = {\n Field: React.ReactNode\n indexPath?: string\n initialSchemaPath?: string\n /**\n * @deprecated\n * This is a legacy property that will be removed in v4.\n * Please use `fieldIsSidebar(field)` from `payload` instead.\n * Or check `field.admin.position === 'sidebar'` directly.\n */\n isSidebar: boolean\n path: string\n schemaPath: string\n type: FieldTypes\n}\n\nexport type FieldRow = {\n RowLabel?: React.ReactNode\n}\n\nexport type DocumentSlots = {\n BeforeDocumentControls?: React.ReactNode\n BeforeDocumentMeta?: React.ReactNode\n Description?: React.ReactNode\n EditMenuItems?: React.ReactNode\n LivePreview?: React.ReactNode\n PreviewButton?: React.ReactNode\n PublishButton?: React.ReactNode\n SaveButton?: React.ReactNode\n SaveDraftButton?: React.ReactNode\n Status?: React.ReactNode\n UnpublishButton?: React.ReactNode\n Upload?: React.ReactNode\n UploadControls?: React.ReactNode\n}\n\nexport type {\n BuildTableStateArgs,\n DefaultServerFunctionArgs,\n InitReqResult,\n ListQuery,\n ServerFunction,\n ServerFunctionArgs,\n ServerFunctionClient,\n ServerFunctionClientArgs,\n ServerFunctionConfig,\n ServerFunctionHandler,\n ServerFunctionMode,\n SlugifyServerFunctionArgs,\n} from './functions/index.js'\n\nexport type { LanguageOptions } from './LanguageOptions.js'\n\nexport type { RichTextAdapter, RichTextAdapterProvider, RichTextHooks } from './RichText.js'\n\nexport { type WidgetServerProps } from './views/dashboard.js'\n\nexport type {\n BeforeDocumentControlsClientProps,\n BeforeDocumentControlsServerProps,\n BeforeDocumentControlsServerPropsOnly,\n DocumentSubViewTypes,\n DocumentTabClientProps,\n /**\n * @deprecated\n * The `DocumentTabComponent` type is deprecated and will be removed in the next major version.\n * Use `DocumentTabServerProps`or `DocumentTabClientProps` instead.\n */\n DocumentTabComponent,\n DocumentTabCondition,\n DocumentTabConfig,\n /**\n * @deprecated\n * The `DocumentTabProps` type is deprecated and will be removed in the next major version.\n * Use `DocumentTabServerProps` instead.\n */\n DocumentTabServerProps as DocumentTabProps,\n DocumentTabServerProps,\n DocumentTabServerPropsOnly,\n /**\n * @deprecated\n * The `ClientSideEditViewProps` type is deprecated and will be removed in the next major version.\n * Use `DocumentViewClientProps` instead.\n */\n DocumentViewClientProps as ClientSideEditViewProps,\n DocumentViewClientProps,\n /**\n * @deprecated\n * The `ServerSideEditViewProps` is deprecated and will be removed in the next major version.\n * Use `DocumentViewServerProps` instead.\n */\n DocumentViewServerProps as ServerSideEditViewProps,\n DocumentViewServerProps,\n DocumentViewServerPropsOnly,\n EditViewProps,\n RenderDocumentVersionsProperties,\n} from './views/document.js'\n\nexport type { RelatedDocumentsGrouped } from './views/hierarchyList.js'\n\nexport type {\n AdminViewClientProps,\n /**\n * @deprecated\n * The `AdminViewComponent` type is deprecated and will be removed in the next major version.\n * Type your component props directly instead.\n */\n AdminViewComponent,\n AdminViewConfig,\n /**\n * @deprecated\n * The `AdminViewProps` type is deprecated and will be removed in the next major version.\n * Use `AdminViewServerProps` instead.\n */\n AdminViewServerProps as AdminViewProps,\n AdminViewServerProps,\n AdminViewServerPropsOnly,\n InitPageResult,\n ServerPropsFromView,\n ViewDescriptionClientProps,\n ViewDescriptionServerProps,\n ViewDescriptionServerPropsOnly,\n ViewTypes,\n VisibleEntities,\n} from './views/index.js'\n\nexport type {\n AfterListClientProps,\n AfterListServerProps,\n AfterListServerPropsOnly,\n AfterListTableClientProps,\n AfterListTableServerProps,\n AfterListTableServerPropsOnly,\n BeforeListClientProps,\n BeforeListServerProps,\n BeforeListServerPropsOnly,\n BeforeListTableClientProps,\n BeforeListTableServerProps,\n BeforeListTableServerPropsOnly,\n HierarchyViewData,\n ListViewClientProps,\n ListViewServerProps,\n ListViewServerPropsOnly,\n ListViewSlots,\n ListViewSlotSharedClientProps,\n} from './views/list.js'\n\ntype SchemaPath = {} & string\nexport type FieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: Field[]\n }\n | Block\n | Field\n | Tab\n>\n\nexport type ClientFieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: ClientField[]\n }\n | ClientBlock\n | ClientField\n | ClientTab\n>\n\nexport type DocumentEvent = {\n doc?: TypeWithID\n drawerSlug?: string\n entitySlug: string\n id?: number | string\n operation: 'create' | 'update'\n updatedAt: string\n}\n"],"names":["Action"],"mappings":"AAmgBA,OAAO,IAAA,AAAKA,gCAAAA;;WAAAA;MAEX"}
1
+ {"version":3,"sources":["../../src/admin/types.ts"],"sourcesContent":["import type { AcceptedLanguages, I18nClient } from '@payloadcms/translations'\nimport type React from 'react'\n\nimport type { ImportMap } from '../bin/generateImportMap/index.js'\nimport type { TypeWithID } from '../collections/config/types.js'\nimport type { SanitizedConfig } from '../config/types.js'\nimport type {\n Block,\n ClientBlock,\n ClientField,\n Field,\n FieldTypes,\n Tab,\n} from '../fields/config/types.js'\nimport type { JsonObject } from '../types/index.js'\nimport type { ClientTab } from './fields/Tabs.js'\nimport type {\n BuildFormStateArgs,\n Data,\n FieldState,\n FieldStateWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n} from './forms/Form.js'\n\nexport type {\n /**\n * @deprecated\n * The `CustomPreviewButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomPreviewButton,\n /**\n * @deprecated\n * The `CustomPublishButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomPublishButton,\n /**\n * @deprecated\n * The `CustomSaveButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomSaveButton,\n /**\n * @deprecated\n * The `CustomSaveDraftButton` type is deprecated and will be removed in the next major version.\n * This type is only used for the Payload Config. Use `PreviewButtonClientProps` instead.\n */\n CustomComponent as CustomSaveDraftButton,\n} from '../config/types.js'\nexport type { DefaultCellComponentProps, DefaultServerCellComponentProps } from './elements/Cell.js'\nexport type { ConditionalDateProps } from './elements/DatePicker.js'\nexport type { DayPickerProps, SharedProps, TimePickerProps } from './elements/DatePicker.js'\nexport type {\n EditMenuItemsClientProps,\n EditMenuItemsServerProps,\n EditMenuItemsServerPropsOnly,\n} from './elements/EditMenuItems.js'\nexport type {\n NavGroupPreferences,\n NavPreferences,\n SidebarTabClientProps,\n SidebarTabServerProps,\n SidebarTabServerPropsOnly,\n} from './elements/Nav.js'\nexport type {\n PreviewButtonClientProps,\n PreviewButtonServerProps,\n PreviewButtonServerPropsOnly,\n} from './elements/PreviewButton.js'\nexport type {\n PublishButtonClientProps,\n PublishButtonServerProps,\n PublishButtonServerPropsOnly,\n} from './elements/PublishButton.js'\nexport type {\n SaveButtonClientProps,\n SaveButtonServerProps,\n SaveButtonServerPropsOnly,\n} from './elements/SaveButton.js'\nexport type {\n SaveDraftButtonClientProps,\n SaveDraftButtonServerProps,\n SaveDraftButtonServerPropsOnly,\n} from './elements/SaveDraftButton.js'\nexport type { CustomStatus } from './elements/Status.js'\n\nexport type { Column } from './elements/Table.js'\n\nexport type {\n UnpublishButtonClientProps,\n UnpublishButtonServerProps,\n UnpublishButtonServerPropsOnly,\n} from './elements/UnpublishButton.js'\n\nexport type { CustomUpload } from './elements/Upload.js'\n\nexport type {\n WithServerSidePropsComponent,\n WithServerSidePropsComponentProps,\n} from './elements/WithServerSideProps.js'\n\nexport type {\n ArrayFieldClientComponent,\n ArrayFieldClientProps,\n ArrayFieldDescriptionClientComponent,\n ArrayFieldDescriptionServerComponent,\n ArrayFieldDiffClientComponent,\n ArrayFieldDiffServerComponent,\n ArrayFieldErrorClientComponent,\n ArrayFieldErrorServerComponent,\n ArrayFieldLabelClientComponent,\n ArrayFieldLabelServerComponent,\n ArrayFieldServerComponent,\n ArrayFieldServerProps,\n} from './fields/Array.js'\n\nexport type {\n BlockRowLabelClientComponent,\n BlockRowLabelServerComponent,\n BlocksFieldClientComponent,\n BlocksFieldClientProps,\n BlocksFieldDescriptionClientComponent,\n BlocksFieldDescriptionServerComponent,\n BlocksFieldDiffClientComponent,\n BlocksFieldDiffServerComponent,\n BlocksFieldErrorClientComponent,\n BlocksFieldErrorServerComponent,\n BlocksFieldLabelClientComponent,\n BlocksFieldLabelServerComponent,\n BlocksFieldServerComponent,\n BlocksFieldServerProps,\n} from './fields/Blocks.js'\n\nexport type {\n CheckboxFieldClientComponent,\n CheckboxFieldClientProps,\n CheckboxFieldDescriptionClientComponent,\n CheckboxFieldDescriptionServerComponent,\n CheckboxFieldDiffClientComponent,\n CheckboxFieldDiffServerComponent,\n CheckboxFieldErrorClientComponent,\n CheckboxFieldErrorServerComponent,\n CheckboxFieldLabelClientComponent,\n CheckboxFieldLabelServerComponent,\n CheckboxFieldServerComponent,\n CheckboxFieldServerProps,\n} from './fields/Checkbox.js'\n\nexport type {\n CodeFieldClientComponent,\n CodeFieldClientProps,\n CodeFieldDescriptionClientComponent,\n CodeFieldDescriptionServerComponent,\n CodeFieldDiffClientComponent,\n CodeFieldDiffServerComponent,\n CodeFieldErrorClientComponent,\n CodeFieldErrorServerComponent,\n CodeFieldLabelClientComponent,\n CodeFieldLabelServerComponent,\n CodeFieldServerComponent,\n CodeFieldServerProps,\n} from './fields/Code.js'\n\nexport type {\n CollapsibleFieldClientComponent,\n CollapsibleFieldClientProps,\n CollapsibleFieldDescriptionClientComponent,\n CollapsibleFieldDescriptionServerComponent,\n CollapsibleFieldDiffClientComponent,\n CollapsibleFieldDiffServerComponent,\n CollapsibleFieldErrorClientComponent,\n CollapsibleFieldErrorServerComponent,\n CollapsibleFieldLabelClientComponent,\n CollapsibleFieldLabelServerComponent,\n CollapsibleFieldServerComponent,\n CollapsibleFieldServerProps,\n} from './fields/Collapsible.js'\n\nexport type {\n DateFieldClientComponent,\n DateFieldClientProps,\n DateFieldDescriptionClientComponent,\n DateFieldDescriptionServerComponent,\n DateFieldDiffClientComponent,\n DateFieldDiffServerComponent,\n DateFieldErrorClientComponent,\n DateFieldErrorServerComponent,\n DateFieldLabelClientComponent,\n DateFieldLabelServerComponent,\n DateFieldServerComponent,\n DateFieldServerProps,\n} from './fields/Date.js'\n\nexport type {\n EmailFieldClientComponent,\n EmailFieldClientProps,\n EmailFieldDescriptionClientComponent,\n EmailFieldDescriptionServerComponent,\n EmailFieldDiffClientComponent,\n EmailFieldDiffServerComponent,\n EmailFieldErrorClientComponent,\n EmailFieldErrorServerComponent,\n EmailFieldLabelClientComponent,\n EmailFieldLabelServerComponent,\n EmailFieldServerComponent,\n EmailFieldServerProps,\n} from './fields/Email.js'\n\nexport type {\n GroupFieldClientComponent,\n GroupFieldClientProps,\n GroupFieldDescriptionClientComponent,\n GroupFieldDescriptionServerComponent,\n GroupFieldDiffClientComponent,\n GroupFieldDiffServerComponent,\n GroupFieldErrorClientComponent,\n GroupFieldErrorServerComponent,\n GroupFieldLabelClientComponent,\n GroupFieldLabelServerComponent,\n GroupFieldServerComponent,\n GroupFieldServerProps,\n} from './fields/Group.js'\n\nexport type { HiddenFieldProps } from './fields/Hidden.js'\n\nexport type {\n JoinFieldClientComponent,\n JoinFieldClientProps,\n JoinFieldDescriptionClientComponent,\n JoinFieldDescriptionServerComponent,\n JoinFieldDiffClientComponent,\n JoinFieldDiffServerComponent,\n JoinFieldErrorClientComponent,\n JoinFieldErrorServerComponent,\n JoinFieldLabelClientComponent,\n JoinFieldLabelServerComponent,\n JoinFieldServerComponent,\n JoinFieldServerProps,\n} from './fields/Join.js'\n\nexport type {\n JSONFieldClientComponent,\n JSONFieldClientProps,\n JSONFieldDescriptionClientComponent,\n JSONFieldDescriptionServerComponent,\n JSONFieldDiffClientComponent,\n JSONFieldDiffServerComponent,\n JSONFieldErrorClientComponent,\n JSONFieldErrorServerComponent,\n JSONFieldLabelClientComponent,\n JSONFieldLabelServerComponent,\n JSONFieldServerComponent,\n JSONFieldServerProps,\n} from './fields/JSON.js'\n\nexport type {\n NumberFieldClientComponent,\n NumberFieldClientProps,\n NumberFieldDescriptionClientComponent,\n NumberFieldDescriptionServerComponent,\n NumberFieldDiffClientComponent,\n NumberFieldDiffServerComponent,\n NumberFieldErrorClientComponent,\n NumberFieldErrorServerComponent,\n NumberFieldLabelClientComponent,\n NumberFieldLabelServerComponent,\n NumberFieldServerComponent,\n NumberFieldServerProps,\n} from './fields/Number.js'\n\nexport type {\n PointFieldClientComponent,\n PointFieldClientProps,\n PointFieldDescriptionClientComponent,\n PointFieldDescriptionServerComponent,\n PointFieldDiffClientComponent,\n PointFieldDiffServerComponent,\n PointFieldErrorClientComponent,\n PointFieldErrorServerComponent,\n PointFieldLabelClientComponent,\n PointFieldLabelServerComponent,\n PointFieldServerComponent,\n PointFieldServerProps,\n} from './fields/Point.js'\n\nexport type {\n RadioFieldClientComponent,\n RadioFieldClientProps,\n RadioFieldDescriptionClientComponent,\n RadioFieldDescriptionServerComponent,\n RadioFieldDiffClientComponent,\n RadioFieldDiffServerComponent,\n RadioFieldErrorClientComponent,\n RadioFieldErrorServerComponent,\n RadioFieldLabelClientComponent,\n RadioFieldLabelServerComponent,\n RadioFieldServerComponent,\n RadioFieldServerProps,\n} from './fields/Radio.js'\n\nexport type {\n RelationshipFieldClientComponent,\n RelationshipFieldClientProps,\n RelationshipFieldDescriptionClientComponent,\n RelationshipFieldDescriptionServerComponent,\n RelationshipFieldDiffClientComponent,\n RelationshipFieldDiffServerComponent,\n RelationshipFieldErrorClientComponent,\n RelationshipFieldErrorServerComponent,\n RelationshipFieldLabelClientComponent,\n RelationshipFieldLabelServerComponent,\n RelationshipFieldServerComponent,\n RelationshipFieldServerProps,\n} from './fields/Relationship.js'\n\nexport type {\n RichTextFieldClientComponent,\n RichTextFieldClientProps,\n RichTextFieldDescriptionClientComponent,\n RichTextFieldDescriptionServerComponent,\n RichTextFieldDiffClientComponent,\n RichTextFieldDiffServerComponent,\n RichTextFieldErrorClientComponent,\n RichTextFieldErrorServerComponent,\n RichTextFieldLabelClientComponent,\n RichTextFieldLabelServerComponent,\n RichTextFieldServerComponent,\n RichTextFieldServerProps,\n} from './fields/RichText.js'\n\nexport type {\n RowFieldClientComponent,\n RowFieldClientProps,\n RowFieldDescriptionClientComponent,\n RowFieldDescriptionServerComponent,\n RowFieldDiffClientComponent,\n RowFieldDiffServerComponent,\n RowFieldErrorClientComponent,\n RowFieldErrorServerComponent,\n RowFieldLabelClientComponent,\n RowFieldLabelServerComponent,\n RowFieldServerComponent,\n RowFieldServerProps,\n} from './fields/Row.js'\n\nexport type {\n SelectFieldClientComponent,\n SelectFieldClientProps,\n SelectFieldDescriptionClientComponent,\n SelectFieldDescriptionServerComponent,\n SelectFieldDiffClientComponent,\n SelectFieldDiffServerComponent,\n SelectFieldErrorClientComponent,\n SelectFieldErrorServerComponent,\n SelectFieldLabelClientComponent,\n SelectFieldLabelServerComponent,\n SelectFieldServerComponent,\n SelectFieldServerProps,\n} from './fields/Select.js'\n\nexport type {\n ClientTab,\n TabsFieldClientComponent,\n TabsFieldClientProps,\n TabsFieldDescriptionClientComponent,\n TabsFieldDescriptionServerComponent,\n TabsFieldDiffClientComponent,\n TabsFieldDiffServerComponent,\n TabsFieldErrorClientComponent,\n TabsFieldErrorServerComponent,\n TabsFieldLabelClientComponent,\n TabsFieldLabelServerComponent,\n TabsFieldServerComponent,\n TabsFieldServerProps,\n} from './fields/Tabs.js'\n\nexport type {\n TextFieldClientComponent,\n TextFieldClientProps,\n TextFieldDescriptionClientComponent,\n TextFieldDescriptionServerComponent,\n TextFieldDiffClientComponent,\n TextFieldDiffServerComponent,\n TextFieldErrorClientComponent,\n TextFieldErrorServerComponent,\n TextFieldLabelClientComponent,\n TextFieldLabelServerComponent,\n TextFieldServerComponent,\n TextFieldServerProps,\n} from './fields/Text.js'\n\nexport type {\n TextareaFieldClientComponent,\n TextareaFieldClientProps,\n TextareaFieldDescriptionClientComponent,\n TextareaFieldDescriptionServerComponent,\n TextareaFieldDiffClientComponent,\n TextareaFieldDiffServerComponent,\n TextareaFieldErrorClientComponent,\n TextareaFieldErrorServerComponent,\n TextareaFieldLabelClientComponent,\n TextareaFieldLabelServerComponent,\n TextareaFieldServerComponent,\n TextareaFieldServerProps,\n} from './fields/Textarea.js'\n\nexport type {\n UIFieldClientComponent,\n UIFieldClientProps,\n UIFieldDiffClientComponent,\n UIFieldDiffServerComponent,\n UIFieldServerComponent,\n UIFieldServerProps,\n} from './fields/UI.js'\n\nexport type {\n UploadFieldClientComponent,\n UploadFieldClientProps,\n UploadFieldDescriptionClientComponent,\n UploadFieldDescriptionServerComponent,\n UploadFieldDiffClientComponent,\n UploadFieldDiffServerComponent,\n UploadFieldErrorClientComponent,\n UploadFieldErrorServerComponent,\n UploadFieldLabelClientComponent,\n UploadFieldLabelServerComponent,\n UploadFieldServerComponent,\n UploadFieldServerProps,\n} from './fields/Upload.js'\n\nexport type {\n Description,\n DescriptionFunction,\n FieldDescriptionClientComponent,\n FieldDescriptionClientProps,\n FieldDescriptionServerComponent,\n FieldDescriptionServerProps,\n GenericDescriptionProps,\n StaticDescription,\n} from './forms/Description.js'\n\nexport type {\n BaseVersionField,\n DiffMethod,\n FieldDiffClientComponent,\n FieldDiffClientProps,\n FieldDiffServerComponent,\n FieldDiffServerProps,\n VersionField,\n VersionTab,\n} from './forms/Diff.js'\n\nexport type {\n BuildFormStateArgs,\n Data,\n FieldState as FormField,\n FieldStateWithoutComponents as FormFieldWithoutComponents,\n FilterOptionsResult,\n FormState,\n FormStateWithoutComponents,\n Row,\n}\n\nexport type {\n FieldErrorClientComponent,\n FieldErrorClientProps,\n FieldErrorServerComponent,\n FieldErrorServerProps,\n GenericErrorProps,\n} from './forms/Error.js'\n\nexport type {\n ClientComponentProps,\n ClientFieldBase,\n ClientFieldWithOptionalType,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerComponentProps,\n ServerFieldBase,\n} from './forms/Field.js'\n\nexport type {\n FieldLabelClientComponent,\n FieldLabelClientProps,\n FieldLabelServerComponent,\n FieldLabelServerProps,\n GenericLabelProps,\n SanitizedLabelProps,\n} from './forms/Label.js'\n\nexport type { RowLabel, RowLabelComponent } from './forms/RowLabel.js'\n\nexport type MappedServerComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component?: React.ComponentType<TComponentClientProps>\n props?: Partial<any>\n RenderedComponent: React.ReactNode\n type: 'server'\n}\n\nexport type MappedClientComponent<TComponentClientProps extends JsonObject = JsonObject> = {\n Component?: React.ComponentType<TComponentClientProps>\n props?: Partial<TComponentClientProps>\n RenderedComponent?: React.ReactNode\n type: 'client'\n}\n\nexport type MappedEmptyComponent = {\n type: 'empty'\n}\n\nexport enum Action {\n RenderConfig = 'render-config',\n}\n\nexport type RenderEntityConfigArgs = {\n collectionSlug?: string\n data?: Data\n globalSlug?: string\n}\n\nexport type RenderRootConfigArgs = {}\n\nexport type RenderFieldConfigArgs = {\n collectionSlug?: string\n formState?: FormState\n globalSlug?: string\n schemaPath: string\n}\n\nexport type RenderConfigArgs = {\n action: Action.RenderConfig\n config: Promise<SanitizedConfig> | SanitizedConfig\n i18n: I18nClient\n importMap: ImportMap\n languageCode: AcceptedLanguages\n serverProps?: any\n} & (RenderEntityConfigArgs | RenderFieldConfigArgs | RenderRootConfigArgs)\n\nexport type PayloadServerAction = (\n args:\n | {\n [key: string]: any\n action: Action\n i18n: I18nClient\n }\n | RenderConfigArgs,\n) => Promise<string>\n\nexport type RenderedField = {\n Field: React.ReactNode\n indexPath?: string\n initialSchemaPath?: string\n /**\n * @deprecated\n * This is a legacy property that will be removed in v4.\n * Please use `fieldIsSidebar(field)` from `payload` instead.\n * Or check `field.admin.position === 'sidebar'` directly.\n */\n isSidebar: boolean\n path: string\n schemaPath: string\n type: FieldTypes\n}\n\nexport type FieldRow = {\n RowLabel?: React.ReactNode\n}\n\nexport type DocumentSlots = {\n BeforeDocumentControls?: React.ReactNode\n BeforeDocumentMeta?: React.ReactNode\n Description?: React.ReactNode\n EditMenuItems?: React.ReactNode\n LivePreview?: React.ReactNode\n PreviewButton?: React.ReactNode\n PublishButton?: React.ReactNode\n SaveButton?: React.ReactNode\n SaveDraftButton?: React.ReactNode\n Status?: React.ReactNode\n UnpublishButton?: React.ReactNode\n Upload?: React.ReactNode\n UploadControls?: React.ReactNode\n UploadFilePreview?: React.ReactNode\n}\n\nexport type {\n BuildTableStateArgs,\n DefaultServerFunctionArgs,\n InitReqResult,\n ListQuery,\n ServerFunction,\n ServerFunctionArgs,\n ServerFunctionClient,\n ServerFunctionClientArgs,\n ServerFunctionConfig,\n ServerFunctionHandler,\n ServerFunctionMode,\n SlugifyServerFunctionArgs,\n} from './functions/index.js'\n\nexport type { LanguageOptions } from './LanguageOptions.js'\n\nexport type { RichTextAdapter, RichTextAdapterProvider, RichTextHooks } from './RichText.js'\n\nexport { type WidgetServerProps } from './views/dashboard.js'\n\nexport type {\n BeforeDocumentControlsClientProps,\n BeforeDocumentControlsServerProps,\n BeforeDocumentControlsServerPropsOnly,\n DocumentSubViewTypes,\n DocumentTabClientProps,\n /**\n * @deprecated\n * The `DocumentTabComponent` type is deprecated and will be removed in the next major version.\n * Use `DocumentTabServerProps`or `DocumentTabClientProps` instead.\n */\n DocumentTabComponent,\n DocumentTabCondition,\n DocumentTabConfig,\n /**\n * @deprecated\n * The `DocumentTabProps` type is deprecated and will be removed in the next major version.\n * Use `DocumentTabServerProps` instead.\n */\n DocumentTabServerProps as DocumentTabProps,\n DocumentTabServerProps,\n DocumentTabServerPropsOnly,\n /**\n * @deprecated\n * The `ClientSideEditViewProps` type is deprecated and will be removed in the next major version.\n * Use `DocumentViewClientProps` instead.\n */\n DocumentViewClientProps as ClientSideEditViewProps,\n DocumentViewClientProps,\n /**\n * @deprecated\n * The `ServerSideEditViewProps` is deprecated and will be removed in the next major version.\n * Use `DocumentViewServerProps` instead.\n */\n DocumentViewServerProps as ServerSideEditViewProps,\n DocumentViewServerProps,\n DocumentViewServerPropsOnly,\n EditViewProps,\n RenderDocumentVersionsProperties,\n} from './views/document.js'\n\nexport type { RelatedDocumentsGrouped } from './views/hierarchyList.js'\n\nexport type {\n AdminViewClientProps,\n /**\n * @deprecated\n * The `AdminViewComponent` type is deprecated and will be removed in the next major version.\n * Type your component props directly instead.\n */\n AdminViewComponent,\n AdminViewConfig,\n /**\n * @deprecated\n * The `AdminViewProps` type is deprecated and will be removed in the next major version.\n * Use `AdminViewServerProps` instead.\n */\n AdminViewServerProps as AdminViewProps,\n AdminViewServerProps,\n AdminViewServerPropsOnly,\n InitPageResult,\n ServerPropsFromView,\n ViewDescriptionClientProps,\n ViewDescriptionServerProps,\n ViewDescriptionServerPropsOnly,\n ViewTypes,\n VisibleEntities,\n} from './views/index.js'\n\nexport type {\n AfterListClientProps,\n AfterListServerProps,\n AfterListServerPropsOnly,\n AfterListTableClientProps,\n AfterListTableServerProps,\n AfterListTableServerPropsOnly,\n BeforeListClientProps,\n BeforeListServerProps,\n BeforeListServerPropsOnly,\n BeforeListTableClientProps,\n BeforeListTableServerProps,\n BeforeListTableServerPropsOnly,\n HierarchyViewData,\n ListViewClientProps,\n ListViewServerProps,\n ListViewServerPropsOnly,\n ListViewSlots,\n ListViewSlotSharedClientProps,\n NoResultsClientProps,\n NoResultsServerProps,\n NoResultsServerPropsOnly,\n} from './views/list.js'\n\ntype SchemaPath = {} & string\nexport type FieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: Field[]\n }\n | Block\n | Field\n | Tab\n>\n\nexport type ClientFieldSchemaMap = Map<\n SchemaPath,\n | {\n fields: ClientField[]\n }\n | ClientBlock\n | ClientField\n | ClientTab\n>\n\nexport type DocumentEvent = {\n doc?: TypeWithID\n drawerSlug?: string\n entitySlug: string\n id?: number | string\n operation: 'create' | 'update'\n updatedAt: string\n}\n"],"names":["Action"],"mappings":"AAmgBA,OAAO,IAAA,AAAKA,gCAAAA;;WAAAA;MAEX"}
@@ -19,10 +19,6 @@ export type RenderDocumentVersionsProperties = {
19
19
  * rather than perform a full navigation.
20
20
  */
21
21
  CreatedAtCellOverride?: (props: any) => any;
22
- /**
23
- * @default false
24
- */
25
- disableGutter?: boolean;
26
22
  /**
27
23
  * @deprecated Pass `CreatedAtCellOverride` directly instead.
28
24
  * @default false
@@ -1 +1 @@
1
- {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/admin/views/document.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC3F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAA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,CAAC,EAAE,oBAAoB,CAAA;IACzC,QAAQ,CAAC,SAAS,CAAC,EAAE,oBAAoB,CAAA;IACzC,QAAQ,CAAC,IAAI,CAAC,EACV,CAAC,CAAC,IAAI,EAAE;QACN,MAAM,EAAE,MAAM,CAAA;QACd,UAAU,EAAE,yBAAyB,CAAA;QACrC,MAAM,EAAE,qBAAqB,CAAA;QAC7B,EAAE,CAAC,EAAE,MAAM,CAAA;QACX,MAAM,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAA;KAClC,KAAK,MAAM,CAAC,GACb,MAAM,CAAA;IACV,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,GAAG,OAAO,CAAA;IACnE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE;QAAE,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC,GAAG,MAAM,CAAA;IAC5E,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAA;CACjC,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;IAClD,IAAI,EAAE,MAAM,CAAA;CACb,CAAC,CAAA;AAIF,MAAM,MAAM,iCAAiC,GAAG,EAAE,CAAA;AAClD,MAAM,MAAM,qCAAqC,GAAG,EAAE,GAAG,WAAW,CAAA;AACpE,MAAM,MAAM,iCAAiC,GAAG,iCAAiC,GAC/E,qCAAqC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/views/document.ts"],"sourcesContent":["import type { SanitizedPermissions } from '../../auth/types.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { PayloadComponent, SanitizedConfig, ServerProps } from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { Data, DocumentSlots, FormState } from '../types.js'\nimport type { InitPageResult, ViewTypes } from './index.js'\n\nexport type EditViewProps = {\n readonly collectionSlug?: string\n readonly globalSlug?: string\n}\n/**\n * Properties specific to the versions view\n */\nexport type RenderDocumentVersionsProperties = {\n /**\n * Override the CreatedAt cell component rendered in the versions table.\n * Useful when embedding the versions list inside a drawer that should update URL params\n * rather than perform a full navigation.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n CreatedAtCellOverride?: (props: any) => any\n /**\n * @default false\n */\n disableGutter?: boolean\n /**\n * @deprecated Pass `CreatedAtCellOverride` directly instead.\n * @default false\n */\n useVersionDrawerCreatedAtCell?: boolean\n}\n\nexport type DocumentViewServerPropsOnly = {\n doc: Data\n hasPublishedDoc: boolean\n initPageResult: InitPageResult\n routeSegments: string[]\n versions?: RenderDocumentVersionsProperties\n} & ServerProps\n\nexport type DocumentViewServerProps = DocumentViewClientProps & DocumentViewServerPropsOnly\n\nexport type DocumentViewClientProps = {\n documentSubViewType: DocumentSubViewTypes\n formState: FormState\n viewType: ViewTypes\n} & DocumentSlots\n\n/**\n * @todo: This should be renamed to `DocumentSubViewType` (singular)\n */\nexport type DocumentSubViewTypes = 'api' | 'default' | 'version' | 'versions'\n\nexport type DocumentTabServerPropsOnly = {\n readonly apiURL?: string\n readonly collectionConfig?: SanitizedCollectionConfig\n readonly globalConfig?: SanitizedGlobalConfig\n readonly permissions: SanitizedPermissions\n readonly req: PayloadRequest\n} & ServerProps\n\nexport type DocumentTabClientProps = {\n path: string\n}\n\nexport type DocumentTabServerProps = DocumentTabClientProps & DocumentTabServerPropsOnly\n\nexport type DocumentTabCondition = (args: {\n collectionConfig: SanitizedCollectionConfig\n /**\n * @deprecated: Use `req.payload.config` instead. This will be removed in v4.\n */\n config: SanitizedConfig\n globalConfig: SanitizedGlobalConfig\n permissions: SanitizedPermissions\n req: PayloadRequest\n}) => boolean\n\n// Everything is optional because we merge in the defaults\n// i.e. the config may override the `Default` view with a `label` but not an `href`\nexport type DocumentTabConfig = {\n readonly Component?: DocumentTabComponent\n readonly condition?: DocumentTabCondition\n readonly href?:\n | ((args: {\n apiURL: string\n collection: SanitizedCollectionConfig\n global: SanitizedGlobalConfig\n id?: string\n routes: SanitizedConfig['routes']\n }) => string)\n | string\n readonly isActive?: ((args: { href: string }) => boolean) | boolean\n readonly label?: ((args: { t: (key: string) => string }) => string) | string\n readonly newTab?: boolean\n /**\n * Sets the order to render the tab in the admin panel\n * Recommended to use increments of 100 (e.g. 0, 100, 200)\n */\n readonly order?: number\n readonly Pill?: PayloadComponent\n}\n\n/**\n * @todo: Remove this type as it's only used internally for the config (above)\n */\nexport type DocumentTabComponent = PayloadComponent<{\n path: string\n}>\n\n// BeforeDocumentControls\n\nexport type BeforeDocumentControlsClientProps = {}\nexport type BeforeDocumentControlsServerPropsOnly = {} & ServerProps\nexport type BeforeDocumentControlsServerProps = BeforeDocumentControlsClientProps &\n BeforeDocumentControlsServerPropsOnly\n"],"names":[],"mappings":"AAoHA,WACuC"}
1
+ {"version":3,"sources":["../../../src/admin/views/document.ts"],"sourcesContent":["import type { SanitizedPermissions } from '../../auth/types.js'\nimport type { SanitizedCollectionConfig } from '../../collections/config/types.js'\nimport type { PayloadComponent, SanitizedConfig, ServerProps } from '../../config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\nimport type { Data, DocumentSlots, FormState } from '../types.js'\nimport type { InitPageResult, ViewTypes } from './index.js'\n\nexport type EditViewProps = {\n readonly collectionSlug?: string\n readonly globalSlug?: string\n}\n/**\n * Properties specific to the versions view\n */\nexport type RenderDocumentVersionsProperties = {\n /**\n * Override the CreatedAt cell component rendered in the versions table.\n * Useful when embedding the versions list inside a drawer that should update URL params\n * rather than perform a full navigation.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n CreatedAtCellOverride?: (props: any) => any\n /**\n * @deprecated Pass `CreatedAtCellOverride` directly instead.\n * @default false\n */\n useVersionDrawerCreatedAtCell?: boolean\n}\n\nexport type DocumentViewServerPropsOnly = {\n doc: Data\n hasPublishedDoc: boolean\n initPageResult: InitPageResult\n routeSegments: string[]\n versions?: RenderDocumentVersionsProperties\n} & ServerProps\n\nexport type DocumentViewServerProps = DocumentViewClientProps & DocumentViewServerPropsOnly\n\nexport type DocumentViewClientProps = {\n documentSubViewType: DocumentSubViewTypes\n formState: FormState\n viewType: ViewTypes\n} & DocumentSlots\n\n/**\n * @todo: This should be renamed to `DocumentSubViewType` (singular)\n */\nexport type DocumentSubViewTypes = 'api' | 'default' | 'version' | 'versions'\n\nexport type DocumentTabServerPropsOnly = {\n readonly apiURL?: string\n readonly collectionConfig?: SanitizedCollectionConfig\n readonly globalConfig?: SanitizedGlobalConfig\n readonly permissions: SanitizedPermissions\n readonly req: PayloadRequest\n} & ServerProps\n\nexport type DocumentTabClientProps = {\n path: string\n}\n\nexport type DocumentTabServerProps = DocumentTabClientProps & DocumentTabServerPropsOnly\n\nexport type DocumentTabCondition = (args: {\n collectionConfig: SanitizedCollectionConfig\n /**\n * @deprecated: Use `req.payload.config` instead. This will be removed in v4.\n */\n config: SanitizedConfig\n globalConfig: SanitizedGlobalConfig\n permissions: SanitizedPermissions\n req: PayloadRequest\n}) => boolean\n\n// Everything is optional because we merge in the defaults\n// i.e. the config may override the `Default` view with a `label` but not an `href`\nexport type DocumentTabConfig = {\n readonly Component?: DocumentTabComponent\n readonly condition?: DocumentTabCondition\n readonly href?:\n | ((args: {\n apiURL: string\n collection: SanitizedCollectionConfig\n global: SanitizedGlobalConfig\n id?: string\n routes: SanitizedConfig['routes']\n }) => string)\n | string\n readonly isActive?: ((args: { href: string }) => boolean) | boolean\n readonly label?: ((args: { t: (key: string) => string }) => string) | string\n readonly newTab?: boolean\n /**\n * Sets the order to render the tab in the admin panel\n * Recommended to use increments of 100 (e.g. 0, 100, 200)\n */\n readonly order?: number\n readonly Pill?: PayloadComponent\n}\n\n/**\n * @todo: Remove this type as it's only used internally for the config (above)\n */\nexport type DocumentTabComponent = PayloadComponent<{\n path: string\n}>\n\n// BeforeDocumentControls\n\nexport type BeforeDocumentControlsClientProps = {}\nexport type BeforeDocumentControlsServerPropsOnly = {} & ServerProps\nexport type BeforeDocumentControlsServerProps = BeforeDocumentControlsClientProps &\n BeforeDocumentControlsServerPropsOnly\n"],"names":[],"mappings":"AAgHA,WACuC"}
@@ -45,6 +45,7 @@ export type ListViewSlots = {
45
45
  BeforeListTable?: React.ReactNode;
46
46
  Description?: React.ReactNode;
47
47
  listMenuItems?: React.ReactNode[];
48
+ NoResults?: React.ReactNode;
48
49
  Table: React.ReactNode | React.ReactNode[];
49
50
  };
50
51
  /**
@@ -106,6 +107,7 @@ export type ListViewSlotSharedClientProps = {
106
107
  hasDeletePermission?: boolean;
107
108
  hasTrashPermission?: boolean;
108
109
  newDocumentURL: string;
110
+ viewType: ViewTypes;
109
111
  };
110
112
  export type BeforeListClientProps = ListViewSlotSharedClientProps;
111
113
  export type BeforeListServerPropsOnly = {} & ListViewServerPropsOnly;
@@ -113,6 +115,9 @@ export type BeforeListServerProps = BeforeListClientProps & BeforeListServerProp
113
115
  export type BeforeListTableClientProps = ListViewSlotSharedClientProps;
114
116
  export type BeforeListTableServerPropsOnly = {} & ListViewServerPropsOnly;
115
117
  export type BeforeListTableServerProps = BeforeListTableClientProps & BeforeListTableServerPropsOnly;
118
+ export type NoResultsClientProps = ListViewSlotSharedClientProps;
119
+ export type NoResultsServerPropsOnly = {} & ListViewServerPropsOnly;
120
+ export type NoResultsServerProps = NoResultsClientProps & NoResultsServerPropsOnly;
116
121
  export type AfterListClientProps = ListViewSlotSharedClientProps;
117
122
  export type AfterListServerPropsOnly = {} & ListViewServerPropsOnly;
118
123
  export type AfterListServerProps = AfterListClientProps & AfterListServerPropsOn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AA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/views/list.ts"],"sourcesContent":["import type { SanitizedCollectionPermission } from '../../auth/types.js'\nimport type {\n CollectionAdminOptions,\n SanitizedCollectionConfig,\n TypeWithID,\n} from '../../collections/config/types.js'\nimport type { ServerProps } from '../../config/types.js'\nimport type { PaginatedDocs } from '../../database/types.js'\nimport type { CollectionPreferences } from '../../preferences/types.js'\nimport type { QueryPreset } from '../../query-presets/types.js'\nimport type { ResolvedFilterOptions, Where } from '../../types/index.js'\nimport type { Column } from '../elements/Table.js'\nimport type { Data, ViewTypes } from '../types.js'\nimport type { RelatedDocumentsGrouped } from './hierarchyList.js'\n\nexport type HierarchyViewData = {\n /**\n * Collections allowed for creation based on parent's collectionSpecific field.\n * Undefined means all related collections are allowed.\n * Always includes the hierarchy collection itself.\n */\n allowedCollections?: Array<{ label: string; slug: string }>\n /** Base filter applied to hierarchy collection queries (e.g., tenant filter) */\n baseFilter?: Where\n /** Breadcrumb trail to the current parent */\n breadcrumbs: Array<{ id: number | string; title: string }>\n /** Children of the current parent (same collection) */\n childrenData: PaginatedDocs\n /** The current parent document data (for display and collectionSpecific field access) */\n parent: null | (Record<string, unknown> & TypeWithID)\n /** The parent field name for building queries */\n parentFieldName: string\n /** The parent ID being viewed */\n parentId: null | number | string\n /** Base filters for related collections (keyed by collection slug) */\n relatedBaseFilters?: Record<string, Where>\n /** Related documents grouped by collection */\n relatedDocumentsByCollection: RelatedDocumentsGrouped\n}\n\nexport type ListViewSlots = {\n AfterList?: React.ReactNode\n AfterListTable?: React.ReactNode\n BeforeList?: React.ReactNode\n BeforeListTable?: React.ReactNode\n Description?: React.ReactNode\n listMenuItems?: React.ReactNode[]\n Table: React.ReactNode | React.ReactNode[]\n}\n\n/**\n * The `ListViewServerPropsOnly` approach is needed to ensure type strictness when injecting component props\n * There is no way to do something like `Omit<ListViewServerProps, keyof ListViewClientProps>`\n * This is because `ListViewClientProps` is a union which is impossible to exclude from\n * Exporting explicitly defined `ListViewServerPropsOnly`, etc. allows for the strictest typing\n */\nexport type ListViewServerPropsOnly = {\n collectionConfig: SanitizedCollectionConfig\n data: Data\n limit: number\n listPreferences: CollectionPreferences\n listSearchableFields: CollectionAdminOptions['listSearchableFields']\n} & ServerProps\n\nexport type ListViewServerProps = ListViewClientProps & ListViewServerPropsOnly\n\nexport type ListViewClientProps = {\n baseFilter?: Where\n beforeActions?: React.ReactNode[]\n collectionSlug: SanitizedCollectionConfig['slug']\n columnState: Column[]\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n disableQueryPresets?: boolean\n enableRowSelections?: boolean\n hasCreatePermission: boolean\n hasDeletePermission?: boolean\n hasTrashPermission?: boolean\n /**\n * Hierarchy view data - present when viewing a hierarchy collection with a parent selected\n */\n hierarchyData?: HierarchyViewData\n /**\n * Resolved full-size icon component for hierarchy collections (used in drawer subheader)\n */\n HierarchyIcon?: React.ReactNode\n /**\n * Resolved small icon component for hierarchy collections (used in table rows)\n */\n HierarchySmallIcon?: React.ReactNode\n /**\n * @deprecated\n */\n listPreferences?: CollectionPreferences\n newDocumentURL: string\n /**\n * @deprecated\n */\n preferenceKey?: string\n queryPreset?: QueryPreset\n queryPresetPermissions?: SanitizedCollectionPermission\n renderedFilters?: Map<string, React.ReactNode>\n resolvedFilterOptions?: Map<string, ResolvedFilterOptions>\n viewType: ViewTypes\n} & ListViewSlots\n\nexport type ListViewSlotSharedClientProps = {\n collectionSlug: SanitizedCollectionConfig['slug']\n hasCreatePermission: boolean\n hasDeletePermission?: boolean\n hasTrashPermission?: boolean\n newDocumentURL: string\n}\n\n// BeforeList\nexport type BeforeListClientProps = ListViewSlotSharedClientProps\nexport type BeforeListServerPropsOnly = {} & ListViewServerPropsOnly\nexport type BeforeListServerProps = BeforeListClientProps & BeforeListServerPropsOnly\n\n// BeforeListTable\nexport type BeforeListTableClientProps = ListViewSlotSharedClientProps\nexport type BeforeListTableServerPropsOnly = {} & ListViewServerPropsOnly\nexport type BeforeListTableServerProps = BeforeListTableClientProps & BeforeListTableServerPropsOnly\n\n// AfterList\nexport type AfterListClientProps = ListViewSlotSharedClientProps\nexport type AfterListServerPropsOnly = {} & ListViewServerPropsOnly\nexport type AfterListServerProps = AfterListClientProps & AfterListServerPropsOnly\n\n// AfterListTable\nexport type AfterListTableClientProps = ListViewSlotSharedClientProps\nexport type AfterListTableServerPropsOnly = {} & ListViewServerPropsOnly\nexport type AfterListTableServerProps = AfterListTableClientProps & AfterListTableServerPropsOnly\n"],"names":[],"mappings":"AAoIA,WAAiG"}
1
+ {"version":3,"sources":["../../../src/admin/views/list.ts"],"sourcesContent":["import type { SanitizedCollectionPermission } from '../../auth/types.js'\nimport type {\n CollectionAdminOptions,\n SanitizedCollectionConfig,\n TypeWithID,\n} from '../../collections/config/types.js'\nimport type { ServerProps } from '../../config/types.js'\nimport type { PaginatedDocs } from '../../database/types.js'\nimport type { CollectionPreferences } from '../../preferences/types.js'\nimport type { QueryPreset } from '../../query-presets/types.js'\nimport type { ResolvedFilterOptions, Where } from '../../types/index.js'\nimport type { Column } from '../elements/Table.js'\nimport type { Data, ViewTypes } from '../types.js'\nimport type { RelatedDocumentsGrouped } from './hierarchyList.js'\n\nexport type HierarchyViewData = {\n /**\n * Collections allowed for creation based on parent's collectionSpecific field.\n * Undefined means all related collections are allowed.\n * Always includes the hierarchy collection itself.\n */\n allowedCollections?: Array<{ label: string; slug: string }>\n /** Base filter applied to hierarchy collection queries (e.g., tenant filter) */\n baseFilter?: Where\n /** Breadcrumb trail to the current parent */\n breadcrumbs: Array<{ id: number | string; title: string }>\n /** Children of the current parent (same collection) */\n childrenData: PaginatedDocs\n /** The current parent document data (for display and collectionSpecific field access) */\n parent: null | (Record<string, unknown> & TypeWithID)\n /** The parent field name for building queries */\n parentFieldName: string\n /** The parent ID being viewed */\n parentId: null | number | string\n /** Base filters for related collections (keyed by collection slug) */\n relatedBaseFilters?: Record<string, Where>\n /** Related documents grouped by collection */\n relatedDocumentsByCollection: RelatedDocumentsGrouped\n}\n\nexport type ListViewSlots = {\n AfterList?: React.ReactNode\n AfterListTable?: React.ReactNode\n BeforeList?: React.ReactNode\n BeforeListTable?: React.ReactNode\n Description?: React.ReactNode\n listMenuItems?: React.ReactNode[]\n NoResults?: React.ReactNode\n Table: React.ReactNode | React.ReactNode[]\n}\n\n/**\n * The `ListViewServerPropsOnly` approach is needed to ensure type strictness when injecting component props\n * There is no way to do something like `Omit<ListViewServerProps, keyof ListViewClientProps>`\n * This is because `ListViewClientProps` is a union which is impossible to exclude from\n * Exporting explicitly defined `ListViewServerPropsOnly`, etc. allows for the strictest typing\n */\nexport type ListViewServerPropsOnly = {\n collectionConfig: SanitizedCollectionConfig\n data: Data\n limit: number\n listPreferences: CollectionPreferences\n listSearchableFields: CollectionAdminOptions['listSearchableFields']\n} & ServerProps\n\nexport type ListViewServerProps = ListViewClientProps & ListViewServerPropsOnly\n\nexport type ListViewClientProps = {\n baseFilter?: Where\n beforeActions?: React.ReactNode[]\n collectionSlug: SanitizedCollectionConfig['slug']\n columnState: Column[]\n disableBulkDelete?: boolean\n disableBulkEdit?: boolean\n disableQueryPresets?: boolean\n enableRowSelections?: boolean\n hasCreatePermission: boolean\n hasDeletePermission?: boolean\n hasTrashPermission?: boolean\n /**\n * Hierarchy view data - present when viewing a hierarchy collection with a parent selected\n */\n hierarchyData?: HierarchyViewData\n /**\n * Resolved full-size icon component for hierarchy collections (used in drawer subheader)\n */\n HierarchyIcon?: React.ReactNode\n /**\n * Resolved small icon component for hierarchy collections (used in table rows)\n */\n HierarchySmallIcon?: React.ReactNode\n /**\n * @deprecated\n */\n listPreferences?: CollectionPreferences\n newDocumentURL: string\n /**\n * @deprecated\n */\n preferenceKey?: string\n queryPreset?: QueryPreset\n queryPresetPermissions?: SanitizedCollectionPermission\n renderedFilters?: Map<string, React.ReactNode>\n resolvedFilterOptions?: Map<string, ResolvedFilterOptions>\n viewType: ViewTypes\n} & ListViewSlots\n\nexport type ListViewSlotSharedClientProps = {\n collectionSlug: SanitizedCollectionConfig['slug']\n hasCreatePermission: boolean\n hasDeletePermission?: boolean\n hasTrashPermission?: boolean\n newDocumentURL: string\n viewType: ViewTypes\n}\n\n// BeforeList\nexport type BeforeListClientProps = ListViewSlotSharedClientProps\nexport type BeforeListServerPropsOnly = {} & ListViewServerPropsOnly\nexport type BeforeListServerProps = BeforeListClientProps & BeforeListServerPropsOnly\n\n// BeforeListTable\nexport type BeforeListTableClientProps = ListViewSlotSharedClientProps\nexport type BeforeListTableServerPropsOnly = {} & ListViewServerPropsOnly\nexport type BeforeListTableServerProps = BeforeListTableClientProps & BeforeListTableServerPropsOnly\n\n// NoResults\nexport type NoResultsClientProps = ListViewSlotSharedClientProps\nexport type NoResultsServerPropsOnly = {} & ListViewServerPropsOnly\nexport type NoResultsServerProps = NoResultsClientProps & NoResultsServerPropsOnly\n\n// AfterList\nexport type AfterListClientProps = ListViewSlotSharedClientProps\nexport type AfterListServerPropsOnly = {} & ListViewServerPropsOnly\nexport type AfterListServerProps = AfterListClientProps & AfterListServerPropsOnly\n\n// AfterListTable\nexport type AfterListTableClientProps = ListViewSlotSharedClientProps\nexport type AfterListTableServerPropsOnly = {} & ListViewServerPropsOnly\nexport type AfterListTableServerProps = AfterListTableClientProps & AfterListTableServerPropsOnly\n"],"names":[],"mappings":"AA2IA,WAAiG"}
@@ -1,3 +1,11 @@
1
- import type { Field } from '../../fields/config/types.js';
2
- export declare const apiKeyFields: Field[];
1
+ import type { CheckboxField, Field, TextField } from '../../fields/config/types.js';
2
+ type APIKeyCheckboxFieldOverride = Omit<Partial<CheckboxField>, 'name' | 'type'>;
3
+ type APIKeyTextFieldOverride = Omit<Partial<TextField>, 'hasMany' | 'maxRows' | 'minRows' | 'name' | 'type' | 'validate'>;
4
+ export declare const createAPIKeyFields: ({ apiKeyField, apiKeyIndexField, enableAPIKeyField, includeEnableAPIKey, }?: {
5
+ apiKeyField?: APIKeyTextFieldOverride;
6
+ apiKeyIndexField?: APIKeyTextFieldOverride;
7
+ enableAPIKeyField?: APIKeyCheckboxFieldOverride;
8
+ includeEnableAPIKey?: boolean;
9
+ }) => Field[];
10
+ export {};
3
11
  //# sourceMappingURL=apiKey.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apiKey.d.ts","sourceRoot":"","sources":["../../../src/auth/baseFields/apiKey.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAa,MAAM,8BAA8B,CAAA;AAOpE,eAAO,MAAM,YAAY,EAoDpB,KAAK,EAAE,CAAA"}
1
+ {"version":3,"file":"apiKey.d.ts","sourceRoot":"","sources":["../../../src/auth/baseFields/apiKey.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAa,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAO9F,KAAK,2BAA2B,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;AAChF,KAAK,uBAAuB,GAAG,IAAI,CACjC,OAAO,CAAC,SAAS,CAAC,EAClB,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CACjE,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,6EAKhC;IACD,WAAW,CAAC,EAAE,uBAAuB,CAAA;IACrC,gBAAgB,CAAC,EAAE,uBAAuB,CAAA;IAC1C,iBAAiB,CAAC,EAAE,2BAA2B,CAAA;IAC/C,mBAAmB,CAAC,EAAE,OAAO,CAAA;CACzB,KAAG,KAAK,EAwEb,CAAA"}
@@ -1,24 +1,31 @@
1
1
  import crypto from 'crypto';
2
2
  const encryptKey = ({ req, value })=>value ? req.payload.encrypt(value) : null;
3
3
  const decryptKey = ({ req, value })=>value ? req.payload.decrypt(value) : undefined;
4
- export const apiKeyFields = [
5
- {
6
- name: 'enableAPIKey',
7
- type: 'checkbox',
8
- admin: {
9
- components: {
10
- Field: false
11
- }
12
- },
13
- label: ({ t })=>t('authentication:enableAPIKey')
14
- },
15
- {
4
+ export const createAPIKeyFields = ({ apiKeyField, apiKeyIndexField, enableAPIKeyField, includeEnableAPIKey = true } = {})=>{
5
+ const fields = [];
6
+ if (includeEnableAPIKey) {
7
+ fields.push({
8
+ name: 'enableAPIKey',
9
+ type: 'checkbox',
10
+ ...enableAPIKeyField,
11
+ admin: {
12
+ components: {
13
+ Field: false
14
+ },
15
+ ...enableAPIKeyField?.admin
16
+ },
17
+ label: enableAPIKeyField?.label ?? (({ t })=>t('authentication:enableAPIKey'))
18
+ });
19
+ }
20
+ fields.push({
16
21
  name: 'apiKey',
17
22
  type: 'text',
23
+ ...apiKeyField,
18
24
  admin: {
19
25
  components: {
20
26
  Field: false
21
- }
27
+ },
28
+ ...apiKeyField?.admin
22
29
  },
23
30
  hooks: {
24
31
  afterRead: [
@@ -26,24 +33,26 @@ export const apiKeyFields = [
26
33
  ],
27
34
  beforeChange: [
28
35
  encryptKey
29
- ]
36
+ ],
37
+ ...apiKeyField?.hooks
30
38
  },
31
- label: ({ t })=>t('authentication:apiKey')
32
- },
33
- {
39
+ label: apiKeyField?.label ?? (({ t })=>t('authentication:apiKey'))
40
+ }, {
34
41
  name: 'apiKeyIndex',
35
42
  type: 'text',
43
+ ...apiKeyIndexField,
36
44
  admin: {
37
- disabled: true
45
+ disabled: true,
46
+ ...apiKeyIndexField?.admin
38
47
  },
39
- hidden: true,
48
+ hidden: apiKeyIndexField?.hidden ?? true,
40
49
  hooks: {
41
50
  beforeValidate: [
42
51
  ({ data, req, value })=>{
43
- if (data?.apiKey === false || data?.apiKey === null) {
52
+ if (data?.apiKey === false || data?.apiKey === null || data?.apiKey === '') {
44
53
  return null;
45
54
  }
46
- if (data?.enableAPIKey === false || data?.enableAPIKey === null) {
55
+ if (includeEnableAPIKey && (data?.enableAPIKey === false || data?.enableAPIKey === null)) {
47
56
  return null;
48
57
  }
49
58
  if (data?.apiKey) {
@@ -51,9 +60,11 @@ export const apiKeyFields = [
51
60
  }
52
61
  return value;
53
62
  }
54
- ]
63
+ ],
64
+ ...apiKeyIndexField?.hooks
55
65
  }
56
- }
57
- ];
66
+ });
67
+ return fields;
68
+ };
58
69
 
59
70
  //# sourceMappingURL=apiKey.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/auth/baseFields/apiKey.ts"],"sourcesContent":["import crypto from 'crypto'\n\nimport type { Field, FieldHook } from '../../fields/config/types.js'\n\nconst encryptKey: FieldHook = ({ req, value }) =>\n value ? req.payload.encrypt(value as string) : null\nconst decryptKey: FieldHook = ({ req, value }) =>\n value ? req.payload.decrypt(value as string) : undefined\n\nexport const apiKeyFields = [\n {\n name: 'enableAPIKey',\n type: 'checkbox',\n admin: {\n components: {\n Field: false,\n },\n },\n label: ({ t }) => t('authentication:enableAPIKey'),\n },\n {\n name: 'apiKey',\n type: 'text',\n admin: {\n components: {\n Field: false,\n },\n },\n hooks: {\n afterRead: [decryptKey],\n beforeChange: [encryptKey],\n },\n label: ({ t }) => t('authentication:apiKey'),\n },\n {\n name: 'apiKeyIndex',\n type: 'text',\n admin: {\n disabled: true,\n },\n hidden: true,\n hooks: {\n beforeValidate: [\n ({ data, req, value }) => {\n if (data?.apiKey === false || data?.apiKey === null) {\n return null\n }\n if (data?.enableAPIKey === false || data?.enableAPIKey === null) {\n return null\n }\n if (data?.apiKey) {\n return crypto\n .createHmac('sha256', req.payload.secret)\n .update(data.apiKey as string)\n .digest('hex')\n }\n return value\n },\n ],\n },\n },\n] as Field[]\n"],"names":["crypto","encryptKey","req","value","payload","encrypt","decryptKey","decrypt","undefined","apiKeyFields","name","type","admin","components","Field","label","t","hooks","afterRead","beforeChange","disabled","hidden","beforeValidate","data","apiKey","enableAPIKey","createHmac","secret","update","digest"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAI3B,MAAMC,aAAwB,CAAC,EAAEC,GAAG,EAAEC,KAAK,EAAE,GAC3CA,QAAQD,IAAIE,OAAO,CAACC,OAAO,CAACF,SAAmB;AACjD,MAAMG,aAAwB,CAAC,EAAEJ,GAAG,EAAEC,KAAK,EAAE,GAC3CA,QAAQD,IAAIE,OAAO,CAACG,OAAO,CAACJ,SAAmBK;AAEjD,OAAO,MAAMC,eAAe;IAC1B;QACEC,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,YAAY;gBACVC,OAAO;YACT;QACF;QACAC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;IACtB;IACA;QACEN,MAAM;QACNC,MAAM;QACNC,OAAO;YACLC,YAAY;gBACVC,OAAO;YACT;QACF;QACAG,OAAO;YACLC,WAAW;gBAACZ;aAAW;YACvBa,cAAc;gBAAClB;aAAW;QAC5B;QACAc,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;IACtB;IACA;QACEN,MAAM;QACNC,MAAM;QACNC,OAAO;YACLQ,UAAU;QACZ;QACAC,QAAQ;QACRJ,OAAO;YACLK,gBAAgB;gBACd,CAAC,EAAEC,IAAI,EAAErB,GAAG,EAAEC,KAAK,EAAE;oBACnB,IAAIoB,MAAMC,WAAW,SAASD,MAAMC,WAAW,MAAM;wBACnD,OAAO;oBACT;oBACA,IAAID,MAAME,iBAAiB,SAASF,MAAME,iBAAiB,MAAM;wBAC/D,OAAO;oBACT;oBACA,IAAIF,MAAMC,QAAQ;wBAChB,OAAOxB,OACJ0B,UAAU,CAAC,UAAUxB,IAAIE,OAAO,CAACuB,MAAM,EACvCC,MAAM,CAACL,KAAKC,MAAM,EAClBK,MAAM,CAAC;oBACZ;oBACA,OAAO1B;gBACT;aACD;QACH;IACF;CACD,CAAW"}
1
+ {"version":3,"sources":["../../../src/auth/baseFields/apiKey.ts"],"sourcesContent":["import crypto from 'crypto'\n\nimport type { CheckboxField, Field, FieldHook, TextField } from '../../fields/config/types.js'\n\nconst encryptKey: FieldHook = ({ req, value }) =>\n value ? req.payload.encrypt(value as string) : null\nconst decryptKey: FieldHook = ({ req, value }) =>\n value ? req.payload.decrypt(value as string) : undefined\n\ntype APIKeyCheckboxFieldOverride = Omit<Partial<CheckboxField>, 'name' | 'type'>\ntype APIKeyTextFieldOverride = Omit<\n Partial<TextField>,\n 'hasMany' | 'maxRows' | 'minRows' | 'name' | 'type' | 'validate'\n>\n\nexport const createAPIKeyFields = ({\n apiKeyField,\n apiKeyIndexField,\n enableAPIKeyField,\n includeEnableAPIKey = true,\n}: {\n apiKeyField?: APIKeyTextFieldOverride\n apiKeyIndexField?: APIKeyTextFieldOverride\n enableAPIKeyField?: APIKeyCheckboxFieldOverride\n includeEnableAPIKey?: boolean\n} = {}): Field[] => {\n const fields: Field[] = []\n\n if (includeEnableAPIKey) {\n fields.push({\n name: 'enableAPIKey',\n type: 'checkbox',\n ...enableAPIKeyField,\n admin: {\n components: {\n Field: false,\n },\n ...enableAPIKeyField?.admin,\n },\n label: enableAPIKeyField?.label ?? (({ t }) => t('authentication:enableAPIKey')),\n })\n }\n\n fields.push(\n {\n name: 'apiKey',\n type: 'text',\n ...apiKeyField,\n admin: {\n components: {\n Field: false,\n },\n ...apiKeyField?.admin,\n },\n hooks: {\n afterRead: [decryptKey],\n beforeChange: [encryptKey],\n ...apiKeyField?.hooks,\n },\n label: apiKeyField?.label ?? (({ t }) => t('authentication:apiKey')),\n },\n {\n name: 'apiKeyIndex',\n type: 'text',\n ...apiKeyIndexField,\n admin: {\n disabled: true,\n ...apiKeyIndexField?.admin,\n },\n hidden: apiKeyIndexField?.hidden ?? true,\n hooks: {\n beforeValidate: [\n ({ data, req, value }) => {\n if (data?.apiKey === false || data?.apiKey === null || data?.apiKey === '') {\n return null\n }\n if (\n includeEnableAPIKey &&\n (data?.enableAPIKey === false || data?.enableAPIKey === null)\n ) {\n return null\n }\n if (data?.apiKey) {\n return crypto\n .createHmac('sha256', req.payload.secret)\n .update(data.apiKey as string)\n .digest('hex')\n }\n return value\n },\n ],\n ...apiKeyIndexField?.hooks,\n },\n },\n )\n\n return fields\n}\n"],"names":["crypto","encryptKey","req","value","payload","encrypt","decryptKey","decrypt","undefined","createAPIKeyFields","apiKeyField","apiKeyIndexField","enableAPIKeyField","includeEnableAPIKey","fields","push","name","type","admin","components","Field","label","t","hooks","afterRead","beforeChange","disabled","hidden","beforeValidate","data","apiKey","enableAPIKey","createHmac","secret","update","digest"],"mappings":"AAAA,OAAOA,YAAY,SAAQ;AAI3B,MAAMC,aAAwB,CAAC,EAAEC,GAAG,EAAEC,KAAK,EAAE,GAC3CA,QAAQD,IAAIE,OAAO,CAACC,OAAO,CAACF,SAAmB;AACjD,MAAMG,aAAwB,CAAC,EAAEJ,GAAG,EAAEC,KAAK,EAAE,GAC3CA,QAAQD,IAAIE,OAAO,CAACG,OAAO,CAACJ,SAAmBK;AAQjD,OAAO,MAAMC,qBAAqB,CAAC,EACjCC,WAAW,EACXC,gBAAgB,EAChBC,iBAAiB,EACjBC,sBAAsB,IAAI,EAM3B,GAAG,CAAC,CAAC;IACJ,MAAMC,SAAkB,EAAE;IAE1B,IAAID,qBAAqB;QACvBC,OAAOC,IAAI,CAAC;YACVC,MAAM;YACNC,MAAM;YACN,GAAGL,iBAAiB;YACpBM,OAAO;gBACLC,YAAY;oBACVC,OAAO;gBACT;gBACA,GAAGR,mBAAmBM,KAAK;YAC7B;YACAG,OAAOT,mBAAmBS,SAAU,CAAA,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE,8BAA6B;QAChF;IACF;IAEAR,OAAOC,IAAI,CACT;QACEC,MAAM;QACNC,MAAM;QACN,GAAGP,WAAW;QACdQ,OAAO;YACLC,YAAY;gBACVC,OAAO;YACT;YACA,GAAGV,aAAaQ,KAAK;QACvB;QACAK,OAAO;YACLC,WAAW;gBAAClB;aAAW;YACvBmB,cAAc;gBAACxB;aAAW;YAC1B,GAAGS,aAAaa,KAAK;QACvB;QACAF,OAAOX,aAAaW,SAAU,CAAA,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE,wBAAuB;IACpE,GACA;QACEN,MAAM;QACNC,MAAM;QACN,GAAGN,gBAAgB;QACnBO,OAAO;YACLQ,UAAU;YACV,GAAGf,kBAAkBO,KAAK;QAC5B;QACAS,QAAQhB,kBAAkBgB,UAAU;QACpCJ,OAAO;YACLK,gBAAgB;gBACd,CAAC,EAAEC,IAAI,EAAE3B,GAAG,EAAEC,KAAK,EAAE;oBACnB,IAAI0B,MAAMC,WAAW,SAASD,MAAMC,WAAW,QAAQD,MAAMC,WAAW,IAAI;wBAC1E,OAAO;oBACT;oBACA,IACEjB,uBACCgB,CAAAA,MAAME,iBAAiB,SAASF,MAAME,iBAAiB,IAAG,GAC3D;wBACA,OAAO;oBACT;oBACA,IAAIF,MAAMC,QAAQ;wBAChB,OAAO9B,OACJgC,UAAU,CAAC,UAAU9B,IAAIE,OAAO,CAAC6B,MAAM,EACvCC,MAAM,CAACL,KAAKC,MAAM,EAClBK,MAAM,CAAC;oBACZ;oBACA,OAAOhC;gBACT;aACD;YACD,GAAGQ,kBAAkBY,KAAK;QAC5B;IACF;IAGF,OAAOT;AACT,EAAC"}
@@ -1,5 +1,5 @@
1
1
  import { accountLockFields } from './baseFields/accountLock.js';
2
- import { apiKeyFields } from './baseFields/apiKey.js';
2
+ import { createAPIKeyFields } from './baseFields/apiKey.js';
3
3
  import { baseAuthFields } from './baseFields/auth.js';
4
4
  import { emailFieldConfig } from './baseFields/email.js';
5
5
  import { sessionsFieldConfig } from './baseFields/sessions.js';
@@ -8,7 +8,7 @@ import { verificationFields } from './baseFields/verification.js';
8
8
  export const getBaseAuthFields = (authConfig)=>{
9
9
  const authFields = [];
10
10
  if (authConfig.useAPIKey) {
11
- authFields.push(...apiKeyFields);
11
+ authFields.push(...createAPIKeyFields());
12
12
  }
13
13
  if (!authConfig.disableLocalStrategy || typeof authConfig.disableLocalStrategy === 'object' && authConfig.disableLocalStrategy.enableFields) {
14
14
  const emailField = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/auth/getAuthFields.ts"],"sourcesContent":["import type { Field, TextField } from '../fields/config/types.js'\nimport type { IncomingAuthType } from './types.js'\n\nimport { accountLockFields } from './baseFields/accountLock.js'\nimport { apiKeyFields } from './baseFields/apiKey.js'\nimport { baseAuthFields } from './baseFields/auth.js'\nimport { emailFieldConfig } from './baseFields/email.js'\nimport { sessionsFieldConfig } from './baseFields/sessions.js'\nimport { usernameFieldConfig } from './baseFields/username.js'\nimport { verificationFields } from './baseFields/verification.js'\n\nexport const getBaseAuthFields = (authConfig: IncomingAuthType): Field[] => {\n const authFields: Field[] = []\n\n if (authConfig.useAPIKey) {\n authFields.push(...apiKeyFields)\n }\n\n if (\n !authConfig.disableLocalStrategy ||\n (typeof authConfig.disableLocalStrategy === 'object' &&\n authConfig.disableLocalStrategy.enableFields)\n ) {\n const emailField = { ...emailFieldConfig }\n let usernameField: TextField | undefined\n\n if (authConfig.loginWithUsername) {\n usernameField = { ...usernameFieldConfig }\n if (typeof authConfig.loginWithUsername === 'object') {\n if (authConfig.loginWithUsername.requireEmail === false) {\n emailField.required = false\n }\n if (authConfig.loginWithUsername.requireUsername === false) {\n usernameField.required = false\n }\n if (authConfig.loginWithUsername.allowEmailLogin === false) {\n emailField.unique = false\n }\n }\n }\n\n authFields.push(emailField)\n if (usernameField) {\n authFields.push(usernameField)\n }\n\n authFields.push(...baseAuthFields)\n\n if (authConfig.verify) {\n authFields.push(...verificationFields)\n }\n\n if (authConfig?.maxLoginAttempts && authConfig.maxLoginAttempts > 0) {\n authFields.push(...accountLockFields)\n }\n\n if (authConfig.useSessions) {\n authFields.push(sessionsFieldConfig)\n }\n }\n\n return authFields\n}\n"],"names":["accountLockFields","apiKeyFields","baseAuthFields","emailFieldConfig","sessionsFieldConfig","usernameFieldConfig","verificationFields","getBaseAuthFields","authConfig","authFields","useAPIKey","push","disableLocalStrategy","enableFields","emailField","usernameField","loginWithUsername","requireEmail","required","requireUsername","allowEmailLogin","unique","verify","maxLoginAttempts","useSessions"],"mappings":"AAGA,SAASA,iBAAiB,QAAQ,8BAA6B;AAC/D,SAASC,YAAY,QAAQ,yBAAwB;AACrD,SAASC,cAAc,QA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T,EAAC"}
1
+ {"version":3,"sources":["../../src/auth/getAuthFields.ts"],"sourcesContent":["import type { Field, TextField } from '../fields/config/types.js'\nimport type { IncomingAuthType } from './types.js'\n\nimport { accountLockFields } from './baseFields/accountLock.js'\nimport { createAPIKeyFields } from './baseFields/apiKey.js'\nimport { baseAuthFields } from './baseFields/auth.js'\nimport { emailFieldConfig } from './baseFields/email.js'\nimport { sessionsFieldConfig } from './baseFields/sessions.js'\nimport { usernameFieldConfig } from './baseFields/username.js'\nimport { verificationFields } from './baseFields/verification.js'\n\nexport const getBaseAuthFields = (authConfig: IncomingAuthType): Field[] => {\n const authFields: Field[] = []\n\n if (authConfig.useAPIKey) {\n authFields.push(...createAPIKeyFields())\n }\n\n if (\n !authConfig.disableLocalStrategy ||\n (typeof authConfig.disableLocalStrategy === 'object' &&\n authConfig.disableLocalStrategy.enableFields)\n ) {\n const emailField = { ...emailFieldConfig }\n let usernameField: TextField | undefined\n\n if (authConfig.loginWithUsername) {\n usernameField = { ...usernameFieldConfig }\n if (typeof authConfig.loginWithUsername === 'object') {\n if (authConfig.loginWithUsername.requireEmail === false) {\n emailField.required = false\n }\n if (authConfig.loginWithUsername.requireUsername === false) {\n usernameField.required = false\n }\n if (authConfig.loginWithUsername.allowEmailLogin === false) {\n emailField.unique = false\n }\n }\n }\n\n authFields.push(emailField)\n if (usernameField) {\n authFields.push(usernameField)\n }\n\n authFields.push(...baseAuthFields)\n\n if (authConfig.verify) {\n authFields.push(...verificationFields)\n }\n\n if (authConfig?.maxLoginAttempts && authConfig.maxLoginAttempts > 0) {\n authFields.push(...accountLockFields)\n }\n\n if (authConfig.useSessions) {\n authFields.push(sessionsFieldConfig)\n }\n }\n\n return authFields\n}\n"],"names":["accountLockFields","createAPIKeyFields","baseAuthFields","emailFieldConfig","sessionsFieldConfig","usernameFieldConfig","verificationFields","getBaseAuthFields","authConfig","authFields","useAPIKey","push","disableLocalStrategy","enableFields","emailField","usernameField","loginWithUsername","requireEmail","required","requireUsername","allow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,GAAG,GAAG;YACnEd,WAAWE,IAAI,IAAIX;QACrB;QAEA,IAAIQ,WAAWgB,WAAW,EAAE;YAC1Bf,WAAWE,IAAI,CAACP;QAClB;IACF;IAEA,OAAOK;AACT,EAAC"}
@@ -1,4 +1,4 @@
1
- import type { SanitizedPermissions, TypedUser } from '../../index.js';
1
+ import type { AuthenticatedUser, SanitizedPermissions } from '../../index.js';
2
2
  import type { PayloadRequest } from '../../types/index.js';
3
3
  export type AuthArgs = {
4
4
  /**
@@ -11,7 +11,7 @@ export type AuthArgs = {
11
11
  export type AuthResult = {
12
12
  permissions: SanitizedPermissions;
13
13
  responseHeaders?: Headers;
14
- user: null | TypedUser;
14
+ user: AuthenticatedUser | null;
15
15
  };
16
16
  export declare const auth: (args: Required<AuthArgs>) => Promise<AuthResult>;
17
17
  //# sourceMappingURL=auth.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAM1D,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC3B,GAAG,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,oBAAoB,CAAA;IACjC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,IAAI,EAAE,IAAI,GAAG,SAAS,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,IAAI,GAAU,MAAM,QAAQ,CAAC,QAAQ,CAAC,KAAG,OAAO,CAAC,UAAU,CA4BvE,CAAA"}
1
+ {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/auth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAM1D,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAA;IAC3B,GAAG,CAAC,EAAE,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,EAAE,oBAAoB,CAAA;IACjC,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,IAAI,GAAU,MAAM,QAAQ,CAAC,QAAQ,CAAC,KAAG,OAAO,CAAC,UAAU,CA4BvE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/auth/operations/auth.ts"],"sourcesContent":["import type { SanitizedPermissions, TypedUser } from '../../index.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { executeAuthStrategies } from '../executeAuthStrategies.js'\nimport { getAccessResults } from '../getAccessResults.js'\n\nexport type AuthArgs = {\n /**\n * Specify if it's possible for auth strategies to set headers within this operation.\n */\n canSetHeaders?: boolean\n headers: Request['headers']\n req?: Omit<PayloadRequest, 'user'>\n}\n\nexport type AuthResult = {\n permissions: SanitizedPermissions\n responseHeaders?: Headers\n user: null | TypedUser\n}\n\nexport const auth = async (args: Required<AuthArgs>): Promise<AuthResult> => {\n const { canSetHeaders, headers } = args\n const req = args.req as PayloadRequest\n const { payload } = req\n\n try {\n const { responseHeaders, user } = await executeAuthStrategies({\n canSetHeaders,\n headers,\n payload,\n })\n\n req.user = user\n req.responseHeaders = responseHeaders\n\n const permissions = await getAccessResults({\n req,\n })\n\n return {\n permissions,\n responseHeaders,\n user,\n }\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["killTransaction","executeAuthStrategies","getAccessResults","auth","args","canSetHeaders","headers","req","payload","responseHeaders","user","permissions","error"],"mappings":"AAGA,SAASA,eAAe,QAAQ,qCAAoC;AACpE,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,gBAAgB,QAAQ,yBAAwB;AAiBzD,OAAO,MAAMC,OAAO,OAAOC;IACzB,MAAM,EAAEC,aAAa,EAAEC,OAAO,EAAE,GAAGF;IACnC,MAAMG,MAAMH,KAAKG,GAAG;IACpB,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAEpB,IAAI;QACF,MAAM,EAAEE,eAAe,EAAEC,IAAI,EAAE,GAAG,MAAMT,sBAAsB;YAC5DI;YACAC;YACAE;QACF;QAEAD,IAAIG,IAAI,GAAGA;QACXH,IAAIE,eAAe,GAAGA;QAEtB,MAAME,cAAc,MAAMT,iBAAiB;YACzCK;QACF;QAEA,OAAO;YACLI;YACAF;YACAC;QACF;IACF,EAAE,OAAOE,OAAgB;QACvB,MAAMZ,gBAAgBO;QACtB,MAAMK;IACR;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/auth/operations/auth.ts"],"sourcesContent":["import type { AuthenticatedUser, SanitizedPermissions } from '../../index.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { executeAuthStrategies } from '../executeAuthStrategies.js'\nimport { getAccessResults } from '../getAccessResults.js'\n\nexport type AuthArgs = {\n /**\n * Specify if it's possible for auth strategies to set headers within this operation.\n */\n canSetHeaders?: boolean\n headers: Request['headers']\n req?: Omit<PayloadRequest, 'user'>\n}\n\nexport type AuthResult = {\n permissions: SanitizedPermissions\n responseHeaders?: Headers\n user: AuthenticatedUser | null\n}\n\nexport const auth = async (args: Required<AuthArgs>): Promise<AuthResult> => {\n const { canSetHeaders, headers } = args\n const req = args.req as PayloadRequest\n const { payload } = req\n\n try {\n const { responseHeaders, user } = await executeAuthStrategies({\n canSetHeaders,\n headers,\n payload,\n })\n\n req.user = user\n req.responseHeaders = responseHeaders\n\n const permissions = await getAccessResults({\n req,\n })\n\n return {\n permissions,\n responseHeaders,\n user,\n }\n } catch (error: unknown) {\n await killTransaction(req)\n throw error\n }\n}\n"],"names":["killTransaction","executeAuthStrategies","getAccessResults","auth","args","canSetHeaders","headers","req","payload","responseHeaders","user","permissions","error"],"mappings":"AAGA,SAASA,eAAe,QAAQ,qCAAoC;AACpE,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,gBAAgB,QAAQ,yBAAwB;AAiBzD,OAAO,MAAMC,OAAO,OAAOC;IACzB,MAAM,EAAEC,aAAa,EAAEC,OAAO,EAAE,GAAGF;IACnC,MAAMG,MAAMH,KAAKG,GAAG;IACpB,MAAM,EAAEC,OAAO,EAAE,GAAGD;IAEpB,IAAI;QACF,MAAM,EAAEE,eAAe,EAAEC,IAAI,EAAE,GAAG,MAAMT,sBAAsB;YAC5DI;YACAC;YACAE;QACF;QAEAD,IAAIG,IAAI,GAAGA;QACXH,IAAIE,eAAe,GAAGA;QAEtB,MAAME,cAAc,MAAMT,iBAAiB;YACzCK;QACF;QAEA,OAAO;YACLI;YACAF;YACAC;QACF;IACF,EAAE,OAAOE,OAAgB;QACvB,MAAMZ,gBAAgBO;QACtB,MAAMK;IACR;AACF,EAAC"}
@@ -1,10 +1,11 @@
1
1
  import type { AuthOperationsFromCollectionSlug, Collection, DataFromCollectionSlug } from '../../collections/config/types.js';
2
2
  import type { AuthCollectionSlug } from '../../index.js';
3
3
  import type { PayloadRequest } from '../../types/index.js';
4
+ import type { AuthRuntimeFields } from '../types.js';
4
5
  export type LoginResult<TSlug extends AuthCollectionSlug> = {
5
6
  exp?: number;
6
7
  token?: string;
7
- user?: DataFromCollectionSlug<TSlug>;
8
+ user?: AuthRuntimeFields & DataFromCollectionSlug<TSlug>;
8
9
  };
9
10
  export type Arguments<TSlug extends AuthCollectionSlug> = {
10
11
  collection: Collection;
@@ -1 +1 @@
1
- {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/auth/operations/login.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gCAAgC,EAChC,UAAU,EACV,sBAAsB,EACvB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAa,MAAM,gBAAgB,CAAA;AACnE,OAAO,KAAK,EAAE,cAAc,EAAS,MAAM,sBAAsB,CAAA;AAwBjE,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,kBAAkB,IAAI;IAC1D,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAA;CACrC,CAAA;AAED,MAAM,MAAM,SAAS,CAAC,KAAK,SAAS,kBAAkB,IAAI;IACxD,UAAU,EAAE,UAAU,CAAA;IACtB,IAAI,EAAE,gCAAgC,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAA;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,KAAK,wBAAwB,CAAC,KAAK,SAAS,kBAAkB,IAAI;IAChE,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAA;CACpC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,SAAS,kBAAkB,EAAE,uCAIpE,wBAAwB,CAAC,KAAK,CAAC,SAQjC,CAAA;AAED,eAAO,MAAM,cAAc,GAAU,KAA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BAAwB,CAAC,KAAK,CAAC,SAQjC,CAAA;AAED,eAAO,MAAM,cAAc,GAAU,KAAK,SAAS,kBAAkB,EACnE,cAAc,SAAS,CAAC,KAAK,CAAC,KAC7B,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CA+V5B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/auth/operations/login.ts"],"sourcesContent":["import type {\n AuthOperationsFromCollectionSlug,\n Collection,\n DataFromCollectionSlug,\n} from '../../collections/config/types.js'\nimport type { AuthCollectionSlug, TypedUser } from '../../index.js'\nimport type { PayloadRequest, Where } from '../../types/index.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utilities/buildAfterOperation.js'\nimport { buildBeforeOperation } from '../../collections/operations/utilities/buildBeforeOperation.js'\nimport {\n AuthenticationError,\n LockedAuth,\n UnverifiedEmail,\n ValidationError,\n} from '../../errors/index.js'\nimport { afterRead } from '../../fields/hooks/afterRead/index.js'\nimport { commitTransaction, Forbidden, initTransaction } from '../../index.js'\nimport { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { sanitizeInternalFields } from '../../utilities/sanitizeInternalFields.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\nimport { getLoginOptions } from '../getLoginOptions.js'\nimport { isUserLocked } from '../isUserLocked.js'\nimport { jwtSign } from '../jwt.js'\nimport { addSessionToUser, revokeSession } from '../sessions.js'\nimport { authenticateLocalStrategy } from '../strategies/local/authenticate.js'\nimport { incrementLoginAttempts } from '../strategies/local/incrementLoginAttempts.js'\nimport { resetLoginAttempts } from '../strategies/local/resetLoginAttempts.js'\n\nexport type LoginResult<TSlug extends AuthCollectionSlug> = {\n exp?: number\n token?: string\n user?: DataFromCollectionSlug<TSlug>\n}\n\nexport type Arguments<TSlug extends AuthCollectionSlug> = {\n collection: Collection\n data: AuthOperationsFromCollectionSlug<TSlug>['login']\n depth?: number\n overrideAccess?: boolean\n req: PayloadRequest\n showHiddenFields?: boolean\n}\n\ntype CheckLoginPermissionArgs<TSlug extends AuthCollectionSlug> = {\n loggingInWithUsername?: boolean\n req: PayloadRequest\n user: DataFromCollectionSlug<TSlug>\n}\n\n/**\n * Throws an error if the user is locked or does not exist.\n * This does not check the login attempts, only the lock status. Whoever increments login attempts\n * is responsible for locking the user properly, not whoever checks the login permission.\n */\nexport const checkLoginPermission = <TSlug extends AuthCollectionSlug>({\n loggingInWithUsername,\n req,\n user,\n}: CheckLoginPermissionArgs<TSlug>) => {\n if (!user) {\n throw new AuthenticationError(req.t, Boolean(loggingInWithUsername))\n }\n\n if (isUserLocked(new Date(user.lockUntil))) {\n throw new LockedAuth(req.t)\n }\n}\n\nexport const loginOperation = async <TSlug extends AuthCollectionSlug>(\n incomingArgs: Arguments<TSlug>,\n): Promise<LoginResult<TSlug>> => {\n let args = incomingArgs\n\n if (args.collection.config.auth.disableLocalStrategy) {\n throw new Forbidden(args.req.t)\n }\n\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n args = await buildBeforeOperation({\n args,\n collection: args.collection.config,\n operation: 'login',\n overrideAccess: args.overrideAccess!,\n })\n\n const {\n collection: { config: collectionConfig },\n data,\n depth,\n overrideAccess = false,\n req,\n req: {\n fallbackLocale,\n locale,\n payload,\n payload: { secret },\n },\n showHiddenFields,\n } = args\n\n // /////////////////////////////////////\n // Login\n // /////////////////////////////////////\n\n const { email: unsanitizedEmail, password } = data\n const loginWithUsername = collectionConfig.auth.loginWithUsername\n\n const sanitizedEmail =\n typeof unsanitizedEmail === 'string' ? unsanitizedEmail.toLowerCase().trim() : null\n const sanitizedUsername =\n 'username' in data && typeof data?.username === 'string'\n ? data.username.toLowerCase().trim()\n : null\n\n const { canLoginWithEmail, canLoginWithUsername } = getLoginOptions(loginWithUsername)\n\n // cannot login with email, did not provide username\n if (!canLoginWithEmail && !sanitizedUsername) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ message: req.i18n.t('validation:required'), path: 'username' }],\n })\n }\n\n // cannot login with username, did not provide email\n if (!canLoginWithUsername && !sanitizedEmail) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ message: req.i18n.t('validation:required'), path: 'email' }],\n })\n }\n\n // can login with either email or username, did not provide either\n if (!sanitizedUsername && !sanitizedEmail) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [\n { message: req.i18n.t('validation:required'), path: 'email' },\n { message: req.i18n.t('validation:required'), path: 'username' },\n ],\n })\n }\n\n // did not provide password for login\n if (typeof password !== 'string' || password.trim() === '') {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ message: req.i18n.t('validation:required'), path: 'password' }],\n })\n }\n\n let whereConstraint: Where = {}\n const emailConstraint: Where = {\n email: {\n equals: sanitizedEmail,\n },\n }\n const usernameConstraint: Where = {\n username: {\n equals: sanitizedUsername,\n },\n }\n\n if (canLoginWithEmail && canLoginWithUsername && (sanitizedUsername || sanitizedEmail)) {\n if (sanitizedUsername) {\n whereConstraint = {\n or: [\n usernameConstraint,\n {\n email: {\n equals: sanitizedUsername,\n },\n },\n ],\n }\n } else {\n whereConstraint = {\n or: [\n emailConstraint,\n {\n username: {\n equals: sanitizedEmail,\n },\n },\n ],\n }\n }\n } else if (canLoginWithEmail && sanitizedEmail) {\n whereConstraint = emailConstraint\n } else if (canLoginWithUsername && sanitizedUsername) {\n whereConstraint = usernameConstraint\n }\n\n // Exclude trashed users\n whereConstraint = appendNonTrashedFilter({\n enableTrash: collectionConfig.trash,\n trash: false,\n where: whereConstraint,\n })\n\n let user = (await payload.db.findOne<TypedUser>({\n collection: collectionConfig.slug,\n req,\n where: whereConstraint,\n })) as TypedUser\n\n checkLoginPermission({\n loggingInWithUsername: Boolean(canLoginWithUsername && sanitizedUsername),\n req,\n user,\n })\n\n user.collection = collectionConfig.slug\n user._strategy = 'local-jwt'\n\n const authResult = await authenticateLocalStrategy({ doc: user, password })\n user = sanitizeInternalFields(user)\n\n const maxLoginAttemptsEnabled = args.collection.config.auth.maxLoginAttempts > 0\n\n if (!authResult) {\n if (maxLoginAttemptsEnabled) {\n await incrementLoginAttempts({\n collection: collectionConfig,\n payload: req.payload,\n user,\n })\n\n // Re-check login permissions and max attempts after incrementing attempts, in case parallel updates occurred\n checkLoginPermission({\n loggingInWithUsername: Boolean(canLoginWithUsername && sanitizedUsername),\n req,\n user,\n })\n }\n\n throw new AuthenticationError(req.t)\n }\n\n if (collectionConfig.auth.verify && user._verified === false) {\n throw new UnverifiedEmail({ t: req.t })\n }\n\n // Authentication successful - start transaction for remaining operations\n const shouldCommit = await initTransaction(args.req)\n let sid: string | undefined\n\n try {\n /*\n * Correct password accepted - re‑check that the account didn't\n * get locked by parallel bad attempts in the meantime.\n */\n if (maxLoginAttemptsEnabled) {\n const { lockUntil, loginAttempts } = (await payload.db.findOne<TypedUser>({\n collection: collectionConfig.slug,\n req,\n select: {\n lockUntil: true,\n loginAttempts: true,\n },\n where: { id: { equals: user.id } },\n }))!\n\n user.lockUntil = lockUntil\n user.loginAttempts = loginAttempts\n\n checkLoginPermission({\n req,\n user,\n })\n }\n\n const fieldsToSignArgs: Parameters<typeof getFieldsToSign>[0] = {\n collectionConfig,\n email: sanitizedEmail!,\n user,\n }\n\n const session = await addSessionToUser({\n collectionConfig,\n payload,\n req,\n user,\n })\n sid = session.sid\n\n if (sid) {\n fieldsToSignArgs.sid = sid\n }\n\n const fieldsToSign = getFieldsToSign(fieldsToSignArgs)\n\n if (maxLoginAttemptsEnabled) {\n await resetLoginAttempts({\n collection: collectionConfig,\n doc: user,\n payload: req.payload,\n req,\n })\n }\n\n // /////////////////////////////////////\n // beforeLogin - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.beforeLogin?.length) {\n for (const hook of collectionConfig.hooks.beforeLogin) {\n user =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n req: args.req,\n user,\n })) || user\n }\n }\n\n const { exp, token } = await jwtSign({\n fieldsToSign,\n secret,\n tokenExpiration: collectionConfig.auth.tokenExpiration,\n })\n\n req.user = user\n\n // /////////////////////////////////////\n // afterLogin - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.afterLogin?.length) {\n for (const hook of collectionConfig.hooks.afterLogin) {\n user =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n req: args.req,\n token,\n user,\n })) || user\n }\n }\n\n // /////////////////////////////////////\n // afterRead - Fields\n // /////////////////////////////////////\n\n user = await afterRead({\n collection: collectionConfig,\n context: req.context,\n depth: depth!,\n doc: user,\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n draft: undefined,\n fallbackLocale: fallbackLocale!,\n global: null,\n locale: locale!,\n overrideAccess,\n req,\n showHiddenFields: showHiddenFields!,\n })\n\n // /////////////////////////////////////\n // afterRead - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.afterRead?.length) {\n for (const hook of collectionConfig.hooks.afterRead) {\n user =\n (await hook({\n collection: args.collection?.config,\n context: req.context,\n doc: user,\n overrideAccess,\n req,\n })) || user\n }\n }\n\n let result: LoginResult<TSlug> = {\n exp,\n token,\n user,\n }\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'login',\n overrideAccess: args.overrideAccess!,\n result,\n })\n\n if (shouldCommit) {\n await commitTransaction(req)\n }\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n return result\n } catch (error: unknown) {\n if (sid) {\n await revokeSession({\n collectionConfig,\n payload,\n req,\n sid,\n user,\n })\n }\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["buildAfterOperation","buildBeforeOperation","AuthenticationError","LockedAuth","UnverifiedEmail","ValidationError","afterRead","commitTransaction","Forbidden","initTransaction","appendNonTrashedFilter","killTransaction","sanitizeInternalFields","getFieldsToSign","getLoginOptions","isUserLocked","jwtSign","addSessionToUser","revokeSession","authenticateLocalStrategy","incrementLoginAttempts","resetLoginAttempts","checkLoginPermission","loggingInWithUsername","req","user","t","Boolean","Date","lockUntil","loginOperation","incomingArgs","args","collection","config","auth","disableLocalStrategy","operation","overrideAccess","collectionConfig","data","depth","fallbackLocale","locale","payload","secret","showHiddenFields","email","unsanitizedEmail","password","loginWithUsername","sanitizedEmail","toLowerCase","trim","sanitizedUsername","username","canLoginWithEmail","canLoginWithUsername","slug","errors","message","i18n","path","whereConstraint","emailConstraint","equals","usernameConstraint","or","enableTrash","trash","where","db","findOne","_strategy","authResult","doc","maxLoginAttemptsEnabled","maxLoginAttempts","verify","_verified","shouldCommit","sid","loginAttempts","select","id","fieldsToSignArgs","session","fieldsToSign","hooks","beforeLogin","length","hook","context","exp","token","tokenExpiration","afterLogin","draft","undefined","global","result","error"],"mappings":"AAQA,SAASA,mBAAmB,QAAQ,gEAA+D;AACnG,SAASC,oBAAoB,QAAQ,iEAAgE;AACrG,SACEC,mBAAmB,EACnBC,UAAU,EACVC,eAAe,EACfC,eAAe,QACV,wBAAuB;AAC9B,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,iBAAiB,EAAEC,SAAS,EAAEC,eAAe,QAAQ,iBAAgB;AAC9E,SAASC,sBAAsB,QAAQ,4CAA2C;AAClF,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,sBAAsB,QAAQ,4CAA2C;AAClF,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,YAAY,QAAQ,qBAAoB;AACjD,SAASC,OAAO,QAAQ,YAAW;AACnC,SAASC,gBAAgB,EAAEC,aAAa,QAAQ,iBAAgB;AAChE,SAASC,yBAAyB,QAAQ,sCAAqC;AAC/E,SAASC,sBAAsB,QAAQ,gDAA+C;AACtF,SAASC,kBAAkB,QAAQ,4CAA2C;AAuB9E;;;;CAIC,GACD,OAAO,MAAMC,uBAAuB,CAAmC,EACrEC,qBAAqB,EACrBC,GAAG,EACHC,IAAI,EAC4B;IAChC,IAA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G,oBAAoB;YACjCgC;YACAC,YAAYD,KAAKC,UAAU,EAAEC;YAC7BG,WAAW;YACXC,gBAAgBN,KAAKM,cAAc;YACnC8D;QACF;QAEA,IAAIpB,cAAc;YAChB,MAAMzE,kBAAkBiB;QAC1B;QAEA,wCAAwC;QACxC,iBAAiB;QACjB,wCAAwC;QAExC,OAAO4E;IACT,EAAE,OAAOC,OAAgB;QACvB,IAAIpB,KAAK;YACP,MAAM/D,cAAc;gBAClBqB;gBACAK;gBACApB;gBACAyD;gBACAxD;YACF;QACF;QACA,MAAMd,gBAAgBqB,KAAKR,GAAG;QAC9B,MAAM6E;IACR;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../src/auth/operations/login.ts"],"sourcesContent":["import type {\n AuthOperationsFromCollectionSlug,\n Collection,\n DataFromCollectionSlug,\n} from '../../collections/config/types.js'\nimport type { AuthCollectionSlug, AuthenticatedUser, User } from '../../index.js'\nimport type { PayloadRequest, Where } from '../../types/index.js'\nimport type { AuthRuntimeFields } from '../types.js'\n\nimport { buildAfterOperation } from '../../collections/operations/utilities/buildAfterOperation.js'\nimport { buildBeforeOperation } from '../../collections/operations/utilities/buildBeforeOperation.js'\nimport {\n AuthenticationError,\n LockedAuth,\n UnverifiedEmail,\n ValidationError,\n} from '../../errors/index.js'\nimport { afterRead } from '../../fields/hooks/afterRead/index.js'\nimport { commitTransaction, Forbidden, initTransaction } from '../../index.js'\nimport { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js'\nimport { killTransaction } from '../../utilities/killTransaction.js'\nimport { sanitizeInternalFields } from '../../utilities/sanitizeInternalFields.js'\nimport { getFieldsToSign } from '../getFieldsToSign.js'\nimport { getLoginOptions } from '../getLoginOptions.js'\nimport { isUserLocked } from '../isUserLocked.js'\nimport { jwtSign } from '../jwt.js'\nimport { addSessionToUser, revokeSession } from '../sessions.js'\nimport { authenticateLocalStrategy } from '../strategies/local/authenticate.js'\nimport { incrementLoginAttempts } from '../strategies/local/incrementLoginAttempts.js'\nimport { resetLoginAttempts } from '../strategies/local/resetLoginAttempts.js'\n\nexport type LoginResult<TSlug extends AuthCollectionSlug> = {\n exp?: number\n token?: string\n user?: AuthRuntimeFields & DataFromCollectionSlug<TSlug>\n}\n\nexport type Arguments<TSlug extends AuthCollectionSlug> = {\n collection: Collection\n data: AuthOperationsFromCollectionSlug<TSlug>['login']\n depth?: number\n overrideAccess?: boolean\n req: PayloadRequest\n showHiddenFields?: boolean\n}\n\ntype CheckLoginPermissionArgs<TSlug extends AuthCollectionSlug> = {\n loggingInWithUsername?: boolean\n req: PayloadRequest\n user: DataFromCollectionSlug<TSlug>\n}\n\n/**\n * Throws an error if the user is locked or does not exist.\n * This does not check the login attempts, only the lock status. Whoever increments login attempts\n * is responsible for locking the user properly, not whoever checks the login permission.\n */\nexport const checkLoginPermission = <TSlug extends AuthCollectionSlug>({\n loggingInWithUsername,\n req,\n user,\n}: CheckLoginPermissionArgs<TSlug>) => {\n if (!user) {\n throw new AuthenticationError(req.t, Boolean(loggingInWithUsername))\n }\n\n if (isUserLocked(new Date(user.lockUntil))) {\n throw new LockedAuth(req.t)\n }\n}\n\nexport const loginOperation = async <TSlug extends AuthCollectionSlug>(\n incomingArgs: Arguments<TSlug>,\n): Promise<LoginResult<TSlug>> => {\n let args = incomingArgs\n\n if (args.collection.config.auth.disableLocalStrategy) {\n throw new Forbidden(args.req.t)\n }\n\n // /////////////////////////////////////\n // beforeOperation - Collection\n // /////////////////////////////////////\n\n args = await buildBeforeOperation({\n args,\n collection: args.collection.config,\n operation: 'login',\n overrideAccess: args.overrideAccess!,\n })\n\n const {\n collection: { config: collectionConfig },\n data,\n depth,\n overrideAccess = false,\n req,\n req: {\n fallbackLocale,\n locale,\n payload,\n payload: { secret },\n },\n showHiddenFields,\n } = args\n\n // /////////////////////////////////////\n // Login\n // /////////////////////////////////////\n\n const { email: unsanitizedEmail, password } = data\n const loginWithUsername = collectionConfig.auth.loginWithUsername\n\n const sanitizedEmail =\n typeof unsanitizedEmail === 'string' ? unsanitizedEmail.toLowerCase().trim() : null\n const sanitizedUsername =\n 'username' in data && typeof data?.username === 'string'\n ? data.username.toLowerCase().trim()\n : null\n\n const { canLoginWithEmail, canLoginWithUsername } = getLoginOptions(loginWithUsername)\n\n // cannot login with email, did not provide username\n if (!canLoginWithEmail && !sanitizedUsername) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ message: req.i18n.t('validation:required'), path: 'username' }],\n })\n }\n\n // cannot login with username, did not provide email\n if (!canLoginWithUsername && !sanitizedEmail) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ message: req.i18n.t('validation:required'), path: 'email' }],\n })\n }\n\n // can login with either email or username, did not provide either\n if (!sanitizedUsername && !sanitizedEmail) {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [\n { message: req.i18n.t('validation:required'), path: 'email' },\n { message: req.i18n.t('validation:required'), path: 'username' },\n ],\n })\n }\n\n // did not provide password for login\n if (typeof password !== 'string' || password.trim() === '') {\n throw new ValidationError({\n collection: collectionConfig.slug,\n errors: [{ message: req.i18n.t('validation:required'), path: 'password' }],\n })\n }\n\n let whereConstraint: Where = {}\n const emailConstraint: Where = {\n email: {\n equals: sanitizedEmail,\n },\n }\n const usernameConstraint: Where = {\n username: {\n equals: sanitizedUsername,\n },\n }\n\n if (canLoginWithEmail && canLoginWithUsername && (sanitizedUsername || sanitizedEmail)) {\n if (sanitizedUsername) {\n whereConstraint = {\n or: [\n usernameConstraint,\n {\n email: {\n equals: sanitizedUsername,\n },\n },\n ],\n }\n } else {\n whereConstraint = {\n or: [\n emailConstraint,\n {\n username: {\n equals: sanitizedEmail,\n },\n },\n ],\n }\n }\n } else if (canLoginWithEmail && sanitizedEmail) {\n whereConstraint = emailConstraint\n } else if (canLoginWithUsername && sanitizedUsername) {\n whereConstraint = usernameConstraint\n }\n\n // Exclude trashed users\n whereConstraint = appendNonTrashedFilter({\n enableTrash: collectionConfig.trash,\n trash: false,\n where: whereConstraint,\n })\n\n let user = (await payload.db.findOne<User>({\n collection: collectionConfig.slug,\n req,\n where: whereConstraint,\n })) as AuthenticatedUser\n\n checkLoginPermission({\n loggingInWithUsername: Boolean(canLoginWithUsername && sanitizedUsername),\n req,\n user,\n })\n\n user.collection = collectionConfig.slug\n user._strategy = 'local-jwt'\n\n const authResult = await authenticateLocalStrategy({ doc: user, password })\n user = sanitizeInternalFields(user)\n\n const maxLoginAttemptsEnabled = args.collection.config.auth.maxLoginAttempts > 0\n\n if (!authResult) {\n if (maxLoginAttemptsEnabled) {\n await incrementLoginAttempts({\n collection: collectionConfig,\n payload: req.payload,\n user,\n })\n\n // Re-check login permissions and max attempts after incrementing attempts, in case parallel updates occurred\n checkLoginPermission({\n loggingInWithUsername: Boolean(canLoginWithUsername && sanitizedUsername),\n req,\n user,\n })\n }\n\n throw new AuthenticationError(req.t)\n }\n\n if (collectionConfig.auth.verify && user._verified === false) {\n throw new UnverifiedEmail({ t: req.t })\n }\n\n // Authentication successful - start transaction for remaining operations\n const shouldCommit = await initTransaction(args.req)\n let sid: string | undefined\n\n try {\n /*\n * Correct password accepted - re‑check that the account didn't\n * get locked by parallel bad attempts in the meantime.\n */\n if (maxLoginAttemptsEnabled) {\n const { lockUntil, loginAttempts } = (await payload.db.findOne<User>({\n collection: collectionConfig.slug,\n req,\n select: {\n lockUntil: true,\n loginAttempts: true,\n },\n where: { id: { equals: user.id } },\n }))!\n\n user.lockUntil = lockUntil\n user.loginAttempts = loginAttempts\n\n checkLoginPermission({\n req,\n user,\n })\n }\n\n const fieldsToSignArgs: Parameters<typeof getFieldsToSign>[0] = {\n collectionConfig,\n email: sanitizedEmail!,\n user,\n }\n\n const session = await addSessionToUser({\n collectionConfig,\n payload,\n req,\n user,\n })\n sid = session.sid\n\n if (sid) {\n fieldsToSignArgs.sid = sid\n }\n\n const fieldsToSign = getFieldsToSign(fieldsToSignArgs)\n\n if (maxLoginAttemptsEnabled) {\n await resetLoginAttempts({\n collection: collectionConfig,\n doc: user,\n payload: req.payload,\n req,\n })\n }\n\n // /////////////////////////////////////\n // beforeLogin - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.beforeLogin?.length) {\n for (const hook of collectionConfig.hooks.beforeLogin) {\n user =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n req: args.req,\n user,\n })) || user\n }\n }\n\n const { exp, token } = await jwtSign({\n fieldsToSign,\n secret,\n tokenExpiration: collectionConfig.auth.tokenExpiration,\n })\n\n req.user = user\n\n // /////////////////////////////////////\n // afterLogin - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.afterLogin?.length) {\n for (const hook of collectionConfig.hooks.afterLogin) {\n user =\n (await hook({\n collection: args.collection?.config,\n context: args.req.context,\n req: args.req,\n token,\n user,\n })) || user\n }\n }\n\n // /////////////////////////////////////\n // afterRead - Fields\n // /////////////////////////////////////\n\n user = await afterRead({\n collection: collectionConfig,\n context: req.context,\n depth: depth!,\n doc: user,\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n draft: undefined,\n fallbackLocale: fallbackLocale!,\n global: null,\n locale: locale!,\n overrideAccess,\n req,\n showHiddenFields: showHiddenFields!,\n })\n\n // /////////////////////////////////////\n // afterRead - Collection\n // /////////////////////////////////////\n\n if (collectionConfig.hooks?.afterRead?.length) {\n for (const hook of collectionConfig.hooks.afterRead) {\n user =\n (await hook({\n collection: args.collection?.config,\n context: req.context,\n doc: user,\n overrideAccess,\n req,\n })) || user\n }\n }\n\n let result: LoginResult<TSlug> = {\n exp,\n token,\n user,\n }\n\n // /////////////////////////////////////\n // afterOperation - Collection\n // /////////////////////////////////////\n\n result = await buildAfterOperation({\n args,\n collection: args.collection?.config,\n operation: 'login',\n overrideAccess: args.overrideAccess!,\n result,\n })\n\n if (shouldCommit) {\n await commitTransaction(req)\n }\n\n // /////////////////////////////////////\n // Return results\n // /////////////////////////////////////\n\n return result\n } catch (error: unknown) {\n if (sid) {\n await revokeSession({\n collectionConfig,\n payload,\n req,\n sid,\n user,\n })\n }\n await killTransaction(args.req)\n throw error\n }\n}\n"],"names":["buildAfterOperation","buildBeforeOperation","AuthenticationError","LockedAuth","UnverifiedEmail","ValidationError","afterRead","commitTransaction","Forbidden","initTransaction","appendNonTrashedFilter","killTransaction","sanitizeInternalFields","getFieldsToSign","getLoginOptions","isUserLocked","jwtSign","addSessionToUser","revokeSession","authenticateLocalStrategy","incrementLoginAttempts","resetLoginAttempts","checkLoginPermission","loggingInWithUsername","req","user","t","Boolean","Date","lockUntil","loginOperation","incomingArgs","args","collection","config","auth","disableLocalStrategy","operation","overrideAccess","collectionConfig","data","depth","fallbackLocale","locale","payload","secret","showHiddenFields","email","unsanitizedEmail","password","loginWithUsername","sanitizedEmail","toLowerCase","trim","sanitizedUsername","username","canLoginWithEmail","canLoginWithUsername","slug","errors","message","i18n","path","whereConstraint","emailConstraint","equals","usernameConstraint","or","enableTrash","trash","where","db","findOne","_strategy","authResult","doc","maxLoginAttemptsEnabled","maxLoginAttempts","verify","_verified","shouldCommit","sid","loginAttempts","select","id","fieldsToSignArgs","session","fieldsToSign","hooks","beforeLogin","length","hook","context","exp","token","tokenExpiration","afterLogin","draft","undefined","global","result","error"],"mappings":"AASA,SAASA,mBAAmB,QAAQ,gEAA+D;AACnG,SAASC,oBAAoB,QAAQ,iEAAgE;AACrG,SACEC,mBAAmB,EACnBC,UAAU,EACVC,eAAe,EACfC,eAAe,QACV,wBAAuB;AAC9B,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,iBAAiB,EAAEC,SAAS,EAAEC,eAAe,QAAQ,iBAAgB;AAC9E,SAASC,sBAAsB,QAAQ,4CAA2C;AAClF,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,sBAAsB,QAAQ,4CAA2C;AAClF,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,eAAe,QAAQ,wBAAuB;AACvD,SAASC,YAAY,QAAQ,qBAAoB;AACjD,SAASC,OAAO,QAAQ,YAAW;AACnC,SAASC,gBAA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