payload 4.0.0-internal.fa345ef → 4.0.0-internal.fec2230

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 (1289) hide show
  1. package/bin.js +14 -10
  2. package/dist/__testing__/predefinedMigration.d.ts +4 -3
  3. package/dist/__testing__/predefinedMigration.d.ts.map +1 -1
  4. package/dist/admin/RichText.d.ts +1 -1
  5. package/dist/admin/RichText.d.ts.map +1 -1
  6. package/dist/admin/RichText.js.map +1 -1
  7. package/dist/admin/adapters/devReload.d.ts +13 -0
  8. package/dist/admin/adapters/devReload.d.ts.map +1 -1
  9. package/dist/admin/adapters/devReload.js +14 -1
  10. package/dist/admin/adapters/devReload.js.map +1 -1
  11. package/dist/admin/adapters/router.d.ts +8 -0
  12. package/dist/admin/adapters/router.d.ts.map +1 -1
  13. package/dist/admin/adapters/router.js.map +1 -1
  14. package/dist/admin/functions/index.d.ts +12 -10
  15. package/dist/admin/functions/index.d.ts.map +1 -1
  16. package/dist/admin/functions/index.js.map +1 -1
  17. package/dist/admin/types.d.ts +3 -3
  18. package/dist/admin/types.d.ts.map +1 -1
  19. package/dist/admin/types.js.map +1 -1
  20. package/dist/admin/views/index.d.ts +2 -2
  21. package/dist/admin/views/index.d.ts.map +1 -1
  22. package/dist/admin/views/index.js.map +1 -1
  23. package/dist/auth/baseFields/apiKey.d.ts.map +1 -1
  24. package/dist/auth/baseFields/apiKey.js +16 -1
  25. package/dist/auth/baseFields/apiKey.js.map +1 -1
  26. package/dist/auth/cookies.d.ts +2 -2
  27. package/dist/auth/cookies.d.ts.map +1 -1
  28. package/dist/auth/crypto.d.ts +73 -2
  29. package/dist/auth/crypto.d.ts.map +1 -1
  30. package/dist/auth/crypto.js +90 -13
  31. package/dist/auth/crypto.js.map +1 -1
  32. package/dist/auth/defaultAccess.d.ts.map +1 -1
  33. package/dist/auth/endpoints/login.d.ts.map +1 -1
  34. package/dist/auth/endpoints/login.js +2 -11
  35. package/dist/auth/endpoints/login.js.map +1 -1
  36. package/dist/auth/endpoints/refresh.d.ts.map +1 -1
  37. package/dist/auth/endpoints/refresh.js +4 -6
  38. package/dist/auth/endpoints/refresh.js.map +1 -1
  39. package/dist/auth/ensureUsernameOrEmail.d.ts.map +1 -1
  40. package/dist/auth/executeAccess.d.ts +2 -1
  41. package/dist/auth/executeAccess.d.ts.map +1 -1
  42. package/dist/auth/executeAccess.js +2 -1
  43. package/dist/auth/executeAccess.js.map +1 -1
  44. package/dist/auth/executeAuthStrategies.d.ts.map +1 -1
  45. package/dist/auth/extractAccessFromPermission.d.ts.map +1 -1
  46. package/dist/auth/extractJWT.d.ts +1 -1
  47. package/dist/auth/extractJWT.d.ts.map +1 -1
  48. package/dist/auth/getAccessResults.js +1 -0
  49. package/dist/auth/getAccessResults.js.map +1 -1
  50. package/dist/auth/getAuthFields.d.ts.map +1 -1
  51. package/dist/auth/getFieldsToSign.d.ts +1 -1
  52. package/dist/auth/getFieldsToSign.d.ts.map +1 -1
  53. package/dist/auth/getLoginOptions.d.ts +1 -1
  54. package/dist/auth/getLoginOptions.d.ts.map +1 -1
  55. package/dist/auth/getLoginOptions.js.map +1 -1
  56. package/dist/auth/isUserLocked.d.ts.map +1 -1
  57. package/dist/auth/jwt.d.ts.map +1 -1
  58. package/dist/auth/loginWithCookie.d.ts +33 -0
  59. package/dist/auth/loginWithCookie.d.ts.map +1 -0
  60. package/dist/auth/loginWithCookie.js +34 -0
  61. package/dist/auth/loginWithCookie.js.map +1 -0
  62. package/dist/auth/operations/access.d.ts.map +1 -1
  63. package/dist/auth/operations/access.js +3 -9
  64. package/dist/auth/operations/access.js.map +1 -1
  65. package/dist/auth/operations/auth.d.ts.map +1 -1
  66. package/dist/auth/operations/auth.js +15 -21
  67. package/dist/auth/operations/auth.js.map +1 -1
  68. package/dist/auth/operations/forgotPassword.d.ts.map +1 -1
  69. package/dist/auth/operations/init.d.ts.map +1 -1
  70. package/dist/auth/operations/local/auth.d.ts.map +1 -1
  71. package/dist/auth/operations/login.d.ts.map +1 -1
  72. package/dist/auth/operations/logout.d.ts.map +1 -1
  73. package/dist/auth/operations/me.d.ts +2 -9
  74. package/dist/auth/operations/me.d.ts.map +1 -1
  75. package/dist/auth/operations/me.js +0 -6
  76. package/dist/auth/operations/me.js.map +1 -1
  77. package/dist/auth/operations/refresh.d.ts +0 -7
  78. package/dist/auth/operations/refresh.d.ts.map +1 -1
  79. package/dist/auth/operations/refresh.js +0 -6
  80. package/dist/auth/operations/refresh.js.map +1 -1
  81. package/dist/auth/operations/registerFirstUser.d.ts.map +1 -1
  82. package/dist/auth/operations/resetPassword.d.ts.map +1 -1
  83. package/dist/auth/operations/unlock.d.ts.map +1 -1
  84. package/dist/auth/operations/unlock.js +1 -0
  85. package/dist/auth/operations/unlock.js.map +1 -1
  86. package/dist/auth/operations/verifyEmail.d.ts.map +1 -1
  87. package/dist/auth/rotateSecret.d.ts +51 -0
  88. package/dist/auth/rotateSecret.d.ts.map +1 -0
  89. package/dist/auth/rotateSecret.js +131 -0
  90. package/dist/auth/rotateSecret.js.map +1 -0
  91. package/dist/auth/serverFunctions/cookies.d.ts +47 -0
  92. package/dist/auth/serverFunctions/cookies.d.ts.map +1 -0
  93. package/dist/auth/serverFunctions/cookies.js +52 -0
  94. package/dist/auth/serverFunctions/cookies.js.map +1 -0
  95. package/dist/auth/serverFunctions/login.d.ts +29 -0
  96. package/dist/auth/serverFunctions/login.d.ts.map +1 -0
  97. package/dist/auth/serverFunctions/login.js +63 -0
  98. package/dist/auth/serverFunctions/login.js.map +1 -0
  99. package/dist/auth/serverFunctions/logout.d.ts +17 -0
  100. package/dist/auth/serverFunctions/logout.d.ts.map +1 -0
  101. package/dist/auth/serverFunctions/logout.js +58 -0
  102. package/dist/auth/serverFunctions/logout.js.map +1 -0
  103. package/dist/auth/serverFunctions/refresh.d.ts +17 -0
  104. package/dist/auth/serverFunctions/refresh.d.ts.map +1 -0
  105. package/dist/auth/serverFunctions/refresh.js +61 -0
  106. package/dist/auth/serverFunctions/refresh.js.map +1 -0
  107. package/dist/auth/sessions.d.ts.map +1 -1
  108. package/dist/auth/strategies/apiKey.d.ts.map +1 -1
  109. package/dist/auth/strategies/apiKey.js +5 -3
  110. package/dist/auth/strategies/apiKey.js.map +1 -1
  111. package/dist/auth/strategies/jwt.d.ts.map +1 -1
  112. package/dist/auth/strategies/jwt.js +23 -2
  113. package/dist/auth/strategies/jwt.js.map +1 -1
  114. package/dist/auth/strategies/local/authenticate.d.ts.map +1 -1
  115. package/dist/auth/strategies/local/generatePasswordSaltHash.d.ts.map +1 -1
  116. package/dist/auth/strategies/local/incrementLoginAttempts.d.ts.map +1 -1
  117. package/dist/auth/strategies/local/register.d.ts.map +1 -1
  118. package/dist/auth/strategies/local/resetLoginAttempts.d.ts.map +1 -1
  119. package/dist/auth/types.d.ts +13 -21
  120. package/dist/auth/types.d.ts.map +1 -1
  121. package/dist/auth/types.js.map +1 -1
  122. package/dist/auth/withBaseAccess.d.ts +22 -0
  123. package/dist/auth/withBaseAccess.d.ts.map +1 -0
  124. package/dist/auth/withBaseAccess.js +61 -0
  125. package/dist/auth/withBaseAccess.js.map +1 -0
  126. package/dist/cli/commands/build/build.d.ts +44 -0
  127. package/dist/cli/commands/build/build.d.ts.map +1 -0
  128. package/dist/cli/commands/build/build.js +225 -0
  129. package/dist/cli/commands/build/build.js.map +1 -0
  130. package/dist/cli/commands/build/build.spec.js +582 -0
  131. package/dist/cli/commands/build/build.spec.js.map +1 -0
  132. package/dist/cli/commands/build/index.d.ts +2 -0
  133. package/dist/cli/commands/build/index.d.ts.map +1 -0
  134. package/dist/cli/commands/build/index.js +26 -0
  135. package/dist/cli/commands/build/index.js.map +1 -0
  136. package/dist/cli/commands/collections/countDocuments.d.ts +2 -0
  137. package/dist/cli/commands/collections/countDocuments.d.ts.map +1 -0
  138. package/dist/cli/commands/collections/countDocuments.js +37 -0
  139. package/dist/cli/commands/collections/countDocuments.js.map +1 -0
  140. package/dist/cli/commands/collections/countVersions.d.ts +2 -0
  141. package/dist/cli/commands/collections/countVersions.d.ts.map +1 -0
  142. package/dist/cli/commands/collections/countVersions.js +36 -0
  143. package/dist/cli/commands/collections/countVersions.js.map +1 -0
  144. package/dist/cli/commands/collections/createDocuments.d.ts +2 -0
  145. package/dist/cli/commands/collections/createDocuments.d.ts.map +1 -0
  146. package/dist/cli/commands/collections/createDocuments.js +130 -0
  147. package/dist/cli/commands/collections/createDocuments.js.map +1 -0
  148. package/dist/cli/commands/collections/deleteDocuments.d.ts +2 -0
  149. package/dist/cli/commands/collections/deleteDocuments.d.ts.map +1 -0
  150. package/dist/cli/commands/collections/deleteDocuments.js +64 -0
  151. package/dist/cli/commands/collections/deleteDocuments.js.map +1 -0
  152. package/dist/cli/commands/collections/duplicateDocument.d.ts +2 -0
  153. package/dist/cli/commands/collections/duplicateDocument.d.ts.map +1 -0
  154. package/dist/cli/commands/collections/duplicateDocument.js +107 -0
  155. package/dist/cli/commands/collections/duplicateDocument.js.map +1 -0
  156. package/dist/cli/commands/collections/findDistinct.d.ts +2 -0
  157. package/dist/cli/commands/collections/findDistinct.d.ts.map +1 -0
  158. package/dist/cli/commands/collections/findDistinct.js +52 -0
  159. package/dist/cli/commands/collections/findDistinct.js.map +1 -0
  160. package/dist/cli/commands/collections/findDocuments.d.ts +2 -0
  161. package/dist/cli/commands/collections/findDocuments.d.ts.map +1 -0
  162. package/dist/cli/commands/collections/findDocuments.js +79 -0
  163. package/dist/cli/commands/collections/findDocuments.js.map +1 -0
  164. package/dist/cli/commands/collections/findVersionByID.d.ts +2 -0
  165. package/dist/cli/commands/collections/findVersionByID.d.ts.map +1 -0
  166. package/dist/cli/commands/collections/findVersionByID.js +48 -0
  167. package/dist/cli/commands/collections/findVersionByID.js.map +1 -0
  168. package/dist/cli/commands/collections/findVersions.d.ts +2 -0
  169. package/dist/cli/commands/collections/findVersions.d.ts.map +1 -0
  170. package/dist/cli/commands/collections/findVersions.js +57 -0
  171. package/dist/cli/commands/collections/findVersions.js.map +1 -0
  172. package/dist/cli/commands/collections/getCollectionSchema.d.ts +2 -0
  173. package/dist/cli/commands/collections/getCollectionSchema.d.ts.map +1 -0
  174. package/dist/cli/commands/collections/getCollectionSchema.js +49 -0
  175. package/dist/cli/commands/collections/getCollectionSchema.js.map +1 -0
  176. package/dist/cli/commands/collections/restoreVersion.d.ts +2 -0
  177. package/dist/cli/commands/collections/restoreVersion.d.ts.map +1 -0
  178. package/dist/cli/commands/collections/restoreVersion.js +47 -0
  179. package/dist/cli/commands/collections/restoreVersion.js.map +1 -0
  180. package/dist/cli/commands/collections/updateDocument.d.ts +2 -0
  181. package/dist/cli/commands/collections/updateDocument.d.ts.map +1 -0
  182. package/dist/cli/commands/collections/updateDocument.js +190 -0
  183. package/dist/cli/commands/collections/updateDocument.js.map +1 -0
  184. package/dist/cli/commands/data/input.d.ts +28 -0
  185. package/dist/cli/commands/data/input.d.ts.map +1 -0
  186. package/dist/cli/commands/data/input.js +76 -0
  187. package/dist/cli/commands/data/input.js.map +1 -0
  188. package/dist/cli/commands/data/utilities.d.ts +65 -0
  189. package/dist/cli/commands/data/utilities.d.ts.map +1 -0
  190. package/dist/cli/commands/data/utilities.js +67 -0
  191. package/dist/cli/commands/data/utilities.js.map +1 -0
  192. package/dist/cli/commands/generateDBSchema.d.ts +2 -0
  193. package/dist/cli/commands/generateDBSchema.d.ts.map +1 -0
  194. package/dist/cli/commands/generateDBSchema.js +29 -0
  195. package/dist/cli/commands/generateDBSchema.js.map +1 -0
  196. package/dist/cli/commands/generateImportMap/frameworkConventions.d.ts +8 -0
  197. package/dist/cli/commands/generateImportMap/frameworkConventions.d.ts.map +1 -0
  198. package/dist/cli/commands/generateImportMap/frameworkConventions.js +8 -0
  199. package/dist/cli/commands/generateImportMap/frameworkConventions.js.map +1 -0
  200. package/dist/{bin/generateImportMap/index.d.ts → cli/commands/generateImportMap/generateImportMap.d.ts} +8 -4
  201. package/dist/cli/commands/generateImportMap/generateImportMap.d.ts.map +1 -0
  202. package/dist/{bin/generateImportMap/index.js → cli/commands/generateImportMap/generateImportMap.js} +9 -4
  203. package/dist/cli/commands/generateImportMap/generateImportMap.js.map +1 -0
  204. package/dist/cli/commands/generateImportMap/generateImportMap.spec.js.map +1 -0
  205. package/dist/cli/commands/generateImportMap/index.d.ts +2 -0
  206. package/dist/cli/commands/generateImportMap/index.d.ts.map +1 -0
  207. package/dist/cli/commands/generateImportMap/index.js +18 -0
  208. package/dist/cli/commands/generateImportMap/index.js.map +1 -0
  209. package/dist/{bin → cli/commands}/generateImportMap/iterateCollections.d.ts +3 -3
  210. package/dist/cli/commands/generateImportMap/iterateCollections.d.ts.map +1 -0
  211. package/dist/cli/commands/generateImportMap/iterateCollections.js.map +1 -0
  212. package/dist/{bin → cli/commands}/generateImportMap/iterateConfig.d.ts +2 -2
  213. package/dist/cli/commands/generateImportMap/iterateConfig.d.ts.map +1 -0
  214. package/dist/{bin → cli/commands}/generateImportMap/iterateConfig.js +1 -1
  215. package/dist/cli/commands/generateImportMap/iterateConfig.js.map +1 -0
  216. package/dist/{bin → cli/commands}/generateImportMap/iterateFields.d.ts +3 -3
  217. package/dist/cli/commands/generateImportMap/iterateFields.d.ts.map +1 -0
  218. package/dist/cli/commands/generateImportMap/iterateFields.js.map +1 -0
  219. package/dist/{bin → cli/commands}/generateImportMap/iterateGlobals.d.ts +3 -3
  220. package/dist/cli/commands/generateImportMap/iterateGlobals.d.ts.map +1 -0
  221. package/dist/cli/commands/generateImportMap/iterateGlobals.js.map +1 -0
  222. package/dist/{bin → cli/commands}/generateImportMap/utilities/addPayloadComponentToImportMap.d.ts +2 -2
  223. package/dist/cli/commands/generateImportMap/utilities/addPayloadComponentToImportMap.d.ts.map +1 -0
  224. package/dist/cli/commands/generateImportMap/utilities/addPayloadComponentToImportMap.js.map +1 -0
  225. package/dist/{bin → cli/commands}/generateImportMap/utilities/getFromImportMap.d.ts +2 -2
  226. package/dist/cli/commands/generateImportMap/utilities/getFromImportMap.d.ts.map +1 -0
  227. package/dist/cli/commands/generateImportMap/utilities/getFromImportMap.js.map +1 -0
  228. package/dist/cli/commands/generateImportMap/utilities/getImportMapToBaseDirPath.d.ts.map +1 -0
  229. package/dist/cli/commands/generateImportMap/utilities/getImportMapToBaseDirPath.js.map +1 -0
  230. package/dist/{bin → cli/commands}/generateImportMap/utilities/parsePayloadComponent.d.ts +1 -1
  231. package/dist/cli/commands/generateImportMap/utilities/parsePayloadComponent.d.ts.map +1 -0
  232. package/dist/cli/commands/generateImportMap/utilities/parsePayloadComponent.js.map +1 -0
  233. package/dist/cli/commands/generateImportMap/utilities/resolveImportMapFilePath.d.ts.map +1 -0
  234. package/dist/{bin → cli/commands}/generateImportMap/utilities/resolveImportMapFilePath.js +5 -4
  235. package/dist/cli/commands/generateImportMap/utilities/resolveImportMapFilePath.js.map +1 -0
  236. package/dist/cli/commands/generateTypes.d.ts +12 -0
  237. package/dist/cli/commands/generateTypes.d.ts.map +1 -0
  238. package/dist/{bin → cli/commands}/generateTypes.js +33 -7
  239. package/dist/cli/commands/generateTypes.js.map +1 -0
  240. package/dist/cli/commands/getConfigInfo.d.ts +2 -0
  241. package/dist/cli/commands/getConfigInfo.d.ts.map +1 -0
  242. package/dist/cli/commands/getConfigInfo.js +23 -0
  243. package/dist/cli/commands/getConfigInfo.js.map +1 -0
  244. package/dist/cli/commands/globals/countGlobalVersions.d.ts +2 -0
  245. package/dist/cli/commands/globals/countGlobalVersions.d.ts.map +1 -0
  246. package/dist/cli/commands/globals/countGlobalVersions.js +36 -0
  247. package/dist/cli/commands/globals/countGlobalVersions.js.map +1 -0
  248. package/dist/cli/commands/globals/findGlobal.d.ts +2 -0
  249. package/dist/cli/commands/globals/findGlobal.d.ts.map +1 -0
  250. package/dist/cli/commands/globals/findGlobal.js +42 -0
  251. package/dist/cli/commands/globals/findGlobal.js.map +1 -0
  252. package/dist/cli/commands/globals/findGlobalVersionByID.d.ts +2 -0
  253. package/dist/cli/commands/globals/findGlobalVersionByID.d.ts.map +1 -0
  254. package/dist/cli/commands/globals/findGlobalVersionByID.js +46 -0
  255. package/dist/cli/commands/globals/findGlobalVersionByID.js.map +1 -0
  256. package/dist/cli/commands/globals/findGlobalVersions.d.ts +2 -0
  257. package/dist/cli/commands/globals/findGlobalVersions.d.ts.map +1 -0
  258. package/dist/cli/commands/globals/findGlobalVersions.js +55 -0
  259. package/dist/cli/commands/globals/findGlobalVersions.js.map +1 -0
  260. package/dist/cli/commands/globals/getGlobalSchema.d.ts +2 -0
  261. package/dist/cli/commands/globals/getGlobalSchema.d.ts.map +1 -0
  262. package/dist/cli/commands/globals/getGlobalSchema.js +34 -0
  263. package/dist/cli/commands/globals/getGlobalSchema.js.map +1 -0
  264. package/dist/cli/commands/globals/restoreGlobalVersion.d.ts +2 -0
  265. package/dist/cli/commands/globals/restoreGlobalVersion.d.ts.map +1 -0
  266. package/dist/cli/commands/globals/restoreGlobalVersion.js +46 -0
  267. package/dist/cli/commands/globals/restoreGlobalVersion.js.map +1 -0
  268. package/dist/cli/commands/globals/updateGlobal.d.ts +2 -0
  269. package/dist/cli/commands/globals/updateGlobal.d.ts.map +1 -0
  270. package/dist/cli/commands/globals/updateGlobal.js +93 -0
  271. package/dist/cli/commands/globals/updateGlobal.js.map +1 -0
  272. package/dist/cli/commands/help.d.ts +2 -0
  273. package/dist/cli/commands/help.d.ts.map +1 -0
  274. package/dist/cli/commands/help.js +42 -0
  275. package/dist/cli/commands/help.js.map +1 -0
  276. package/dist/cli/commands/info.d.ts +2 -0
  277. package/dist/cli/commands/info.d.ts.map +1 -0
  278. package/dist/cli/commands/info.js +78 -0
  279. package/dist/cli/commands/info.js.map +1 -0
  280. package/dist/cli/commands/jobs/handleSchedules.d.ts +2 -0
  281. package/dist/cli/commands/jobs/handleSchedules.d.ts.map +1 -0
  282. package/dist/cli/commands/jobs/handleSchedules.js +17 -0
  283. package/dist/cli/commands/jobs/handleSchedules.js.map +1 -0
  284. package/dist/cli/commands/jobs/run.d.ts +2 -0
  285. package/dist/cli/commands/jobs/run.d.ts.map +1 -0
  286. package/dist/cli/commands/jobs/run.js +29 -0
  287. package/dist/cli/commands/jobs/run.js.map +1 -0
  288. package/dist/cli/commands/migrate/create.d.ts +2 -0
  289. package/dist/cli/commands/migrate/create.d.ts.map +1 -0
  290. package/dist/cli/commands/migrate/create.js +44 -0
  291. package/dist/cli/commands/migrate/create.js.map +1 -0
  292. package/dist/cli/commands/migrate/down.d.ts +2 -0
  293. package/dist/cli/commands/migrate/down.d.ts.map +1 -0
  294. package/dist/cli/commands/migrate/down.js +22 -0
  295. package/dist/cli/commands/migrate/down.js.map +1 -0
  296. package/dist/cli/commands/migrate/fresh.d.ts +2 -0
  297. package/dist/cli/commands/migrate/fresh.d.ts.map +1 -0
  298. package/dist/cli/commands/migrate/fresh.js +28 -0
  299. package/dist/cli/commands/migrate/fresh.js.map +1 -0
  300. package/dist/cli/commands/migrate/initialize.d.ts +11 -0
  301. package/dist/cli/commands/migrate/initialize.d.ts.map +1 -0
  302. package/dist/cli/commands/migrate/initialize.js +17 -0
  303. package/dist/cli/commands/migrate/initialize.js.map +1 -0
  304. package/dist/cli/commands/migrate/refresh.d.ts +2 -0
  305. package/dist/cli/commands/migrate/refresh.d.ts.map +1 -0
  306. package/dist/cli/commands/migrate/refresh.js +22 -0
  307. package/dist/cli/commands/migrate/refresh.js.map +1 -0
  308. package/dist/cli/commands/migrate/reset.d.ts +2 -0
  309. package/dist/cli/commands/migrate/reset.d.ts.map +1 -0
  310. package/dist/cli/commands/migrate/reset.js +22 -0
  311. package/dist/cli/commands/migrate/reset.js.map +1 -0
  312. package/dist/cli/commands/migrate/run.d.ts +2 -0
  313. package/dist/cli/commands/migrate/run.d.ts.map +1 -0
  314. package/dist/cli/commands/migrate/run.js +28 -0
  315. package/dist/cli/commands/migrate/run.js.map +1 -0
  316. package/dist/cli/commands/migrate/status.d.ts +2 -0
  317. package/dist/cli/commands/migrate/status.d.ts.map +1 -0
  318. package/dist/cli/commands/migrate/status.js +22 -0
  319. package/dist/cli/commands/migrate/status.js.map +1 -0
  320. package/dist/cli/commands/run.d.ts +2 -0
  321. package/dist/cli/commands/run.d.ts.map +1 -0
  322. package/dist/cli/commands/run.js +45 -0
  323. package/dist/cli/commands/run.js.map +1 -0
  324. package/dist/cli/defineCLICommand.d.ts +32 -0
  325. package/dist/cli/defineCLICommand.d.ts.map +1 -0
  326. package/dist/cli/defineCLICommand.js +26 -0
  327. package/dist/cli/defineCLICommand.js.map +1 -0
  328. package/dist/cli/index.d.ts +7 -0
  329. package/dist/cli/index.d.ts.map +1 -0
  330. package/dist/cli/index.js +95 -0
  331. package/dist/cli/index.js.map +1 -0
  332. package/dist/cli/index.spec.js +402 -0
  333. package/dist/cli/index.spec.js.map +1 -0
  334. package/dist/cli/program/createHelp.d.ts +8 -0
  335. package/dist/cli/program/createHelp.d.ts.map +1 -0
  336. package/dist/cli/program/createHelp.js +26 -0
  337. package/dist/cli/program/createHelp.js.map +1 -0
  338. package/dist/cli/program/loadCommands.d.ts +12 -0
  339. package/dist/cli/program/loadCommands.d.ts.map +1 -0
  340. package/dist/cli/program/loadCommands.js +62 -0
  341. package/dist/cli/program/loadCommands.js.map +1 -0
  342. package/dist/cli/program/normalizeHelpArguments.d.ts +12 -0
  343. package/dist/cli/program/normalizeHelpArguments.d.ts.map +1 -0
  344. package/dist/cli/program/normalizeHelpArguments.js +34 -0
  345. package/dist/cli/program/normalizeHelpArguments.js.map +1 -0
  346. package/dist/cli/program/registerCommand.d.ts +10 -0
  347. package/dist/cli/program/registerCommand.d.ts.map +1 -0
  348. package/dist/cli/program/registerCommand.js +185 -0
  349. package/dist/cli/program/registerCommand.js.map +1 -0
  350. package/dist/cli/runtime/createRuntime.d.ts +9 -0
  351. package/dist/cli/runtime/createRuntime.d.ts.map +1 -0
  352. package/dist/cli/runtime/createRuntime.js +81 -0
  353. package/dist/cli/runtime/createRuntime.js.map +1 -0
  354. package/dist/cli/runtime/getCommandInput.d.ts +17 -0
  355. package/dist/cli/runtime/getCommandInput.d.ts.map +1 -0
  356. package/dist/cli/runtime/getCommandInput.js +86 -0
  357. package/dist/cli/runtime/getCommandInput.js.map +1 -0
  358. package/dist/cli/runtime/getCommandInput.spec.js +74 -0
  359. package/dist/cli/runtime/getCommandInput.spec.js.map +1 -0
  360. package/dist/cli/runtime/invokeCommand.d.ts +23 -0
  361. package/dist/cli/runtime/invokeCommand.d.ts.map +1 -0
  362. package/dist/cli/runtime/invokeCommand.js +107 -0
  363. package/dist/cli/runtime/invokeCommand.js.map +1 -0
  364. package/dist/cli/runtime/loadEnv.d.ts.map +1 -0
  365. package/dist/{bin → cli/runtime}/loadEnv.js +1 -1
  366. package/dist/cli/runtime/loadEnv.js.map +1 -0
  367. package/dist/cli/runtime/output.d.ts +50 -0
  368. package/dist/cli/runtime/output.d.ts.map +1 -0
  369. package/dist/cli/runtime/output.js +125 -0
  370. package/dist/cli/runtime/output.js.map +1 -0
  371. package/dist/cli/runtime/redirectOutputToStderr.d.ts +8 -0
  372. package/dist/cli/runtime/redirectOutputToStderr.d.ts.map +1 -0
  373. package/dist/cli/runtime/redirectOutputToStderr.js +31 -0
  374. package/dist/cli/runtime/redirectOutputToStderr.js.map +1 -0
  375. package/dist/collections/config/client.d.ts +11 -5
  376. package/dist/collections/config/client.d.ts.map +1 -1
  377. package/dist/collections/config/client.js +6 -1
  378. package/dist/collections/config/client.js.map +1 -1
  379. package/dist/collections/config/defaults.d.ts +4 -4
  380. package/dist/collections/config/defaults.d.ts.map +1 -1
  381. package/dist/collections/config/defaults.js +37 -32
  382. package/dist/collections/config/defaults.js.map +1 -1
  383. package/dist/collections/config/sanitize.d.ts +4 -8
  384. package/dist/collections/config/sanitize.d.ts.map +1 -1
  385. package/dist/collections/config/sanitize.js +31 -21
  386. package/dist/collections/config/sanitize.js.map +1 -1
  387. package/dist/collections/config/sanitize.spec.js +363 -1
  388. package/dist/collections/config/sanitize.spec.js.map +1 -1
  389. package/dist/collections/config/sanitizeCompoundIndexes.d.ts.map +1 -1
  390. package/dist/collections/config/types.d.ts +56 -51
  391. package/dist/collections/config/types.d.ts.map +1 -1
  392. package/dist/collections/config/types.js.map +1 -1
  393. package/dist/collections/config/useAsTitle.d.ts.map +1 -1
  394. package/dist/collections/config/useAsTitle.spec.js +27 -27
  395. package/dist/collections/config/useAsTitle.spec.js.map +1 -1
  396. package/dist/collections/dataloader.d.ts +1 -1
  397. package/dist/collections/dataloader.d.ts.map +1 -1
  398. package/dist/collections/operations/count.d.ts.map +1 -1
  399. package/dist/collections/operations/count.js +65 -70
  400. package/dist/collections/operations/count.js.map +1 -1
  401. package/dist/collections/operations/countVersions.d.ts.map +1 -1
  402. package/dist/collections/operations/countVersions.js +61 -66
  403. package/dist/collections/operations/countVersions.js.map +1 -1
  404. package/dist/collections/operations/create.d.ts.map +1 -1
  405. package/dist/collections/operations/create.js +22 -0
  406. package/dist/collections/operations/create.js.map +1 -1
  407. package/dist/collections/operations/delete.d.ts.map +1 -1
  408. package/dist/collections/operations/delete.js +215 -129
  409. package/dist/collections/operations/delete.js.map +1 -1
  410. package/dist/collections/operations/deleteByID.d.ts.map +1 -1
  411. package/dist/collections/operations/deleteByID.js +1 -0
  412. package/dist/collections/operations/deleteByID.js.map +1 -1
  413. package/dist/collections/operations/docAccess.d.ts.map +1 -1
  414. package/dist/collections/operations/docAccess.js +19 -25
  415. package/dist/collections/operations/docAccess.js.map +1 -1
  416. package/dist/collections/operations/duplicate.d.ts.map +1 -1
  417. package/dist/collections/operations/find.d.ts.map +1 -1
  418. package/dist/collections/operations/find.js +248 -246
  419. package/dist/collections/operations/find.js.map +1 -1
  420. package/dist/collections/operations/findByID.d.ts.map +1 -1
  421. package/dist/collections/operations/findByID.js +215 -220
  422. package/dist/collections/operations/findByID.js.map +1 -1
  423. package/dist/collections/operations/findDistinct.d.ts.map +1 -1
  424. package/dist/collections/operations/findDistinct.js +161 -159
  425. package/dist/collections/operations/findDistinct.js.map +1 -1
  426. package/dist/collections/operations/findVersionByID.d.ts.map +1 -1
  427. package/dist/collections/operations/findVersionByID.js +131 -136
  428. package/dist/collections/operations/findVersionByID.js.map +1 -1
  429. package/dist/collections/operations/findVersions.d.ts.map +1 -1
  430. package/dist/collections/operations/findVersions.js +152 -149
  431. package/dist/collections/operations/findVersions.js.map +1 -1
  432. package/dist/collections/operations/inputSchemas.d.ts +877 -0
  433. package/dist/collections/operations/inputSchemas.d.ts.map +1 -0
  434. package/dist/collections/operations/inputSchemas.js +217 -0
  435. package/dist/collections/operations/inputSchemas.js.map +1 -0
  436. package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
  437. package/dist/collections/operations/restoreVersion.js +8 -4
  438. package/dist/collections/operations/restoreVersion.js.map +1 -1
  439. package/dist/collections/operations/update.d.ts.map +1 -1
  440. package/dist/collections/operations/update.js +20 -1
  441. package/dist/collections/operations/update.js.map +1 -1
  442. package/dist/collections/operations/updateByID.d.ts.map +1 -1
  443. package/dist/collections/operations/updateByID.js +13 -0
  444. package/dist/collections/operations/updateByID.js.map +1 -1
  445. package/dist/collections/operations/utilities/buildAfterOperation.d.ts +1 -1
  446. package/dist/collections/operations/utilities/buildAfterOperation.d.ts.map +1 -1
  447. package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.d.ts.map +1 -1
  448. package/dist/collections/operations/utilities/sanitizeSortQuery.d.ts.map +1 -1
  449. package/dist/collections/operations/utilities/types.d.ts +20 -20
  450. package/dist/collections/operations/utilities/types.d.ts.map +1 -1
  451. package/dist/collections/operations/utilities/update.d.ts.map +1 -1
  452. package/dist/config/build.js +1 -1
  453. package/dist/config/build.js.map +1 -1
  454. package/dist/config/client.d.ts +2 -2
  455. package/dist/config/client.d.ts.map +1 -1
  456. package/dist/config/client.js +2 -1
  457. package/dist/config/client.js.map +1 -1
  458. package/dist/config/client.spec.js +20 -0
  459. package/dist/config/client.spec.js.map +1 -0
  460. package/dist/config/defaults.d.ts.map +1 -1
  461. package/dist/config/defaults.js +95 -42
  462. package/dist/config/defaults.js.map +1 -1
  463. package/dist/config/orderable/fractional-indexing.d.ts +23 -23
  464. package/dist/config/orderable/fractional-indexing.d.ts.map +1 -1
  465. package/dist/config/orderable/index.d.ts +1 -1
  466. package/dist/config/orderable/index.d.ts.map +1 -1
  467. package/dist/config/orderable/index.js +3 -2
  468. package/dist/config/orderable/index.js.map +1 -1
  469. package/dist/config/sanitize.d.ts +1 -1
  470. package/dist/config/sanitize.d.ts.map +1 -1
  471. package/dist/config/sanitize.js +42 -32
  472. package/dist/config/sanitize.js.map +1 -1
  473. package/dist/config/sanitize.spec.js +105 -0
  474. package/dist/config/sanitize.spec.js.map +1 -0
  475. package/dist/config/types.d.ts +495 -421
  476. package/dist/config/types.d.ts.map +1 -1
  477. package/dist/config/types.js.map +1 -1
  478. package/dist/database/combineQueries.d.ts.map +1 -1
  479. package/dist/database/createDatabaseAdapter.d.ts +1 -1
  480. package/dist/database/createDatabaseAdapter.d.ts.map +1 -1
  481. package/dist/database/createDatabaseAdapter.js +0 -2
  482. package/dist/database/createDatabaseAdapter.js.map +1 -1
  483. package/dist/database/isNestedRelationshipQuery.d.ts +14 -0
  484. package/dist/database/isNestedRelationshipQuery.d.ts.map +1 -0
  485. package/dist/database/isNestedRelationshipQuery.js +19 -0
  486. package/dist/database/isNestedRelationshipQuery.js.map +1 -0
  487. package/dist/database/migrations/createMigration.d.ts.map +1 -1
  488. package/dist/database/migrations/createMigration.js +4 -0
  489. package/dist/database/migrations/createMigration.js.map +1 -1
  490. package/dist/database/migrations/findMigrationDir.d.ts.map +1 -1
  491. package/dist/database/migrations/getPredefinedMigration.d.ts.map +1 -1
  492. package/dist/database/migrations/getPredefinedMigration.js +2 -2
  493. package/dist/database/migrations/getPredefinedMigration.js.map +1 -1
  494. package/dist/database/migrations/migrate.d.ts.map +1 -1
  495. package/dist/database/migrations/migrate.js +9 -0
  496. package/dist/database/migrations/migrate.js.map +1 -1
  497. package/dist/database/migrations/migrateDown.d.ts +2 -2
  498. package/dist/database/migrations/migrateDown.d.ts.map +1 -1
  499. package/dist/database/migrations/migrateDown.js +12 -2
  500. package/dist/database/migrations/migrateDown.js.map +1 -1
  501. package/dist/database/migrations/migrateRefresh.d.ts +2 -2
  502. package/dist/database/migrations/migrateRefresh.d.ts.map +1 -1
  503. package/dist/database/migrations/migrateRefresh.js +10 -2
  504. package/dist/database/migrations/migrateRefresh.js.map +1 -1
  505. package/dist/database/migrations/migrateReset.d.ts +2 -2
  506. package/dist/database/migrations/migrateReset.d.ts.map +1 -1
  507. package/dist/database/migrations/migrateReset.js +11 -1
  508. package/dist/database/migrations/migrateReset.js.map +1 -1
  509. package/dist/database/migrations/migrateStatus.d.ts +2 -2
  510. package/dist/database/migrations/migrateStatus.d.ts.map +1 -1
  511. package/dist/database/migrations/migrateStatus.js +11 -6
  512. package/dist/database/migrations/migrateStatus.js.map +1 -1
  513. package/dist/database/migrations/readMigrationFiles.d.ts.map +1 -1
  514. package/dist/database/migrations/writeMigrationIndex.d.ts.map +1 -1
  515. package/dist/database/queryValidation/validateQueryPaths.d.ts.map +1 -1
  516. package/dist/database/queryValidation/validateQueryPaths.js +8 -1
  517. package/dist/database/queryValidation/validateQueryPaths.js.map +1 -1
  518. package/dist/database/queryValidation/validateSearchParams.d.ts.map +1 -1
  519. package/dist/database/queryValidation/validateSearchParams.js +21 -4
  520. package/dist/database/queryValidation/validateSearchParams.js.map +1 -1
  521. package/dist/database/queryValidation/validateSortQuery.d.ts +23 -0
  522. package/dist/database/queryValidation/validateSortQuery.d.ts.map +1 -0
  523. package/dist/database/queryValidation/validateSortQuery.js +54 -0
  524. package/dist/database/queryValidation/validateSortQuery.js.map +1 -0
  525. package/dist/database/sanitizeJoinQuery.d.ts.map +1 -1
  526. package/dist/database/sanitizeJoinQuery.js +7 -0
  527. package/dist/database/sanitizeJoinQuery.js.map +1 -1
  528. package/dist/database/sanitizeWhereQuery.d.ts +1 -1
  529. package/dist/database/sanitizeWhereQuery.d.ts.map +1 -1
  530. package/dist/database/sanitizeWhereQuery.js +44 -1
  531. package/dist/database/sanitizeWhereQuery.js.map +1 -1
  532. package/dist/database/types.d.ts +37 -13
  533. package/dist/database/types.d.ts.map +1 -1
  534. package/dist/database/types.js.map +1 -1
  535. package/dist/duplicateDocument/index.d.ts.map +1 -1
  536. package/dist/duplicateDocument/index.js +1 -0
  537. package/dist/duplicateDocument/index.js.map +1 -1
  538. package/dist/email/getStringifiedToAddress.d.ts.map +1 -1
  539. package/dist/errors/APIError.d.ts.map +1 -1
  540. package/dist/errors/AuthenticationError.d.ts.map +1 -1
  541. package/dist/errors/DuplicateCollection.d.ts.map +1 -1
  542. package/dist/errors/DuplicateFieldName.d.ts.map +1 -1
  543. package/dist/errors/DuplicateGlobal.d.ts.map +1 -1
  544. package/dist/errors/ErrorDeletingFile.d.ts.map +1 -1
  545. package/dist/errors/FileRetrievalError.d.ts.map +1 -1
  546. package/dist/errors/FileUploadError.d.ts.map +1 -1
  547. package/dist/errors/Forbidden.d.ts.map +1 -1
  548. package/dist/errors/InvalidConfiguration.d.ts.map +1 -1
  549. package/dist/errors/InvalidFieldJoin.d.ts.map +1 -1
  550. package/dist/errors/InvalidFieldName.d.ts.map +1 -1
  551. package/dist/errors/InvalidFieldRelationship.d.ts.map +1 -1
  552. package/dist/errors/InvalidSchema.d.ts.map +1 -1
  553. package/dist/errors/Locked.d.ts.map +1 -1
  554. package/dist/errors/LockedAuth.d.ts.map +1 -1
  555. package/dist/errors/MissingCollectionLabel.d.ts.map +1 -1
  556. package/dist/errors/MissingEditorProp.d.ts.map +1 -1
  557. package/dist/errors/MissingFieldInputOptions.d.ts.map +1 -1
  558. package/dist/errors/MissingFieldType.d.ts.map +1 -1
  559. package/dist/errors/MissingFile.d.ts.map +1 -1
  560. package/dist/errors/NotFound.d.ts.map +1 -1
  561. package/dist/errors/QueryError.d.ts.map +1 -1
  562. package/dist/errors/ReservedFieldName.d.ts.map +1 -1
  563. package/dist/errors/TimestampsRequired.d.ts.map +1 -1
  564. package/dist/errors/UnauthorizedError.d.ts.map +1 -1
  565. package/dist/errors/UnverifiedEmail.d.ts.map +1 -1
  566. package/dist/errors/ValidationError.d.ts.map +1 -1
  567. package/dist/exports/auth.d.ts +5 -0
  568. package/dist/exports/auth.d.ts.map +1 -0
  569. package/dist/exports/auth.js +6 -0
  570. package/dist/exports/auth.js.map +1 -0
  571. package/dist/exports/cli.d.ts +4 -0
  572. package/dist/exports/cli.d.ts.map +1 -0
  573. package/dist/exports/cli.js +4 -0
  574. package/dist/exports/cli.js.map +1 -0
  575. package/dist/exports/cliBuiltin.d.ts +37 -0
  576. package/dist/exports/cliBuiltin.d.ts.map +1 -0
  577. package/dist/exports/cliBuiltin.js +38 -0
  578. package/dist/exports/cliBuiltin.js.map +1 -0
  579. package/dist/exports/internal.d.ts +9 -1
  580. package/dist/exports/internal.d.ts.map +1 -1
  581. package/dist/exports/internal.js +8 -1
  582. package/dist/exports/internal.js.map +1 -1
  583. package/dist/exports/node.d.ts +2 -2
  584. package/dist/exports/node.d.ts.map +1 -1
  585. package/dist/exports/node.js +2 -2
  586. package/dist/exports/node.js.map +1 -1
  587. package/dist/exports/shared.d.ts +6 -4
  588. package/dist/exports/shared.d.ts.map +1 -1
  589. package/dist/exports/shared.js +4 -3
  590. package/dist/exports/shared.js.map +1 -1
  591. package/dist/fields/baseFields/slug/duplicateContext.d.ts +11 -0
  592. package/dist/fields/baseFields/slug/duplicateContext.d.ts.map +1 -0
  593. package/dist/fields/baseFields/slug/duplicateContext.js +21 -0
  594. package/dist/fields/baseFields/slug/duplicateContext.js.map +1 -0
  595. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.d.ts +23 -0
  596. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.d.ts.map +1 -0
  597. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.js +65 -0
  598. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.js.map +1 -0
  599. package/dist/fields/baseFields/slug/generateSlug.d.ts +19 -7
  600. package/dist/fields/baseFields/slug/generateSlug.d.ts.map +1 -1
  601. package/dist/fields/baseFields/slug/generateSlug.js +111 -74
  602. package/dist/fields/baseFields/slug/generateSlug.js.map +1 -1
  603. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.d.ts +18 -0
  604. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.d.ts.map +1 -0
  605. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.js +20 -0
  606. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.js.map +1 -0
  607. package/dist/fields/baseFields/slug/getSlugFallbackValue.d.ts +23 -0
  608. package/dist/fields/baseFields/slug/getSlugFallbackValue.d.ts.map +1 -0
  609. package/dist/fields/baseFields/slug/getSlugFallbackValue.js +24 -0
  610. package/dist/fields/baseFields/slug/getSlugFallbackValue.js.map +1 -0
  611. package/dist/fields/baseFields/slug/hasValue.d.ts +3 -0
  612. package/dist/fields/baseFields/slug/hasValue.d.ts.map +1 -0
  613. package/dist/fields/baseFields/slug/hasValue.js +3 -0
  614. package/dist/fields/baseFields/slug/hasValue.js.map +1 -0
  615. package/dist/fields/baseFields/slug/types.d.ts +14 -0
  616. package/dist/fields/baseFields/slug/types.d.ts.map +1 -0
  617. package/dist/fields/baseFields/slug/types.js +6 -0
  618. package/dist/fields/baseFields/slug/types.js.map +1 -0
  619. package/dist/fields/config/client.d.ts +5 -5
  620. package/dist/fields/config/client.d.ts.map +1 -1
  621. package/dist/fields/config/client.js +3 -2
  622. package/dist/fields/config/client.js.map +1 -1
  623. package/dist/fields/config/reservedFieldNames.spec.js +18 -18
  624. package/dist/fields/config/reservedFieldNames.spec.js.map +1 -1
  625. package/dist/fields/config/sanitize.d.ts +6 -6
  626. package/dist/fields/config/sanitize.d.ts.map +1 -1
  627. package/dist/fields/config/sanitize.js +68 -19
  628. package/dist/fields/config/sanitize.js.map +1 -1
  629. package/dist/fields/config/sanitize.spec.js +105 -105
  630. package/dist/fields/config/sanitize.spec.js.map +1 -1
  631. package/dist/fields/config/sanitizeJoinField.d.ts.map +1 -1
  632. package/dist/fields/config/types.d.ts +37 -11
  633. package/dist/fields/config/types.d.ts.map +1 -1
  634. package/dist/fields/config/types.js +1 -1
  635. package/dist/fields/config/types.js.map +1 -1
  636. package/dist/fields/getDefaultValue.d.ts.map +1 -1
  637. package/dist/fields/hooks/afterChange/index.d.ts.map +1 -1
  638. package/dist/fields/hooks/afterChange/promise.d.ts.map +1 -1
  639. package/dist/fields/hooks/afterChange/traverseFields.d.ts.map +1 -1
  640. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
  641. package/dist/fields/hooks/afterRead/promise.js +1 -0
  642. package/dist/fields/hooks/afterRead/promise.js.map +1 -1
  643. package/dist/fields/hooks/afterRead/relationshipPopulationPromise.d.ts.map +1 -1
  644. package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
  645. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.d.ts.map +1 -1
  646. package/dist/fields/hooks/beforeChange/cloneDataFromOriginalDoc.d.ts.map +1 -1
  647. package/dist/fields/hooks/beforeChange/getExistingRowDoc.d.ts.map +1 -1
  648. package/dist/fields/hooks/beforeChange/index.d.ts.map +1 -1
  649. package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
  650. package/dist/fields/hooks/beforeChange/promise.js +1 -0
  651. package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
  652. package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
  653. package/dist/fields/hooks/beforeDuplicate/index.d.ts.map +1 -1
  654. package/dist/fields/hooks/beforeDuplicate/promise.d.ts.map +1 -1
  655. package/dist/fields/hooks/beforeDuplicate/traverseFields.d.ts.map +1 -1
  656. package/dist/fields/hooks/beforeValidate/index.d.ts.map +1 -1
  657. package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
  658. package/dist/fields/hooks/beforeValidate/promise.js +5 -3
  659. package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
  660. package/dist/fields/hooks/beforeValidate/stripNullRows.d.ts +10 -0
  661. package/dist/fields/hooks/beforeValidate/stripNullRows.d.ts.map +1 -0
  662. package/dist/fields/hooks/beforeValidate/stripNullRows.js +18 -0
  663. package/dist/fields/hooks/beforeValidate/stripNullRows.js.map +1 -0
  664. package/dist/fields/hooks/beforeValidate/traverseFields.d.ts.map +1 -1
  665. package/dist/fields/hooks/beforeValidate/traverseFields.js +2 -0
  666. package/dist/fields/hooks/beforeValidate/traverseFields.js.map +1 -1
  667. package/dist/fields/isFieldDisabled.d.ts.map +1 -1
  668. package/dist/fields/mergeBaseFields.d.ts.map +1 -1
  669. package/dist/fields/setDefaultBeforeDuplicate.d.ts.map +1 -1
  670. package/dist/fields/setDefaultBeforeDuplicate.js +1 -0
  671. package/dist/fields/setDefaultBeforeDuplicate.js.map +1 -1
  672. package/dist/fields/sortableFieldTypes.d.ts.map +1 -1
  673. package/dist/fields/sortableFieldTypes.js +1 -0
  674. package/dist/fields/sortableFieldTypes.js.map +1 -1
  675. package/dist/fields/validations.d.ts +4 -1
  676. package/dist/fields/validations.d.ts.map +1 -1
  677. package/dist/fields/validations.js +8 -2
  678. package/dist/fields/validations.js.map +1 -1
  679. package/dist/fields/validations.spec.js +61 -37
  680. package/dist/fields/validations.spec.js.map +1 -1
  681. package/dist/globals/config/client.d.ts +5 -5
  682. package/dist/globals/config/client.d.ts.map +1 -1
  683. package/dist/globals/config/client.js.map +1 -1
  684. package/dist/globals/config/sanitize.d.ts +3 -7
  685. package/dist/globals/config/sanitize.d.ts.map +1 -1
  686. package/dist/globals/config/sanitize.js +26 -6
  687. package/dist/globals/config/sanitize.js.map +1 -1
  688. package/dist/globals/config/sanitize.spec.js +227 -8
  689. package/dist/globals/config/sanitize.spec.js.map +1 -1
  690. package/dist/globals/config/types.d.ts +21 -16
  691. package/dist/globals/config/types.d.ts.map +1 -1
  692. package/dist/globals/config/types.js.map +1 -1
  693. package/dist/globals/operations/countGlobalVersions.d.ts.map +1 -1
  694. package/dist/globals/operations/countGlobalVersions.js +51 -55
  695. package/dist/globals/operations/countGlobalVersions.js.map +1 -1
  696. package/dist/globals/operations/docAccess.d.ts.map +1 -1
  697. package/dist/globals/operations/docAccess.js +19 -25
  698. package/dist/globals/operations/docAccess.js.map +1 -1
  699. package/dist/globals/operations/findOne.d.ts.map +1 -1
  700. package/dist/globals/operations/findOne.js +169 -174
  701. package/dist/globals/operations/findOne.js.map +1 -1
  702. package/dist/globals/operations/findVersionByID.d.ts.map +1 -1
  703. package/dist/globals/operations/findVersionByID.js +104 -109
  704. package/dist/globals/operations/findVersionByID.js.map +1 -1
  705. package/dist/globals/operations/findVersions.d.ts.map +1 -1
  706. package/dist/globals/operations/findVersions.js +112 -109
  707. package/dist/globals/operations/findVersions.js.map +1 -1
  708. package/dist/globals/operations/inputSchemas.d.ts +365 -0
  709. package/dist/globals/operations/inputSchemas.d.ts.map +1 -0
  710. package/dist/globals/operations/inputSchemas.js +104 -0
  711. package/dist/globals/operations/inputSchemas.js.map +1 -0
  712. package/dist/globals/operations/restoreVersion.d.ts.map +1 -1
  713. package/dist/globals/operations/restoreVersion.js +1 -0
  714. package/dist/globals/operations/restoreVersion.js.map +1 -1
  715. package/dist/globals/operations/update.d.ts.map +1 -1
  716. package/dist/globals/operations/update.js +1 -0
  717. package/dist/globals/operations/update.js.map +1 -1
  718. package/dist/hierarchy/addHierarchyToCollection.d.ts.map +1 -1
  719. package/dist/hierarchy/addHierarchyToCollection.js +2 -0
  720. package/dist/hierarchy/addHierarchyToCollection.js.map +1 -1
  721. package/dist/hierarchy/buildParentField.d.ts.map +1 -1
  722. package/dist/hierarchy/constants.d.ts.map +1 -1
  723. package/dist/hierarchy/getInitialTreeData.d.ts.map +1 -1
  724. package/dist/hierarchy/hooks/collectionAfterDelete.d.ts.map +1 -1
  725. package/dist/hierarchy/hooks/collectionAfterRead.d.ts.map +1 -1
  726. package/dist/hierarchy/hooks/collectionBeforeChange.d.ts.map +1 -1
  727. package/dist/hierarchy/hooks/collectionBeforeDelete.d.ts.map +1 -1
  728. package/dist/hierarchy/hooks/collectionBeforeOperation.d.ts.map +1 -1
  729. package/dist/hierarchy/hooks/ensureSafeCollectionsChange.d.ts.map +1 -1
  730. package/dist/hierarchy/injectHierarchyButton.d.ts.map +1 -1
  731. package/dist/hierarchy/resolveHierarchyCollections.d.ts.map +1 -1
  732. package/dist/hierarchy/sanitizeHierarchyCollection.d.ts.map +1 -1
  733. package/dist/index.bundled.d.ts +5889 -4239
  734. package/dist/index.d.ts +102 -44
  735. package/dist/index.d.ts.map +1 -1
  736. package/dist/index.js +84 -64
  737. package/dist/index.js.map +1 -1
  738. package/dist/kv/adapters/DatabaseKVAdapter.d.ts.map +1 -1
  739. package/dist/kv/adapters/InMemoryKVAdapter.d.ts.map +1 -1
  740. package/dist/locked-documents/config.d.ts.map +1 -1
  741. package/dist/preferences/config.d.ts.map +1 -1
  742. package/dist/preferences/deleteUserPreferences.d.ts.map +1 -1
  743. package/dist/preferences/keys.d.ts +5 -5
  744. package/dist/preferences/keys.d.ts.map +1 -1
  745. package/dist/query-presets/access.d.ts.map +1 -1
  746. package/dist/query-presets/config.d.ts.map +1 -1
  747. package/dist/query-presets/constraints.d.ts.map +1 -1
  748. package/dist/query-presets/constraints.js +1 -1
  749. package/dist/query-presets/constraints.js.map +1 -1
  750. package/dist/query-presets/types.d.ts +1 -1
  751. package/dist/query-presets/types.d.ts.map +1 -1
  752. package/dist/queues/config/collection.d.ts.map +1 -1
  753. package/dist/queues/config/collection.js +43 -43
  754. package/dist/queues/config/collection.js.map +1 -1
  755. package/dist/queues/config/global.d.ts +5 -6
  756. package/dist/queues/config/global.d.ts.map +1 -1
  757. package/dist/queues/config/global.js +1 -1
  758. package/dist/queues/config/global.js.map +1 -1
  759. package/dist/queues/config/types/index.d.ts +31 -24
  760. package/dist/queues/config/types/index.d.ts.map +1 -1
  761. package/dist/queues/config/types/index.js.map +1 -1
  762. package/dist/queues/config/types/taskTypes.d.ts +4 -7
  763. package/dist/queues/config/types/taskTypes.d.ts.map +1 -1
  764. package/dist/queues/config/types/taskTypes.js.map +1 -1
  765. package/dist/queues/config/types/workflowJSONTypes.d.ts +10 -9
  766. package/dist/queues/config/types/workflowJSONTypes.d.ts.map +1 -1
  767. package/dist/queues/config/types/workflowJSONTypes.js.map +1 -1
  768. package/dist/queues/config/types/workflowTypes.d.ts +11 -58
  769. package/dist/queues/config/types/workflowTypes.d.ts.map +1 -1
  770. package/dist/queues/config/types/workflowTypes.js.map +1 -1
  771. package/dist/queues/endpoints/handleSchedules.d.ts.map +1 -1
  772. package/dist/queues/endpoints/handleSchedules.js +3 -2
  773. package/dist/queues/endpoints/handleSchedules.js.map +1 -1
  774. package/dist/queues/endpoints/run.d.ts.map +1 -1
  775. package/dist/queues/endpoints/run.js +2 -1
  776. package/dist/queues/endpoints/run.js.map +1 -1
  777. package/dist/queues/errors/handleTaskError.js +4 -4
  778. package/dist/queues/errors/handleTaskError.js.map +1 -1
  779. package/dist/queues/errors/handleWorkflowError.js +1 -1
  780. package/dist/queues/errors/handleWorkflowError.js.map +1 -1
  781. package/dist/queues/errors/index.d.ts +6 -0
  782. package/dist/queues/errors/index.d.ts.map +1 -1
  783. package/dist/queues/errors/index.js +5 -0
  784. package/dist/queues/errors/index.js.map +1 -1
  785. package/dist/queues/localAPI.d.ts +9 -9
  786. package/dist/queues/localAPI.d.ts.map +1 -1
  787. package/dist/queues/localAPI.js +63 -66
  788. package/dist/queues/localAPI.js.map +1 -1
  789. package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.d.ts +4 -4
  790. package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.d.ts.map +1 -1
  791. package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.js.map +1 -1
  792. package/dist/queues/operations/handleSchedules/getQueuesWithSchedules.d.ts.map +1 -1
  793. package/dist/queues/operations/handleSchedules/index.d.ts +1 -1
  794. package/dist/queues/operations/handleSchedules/index.d.ts.map +1 -1
  795. package/dist/queues/operations/handleSchedules/index.js +1 -1
  796. package/dist/queues/operations/handleSchedules/index.js.map +1 -1
  797. package/dist/queues/operations/runJobs/heartbeat.d.ts +13 -0
  798. package/dist/queues/operations/runJobs/heartbeat.d.ts.map +1 -0
  799. package/dist/queues/operations/runJobs/heartbeat.js +66 -0
  800. package/dist/queues/operations/runJobs/heartbeat.js.map +1 -0
  801. package/dist/queues/operations/runJobs/index.d.ts.map +1 -1
  802. package/dist/queues/operations/runJobs/index.js +133 -84
  803. package/dist/queues/operations/runJobs/index.js.map +1 -1
  804. package/dist/queues/operations/runJobs/runJSONJob/index.d.ts.map +1 -1
  805. package/dist/queues/operations/runJobs/runJSONJob/index.js +6 -3
  806. package/dist/queues/operations/runJobs/runJSONJob/index.js.map +1 -1
  807. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.d.ts.map +1 -1
  808. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js +5 -5
  809. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js.map +1 -1
  810. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.d.ts +2 -1
  811. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.d.ts.map +1 -1
  812. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.js +39 -8
  813. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.js.map +1 -1
  814. package/dist/queues/operations/runJobs/runJob/importHandlerPath.d.ts +1 -1
  815. package/dist/queues/operations/runJobs/runJob/importHandlerPath.d.ts.map +1 -1
  816. package/dist/queues/operations/runJobs/runJob/importHandlerPath.js.map +1 -1
  817. package/dist/queues/operations/runJobs/runJob/index.d.ts.map +1 -1
  818. package/dist/queues/operations/runJobs/runJob/index.js +4 -4
  819. package/dist/queues/operations/runJobs/runJob/index.js.map +1 -1
  820. package/dist/queues/utilities/getCurrentDate.d.ts.map +1 -1
  821. package/dist/queues/utilities/getJobTaskStatus.d.ts.map +1 -1
  822. package/dist/queues/utilities/updateJob.d.ts.map +1 -1
  823. package/dist/queues/utilities/updateJob.js +3 -0
  824. package/dist/queues/utilities/updateJob.js.map +1 -1
  825. package/dist/translations/getLocalI18n.d.ts.map +1 -1
  826. package/dist/types/constants.d.ts +23 -2
  827. package/dist/types/constants.d.ts.map +1 -1
  828. package/dist/types/constants.js +23 -0
  829. package/dist/types/constants.js.map +1 -1
  830. package/dist/types/index.d.ts +4 -7
  831. package/dist/types/index.d.ts.map +1 -1
  832. package/dist/types/index.js.map +1 -1
  833. package/dist/uploads/checkFileAccess.d.ts.map +1 -1
  834. package/dist/uploads/checkFileAccess.js +1 -0
  835. package/dist/uploads/checkFileAccess.js.map +1 -1
  836. package/dist/uploads/checkFileRestrictions.d.ts +1 -1
  837. package/dist/uploads/checkFileRestrictions.d.ts.map +1 -1
  838. package/dist/uploads/checkFileRestrictions.js +15 -1
  839. package/dist/uploads/checkFileRestrictions.js.map +1 -1
  840. package/dist/uploads/cropImage.d.ts +1 -1
  841. package/dist/uploads/cropImage.d.ts.map +1 -1
  842. package/dist/uploads/cropImage.js +2 -5
  843. package/dist/uploads/cropImage.js.map +1 -1
  844. package/dist/uploads/cropImage.spec.js +71 -0
  845. package/dist/uploads/cropImage.spec.js.map +1 -0
  846. package/dist/uploads/docWithFilenameExists.d.ts.map +1 -1
  847. package/dist/uploads/downloadFileToBuffer.d.ts +11 -0
  848. package/dist/uploads/downloadFileToBuffer.d.ts.map +1 -0
  849. package/dist/uploads/downloadFileToBuffer.js +41 -0
  850. package/dist/uploads/downloadFileToBuffer.js.map +1 -0
  851. package/dist/uploads/endpoints/index.js +2 -2
  852. package/dist/uploads/endpoints/index.js.map +1 -1
  853. package/dist/uploads/endpoints/pasteURL.d.ts +3 -0
  854. package/dist/uploads/endpoints/pasteURL.d.ts.map +1 -0
  855. package/dist/uploads/endpoints/{getFileFromURL.js → pasteURL.js} +19 -55
  856. package/dist/uploads/endpoints/pasteURL.js.map +1 -0
  857. package/dist/uploads/endpoints/uploadInstructions.d.ts +15 -0
  858. package/dist/uploads/endpoints/uploadInstructions.d.ts.map +1 -0
  859. package/dist/uploads/endpoints/uploadInstructions.js +84 -0
  860. package/dist/uploads/endpoints/uploadInstructions.js.map +1 -0
  861. package/dist/uploads/fetchAPI-multipart/isEligibleRequest.d.ts.map +1 -1
  862. package/dist/uploads/fetchAPI-multipart/isEligibleRequest.js +1 -2
  863. package/dist/uploads/fetchAPI-multipart/isEligibleRequest.js.map +1 -1
  864. package/dist/uploads/fetchAPI-multipart/isEligibleRequest.spec.js +28 -0
  865. package/dist/uploads/fetchAPI-multipart/isEligibleRequest.spec.js.map +1 -1
  866. package/dist/uploads/fetchAPI-multipart/processMultipart.d.ts.map +1 -1
  867. package/dist/uploads/fetchAPI-multipart/processMultipart.js +4 -0
  868. package/dist/uploads/fetchAPI-multipart/processMultipart.js.map +1 -1
  869. package/dist/uploads/fetchAPI-multipart/processNested.d.ts.map +1 -1
  870. package/dist/uploads/fetchAPI-multipart/utilities.d.ts.map +1 -1
  871. package/dist/uploads/fetchWithRedirects.d.ts +17 -0
  872. package/dist/uploads/fetchWithRedirects.d.ts.map +1 -0
  873. package/dist/uploads/fetchWithRedirects.js +39 -0
  874. package/dist/uploads/fetchWithRedirects.js.map +1 -0
  875. package/dist/uploads/fileExists.d.ts.map +1 -1
  876. package/dist/uploads/generateFileData.d.ts +9 -0
  877. package/dist/uploads/generateFileData.d.ts.map +1 -1
  878. package/dist/uploads/generateFileData.js +62 -48
  879. package/dist/uploads/generateFileData.js.map +1 -1
  880. package/dist/uploads/generateFileData.spec.js +207 -0
  881. package/dist/uploads/generateFileData.spec.js.map +1 -0
  882. package/dist/uploads/generateFileData.tempFileBuffering.spec.js +81 -0
  883. package/dist/uploads/generateFileData.tempFileBuffering.spec.js.map +1 -0
  884. package/dist/uploads/getBaseFields.d.ts.map +1 -1
  885. package/dist/uploads/getFileByPath.d.ts +1 -1
  886. package/dist/uploads/getFileByPath.d.ts.map +1 -1
  887. package/dist/uploads/getFileContentRequirement.d.ts +32 -0
  888. package/dist/uploads/getFileContentRequirement.d.ts.map +1 -0
  889. package/dist/uploads/getFileContentRequirement.js +40 -0
  890. package/dist/uploads/getFileContentRequirement.js.map +1 -0
  891. package/dist/uploads/getFileContentRequirement.spec.js +125 -0
  892. package/dist/uploads/getFileContentRequirement.spec.js.map +1 -0
  893. package/dist/uploads/getFileFromUploadInstructions.d.ts +8 -0
  894. package/dist/uploads/getFileFromUploadInstructions.d.ts.map +1 -0
  895. package/dist/uploads/getFileFromUploadInstructions.js +232 -0
  896. package/dist/uploads/getFileFromUploadInstructions.js.map +1 -0
  897. package/dist/uploads/getFileFromUploadInstructions.spec.js +387 -0
  898. package/dist/uploads/getFileFromUploadInstructions.spec.js.map +1 -0
  899. package/dist/uploads/getFileTypeFallback.d.ts.map +1 -1
  900. package/dist/uploads/getImageSize.d.ts +12 -1
  901. package/dist/uploads/getImageSize.d.ts.map +1 -1
  902. package/dist/uploads/getImageSize.js +20 -18
  903. package/dist/uploads/getImageSize.js.map +1 -1
  904. package/dist/uploads/getImageSize.spec.js +298 -0
  905. package/dist/uploads/getImageSize.spec.js.map +1 -0
  906. package/dist/uploads/getSafeFilename.d.ts.map +1 -1
  907. package/dist/uploads/image-resizing/createImageSize.d.ts.map +1 -1
  908. package/dist/uploads/image-resizing/createImageSizes.d.ts.map +1 -1
  909. package/dist/uploads/image-resizing/createImageSizes.js +2 -5
  910. package/dist/uploads/image-resizing/createImageSizes.js.map +1 -1
  911. package/dist/uploads/image-resizing/createImageSizes.spec.js +80 -0
  912. package/dist/uploads/image-resizing/createImageSizes.spec.js.map +1 -0
  913. package/dist/uploads/image-resizing/generateImageSizeFilename.d.ts.map +1 -1
  914. package/dist/uploads/image-resizing/getImageResizeAction.d.ts +1 -1
  915. package/dist/uploads/image-resizing/getImageResizeAction.d.ts.map +1 -1
  916. package/dist/uploads/image-resizing/parseFilename.d.ts.map +1 -1
  917. package/dist/uploads/image-resizing/sanitizeResizeConfig.d.ts.map +1 -1
  918. package/dist/uploads/isAnimatedImage.d.ts +8 -0
  919. package/dist/uploads/isAnimatedImage.d.ts.map +1 -0
  920. package/dist/uploads/isAnimatedImage.js +22 -0
  921. package/dist/uploads/isAnimatedImage.js.map +1 -0
  922. package/dist/uploads/isAnimatedImage.spec.js +19 -0
  923. package/dist/uploads/isAnimatedImage.spec.js.map +1 -0
  924. package/dist/uploads/mimeTypeValidator.d.ts.map +1 -1
  925. package/dist/uploads/probeImageSize.d.ts +39 -0
  926. package/dist/uploads/probeImageSize.d.ts.map +1 -0
  927. package/dist/uploads/probeImageSize.js +374 -0
  928. package/dist/uploads/probeImageSize.js.map +1 -0
  929. package/dist/uploads/probeImageSize.spec.js +366 -0
  930. package/dist/uploads/probeImageSize.spec.js.map +1 -0
  931. package/dist/uploads/resolveURLUploadInput.d.ts +25 -0
  932. package/dist/uploads/resolveURLUploadInput.d.ts.map +1 -0
  933. package/dist/uploads/resolveURLUploadInput.js +53 -0
  934. package/dist/uploads/resolveURLUploadInput.js.map +1 -0
  935. package/dist/uploads/safeFetch.d.ts.map +1 -1
  936. package/dist/uploads/saveBufferToFile.d.ts.map +1 -1
  937. package/dist/uploads/stagedUpload.d.ts +27 -0
  938. package/dist/uploads/stagedUpload.d.ts.map +1 -0
  939. package/dist/uploads/stagedUpload.js +197 -0
  940. package/dist/uploads/stagedUpload.js.map +1 -0
  941. package/dist/uploads/types.d.ts +91 -7
  942. package/dist/uploads/types.d.ts.map +1 -1
  943. package/dist/uploads/types.js.map +1 -1
  944. package/dist/uploads/unlinkTempFiles.d.ts.map +1 -1
  945. package/dist/uploads/unlinkTempFiles.js +6 -2
  946. package/dist/uploads/unlinkTempFiles.js.map +1 -1
  947. package/dist/uploads/unlinkTempFiles.spec.js +71 -0
  948. package/dist/uploads/unlinkTempFiles.spec.js.map +1 -0
  949. package/dist/uploads/uploadFiles.d.ts.map +1 -1
  950. package/dist/uploads/uploadFiles.js +7 -2
  951. package/dist/uploads/uploadFiles.js.map +1 -1
  952. package/dist/uploads/uploadFiles.spec.js +44 -0
  953. package/dist/uploads/uploadFiles.spec.js.map +1 -0
  954. package/dist/uploads/validateUploadURL.d.ts +13 -0
  955. package/dist/uploads/validateUploadURL.d.ts.map +1 -0
  956. package/dist/uploads/validateUploadURL.js +37 -0
  957. package/dist/uploads/validateUploadURL.js.map +1 -0
  958. package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
  959. package/dist/utilities/addDataAndFileToRequest.js +12 -45
  960. package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
  961. package/dist/utilities/addLocalesToRequest.d.ts.map +1 -1
  962. package/dist/utilities/addSelectGenericsToGeneretedTypes.d.ts.map +1 -1
  963. package/dist/utilities/appendDateTimezoneSelectFields.d.ts.map +1 -1
  964. package/dist/utilities/appendNonTrashedFilter.d.ts +1 -1
  965. package/dist/utilities/appendNonTrashedFilter.d.ts.map +1 -1
  966. package/dist/utilities/appendNonTrashedFilter.js.map +1 -1
  967. package/dist/utilities/appendUploadSelectFields.d.ts.map +1 -1
  968. package/dist/utilities/canAccessAdmin.d.ts.map +1 -1
  969. package/dist/utilities/canAccessAdmin.js +1 -0
  970. package/dist/utilities/canAccessAdmin.js.map +1 -1
  971. package/dist/utilities/checkDocumentLockStatus.d.ts +19 -0
  972. package/dist/utilities/checkDocumentLockStatus.d.ts.map +1 -1
  973. package/dist/utilities/checkDocumentLockStatus.js +74 -0
  974. package/dist/utilities/checkDocumentLockStatus.js.map +1 -1
  975. package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
  976. package/dist/utilities/configToJSONSchema.js +3 -2
  977. package/dist/utilities/configToJSONSchema.js.map +1 -1
  978. package/dist/utilities/configToJSONSchema.spec.js +68 -31
  979. package/dist/utilities/configToJSONSchema.spec.js.map +1 -1
  980. package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
  981. package/dist/utilities/deepCopyObject.d.ts.map +1 -1
  982. package/dist/utilities/dependencies/resolveFrom.d.ts.map +1 -1
  983. package/dist/utilities/entityInputSchema/filterFieldsByAccess.d.ts +30 -0
  984. package/dist/utilities/entityInputSchema/filterFieldsByAccess.d.ts.map +1 -0
  985. package/dist/utilities/entityInputSchema/filterFieldsByAccess.js +71 -0
  986. package/dist/utilities/entityInputSchema/filterFieldsByAccess.js.map +1 -0
  987. package/dist/utilities/entityInputSchema/getEntityInputSchema.d.ts +13 -0
  988. package/dist/utilities/entityInputSchema/getEntityInputSchema.d.ts.map +1 -0
  989. package/dist/utilities/entityInputSchema/getEntityInputSchema.js +66 -0
  990. package/dist/utilities/entityInputSchema/getEntityInputSchema.js.map +1 -0
  991. package/dist/utilities/entityInputSchema/sanitizeEntitySchema.d.ts +10 -0
  992. package/dist/utilities/entityInputSchema/sanitizeEntitySchema.d.ts.map +1 -0
  993. package/dist/utilities/entityInputSchema/sanitizeEntitySchema.js +384 -0
  994. package/dist/utilities/entityInputSchema/sanitizeEntitySchema.js.map +1 -0
  995. package/dist/utilities/entityInputSchema/sanitizeEntitySchema.spec.js +133 -0
  996. package/dist/utilities/entityInputSchema/sanitizeEntitySchema.spec.js.map +1 -0
  997. package/dist/utilities/entityInputSchema/types.d.ts +16 -0
  998. package/dist/utilities/entityInputSchema/types.d.ts.map +1 -0
  999. package/dist/utilities/entityInputSchema/types.js +3 -0
  1000. package/dist/utilities/entityInputSchema/types.js.map +1 -0
  1001. package/dist/utilities/entityInputSchema/validateEntityData.d.ts +13 -0
  1002. package/dist/utilities/entityInputSchema/validateEntityData.d.ts.map +1 -0
  1003. package/dist/utilities/entityInputSchema/validateEntityData.js +138 -0
  1004. package/dist/utilities/entityInputSchema/validateEntityData.js.map +1 -0
  1005. package/dist/utilities/escapeRegExp.d.ts.map +1 -1
  1006. package/dist/utilities/extractID.d.ts.map +1 -1
  1007. package/dist/utilities/fieldValueExists.d.ts +29 -0
  1008. package/dist/utilities/fieldValueExists.d.ts.map +1 -0
  1009. package/dist/utilities/fieldValueExists.js +37 -0
  1010. package/dist/utilities/fieldValueExists.js.map +1 -0
  1011. package/dist/utilities/flattenAllFields.d.ts.map +1 -1
  1012. package/dist/utilities/formatAdminURL.d.ts.map +1 -1
  1013. package/dist/utilities/formatErrors.d.ts.map +1 -1
  1014. package/dist/utilities/formatLabels.d.ts.map +1 -1
  1015. package/dist/utilities/getBestFitFromSizes.d.ts.map +1 -1
  1016. package/dist/utilities/getBlockSelect.d.ts.map +1 -1
  1017. package/dist/utilities/getDataByPath.d.ts.map +1 -1
  1018. package/dist/utilities/getEntityPermissions/getEntityPermissions.d.ts.map +1 -1
  1019. package/dist/utilities/getEntityPermissions/getEntityPermissions.js +1 -0
  1020. package/dist/utilities/getEntityPermissions/getEntityPermissions.js.map +1 -1
  1021. package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts.map +1 -1
  1022. package/dist/utilities/getFieldByPath.d.ts.map +1 -1
  1023. package/dist/utilities/getFieldPermissions.d.ts.map +1 -1
  1024. package/dist/utilities/getNextVersion.d.ts +7 -0
  1025. package/dist/utilities/getNextVersion.d.ts.map +1 -0
  1026. package/dist/utilities/getNextVersion.js +20 -0
  1027. package/dist/utilities/getNextVersion.js.map +1 -0
  1028. package/dist/utilities/getNextVersion.spec.js +16 -0
  1029. package/dist/utilities/getNextVersion.spec.js.map +1 -0
  1030. package/dist/utilities/getObjectDotNotation.d.ts.map +1 -1
  1031. package/dist/utilities/getRequestEntity.d.ts.map +1 -1
  1032. package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
  1033. package/dist/utilities/getRequestOrigin.d.ts +2 -2
  1034. package/dist/utilities/getRequestOrigin.d.ts.map +1 -1
  1035. package/dist/utilities/getRequestOrigin.js.map +1 -1
  1036. package/dist/utilities/getSafeRedirect.d.ts.map +1 -1
  1037. package/dist/utilities/getSafeRedirect.js +16 -9
  1038. package/dist/utilities/getSafeRedirect.js.map +1 -1
  1039. package/dist/utilities/getSafeRedirect.spec.js +96 -2
  1040. package/dist/utilities/getSafeRedirect.spec.js.map +1 -1
  1041. package/dist/utilities/getSelectMode.d.ts.map +1 -1
  1042. package/dist/utilities/getSiblingData.d.ts.map +1 -1
  1043. package/dist/utilities/getTranslatedLabel.d.ts.map +1 -1
  1044. package/dist/utilities/getUniqueFieldValue.d.ts +28 -0
  1045. package/dist/utilities/getUniqueFieldValue.d.ts.map +1 -0
  1046. package/dist/utilities/getUniqueFieldValue.js +27 -0
  1047. package/dist/utilities/getUniqueFieldValue.js.map +1 -0
  1048. package/dist/utilities/getVersionsConfig.d.ts +1 -1
  1049. package/dist/utilities/getVersionsConfig.d.ts.map +1 -1
  1050. package/dist/utilities/getVirtualFieldNames.d.ts +14 -0
  1051. package/dist/utilities/getVirtualFieldNames.d.ts.map +1 -0
  1052. package/dist/utilities/getVirtualFieldNames.js +35 -0
  1053. package/dist/utilities/getVirtualFieldNames.js.map +1 -0
  1054. package/dist/utilities/handleEndpoints.d.ts.map +1 -1
  1055. package/dist/utilities/headersWithCors.d.ts.map +1 -1
  1056. package/dist/utilities/headersWithCors.js +1 -1
  1057. package/dist/utilities/headersWithCors.js.map +1 -1
  1058. package/dist/utilities/isEntityHidden.d.ts +2 -2
  1059. package/dist/utilities/isEntityHidden.d.ts.map +1 -1
  1060. package/dist/utilities/isURLAllowed.d.ts.map +1 -1
  1061. package/dist/utilities/isURLAllowed.js +9 -3
  1062. package/dist/utilities/isURLAllowed.js.map +1 -1
  1063. package/dist/utilities/isURLAllowed.spec.js +78 -0
  1064. package/dist/utilities/isURLAllowed.spec.js.map +1 -0
  1065. package/dist/utilities/isValidID.d.ts +1 -1
  1066. package/dist/utilities/isValidID.d.ts.map +1 -1
  1067. package/dist/utilities/killTransaction.d.ts +7 -0
  1068. package/dist/utilities/killTransaction.d.ts.map +1 -1
  1069. package/dist/utilities/killTransaction.js +7 -0
  1070. package/dist/utilities/killTransaction.js.map +1 -1
  1071. package/dist/utilities/logError.d.ts.map +1 -1
  1072. package/dist/utilities/logError.js +5 -2
  1073. package/dist/utilities/logError.js.map +1 -1
  1074. package/dist/utilities/logger.d.ts +1 -1
  1075. package/dist/utilities/logger.d.ts.map +1 -1
  1076. package/dist/utilities/mergeHeaders.d.ts.map +1 -1
  1077. package/dist/utilities/mergeListSearchAndWhere.d.ts.map +1 -1
  1078. package/dist/utilities/miniChalk.d.ts.map +1 -1
  1079. package/dist/utilities/nextJsDevReloadStrategy.d.ts +7 -0
  1080. package/dist/utilities/nextJsDevReloadStrategy.d.ts.map +1 -0
  1081. package/dist/utilities/nextJsDevReloadStrategy.js +59 -0
  1082. package/dist/utilities/nextJsDevReloadStrategy.js.map +1 -0
  1083. package/dist/utilities/nextJsDevReloadStrategy.spec.js +123 -0
  1084. package/dist/utilities/nextJsDevReloadStrategy.spec.js.map +1 -0
  1085. package/dist/utilities/optionsAreEqual.d.ts.map +1 -1
  1086. package/dist/utilities/parseBooleanString.d.ts.map +1 -1
  1087. package/dist/utilities/parseCookies.d.ts +1 -1
  1088. package/dist/utilities/parseCookies.d.ts.map +1 -1
  1089. package/dist/utilities/parseDocumentID.d.ts +4 -1
  1090. package/dist/utilities/parseDocumentID.d.ts.map +1 -1
  1091. package/dist/utilities/parseDocumentID.js +7 -1
  1092. package/dist/utilities/parseDocumentID.js.map +1 -1
  1093. package/dist/utilities/parseParams/index.d.ts.map +1 -1
  1094. package/dist/utilities/profiling.d.ts.map +1 -1
  1095. package/dist/utilities/reduceFieldsToValues.d.ts.map +1 -1
  1096. package/dist/utilities/resolveSelect.d.ts.map +1 -1
  1097. package/dist/utilities/routeError.d.ts.map +1 -1
  1098. package/dist/utilities/sanitizeFallbackLocale.d.ts.map +1 -1
  1099. package/dist/utilities/sanitizeInternalFields.d.ts.map +1 -1
  1100. package/dist/utilities/sanitizeJoinParams.d.ts.map +1 -1
  1101. package/dist/utilities/sanitizePopulateParam.d.ts.map +1 -1
  1102. package/dist/utilities/sanitizeSelect.d.ts.map +1 -1
  1103. package/dist/utilities/sanitizeSelectParam.d.ts.map +1 -1
  1104. package/dist/utilities/sanitizeSortParams.d.ts.map +1 -1
  1105. package/dist/utilities/setsAreEqual.d.ts.map +1 -1
  1106. package/dist/utilities/sharedInputSchemas.d.ts +52 -0
  1107. package/dist/utilities/sharedInputSchemas.d.ts.map +1 -0
  1108. package/dist/utilities/sharedInputSchemas.js +101 -0
  1109. package/dist/utilities/sharedInputSchemas.js.map +1 -0
  1110. package/dist/utilities/slugify.d.ts.map +1 -1
  1111. package/dist/utilities/stripUnselectedFields.d.ts.map +1 -1
  1112. package/dist/utilities/telemetry/conf/index.d.ts.map +1 -1
  1113. package/dist/utilities/telemetry/events/adminInit.d.ts.map +1 -1
  1114. package/dist/utilities/telemetry/events/adminInit.js +2 -3
  1115. package/dist/utilities/telemetry/events/adminInit.js.map +1 -1
  1116. package/dist/utilities/telemetry/events/serverInit.d.ts.map +1 -1
  1117. package/dist/utilities/telemetry/events/serverInit.js +2 -3
  1118. package/dist/utilities/telemetry/events/serverInit.js.map +1 -1
  1119. package/dist/utilities/telemetry/featureInfo/getFeatureInfo.d.ts +4 -0
  1120. package/dist/utilities/telemetry/featureInfo/getFeatureInfo.d.ts.map +1 -0
  1121. package/dist/utilities/telemetry/featureInfo/getFeatureInfo.js +261 -0
  1122. package/dist/utilities/telemetry/featureInfo/getFeatureInfo.js.map +1 -0
  1123. package/dist/utilities/telemetry/featureInfo/getFeatureInfo.spec.js +117 -0
  1124. package/dist/utilities/telemetry/featureInfo/getFeatureInfo.spec.js.map +1 -0
  1125. package/dist/utilities/telemetry/featureInfo/types.d.ts +63 -0
  1126. package/dist/utilities/telemetry/featureInfo/types.d.ts.map +1 -0
  1127. package/dist/utilities/telemetry/featureInfo/types.js +3 -0
  1128. package/dist/utilities/telemetry/featureInfo/types.js.map +1 -0
  1129. package/dist/utilities/telemetry/getProjectContext.d.ts +16 -0
  1130. package/dist/utilities/telemetry/getProjectContext.d.ts.map +1 -0
  1131. package/dist/utilities/telemetry/getProjectContext.js +43 -0
  1132. package/dist/utilities/telemetry/getProjectContext.js.map +1 -0
  1133. package/dist/utilities/telemetry/index.d.ts +21 -5
  1134. package/dist/utilities/telemetry/index.d.ts.map +1 -1
  1135. package/dist/utilities/telemetry/index.js +26 -1
  1136. package/dist/utilities/telemetry/index.js.map +1 -1
  1137. package/dist/utilities/telemetry/index.spec.js +43 -0
  1138. package/dist/utilities/telemetry/index.spec.js.map +1 -0
  1139. package/dist/utilities/telemetry/oneWayHash.d.ts.map +1 -1
  1140. package/dist/utilities/timestamp.d.ts.map +1 -1
  1141. package/dist/utilities/toKebabCase.d.ts.map +1 -1
  1142. package/dist/utilities/transformColumnPreferences.d.ts.map +1 -1
  1143. package/dist/utilities/transformPointDataToPayload.d.ts +7 -0
  1144. package/dist/utilities/transformPointDataToPayload.d.ts.map +1 -0
  1145. package/dist/utilities/transformPointDataToPayload.js +28 -0
  1146. package/dist/utilities/transformPointDataToPayload.js.map +1 -0
  1147. package/dist/utilities/transformWhereQuery.d.ts.map +1 -1
  1148. package/dist/utilities/traverseFields.d.ts.map +1 -1
  1149. package/dist/utilities/traverseFields.js +20 -22
  1150. package/dist/utilities/traverseFields.js.map +1 -1
  1151. package/dist/utilities/traverseFields.spec.js +112 -0
  1152. package/dist/utilities/traverseFields.spec.js.map +1 -1
  1153. package/dist/utilities/traverseForLocalizedFields.d.ts.map +1 -1
  1154. package/dist/utilities/unflatten.d.ts.map +1 -1
  1155. package/dist/utilities/unflattenData.d.ts +3 -0
  1156. package/dist/utilities/unflattenData.d.ts.map +1 -0
  1157. package/dist/utilities/unflattenData.js +14 -0
  1158. package/dist/utilities/unflattenData.js.map +1 -0
  1159. package/dist/utilities/validateMimeType.d.ts.map +1 -1
  1160. package/dist/utilities/validateTimezones.d.ts.map +1 -1
  1161. package/dist/utilities/validateWhereQuery.d.ts.map +1 -1
  1162. package/dist/utilities/wordBoundariesRegex.d.ts.map +1 -1
  1163. package/dist/utilities/wrapInternalEndpoints.d.ts.map +1 -1
  1164. package/dist/utilities/zod.d.ts +5 -0
  1165. package/dist/utilities/zod.d.ts.map +1 -0
  1166. package/dist/utilities/zod.js +21 -0
  1167. package/dist/utilities/zod.js.map +1 -0
  1168. package/dist/versions/baseFields.d.ts.map +1 -1
  1169. package/dist/versions/buildCollectionFields.d.ts.map +1 -1
  1170. package/dist/versions/buildGlobalFields.d.ts.map +1 -1
  1171. package/dist/versions/buildVersionCompoundIndexes.d.ts.map +1 -1
  1172. package/dist/versions/defaults.d.ts.map +1 -1
  1173. package/dist/versions/deleteCollectionVersions.d.ts +11 -1
  1174. package/dist/versions/deleteCollectionVersions.d.ts.map +1 -1
  1175. package/dist/versions/deleteCollectionVersions.js +10 -3
  1176. package/dist/versions/deleteCollectionVersions.js.map +1 -1
  1177. package/dist/versions/deleteScheduledPublishJobs.d.ts +5 -1
  1178. package/dist/versions/deleteScheduledPublishJobs.d.ts.map +1 -1
  1179. package/dist/versions/deleteScheduledPublishJobs.js +11 -5
  1180. package/dist/versions/deleteScheduledPublishJobs.js.map +1 -1
  1181. package/dist/versions/drafts/appendVersionToQueryKey.d.ts.map +1 -1
  1182. package/dist/versions/drafts/appendVersionToQueryKey.js +1 -3
  1183. package/dist/versions/drafts/appendVersionToQueryKey.js.map +1 -1
  1184. package/dist/versions/drafts/appendVersionToQueryKey.spec.js +28 -0
  1185. package/dist/versions/drafts/appendVersionToQueryKey.spec.js.map +1 -0
  1186. package/dist/versions/drafts/getQueryDraftsSelect.d.ts.map +1 -1
  1187. package/dist/versions/drafts/getQueryDraftsSort.d.ts.map +1 -1
  1188. package/dist/versions/drafts/replaceWithDraftIfAvailable.d.ts.map +1 -1
  1189. package/dist/versions/enforceMaxVersions.d.ts.map +1 -1
  1190. package/dist/versions/getLatestCollectionVersion.d.ts.map +1 -1
  1191. package/dist/versions/getLatestGlobalVersion.d.ts.map +1 -1
  1192. package/dist/versions/migrations/localizeStatus/shared.d.ts.map +1 -1
  1193. package/dist/versions/payloadPackageList.d.ts.map +1 -1
  1194. package/dist/versions/payloadPackageList.js +0 -1
  1195. package/dist/versions/payloadPackageList.js.map +1 -1
  1196. package/dist/versions/schedule/job.d.ts.map +1 -1
  1197. package/dist/versions/schedule/job.js +4 -1
  1198. package/dist/versions/schedule/job.js.map +1 -1
  1199. package/package.json +24 -7
  1200. package/skills/payload/SKILL.md +526 -0
  1201. package/skills/payload/reference/ACCESS-CONTROL-ADVANCED.md +704 -0
  1202. package/skills/payload/reference/ACCESS-CONTROL.md +696 -0
  1203. package/skills/payload/reference/ADAPTERS.md +305 -0
  1204. package/skills/payload/reference/ADVANCED.md +386 -0
  1205. package/skills/payload/reference/COLLECTIONS.md +333 -0
  1206. package/skills/payload/reference/ENDPOINTS.md +634 -0
  1207. package/skills/payload/reference/FIELD-TYPE-GUARDS.md +553 -0
  1208. package/skills/payload/reference/FIELDS.md +745 -0
  1209. package/skills/payload/reference/HOOKS.md +186 -0
  1210. package/skills/payload/reference/PLUGIN-DEVELOPMENT.md +1436 -0
  1211. package/skills/payload/reference/QUERIES.md +274 -0
  1212. package/dist/bin/build.d.ts +0 -25
  1213. package/dist/bin/build.d.ts.map +0 -1
  1214. package/dist/bin/build.js +0 -80
  1215. package/dist/bin/build.js.map +0 -1
  1216. package/dist/bin/build.spec.js +0 -170
  1217. package/dist/bin/build.spec.js.map +0 -1
  1218. package/dist/bin/generateImportMap/generateImportMap.spec.js.map +0 -1
  1219. package/dist/bin/generateImportMap/index.d.ts.map +0 -1
  1220. package/dist/bin/generateImportMap/index.js.map +0 -1
  1221. package/dist/bin/generateImportMap/iterateCollections.d.ts.map +0 -1
  1222. package/dist/bin/generateImportMap/iterateCollections.js.map +0 -1
  1223. package/dist/bin/generateImportMap/iterateConfig.d.ts.map +0 -1
  1224. package/dist/bin/generateImportMap/iterateConfig.js.map +0 -1
  1225. package/dist/bin/generateImportMap/iterateFields.d.ts.map +0 -1
  1226. package/dist/bin/generateImportMap/iterateFields.js.map +0 -1
  1227. package/dist/bin/generateImportMap/iterateGlobals.d.ts.map +0 -1
  1228. package/dist/bin/generateImportMap/iterateGlobals.js.map +0 -1
  1229. package/dist/bin/generateImportMap/utilities/addPayloadComponentToImportMap.d.ts.map +0 -1
  1230. package/dist/bin/generateImportMap/utilities/addPayloadComponentToImportMap.js.map +0 -1
  1231. package/dist/bin/generateImportMap/utilities/getFromImportMap.d.ts.map +0 -1
  1232. package/dist/bin/generateImportMap/utilities/getFromImportMap.js.map +0 -1
  1233. package/dist/bin/generateImportMap/utilities/getImportMapToBaseDirPath.d.ts.map +0 -1
  1234. package/dist/bin/generateImportMap/utilities/getImportMapToBaseDirPath.js.map +0 -1
  1235. package/dist/bin/generateImportMap/utilities/parsePayloadComponent.d.ts.map +0 -1
  1236. package/dist/bin/generateImportMap/utilities/parsePayloadComponent.js.map +0 -1
  1237. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts.map +0 -1
  1238. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js.map +0 -1
  1239. package/dist/bin/generateTypes.d.ts +0 -6
  1240. package/dist/bin/generateTypes.d.ts.map +0 -1
  1241. package/dist/bin/generateTypes.js.map +0 -1
  1242. package/dist/bin/index.d.ts +0 -2
  1243. package/dist/bin/index.d.ts.map +0 -1
  1244. package/dist/bin/index.js +0 -200
  1245. package/dist/bin/index.js.map +0 -1
  1246. package/dist/bin/info.d.ts +0 -2
  1247. package/dist/bin/info.d.ts.map +0 -1
  1248. package/dist/bin/info.js +0 -56
  1249. package/dist/bin/info.js.map +0 -1
  1250. package/dist/bin/loadEnv.d.ts.map +0 -1
  1251. package/dist/bin/loadEnv.js.map +0 -1
  1252. package/dist/bin/migrate.d.ts +0 -15
  1253. package/dist/bin/migrate.d.ts.map +0 -1
  1254. package/dist/bin/migrate.js +0 -102
  1255. package/dist/bin/migrate.js.map +0 -1
  1256. package/dist/database/defaultUpdateJobs.d.ts +0 -3
  1257. package/dist/database/defaultUpdateJobs.d.ts.map +0 -1
  1258. package/dist/database/defaultUpdateJobs.js +0 -41
  1259. package/dist/database/defaultUpdateJobs.js.map +0 -1
  1260. package/dist/fields/baseFields/slug/countVersions.d.ts +0 -13
  1261. package/dist/fields/baseFields/slug/countVersions.d.ts.map +0 -1
  1262. package/dist/fields/baseFields/slug/countVersions.js +0 -29
  1263. package/dist/fields/baseFields/slug/countVersions.js.map +0 -1
  1264. package/dist/fields/baseFields/slug/index.d.ts +0 -89
  1265. package/dist/fields/baseFields/slug/index.d.ts.map +0 -1
  1266. package/dist/fields/baseFields/slug/index.js +0 -81
  1267. package/dist/fields/baseFields/slug/index.js.map +0 -1
  1268. package/dist/uploads/endpoints/getFileFromURL.d.ts +0 -3
  1269. package/dist/uploads/endpoints/getFileFromURL.d.ts.map +0 -1
  1270. package/dist/uploads/endpoints/getFileFromURL.js.map +0 -1
  1271. package/dist/uploads/getExternalFile.d.ts +0 -10
  1272. package/dist/uploads/getExternalFile.d.ts.map +0 -1
  1273. package/dist/uploads/getExternalFile.js +0 -73
  1274. package/dist/uploads/getExternalFile.js.map +0 -1
  1275. package/dist/uploads/tempFile.d.ts +0 -7
  1276. package/dist/uploads/tempFile.d.ts.map +0 -1
  1277. package/dist/uploads/tempFile.js +0 -39
  1278. package/dist/uploads/tempFile.js.map +0 -1
  1279. /package/dist/{bin → cli/commands}/generateImportMap/generateImportMap.spec.js +0 -0
  1280. /package/dist/{bin → cli/commands}/generateImportMap/iterateCollections.js +0 -0
  1281. /package/dist/{bin → cli/commands}/generateImportMap/iterateFields.js +0 -0
  1282. /package/dist/{bin → cli/commands}/generateImportMap/iterateGlobals.js +0 -0
  1283. /package/dist/{bin → cli/commands}/generateImportMap/utilities/addPayloadComponentToImportMap.js +0 -0
  1284. /package/dist/{bin → cli/commands}/generateImportMap/utilities/getFromImportMap.js +0 -0
  1285. /package/dist/{bin → cli/commands}/generateImportMap/utilities/getImportMapToBaseDirPath.d.ts +0 -0
  1286. /package/dist/{bin → cli/commands}/generateImportMap/utilities/getImportMapToBaseDirPath.js +0 -0
  1287. /package/dist/{bin → cli/commands}/generateImportMap/utilities/parsePayloadComponent.js +0 -0
  1288. /package/dist/{bin → cli/commands}/generateImportMap/utilities/resolveImportMapFilePath.d.ts +0 -0
  1289. /package/dist/{bin → cli/runtime}/loadEnv.d.ts +0 -0
