payload 4.0.0-internal.ea6e8f8 → 4.0.0-internal.ee5d8bd

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 (703) hide show
  1. package/dist/admin/adapters/router.d.ts +1 -1
  2. package/dist/admin/adapters/router.d.ts.map +1 -1
  3. package/dist/admin/adapters/router.js.map +1 -1
  4. package/dist/admin/forms/Diff.d.ts +0 -4
  5. package/dist/admin/forms/Diff.d.ts.map +1 -1
  6. package/dist/admin/forms/Diff.js.map +1 -1
  7. package/dist/admin/forms/Form.d.ts +0 -2
  8. package/dist/admin/forms/Form.d.ts.map +1 -1
  9. package/dist/admin/forms/Form.js.map +1 -1
  10. package/dist/admin/initAdminContext.d.ts.map +1 -1
  11. package/dist/admin/initAdminContext.js +0 -10
  12. package/dist/admin/initAdminContext.js.map +1 -1
  13. package/dist/auth/createAuthToken.d.ts +26 -0
  14. package/dist/auth/createAuthToken.d.ts.map +1 -0
  15. package/dist/auth/createAuthToken.js +39 -0
  16. package/dist/auth/createAuthToken.js.map +1 -0
  17. package/dist/auth/endpoints/refresh.d.ts.map +1 -1
  18. package/dist/auth/endpoints/refresh.js +2 -1
  19. package/dist/auth/endpoints/refresh.js.map +1 -1
  20. package/dist/auth/getFieldsToSign.js.map +1 -1
  21. package/dist/auth/loginWithCookie.d.ts.map +1 -1
  22. package/dist/auth/loginWithCookie.js +1 -0
  23. package/dist/auth/loginWithCookie.js.map +1 -1
  24. package/dist/auth/operations/local/login.d.ts.map +1 -1
  25. package/dist/auth/operations/local/login.js +1 -0
  26. package/dist/auth/operations/local/login.js.map +1 -1
  27. package/dist/auth/operations/login.d.ts +2 -0
  28. package/dist/auth/operations/login.d.ts.map +1 -1
  29. package/dist/auth/operations/login.js +6 -19
  30. package/dist/auth/operations/login.js.map +1 -1
  31. package/dist/auth/operations/refresh.d.ts +8 -0
  32. package/dist/auth/operations/refresh.d.ts.map +1 -1
  33. package/dist/auth/operations/refresh.js +50 -19
  34. package/dist/auth/operations/refresh.js.map +1 -1
  35. package/dist/auth/operations/resetPassword.d.ts.map +1 -1
  36. package/dist/auth/operations/resetPassword.js +54 -20
  37. package/dist/auth/operations/resetPassword.js.map +1 -1
  38. package/dist/auth/refreshAuthToken.d.ts +32 -0
  39. package/dist/auth/refreshAuthToken.d.ts.map +1 -0
  40. package/dist/auth/refreshAuthToken.js +113 -0
  41. package/dist/auth/refreshAuthToken.js.map +1 -0
  42. package/dist/auth/serverFunctions/cookies.js.map +1 -1
  43. package/dist/auth/serverFunctions/login.js.map +1 -1
  44. package/dist/auth/sessions.d.ts +9 -2
  45. package/dist/auth/sessions.d.ts.map +1 -1
  46. package/dist/auth/sessions.js +6 -5
  47. package/dist/auth/sessions.js.map +1 -1
  48. package/dist/auth/types.d.ts +25 -1
  49. package/dist/auth/types.d.ts.map +1 -1
  50. package/dist/auth/types.js.map +1 -1
  51. package/dist/cli/commands/data/utilities.d.ts +1 -1
  52. package/dist/cli/commands/data/utilities.d.ts.map +1 -1
  53. package/dist/cli/commands/data/utilities.js.map +1 -1
  54. package/dist/cli/defineCLICommand.js +1 -1
  55. package/dist/cli/defineCLICommand.js.map +1 -1
  56. package/dist/collections/config/client.d.ts +1 -1
  57. package/dist/collections/config/client.d.ts.map +1 -1
  58. package/dist/collections/config/client.js +0 -1
  59. package/dist/collections/config/client.js.map +1 -1
  60. package/dist/collections/config/defaults.d.ts +2 -0
  61. package/dist/collections/config/defaults.d.ts.map +1 -1
  62. package/dist/collections/config/defaults.js +4 -0
  63. package/dist/collections/config/defaults.js.map +1 -1
  64. package/dist/collections/config/sanitize.d.ts.map +1 -1
  65. package/dist/collections/config/sanitize.js +3 -0
  66. package/dist/collections/config/sanitize.js.map +1 -1
  67. package/dist/collections/config/sanitizeCompoundIndexes.d.ts.map +1 -1
  68. package/dist/collections/config/sanitizeCompoundIndexes.js +0 -9
  69. package/dist/collections/config/sanitizeCompoundIndexes.js.map +1 -1
  70. package/dist/collections/config/types.d.ts +4 -21
  71. package/dist/collections/config/types.d.ts.map +1 -1
  72. package/dist/collections/config/types.js.map +1 -1
  73. package/dist/collections/dataloader.d.ts +1 -10
  74. package/dist/collections/dataloader.d.ts.map +1 -1
  75. package/dist/collections/dataloader.js +6 -14
  76. package/dist/collections/dataloader.js.map +1 -1
  77. package/dist/collections/operations/create.d.ts.map +1 -1
  78. package/dist/collections/operations/create.js +0 -13
  79. package/dist/collections/operations/create.js.map +1 -1
  80. package/dist/collections/operations/delete.d.ts.map +1 -1
  81. package/dist/collections/operations/delete.js +121 -638
  82. package/dist/collections/operations/delete.js.map +1 -1
  83. package/dist/collections/operations/deleteByID.d.ts.map +1 -1
  84. package/dist/collections/operations/deleteByID.js +32 -238
  85. package/dist/collections/operations/deleteByID.js.map +1 -1
  86. package/dist/collections/operations/findByID.d.ts.map +1 -1
  87. package/dist/collections/operations/findByID.js +0 -6
  88. package/dist/collections/operations/findByID.js.map +1 -1
  89. package/dist/collections/operations/findDistinct.d.ts.map +1 -1
  90. package/dist/collections/operations/findDistinct.js +6 -7
  91. package/dist/collections/operations/findDistinct.js.map +1 -1
  92. package/dist/collections/operations/findVersionByID.d.ts.map +1 -1
  93. package/dist/collections/operations/findVersionByID.js +7 -0
  94. package/dist/collections/operations/findVersionByID.js.map +1 -1
  95. package/dist/collections/operations/findVersions.d.ts.map +1 -1
  96. package/dist/collections/operations/findVersions.js +5 -0
  97. package/dist/collections/operations/findVersions.js.map +1 -1
  98. package/dist/collections/operations/local/count.d.ts +4 -9
  99. package/dist/collections/operations/local/count.d.ts.map +1 -1
  100. package/dist/collections/operations/local/count.js.map +1 -1
  101. package/dist/collections/operations/local/countVersions.d.ts +0 -4
  102. package/dist/collections/operations/local/countVersions.d.ts.map +1 -1
  103. package/dist/collections/operations/local/countVersions.js.map +1 -1
  104. package/dist/collections/operations/local/create.d.ts +4 -9
  105. package/dist/collections/operations/local/create.d.ts.map +1 -1
  106. package/dist/collections/operations/local/create.js.map +1 -1
  107. package/dist/collections/operations/local/delete.d.ts +4 -9
  108. package/dist/collections/operations/local/delete.d.ts.map +1 -1
  109. package/dist/collections/operations/local/delete.js.map +1 -1
  110. package/dist/collections/operations/local/duplicate.d.ts +0 -5
  111. package/dist/collections/operations/local/duplicate.d.ts.map +1 -1
  112. package/dist/collections/operations/local/duplicate.js.map +1 -1
  113. package/dist/collections/operations/local/find.d.ts +4 -9
  114. package/dist/collections/operations/local/find.d.ts.map +1 -1
  115. package/dist/collections/operations/local/find.js.map +1 -1
  116. package/dist/collections/operations/local/findByID.d.ts +4 -9
  117. package/dist/collections/operations/local/findByID.d.ts.map +1 -1
  118. package/dist/collections/operations/local/findByID.js.map +1 -1
  119. package/dist/collections/operations/local/findDistinct.d.ts +0 -5
  120. package/dist/collections/operations/local/findDistinct.d.ts.map +1 -1
  121. package/dist/collections/operations/local/findDistinct.js.map +1 -1
  122. package/dist/collections/operations/local/findVersionByID.d.ts +0 -5
  123. package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
  124. package/dist/collections/operations/local/findVersionByID.js.map +1 -1
  125. package/dist/collections/operations/local/findVersions.d.ts +0 -5
  126. package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
  127. package/dist/collections/operations/local/findVersions.js.map +1 -1
  128. package/dist/collections/operations/local/restoreVersion.d.ts +0 -5
  129. package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
  130. package/dist/collections/operations/local/restoreVersion.js.map +1 -1
  131. package/dist/collections/operations/local/update.d.ts +4 -9
  132. package/dist/collections/operations/local/update.d.ts.map +1 -1
  133. package/dist/collections/operations/local/update.js.map +1 -1
  134. package/dist/collections/operations/renameFile.js +1 -1
  135. package/dist/collections/operations/renameFile.js.map +1 -1
  136. package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
  137. package/dist/collections/operations/restoreVersion.js +76 -157
  138. package/dist/collections/operations/restoreVersion.js.map +1 -1
  139. package/dist/collections/operations/update.d.ts.map +1 -1
  140. package/dist/collections/operations/update.js +171 -357
  141. package/dist/collections/operations/update.js.map +1 -1
  142. package/dist/collections/operations/updateByID.d.ts +0 -15
  143. package/dist/collections/operations/updateByID.d.ts.map +1 -1
  144. package/dist/collections/operations/updateByID.js +60 -265
  145. package/dist/collections/operations/updateByID.js.map +1 -1
  146. package/dist/collections/operations/utilities/buildBeforeOperation.d.ts.map +1 -1
  147. package/dist/collections/operations/utilities/buildBeforeOperation.js +0 -7
  148. package/dist/collections/operations/utilities/buildBeforeOperation.js.map +1 -1
  149. package/dist/collections/operations/utilities/update.d.ts +1 -14
  150. package/dist/collections/operations/utilities/update.d.ts.map +1 -1
  151. package/dist/collections/operations/utilities/update.js +20 -92
  152. package/dist/collections/operations/utilities/update.js.map +1 -1
  153. package/dist/collections/operations/validate.js +4 -4
  154. package/dist/collections/operations/validate.js.map +1 -1
  155. package/dist/config/client.d.ts +1 -3
  156. package/dist/config/client.d.ts.map +1 -1
  157. package/dist/config/client.js +1 -9
  158. package/dist/config/client.js.map +1 -1
  159. package/dist/config/defaults.d.ts.map +1 -1
  160. package/dist/config/defaults.js +1 -0
  161. package/dist/config/defaults.js.map +1 -1
  162. package/dist/config/definePlugin.js.map +1 -1
  163. package/dist/config/sanitize.d.ts.map +1 -1
  164. package/dist/config/sanitize.js +2 -40
  165. package/dist/config/sanitize.js.map +1 -1
  166. package/dist/config/types.d.ts +13 -21
  167. package/dist/config/types.d.ts.map +1 -1
  168. package/dist/config/types.js.map +1 -1
  169. package/dist/database/defaultCopy.d.ts.map +1 -1
  170. package/dist/database/defaultCopy.js +0 -1
  171. package/dist/database/defaultCopy.js.map +1 -1
  172. package/dist/database/types.d.ts +4 -75
  173. package/dist/database/types.d.ts.map +1 -1
  174. package/dist/database/types.js.map +1 -1
  175. package/dist/exports/build-config.d.ts +9 -0
  176. package/dist/exports/build-config.d.ts.map +1 -0
  177. package/dist/exports/build-config.js +38 -0
  178. package/dist/exports/build-config.js.map +1 -0
  179. package/dist/exports/shared.d.ts +0 -2
  180. package/dist/exports/shared.d.ts.map +1 -1
  181. package/dist/exports/shared.js +0 -2
  182. package/dist/exports/shared.js.map +1 -1
  183. package/dist/fields/baseFields/authorship/index.d.ts +1 -2
  184. package/dist/fields/baseFields/authorship/index.d.ts.map +1 -1
  185. package/dist/fields/baseFields/authorship/index.js +0 -12
  186. package/dist/fields/baseFields/authorship/index.js.map +1 -1
  187. package/dist/fields/config/client.js.map +1 -1
  188. package/dist/fields/config/reservedFieldNames.d.ts.map +1 -1
  189. package/dist/fields/config/reservedFieldNames.js.map +1 -1
  190. package/dist/fields/config/types.d.ts.map +1 -1
  191. package/dist/fields/config/types.js.map +1 -1
  192. package/dist/fields/hooks/afterChange/promise.js.map +1 -1
  193. package/dist/fields/hooks/afterRead/index.d.ts +0 -8
  194. package/dist/fields/hooks/afterRead/index.d.ts.map +1 -1
  195. package/dist/fields/hooks/afterRead/index.js +2 -6
  196. package/dist/fields/hooks/afterRead/index.js.map +1 -1
  197. package/dist/fields/hooks/afterRead/promise.d.ts +1 -3
  198. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
  199. package/dist/fields/hooks/afterRead/promise.js +17 -41
  200. package/dist/fields/hooks/afterRead/promise.js.map +1 -1
  201. package/dist/fields/hooks/afterRead/relationshipPopulationPromise.d.ts.map +1 -1
  202. package/dist/fields/hooks/afterRead/relationshipPopulationPromise.js +0 -2
  203. package/dist/fields/hooks/afterRead/relationshipPopulationPromise.js.map +1 -1
  204. package/dist/fields/hooks/afterRead/traverseFields.d.ts +1 -3
  205. package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
  206. package/dist/fields/hooks/afterRead/traverseFields.js +2 -4
  207. package/dist/fields/hooks/afterRead/traverseFields.js.map +1 -1
  208. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.d.ts.map +1 -1
  209. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.js +0 -3
  210. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.js.map +1 -1
  211. package/dist/fields/hooks/beforeChange/flattenValidationData.d.ts +14 -0
  212. package/dist/fields/hooks/beforeChange/flattenValidationData.d.ts.map +1 -0
  213. package/dist/fields/hooks/beforeChange/flattenValidationData.js +36 -0
  214. package/dist/fields/hooks/beforeChange/flattenValidationData.js.map +1 -0
  215. package/dist/fields/hooks/beforeChange/promise.d.ts +2 -1
  216. package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
  217. package/dist/fields/hooks/beforeChange/promise.js +96 -22
  218. package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
  219. package/dist/fields/hooks/beforeChange/traverseFields.d.ts +2 -1
  220. package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
  221. package/dist/fields/hooks/beforeChange/traverseFields.js +2 -1
  222. package/dist/fields/hooks/beforeChange/traverseFields.js.map +1 -1
  223. package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
  224. package/dist/fields/hooks/beforeValidate/promise.js +0 -8
  225. package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
  226. package/dist/fields/validations.d.ts.map +1 -1
  227. package/dist/fields/validations.js +4 -1
  228. package/dist/fields/validations.js.map +1 -1
  229. package/dist/globals/config/types.d.ts +2 -6
  230. package/dist/globals/config/types.d.ts.map +1 -1
  231. package/dist/globals/config/types.js.map +1 -1
  232. package/dist/globals/operations/countGlobalVersions.d.ts.map +1 -1
  233. package/dist/globals/operations/countGlobalVersions.js +0 -7
  234. package/dist/globals/operations/countGlobalVersions.js.map +1 -1
  235. package/dist/globals/operations/findOne.d.ts.map +1 -1
  236. package/dist/globals/operations/findOne.js +0 -7
  237. package/dist/globals/operations/findOne.js.map +1 -1
  238. package/dist/globals/operations/findVersionByID.d.ts.map +1 -1
  239. package/dist/globals/operations/findVersionByID.js +6 -6
  240. package/dist/globals/operations/findVersionByID.js.map +1 -1
  241. package/dist/globals/operations/findVersions.d.ts.map +1 -1
  242. package/dist/globals/operations/findVersions.js +4 -6
  243. package/dist/globals/operations/findVersions.js.map +1 -1
  244. package/dist/globals/operations/local/countVersions.d.ts +0 -5
  245. package/dist/globals/operations/local/countVersions.d.ts.map +1 -1
  246. package/dist/globals/operations/local/countVersions.js.map +1 -1
  247. package/dist/globals/operations/local/findOne.d.ts +0 -5
  248. package/dist/globals/operations/local/findOne.d.ts.map +1 -1
  249. package/dist/globals/operations/local/findOne.js.map +1 -1
  250. package/dist/globals/operations/local/findVersionByID.d.ts +0 -5
  251. package/dist/globals/operations/local/findVersionByID.d.ts.map +1 -1
  252. package/dist/globals/operations/local/findVersionByID.js.map +1 -1
  253. package/dist/globals/operations/local/findVersions.d.ts +0 -5
  254. package/dist/globals/operations/local/findVersions.d.ts.map +1 -1
  255. package/dist/globals/operations/local/findVersions.js.map +1 -1
  256. package/dist/globals/operations/local/restoreVersion.d.ts +0 -5
  257. package/dist/globals/operations/local/restoreVersion.d.ts.map +1 -1
  258. package/dist/globals/operations/local/restoreVersion.js.map +1 -1
  259. package/dist/globals/operations/local/update.d.ts +0 -5
  260. package/dist/globals/operations/local/update.d.ts.map +1 -1
  261. package/dist/globals/operations/local/update.js +18 -61
  262. package/dist/globals/operations/local/update.js.map +1 -1
  263. package/dist/globals/operations/restoreVersion.d.ts +2 -3
  264. package/dist/globals/operations/restoreVersion.d.ts.map +1 -1
  265. package/dist/globals/operations/restoreVersion.js +24 -61
  266. package/dist/globals/operations/restoreVersion.js.map +1 -1
  267. package/dist/globals/operations/update.d.ts.map +1 -1
  268. package/dist/globals/operations/update.js +8 -86
  269. package/dist/globals/operations/update.js.map +1 -1
  270. package/dist/globals/operations/validate.js +1 -1
  271. package/dist/globals/operations/validate.js.map +1 -1
  272. package/dist/hierarchy/addHierarchyToCollection.d.ts.map +1 -1
  273. package/dist/hierarchy/addHierarchyToCollection.js +32 -21
  274. package/dist/hierarchy/addHierarchyToCollection.js.map +1 -1
  275. package/dist/hierarchy/createFolderField.js.map +1 -1
  276. package/dist/hierarchy/getInitialTreeData.d.ts +1 -3
  277. package/dist/hierarchy/getInitialTreeData.d.ts.map +1 -1
  278. package/dist/hierarchy/getInitialTreeData.js +1 -4
  279. package/dist/hierarchy/getInitialTreeData.js.map +1 -1
  280. package/dist/hierarchy/resolveHierarchyCollections.js +9 -3
  281. package/dist/hierarchy/resolveHierarchyCollections.js.map +1 -1
  282. package/dist/hierarchy/utils/computePaths.d.ts.map +1 -1
  283. package/dist/hierarchy/utils/computePaths.js.map +1 -1
  284. package/dist/index.bundled.d.ts +4336 -5501
  285. package/dist/index.d.ts +27 -51
  286. package/dist/index.d.ts.map +1 -1
  287. package/dist/index.js +14 -37
  288. package/dist/index.js.map +1 -1
  289. package/dist/llm-instructions/getInstructionsCollection.d.ts.map +1 -1
  290. package/dist/llm-instructions/getInstructionsCollection.js +2 -0
  291. package/dist/llm-instructions/getInstructionsCollection.js.map +1 -1
  292. package/dist/preferences/keys.d.ts +4 -11
  293. package/dist/preferences/keys.d.ts.map +1 -1
  294. package/dist/preferences/keys.js +3 -10
  295. package/dist/preferences/keys.js.map +1 -1
  296. package/dist/preferences/types.d.ts +0 -19
  297. package/dist/preferences/types.d.ts.map +1 -1
  298. package/dist/preferences/types.js.map +1 -1
  299. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js +1 -1
  300. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js.map +1 -1
  301. package/dist/types/index.d.ts +0 -13
  302. package/dist/types/index.d.ts.map +1 -1
  303. package/dist/types/index.js.map +1 -1
  304. package/dist/uploads/deleteAssociatedFiles.d.ts.map +1 -1
  305. package/dist/uploads/deleteAssociatedFiles.js +29 -108
  306. package/dist/uploads/deleteAssociatedFiles.js.map +1 -1
  307. package/dist/uploads/endpoints/getFile.d.ts.map +1 -1
  308. package/dist/uploads/endpoints/getFile.js +0 -5
  309. package/dist/uploads/endpoints/getFile.js.map +1 -1
  310. package/dist/uploads/fileExists.d.ts.map +1 -1
  311. package/dist/uploads/fileExists.js +2 -5
  312. package/dist/uploads/fileExists.js.map +1 -1
  313. package/dist/uploads/fileVersioning/archive.d.ts.map +1 -1
  314. package/dist/uploads/fileVersioning/archive.js +1 -15
  315. package/dist/uploads/fileVersioning/archive.js.map +1 -1
  316. package/dist/uploads/fileVersioning/cleanup.d.ts +0 -7
  317. package/dist/uploads/fileVersioning/cleanup.d.ts.map +1 -1
  318. package/dist/uploads/fileVersioning/cleanup.js +0 -12
  319. package/dist/uploads/fileVersioning/cleanup.js.map +1 -1
  320. package/dist/uploads/fileVersioning/cloudStorage.d.ts.map +1 -1
  321. package/dist/uploads/fileVersioning/cloudStorage.js +1 -16
  322. package/dist/uploads/fileVersioning/cloudStorage.js.map +1 -1
  323. package/dist/uploads/fileVersioning/resolveHistoricalFile.js.map +1 -1
  324. package/dist/uploads/formatFilesize.js +1 -1
  325. package/dist/uploads/formatFilesize.js.map +1 -1
  326. package/dist/uploads/generateFileData.d.ts +0 -5
  327. package/dist/uploads/generateFileData.d.ts.map +1 -1
  328. package/dist/uploads/generateFileData.js +2 -74
  329. package/dist/uploads/generateFileData.js.map +1 -1
  330. package/dist/uploads/getBaseFields.d.ts.map +1 -1
  331. package/dist/uploads/getBaseFields.js +29 -46
  332. package/dist/uploads/getBaseFields.js.map +1 -1
  333. package/dist/uploads/getFileContentRequirement.js.map +1 -1
  334. package/dist/uploads/getFileFromUploadInstructions.js.map +1 -1
  335. package/dist/uploads/getSafeFilename.d.ts.map +1 -1
  336. package/dist/uploads/getSafeFilename.js +3 -5
  337. package/dist/uploads/getSafeFilename.js.map +1 -1
  338. package/dist/uploads/safeFetch.js.map +1 -1
  339. package/dist/uploads/stagedUpload.js.map +1 -1
  340. package/dist/uploads/transformers/handleDynamicFileRequest.js +11 -2
  341. package/dist/uploads/transformers/handleDynamicFileRequest.js.map +1 -1
  342. package/dist/uploads/types.d.ts +0 -11
  343. package/dist/uploads/types.d.ts.map +1 -1
  344. package/dist/uploads/types.js.map +1 -1
  345. package/dist/uploads/uploadFiles.d.ts +1 -4
  346. package/dist/uploads/uploadFiles.d.ts.map +1 -1
  347. package/dist/uploads/uploadFiles.js +5 -29
  348. package/dist/uploads/uploadFiles.js.map +1 -1
  349. package/dist/utilities/addSelectGenericsToGeneretedTypes.d.ts.map +1 -1
  350. package/dist/utilities/addSelectGenericsToGeneretedTypes.js +0 -1
  351. package/dist/utilities/addSelectGenericsToGeneretedTypes.js.map +1 -1
  352. package/dist/utilities/appendDateTimezoneSelectFields.js.map +1 -1
  353. package/dist/utilities/assertNoValidationWrite.d.ts.map +1 -1
  354. package/dist/utilities/assertNoValidationWrite.js +0 -4
  355. package/dist/utilities/assertNoValidationWrite.js.map +1 -1
  356. package/dist/utilities/checkDocumentLockStatus.d.ts +6 -15
  357. package/dist/utilities/checkDocumentLockStatus.d.ts.map +1 -1
  358. package/dist/utilities/checkDocumentLockStatus.js +11 -44
  359. package/dist/utilities/checkDocumentLockStatus.js.map +1 -1
  360. package/dist/utilities/cloneValidationRequest.js.map +1 -1
  361. package/dist/utilities/commitTransaction.d.ts +0 -4
  362. package/dist/utilities/commitTransaction.d.ts.map +1 -1
  363. package/dist/utilities/commitTransaction.js +1 -41
  364. package/dist/utilities/commitTransaction.js.map +1 -1
  365. package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
  366. package/dist/utilities/configToJSONSchema.js +2 -18
  367. package/dist/utilities/configToJSONSchema.js.map +1 -1
  368. package/dist/utilities/createPayloadRequest.d.ts +0 -5
  369. package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
  370. package/dist/utilities/createPayloadRequest.js +3 -50
  371. package/dist/utilities/createPayloadRequest.js.map +1 -1
  372. package/dist/utilities/createPayloadRequestFromWebRequest.d.ts +12 -1
  373. package/dist/utilities/createPayloadRequestFromWebRequest.d.ts.map +1 -1
  374. package/dist/utilities/createPayloadRequestFromWebRequest.js +9 -5
  375. package/dist/utilities/createPayloadRequestFromWebRequest.js.map +1 -1
  376. package/dist/utilities/deepCopyObject.js.map +1 -1
  377. package/dist/utilities/documentMatchingWhereExists.js +1 -1
  378. package/dist/utilities/documentMatchingWhereExists.js.map +1 -1
  379. package/dist/utilities/entityInputSchema/validateEntityData.d.ts.map +1 -1
  380. package/dist/utilities/entityInputSchema/validateEntityData.js.map +1 -1
  381. package/dist/utilities/filterDataToSelectedLocales.js.map +1 -1
  382. package/dist/utilities/getEntityPermissions/getEntityPermissions.d.ts.map +1 -1
  383. package/dist/utilities/getEntityPermissions/getEntityPermissions.js +1 -0
  384. package/dist/utilities/getEntityPermissions/getEntityPermissions.js.map +1 -1
  385. package/dist/utilities/getEntityPermissions/populateFieldPermissions.js.map +1 -1
  386. package/dist/utilities/getVersionsConfig.d.ts +4 -0
  387. package/dist/utilities/getVersionsConfig.d.ts.map +1 -1
  388. package/dist/utilities/getVersionsConfig.js +5 -0
  389. package/dist/utilities/getVersionsConfig.js.map +1 -1
  390. package/dist/utilities/handleEndpoints.d.ts.map +1 -1
  391. package/dist/utilities/handleEndpoints.js +10 -9
  392. package/dist/utilities/handleEndpoints.js.map +1 -1
  393. package/dist/utilities/httpStatus.d.ts +0 -2
  394. package/dist/utilities/httpStatus.d.ts.map +1 -1
  395. package/dist/utilities/httpStatus.js +1 -3
  396. package/dist/utilities/httpStatus.js.map +1 -1
  397. package/dist/utilities/initTransaction.d.ts.map +1 -1
  398. package/dist/utilities/initTransaction.js +7 -35
  399. package/dist/utilities/initTransaction.js.map +1 -1
  400. package/dist/utilities/killTransaction.d.ts.map +1 -1
  401. package/dist/utilities/killTransaction.js +0 -27
  402. package/dist/utilities/killTransaction.js.map +1 -1
  403. package/dist/utilities/parseParams/index.js.map +1 -1
  404. package/dist/utilities/parseValidationLocale.js.map +1 -1
  405. package/dist/utilities/sanitizePopulateParam.js.map +1 -1
  406. package/dist/utilities/telemetry/conf/index.d.ts +4 -1
  407. package/dist/utilities/telemetry/conf/index.d.ts.map +1 -1
  408. package/dist/utilities/telemetry/conf/index.js.map +1 -1
  409. package/dist/utilities/telemetry/featureInfo/getFeatureInfo.js.map +1 -1
  410. package/dist/versions/allLocalesPublicationStatus.js.map +1 -1
  411. package/dist/versions/buildCollectionFields.d.ts.map +1 -1
  412. package/dist/versions/buildCollectionFields.js +0 -23
  413. package/dist/versions/buildCollectionFields.js.map +1 -1
  414. package/dist/versions/buildGlobalFields.d.ts.map +1 -1
  415. package/dist/versions/buildGlobalFields.js +0 -14
  416. package/dist/versions/buildGlobalFields.js.map +1 -1
  417. package/dist/versions/buildVersionCompoundIndexes.d.ts.map +1 -1
  418. package/dist/versions/buildVersionCompoundIndexes.js +2 -8
  419. package/dist/versions/buildVersionCompoundIndexes.js.map +1 -1
  420. package/dist/versions/deleteCollectionVersions.d.ts +1 -2
  421. package/dist/versions/deleteCollectionVersions.d.ts.map +1 -1
  422. package/dist/versions/deleteCollectionVersions.js +8 -37
  423. package/dist/versions/deleteCollectionVersions.js.map +1 -1
  424. package/dist/versions/deleteScheduledPublishJobs.d.ts.map +1 -1
  425. package/dist/versions/deleteScheduledPublishJobs.js +0 -4
  426. package/dist/versions/deleteScheduledPublishJobs.js.map +1 -1
  427. package/dist/versions/drafts/appendVersionToQueryKey.d.ts.map +1 -1
  428. package/dist/versions/drafts/appendVersionToQueryKey.js +1 -9
  429. package/dist/versions/drafts/appendVersionToQueryKey.js.map +1 -1
  430. package/dist/versions/drafts/replaceWithDraftIfAvailable.d.ts.map +1 -1
  431. package/dist/versions/drafts/replaceWithDraftIfAvailable.js +1 -8
  432. package/dist/versions/drafts/replaceWithDraftIfAvailable.js.map +1 -1
  433. package/dist/versions/enforceMaxVersions.d.ts +0 -1
  434. package/dist/versions/enforceMaxVersions.d.ts.map +1 -1
  435. package/dist/versions/enforceMaxVersions.js +6 -22
  436. package/dist/versions/enforceMaxVersions.js.map +1 -1
  437. package/dist/versions/getLatestCollectionVersion.d.ts.map +1 -1
  438. package/dist/versions/getLatestCollectionVersion.js +2 -10
  439. package/dist/versions/getLatestCollectionVersion.js.map +1 -1
  440. package/dist/versions/getLatestGlobalVersion.d.ts +2 -6
  441. package/dist/versions/getLatestGlobalVersion.d.ts.map +1 -1
  442. package/dist/versions/getLatestGlobalVersion.js +21 -65
  443. package/dist/versions/getLatestGlobalVersion.js.map +1 -1
  444. package/dist/versions/isInheritedReadVersionsAccess.js.map +1 -1
  445. package/dist/versions/saveVersion.d.ts +0 -7
  446. package/dist/versions/saveVersion.d.ts.map +1 -1
  447. package/dist/versions/saveVersion.js +4 -27
  448. package/dist/versions/saveVersion.js.map +1 -1
  449. package/dist/versions/updateLatestVersion.d.ts +0 -1
  450. package/dist/versions/updateLatestVersion.d.ts.map +1 -1
  451. package/dist/versions/updateLatestVersion.js +7 -24
  452. package/dist/versions/updateLatestVersion.js.map +1 -1
  453. package/package.json +30 -28
  454. package/skills/payload/reference/ENDPOINTS.md +3 -9
  455. package/skills/payload/reference/PLUGIN-DEVELOPMENT.md +4 -4
  456. package/dist/admin/getAdminPreferences.d.ts +0 -10
  457. package/dist/admin/getAdminPreferences.d.ts.map +0 -1
  458. package/dist/admin/getAdminPreferences.js +0 -53
  459. package/dist/admin/getAdminPreferences.js.map +0 -1
  460. package/dist/admin/getRequestBranch.d.ts +0 -6
  461. package/dist/admin/getRequestBranch.d.ts.map +0 -1
  462. package/dist/admin/getRequestBranch.js +0 -17
  463. package/dist/admin/getRequestBranch.js.map +0 -1
  464. package/dist/branching/appendBranchFilter.d.ts +0 -30
  465. package/dist/branching/appendBranchFilter.d.ts.map +0 -1
  466. package/dist/branching/appendBranchFilter.js +0 -105
  467. package/dist/branching/appendBranchFilter.js.map +0 -1
  468. package/dist/branching/assertBranchAccess.d.ts +0 -10
  469. package/dist/branching/assertBranchAccess.d.ts.map +0 -1
  470. package/dist/branching/assertBranchAccess.js +0 -36
  471. package/dist/branching/assertBranchAccess.js.map +0 -1
  472. package/dist/branching/assertBranchActionAccess.d.ts +0 -10
  473. package/dist/branching/assertBranchActionAccess.d.ts.map +0 -1
  474. package/dist/branching/assertBranchActionAccess.js +0 -15
  475. package/dist/branching/assertBranchActionAccess.js.map +0 -1
  476. package/dist/branching/assertBranchCreatedDocumentsUnreferenced.d.ts +0 -53
  477. package/dist/branching/assertBranchCreatedDocumentsUnreferenced.d.ts.map +0 -1
  478. package/dist/branching/assertBranchCreatedDocumentsUnreferenced.js +0 -833
  479. package/dist/branching/assertBranchCreatedDocumentsUnreferenced.js.map +0 -1
  480. package/dist/branching/assertBranchReadable.d.ts +0 -36
  481. package/dist/branching/assertBranchReadable.d.ts.map +0 -1
  482. package/dist/branching/assertBranchReadable.js +0 -83
  483. package/dist/branching/assertBranchReadable.js.map +0 -1
  484. package/dist/branching/assertBranchUpdateAccess.d.ts +0 -8
  485. package/dist/branching/assertBranchUpdateAccess.d.ts.map +0 -1
  486. package/dist/branching/assertBranchUpdateAccess.js +0 -12
  487. package/dist/branching/assertBranchUpdateAccess.js.map +0 -1
  488. package/dist/branching/assertBranchWritable.d.ts +0 -18
  489. package/dist/branching/assertBranchWritable.d.ts.map +0 -1
  490. package/dist/branching/assertBranchWritable.js +0 -46
  491. package/dist/branching/assertBranchWritable.js.map +0 -1
  492. package/dist/branching/branchIDs.d.ts +0 -38
  493. package/dist/branching/branchIDs.d.ts.map +0 -1
  494. package/dist/branching/branchIDs.js +0 -113
  495. package/dist/branching/branchIDs.js.map +0 -1
  496. package/dist/branching/branchSelect.d.ts +0 -42
  497. package/dist/branching/branchSelect.d.ts.map +0 -1
  498. package/dist/branching/branchSelect.js +0 -97
  499. package/dist/branching/branchSelect.js.map +0 -1
  500. package/dist/branching/checkFieldAccess.d.ts +0 -21
  501. package/dist/branching/checkFieldAccess.d.ts.map +0 -1
  502. package/dist/branching/checkFieldAccess.js +0 -238
  503. package/dist/branching/checkFieldAccess.js.map +0 -1
  504. package/dist/branching/collections.d.ts +0 -14
  505. package/dist/branching/collections.d.ts.map +0 -1
  506. package/dist/branching/collections.js +0 -713
  507. package/dist/branching/collections.js.map +0 -1
  508. package/dist/branching/combineBranchAccess.d.ts +0 -6
  509. package/dist/branching/combineBranchAccess.d.ts.map +0 -1
  510. package/dist/branching/combineBranchAccess.js +0 -22
  511. package/dist/branching/combineBranchAccess.js.map +0 -1
  512. package/dist/branching/copyUploadFilesToBranch.d.ts +0 -9
  513. package/dist/branching/copyUploadFilesToBranch.d.ts.map +0 -1
  514. package/dist/branching/copyUploadFilesToBranch.js +0 -126
  515. package/dist/branching/copyUploadFilesToBranch.js.map +0 -1
  516. package/dist/branching/createShadowRow.d.ts +0 -70
  517. package/dist/branching/createShadowRow.d.ts.map +0 -1
  518. package/dist/branching/createShadowRow.js +0 -296
  519. package/dist/branching/createShadowRow.js.map +0 -1
  520. package/dist/branching/discard.d.ts +0 -52
  521. package/dist/branching/discard.d.ts.map +0 -1
  522. package/dist/branching/discard.js +0 -428
  523. package/dist/branching/discard.js.map +0 -1
  524. package/dist/branching/effectiveOperations.d.ts +0 -55
  525. package/dist/branching/effectiveOperations.d.ts.map +0 -1
  526. package/dist/branching/effectiveOperations.js +0 -472
  527. package/dist/branching/effectiveOperations.js.map +0 -1
  528. package/dist/branching/endpoints/discard.d.ts +0 -15
  529. package/dist/branching/endpoints/discard.d.ts.map +0 -1
  530. package/dist/branching/endpoints/discard.js +0 -55
  531. package/dist/branching/endpoints/discard.js.map +0 -1
  532. package/dist/branching/endpoints/merge.d.ts +0 -34
  533. package/dist/branching/endpoints/merge.d.ts.map +0 -1
  534. package/dist/branching/endpoints/merge.js +0 -119
  535. package/dist/branching/endpoints/merge.js.map +0 -1
  536. package/dist/branching/forkDocument.d.ts +0 -20
  537. package/dist/branching/forkDocument.d.ts.map +0 -1
  538. package/dist/branching/forkDocument.js +0 -169
  539. package/dist/branching/forkDocument.js.map +0 -1
  540. package/dist/branching/globalMergeWrites.d.ts +0 -21
  541. package/dist/branching/globalMergeWrites.d.ts.map +0 -1
  542. package/dist/branching/globalMergeWrites.js +0 -146
  543. package/dist/branching/globalMergeWrites.js.map +0 -1
  544. package/dist/branching/globals.d.ts +0 -49
  545. package/dist/branching/globals.d.ts.map +0 -1
  546. package/dist/branching/globals.js +0 -197
  547. package/dist/branching/globals.js.map +0 -1
  548. package/dist/branching/hooks.d.ts +0 -24
  549. package/dist/branching/hooks.d.ts.map +0 -1
  550. package/dist/branching/hooks.js +0 -92
  551. package/dist/branching/hooks.js.map +0 -1
  552. package/dist/branching/injectBranchFields.d.ts +0 -40
  553. package/dist/branching/injectBranchFields.d.ts.map +0 -1
  554. package/dist/branching/injectBranchFields.js +0 -229
  555. package/dist/branching/injectBranchFields.js.map +0 -1
  556. package/dist/branching/merge/applyMergeChange.d.ts +0 -27
  557. package/dist/branching/merge/applyMergeChange.d.ts.map +0 -1
  558. package/dist/branching/merge/applyMergeChange.js +0 -853
  559. package/dist/branching/merge/applyMergeChange.js.map +0 -1
  560. package/dist/branching/merge/branchMergeStatus.d.ts +0 -12
  561. package/dist/branching/merge/branchMergeStatus.d.ts.map +0 -1
  562. package/dist/branching/merge/branchMergeStatus.js +0 -74
  563. package/dist/branching/merge/branchMergeStatus.js.map +0 -1
  564. package/dist/branching/merge/executeMerge.d.ts +0 -22
  565. package/dist/branching/merge/executeMerge.d.ts.map +0 -1
  566. package/dist/branching/merge/executeMerge.js +0 -600
  567. package/dist/branching/merge/executeMerge.js.map +0 -1
  568. package/dist/branching/merge/finalizeMerge.d.ts +0 -40
  569. package/dist/branching/merge/finalizeMerge.d.ts.map +0 -1
  570. package/dist/branching/merge/finalizeMerge.js +0 -237
  571. package/dist/branching/merge/finalizeMerge.js.map +0 -1
  572. package/dist/branching/merge/mergeLedger.d.ts +0 -40
  573. package/dist/branching/merge/mergeLedger.d.ts.map +0 -1
  574. package/dist/branching/merge/mergeLedger.js +0 -130
  575. package/dist/branching/merge/mergeLedger.js.map +0 -1
  576. package/dist/branching/merge/prepareMerge.d.ts +0 -41
  577. package/dist/branching/merge/prepareMerge.d.ts.map +0 -1
  578. package/dist/branching/merge/prepareMerge.js +0 -234
  579. package/dist/branching/merge/prepareMerge.js.map +0 -1
  580. package/dist/branching/merge/recoverMerge.d.ts +0 -16
  581. package/dist/branching/merge/recoverMerge.d.ts.map +0 -1
  582. package/dist/branching/merge/recoverMerge.js +0 -199
  583. package/dist/branching/merge/recoverMerge.js.map +0 -1
  584. package/dist/branching/merge/retryFailedCleanups.d.ts +0 -36
  585. package/dist/branching/merge/retryFailedCleanups.d.ts.map +0 -1
  586. package/dist/branching/merge/retryFailedCleanups.js +0 -335
  587. package/dist/branching/merge/retryFailedCleanups.js.map +0 -1
  588. package/dist/branching/merge/utilities.d.ts +0 -35
  589. package/dist/branching/merge/utilities.d.ts.map +0 -1
  590. package/dist/branching/merge/utilities.js +0 -54
  591. package/dist/branching/merge/utilities.js.map +0 -1
  592. package/dist/branching/merge.d.ts +0 -88
  593. package/dist/branching/merge.d.ts.map +0 -1
  594. package/dist/branching/merge.js +0 -163
  595. package/dist/branching/merge.js.map +0 -1
  596. package/dist/branching/mergeWriteGuard.d.ts +0 -20
  597. package/dist/branching/mergeWriteGuard.d.ts.map +0 -1
  598. package/dist/branching/mergeWriteGuard.js +0 -27
  599. package/dist/branching/mergeWriteGuard.js.map +0 -1
  600. package/dist/branching/preflight.d.ts +0 -71
  601. package/dist/branching/preflight.d.ts.map +0 -1
  602. package/dist/branching/preflight.js +0 -757
  603. package/dist/branching/preflight.js.map +0 -1
  604. package/dist/branching/readLocalizedBranchWrite.d.ts +0 -14
  605. package/dist/branching/readLocalizedBranchWrite.d.ts.map +0 -1
  606. package/dist/branching/readLocalizedBranchWrite.js +0 -90
  607. package/dist/branching/readLocalizedBranchWrite.js.map +0 -1
  608. package/dist/branching/readMergeSnapshot.d.ts +0 -18
  609. package/dist/branching/readMergeSnapshot.d.ts.map +0 -1
  610. package/dist/branching/readMergeSnapshot.js +0 -99
  611. package/dist/branching/readMergeSnapshot.js.map +0 -1
  612. package/dist/branching/resolveBranch.d.ts +0 -153
  613. package/dist/branching/resolveBranch.d.ts.map +0 -1
  614. package/dist/branching/resolveBranch.js +0 -363
  615. package/dist/branching/resolveBranch.js.map +0 -1
  616. package/dist/branching/resolveBranchActionAccess.d.ts +0 -8
  617. package/dist/branching/resolveBranchActionAccess.d.ts.map +0 -1
  618. package/dist/branching/resolveBranchActionAccess.js +0 -9
  619. package/dist/branching/resolveBranchActionAccess.js.map +0 -1
  620. package/dist/branching/resolveBranchQuery.d.ts +0 -48
  621. package/dist/branching/resolveBranchQuery.d.ts.map +0 -1
  622. package/dist/branching/resolveBranchQuery.js +0 -115
  623. package/dist/branching/resolveBranchQuery.js.map +0 -1
  624. package/dist/branching/resolveBranchRowID.d.ts +0 -22
  625. package/dist/branching/resolveBranchRowID.d.ts.map +0 -1
  626. package/dist/branching/resolveBranchRowID.js +0 -70
  627. package/dist/branching/resolveBranchRowID.js.map +0 -1
  628. package/dist/branching/sanitizeBranchingConfig.d.ts +0 -31
  629. package/dist/branching/sanitizeBranchingConfig.d.ts.map +0 -1
  630. package/dist/branching/sanitizeBranchingConfig.js +0 -110
  631. package/dist/branching/sanitizeBranchingConfig.js.map +0 -1
  632. package/dist/branching/schedule/job.d.ts +0 -51
  633. package/dist/branching/schedule/job.d.ts.map +0 -1
  634. package/dist/branching/schedule/job.js +0 -151
  635. package/dist/branching/schedule/job.js.map +0 -1
  636. package/dist/branching/selectBranchChanges.d.ts +0 -8
  637. package/dist/branching/selectBranchChanges.d.ts.map +0 -1
  638. package/dist/branching/selectBranchChanges.js +0 -9
  639. package/dist/branching/selectBranchChanges.js.map +0 -1
  640. package/dist/branching/stripBranchMergeData.d.ts +0 -11
  641. package/dist/branching/stripBranchMergeData.d.ts.map +0 -1
  642. package/dist/branching/stripBranchMergeData.js +0 -20
  643. package/dist/branching/stripBranchMergeData.js.map +0 -1
  644. package/dist/branching/tombstone.d.ts +0 -91
  645. package/dist/branching/tombstone.d.ts.map +0 -1
  646. package/dist/branching/tombstone.js +0 -546
  647. package/dist/branching/tombstone.js.map +0 -1
  648. package/dist/branching/types.d.ts +0 -158
  649. package/dist/branching/types.d.ts.map +0 -1
  650. package/dist/branching/types.js +0 -54
  651. package/dist/branching/types.js.map +0 -1
  652. package/dist/branching/validation.d.ts +0 -47
  653. package/dist/branching/validation.d.ts.map +0 -1
  654. package/dist/branching/validation.js +0 -272
  655. package/dist/branching/validation.js.map +0 -1
  656. package/dist/branching/versions.d.ts +0 -131
  657. package/dist/branching/versions.d.ts.map +0 -1
  658. package/dist/branching/versions.js +0 -572
  659. package/dist/branching/versions.js.map +0 -1
  660. package/dist/collections/operations/utilities/createOperationRetryRequest.d.ts +0 -23
  661. package/dist/collections/operations/utilities/createOperationRetryRequest.d.ts.map +0 -1
  662. package/dist/collections/operations/utilities/createOperationRetryRequest.js +0 -683
  663. package/dist/collections/operations/utilities/createOperationRetryRequest.js.map +0 -1
  664. package/dist/fields/hooks/beforeValidate/throwOnAccessDenied.d.ts +0 -3
  665. package/dist/fields/hooks/beforeValidate/throwOnAccessDenied.d.ts.map +0 -1
  666. package/dist/fields/hooks/beforeValidate/throwOnAccessDenied.js +0 -3
  667. package/dist/fields/hooks/beforeValidate/throwOnAccessDenied.js.map +0 -1
  668. package/dist/uploads/appendBranchToFileURL.d.ts +0 -6
  669. package/dist/uploads/appendBranchToFileURL.d.ts.map +0 -1
  670. package/dist/uploads/appendBranchToFileURL.js +0 -24
  671. package/dist/uploads/appendBranchToFileURL.js.map +0 -1
  672. package/dist/uploads/deleteUploadFilesExclusiveToDocument.d.ts +0 -15
  673. package/dist/uploads/deleteUploadFilesExclusiveToDocument.d.ts.map +0 -1
  674. package/dist/uploads/deleteUploadFilesExclusiveToDocument.js +0 -62
  675. package/dist/uploads/deleteUploadFilesExclusiveToDocument.js.map +0 -1
  676. package/dist/uploads/fileIdentity.d.ts +0 -24
  677. package/dist/uploads/fileIdentity.d.ts.map +0 -1
  678. package/dist/uploads/fileIdentity.js +0 -36
  679. package/dist/uploads/fileIdentity.js.map +0 -1
  680. package/dist/uploads/fileQuarantine.d.ts +0 -17
  681. package/dist/uploads/fileQuarantine.d.ts.map +0 -1
  682. package/dist/uploads/fileQuarantine.js +0 -52
  683. package/dist/uploads/fileQuarantine.js.map +0 -1
  684. package/dist/uploads/linkFileWithoutOverwrite.d.ts +0 -13
  685. package/dist/uploads/linkFileWithoutOverwrite.d.ts.map +0 -1
  686. package/dist/uploads/linkFileWithoutOverwrite.js +0 -13
  687. package/dist/uploads/linkFileWithoutOverwrite.js.map +0 -1
  688. package/dist/uploads/uploadFileRollback.d.ts +0 -31
  689. package/dist/uploads/uploadFileRollback.d.ts.map +0 -1
  690. package/dist/uploads/uploadFileRollback.js +0 -269
  691. package/dist/uploads/uploadFileRollback.js.map +0 -1
  692. package/dist/utilities/extractRelationshipID.d.ts +0 -4
  693. package/dist/utilities/extractRelationshipID.d.ts.map +0 -1
  694. package/dist/utilities/extractRelationshipID.js +0 -14
  695. package/dist/utilities/extractRelationshipID.js.map +0 -1
  696. package/dist/utilities/transactionCallbacks.d.ts +0 -77
  697. package/dist/utilities/transactionCallbacks.d.ts.map +0 -1
  698. package/dist/utilities/transactionCallbacks.js +0 -299
  699. package/dist/utilities/transactionCallbacks.js.map +0 -1
  700. package/dist/utilities/transactionMutationTracker.d.ts +0 -21
  701. package/dist/utilities/transactionMutationTracker.d.ts.map +0 -1
  702. package/dist/utilities/transactionMutationTracker.js +0 -71
  703. package/dist/utilities/transactionMutationTracker.js.map +0 -1