@@ -0,0 +1,133 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { sanitizeEntitySchema } from './sanitizeEntitySchema.js';
3
+ describe('sanitizeEntitySchema', ()=>{
4
+ it('renames the Lexical node-union definition to a short name and keeps it a strict oneOf', ()=>{
5
+ // Shaped like the agent-friendly schema for a collection with a Lexical richText field
6
+ // (Payload's `input` variant): a `$defs` node union (a `oneOf` of node shapes). The input variant
7
+ // already types the relationship node's `value` as a bare ID - there is no populated-doc `$ref` to
8
+ // reduce here (the variant did that upstream), so sanitize leaves the value untouched.
9
+ const standalone = {
10
+ type: 'object',
11
+ $defs: {
12
+ LexicalNodes_ABCDEF12: {
13
+ oneOf: [
14
+ {
15
+ type: 'object',
16
+ additionalProperties: false,
17
+ properties: {
18
+ type: {
19
+ const: 'paragraph'
20
+ }
21
+ },
22
+ required: [
23
+ 'type'
24
+ ]
25
+ },
26
+ {
27
+ type: 'object',
28
+ additionalProperties: false,
29
+ properties: {
30
+ type: {
31
+ const: 'relationship'
32
+ },
33
+ value: {
34
+ type: 'string',
35
+ description: 'The related document ID.'
36
+ }
37
+ },
38
+ required: [
39
+ 'type'
40
+ ]
41
+ }
42
+ ]
43
+ }
44
+ },
45
+ properties: {
46
+ id: {
47
+ type: 'string'
48
+ },
49
+ content: {
50
+ type: 'object',
51
+ properties: {
52
+ root: {
53
+ type: 'object',
54
+ properties: {
55
+ children: {
56
+ type: 'array',
57
+ items: {
58
+ $ref: '#/$defs/LexicalNodes_ABCDEF12'
59
+ }
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }
66
+ };
67
+ expect(sanitizeEntitySchema(standalone)).toStrictEqual({
68
+ type: 'object',
69
+ $defs: {
70
+ // The node union is renamed to a short, readable `node`, and stays a strict discriminated
71
+ // `oneOf` - not loosened to `anyOf`.
72
+ node: {
73
+ oneOf: [
74
+ {
75
+ type: 'object',
76
+ additionalProperties: false,
77
+ properties: {
78
+ type: {
79
+ const: 'paragraph'
80
+ }
81
+ },
82
+ required: [
83
+ 'type'
84
+ ]
85
+ },
86
+ {
87
+ type: 'object',
88
+ additionalProperties: false,
89
+ properties: {
90
+ type: {
91
+ const: 'relationship'
92
+ },
93
+ // The value is already ID-only from the input variant - left as-is.
94
+ value: {
95
+ type: 'string',
96
+ description: 'The related document ID.'
97
+ }
98
+ },
99
+ required: [
100
+ 'type'
101
+ ]
102
+ }
103
+ ]
104
+ }
105
+ },
106
+ properties: {
107
+ // Managed timestamps are excluded upstream by the `input` variant. `id` stays because it's
108
+ // a valid optional input (a client may supply a custom ID).
109
+ id: {
110
+ type: 'string'
111
+ },
112
+ content: {
113
+ type: 'object',
114
+ properties: {
115
+ root: {
116
+ type: 'object',
117
+ properties: {
118
+ children: {
119
+ type: 'array',
120
+ items: {
121
+ $ref: '#/$defs/node'
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ }
128
+ }
129
+ });
130
+ });
131
+ });
132
+
133
+ //# sourceMappingURL=sanitizeEntitySchema.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utilities/entityInputSchema/sanitizeEntitySchema.spec.ts"],"sourcesContent":["import { describe, expect, it } from 'vitest'\n\nimport type { EntityInputSchema as JsonSchemaType } from './types.js'\n\nimport { sanitizeEntitySchema } from './sanitizeEntitySchema.js'\n\ndescribe('sanitizeEntitySchema', () => {\n it('renames the Lexical node-union definition to a short name and keeps it a strict oneOf', () => {\n // Shaped like the agent-friendly schema for a collection with a Lexical richText field\n // (Payload's `input` variant): a `$defs` node union (a `oneOf` of node shapes). The input variant\n // already types the relationship node's `value` as a bare ID - there is no populated-doc `$ref` to\n // reduce here (the variant did that upstream), so sanitize leaves the value untouched.\n const standalone: JsonSchemaType = {\n type: 'object',\n $defs: {\n LexicalNodes_ABCDEF12: {\n oneOf: [\n {\n type: 'object',\n additionalProperties: false,\n properties: { type: { const: 'paragraph' } },\n required: ['type'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { const: 'relationship' },\n value: { type: 'string', description: 'The related document ID.' },\n },\n required: ['type'],\n },\n ],\n },\n },\n properties: {\n id: { type: 'string' },\n content: {\n type: 'object',\n properties: {\n root: {\n type: 'object',\n properties: {\n children: { type: 'array', items: { $ref: '#/$defs/LexicalNodes_ABCDEF12' } },\n },\n },\n },\n },\n },\n }\n\n expect(sanitizeEntitySchema(standalone)).toStrictEqual({\n type: 'object',\n $defs: {\n // The node union is renamed to a short, readable `node`, and stays a strict discriminated\n // `oneOf` - not loosened to `anyOf`.\n node: {\n oneOf: [\n {\n type: 'object',\n additionalProperties: false,\n properties: { type: { const: 'paragraph' } },\n required: ['type'],\n },\n {\n type: 'object',\n additionalProperties: false,\n properties: {\n type: { const: 'relationship' },\n // The value is already ID-only from the input variant - left as-is.\n value: { type: 'string', description: 'The related document ID.' },\n },\n required: ['type'],\n },\n ],\n },\n },\n properties: {\n // Managed timestamps are excluded upstream by the `input` variant. `id` stays because it's\n // a valid optional input (a client may supply a custom ID).\n id: { type: 'string' },\n content: {\n type: 'object',\n properties: {\n root: {\n type: 'object',\n properties: {\n children: { type: 'array', items: { $ref: '#/$defs/node' } },\n },\n },\n },\n },\n },\n })\n })\n})\n"],"names":["describe","expect","it","sanitizeEntitySchema","standalone","type","$defs","LexicalNodes_ABCDEF12","oneOf","additionalProperties","properties","const","required","value","description","id","content","root","children","items","$ref","toStrictEqual","node"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAI7C,SAASC,oBAAoB,QAAQ,4BAA2B;AAEhEH,SAAS,wBAAwB;IAC/BE,GAAG,yFAAyF;QAC1F,uFAAuF;QACvF,kGAAkG;QAClG,mGAAmG;QACnG,uFAAuF;QACvF,MAAME,aAA6B;YACjCC,MAAM;YACNC,OAAO;gBACLC,uBAAuB;oBACrBC,OAAO;wBACL;4BACEH,MAAM;4BACNI,sBAAsB;4BACtBC,YAAY;gCAAEL,MAAM;oCAAEM,OAAO;gCAAY;4BAAE;4BAC3CC,UAAU;gC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EntityInputSchema = {
2
+ $defs?: Record<string, boolean | EntityInputSchema>;
3
+ $ref?: string;
4
+ [key: string]: unknown;
5
+ additionalProperties?: boolean | EntityInputSchema;
6
+ anyOf?: Array<boolean | EntityInputSchema>;
7
+ const?: unknown;
8
+ description?: string;
9
+ enum?: unknown[];
10
+ items?: EntityInputSchema | EntityInputSchema[];
11
+ oneOf?: Array<boolean | EntityInputSchema>;
12
+ properties?: Record<string, EntityInputSchema>;
13
+ required?: string[];
14
+ type?: string | string[];
15
+ };
16
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utilities/entityInputSchema/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,iBAAiB,CAAC,CAAA;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IACtB,oBAAoB,CAAC,EAAE,OAAO,GAAG,iBAAiB,CAAA;IAClD,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,iBAAiB,CAAC,CAAA;IAC1C,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,OAAO,EAAE,CAAA;IAChB,KAAK,CAAC,EAAE,iBAAiB,GAAG,iBAAiB,EAAE,CAAA;IAC/C,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,iBAAiB,CAAC,CAAA;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;IAC9C,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CACzB,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { };
2
+
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utilities/entityInputSchema/types.ts"],"sourcesContent":["export type EntityInputSchema = {\n $defs?: Record<string, boolean | EntityInputSchema>\n $ref?: string\n [key: string]: unknown\n additionalProperties?: boolean | EntityInputSchema\n anyOf?: Array<boolean | EntityInputSchema>\n const?: unknown\n description?: string\n enum?: unknown[]\n items?: EntityInputSchema | EntityInputSchema[]\n oneOf?: Array<boolean | EntityInputSchema>\n properties?: Record<string, EntityInputSchema>\n required?: string[]\n type?: string | string[]\n}\n"],"names":[],"mappings":"AAAA,WAcC"}
@@ -0,0 +1,13 @@
1
+ import type { CollectionSlug, GlobalSlug, PayloadRequest } from '../../index.js';
2
+ export declare const validateCollectionData: ({ slug, data, partial, req, }: {
3
+ data: Record<string, unknown>;
4
+ partial?: boolean;
5
+ req: PayloadRequest;
6
+ slug: CollectionSlug;
7
+ }) => void;
8
+ export declare const validateGlobalData: ({ slug, data, req, }: {
9
+ data: Record<string, unknown>;
10
+ req: PayloadRequest;
11
+ slug: GlobalSlug;
12
+ }) => void;
13
+ //# sourceMappingURL=validateEntityData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateEntityData.d.ts","sourceRoot":"","sources":["../../../src/utilities/entityInputSchema/validateEntityData.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAMhF,eAAO,MAAM,sBAAsB,kCAKhC;IACD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,cAAc,CAAA;CACrB,KAAG,IAIH,CAAA;AAED,eAAO,MAAM,kBAAkB,yBAI5B;IACD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,GAAG,EAAE,cAAc,CAAA;IACnB,IAAI,EAAE,UAAU,CAAA;CACjB,KAAG,IAIH,CAAA"}
@@ -0,0 +1,138 @@
1
+ import { fromJSONSchema } from 'zod';
2
+ import { ValidationError } from '../../errors/ValidationError.js';
3
+ import { getCollectionInputSchema, getGlobalInputSchema } from './getEntityInputSchema.js';
4
+ export const validateCollectionData = ({ slug, data, partial, req })=>{
5
+ const schema = getCollectionInputSchema({
6
+ collectionSlug: slug,
7
+ req
8
+ });
9
+ validateEntityData({
10
+ slug,
11
+ data,
12
+ entity: 'collection',
13
+ partial,
14
+ req,
15
+ schema
16
+ });
17
+ };
18
+ export const validateGlobalData = ({ slug, data, req })=>{
19
+ const schema = getGlobalInputSchema({
20
+ globalSlug: slug,
21
+ req
22
+ });
23
+ validateEntityData({
24
+ slug,
25
+ data,
26
+ entity: 'global',
27
+ partial: true,
28
+ req,
29
+ schema
30
+ });
31
+ };
32
+ const validateEntityData = ({ slug, data, entity, partial, req, schema })=>{
33
+ if (!schema) {
34
+ return;
35
+ }
36
+ const validationSchema = partial ? withoutRequired(schema) : schema;
37
+ const result = fromJSONSchema(validationSchema).safeParse(data);
38
+ if (result.success) {
39
+ return;
40
+ }
41
+ throw new ValidationError({
42
+ [entity]: slug,
43
+ errors: getUsefulIssues(result.error.issues).map(({ message, path })=>({
44
+ message,
45
+ path: formatDataPath(path)
46
+ })),
47
+ req
48
+ });
49
+ };
50
+ /** Updates and drafts accept partial data, including partial nested objects and array rows. */ const withoutRequired = (schema)=>{
51
+ const { $defs, additionalProperties, anyOf, items, oneOf, properties, required: _required, ...partialSchema } = schema;
52
+ return {
53
+ ...partialSchema,
54
+ ...$defs ? {
55
+ $defs: mapSchemaRecord($defs)
56
+ } : {},
57
+ ...typeof additionalProperties === 'object' ? {
58
+ additionalProperties: withoutRequired(additionalProperties)
59
+ } : additionalProperties !== undefined ? {
60
+ additionalProperties
61
+ } : {},
62
+ ...anyOf ? {
63
+ anyOf: anyOf.map(makeSchemaPartial)
64
+ } : {},
65
+ ...items ? {
66
+ items: Array.isArray(items) ? items.map((item)=>withoutRequired(item)) : withoutRequired(items)
67
+ } : {},
68
+ ...oneOf ? {
69
+ oneOf: oneOf.map(makeSchemaPartial)
70
+ } : {},
71
+ ...properties ? {
72
+ properties: mapSchemaRecord(properties)
73
+ } : {}
74
+ };
75
+ };
76
+ const makeSchemaPartial = (schema)=>typeof schema === 'boolean' ? schema : withoutRequired(schema);
77
+ const mapSchemaRecord = (schemas)=>Object.fromEntries(Object.entries(schemas).map(([name, schema])=>[
78
+ name,
79
+ makeSchemaPartial(schema)
80
+ ]));
81
+ /**
82
+ * Zod keeps every failed recursive-union branch. Select the closest matching branch instead of
83
+ * returning a very large error tree to CLI and MCP clients.
84
+ */ const getUsefulIssues = (issues, parentPath = [])=>{
85
+ const selectedIssues = issues.flatMap((issue)=>{
86
+ if (issue.code !== 'invalid_union') {
87
+ return [
88
+ {
89
+ ...issue,
90
+ path: [
91
+ ...parentPath,
92
+ ...issue.path
93
+ ]
94
+ }
95
+ ];
96
+ }
97
+ const unionPath = [
98
+ ...parentPath,
99
+ ...issue.path
100
+ ];
101
+ const closestBranch = issue.errors.filter((branch)=>branch.length > 0).sort(compareIssueBranches)[0];
102
+ return closestBranch ? getUsefulIssues(closestBranch, unionPath) : [
103
+ {
104
+ ...issue,
105
+ path: unionPath
106
+ }
107
+ ];
108
+ });
109
+ const uniqueIssues = new Map();
110
+ for (const issue of selectedIssues){
111
+ const key = `${issue.path.map(String).join('.')}:${issue.message}`;
112
+ if (!uniqueIssues.has(key)) {
113
+ uniqueIssues.set(key, issue);
114
+ }
115
+ }
116
+ return [
117
+ ...uniqueIssues.values()
118
+ ].slice(0, 10);
119
+ };
120
+ const compareIssueBranches = (left, right)=>{
121
+ const discriminatorDifference = countDiscriminatorIssues(left) - countDiscriminatorIssues(right);
122
+ if (discriminatorDifference !== 0) {
123
+ return discriminatorDifference;
124
+ }
125
+ const pathDepthDifference = getDeepestPath(right) - getDeepestPath(left);
126
+ if (pathDepthDifference !== 0) {
127
+ return pathDepthDifference;
128
+ }
129
+ return left.length - right.length;
130
+ };
131
+ const countDiscriminatorIssues = (issues)=>issues.filter((issue)=>{
132
+ const field = issue.path.at(-1);
133
+ return field === 'blockType' || field === 'relationTo' || field === 'type';
134
+ }).length;
135
+ const getDeepestPath = (issues)=>Math.max(0, ...issues.map((issue)=>issue.path.length));
136
+ const formatDataPath = (path)=>path.reduce((result, segment)=>typeof segment === 'number' ? `${result}[${segment}]` : `${result}.${String(segment)}`, 'data');
137
+
138
+ //# sourceMappingURL=validateEntityData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utilities/entityInputSchema/validateEntityData.ts"],"sourcesContent":["import type { core } from 'zod'\n\nimport { fromJSONSchema } from 'zod'\n\nimport type { CollectionSlug, GlobalSlug, PayloadRequest } from '../../index.js'\nimport type { EntityInputSchema } from './types.js'\n\nimport { ValidationError } from '../../errors/ValidationError.js'\nimport { getCollectionInputSchema, getGlobalInputSchema } from './getEntityInputSchema.js'\n\nexport const validateCollectionData = ({\n slug,\n data,\n partial,\n req,\n}: {\n data: Record<string, unknown>\n partial?: boolean\n req: PayloadRequest\n slug: CollectionSlug\n}): void => {\n const schema = getCollectionInputSchema({ collectionSlug: slug, req })\n\n validateEntityData({ slug, data, entity: 'collection', partial, req, schema })\n}\n\nexport const validateGlobalData = ({\n slug,\n data,\n req,\n}: {\n data: Record<string, unknown>\n req: PayloadRequest\n slug: GlobalSlug\n}): void => {\n const schema = getGlobalInputSchema({ globalSlug: slug, req })\n\n validateEntityData({ slug, data, entity: 'global', partial: true, req, schema })\n}\n\nconst validateEntityData = ({\n slug,\n data,\n entity,\n partial,\n req,\n schema,\n}: {\n data: Record<string, unknown>\n entity: 'collection' | 'global'\n partial?: boolean\n req: PayloadRequest\n schema: EntityInputSchema | null\n slug: string\n}): void => {\n if (!schema) {\n return\n }\n\n const validationSchema = partial ? withoutRequired(schema) : schema\n const result = fromJSONSchema(validationSchema as Parameters<typeof fromJSONSchema>[0]).safeParse(\n data,\n )\n\n if (result.success) {\n return\n }\n\n throw new ValidationError({\n [entity]: slug,\n errors: getUsefulIssues(result.error.issues).map(({ message, path }) => ({\n message,\n path: formatDataPath(path),\n })),\n req,\n })\n}\n\n/** Updates and drafts accept partial data, including partial nested objects and array rows. */\nconst withoutRequired = (schema: EntityInputSchema): EntityInputSchema => {\n const {\n $defs,\n additionalProperties,\n anyOf,\n items,\n oneOf,\n properties,\n required: _required,\n ...partialSchema\n } = schema\n\n return {\n ...partialSchema,\n ...($defs ? { $defs: mapSchemaRecord($defs) } : {}),\n ...(typeof additionalProperties === 'object'\n ? { additionalProperties: withoutRequired(additionalProperties) }\n : additionalProperties !== undefined\n ? { additionalProperties }\n : {}),\n ...(anyOf ? { anyOf: anyOf.map(makeSchemaPartial) } : {}),\n ...(items\n ? {\n items: Array.isArray(items)\n ? items.map((item) => withoutRequired(item))\n : withoutRequired(items),\n }\n : {}),\n ...(oneOf ? { oneOf: oneOf.map(makeSchemaPartial) } : {}),\n ...(properties ? { properties: mapSchemaRecord(properties) } : {}),\n }\n}\n\nconst makeSchemaPartial = (schema: boolean | EntityInputSchema): boolean | EntityInputSchema =>\n typeof schema === 'boolean' ? schema : withoutRequired(schema)\n\nconst mapSchemaRecord = <T extends boolean | EntityInputSchema>(\n schemas: Record<string, T>,\n): Record<string, T> =>\n Object.fromEntries(\n Object.entries(schemas).map(([name, schema]) => [name, makeSchemaPartial(schema)]),\n ) as Record<string, T>\n\n/**\n * Zod keeps every failed recursive-union branch. Select the closest matching branch instead of\n * returning a very large error tree to CLI and MCP clients.\n */\nconst getUsefulIssues = (\n issues: core.$ZodIssue[],\n parentPath: PropertyKey[] = [],\n): core.$ZodIssue[] => {\n const selectedIssues = issues.flatMap((issue) => {\n if (issue.code !== 'invalid_union') {\n return [{ ...issue, path: [...parentPath, ...issue.path] }]\n }\n\n const unionPath = [...parentPath, ...issue.path]\n const closestBranch = issue.errors\n .filter((branch) => branch.length > 0)\n .sort(compareIssueBranches)[0]\n\n return closestBranch\n ? getUsefulIssues(closestBranch, unionPath)\n : [{ ...issue, path: unionPath }]\n })\n const uniqueIssues = new Map<string, core.$ZodIssue>()\n\n for (const issue of selectedIssues) {\n const key = `${issue.path.map(String).join('.')}:${issue.message}`\n\n if (!uniqueIssues.has(key)) {\n uniqueIssues.set(key, issue)\n }\n }\n\n return [...uniqueIssues.values()].slice(0, 10)\n}\n\nconst compareIssueBranches = (left: core.$ZodIssue[], right: core.$ZodIssue[]): number => {\n const discriminatorDifference = countDiscriminatorIssues(left) - countDiscriminatorIssues(right)\n\n if (discriminatorDifference !== 0) {\n return discriminatorDifference\n }\n\n const pathDepthDifference = getDeepestPath(right) - getDeepestPath(left)\n\n if (pathDepthDifference !== 0) {\n return pathDepthDifference\n }\n\n return left.length - right.length\n}\n\nconst countDiscriminatorIssues = (issues: core.$ZodIssue[]): number =>\n issues.filter((issue) => {\n const field = issue.path.at(-1)\n\n return field === 'blockType' || field === 'relationTo' || field === 'type'\n }).length\n\nconst getDeepestPath = (issues: core.$ZodIssue[]): number =>\n Math.max(0, ...issues.map((issue) => issue.path.length))\n\nconst formatDataPath = (path: PropertyKey[]): string =>\n path.reduce<string>(\n (result, segment) =>\n typeof segment === 'number' ? `${result}[${segment}]` : `${result}.${String(segment)}`,\n 'data',\n )\n"],"names":["fromJSONSchema","ValidationError","getCollectionInputSchema","getGlobalInputSchema","validateCollectionData","slug","data","partial","req","schema","collectionSlug","validateEntityData","entity","validateGlobalData","globalSlug","validationSchema","withoutRequired","result","safeParse","success","errors","getUsefulIssues","error","issues","map","message","path","formatDataPath","$defs","additionalProperties","anyOf","items","oneOf","properties","required","_required","partialSchema","mapSchemaRecord","undefined","makeSchemaPartial","Array","isArray","item","schemas","Object","fromEntries","entries","name","parentPath","selectedIssues","flatMap","issue","code","unionPath","closestBranch","filter","branch","length","sort","compareIssueBranches","uniqueIssues","Map","key","String","join","has","set","values","slice","left","right","discriminatorDifference","countDiscrimin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AiB,CAACD,OACtBA,KAAKqD,MAAM,CACT,CAAC9D,QAAQ+D,UACP,OAAOA,YAAY,WAAW,GAAG/D,OAAO,CAAC,EAAE+D,QAAQ,CAAC,CAAC,GAAG,GAAG/D,OAAO,CAAC,EAAE8C,OAAOiB,UAAU,EACxF"}
@@ -1 +1 @@
1
- {"version":3,"file":"escapeRegExp.d.ts","sourceRoot":"","sources":["../../src/utilities/escapeRegExp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,KAAG,MACC,CAAA"}
1
+ {"version":3,"file":"escapeRegExp.d.ts","sourceRoot":"","sources":["../../src/utilities/escapeRegExp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,YAAY,WAAY,MAAM,KAAG,MACC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"extractID.d.ts","sourceRoot":"","sources":["../../src/utilities/extractID.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,MAAM,SAAS,MAAM,GAAG,MAAM,EACtD,YAAY;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,KAClC,MAMF,CAAA"}
1
+ {"version":3,"file":"extractID.d.ts","sourceRoot":"","sources":["../../src/utilities/extractID.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,MAAM,SAAS,MAAM,GAAG,MAAM,cAC1C;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,KAClC,MAMF,CAAA"}
@@ -0,0 +1,29 @@
1
+ import type { DefaultDocumentIDType, Locale } from '../index.js';
2
+ import type { PayloadRequest } from '../types/index.js';
3
+ type Args = {
4
+ collection: string;
5
+ /**
6
+ * When true, also matches documents whose value only exists in a draft version. A versioned
7
+ * collection keeps draft data in `_versions`, which the main-collection query — and the unique
8
+ * index — would miss.
9
+ */
10
+ draftsEnabled?: boolean;
11
+ field: string;
12
+ /** Exclude this document, so a doc doesn't conflict with itself on update. */
13
+ id?: DefaultDocumentIDType;
14
+ locale?: Locale['code'];
15
+ overrideAccess?: boolean;
16
+ req: PayloadRequest;
17
+ value: unknown;
18
+ };
19
+ /**
20
+ * Whether another document in `collection` already uses `value` for `field`.
21
+ *
22
+ * Runs the `find` operation outside the caller's transaction while preserving the rest of the
23
+ * request. A committed read is what a uniqueness check wants, and isolating the transaction avoids
24
+ * the "cursor on a session with a transaction in progress" error from a hook. `draft` includes
25
+ * slugs that only exist in a draft version.
26
+ */
27
+ export declare const fieldValueExists: ({ id, collection, draftsEnabled, field, locale, overrideAccess, req, value, }: Args) => Promise<boolean>;
28
+ export {};
29
+ //# sourceMappingURL=fieldValueExists.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fieldValueExists.d.ts","sourceRoot":"","sources":["../../src/utilities/fieldValueExists.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAIvD,KAAK,IAAI,GAAG;IACV,UAAU,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,8EAA8E;IAC9E,EAAE,CAAC,EAAE,qBAAqB,CAAA;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IACvB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,GAAG,EAAE,cAAc,CAAA;IACnB,KAAK,EAAE,OAAO,CAAA;CACf,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,kFAS1B,IAAI,KAAG,OAAO,CAAC,OAAO,CAmBxB,CAAA"}
@@ -0,0 +1,37 @@
1
+ import { isolateObjectProperty } from './isolateObjectProperty.js';
2
+ /**
3
+ * Whether another document in `collection` already uses `value` for `field`.
4
+ *
5
+ * Runs the `find` operation outside the caller's transaction while preserving the rest of the
6
+ * request. A committed read is what a uniqueness check wants, and isolating the transaction avoids
7
+ * the "cursor on a session with a transaction in progress" error from a hook. `draft` includes
8
+ * slugs that only exist in a draft version.
9
+ */ export const fieldValueExists = async ({ id, collection, draftsEnabled, field, locale, overrideAccess = false, req, value })=>{
10
+ const queryReq = isolateObjectProperty(req, [
11
+ 'query',
12
+ 'transactionID'
13
+ ]);
14
+ queryReq.query = {
15
+ ...req.query
16
+ };
17
+ delete queryReq.transactionID;
18
+ const { docs } = await req.payload.find({
19
+ collection,
20
+ depth: 0,
21
+ disableErrors: true,
22
+ draft: Boolean(draftsEnabled),
23
+ limit: 2,
24
+ locale: locale,
25
+ overrideAccess,
26
+ pagination: false,
27
+ req: queryReq,
28
+ where: {
29
+ [field]: {
30
+ equals: value
31
+ }
32
+ }
33
+ });
34
+ return docs.some((doc)=>doc.id !== id);
35
+ };
36
+
37
+ //# sourceMappingURL=fieldValueExists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utilities/fieldValueExists.ts"],"sourcesContent":["import type { DefaultDocumentIDType, Locale } from '../index.js'\nimport type { PayloadRequest } from '../types/index.js'\n\nimport { isolateObjectProperty } from './isolateObjectProperty.js'\n\ntype Args = {\n collection: string\n /**\n * When true, also matches documents whose value only exists in a draft version. A versioned\n * collection keeps draft data in `_versions`, which the main-collection query — and the unique\n * index — would miss.\n */\n draftsEnabled?: boolean\n field: string\n /** Exclude this document, so a doc doesn't conflict with itself on update. */\n id?: DefaultDocumentIDType\n locale?: Locale['code']\n overrideAccess?: boolean\n req: PayloadRequest\n value: unknown\n}\n\n/**\n * Whether another document in `collection` already uses `value` for `field`.\n *\n * Runs the `find` operation outside the caller's transaction while preserving the rest of the\n * request. A committed read is what a uniqueness check wants, and isolating the transaction avoids\n * the \"cursor on a session with a transaction in progress\" error from a hook. `draft` includes\n * slugs that only exist in a draft version.\n */\nexport const fieldValueExists = async ({\n id,\n collection,\n draftsEnabled,\n field,\n locale,\n overrideAccess = false,\n req,\n value,\n}: Args): Promise<boolean> => {\n const queryReq = isolateObjectProperty(req, ['query', 'transactionID'])\n queryReq.query = { ...req.query }\n delete queryReq.transactionID\n\n const { docs } = await req.payload.find({\n collection,\n depth: 0,\n disableErrors: true,\n draft: Boolean(draftsEnabled),\n limit: 2,\n locale: locale as Parameters<typeof req.payload.find>[0]['locale'],\n overrideAccess,\n pagination: false,\n req: queryReq,\n where: { [field]: { equals: value } },\n })\n\n return docs.some((doc) => doc.id !== id)\n}\n"],"names":["isolateObjectProperty","fieldValueExists","id","collection","draftsEnabled","field","locale","overrideAccess","req","value","queryReq","query","transactionID","docs","payload","find","depth","disableErrors","draft","Boolean","limit","pagination","where","equals","some","doc"],"mappings":"AAGA,SAASA,qBAAqB,QAAQ,6BAA4B;AAmBlE;;;;;;;CAOC,GACD,OAAO,MAAMC,mBAAmB,OAAO,EACrCC,EAAE,EACFC,UAAU,EACVC,aAAa,EACbC,KAAK,EACLC,MAAM,EACNC,iBAAiB,KAAK,EACtBC,GAAG,EACHC,KAAK,EACA;IACL,MAAMC,WAAWV,sBAAsBQ,KAAK;QAAC;QAAS;KAAgB;IACtEE,SAASC,KAAK,GAAG;QAAE,GAAGH,IAAIG,KAAK;IAAC;IAChC,OAAOD,SAASE,aAAa;IAE7B,MAAM,EAAEC,IAAI,EAAE,GAAG,MAAML,IAAIM,OAAO,CAACC,IAAI,CAAC;QACtCZ;QACAa,OAAO;QACPC,eAAe;QACfC,OAAOC,QAAQf;QACfgB,OAAO;QACPd,QAAQA;QACRC;QACAc,YAAY;QACZb,KAAKE;QACLY,OAAO;YAAE,CAACjB,MAAM,EAAE;gBAAEkB,QAAQd;YAAM;QAAE;IACtC;IAEA,OAAOI,KAAKW,IAAI,CAAC,CAACC,MAAQA,IAAIvB,EAAE,KAAKA;AACvC,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"flattenAllFields.d.ts","sourceRoot":"","sources":["../../src/utilities/flattenAllFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,KAAK,EACL,cAAc,EAEd,cAAc,EAEf,MAAM,2BAA2B,CAAA;AAIlC,eAAO,MAAM,YAAY,GAAI,WAAW;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,KAAG,cAK1D,CAAA;AAID;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,oBAG9B;IACD,wGAAwG;IACxG,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB,KAAG,cAAc,EAoFjB,CAAA"}
1
+ {"version":3,"file":"flattenAllFields.d.ts","sourceRoot":"","sources":["../../src/utilities/flattenAllFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,KAAK,EACL,cAAc,EAEd,cAAc,EAEf,MAAM,2BAA2B,CAAA;AAIlC,eAAO,MAAM,YAAY,cAAe;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,KAAG,cAK1D,CAAA;AAID;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,uBAG1B;IACD,wGAAwG;IACxG,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB,KAAG,cAAc,EAoFjB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"formatAdminURL.d.ts","sourceRoot":"","sources":["../../src/utilities/formatAdminURL.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAEhD;;;;;;;;;;;;;;;;;GAiBG;AACH,KAAK,iBAAiB,GAAG;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,IAAI,CAAC,EAAE,EAAE,GAAG,IAAI,MAAM,EAAE,GAAG,IAAI,CAAA;IAC/B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,GA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AA;CAC/C,GAAG,iBAAiB,CAAC,CAAA;AAE1B,eAAO,MAAM,cAAc,SAAU,aAAa,KAAG,MAyBpD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"formatErrors.d.ts","sourceRoot":"","sources":["../../src/utilities/formatErrors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGhD,eAAO,MAAM,YAAY,GAAI,UAAU;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GAAG,QAAQ,KAAG,WAmE9E,CAAA"}
1
+ {"version":3,"file":"formatErrors.d.ts","sourceRoot":"","sources":["../../src/utilities/formatErrors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAErD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGhD,eAAO,MAAM,YAAY,aAAc;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GAAG,QAAQ,KAAG,WAmE9E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"formatLabels.d.ts","sourceRoot":"","sources":["../../src/utilities/formatLabels.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,OAAO,GAAI,aAAa,MAAM,EAAE,mBAAiB,KAAG,MAczD,CAAA;AAED,QAAA,MAAM,YAAY,GAAI,MAAM,MAAM,KAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAYtE,CAAA;AAED,QAAA,MAAM,WAAW,GAAI,MAAM,MAAM,KAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAWrE,CAAA;AAED,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,CAAA"}
1
+ {"version":3,"file":"formatLabels.d.ts","sourceRoot":"","sources":["../../src/utilities/formatLabels.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,OAAO,gBAAiB,MAAM,0BAAsB,MAczD,CAAA;AAED,QAAA,MAAM,YAAY,SAAU,MAAM,KAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAYtE,CAAA;AAED,QAAA,MAAM,WAAW,SAAU,MAAM,KAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAWrE,CAAA;AAED,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,OAAO,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getBestFitFromSizes.d.ts","sourceRoot":"","sources":["../../src/utilities/getBestFitFromSizes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,GAAI,oEAOjC;IACD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACxD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,WA0CA,CAAA"}
1
+ {"version":3,"file":"getBestFitFromSizes.d.ts","sourceRoot":"","sources":["../../src/utilities/getBestFitFromSizes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,uEAO7B;IACD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACxD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,WA0CA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getBlockSelect.d.ts","sourceRoot":"","sources":["../../src/utilities/getBlockSelect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE/D;;;;GAIG;AACH,eAAO,MAAM,cAAc,GAAI,gCAI5B;IACD,KAAK,EAAE,KAAK,CAAA;IACZ,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAA;IAC1B,UAAU,EAAE,UAAU,CAAA;CACvB,KAAG;IAAE,WAAW,EAAE,OAAO,GAAG,UAAU,CAAC;IAAC,eAAe,EAAE,UAAU,CAAA;CAqCnE,CAAA"}
1
+ {"version":3,"file":"getBlockSelect.d.ts","sourceRoot":"","sources":["../../src/utilities/getBlockSelect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAE/D;;;;GAIG;AACH,eAAO,MAAM,cAAc,mCAIxB;IACD,KAAK,EAAE,KAAK,CAAA;IACZ,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAA;IAC1B,UAAU,EAAE,UAAU,CAAA;CACvB,KAAG;IAAE,WAAW,EAAE,OAAO,GAAG,UAAU,CAAC;IAAC,eAAe,EAAE,UAAU,CAAA;CAqCnE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getDataByPath.d.ts","sourceRoot":"","sources":["../../src/utilities/getDataByPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAIlD,eAAO,MAAM,aAAa,GAAI,CAAC,GAAG,OAAO,EAAE,QAAQ,SAAS,EAAE,MAAM,MAAM,KAAG,CAkB5E,CAAA"}
1
+ {"version":3,"file":"getDataByPath.d.ts","sourceRoot":"","sources":["../../src/utilities/getDataByPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAIlD,eAAO,MAAM,aAAa,GAAI,CAAC,GAAG,OAAO,UAAU,SAAS,QAAQ,MAAM,KAAG,CAkB5E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getEntityPermissions.d.ts","sourceRoot":"","sources":["../../../src/utilities/getEntityPermissions/getEntityPermissions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EAEpB,gBAAgB,EAEjB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAC9F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAS,MAAM,sBAAsB,CAAA;AAO5F,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAC7C,SAAS,EACT,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAC7C,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,UAAU,CAAA;AAE/C,KAAK,UAAU,CAAC,WAAW,SAAS,YAAY,GAAG,QAAQ,IAAI,WAAW,SAAS,QAAQ,GACvF,gBAAgB,GAChB,oBAAoB,CAAA;AAExB,KAAK,IAAI,CAAC,WAAW,SAAS,YAAY,GAAG,QAAQ,IAAI;IACvD,0BAA0B,EAAE,0BAA0B,CAAA;IACtD;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,MAAM,EAAE,WAAW,SAAS,YAAY,GAAG,yBAAyB,GAAG,qBAAqB,CAAA;IAC5F,UAAU,EAAE,WAAW,CAAA;IACvB;;OAEG;IACH,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,GAAG,EAAE,cAAc,CAAA;CACpB,GAAG,CACA;IACE,SAAS,EAAE,KAAK,CAAA;IAChB,EAAE,CAAC,EAAE,KAAK,CAAA;CACX,GACD;IACE,SAAS,EAAE,IAAI,CAAA;IACf,EAAE,EAAE,WAAW,SAAS,YAAY,GAAG,qBAAqB,GAAG,SAAS,CAAA;CACzE,CACJ,CAAA;AAYD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,oBAAoB,CAAC,WAAW,SAAS,YAAY,GAAG,QAAQ,EACpF,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,GACtB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CA0JlC"}
1
+ {"version":3,"file":"getEntityPermissions.d.ts","sourceRoot":"","sources":["../../../src/utilities/getEntityPermissions/getEntityPermissions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EAEpB,gBAAgB,EAEjB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAC9F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAS,MAAM,sBAAsB,CAAA;AAO5F,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAC7C,SAAS,EACT,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAC7C,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,UAAU,CAAA;AAE/C,KAAK,UAAU,CAAC,WAAW,SAAS,YAAY,GAAG,QAAQ,IAAI,WAAW,SAAS,QAAQ,GACvF,gBAAgB,GAChB,oBAAoB,CAAA;AAExB,KAAK,IAAI,CAAC,WAAW,SAAS,YAAY,GAAG,QAAQ,IAAI;IACvD,0BAA0B,EAAE,0BAA0B,CAAA;IACtD;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,CAAA;IACjB,MAAM,EAAE,WAAW,SAAS,YAAY,GAAG,yBAAyB,GAAG,qBAAqB,CAAA;IAC5F,UAAU,EAAE,WAAW,CAAA;IACvB;;OAEG;IACH,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,GAAG,EAAE,cAAc,CAAA;CACpB,GAAG,CACA;IACE,SAAS,EAAE,KAAK,CAAA;IAChB,EAAE,CAAC,EAAE,KAAK,CAAA;CACX,GACD;IACE,SAAS,EAAE,IAAI,CAAA;IACf,EAAE,EAAE,WAAW,SAAS,YAAY,GAAG,qBAAqB,GAAG,SAAS,CAAA;CACzE,CACJ,CAAA;AAYD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,oBAAoB,CAAC,WAAW,SAAS,YAAY,GAAG,QAAQ,EACpF,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,GACtB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CA4JlC"}
@@ -83,6 +83,7 @@ const topLevelGlobalPermissions = [
83
83
  operation,
84
84
  result: Promise.resolve(accessFunction({
85
85
  id,
86
+ slug: entity.slug,
86
87
  data,
87
88
  req
88
89
  }))
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utilities/getEntityPermissions/getEntityPermissions.ts"],"sourcesContent":["import { isDeepStrictEqual } from 'util'\n\nimport type {\n BlockPermissions,\n CollectionPermission,\n FieldsPermissions,\n GlobalPermission,\n Permission,\n} from '../../auth/types.js'\nimport type { SanitizedCollectionConfig, TypeWithID } from '../../collections/config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { BlockSlug, DefaultDocumentIDType } from '../../index.js'\nimport type { AllOperations, JsonObject, PayloadRequest, Where } from '../../types/index.js'\n\nimport { entityDocExists } from './entityDocExists.js'\nimport { populateFieldPermissions } from './populateFieldPermissions.js'\n\ntype WhereQueryCache = { result: Promise<boolean>; where: Where }[]\n\nexport type BlockReferencesPermissions = Record<\n BlockSlug,\n BlockPermissions | Promise<BlockPermissions>\n>\n\nexport type EntityDoc = JsonObject | TypeWithID\n\ntype ReturnType<TEntityType extends 'collection' | 'global'> = TEntityType extends 'global'\n ? GlobalPermission\n : CollectionPermission\n\ntype Args<TEntityType extends 'collection' | 'global'> = {\n blockReferencesPermissions: BlockReferencesPermissions\n /**\n * If the document data is passed, it will be used to check access instead of fetching the document from the database.\n */\n data?: JsonObject\n entity: TEntityType extends 'collection' ? SanitizedCollectionConfig : SanitizedGlobalConfig\n entityType: TEntityType\n /**\n * Operations to check access for\n */\n operations: AllOperations[]\n req: PayloadRequest\n} & (\n | {\n fetchData: false\n id?: never\n }\n | {\n fetchData: true\n id: TEntityType extends 'collection' ? DefaultDocumentIDType : undefined\n }\n)\n\nconst topLevelCollectionPermissions = [\n 'create',\n 'delete',\n 'read',\n 'readVersions',\n 'update',\n 'unlock',\n]\nconst topLevelGlobalPermissions = ['read', 'readVersions', 'update']\n\n/**\n * Build up permissions object for an entity (collection or global).\n * This is not run during any update and reflects the current state of the entity data => doc and data is the same.\n *\n * When `fetchData` is false:\n * - returned `Where` are not run and evaluated as \"does not have permission\".\n * - If req.data is passed: `data` and `doc` is passed to access functions.\n * - If req.data is not passed: `data` and `doc` is not passed to access functions.\n *\n * When `fetchData` is true:\n * - `Where` are run and evaluated as \"has permission\" or \"does not have permission\".\n * - `data` and `doc` are always passed to access functions.\n * - Error is thrown if `entityType` is 'collection' and `id` is not passed.\n *\n * In both cases:\n * We cannot include siblingData or blockData here, as we do not have siblingData available once we reach block or array\n * rows, as we're calculating schema permissions, which do not include individual rows.\n * For consistency, it's thus better to never include the siblingData and blockData\n *\n * @internal\n */\nexport async function getEntityPermissions<TEntityType extends 'collection' | 'global'>(\n args: Args<TEntityType>,\n): Promise<ReturnType<TEntityType>> {\n const {\n id,\n blockReferencesPermissions,\n data: _data,\n entity,\n entityType,\n fetchData,\n operations,\n req,\n } = args\n const { locale: _locale, user } = req\n\n const locale = _locale ? _locale : undefined\n\n if (fetchData && entityType === 'collection' && !id) {\n throw new Error('ID is required when fetching data for a collection')\n }\n\n const hasData = _data && Object.keys(_data).length > 0\n const data: JsonObject | undefined = hasData\n ? _data\n : fetchData\n ? await (async () => {\n if (entityType === 'global') {\n return req.payload.findGlobal({\n slug: entity.slug,\n depth: 0,\n fallbackLocale: null,\n locale,\n overrideAccess: true,\n req,\n })\n }\n\n if (entityType === 'collection') {\n return req.payload.findByID({\n id: id!,\n collection: entity.slug,\n depth: 0,\n fallbackLocale: null,\n locale,\n overrideAccess: true,\n req,\n trash: true,\n })\n }\n })()\n : undefined\n\n const isLoggedIn = !!user\n\n const fieldsPermissions: FieldsPermissions = {}\n\n const entityPermissions: ReturnType<TEntityType> = {\n fields: fieldsPermissions,\n } as ReturnType<TEntityType>\n\n const promises: Promise<void>[] = []\n\n // Phase 1: Resolve all access functions to get where queries\n const accessResults: {\n operation: keyof typeof entity.access\n result: Promise<boolean | Where>\n }[] = []\n\n for (const _operation of operations) {\n const operation = _operation as keyof typeof entity.access\n const accessFunction = entity.access[operation]\n\n if (\n (entityType === 'collection' && topLevelCollectionPermissions.includes(operation)) ||\n (entityType === 'global' && topLevelGlobalPermissions.includes(operation))\n ) {\n if (typeof accessFunction === 'function') {\n accessResults.push({\n operation,\n result: Promise.resolve(accessFunction({ id, data, req })) as Promise<boolean | Where>,\n })\n } else {\n entityPermissions[operation] = {\n permission: isLoggedIn,\n }\n }\n }\n }\n\n // Await all access functions in parallel\n const resolvedAccessResults = await Promise.all(\n accessResults.map(async (item) => ({\n operation: item.operation,\n result: await item.result,\n })),\n )\n\n // Phase 2: Process where queries with cache and resolve in parallel\n const whereQueryCache: WhereQueryCache = []\n const wherePromises: Promise<void>[] = []\n\n for (const { operation, result: accessResult } of resolvedAccessResults) {\n if (typeof accessResult === 'object') {\n processWhereQuery({\n id,\n slug: entity.slug,\n accessResult,\n entityPermissions,\n entityType,\n fetchData,\n locale,\n operation,\n req,\n wherePromises,\n whereQueryCache,\n })\n } else if (entityPermissions[operation]?.permission !== false) {\n entityPermissions[operation] = { permission: !!accessResult }\n }\n }\n\n // Await all where query DB calls in parallel\n await Promise.all(wherePromises)\n\n populateFieldPermissions({\n blockReferencesPermissions,\n collection: entityType === 'collection' ? (entity as SanitizedCollectionConfig) : null,\n data,\n fields: entity.fields,\n global: entityType === 'global' ? (entity as SanitizedGlobalConfig) : null,\n operations,\n parentPermissionsObject: entityPermissions,\n permissionsObject: fieldsPermissions,\n promises,\n req,\n })\n\n /**\n * Await all promises in parallel.\n * A promise can add more promises to the promises array (group of fields calls populateFieldPermissions again in their own promise), which will not be\n * awaited in the first run.\n * This is why we need to loop again to process the new promises, until there are no more promises left.\n */\n let iterations = 0\n while (promises.length > 0) {\n const currentPromises = promises.splice(0, promises.length)\n\n await Promise.all(currentPromises)\n\n iterations++\n if (iterations >= 100) {\n throw new Error('Infinite getEntityPermissions promise loop detected.')\n }\n }\n\n return entityPermissions\n}\n\nconst processWhereQuery = ({\n id,\n slug,\n accessResult,\n entityPermissions,\n entityType,\n fetchData,\n locale,\n operation,\n req,\n wherePromises,\n whereQueryCache,\n}: {\n accessResult: Where\n entityPermissions: CollectionPermission | GlobalPermission\n entityType: 'collection' | 'global'\n fetchData: boolean\n id?: DefaultDocumentIDType\n locale?: string\n operation: Extract<keyof (CollectionPermission | GlobalPermission), AllOperations>\n req: PayloadRequest\n slug: string\n wherePromises: Promise<void>[]\n whereQueryCache: WhereQueryCache\n}): void => {\n if (fetchData) {\n // Check cache for identical where query using deep comparison\n let cached = whereQueryCache.find((entry) => isDeepStrictEqual(entry.where, accessResult))\n\n if (!cached) {\n // Cache miss - start DB query (don't await)\n cached = {\n result: entityDocExists({\n id,\n slug,\n entityType,\n locale,\n operation,\n req,\n where: accessResult,\n }),\n where: accessResult,\n }\n whereQueryCache.push(cached)\n }\n\n // Defer resolution to Promise.all (cache hits reuse same promise)\n wherePromises.push(\n cached.result.then((hasPermission) => {\n entityPermissions[operation] = {\n permission: hasPermission,\n where: accessResult,\n } as Permission\n }),\n )\n } else {\n // TODO: 4.0: Investigate defaulting to `false` here, if where query is returned but ignored as we don't\n // have the document data available. This seems more secure.\n // Alternatively, we could set permission to a third state, like 'unknown'.\n // Even after calling sanitizePermissions, the permissions will still be true if the where query is returned but ignored as we don't have the document data available.\n entityPermissions[operation] = { permission: true, where: accessResult } as Permission\n }\n}\n"],"names":["isDeepStrictEqual","entityDocExists","populateFieldPermissions","topLevelCollectionPermissions","topLevelGlobalPermissions","getEntityPermissions","args","id","blockReferencesPermissions","data","_data","entity","entityType","fetchData","operations","req","locale","_locale","user","undefined","Error","hasData","Object","keys","length","payload","findGlobal","slug","depth","fallbackLocale","overrideAccess","findByID","collection","trash","isLoggedIn","fieldsPermissions","entityPermissions","fields","promises","accessResults","_operation","operation","accessFunction","access","includes","push","result","Promise","resolve","permission","resolvedAccessResults","all","map","item","whereQueryCache","wherePromises","accessResult","processWhereQuery","global","parentPermissionsObject","permissionsObject","iterations","currentPromises","splice","cached","find","entry","where","then","hasPermission"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,OAAM;AAcxC,SAASC,eAAe,QAAQ,uBAAsB;AACtD,SAASC,wBAAwB,QAAQ,gCAA+B;AAuCxE,MAAMC,gCAAgC;IACpC;IACA;IACA;IACA;IACA;IACA;CACD;AACD,MAAMC,4BAA4B;IAAC;IAAQ;IAAgB;CAAS;AAEpE;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,eAAeC,qBACpBC,IAAuB;IAEvB,MAAM,EACJC,E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1D,MAAMuB,QAAQI,GAAG,CAACW;QAElBD;QACA,IAAIA,cAAc,KAAK;YACrB,MAAM,IAAIzC,MAAM;QAClB;IACF;IAEA,OAAOgB;AACT;AAEA,MAAMqB,oBAAoB,CAAC,EACzBlD,EAAE,EACFoB,IAAI,EACJ6B,YAAY,EACZpB,iBAAiB,EACjBxB,UAAU,EACVC,SAAS,EACTG,MAAM,EACNyB,SAAS,EACT1B,GAAG,EACHwC,aAAa,EACbD,eAAe,EAahB;IACC,IAAIzC,WAAW;QACb,8DAA8D;QAC9D,IAAImD,SAASV,gBAAgBW,IAAI,CAAC,CAACC,QAAUlE,kBAAkBkE,MAAMC,KAAK,EAAEX;QAE5E,IAAI,CAACQ,QAAQ;YACX,4CAA4C;YAC5CA,SAAS;gBACPlB,QAAQ7C,gBAAgB;oBACtBM;oBACAoB;oBACAf;oBACAI;oBACAyB;oBACA1B;oBACAoD,OAAOX;gBACT;gBACAW,OAAOX;YACT;YACAF,gBAAgBT,IAAI,CAACmB;QACvB;QAEA,kEAAkE;QAClET,cAAcV,IAAI,CAChBmB,OAAOlB,MAAM,CAACsB,IAAI,CAAC,CAACC;YAClBjC,iBAAiB,CAACK,UAAU,GAAG;gBAC7BQ,YAAYoB;gBACZF,OAAOX;YACT;QACF;IAEJ,OAAO;QACL,wGAAwG;QACxG,4DAA4D;QAC5D,2EAA2E;QAC3E,sKAAsK;QACtKpB,iBAAiB,CAACK,UAAU,GAAG;YAAEQ,YAAY;YAAMkB,OAAOX;QAAa;IACzE;AACF"}
1
+ {"version":3,"sources":["../../../src/utilities/getEntityPermissions/getEntityPermissions.ts"],"sourcesContent":["import { isDeepStrictEqual } from 'util'\n\nimport type {\n BlockPermissions,\n CollectionPermission,\n FieldsPermissions,\n GlobalPermission,\n Permission,\n} from '../../auth/types.js'\nimport type { SanitizedCollectionConfig, TypeWithID } from '../../collections/config/types.js'\nimport type { SanitizedGlobalConfig } from '../../globals/config/types.js'\nimport type { BlockSlug, DefaultDocumentIDType } from '../../index.js'\nimport type { AllOperations, JsonObject, PayloadRequest, Where } from '../../types/index.js'\n\nimport { entityDocExists } from './entityDocExists.js'\nimport { populateFieldPermissions } from './populateFieldPermissions.js'\n\ntype WhereQueryCache = { result: Promise<boolean>; where: Where }[]\n\nexport type BlockReferencesPermissions = Record<\n BlockSlug,\n BlockPermissions | Promise<BlockPermissions>\n>\n\nexport type EntityDoc = JsonObject | TypeWithID\n\ntype ReturnType<TEntityType extends 'collection' | 'global'> = TEntityType extends 'global'\n ? GlobalPermission\n : CollectionPermission\n\ntype Args<TEntityType extends 'collection' | 'global'> = {\n blockReferencesPermissions: BlockReferencesPermissions\n /**\n * If the document data is passed, it will be used to check access instead of fetching the document from the database.\n */\n data?: JsonObject\n entity: TEntityType extends 'collection' ? SanitizedCollectionConfig : SanitizedGlobalConfig\n entityType: TEntityType\n /**\n * Operations to check access for\n */\n operations: AllOperations[]\n req: PayloadRequest\n} & (\n | {\n fetchData: false\n id?: never\n }\n | {\n fetchData: true\n id: TEntityType extends 'collection' ? DefaultDocumentIDType : undefined\n }\n)\n\nconst topLevelCollectionPermissions = [\n 'create',\n 'delete',\n 'read',\n 'readVersions',\n 'update',\n 'unlock',\n]\nconst topLevelGlobalPermissions = ['read', 'readVersions', 'update']\n\n/**\n * Build up permissions object for an entity (collection or global).\n * This is not run during any update and reflects the current state of the entity data => doc and data is the same.\n *\n * When `fetchData` is false:\n * - returned `Where` are not run and evaluated as \"does not have permission\".\n * - If req.data is passed: `data` and `doc` is passed to access functions.\n * - If req.data is not passed: `data` and `doc` is not passed to access functions.\n *\n * When `fetchData` is true:\n * - `Where` are run and evaluated as \"has permission\" or \"does not have permission\".\n * - `data` and `doc` are always passed to access functions.\n * - Error is thrown if `entityType` is 'collection' and `id` is not passed.\n *\n * In both cases:\n * We cannot include siblingData or blockData here, as we do not have siblingData available once we reach block or array\n * rows, as we're calculating schema permissions, which do not include individual rows.\n * For consistency, it's thus better to never include the siblingData and blockData\n *\n * @internal\n */\nexport async function getEntityPermissions<TEntityType extends 'collection' | 'global'>(\n args: Args<TEntityType>,\n): Promise<ReturnType<TEntityType>> {\n const {\n id,\n blockReferencesPermissions,\n data: _data,\n entity,\n entityType,\n fetchData,\n operations,\n req,\n } = args\n const { locale: _locale, user } = req\n\n const locale = _locale ? _locale : undefined\n\n if (fetchData && entityType === 'collection' && !id) {\n throw new Error('ID is required when fetching data for a collection')\n }\n\n const hasData = _data && Object.keys(_data).length > 0\n const data: JsonObject | undefined = hasData\n ? _data\n : fetchData\n ? await (async () => {\n if (entityType === 'global') {\n return req.payload.findGlobal({\n slug: entity.slug,\n depth: 0,\n fallbackLocale: null,\n locale,\n overrideAccess: true,\n req,\n })\n }\n\n if (entityType === 'collection') {\n return req.payload.findByID({\n id: id!,\n collection: entity.slug,\n depth: 0,\n fallbackLocale: null,\n locale,\n overrideAccess: true,\n req,\n trash: true,\n })\n }\n })()\n : undefined\n\n const isLoggedIn = !!user\n\n const fieldsPermissions: FieldsPermissions = {}\n\n const entityPermissions: ReturnType<TEntityType> = {\n fields: fieldsPermissions,\n } as ReturnType<TEntityType>\n\n const promises: Promise<void>[] = []\n\n // Phase 1: Resolve all access functions to get where queries\n const accessResults: {\n operation: keyof typeof entity.access\n result: Promise<boolean | Where>\n }[] = []\n\n for (const _operation of operations) {\n const operation = _operation as keyof typeof entity.access\n const accessFunction = entity.access[operation]\n\n if (\n (entityType === 'collection' && topLevelCollectionPermissions.includes(operation)) ||\n (entityType === 'global' && topLevelGlobalPermissions.includes(operation))\n ) {\n if (typeof accessFunction === 'function') {\n accessResults.push({\n operation,\n result: Promise.resolve(accessFunction({ id, slug: entity.slug, data, req })) as Promise<\n boolean | Where\n >,\n })\n } else {\n entityPermissions[operation] = {\n permission: isLoggedIn,\n }\n }\n }\n }\n\n // Await all access functions in parallel\n const resolvedAccessResults = await Promise.all(\n accessResults.map(async (item) => ({\n operation: item.operation,\n result: await item.result,\n })),\n )\n\n // Phase 2: Process where queries with cache and resolve in parallel\n const whereQueryCache: WhereQueryCache = []\n const wherePromises: Promise<void>[] = []\n\n for (const { operation, result: accessResult } of resolvedAccessResults) {\n if (typeof accessResult === 'object') {\n processWhereQuery({\n id,\n slug: entity.slug,\n accessResult,\n entityPermissions,\n entityType,\n fetchData,\n locale,\n operation,\n req,\n wherePromises,\n whereQueryCache,\n })\n } else if (entityPermissions[operation]?.permission !== false) {\n entityPermissions[operation] = { permission: !!accessResult }\n }\n }\n\n // Await all where query DB calls in parallel\n await Promise.all(wherePromises)\n\n populateFieldPermissions({\n blockReferencesPermissions,\n collection: entityType === 'collection' ? (entity as SanitizedCollectionConfig) : null,\n data,\n fields: entity.fields,\n global: entityType === 'global' ? (entity as SanitizedGlobalConfig) : null,\n operations,\n parentPermissionsObject: entityPermissions,\n permissionsObject: fieldsPermissions,\n promises,\n req,\n })\n\n /**\n * Await all promises in parallel.\n * A promise can add more promises to the promises array (group of fields calls populateFieldPermissions again in their own promise), which will not be\n * awaited in the first run.\n * This is why we need to loop again to process the new promises, until there are no more promises left.\n */\n let iterations = 0\n while (promises.length > 0) {\n const currentPromises = promises.splice(0, promises.length)\n\n await Promise.all(currentPromises)\n\n iterations++\n if (iterations >= 100) {\n throw new Error('Infinite getEntityPermissions promise loop detected.')\n }\n }\n\n return entityPermissions\n}\n\nconst processWhereQuery = ({\n id,\n slug,\n accessResult,\n entityPermissions,\n entityType,\n fetchData,\n locale,\n operation,\n req,\n wherePromises,\n whereQueryCache,\n}: {\n accessResult: Where\n entityPermissions: CollectionPermission | GlobalPermission\n entityType: 'collection' | 'global'\n fetchData: boolean\n id?: DefaultDocumentIDType\n locale?: string\n operation: Extract<keyof (CollectionPermission | GlobalPermission), AllOperations>\n req: PayloadRequest\n slug: string\n wherePromises: Promise<void>[]\n whereQueryCache: WhereQueryCache\n}): void => {\n if (fetchData) {\n // Check cache for identical where query using deep comparison\n let cached = whereQueryCache.find((entry) => isDeepStrictEqual(entry.where, accessResult))\n\n if (!cached) {\n // Cache miss - start DB query (don't await)\n cached = {\n result: entityDocExists({\n id,\n slug,\n entityType,\n locale,\n operation,\n req,\n where: accessResult,\n }),\n where: accessResult,\n }\n whereQueryCache.push(cached)\n }\n\n // Defer resolution to Promise.all (cache hits reuse same promise)\n wherePromises.push(\n cached.result.then((hasPermission) => {\n entityPermissions[operation] = {\n permission: hasPermission,\n where: accessResult,\n } as Permission\n }),\n )\n } else {\n // TODO: 4.0: Investigate defaulting to `false` here, if where query is returned but ignored as we don't\n // have the document data available. This seems more secure.\n // Alternatively, we could set permission to a third state, like 'unknown'.\n // Even after calling sanitizePermissions, the permissions will still be true if the where query is returned but ignored as we don't have the document data available.\n entityPermissions[operation] = { permission: true, where: accessResult } as Permission\n }\n}\n"],"names":["isDeepStrictEqual","entityDocExists","populateFieldPermissions","topLevelCollectionPermissions","topLevelGlobalPermissions","getEntityPermissions","args","id","blockReferencesPermissions","data","_data","entity","entityType","fetchData","operations","req","locale","_locale","user","undefined","Error","hasData","Object","keys","length","payload","findGlobal","slug","depth","fallbackLocale","overrideAccess","findByID","collection","trash","isLoggedIn","fieldsPermissions","entityPermissions","fields","promises","accessResults","_operation","operation","accessFunction","access","includes","push","result","Promise","resolve","permission","resolvedAccessResults","all","map","item","whereQueryCache","wherePromises","accessResult","processWhereQuery","global","parentPermissionsObject","permissionsObject","iterations","currentPromises","splice","cached","find","entry","where","then","hasPermission"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,OAAM;AAcxC,SAASC,eAAe,QAAQ,uBAAsB;AACtD,SAASC,wBAAwB,QAAQ,gCAA+B;AAuCxE,MAAMC,gCAAgC;IACpC;IACA;IACA;IACA;IACA;IACA;CACD;AACD,MAAMC,4BAA4B;IAAC;IAAQ;IAAgB;CAAS;AAEpE;;;;;;;;;;;;;;;;;;;;CAoBC,GACD,OAAO,eAAeC,qBACpBC,IAAuB;IAEvB,MAAM,EACJC,EAAE,EACFC,0BAA0B,EAC1BC,MAAMC,KAAK,EACXC,MAAM,EACNC,UAAU,EACVC,SAAS,EACTC,U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cAAc,KAAK;YACrB,MAAM,IAAIzC,MAAM;QAClB;IACF;IAEA,OAAOgB;AACT;AAEA,MAAMqB,oBAAoB,CAAC,EACzBlD,EAAE,EACFoB,IAAI,EACJ6B,YAAY,EACZpB,iBAAiB,EACjBxB,UAAU,EACVC,SAAS,EACTG,MAAM,EACNyB,SAAS,EACT1B,GAAG,EACHwC,aAAa,EACbD,eAAe,EAahB;IACC,IAAIzC,WAAW;QACb,8DAA8D;QAC9D,IAAImD,SAASV,gBAAgBW,IAAI,CAAC,CAACC,QAAUlE,kBAAkBkE,MAAMC,KAAK,EAAEX;QAE5E,IAAI,CAACQ,QAAQ;YACX,4CAA4C;YAC5CA,SAAS;gBACPlB,QAAQ7C,gBAAgB;oBACtBM;oBACAoB;oBACAf;oBACAI;oBACAyB;oBACA1B;oBACAoD,OAAOX;gBACT;gBACAW,OAAOX;YACT;YACAF,gBAAgBT,IAAI,CAACmB;QACvB;QAEA,kEAAkE;QAClET,cAAcV,IAAI,CAChBmB,OAAOlB,MAAM,CAACsB,IAAI,CAAC,CAACC;YAClBjC,iBAAiB,CAACK,UAAU,GAAG;gBAC7BQ,YAAYoB;gBACZF,OAAOX;YACT;QACF;IAEJ,OAAO;QACL,wGAAwG;QACxG,4DAA4D;QAC5D,2EAA2E;QAC3E,sKAAsK;QACtKpB,iBAAiB,CAACK,UAAU,GAAG;YAAEQ,YAAY;YAAMkB,OAAOX;QAAa;IACzE;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"populateFieldPermissions.d.ts","sourceRoot":"","sources":["../../../src/utilities/getEntityPermissions/populateFieldPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAEjB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAA;AAE3E,OAAO,EAAE,KAAK,KAAK,EAAc,MAAM,8BAA8B,CAAA;AAkCrE;;;GAGG;AACH,eAAO,MAAM,wBAAwB,GAAI,8IAYtC;IACD,0BAA0B,EAAE,0BAA0B,CAAA;IACtD,sGAAsG;IACtG,UAAU,EAAE,IAAI,GAAG,yBAAyB,CAAA;IAC5C,IAAI,EAAE,UAAU,GAAG,SAAS,CAAA;IAC5B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,sGAAsG;IACtG,MAAM,EAAE,IAAI,GAAG,qBAAqB,CAAA;IACpC,EAAE,CAAC,EAAE,qBAAqB,CAAA;IAC1B;;OAEG;IACH,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,uBAAuB,EAAE,oBAAoB,GAAG,gBAAgB,GAAG,gBAAgB,CAAA;IACnF,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;IACzB,GAAG,EAAE,cAAc,CAAA;CACpB,KAAG,IA2QH,CAAA"}
1
+ {"version":3,"file":"populateFieldPermissions.d.ts","sourceRoot":"","sources":["../../../src/utilities/getEntityPermissions/populateFieldPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAEjB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AAC1E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;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AAA;CACb,KAAG;IACF,KAAK,EAAE,cAAc,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,GAAG,IA8EH,CAAA"}
1
+ {"version":3,"file":"getFieldByPath.d.ts","sourceRoot":"","sources":["../../src/utilities/getFieldByPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACzD,OAAO,KAAK,EAAkB,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAE/E;;;;GAIG;AACH,eAAO,MAAM,cAAc,mEAMxB;IACD,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;CACb,KAAG;IACF,KAAK,EAAE,cAAc,CAAA;IACrB,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,GAAG,IA8EH,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"getFieldPermissions.d.ts","sourceRoot":"","sources":["../../src/utilities/getFieldPermissions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,uEAMjC;IACD,QAAQ,CAAC,qBAAqB,CAAC,EAAE,4BAA4B,CAAA;IAC7D,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,CAAA;IACnC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,EAAE,yBAAyB,GAAG,0BAA0B,CAAA;CAC7E,KAAG;IACF,SAAS,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,WAAW,EAAE,yBAAyB,GAAG,0BAA0B,CAAA;IACnE,IAAI,EAAE,OAAO,CAAA;CA6Dd,CAAA"}
1
+ {"version":3,"file":"getFieldPermissions.d.ts","sourceRoot":"","sources":["../../src/utilities/getFieldPermissions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,kBAAkB,CAAA;AACzB,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAElD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0EAM7B;IACD,QAAQ,CAAC,qBAAqB,CAAC,EAAE,4BAA4B,CAAA;IAC7D,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,KAAK,CAAA;IACnC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,EAAE,yBAAyB,GAAG,0BAA0B,CAAA;CAC7E,KAAG;IACF,SAAS,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,WAAW,EAAE,yBAAyB,GAAG,0BAA0B,CAAA;IACnE,IAAI,EAAE,OAAO,CAAA;CA6Dd,CAAA"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Reads the version of the Next.js installed alongside the running app.
3
+ * Returns undefined if Next.js cannot be resolved, e.g. because Payload runs
4
+ * outside of Next.js or from a directory the app's dependencies are not visible from.
5
+ */
6
+ export declare const getNextVersion: () => string | undefined;
7
+ //# sourceMappingURL=getNextVersion.d.ts.map