@@ -1,4 +1,3 @@
1
- import { resolveBranch } from '../../../branching/resolveBranch.js';
2
1
  import { createDataloaderCacheKey } from '../../../collections/dataloader.js';
3
2
  export const virtualFieldPopulationPromise = async ({ name, draft, fallbackLocale, fields, hasMany, locale, overrideAccess, ref, req, segments, showHiddenFields, siblingDoc })=>{
4
3
  const currentSegment = segments.shift();
@@ -77,7 +76,6 @@ export const virtualFieldPopulationPromise = async ({ name, draft, fallbackLocal
77
76
  const collectionSlug = currentField.relationTo;
78
77
  const populatedDocs = await Promise.all(docIDs.map((docID)=>{
79
78
  return req.payloadDataLoader.load(createDataloaderCacheKey({
80
- branch: resolveBranch(req),
81
79
  collectionSlug,
82
80
  currentDepth: 0,
83
81
  depth: 0,
@@ -128,7 +126,6 @@ export const virtualFieldPopulationPromise = async ({ name, draft, fallbackLocal
128
126
  return;
129
127
  }
130
128
  const populatedDoc = await req.payloadDataLoader.load(createDataloaderCacheKey({
131
- branch: resolveBranch(req),
132
129
  collectionSlug: currentField.relationTo,
133
130
  currentDepth: 0,
134
131
  depth: 0,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/fields/hooks/afterRead/virtualFieldPopulationPromise.ts"],"sourcesContent":["import type { TypedFallbackLocale } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\nimport type { FlattenedField } from '../../config/types.js'\n\nimport { resolveBranch } from '../../../branching/resolveBranch.js'\nimport { createDataloaderCacheKey } from '../../../collections/dataloader.js'\n\nexport const virtualFieldPopulationPromise = async ({\n name,\n draft,\n fallbackLocale,\n fields,\n hasMany,\n locale,\n overrideAccess,\n ref,\n req,\n segments,\n showHiddenFields,\n siblingDoc,\n}: {\n draft: boolean\n fallbackLocale: TypedFallbackLocale\n fields: FlattenedField[]\n hasMany?: boolean\n locale: string\n name: string\n overrideAccess: boolean\n ref: any\n req: PayloadRequest\n segments: string[]\n shift?: boolean\n showHiddenFields: boolean\n siblingDoc: Record<string, unknown>\n}): Promise<void> => {\n const currentSegment = segments.shift()\n\n if (!currentSegment) {\n return\n }\n\n const currentValue = ref[currentSegment]\n\n if (typeof currentValue === 'undefined') {\n return\n }\n\n // Final step\n if (segments.length === 0) {\n if (hasMany) {\n if (!Array.isArray(siblingDoc[name])) {\n siblingDoc[name] = []\n }\n ;(siblingDoc[name] as any[]).push(currentValue)\n } else {\n siblingDoc[name] = currentValue\n }\n return\n }\n\n const currentField = fields.find((each) => each.name === currentSegment)\n\n if (!currentField) {\n return\n }\n\n if (currentField.type === 'group' || currentField.type === 'tab') {\n if (!currentValue || typeof currentValue !== 'object') {\n return\n }\n\n return virtualFieldPopulationPromise({\n name,\n draft,\n fallbackLocale,\n fields: currentField.flattenedFields,\n locale,\n overrideAccess,\n ref: currentValue,\n req,\n segments,\n showHiddenFields,\n siblingDoc,\n })\n }\n\n if (\n (currentField.type === 'relationship' || currentField.type === 'upload') &&\n typeof currentField.relationTo === 'string'\n ) {\n const select = {}\n let currentSelectRef: any = select\n const currentFields = req.payload.collections[currentField.relationTo]?.config.flattenedFields\n\n for (let i = 0; i < segments.length; i++) {\n const field = currentFields?.find((each) => each.name === segments[i])\n\n const shouldBreak =\n i === segments.length - 1 || field?.type === 'relationship' || field?.type === 'upload'\n\n currentSelectRef[segments[i]!] = shouldBreak ? true : {}\n currentSelectRef = currentSelectRef[segments[i]!]\n\n if (shouldBreak) {\n break\n }\n }\n\n if (currentField.hasMany) {\n if (!Array.isArray(currentValue)) {\n return\n }\n\n const docIDs = currentValue\n .map((e) => {\n if (!e) {\n return null\n }\n if (typeof e === 'object') {\n return e.id\n }\n return e\n })\n .filter((e) => typeof e === 'string' || typeof e === 'number')\n\n if (segments[0] === 'id' && segments.length === 0) {\n siblingDoc[name] = docIDs\n return\n }\n\n const collectionSlug = currentField.relationTo\n\n const populatedDocs = await Promise.all(\n docIDs.map((docID) => {\n return req.payloadDataLoader.load(\n createDataloaderCacheKey({\n branch: resolveBranch(req),\n collectionSlug,\n currentDepth: 0,\n depth: 0,\n docID,\n draft,\n fallbackLocale,\n locale,\n overrideAccess,\n select,\n showHiddenFields,\n transactionID: req.transactionID as number,\n }),\n )\n }),\n )\n\n for (const doc of populatedDocs) {\n if (!doc) {\n continue\n }\n\n await virtualFieldPopulationPromise({\n name,\n draft,\n fallbackLocale,\n fields: req.payload.collections[currentField.relationTo]!.config.flattenedFields,\n hasMany: true,\n locale,\n overrideAccess,\n ref: doc,\n req,\n segments: [...segments],\n showHiddenFields,\n siblingDoc,\n })\n }\n\n return\n }\n\n let docID: number | string\n\n if (typeof currentValue === 'object' && currentValue) {\n docID = currentValue.id\n } else {\n docID = currentValue\n }\n\n if (segments[0] === 'id' && segments.length === 0) {\n siblingDoc[name] = docID\n return\n }\n\n if (typeof docID !== 'string' && typeof docID !== 'number') {\n return\n }\n\n const populatedDoc = await req.payloadDataLoader.load(\n createDataloaderCacheKey({\n branch: resolveBranch(req),\n collectionSlug: currentField.relationTo,\n currentDepth: 0,\n depth: 0,\n docID,\n draft,\n fallbackLocale,\n locale,\n overrideAccess,\n select,\n showHiddenFields,\n transactionID: req.transactionID as number,\n }),\n )\n\n if (!populatedDoc) {\n return\n }\n\n return virtualFieldPopulationPromise({\n name,\n draft,\n fallbackLocale,\n fields: req.payload.collections[currentField.relationTo]!.config.flattenedFields,\n hasMany,\n locale,\n overrideAccess,\n ref: populatedDoc,\n req,\n segments,\n showHiddenFields,\n siblingDoc,\n })\n }\n}\n"],"names":["resolveBranch","createDataloaderCacheKey","virtualFieldPopulationPromise","name","draft","fallbackLocale","fields","hasMany","locale","overrideAccess","ref","req","segments","showHiddenFields","siblingDoc","currentSegment","shift","currentValue","length","Array","isArray","push","currentField","find","each","type","flattenedFields","relationTo","select","currentSelectRef","currentFields","payload","collections","config","i","field","shouldBreak","docIDs","map","e","id","filter","collectionSlug","populatedDocs","Promise","all","docID","payloadDataLoader","load","branch","currentDepth","depth","transactionID","doc","populatedDoc"],"mappings":"AAIA,SAASA,aAAa,QAAQ,sCAAqC;AACnE,SAASC,wBAAwB,QAAQ,qCAAoC;AAE7E,OAAO,MAAMC,gCAAgC,OAAO,EAClDC,IAAI,EACJC,KAAK,EACLC,cAAc,EACdC,MAAM,EACNC,OAAO,EACPC,MAAM,EACNC,cAAc,EACdC,GAAG,EACHC,GAAG,EACHC,QAAQ,EACRC,gBAAgB,EAChBC,UAAU,EAeX;IACC,MAAMC,iBAAiBH,SAASI,KAAK;IAErC,IAAI,CAACD,gBAAgB;QACnB;IACF;IAEA,MAAME,eAAeP,GAAG,CAACK,eAAe;IAExC,IAAI,OAAOE,iBAAiB,aAAa;QACvC;IACF;IAEA,aAAa;IACb,IAAIL,SAASM,MAAM,KAAK,GAAG;QACzB,IAAIX,SAAS;YACX,IAAI,CAACY,MAAMC,OAAO,CAACN,UAAU,CAACX,KAAK,GAAG;gBACpCW,UAAU,CAACX,KA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ACjDJ,UAAU,CAACX,KAAK,GAAG2C;YACnB;QACF;QAEA,IAAI,OAAOA,UAAU,YAAY,OAAOA,UAAU,UAAU;YAC1D;QACF;QAEA,MAAMQ,eAAe,MAAM3C,IAAIoC,iBAAiB,CAACC,IAAI,CACnD/C,yBAAyB;YACvBgD,QAAQjD,cAAcW;YACtB+B,gBAAgBpB,aAAaK,UAAU;YACvCuB,cAAc;YACdC,OAAO;YACPL;YACA1C;YACAC;YACAG;YACAC;YACAmB;YACAf;YACAuC,eAAezC,IAAIyC,aAAa;QAClC;QAGF,IAAI,CAACE,cAAc;YACjB;QACF;QAEA,OAAOpD,8BAA8B;YACnCC;YACAC;YACAC;YACAC,QAAQK,IAAIoB,OAAO,CAACC,WAAW,CAACV,aAAaK,UAAU,CAAC,CAAEM,MAAM,CAACP,eAAe;YAChFnB;YACAC;YACAC;YACAC,KAAK4C;YACL3C;YACAC;YACAC;YACAC;QACF;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/fields/hooks/afterRead/virtualFieldPopulationPromise.ts"],"sourcesContent":["import type { TypedFallbackLocale } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\nimport type { FlattenedField } from '../../config/types.js'\n\nimport { createDataloaderCacheKey } from '../../../collections/dataloader.js'\n\nexport const virtualFieldPopulationPromise = async ({\n name,\n draft,\n fallbackLocale,\n fields,\n hasMany,\n locale,\n overrideAccess,\n ref,\n req,\n segments,\n showHiddenFields,\n siblingDoc,\n}: {\n draft: boolean\n fallbackLocale: TypedFallbackLocale\n fields: FlattenedField[]\n hasMany?: boolean\n locale: string\n name: string\n overrideAccess: boolean\n ref: any\n req: PayloadRequest\n segments: string[]\n shift?: boolean\n showHiddenFields: boolean\n siblingDoc: Record<string, unknown>\n}): Promise<void> => {\n const currentSegment = segments.shift()\n\n if (!currentSegment) {\n return\n }\n\n const currentValue = ref[currentSegment]\n\n if (typeof currentValue === 'undefined') {\n return\n }\n\n // Final step\n if (segments.length === 0) {\n if (hasMany) {\n if (!Array.isArray(siblingDoc[name])) {\n siblingDoc[name] = []\n }\n ;(siblingDoc[name] as any[]).push(currentValue)\n } else {\n siblingDoc[name] = currentValue\n }\n return\n }\n\n const currentField = fields.find((each) => each.name === currentSegment)\n\n if (!currentField) {\n return\n }\n\n if (currentField.type === 'group' || currentField.type === 'tab') {\n if (!currentValue || typeof currentValue !== 'object') {\n return\n }\n\n return virtualFieldPopulationPromise({\n name,\n draft,\n fallbackLocale,\n fields: currentField.flattenedFields,\n locale,\n overrideAccess,\n ref: currentValue,\n req,\n segments,\n showHiddenFields,\n siblingDoc,\n })\n }\n\n if (\n (currentField.type === 'relationship' || currentField.type === 'upload') &&\n typeof currentField.relationTo === 'string'\n ) {\n const select = {}\n let currentSelectRef: any = select\n const currentFields = req.payload.collections[currentField.relationTo]?.config.flattenedFields\n\n for (let i = 0; i < segments.length; i++) {\n const field = currentFields?.find((each) => each.name === segments[i])\n\n const shouldBreak =\n i === segments.length - 1 || field?.type === 'relationship' || field?.type === 'upload'\n\n currentSelectRef[segments[i]!] = shouldBreak ? true : {}\n currentSelectRef = currentSelectRef[segments[i]!]\n\n if (shouldBreak) {\n break\n }\n }\n\n if (currentField.hasMany) {\n if (!Array.isArray(currentValue)) {\n return\n }\n\n const docIDs = currentValue\n .map((e) => {\n if (!e) {\n return null\n }\n if (typeof e === 'object') {\n return e.id\n }\n return e\n })\n .filter((e) => typeof e === 'string' || typeof e === 'number')\n\n if (segments[0] === 'id' && segments.length === 0) {\n siblingDoc[name] = docIDs\n return\n }\n\n const collectionSlug = currentField.relationTo\n\n const populatedDocs = await Promise.all(\n docIDs.map((docID) => {\n return req.payloadDataLoader.load(\n createDataloaderCacheKey({\n collectionSlug,\n currentDepth: 0,\n depth: 0,\n docID,\n draft,\n fallbackLocale,\n locale,\n overrideAccess,\n select,\n showHiddenFields,\n transactionID: req.transactionID as number,\n }),\n )\n }),\n )\n\n for (const doc of populatedDocs) {\n if (!doc) {\n continue\n }\n\n await virtualFieldPopulationPromise({\n name,\n draft,\n fallbackLocale,\n fields: req.payload.collections[currentField.relationTo]!.config.flattenedFields,\n hasMany: true,\n locale,\n overrideAccess,\n ref: doc,\n req,\n segments: [...segments],\n showHiddenFields,\n siblingDoc,\n })\n }\n\n return\n }\n\n let docID: number | string\n\n if (typeof currentValue === 'object' && currentValue) {\n docID = currentValue.id\n } else {\n docID = currentValue\n }\n\n if (segments[0] === 'id' && segments.length === 0) {\n siblingDoc[name] = docID\n return\n }\n\n if (typeof docID !== 'string' && typeof docID !== 'number') {\n return\n }\n\n const populatedDoc = await req.payloadDataLoader.load(\n createDataloaderCacheKey({\n collectionSlug: currentField.relationTo,\n currentDepth: 0,\n depth: 0,\n docID,\n draft,\n fallbackLocale,\n locale,\n overrideAccess,\n select,\n showHiddenFields,\n transactionID: req.transactionID as number,\n }),\n )\n\n if (!populatedDoc) {\n return\n }\n\n return virtualFieldPopulationPromise({\n name,\n draft,\n fallbackLocale,\n fields: req.payload.collections[currentField.relationTo]!.config.flattenedFields,\n hasMany,\n locale,\n overrideAccess,\n ref: populatedDoc,\n req,\n segments,\n showHiddenFields,\n siblingDoc,\n })\n }\n}\n"],"names":["createDataloaderCacheKey","virtualFieldPopulationPromise","name","draft","fallbackLocale","fields","hasMany","locale","overrideAccess","ref","req","segments","showHiddenFields","siblingDoc","currentSegment","shift","currentValue","length","Array","isArray","push","currentField","find","each","type","flattenedFields","relationTo","select","currentSelectRef","currentFields","payload","collections","config","i","field","shouldBreak","docIDs","map","e","id","filter","collectionSlug","populatedDocs","Promise","all","docID","payloadDataLoader","load","currentDepth","depth","transactionID","doc","populatedDoc"],"mappings":"AAIA,SAASA,wBAAwB,QAAQ,qCAAoC;AAE7E,OAAO,MAAMC,gCAAgC,OAAO,EAClDC,IAAI,EACJC,KAAK,EACLC,cAAc,EACdC,MAAM,EACNC,OAAO,EACPC,MAAM,EACNC,cAAc,EACdC,GAAG,EACHC,GAAG,EACHC,QAAQ,EACRC,gBAAgB,EAChBC,UA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AC;oBACAC,KAAK0C;oBACLzC;oBACAC,UAAU;2BAAIA;qBAAS;oBACvBC;oBACAC;gBACF;YACF;YAEA;QACF;QAEA,IAAIgC;QAEJ,IAAI,OAAO7B,iBAAiB,YAAYA,cAAc;YACpD6B,QAAQ7B,aAAauB,EAAE;QACzB,OAAO;YACLM,QAAQ7B;QACV;QAEA,IAAIL,QAAQ,CAAC,EAAE,KAAK,QAAQA,SAASM,MAAM,KAAK,GAAG;YACjDJ,UAAU,CAACX,KAAK,GAAG2C;YACnB;QACF;QAEA,IAAI,OAAOA,UAAU,YAAY,OAAOA,UAAU,UAAU;YAC1D;QACF;QAEA,MAAMO,eAAe,MAAM1C,IAAIoC,iBAAiB,CAACC,IAAI,CACnD/C,yBAAyB;YACvByC,gBAAgBpB,aAAaK,UAAU;YACvCsB,cAAc;YACdC,OAAO;YACPJ;YACA1C;YACAC;YACAG;YACAC;YACAmB;YACAf;YACAsC,eAAexC,IAAIwC,aAAa;QAClC;QAGF,IAAI,CAACE,cAAc;YACjB;QACF;QAEA,OAAOnD,8BAA8B;YACnCC;YACAC;YACAC;YACAC,QAAQK,IAAIoB,OAAO,CAACC,WAAW,CAACV,aAAaK,UAAU,CAAC,CAAEM,MAAM,CAACP,eAAe;YAChFnB;YACAC;YACAC;YACAC,KAAK2C;YACL1C;YACAC;YACAC;YACAC;QACF;IACF;AACF,EAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Payload } from '../../../index.js';
2
+ import type { JsonObject } from '../../../types/index.js';
3
+ import type { Field, TabAsField } from '../../config/types.js';
4
+ type Args = {
5
+ config: Payload['config'];
6
+ data: JsonObject;
7
+ fields: (Field | TabAsField)[];
8
+ locale: string;
9
+ parentIsLocalized?: boolean;
10
+ };
11
+ /** Projects validation context to one locale without running hooks or changing the write data. */
12
+ export declare function flattenValidationData({ config, data, fields, locale, parentIsLocalized, }: Args): JsonObject;
13
+ export {};
14
+ //# sourceMappingURL=flattenValidationData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flattenValidationData.d.ts","sourceRoot":"","sources":["../../../../src/fields/hooks/beforeChange/flattenValidationData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAM9D,KAAK,IAAI,GAAG;IACV,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;IACzB,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,CAAC,KAAK,GAAG,UAAU,CAAC,EAAE,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B,CAAA;AAED,kGAAkG;AAClG,wBAAgB,qBAAqB,CAAC,EACpC,MAAM,EACN,IAAI,EACJ,MAAM,EACN,MAAM,EACN,iBAAyB,GAC1B,EAAE,IAAI,GAAG,UAAU,CAgCnB"}
@@ -0,0 +1,36 @@
1
+ import { deepCopyObjectSimple } from '../../../utilities/deepCopyObject.js';
2
+ import { traverseFields } from '../../../utilities/traverseFields.js';
3
+ import { fieldAffectsData, fieldShouldBeLocalized } from '../../config/types.js';
4
+ /** Projects validation context to one locale without running hooks or changing the write data. */ export function flattenValidationData({ config, data, fields, locale, parentIsLocalized = false }) {
5
+ // Each locale needs its own projection. Merged contexts also retain source array references.
6
+ const result = deepCopyObjectSimple(data);
7
+ const localizedFields = [];
8
+ traverseFields({
9
+ callback: ({ field, parentIsLocalized, ref })=>{
10
+ if (fieldAffectsData(field) && field.name && fieldShouldBeLocalized({
11
+ field,
12
+ parentIsLocalized
13
+ })) {
14
+ localizedFields.push({
15
+ name: field.name,
16
+ ref: ref
17
+ });
18
+ }
19
+ },
20
+ config,
21
+ fields,
22
+ fillEmpty: false,
23
+ parentIsLocalized,
24
+ ref: result
25
+ });
26
+ // Keep locale maps intact while traversing, then project children before their containers.
27
+ for (const { name, ref } of localizedFields.reverse()){
28
+ const value = ref[name];
29
+ if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
30
+ ref[name] = value[locale];
31
+ }
32
+ }
33
+ return result;
34
+ }
35
+
36
+ //# sourceMappingURL=flattenValidationData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/fields/hooks/beforeChange/flattenValidationData.ts"],"sourcesContent":["import type { Payload } from '../../../index.js'\nimport type { JsonObject } from '../../../types/index.js'\nimport type { Field, TabAsField } from '../../config/types.js'\n\nimport { deepCopyObjectSimple } from '../../../utilities/deepCopyObject.js'\nimport { traverseFields } from '../../../utilities/traverseFields.js'\nimport { fieldAffectsData, fieldShouldBeLocalized } from '../../config/types.js'\n\ntype Args = {\n config: Payload['config']\n data: JsonObject\n fields: (Field | TabAsField)[]\n locale: string\n parentIsLocalized?: boolean\n}\n\n/** Projects validation context to one locale without running hooks or changing the write data. */\nexport function flattenValidationData({\n config,\n data,\n fields,\n locale,\n parentIsLocalized = false,\n}: Args): JsonObject {\n // Each locale needs its own projection. Merged contexts also retain source array references.\n const result = deepCopyObjectSimple(data)\n const localizedFields: { name: string; ref: JsonObject }[] = []\n\n traverseFields({\n callback: ({ field, parentIsLocalized, ref }) => {\n if (\n fieldAffectsData(field) &&\n field.name &&\n fieldShouldBeLocalized({ field, parentIsLocalized })\n ) {\n localizedFields.push({ name: field.name, ref: ref as JsonObject })\n }\n },\n config,\n fields,\n fillEmpty: false,\n parentIsLocalized,\n ref: result,\n })\n\n // Keep locale maps intact while traversing, then project children before their containers.\n for (const { name, ref } of localizedFields.reverse()) {\n const value = ref[name]\n\n if (value !== null && typeof value === 'object' && !Array.isArray(value)) {\n ref[name] = value[locale]\n }\n }\n\n return result\n}\n"],"names":["deepCopyObjectSimple","traverseFields","fieldAffectsData","fieldShouldBeLocalized","flattenValidationData","config","data","fields","locale","parentIsLocalized","result","localizedFields","callback","field","ref","name","push","fillEmpty","reverse","value","Array","isArray"],"mappings":"AAIA,SAASA,oBAAoB,QAAQ,uCAAsC;AAC3E,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,gBAAgB,EAAEC,sBAAsB,QAAQ,wBAAuB;AAUhF,gGAAgG,GAChG,OAAO,SAASC,sBAAsB,EACpCC,MAAM,EACNC,IAAI,EACJC,MAAM,EACNC,MAAM,EACNC,oBAAoB,KAAK,EACpB;IACL,6FAA6F;IAC7F,MAAMC,SAASV,qBAAqBM;IACpC,MAAMK,kBAAuD,EAAE;IAE/DV,eAAe;QACbW,UAAU,CAAC,EAAEC,KAAK,EAAEJ,iBAAiB,EAAEK,GAAG,EAAE;YAC1C,IACEZ,iBAAiBW,UACjBA,MAAME,IAAI,IACVZ,uBAAuB;gBAAEU;gBAAOJ;YAAkB,IAClD;gBACAE,gBAAgBK,IAAI,CAAC;oBAAED,MAAMF,MAAME,IAAI;oBAAED,KAAKA;gBAAkB;YAClE;QACF;QACAT;QACAE;QACAU,WAAW;QACXR;QACAK,KAAKJ;IACP;IAEA,2FAA2F;IAC3F,KAAK,MAAM,EAAEK,IAAI,EAAED,GAAG,EAAE,IAAIH,gBAAgBO,OAAO,GAAI;QACrD,MAAMC,QAAQL,GAAG,CAACC,KAAK;QAEvB,IAAII,UAAU,QAAQ,OAAOA,UAAU,YAAY,CAACC,MAAMC,OAAO,CAACF,QAAQ;YACxEL,GAAG,CAACC,KAAK,GAAGI,KAAK,CAACX,OAAO;QAC3B;IACF;IAEA,OAAOE;AACT"}
@@ -9,6 +9,7 @@ type Args = {
9
9
  * Data of the nearest parent block. If no parent block exists, this will be the `undefined`
10
10
  */
11
11
  blockData?: JsonObject;
12
+ blockFields?: Field[];
12
13
  collection: null | SanitizedCollectionConfig;
13
14
  context: RequestContext;
14
15
  data: JsonObject;
@@ -42,6 +43,6 @@ type Args = {
42
43
  skipValidation: boolean;
43
44
  submittedTopLevelFieldNames?: ReadonlySet<string>;
44
45
  };
45
- export declare const promise: ({ id, blockData, collection, context, data, doc, docWithLocales, errors, field, fieldIndex, fieldLabelPath, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, siblingFields, skipHooks, skipValidation, submittedTopLevelFieldNames, }: Args) => Promise<void>;
46
+ export declare const promise: ({ id, blockData, blockFields, collection, context, data, doc, docWithLocales, errors, field, fieldIndex, fieldLabelPath, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, siblingFields, skipHooks, skipValidation, submittedTopLevelFieldNames, }: Args) => Promise<void>;
46
47
  export {};
47
48
  //# sourceMappingURL=promise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../../../src/fields/hooks/beforeChange/promise.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAA;AACrF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACzF,OAAO,KAAK,EAAS,KAAK,EAAE,UAAU,EAAY,MAAM,uBAAuB,CAAA;AAG/E,OAAO,EAAE,KAAK,cAAc,EAA+B,MAAM,mBAAmB,CAAA;AAkBpF,KAAK,IAAI,GAAG;IACV;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAA;IACtB,UAAU,EAAE,IAAI,GAAG,yBAAyB,CAAA;IAC5C,OAAO,EAAE,cAAc,CAAA;IACvB,IAAI,EAAE,UAAU,CAAA;IAChB,GAAG,EAAE,UAAU,CAAA;IACf,cAAc,EAAE,UAAU,CAAA;IAC1B,MAAM,EAAE,o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AAO,CAAA;IAClB,cAAc,EAAE,OAAO,CAAA;IACvB,2BAA2B,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAClD,CAAA;AAUD,eAAO,MAAM,OAAO,2YA8BjB,IAAI,KAAG,OAAO,CAAC,IAAI,CAmtBrB,CAAA"}
@@ -2,8 +2,10 @@ import { MissingEditorProp } from '../../../errors/index.js';
2
2
  import { validateBlocksFilterOptions } from '../../../index.js';
3
3
  import { deepMergeWithSourceArrays } from '../../../utilities/deepMerge.js';
4
4
  import { getTranslatedLabel } from '../../../utilities/getTranslatedLabel.js';
5
+ import { isolateObjectProperty } from '../../../utilities/isolateObjectProperty.js';
5
6
  import { fieldAffectsData, fieldShouldBeLocalized, tabHasName } from '../../config/types.js';
6
7
  import { getFieldPaths } from '../../getFieldPaths.js';
8
+ import { flattenValidationData } from './flattenValidationData.js';
7
9
  import { getExistingRowDoc } from './getExistingRowDoc.js';
8
10
  import { traverseFields } from './traverseFields.js';
9
11
  function buildFieldLabel(parentLabel, label) {
@@ -20,7 +22,7 @@ function buildFieldLabel(parentLabel, label) {
20
22
  // - Transform data for storage
21
23
  // - beforeDuplicate hooks (if duplicate)
22
24
  // - Unflatten locales
23
- export const promise = async ({ id, blockData, collection, context, data, doc, docWithLocales, errors, field, fieldIndex, fieldLabelPath, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, siblingFields, skipHooks, skipValidation, submittedTopLevelFieldNames })=>{
25
+ export const promise = async ({ id, blockData, blockFields, collection, context, data, doc, docWithLocales, errors, field, fieldIndex, fieldLabelPath, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, siblingFields, skipHooks, skipValidation, submittedTopLevelFieldNames })=>{
24
26
  const { indexPath, path, schemaPath } = getFieldPaths({
25
27
  field,
26
28
  index: fieldIndex,
@@ -96,6 +98,26 @@ export const promise = async ({ id, blockData, collection, context, data, doc, d
96
98
  // Validate
97
99
  if (!skipValidationFromHere && 'validate' in field && field.validate) {
98
100
  const valueToValidate = siblingData[field.name];
101
+ // With `locale: 'all'` a localized scalar is a locale-keyed object; validate each locale, not the
102
+ // wrapper. Containers (`group`/`array`/`blocks`) are excluded - per-locale child validation is a follow-up.
103
+ const isLocaleKeyedValue = operationLocale === 'all' && localization && fieldShouldBeLocalized({
104
+ field,
105
+ parentIsLocalized
106
+ }) && field.type !== 'group' && valueToValidate !== null && typeof valueToValidate === 'object' && !Array.isArray(valueToValidate);
107
+ const localizedValuesToValidate = isLocaleKeyedValue ? localization.localeCodes.filter((locale)=>locale in valueToValidate).map((locale)=>({
108
+ locale,
109
+ value: valueToValidate[locale]
110
+ })) : [
111
+ {
112
+ value: valueToValidate
113
+ }
114
+ ];
115
+ // No recognized locales (e.g. `{}`): validate `undefined` once so required/optional still apply.
116
+ if (localizedValuesToValidate.length === 0) {
117
+ localizedValuesToValidate.push({
118
+ value: undefined
119
+ });
120
+ }
99
121
  let jsonError;
100
122
  if (field.type === 'json' && typeof siblingData[field.name] === 'string') {
101
123
  try {
@@ -105,25 +127,66 @@ export const promise = async ({ id, blockData, collection, context, data, doc, d
105
127
  }
106
128
  }
107
129
  const validateFn = field.validate;
108
- const validationResult = await validateFn(valueToValidate, {
109
- ...field,
110
- id,
111
- blockData: blockData,
112
- collectionSlug: collection?.slug,
113
- data: deepMergeWithSourceArrays(doc, data),
114
- event: 'submit',
115
- // @ts-expect-error
116
- jsonError,
117
- operation,
118
- overrideAccess,
119
- path: pathSegments,
120
- preferences: {
121
- fields: {}
122
- },
123
- previousValue: siblingDoc[field.name],
124
- req,
125
- siblingData: deepMergeWithSourceArrays(siblingDoc, siblingData)
126
- });
130
+ let validationResult = true;
131
+ let failedLocale;
132
+ const validationData = deepMergeWithSourceArrays(doc, data);
133
+ const validationSiblingData = deepMergeWithSourceArrays(siblingDoc, siblingData);
134
+ for (const { locale, value } of localizedValuesToValidate){
135
+ // Scope `req.locale` to the locale being validated without mutating the shared request.
136
+ const validationReq = locale ? isolateObjectProperty(req, 'locale') : req;
137
+ if (locale) {
138
+ validationReq.locale = locale;
139
+ }
140
+ const localeContext = locale ? {
141
+ blockData: blockData && blockFields ? flattenValidationData({
142
+ config: req.payload.config,
143
+ data: blockData,
144
+ fields: blockFields,
145
+ locale,
146
+ parentIsLocalized
147
+ }) : blockData,
148
+ data: flattenValidationData({
149
+ config: req.payload.config,
150
+ data: validationData,
151
+ fields: collection?.fields || global?.fields,
152
+ locale
153
+ }),
154
+ siblingData: flattenValidationData({
155
+ config: req.payload.config,
156
+ data: validationSiblingData,
157
+ fields: siblingFields,
158
+ locale,
159
+ parentIsLocalized
160
+ })
161
+ } : {
162
+ blockData,
163
+ data: validationData,
164
+ siblingData: validationSiblingData
165
+ };
166
+ validationResult = await validateFn(value, {
167
+ ...field,
168
+ id,
169
+ blockData: localeContext.blockData,
170
+ collectionSlug: collection?.slug,
171
+ data: localeContext.data,
172
+ event: 'submit',
173
+ // @ts-expect-error generic validation options cannot infer JSON fields
174
+ jsonError,
175
+ operation,
176
+ overrideAccess,
177
+ path: pathSegments,
178
+ preferences: {
179
+ fields: {}
180
+ },
181
+ previousValue: locale ? siblingDoc[field.name]?.[locale] : siblingDoc[field.name],
182
+ req: validationReq,
183
+ siblingData: localeContext.siblingData
184
+ });
185
+ if (typeof validationResult === 'string') {
186
+ failedLocale = locale;
187
+ break;
188
+ }
189
+ }
127
190
  if (typeof validationResult === 'string') {
128
191
  let filterOptionsError = false;
129
192
  if (field.type === 'blocks' && field.filterOptions) {
@@ -162,7 +225,7 @@ export const promise = async ({ id, blockData, collection, context, data, doc, d
162
225
  // field itself => only push the error if the field is not a block field with validation failure due to filterOptions
163
226
  const fieldLabel = buildFieldLabel(fieldLabelPath, getTranslatedLabel(field?.label || field?.name, req.i18n));
164
227
  errors.push({
165
- label: fieldLabel,
228
+ label: failedLocale ? `${fieldLabel} (${failedLocale})` : fieldLabel,
166
229
  message: validationResult,
167
230
  path
168
231
  });
@@ -176,8 +239,13 @@ export const promise = async ({ id, blockData, collection, context, data, doc, d
176
239
  })) {
177
240
  mergeLocaleActions.push(()=>{
178
241
  const localeData = {};
242
+ // With `locale: 'all'`, siblingData holds a locale-keyed object (`{ en, es }`) rather than a single
243
+ // locale's value - take each submitted locale, falling back to the existing doc for ones not sent.
244
+ const submittedValue = siblingData[field.name];
245
+ const isAllLocales = req.locale === 'all' && submittedValue !== null && typeof submittedValue === 'object' && !Array.isArray(submittedValue);
179
246
  for (const locale of localization.localeCodes){
180
- const fieldValue = locale === req.locale ? siblingData[field.name] : siblingDocWithLocales?.[field.name]?.[locale];
247
+ const existingValue = siblingDocWithLocales?.[field.name]?.[locale];
248
+ const fieldValue = isAllLocales ? locale in submittedValue ? submittedValue[locale] : existingValue : locale === req.locale ? submittedValue : existingValue;
181
249
  // update locale value if it's not undefined
182
250
  if (typeof fieldValue !== 'undefined') {
183
251
  localeData[locale] = fieldValue;
@@ -200,6 +268,7 @@ export const promise = async ({ id, blockData, collection, context, data, doc, d
200
268
  promises.push(traverseFields({
201
269
  id,
202
270
  blockData,
271
+ blockFields,
203
272
  collection,
204
273
  context,
205
274
  data,
@@ -245,6 +314,7 @@ export const promise = async ({ id, blockData, collection, context, data, doc, d
245
314
  promises.push(traverseFields({
246
315
  id,
247
316
  blockData: row,
317
+ blockFields: block.fields,
248
318
  collection,
249
319
  context,
250
320
  data,
@@ -282,6 +352,7 @@ export const promise = async ({ id, blockData, collection, context, data, doc, d
282
352
  await traverseFields({
283
353
  id,
284
354
  blockData,
355
+ blockFields,
285
356
  collection,
286
357
  context,
287
358
  data,
@@ -342,6 +413,7 @@ export const promise = async ({ id, blockData, collection, context, data, doc, d
342
413
  await traverseFields({
343
414
  id,
344
415
  blockData,
416
+ blockFields,
345
417
  collection,
346
418
  context,
347
419
  data,
@@ -450,6 +522,7 @@ export const promise = async ({ id, blockData, collection, context, data, doc, d
450
522
  await traverseFields({
451
523
  id,
452
524
  blockData,
525
+ blockFields,
453
526
  collection,
454
527
  context,
455
528
  data,
@@ -482,6 +555,7 @@ export const promise = async ({ id, blockData, collection, context, data, doc, d
482
555
  await traverseFields({
483
556
  id,
484
557
  blockData,
558
+ blockFields,
485
559
  collection,
486
560
  context,
487
561
  data,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/fields/hooks/beforeChange/promise.ts"],"sourcesContent":["import type { RichTextAdapter } from '../../../admin/RichText.js'\nimport type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { ValidationFieldError } from '../../../errors/index.js'\nimport type { SanitizedGlobalConfig } from '../../../globals/config/types.js'\nimport type { FieldOperation, JsonObject, PayloadRequest } from '../../../types/index.js'\nimport type { Block, Field, TabAsField, Validate } from '../../config/types.js'\n\nimport { MissingEditorProp } from '../../../errors/index.js'\nimport { type RequestContext, validateBlocksFilterOptions } from '../../../index.js'\nimport { deepMergeWithSourceArrays } from '../../../utilities/deepMerge.js'\nimport { getTranslatedLabel } from '../../../utilities/getTranslatedLabel.js'\nimport { fieldAffectsData, fieldShouldBeLocalized, tabHasName } from '../../config/types.js'\nimport { getFieldPaths } from '../../getFieldPaths.js'\nimport { getExistingRowDoc } from './getExistingRowDoc.js'\nimport { traverseFields } from './traverseFields.js'\n\nfunction buildFieldLabel(parentLabel: string, label: string | undefined): string {\n if (!label) {\n return parentLabel\n }\n const capitalizedLabel = label.charAt(0).toUpperCase() + label.slice(1)\n return parentLabel && capitalizedLabel\n ? `${parentLabel} > ${capitalizedLabel}`\n : capitalizedLabel || parentLabel\n}\n\ntype Args = {\n /**\n * Data of the nearest parent block. If no parent block exists, this will be the `undefined`\n */\n blockData?: JsonObject\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n data: JsonObject\n doc: JsonObject\n docWithLocales: JsonObject\n errors: ValidationFieldError[]\n field: Field | TabAsField\n fieldIndex: number\n /**\n * Built up labels of parent fields\n *\n * @example \"Group Field > Tab Field > Text Field\"\n */\n fieldLabelPath: string\n global: null | SanitizedGlobalConfig\n id?: number | string\n isValidationOperation: boolean\n mergeLocaleActions: (() => Promise<void> | void)[]\n operation: FieldOperation\n overrideAccess: boolean\n parentIndexPath: string\n parentIsLocalized: boolean\n parentPath: string\n parentSchemaPath: string\n req: PayloadRequest\n siblingData: JsonObject\n siblingDoc: JsonObject\n siblingDocWithLocales?: JsonObject\n siblingFields?: (Field | TabAsField)[]\n skipHooks: boolean\n skipValidation: boolean\n submittedTopLevelFieldNames?: ReadonlySet<string>\n}\n\n// This function is responsible for the following actions, in order:\n// - Run condition\n// - Execute field hooks\n// - Validate data\n// - Transform data for storage\n// - beforeDuplicate hooks (if duplicate)\n// - Unflatten locales\n\nexport const promise = async ({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n field,\n fieldIndex,\n fieldLabelPath,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales,\n siblingFields,\n skipHooks,\n skipValidation,\n submittedTopLevelFieldNames,\n}: Args): Promise<void> => {\n const { indexPath, path, schemaPath } = getFieldPaths({\n field,\n index: fieldIndex,\n parentIndexPath,\n parentPath,\n parentSchemaPath,\n })\n\n const { localization } = req.payload.config\n const defaultLocale = localization ? localization?.defaultLocale : 'en'\n const operationLocale = req.locale || defaultLocale\n\n const pathSegments = path ? path.split('.') : []\n const schemaPathSegments = schemaPath ? schemaPath.split('.') : []\n const indexPathSegments = indexPath ? indexPath.split('-').filter(Boolean)?.map(Number) : []\n\n const passesCondition = field.admin?.condition\n ? Boolean(\n field.admin.condition(data, siblingData, {\n blockData: blockData!,\n operation,\n path: pathSegments,\n user: req.user,\n }),\n )\n : true\n const isOutsideSubmittedFieldScope =\n submittedTopLevelFieldNames !== undefined &&\n fieldAffectsData(field) &&\n !submittedTopLevelFieldNames.has(pathSegments[0]!)\n let skipValidationFromHere = skipValidation || isOutsideSubmittedFieldScope || !passesCondition\n\n if (fieldAffectsData(field)) {\n const shouldSkipValidationForLocalizedFallback =\n !isValidationOperation &&\n operation !== 'validate' &&\n fieldShouldBeLocalized({ field, parentIsLocalized }) &&\n operationLocale !== defaultLocale &&\n ['array', 'blocks'].includes(field.type) &&\n siblingData[field.name!] === null\n\n if (shouldSkipValidationForLocalizedFallback) {\n skipValidationFromHere = true\n }\n\n // Execute hooks\n if (!skipHooks && 'hooks' in field && field.hooks?.beforeChange) {\n for (const hook of field.hooks.beforeChange) {\n const hookedValue = await hook({\n blockData,\n collection,\n context,\n data,\n field,\n global,\n indexPath: indexPathSegments,\n operation,\n originalDoc: doc,\n overrideAccess,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingDoc[field.name],\n req,\n schemaPath: schemaPathSegments,\n siblingData,\n siblingDocWithLocales,\n siblingFields: siblingFields!,\n value: siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n\n if (hasInvalidFieldValueShape({ field, value: siblingData[field.name!] })) {\n errors.push({\n label: buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n ),\n message: req.t('validation:invalidInput'),\n path,\n })\n return\n }\n\n // Validate\n if (!skipValidationFromHere && 'validate' in field && field.validate) {\n const valueToValidate = siblingData[field.name]\n let jsonError: object\n\n if (field.type === 'json' && typeof siblingData[field.name] === 'string') {\n try {\n JSON.parse(siblingData[field.name] as string)\n } catch (e) {\n jsonError = e as object\n }\n }\n\n const validateFn: Validate<object, object, object, object> = field.validate as Validate<\n object,\n object,\n object,\n object\n >\n\n const validationResult = await validateFn(valueToValidate as never, {\n ...field,\n id,\n blockData: blockData!,\n collectionSlug: collection?.slug,\n data: deepMergeWithSourceArrays(doc, data),\n event: 'submit',\n // @ts-expect-error\n jsonError,\n operation,\n overrideAccess,\n path: pathSegments,\n preferences: { fields: {} },\n previousValue: siblingDoc[field.name],\n req,\n siblingData: deepMergeWithSourceArrays(siblingDoc, siblingData),\n })\n\n if (typeof validationResult === 'string') {\n let filterOptionsError = false\n\n if (field.type === 'blocks' && field.filterOptions) {\n // Re-run filteroptions. If the validation error is due to filteroptions, we need to add error paths to all the blocks\n // that are no longer valid\n const validationResult = await validateBlocksFilterOptions({\n id,\n data,\n filterOptions: field.filterOptions,\n req,\n siblingData,\n value: siblingData[field.name],\n })\n if (validationResult?.invalidBlockSlugs?.length) {\n filterOptionsError = true\n let rowIndex = -1\n for (const block of siblingData[field.name] as JsonObject[]) {\n rowIndex++\n if (validationResult.invalidBlockSlugs.includes(block.blockType as string)) {\n const blockConfigOrSlug = field.blocks.find((blockFromField) =>\n typeof blockFromField === 'string'\n ? blockFromField === block.blockType\n : blockFromField.slug === block.blockType,\n )\n const blockConfig =\n typeof blockConfigOrSlug === 'string'\n ? req.payload.blocks[blockConfigOrSlug]\n : blockConfigOrSlug\n\n const blockLabelPath =\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} > ${req.t('fields:block')} ${rowIndex + 1} (${getTranslatedLabel(blockConfig?.labels?.singular || block.blockType, req.i18n)})`,\n )\n\n errors.push({\n label: blockLabelPath,\n message: req.t('validation:invalidBlock', { block: block.blockType }),\n path: `${path}.${rowIndex}.id`,\n })\n }\n }\n }\n }\n\n if (!filterOptionsError) {\n // If the error is due to block filterOptions, we want to push the errors for each individual block, not the blocks\n // field itself => only push the error if the field is not a block field with validation failure due to filterOptions\n const fieldLabel = buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n )\n\n errors.push({\n label: fieldLabel,\n message: validationResult,\n path,\n })\n }\n }\n }\n\n // Push merge locale action if applicable\n if (localization && fieldShouldBeLocalized({ field, parentIsLocalized })) {\n mergeLocaleActions.push(() => {\n const localeData: Record<string, unknown> = {}\n\n for (const locale of localization.localeCodes) {\n const fieldValue =\n locale === req.locale\n ? siblingData[field.name!]\n : siblingDocWithLocales?.[field.name!]?.[locale]\n\n // update locale value if it's not undefined\n if (typeof fieldValue !== 'undefined') {\n localeData[locale] = fieldValue\n }\n }\n\n // If there are locales with data, set the data\n if (Object.keys(localeData).length > 0) {\n siblingData[field.name!] = localeData\n }\n })\n }\n }\n\n switch (field.type) {\n case 'array': {\n const rows = siblingData[field.name]\n\n if (Array.isArray(rows)) {\n const promises: Promise<void>[] = []\n\n rows.forEach((row, rowIndex) => {\n promises.push(\n traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} ${rowIndex + 1}`,\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath,\n req,\n siblingData: row as JsonObject,\n siblingDoc: getExistingRowDoc(row as JsonObject, siblingDoc[field.name]),\n siblingDocWithLocales: getExistingRowDoc(\n row as JsonObject,\n siblingDocWithLocales?.[field.name],\n ),\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n }),\n )\n })\n\n await Promise.all(promises)\n }\n\n break\n }\n\n case 'blocks': {\n const rows = siblingData[field.name]\n if (Array.isArray(rows)) {\n const promises: Promise<void>[] = []\n\n rows.forEach((row, rowIndex) => {\n const rowSiblingDoc = getExistingRowDoc(row as JsonObject, siblingDoc[field.name])\n\n const rowSiblingDocWithLocales = getExistingRowDoc(\n row as JsonObject,\n siblingDocWithLocales ? siblingDocWithLocales[field.name] : {},\n )\n\n const blockTypeToMatch = (row as JsonObject).blockType || rowSiblingDoc.blockType\n\n const block: Block | undefined =\n req.payload.blocks[blockTypeToMatch] ??\n (field.blocks.find(\n (curBlock) => typeof curBlock !== 'string' && curBlock.slug === blockTypeToMatch,\n ) as Block | undefined)\n\n const blockLabelPath =\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} > ${req.t('fields:block')} ${rowIndex + 1} (${getTranslatedLabel(block?.labels?.singular || blockTypeToMatch, req.i18n)})`,\n )\n\n if (block) {\n promises.push(\n traverseFields({\n id,\n blockData: row,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath: blockLabelPath,\n\n fields: block.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath + '.' + block.slug,\n req,\n siblingData: row as JsonObject,\n siblingDoc: rowSiblingDoc,\n siblingDocWithLocales: rowSiblingDocWithLocales,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n }),\n )\n }\n })\n\n await Promise.all(promises)\n }\n\n break\n }\n\n case 'collapsible':\n case 'row': {\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field.type === 'row' || field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.type, req.i18n),\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales: siblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n case 'group': {\n let groupSiblingData = siblingData\n let groupSiblingDoc = siblingDoc\n let groupSiblingDocWithLocales = siblingDocWithLocales\n\n const isNamedGroup = fieldAffectsData(field)\n\n if (isNamedGroup) {\n if (typeof siblingData[field.name] !== 'object') {\n siblingData[field.name] = {}\n }\n\n if (typeof siblingDoc[field.name] !== 'object') {\n siblingDoc[field.name] = {}\n }\n\n if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\n if (typeof siblingData[field.name] !== 'object') {\n siblingData[field.name] = {}\n }\n\n if (typeof siblingDoc[field.name] !== 'object') {\n siblingDoc[field.name] = {}\n }\n\n if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\n\n groupSiblingData = siblingData[field.name] as JsonObject\n groupSiblingDoc = siblingDoc[field.name] as JsonObject\n groupSiblingDocWithLocales = siblingDocWithLocales![field.name] as JsonObject\n }\n\n const fallbackLabel = field?.label || (isNamedGroup ? field.name : field?.type)\n\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(fieldLabelPath, getTranslatedLabel(fallbackLabel, req.i18n)),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: isNamedGroup ? '' : indexPath,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: isNamedGroup ? path : parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData: groupSiblingData,\n siblingDoc: groupSiblingDoc,\n siblingDocWithLocales: groupSiblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n case 'point': {\n // Transform point data for storage\n if (\n Array.isArray(siblingData[field.name]) &&\n siblingData[field.name][0] !== null &&\n siblingData[field.name][1] !== null\n ) {\n siblingData[field.name] = {\n type: 'Point',\n coordinates: [\n parseFloat(siblingData[field.name][0]),\n parseFloat(siblingData[field.name][1]),\n ],\n }\n }\n\n break\n }\n\n case 'richText': {\n if (!field?.editor) {\n throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n }\n\n if (typeof field?.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n\n const editor: RichTextAdapter = field?.editor\n\n if (!skipHooks && editor?.hooks?.beforeChange?.length) {\n for (const hook of editor.hooks.beforeChange) {\n const hookedValue = await hook({\n collection,\n context,\n data,\n docWithLocales,\n errors,\n field,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n ),\n global,\n indexPath: indexPathSegments,\n mergeLocaleActions,\n operation,\n originalDoc: doc,\n overrideAccess,\n parentIsLocalized,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingDoc[field.name],\n req,\n schemaPath: schemaPathSegments,\n siblingData,\n siblingDocWithLocales,\n skipValidation: skipValidationFromHere,\n value: siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n\n break\n }\n\n case 'tab': {\n let tabSiblingData = siblingData\n let tabSiblingDoc = siblingDoc\n let tabSiblingDocWithLocales = siblingDocWithLocales\n\n const isNamedTab = tabHasName(field)\n\n if (isNamedTab) {\n if (typeof siblingData[field.name] !== 'object') {\n siblingData[field.name] = {}\n }\n\n if (typeof siblingDoc[field.name] !== 'object') {\n siblingDoc[field.name] = {}\n }\n\n if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\n\n tabSiblingData = siblingData[field.name] as JsonObject\n tabSiblingDoc = siblingDoc[field.name] as JsonObject\n tabSiblingDocWithLocales = siblingDocWithLocales![field.name] as JsonObject\n }\n\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field.name, req.i18n),\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: isNamedTab ? '' : indexPath,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: isNamedTab ? path : parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData: tabSiblingData,\n siblingDoc: tabSiblingDoc,\n siblingDocWithLocales: tabSiblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n case 'tabs': {\n await traverseFields({\n id,\n blockData,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(fieldLabelPath, getTranslatedLabel(field?.label || '', req.i18n)),\n fields: field.tabs.map((tab) => ({ ...tab, type: 'tab' })),\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath: path,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales: siblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n default: {\n break\n }\n }\n}\n\nfunction hasInvalidFieldValueShape({\n field,\n value,\n}: {\n field: Field | TabAsField\n value: unknown\n}): boolean {\n if (value === null || typeof value === 'undefined' || !fieldAffectsData(field)) {\n return false\n }\n\n if (field.type === 'array' || field.type === 'blocks') {\n // Form state may use a numeric row count, while submitted values use arrays.\n return !(Array.isArray(value) || typeof value === 'number')\n }\n\n if (field.type === 'number') {\n // Only hasMany number fields may receive arrays.\n return typeof value === 'object' && !(field.hasMany && Array.isArray(value))\n }\n\n if ((field.type === 'relationship' || field.type === 'upload') && field.hasMany) {\n // HasMany relationships/uploads may receive arrays or one valid polymorphic value.\n if (typeof value !== 'object' || Array.isArray(value)) {\n return false\n }\n\n const relationshipValue = value as Record<PropertyKey, unknown>\n const valuePrototype = Object.getPrototypeOf(value)\n const isSinglePolymorphicRelationshipValue =\n Array.isArray(field.relationTo) &&\n (valuePrototype === null || valuePrototype === Object.prototype) &&\n Object.hasOwn(relationshipValue, 'relationTo') &&\n Object.hasOwn(relationshipValue, 'value') &&\n Reflect.ownKeys(relationshipValue).length === 2 &&\n typeof relationshipValue.relationTo === 'string' &&\n field.relationTo.includes(relationshipValue.relationTo) &&\n (typeof relationshipValue.value === 'string' || typeof relationshipValue.value === 'number')\n\n return !isSinglePolymorphicRelationshipValue\n }\n\n return false\n}\n"],"names":["MissingEditorProp","validateBlocksFilterOptions","deepMergeWithSourceArrays","getTranslatedLabel","fieldAffectsData","fieldShouldBeLocalized","tabHasName","getFieldPaths","getExistingRowDoc","traverseFields","buildFieldLabel","parentLabel","label","capitalizedLabel","charAt","toUpperCase","slice","promise","id","blockData","collection","context","data","doc","docWithLocales","errors","field","fieldIndex","fieldLabelPath","global","isValidationOperation","mergeLocaleActions","operation","overrideAccess","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","req","siblingData","siblingDoc","siblingDocWithLocales","siblingFields","skipHooks","skipValidation","submittedTopLevelFieldNames","indexPath","path","schemaPath","index","localization","payload","config","defaultLocale","operationLocale","locale","pathSegments","split","schemaPathSegments","indexPathSegments","filter","Boolean","map","Number","passesCondition","admin","condition","user","isOutsideSubmittedFieldScope","undefined","has","skipValidationFromHere","shouldSkipValidationForLocalizedFallback","includes","type","name","hooks","beforeChange","hook","hookedValue","originalDoc","previousSiblingDoc","previousValue","value","hasInvalidFieldValueShape","push","i18n","message","t","validate","valueToValidate","jsonError","JSON","parse","e","validateFn","validationResult","collectionSlug","slug","event","preferences","fields","filterOptionsError","filterOptions","invalidBlockSlugs","length","rowIndex","block","blockType","blockConfigOrSlug","blocks","find","blockFromField","blockConfig","blockLabelPath","labels","singular","fieldLabel","localeData","localeCodes","fieldValue","Object","keys","rows","Array","isArray","promises","forEach","row","localized","Promise","all","rowSiblingDoc","rowSiblingDocWithLocales","blockTypeToMatch","curBlock","groupSiblingData","groupSiblingDoc","groupSiblingDocWithLocales","isNamedGroup","fallbackLabel","coordinates","parseFloat","editor","Error","tabSiblingData","tabSiblingDoc","tabSiblingDocWithLocales","isNamedTab","tabs","tab","hasMany","relationshipValue","valuePrototype","getPrototypeOf","isSinglePolymorphicRelationshipValue","relationTo","prototype","hasOwn","Reflect","ownKeys"],"mappings":"AAOA,SAASA,iBAAiB,QAAQ,2BAA0B;AAC5D,SAA8BC,2BAA2B,QAAQ,oBAAmB;AACpF,SAASC,yBAAyB,QAAQ,kCAAiC;AAC3E,SAASC,kBAAkB,QAAQ,2CAA0C;AAC7E,SAASC,gBAAgB,EAAEC,sBAAsB,EAAEC,UAAU,QAAQ,wBAAuB;AAC5F,SAASC,aAAa,QAAQ,yBAAwB;AACtD,SAASC,iBAAiB,QAAQ,yBAAwB;AAC1D,SAASC,cAAc,QAAQ,sBAAqB;AAEpD,SAASC,gBAAgBC,WAAmB,EAAEC,KAAyB;IACrE,IAAI,CAACA,OAAO;QACV,OAAOD;IACT;IACA,MAAME,mBAAmBD,MAAME,MAAM,CAAC,GAAGC,WAAW,KAAKH,MAAMI,KAAK,CAAC;IACrE,OAAOL,eAAeE,mBAClB,GAAGF,YAAY,GAAG,EAAEE,kBAAkB,GACtCA,oBAAoBF;AAC1B;AAyCA,oEAAoE;AACpE,kBAAkB;AAClB,wBAAwB;AACxB,kBAAkB;AAClB,+BAA+B;AAC/B,yCAAyC;AACzC,sBAAsB;AAEtB,OAAO,MAAMM,UAAU,OAAO,EAC5BC,EAAE,EACFC,SAAS,EACTC,UAAU,EACVC,OAAO,EACPC,IAAI,EACJC,GAAG,EACHC,cAAc,EACdC,MAAM,EACNC,KAAK,EACLC,UAAU,EACVC,cAAc,EACdC,MAAM,EACNC,qBAAqB,EACrBC,kBAAkB,EAClBC,SAAS,EACTC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,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OoC,SAAS,AAAD,KAC9DpC,OAAOqC,MAAM,CAACN,mBAAmB,iBACjC/B,OAAOqC,MAAM,CAACN,mBAAmB,YACjCO,QAAQC,OAAO,CAACR,mBAAmB/C,MAAM,KAAK,KAC9C,OAAO+C,kBAAkBI,UAAU,KAAK,YACxClI,MAAMkI,UAAU,CAACnF,QAAQ,CAAC+E,kBAAkBI,UAAU,KACrD,CAAA,OAAOJ,kBAAkBrE,KAAK,KAAK,YAAY,OAAOqE,kBAAkBrE,KAAK,KAAK,QAAO;QAE5F,OAAO,CAACwE;IACV;IAEA,OAAO;AACT"}
1
+ {"version":3,"sources":["../../../../src/fields/hooks/beforeChange/promise.ts"],"sourcesContent":["import type { RichTextAdapter } from '../../../admin/RichText.js'\nimport type { SanitizedCollectionConfig } from '../../../collections/config/types.js'\nimport type { ValidationFieldError } from '../../../errors/index.js'\nimport type { SanitizedGlobalConfig } from '../../../globals/config/types.js'\nimport type { FieldOperation, JsonObject, PayloadRequest } from '../../../types/index.js'\nimport type { Block, Field, TabAsField, Validate } from '../../config/types.js'\n\nimport { MissingEditorProp } from '../../../errors/index.js'\nimport { type RequestContext, validateBlocksFilterOptions } from '../../../index.js'\nimport { deepMergeWithSourceArrays } from '../../../utilities/deepMerge.js'\nimport { getTranslatedLabel } from '../../../utilities/getTranslatedLabel.js'\nimport { isolateObjectProperty } from '../../../utilities/isolateObjectProperty.js'\nimport { fieldAffectsData, fieldShouldBeLocalized, tabHasName } from '../../config/types.js'\nimport { getFieldPaths } from '../../getFieldPaths.js'\nimport { flattenValidationData } from './flattenValidationData.js'\nimport { getExistingRowDoc } from './getExistingRowDoc.js'\nimport { traverseFields } from './traverseFields.js'\n\nfunction buildFieldLabel(parentLabel: string, label: string | undefined): string {\n if (!label) {\n return parentLabel\n }\n const capitalizedLabel = label.charAt(0).toUpperCase() + label.slice(1)\n return parentLabel && capitalizedLabel\n ? `${parentLabel} > ${capitalizedLabel}`\n : capitalizedLabel || parentLabel\n}\n\ntype Args = {\n /**\n * Data of the nearest parent block. If no parent block exists, this will be the `undefined`\n */\n blockData?: JsonObject\n blockFields?: Field[]\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n data: JsonObject\n doc: JsonObject\n docWithLocales: JsonObject\n errors: ValidationFieldError[]\n field: Field | TabAsField\n fieldIndex: number\n /**\n * Built up labels of parent fields\n *\n * @example \"Group Field > Tab Field > Text Field\"\n */\n fieldLabelPath: string\n global: null | SanitizedGlobalConfig\n id?: number | string\n isValidationOperation: boolean\n mergeLocaleActions: (() => Promise<void> | void)[]\n operation: FieldOperation\n overrideAccess: boolean\n parentIndexPath: string\n parentIsLocalized: boolean\n parentPath: string\n parentSchemaPath: string\n req: PayloadRequest\n siblingData: JsonObject\n siblingDoc: JsonObject\n siblingDocWithLocales?: JsonObject\n siblingFields?: (Field | TabAsField)[]\n skipHooks: boolean\n skipValidation: boolean\n submittedTopLevelFieldNames?: ReadonlySet<string>\n}\n\n// This function is responsible for the following actions, in order:\n// - Run condition\n// - Execute field hooks\n// - Validate data\n// - Transform data for storage\n// - beforeDuplicate hooks (if duplicate)\n// - Unflatten locales\n\nexport const promise = async ({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n field,\n fieldIndex,\n fieldLabelPath,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales,\n siblingFields,\n skipHooks,\n skipValidation,\n submittedTopLevelFieldNames,\n}: Args): Promise<void> => {\n const { indexPath, path, schemaPath } = getFieldPaths({\n field,\n index: fieldIndex,\n parentIndexPath,\n parentPath,\n parentSchemaPath,\n })\n\n const { localization } = req.payload.config\n const defaultLocale = localization ? localization?.defaultLocale : 'en'\n const operationLocale = req.locale || defaultLocale\n\n const pathSegments = path ? path.split('.') : []\n const schemaPathSegments = schemaPath ? schemaPath.split('.') : []\n const indexPathSegments = indexPath ? indexPath.split('-').filter(Boolean)?.map(Number) : []\n\n const passesCondition = field.admin?.condition\n ? Boolean(\n field.admin.condition(data, siblingData, {\n blockData: blockData!,\n operation,\n path: pathSegments,\n user: req.user,\n }),\n )\n : true\n const isOutsideSubmittedFieldScope =\n submittedTopLevelFieldNames !== undefined &&\n fieldAffectsData(field) &&\n !submittedTopLevelFieldNames.has(pathSegments[0]!)\n let skipValidationFromHere = skipValidation || isOutsideSubmittedFieldScope || !passesCondition\n\n if (fieldAffectsData(field)) {\n const shouldSkipValidationForLocalizedFallback =\n !isValidationOperation &&\n operation !== 'validate' &&\n fieldShouldBeLocalized({ field, parentIsLocalized }) &&\n operationLocale !== defaultLocale &&\n ['array', 'blocks'].includes(field.type) &&\n siblingData[field.name!] === null\n\n if (shouldSkipValidationForLocalizedFallback) {\n skipValidationFromHere = true\n }\n\n // Execute hooks\n if (!skipHooks && 'hooks' in field && field.hooks?.beforeChange) {\n for (const hook of field.hooks.beforeChange) {\n const hookedValue = await hook({\n blockData,\n collection,\n context,\n data,\n field,\n global,\n indexPath: indexPathSegments,\n operation,\n originalDoc: doc,\n overrideAccess,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingDoc[field.name],\n req,\n schemaPath: schemaPathSegments,\n siblingData,\n siblingDocWithLocales,\n siblingFields: siblingFields!,\n value: siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n\n if (hasInvalidFieldValueShape({ field, value: siblingData[field.name!] })) {\n errors.push({\n label: buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n ),\n message: req.t('validation:invalidInput'),\n path,\n })\n return\n }\n\n // Validate\n if (!skipValidationFromHere && 'validate' in field && field.validate) {\n const valueToValidate = siblingData[field.name]\n\n // With `locale: 'all'` a localized scalar is a locale-keyed object; validate each locale, not the\n // wrapper. Containers (`group`/`array`/`blocks`) are excluded - per-locale child validation is a follow-up.\n const isLocaleKeyedValue =\n operationLocale === 'all' &&\n localization &&\n fieldShouldBeLocalized({ field, parentIsLocalized }) &&\n field.type !== 'group' &&\n valueToValidate !== null &&\n typeof valueToValidate === 'object' &&\n !Array.isArray(valueToValidate)\n\n const localizedValuesToValidate: { locale?: string; value: unknown }[] = isLocaleKeyedValue\n ? localization.localeCodes\n .filter((locale) => locale in (valueToValidate as JsonObject))\n .map((locale) => ({ locale, value: (valueToValidate as JsonObject)[locale] }))\n : [{ value: valueToValidate }]\n\n // No recognized locales (e.g. `{}`): validate `undefined` once so required/optional still apply.\n if (localizedValuesToValidate.length === 0) {\n localizedValuesToValidate.push({ value: undefined })\n }\n\n let jsonError: object\n\n if (field.type === 'json' && typeof siblingData[field.name] === 'string') {\n try {\n JSON.parse(siblingData[field.name] as string)\n } catch (e) {\n jsonError = e as object\n }\n }\n\n const validateFn: Validate<object, object, object, object> = field.validate as Validate<\n object,\n object,\n object,\n object\n >\n\n let validationResult: string | true = true\n let failedLocale: string | undefined\n\n const validationData = deepMergeWithSourceArrays<JsonObject>(doc, data)\n const validationSiblingData = deepMergeWithSourceArrays<JsonObject>(siblingDoc, siblingData)\n\n for (const { locale, value } of localizedValuesToValidate) {\n // Scope `req.locale` to the locale being validated without mutating the shared request.\n const validationReq = locale ? isolateObjectProperty(req, 'locale') : req\n if (locale) {\n validationReq.locale = locale\n }\n\n const localeContext = locale\n ? {\n blockData:\n blockData && blockFields\n ? flattenValidationData({\n config: req.payload.config,\n data: blockData,\n fields: blockFields,\n locale,\n parentIsLocalized,\n })\n : blockData,\n data: flattenValidationData({\n config: req.payload.config,\n data: validationData,\n fields: (collection?.fields || global?.fields)!,\n locale,\n }),\n siblingData: flattenValidationData({\n config: req.payload.config,\n data: validationSiblingData,\n fields: siblingFields!,\n locale,\n parentIsLocalized,\n }),\n }\n : { blockData, data: validationData, siblingData: validationSiblingData }\n\n validationResult = await validateFn(value as never, {\n ...field,\n id,\n blockData: localeContext.blockData!,\n collectionSlug: collection?.slug,\n data: localeContext.data,\n event: 'submit',\n // @ts-expect-error generic validation options cannot infer JSON fields\n jsonError,\n operation,\n overrideAccess,\n path: pathSegments,\n preferences: { fields: {} },\n previousValue: locale\n ? (siblingDoc[field.name] as JsonObject)?.[locale]\n : siblingDoc[field.name],\n req: validationReq,\n siblingData: localeContext.siblingData,\n })\n\n if (typeof validationResult === 'string') {\n failedLocale = locale\n break\n }\n }\n\n if (typeof validationResult === 'string') {\n let filterOptionsError = false\n\n if (field.type === 'blocks' && field.filterOptions) {\n // Re-run filteroptions. If the validation error is due to filteroptions, we need to add error paths to all the blocks\n // that are no longer valid\n const validationResult = await validateBlocksFilterOptions({\n id,\n data,\n filterOptions: field.filterOptions,\n req,\n siblingData,\n value: siblingData[field.name],\n })\n if (validationResult?.invalidBlockSlugs?.length) {\n filterOptionsError = true\n let rowIndex = -1\n for (const block of siblingData[field.name] as JsonObject[]) {\n rowIndex++\n if (validationResult.invalidBlockSlugs.includes(block.blockType as string)) {\n const blockConfigOrSlug = field.blocks.find((blockFromField) =>\n typeof blockFromField === 'string'\n ? blockFromField === block.blockType\n : blockFromField.slug === block.blockType,\n )\n const blockConfig =\n typeof blockConfigOrSlug === 'string'\n ? req.payload.blocks[blockConfigOrSlug]\n : blockConfigOrSlug\n\n const blockLabelPath =\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} > ${req.t('fields:block')} ${rowIndex + 1} (${getTranslatedLabel(blockConfig?.labels?.singular || block.blockType, req.i18n)})`,\n )\n\n errors.push({\n label: blockLabelPath,\n message: req.t('validation:invalidBlock', { block: block.blockType }),\n path: `${path}.${rowIndex}.id`,\n })\n }\n }\n }\n }\n\n if (!filterOptionsError) {\n // If the error is due to block filterOptions, we want to push the errors for each individual block, not the blocks\n // field itself => only push the error if the field is not a block field with validation failure due to filterOptions\n const fieldLabel = buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n )\n\n errors.push({\n label: failedLocale ? `${fieldLabel} (${failedLocale})` : fieldLabel,\n message: validationResult,\n path,\n })\n }\n }\n }\n\n // Push merge locale action if applicable\n if (localization && fieldShouldBeLocalized({ field, parentIsLocalized })) {\n mergeLocaleActions.push(() => {\n const localeData: Record<string, unknown> = {}\n\n // With `locale: 'all'`, siblingData holds a locale-keyed object (`{ en, es }`) rather than a single\n // locale's value - take each submitted locale, falling back to the existing doc for ones not sent.\n const submittedValue = siblingData[field.name!]\n const isAllLocales =\n req.locale === 'all' &&\n submittedValue !== null &&\n typeof submittedValue === 'object' &&\n !Array.isArray(submittedValue)\n\n for (const locale of localization.localeCodes) {\n const existingValue = siblingDocWithLocales?.[field.name!]?.[locale]\n\n const fieldValue = isAllLocales\n ? locale in (submittedValue as Record<string, unknown>)\n ? (submittedValue as Record<string, unknown>)[locale]\n : existingValue\n : locale === req.locale\n ? submittedValue\n : existingValue\n\n // update locale value if it's not undefined\n if (typeof fieldValue !== 'undefined') {\n localeData[locale] = fieldValue\n }\n }\n\n // If there are locales with data, set the data\n if (Object.keys(localeData).length > 0) {\n siblingData[field.name!] = localeData\n }\n })\n }\n }\n\n switch (field.type) {\n case 'array': {\n const rows = siblingData[field.name]\n\n if (Array.isArray(rows)) {\n const promises: Promise<void>[] = []\n\n rows.forEach((row, rowIndex) => {\n promises.push(\n traverseFields({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} ${rowIndex + 1}`,\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath,\n req,\n siblingData: row as JsonObject,\n siblingDoc: getExistingRowDoc(row as JsonObject, siblingDoc[field.name]),\n siblingDocWithLocales: getExistingRowDoc(\n row as JsonObject,\n siblingDocWithLocales?.[field.name],\n ),\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n }),\n )\n })\n\n await Promise.all(promises)\n }\n\n break\n }\n\n case 'blocks': {\n const rows = siblingData[field.name]\n if (Array.isArray(rows)) {\n const promises: Promise<void>[] = []\n\n rows.forEach((row, rowIndex) => {\n const rowSiblingDoc = getExistingRowDoc(row as JsonObject, siblingDoc[field.name])\n\n const rowSiblingDocWithLocales = getExistingRowDoc(\n row as JsonObject,\n siblingDocWithLocales ? siblingDocWithLocales[field.name] : {},\n )\n\n const blockTypeToMatch = (row as JsonObject).blockType || rowSiblingDoc.blockType\n\n const block: Block | undefined =\n req.payload.blocks[blockTypeToMatch] ??\n (field.blocks.find(\n (curBlock) => typeof curBlock !== 'string' && curBlock.slug === blockTypeToMatch,\n ) as Block | undefined)\n\n const blockLabelPath =\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n `${getTranslatedLabel(field?.label || field?.name, req.i18n)} > ${req.t('fields:block')} ${rowIndex + 1} (${getTranslatedLabel(block?.labels?.singular || blockTypeToMatch, req.i18n)})`,\n )\n\n if (block) {\n promises.push(\n traverseFields({\n id,\n blockData: row,\n blockFields: block.fields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath: blockLabelPath,\n\n fields: block.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: '',\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: path + '.' + rowIndex,\n parentSchemaPath: schemaPath + '.' + block.slug,\n req,\n siblingData: row as JsonObject,\n siblingDoc: rowSiblingDoc,\n siblingDocWithLocales: rowSiblingDocWithLocales,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n }),\n )\n }\n })\n\n await Promise.all(promises)\n }\n\n break\n }\n\n case 'collapsible':\n case 'row': {\n await traverseFields({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field.type === 'row' || field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.type, req.i18n),\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales: siblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n case 'group': {\n let groupSiblingData = siblingData\n let groupSiblingDoc = siblingDoc\n let groupSiblingDocWithLocales = siblingDocWithLocales\n\n const isNamedGroup = fieldAffectsData(field)\n\n if (isNamedGroup) {\n if (typeof siblingData[field.name] !== 'object') {\n siblingData[field.name] = {}\n }\n\n if (typeof siblingDoc[field.name] !== 'object') {\n siblingDoc[field.name] = {}\n }\n\n if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\n if (typeof siblingData[field.name] !== 'object') {\n siblingData[field.name] = {}\n }\n\n if (typeof siblingDoc[field.name] !== 'object') {\n siblingDoc[field.name] = {}\n }\n\n if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\n\n groupSiblingData = siblingData[field.name] as JsonObject\n groupSiblingDoc = siblingDoc[field.name] as JsonObject\n groupSiblingDocWithLocales = siblingDocWithLocales![field.name] as JsonObject\n }\n\n const fallbackLabel = field?.label || (isNamedGroup ? field.name : field?.type)\n\n await traverseFields({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(fieldLabelPath, getTranslatedLabel(fallbackLabel, req.i18n)),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: isNamedGroup ? '' : indexPath,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: isNamedGroup ? path : parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData: groupSiblingData,\n siblingDoc: groupSiblingDoc,\n siblingDocWithLocales: groupSiblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n case 'point': {\n // Transform point data for storage\n if (\n Array.isArray(siblingData[field.name]) &&\n siblingData[field.name][0] !== null &&\n siblingData[field.name][1] !== null\n ) {\n siblingData[field.name] = {\n type: 'Point',\n coordinates: [\n parseFloat(siblingData[field.name][0]),\n parseFloat(siblingData[field.name][1]),\n ],\n }\n }\n\n break\n }\n\n case 'richText': {\n if (!field?.editor) {\n throw new MissingEditorProp(field) // while we allow disabling editor functionality, you should not have any richText fields defined if you do not have an editor\n }\n\n if (typeof field?.editor === 'function') {\n throw new Error('Attempted to access unsanitized rich text editor.')\n }\n\n const editor: RichTextAdapter = field?.editor\n\n if (!skipHooks && editor?.hooks?.beforeChange?.length) {\n for (const hook of editor.hooks.beforeChange) {\n const hookedValue = await hook({\n collection,\n context,\n data,\n docWithLocales,\n errors,\n field,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field?.name, req.i18n),\n ),\n global,\n indexPath: indexPathSegments,\n mergeLocaleActions,\n operation,\n originalDoc: doc,\n overrideAccess,\n parentIsLocalized,\n path: pathSegments,\n previousSiblingDoc: siblingDoc,\n previousValue: siblingDoc[field.name],\n req,\n schemaPath: schemaPathSegments,\n siblingData,\n siblingDocWithLocales,\n skipValidation: skipValidationFromHere,\n value: siblingData[field.name],\n })\n\n if (hookedValue !== undefined) {\n siblingData[field.name] = hookedValue\n }\n }\n }\n\n break\n }\n\n case 'tab': {\n let tabSiblingData = siblingData\n let tabSiblingDoc = siblingDoc\n let tabSiblingDocWithLocales = siblingDocWithLocales\n\n const isNamedTab = tabHasName(field)\n\n if (isNamedTab) {\n if (typeof siblingData[field.name] !== 'object') {\n siblingData[field.name] = {}\n }\n\n if (typeof siblingDoc[field.name] !== 'object') {\n siblingDoc[field.name] = {}\n }\n\n if (typeof siblingDocWithLocales![field.name] !== 'object') {\n siblingDocWithLocales![field.name] = {}\n }\n\n tabSiblingData = siblingData[field.name] as JsonObject\n tabSiblingDoc = siblingDoc[field.name] as JsonObject\n tabSiblingDocWithLocales = siblingDocWithLocales![field.name] as JsonObject\n }\n\n await traverseFields({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(\n fieldLabelPath,\n getTranslatedLabel(field?.label || field.name, req.i18n),\n ),\n fields: field.fields,\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: isNamedTab ? '' : indexPath,\n parentIsLocalized: parentIsLocalized || field.localized,\n parentPath: isNamedTab ? path : parentPath,\n parentSchemaPath: schemaPath,\n req,\n siblingData: tabSiblingData,\n siblingDoc: tabSiblingDoc,\n siblingDocWithLocales: tabSiblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n case 'tabs': {\n await traverseFields({\n id,\n blockData,\n blockFields,\n collection,\n context,\n data,\n doc,\n docWithLocales,\n errors,\n fieldLabelPath:\n field?.label === false\n ? fieldLabelPath\n : buildFieldLabel(fieldLabelPath, getTranslatedLabel(field?.label || '', req.i18n)),\n fields: field.tabs.map((tab) => ({ ...tab, type: 'tab' })),\n global,\n isValidationOperation,\n mergeLocaleActions,\n operation,\n overrideAccess,\n parentIndexPath: indexPath,\n parentIsLocalized,\n parentPath: path,\n parentSchemaPath: schemaPath,\n req,\n siblingData,\n siblingDoc,\n siblingDocWithLocales: siblingDocWithLocales!,\n skipHooks,\n skipValidation: skipValidationFromHere,\n submittedTopLevelFieldNames,\n })\n\n break\n }\n\n default: {\n break\n }\n }\n}\n\nfunction hasInvalidFieldValueShape({\n field,\n value,\n}: {\n field: Field | TabAsField\n value: unknown\n}): boolean {\n if (value === null || typeof value === 'undefined' || !fieldAffectsData(field)) {\n return false\n }\n\n if (field.type === 'array' || field.type === 'blocks') {\n // Form state may use a numeric row count, while submitted values use arrays.\n return !(Array.isArray(value) || typeof value === 'number')\n }\n\n if (field.type === 'number') {\n // Only hasMany number fields may receive arrays.\n return typeof value === 'object' && !(field.hasMany && Array.isArray(value))\n }\n\n if ((field.type === 'relationship' || field.type === 'upload') && field.hasMany) {\n // HasMany relationships/uploads may receive arrays or one valid polymorphic value.\n if (typeof value !== 'object' || Array.isArray(value)) {\n return false\n }\n\n const relationshipValue = value as Record<PropertyKey, unknown>\n const valuePrototype = Object.getPrototypeOf(value)\n const isSinglePolymorphicRelationshipValue =\n Array.isArray(field.relationTo) &&\n (valuePrototype === null || valuePrototype === Object.prototype) &&\n Object.hasOwn(relationshipValue, 'relationTo') &&\n Object.hasOwn(relationshipValue, 'value') &&\n Reflect.ownKeys(relationshipValue).length === 2 &&\n typeof relationshipValue.relationTo === 'string' &&\n field.relationTo.includes(relationshipValue.relationTo) &&\n (typeof relationshipValue.value === 'string' || typeof relationshipValue.value === 'number')\n\n return !isSinglePolymorphicRelationshipValue\n }\n\n return false\n}\n"],"names":["MissingEditorProp","validateBlocksFilterOptions","deepMergeWithSourceArrays","getTranslatedLabel","isolateObjectProperty","fieldAffectsData","fieldShouldBeLocalized","tabHasName","getFieldPaths","flattenValidationData","getExistingRowDoc","traverseFields","buildFieldLabel","parentLabel","label","capitalizedLabel","charAt","toUpperCase","slice","promise","id","blockData","blockFields","collection","context","data","doc","docWithLocales","errors","field","fieldIndex","fieldLabelPath","global","isValidationOperation","mergeLocaleActions","operation","overrideAccess","parentIndexPath","parentIsLocalized","parentPath","parentSchemaPath","req","siblingData","siblingDoc","siblingDocWithLocales","siblingFields","skipHooks","skipValidation","submittedTopLevelFieldNames","indexPath","path","schemaPath","index","localization","payload","config","defaultLocale","operationLocale","locale","pathSegments","split","schemaPathSegments","indexPathSegments","filter","Boolean","map","Number","passesCondition","admin","condition","user","isOutsideSubmittedFieldScope","undefined","has","skipValidationFromHere","shouldSkipValidationForLocalizedFallback","includes","type","name","hooks","beforeChange","hook","hookedValue","originalDoc","previousSiblingDoc","previousValue","value","hasInvalidFieldValueShape","push","i18n","message","t","validate","valueToValidate","isLocaleKeyedValue","Array","isArray","localizedValuesToValidate","localeCodes","length","jsonError","JSON","parse","e","validateFn","validationResult","failedLocale","validationData","validationSiblingData","validationReq","localeContext","fields","collectionSlug","slug","event","preferences","filterOptionsError","filterOptions","invalidBlockSlugs","rowIndex","block","blockType","blockConfigOrSlug","blocks","find","blockFromField","blockConfig","blockLabelPath","labels","singular","fieldLabel","localeData","submittedValue","isAllLocales","existingValue","fieldValue","Object","keys","rows","promises","forEach","row","localized","Promise","all","rowSiblingDoc","rowSiblingDocWithLocales","blockTypeToMatch","curBlock","groupSiblingData","groupSiblingDoc","groupSiblingDocWithLocales","isNamedGroup","fallbackLabel","coordinates","parseFloat","editor","Error","tabSiblingData","tabSiblingDoc","tabSiblingDocWithLocales","isNamedTab","tabs","tab","hasMany","relationshipValue","valuePrototype","getPrototypeOf","isSinglePolymorphicRelationshipValue","relationTo","prototype","hasOwn","Reflect","ownKeys"],"mappings":"AAOA,SAASA,iBAAiB,QAAQ,2BAA0B;AAC5D,SAA8BC,2BAA2B,QAAQ,oBAAmB;AACpF,SAASC,yBAAyB,QAAQ,kCAAiC;AAC3E,SAASC,kBAAkB,QAAQ,2CAA0C;AAC7E,SAASC,qBAAqB,QAAQ,8CAA6C;AACnF,SAASC,gBAAgB,EAAEC,sBAAsB,EAAEC,UAAU,QAAQ,wBAAuB;AAC5F,SAASC,aAAa,QAAQ,yBAAwB;AACtD,SAASC,q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O,CAACV,QAAQ;YACrD,OAAO;QACT;QAEA,MAAM+E,oBAAoB/E;QAC1B,MAAMgF,iBAAiB9B,OAAO+B,cAAc,CAACjF;QAC7C,MAAMkF,uCACJzE,MAAMC,OAAO,CAACnE,MAAM4I,UAAU,KAC7BH,CAAAA,mBAAmB,QAAQA,mBAAmB9B,OAAOkC,SAAS,AAAD,KAC9DlC,OAAOmC,MAAM,CAACN,mBAAmB,iBACjC7B,OAAOmC,MAAM,CAACN,mBAAmB,YACjCO,QAAQC,OAAO,CAACR,mBAAmBlE,MAAM,KAAK,KAC9C,OAAOkE,kBAAkBI,UAAU,KAAK,YACxC5I,MAAM4I,UAAU,CAAC7F,QAAQ,CAACyF,kBAAkBI,UAAU,KACrD,CAAA,OAAOJ,kBAAkB/E,KAAK,KAAK,YAAY,OAAO+E,kBAAkB/E,KAAK,KAAK,QAAO;QAE5F,OAAO,CAACkF;IACV;IAEA,OAAO;AACT"}
@@ -9,6 +9,7 @@ type Args = {
9
9
  * Data of the nearest parent block. If no parent block exists, this will be the `undefined`
10
10
  */
11
11
  blockData?: JsonObject;
12
+ blockFields?: Field[];
12
13
  collection: null | SanitizedCollectionConfig;
13
14
  context: RequestContext;
14
15
  data: JsonObject;
@@ -63,6 +64,6 @@ type Args = {
63
64
  * - Transform data for storage
64
65
  * - Unflatten locales. The input `data` is the normal document for one locale. The output result will become the document with locales.
65
66
  */
66
- export declare const traverseFields: ({ id, blockData, collection, context, data, doc, docWithLocales, errors, fieldLabelPath, fields, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, skipHooks, skipValidation, submittedTopLevelFieldNames, }: Args) => Promise<void>;
67
+ export declare const traverseFields: ({ id, blockData, blockFields, collection, context, data, doc, docWithLocales, errors, fieldLabelPath, fields, global, isValidationOperation, mergeLocaleActions, operation, overrideAccess, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, req, siblingData, siblingDoc, siblingDocWithLocales, skipHooks, skipValidation, submittedTopLevelFieldNames, }: Args) => Promise<void>;
67
68
  export {};
68
69
  //# sourceMappingURL=traverseFields.d.ts.map