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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (703) hide show
  1. package/dist/admin/adapters/router.d.ts +1 -1
  2. package/dist/admin/adapters/router.d.ts.map +1 -1
  3. package/dist/admin/adapters/router.js.map +1 -1
  4. package/dist/admin/forms/Diff.d.ts +0 -4
  5. package/dist/admin/forms/Diff.d.ts.map +1 -1
  6. package/dist/admin/forms/Diff.js.map +1 -1
  7. package/dist/admin/forms/Form.d.ts +0 -2
  8. package/dist/admin/forms/Form.d.ts.map +1 -1
  9. package/dist/admin/forms/Form.js.map +1 -1
  10. package/dist/admin/initAdminContext.d.ts.map +1 -1
  11. package/dist/admin/initAdminContext.js +0 -10
  12. package/dist/admin/initAdminContext.js.map +1 -1
  13. package/dist/auth/createAuthToken.d.ts +26 -0
  14. package/dist/auth/createAuthToken.d.ts.map +1 -0
  15. package/dist/auth/createAuthToken.js +39 -0
  16. package/dist/auth/createAuthToken.js.map +1 -0
  17. package/dist/auth/endpoints/refresh.d.ts.map +1 -1
  18. package/dist/auth/endpoints/refresh.js +2 -1
  19. package/dist/auth/endpoints/refresh.js.map +1 -1
  20. package/dist/auth/getFieldsToSign.js.map +1 -1
  21. package/dist/auth/loginWithCookie.d.ts.map +1 -1
  22. package/dist/auth/loginWithCookie.js +1 -0
  23. package/dist/auth/loginWithCookie.js.map +1 -1
  24. package/dist/auth/operations/local/login.d.ts.map +1 -1
  25. package/dist/auth/operations/local/login.js +1 -0
  26. package/dist/auth/operations/local/login.js.map +1 -1
  27. package/dist/auth/operations/login.d.ts +2 -0
  28. package/dist/auth/operations/login.d.ts.map +1 -1
  29. package/dist/auth/operations/login.js +6 -19
  30. package/dist/auth/operations/login.js.map +1 -1
  31. package/dist/auth/operations/refresh.d.ts +8 -0
  32. package/dist/auth/operations/refresh.d.ts.map +1 -1
  33. package/dist/auth/operations/refresh.js +50 -19
  34. package/dist/auth/operations/refresh.js.map +1 -1
  35. package/dist/auth/operations/resetPassword.d.ts.map +1 -1
  36. package/dist/auth/operations/resetPassword.js +54 -20
  37. package/dist/auth/operations/resetPassword.js.map +1 -1
  38. package/dist/auth/refreshAuthToken.d.ts +32 -0
  39. package/dist/auth/refreshAuthToken.d.ts.map +1 -0
  40. package/dist/auth/refreshAuthToken.js +113 -0
  41. package/dist/auth/refreshAuthToken.js.map +1 -0
  42. package/dist/auth/serverFunctions/cookies.js.map +1 -1
  43. package/dist/auth/serverFunctions/login.js.map +1 -1
  44. package/dist/auth/sessions.d.ts +9 -2
  45. package/dist/auth/sessions.d.ts.map +1 -1
  46. package/dist/auth/sessions.js +6 -5
  47. package/dist/auth/sessions.js.map +1 -1
  48. package/dist/auth/types.d.ts +25 -1
  49. package/dist/auth/types.d.ts.map +1 -1
  50. package/dist/auth/types.js.map +1 -1
  51. package/dist/cli/commands/data/utilities.d.ts +1 -1
  52. package/dist/cli/commands/data/utilities.d.ts.map +1 -1
  53. package/dist/cli/commands/data/utilities.js.map +1 -1
  54. package/dist/cli/defineCLICommand.js +1 -1
  55. package/dist/cli/defineCLICommand.js.map +1 -1
  56. package/dist/collections/config/client.d.ts +1 -1
  57. package/dist/collections/config/client.d.ts.map +1 -1
  58. package/dist/collections/config/client.js +0 -1
  59. package/dist/collections/config/client.js.map +1 -1
  60. package/dist/collections/config/defaults.d.ts +2 -0
  61. package/dist/collections/config/defaults.d.ts.map +1 -1
  62. package/dist/collections/config/defaults.js +4 -0
  63. package/dist/collections/config/defaults.js.map +1 -1
  64. package/dist/collections/config/sanitize.d.ts.map +1 -1
  65. package/dist/collections/config/sanitize.js +3 -0
  66. package/dist/collections/config/sanitize.js.map +1 -1
  67. package/dist/collections/config/sanitizeCompoundIndexes.d.ts.map +1 -1
  68. package/dist/collections/config/sanitizeCompoundIndexes.js +0 -9
  69. package/dist/collections/config/sanitizeCompoundIndexes.js.map +1 -1
  70. package/dist/collections/config/types.d.ts +4 -21
  71. package/dist/collections/config/types.d.ts.map +1 -1
  72. package/dist/collections/config/types.js.map +1 -1
  73. package/dist/collections/dataloader.d.ts +1 -10
  74. package/dist/collections/dataloader.d.ts.map +1 -1
  75. package/dist/collections/dataloader.js +6 -14
  76. package/dist/collections/dataloader.js.map +1 -1
  77. package/dist/collections/operations/create.d.ts.map +1 -1
  78. package/dist/collections/operations/create.js +0 -13
  79. package/dist/collections/operations/create.js.map +1 -1
  80. package/dist/collections/operations/delete.d.ts.map +1 -1
  81. package/dist/collections/operations/delete.js +121 -638
  82. package/dist/collections/operations/delete.js.map +1 -1
  83. package/dist/collections/operations/deleteByID.d.ts.map +1 -1
  84. package/dist/collections/operations/deleteByID.js +32 -238
  85. package/dist/collections/operations/deleteByID.js.map +1 -1
  86. package/dist/collections/operations/findByID.d.ts.map +1 -1
  87. package/dist/collections/operations/findByID.js +0 -6
  88. package/dist/collections/operations/findByID.js.map +1 -1
  89. package/dist/collections/operations/findDistinct.d.ts.map +1 -1
  90. package/dist/collections/operations/findDistinct.js +6 -7
  91. package/dist/collections/operations/findDistinct.js.map +1 -1
  92. package/dist/collections/operations/findVersionByID.d.ts.map +1 -1
  93. package/dist/collections/operations/findVersionByID.js +7 -0
  94. package/dist/collections/operations/findVersionByID.js.map +1 -1
  95. package/dist/collections/operations/findVersions.d.ts.map +1 -1
  96. package/dist/collections/operations/findVersions.js +5 -0
  97. package/dist/collections/operations/findVersions.js.map +1 -1
  98. package/dist/collections/operations/local/count.d.ts +4 -9
  99. package/dist/collections/operations/local/count.d.ts.map +1 -1
  100. package/dist/collections/operations/local/count.js.map +1 -1
  101. package/dist/collections/operations/local/countVersions.d.ts +0 -4
  102. package/dist/collections/operations/local/countVersions.d.ts.map +1 -1
  103. package/dist/collections/operations/local/countVersions.js.map +1 -1
  104. package/dist/collections/operations/local/create.d.ts +4 -9
  105. package/dist/collections/operations/local/create.d.ts.map +1 -1
  106. package/dist/collections/operations/local/create.js.map +1 -1
  107. package/dist/collections/operations/local/delete.d.ts +4 -9
  108. package/dist/collections/operations/local/delete.d.ts.map +1 -1
  109. package/dist/collections/operations/local/delete.js.map +1 -1
  110. package/dist/collections/operations/local/duplicate.d.ts +0 -5
  111. package/dist/collections/operations/local/duplicate.d.ts.map +1 -1
  112. package/dist/collections/operations/local/duplicate.js.map +1 -1
  113. package/dist/collections/operations/local/find.d.ts +4 -9
  114. package/dist/collections/operations/local/find.d.ts.map +1 -1
  115. package/dist/collections/operations/local/find.js.map +1 -1
  116. package/dist/collections/operations/local/findByID.d.ts +4 -9
  117. package/dist/collections/operations/local/findByID.d.ts.map +1 -1
  118. package/dist/collections/operations/local/findByID.js.map +1 -1
  119. package/dist/collections/operations/local/findDistinct.d.ts +0 -5
  120. package/dist/collections/operations/local/findDistinct.d.ts.map +1 -1
  121. package/dist/collections/operations/local/findDistinct.js.map +1 -1
  122. package/dist/collections/operations/local/findVersionByID.d.ts +0 -5
  123. package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
  124. package/dist/collections/operations/local/findVersionByID.js.map +1 -1
  125. package/dist/collections/operations/local/findVersions.d.ts +0 -5
  126. package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
  127. package/dist/collections/operations/local/findVersions.js.map +1 -1
  128. package/dist/collections/operations/local/restoreVersion.d.ts +0 -5
  129. package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
  130. package/dist/collections/operations/local/restoreVersion.js.map +1 -1
  131. package/dist/collections/operations/local/update.d.ts +4 -9
  132. package/dist/collections/operations/local/update.d.ts.map +1 -1
  133. package/dist/collections/operations/local/update.js.map +1 -1
  134. package/dist/collections/operations/renameFile.js +1 -1
  135. package/dist/collections/operations/renameFile.js.map +1 -1
  136. package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
  137. package/dist/collections/operations/restoreVersion.js +76 -157
  138. package/dist/collections/operations/restoreVersion.js.map +1 -1
  139. package/dist/collections/operations/update.d.ts.map +1 -1
  140. package/dist/collections/operations/update.js +171 -357
  141. package/dist/collections/operations/update.js.map +1 -1
  142. package/dist/collections/operations/updateByID.d.ts +0 -15
  143. package/dist/collections/operations/updateByID.d.ts.map +1 -1
  144. package/dist/collections/operations/updateByID.js +60 -265
  145. package/dist/collections/operations/updateByID.js.map +1 -1
  146. package/dist/collections/operations/utilities/buildBeforeOperation.d.ts.map +1 -1
  147. package/dist/collections/operations/utilities/buildBeforeOperation.js +0 -7
  148. package/dist/collections/operations/utilities/buildBeforeOperation.js.map +1 -1
  149. package/dist/collections/operations/utilities/update.d.ts +1 -14
  150. package/dist/collections/operations/utilities/update.d.ts.map +1 -1
  151. package/dist/collections/operations/utilities/update.js +20 -92
  152. package/dist/collections/operations/utilities/update.js.map +1 -1
  153. package/dist/collections/operations/validate.js +4 -4
  154. package/dist/collections/operations/validate.js.map +1 -1
  155. package/dist/config/client.d.ts +1 -3
  156. package/dist/config/client.d.ts.map +1 -1
  157. package/dist/config/client.js +1 -9
  158. package/dist/config/client.js.map +1 -1
  159. package/dist/config/defaults.d.ts.map +1 -1
  160. package/dist/config/defaults.js +1 -0
  161. package/dist/config/defaults.js.map +1 -1
  162. package/dist/config/definePlugin.js.map +1 -1
  163. package/dist/config/sanitize.d.ts.map +1 -1
  164. package/dist/config/sanitize.js +2 -40
  165. package/dist/config/sanitize.js.map +1 -1
  166. package/dist/config/types.d.ts +13 -21
  167. package/dist/config/types.d.ts.map +1 -1
  168. package/dist/config/types.js.map +1 -1
  169. package/dist/database/defaultCopy.d.ts.map +1 -1
  170. package/dist/database/defaultCopy.js +0 -1
  171. package/dist/database/defaultCopy.js.map +1 -1
  172. package/dist/database/types.d.ts +4 -75
  173. package/dist/database/types.d.ts.map +1 -1
  174. package/dist/database/types.js.map +1 -1
  175. package/dist/exports/build-config.d.ts +9 -0
  176. package/dist/exports/build-config.d.ts.map +1 -0
  177. package/dist/exports/build-config.js +38 -0
  178. package/dist/exports/build-config.js.map +1 -0
  179. package/dist/exports/shared.d.ts +0 -2
  180. package/dist/exports/shared.d.ts.map +1 -1
  181. package/dist/exports/shared.js +0 -2
  182. package/dist/exports/shared.js.map +1 -1
  183. package/dist/fields/baseFields/authorship/index.d.ts +1 -2
  184. package/dist/fields/baseFields/authorship/index.d.ts.map +1 -1
  185. package/dist/fields/baseFields/authorship/index.js +0 -12
  186. package/dist/fields/baseFields/authorship/index.js.map +1 -1
  187. package/dist/fields/config/client.js.map +1 -1
  188. package/dist/fields/config/reservedFieldNames.d.ts.map +1 -1
  189. package/dist/fields/config/reservedFieldNames.js.map +1 -1
  190. package/dist/fields/config/types.d.ts.map +1 -1
  191. package/dist/fields/config/types.js.map +1 -1
  192. package/dist/fields/hooks/afterChange/promise.js.map +1 -1
  193. package/dist/fields/hooks/afterRead/index.d.ts +0 -8
  194. package/dist/fields/hooks/afterRead/index.d.ts.map +1 -1
  195. package/dist/fields/hooks/afterRead/index.js +2 -6
  196. package/dist/fields/hooks/afterRead/index.js.map +1 -1
  197. package/dist/fields/hooks/afterRead/promise.d.ts +1 -3
  198. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
  199. package/dist/fields/hooks/afterRead/promise.js +17 -41
  200. package/dist/fields/hooks/afterRead/promise.js.map +1 -1
  201. package/dist/fields/hooks/afterRead/relationshipPopulationPromise.d.ts.map +1 -1
  202. package/dist/fields/hooks/afterRead/relationshipPopulationPromise.js +0 -2
  203. package/dist/fields/hooks/afterRead/relationshipPopulationPromise.js.map +1 -1
  204. package/dist/fields/hooks/afterRead/traverseFields.d.ts +1 -3
  205. package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
  206. package/dist/fields/hooks/afterRead/traverseFields.js +2 -4
  207. package/dist/fields/hooks/afterRead/traverseFields.js.map +1 -1
  208. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.d.ts.map +1 -1
  209. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.js +0 -3
  210. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.js.map +1 -1
  211. package/dist/fields/hooks/beforeChange/flattenValidationData.d.ts +14 -0
  212. package/dist/fields/hooks/beforeChange/flattenValidationData.d.ts.map +1 -0
  213. package/dist/fields/hooks/beforeChange/flattenValidationData.js +36 -0
  214. package/dist/fields/hooks/beforeChange/flattenValidationData.js.map +1 -0
  215. package/dist/fields/hooks/beforeChange/promise.d.ts +2 -1
  216. package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
  217. package/dist/fields/hooks/beforeChange/promise.js +96 -22
  218. package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
  219. package/dist/fields/hooks/beforeChange/traverseFields.d.ts +2 -1
  220. package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
  221. package/dist/fields/hooks/beforeChange/traverseFields.js +2 -1
  222. package/dist/fields/hooks/beforeChange/traverseFields.js.map +1 -1
  223. package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
  224. package/dist/fields/hooks/beforeValidate/promise.js +0 -8
  225. package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
  226. package/dist/fields/validations.d.ts.map +1 -1
  227. package/dist/fields/validations.js +4 -1
  228. package/dist/fields/validations.js.map +1 -1
  229. package/dist/globals/config/types.d.ts +2 -6
  230. package/dist/globals/config/types.d.ts.map +1 -1
  231. package/dist/globals/config/types.js.map +1 -1
  232. package/dist/globals/operations/countGlobalVersions.d.ts.map +1 -1
  233. package/dist/globals/operations/countGlobalVersions.js +0 -7
  234. package/dist/globals/operations/countGlobalVersions.js.map +1 -1
  235. package/dist/globals/operations/findOne.d.ts.map +1 -1
  236. package/dist/globals/operations/findOne.js +0 -7
  237. package/dist/globals/operations/findOne.js.map +1 -1
  238. package/dist/globals/operations/findVersionByID.d.ts.map +1 -1
  239. package/dist/globals/operations/findVersionByID.js +6 -6
  240. package/dist/globals/operations/findVersionByID.js.map +1 -1
  241. package/dist/globals/operations/findVersions.d.ts.map +1 -1
  242. package/dist/globals/operations/findVersions.js +4 -6
  243. package/dist/globals/operations/findVersions.js.map +1 -1
  244. package/dist/globals/operations/local/countVersions.d.ts +0 -5
  245. package/dist/globals/operations/local/countVersions.d.ts.map +1 -1
  246. package/dist/globals/operations/local/countVersions.js.map +1 -1
  247. package/dist/globals/operations/local/findOne.d.ts +0 -5
  248. package/dist/globals/operations/local/findOne.d.ts.map +1 -1
  249. package/dist/globals/operations/local/findOne.js.map +1 -1
  250. package/dist/globals/operations/local/findVersionByID.d.ts +0 -5
  251. package/dist/globals/operations/local/findVersionByID.d.ts.map +1 -1
  252. package/dist/globals/operations/local/findVersionByID.js.map +1 -1
  253. package/dist/globals/operations/local/findVersions.d.ts +0 -5
  254. package/dist/globals/operations/local/findVersions.d.ts.map +1 -1
  255. package/dist/globals/operations/local/findVersions.js.map +1 -1
  256. package/dist/globals/operations/local/restoreVersion.d.ts +0 -5
  257. package/dist/globals/operations/local/restoreVersion.d.ts.map +1 -1
  258. package/dist/globals/operations/local/restoreVersion.js.map +1 -1
  259. package/dist/globals/operations/local/update.d.ts +0 -5
  260. package/dist/globals/operations/local/update.d.ts.map +1 -1
  261. package/dist/globals/operations/local/update.js +18 -61
  262. package/dist/globals/operations/local/update.js.map +1 -1
  263. package/dist/globals/operations/restoreVersion.d.ts +2 -3
  264. package/dist/globals/operations/restoreVersion.d.ts.map +1 -1
  265. package/dist/globals/operations/restoreVersion.js +24 -61
  266. package/dist/globals/operations/restoreVersion.js.map +1 -1
  267. package/dist/globals/operations/update.d.ts.map +1 -1
  268. package/dist/globals/operations/update.js +8 -86
  269. package/dist/globals/operations/update.js.map +1 -1
  270. package/dist/globals/operations/validate.js +1 -1
  271. package/dist/globals/operations/validate.js.map +1 -1
  272. package/dist/hierarchy/addHierarchyToCollection.d.ts.map +1 -1
  273. package/dist/hierarchy/addHierarchyToCollection.js +32 -21
  274. package/dist/hierarchy/addHierarchyToCollection.js.map +1 -1
  275. package/dist/hierarchy/createFolderField.js.map +1 -1
  276. package/dist/hierarchy/getInitialTreeData.d.ts +1 -3
  277. package/dist/hierarchy/getInitialTreeData.d.ts.map +1 -1
  278. package/dist/hierarchy/getInitialTreeData.js +1 -4
  279. package/dist/hierarchy/getInitialTreeData.js.map +1 -1
  280. package/dist/hierarchy/resolveHierarchyCollections.js +9 -3
  281. package/dist/hierarchy/resolveHierarchyCollections.js.map +1 -1
  282. package/dist/hierarchy/utils/computePaths.d.ts.map +1 -1
  283. package/dist/hierarchy/utils/computePaths.js.map +1 -1
  284. package/dist/index.bundled.d.ts +4336 -5501
  285. package/dist/index.d.ts +27 -51
  286. package/dist/index.d.ts.map +1 -1
  287. package/dist/index.js +14 -37
  288. package/dist/index.js.map +1 -1
  289. package/dist/llm-instructions/getInstructionsCollection.d.ts.map +1 -1
  290. package/dist/llm-instructions/getInstructionsCollection.js +2 -0
  291. package/dist/llm-instructions/getInstructionsCollection.js.map +1 -1
  292. package/dist/preferences/keys.d.ts +4 -11
  293. package/dist/preferences/keys.d.ts.map +1 -1
  294. package/dist/preferences/keys.js +3 -10
  295. package/dist/preferences/keys.js.map +1 -1
  296. package/dist/preferences/types.d.ts +0 -19
  297. package/dist/preferences/types.d.ts.map +1 -1
  298. package/dist/preferences/types.js.map +1 -1
  299. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js +1 -1
  300. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js.map +1 -1
  301. package/dist/types/index.d.ts +0 -13
  302. package/dist/types/index.d.ts.map +1 -1
  303. package/dist/types/index.js.map +1 -1
  304. package/dist/uploads/deleteAssociatedFiles.d.ts.map +1 -1
  305. package/dist/uploads/deleteAssociatedFiles.js +29 -108
  306. package/dist/uploads/deleteAssociatedFiles.js.map +1 -1
  307. package/dist/uploads/endpoints/getFile.d.ts.map +1 -1
  308. package/dist/uploads/endpoints/getFile.js +0 -5
  309. package/dist/uploads/endpoints/getFile.js.map +1 -1
  310. package/dist/uploads/fileExists.d.ts.map +1 -1
  311. package/dist/uploads/fileExists.js +2 -5
  312. package/dist/uploads/fileExists.js.map +1 -1
  313. package/dist/uploads/fileVersioning/archive.d.ts.map +1 -1
  314. package/dist/uploads/fileVersioning/archive.js +1 -15
  315. package/dist/uploads/fileVersioning/archive.js.map +1 -1
  316. package/dist/uploads/fileVersioning/cleanup.d.ts +0 -7
  317. package/dist/uploads/fileVersioning/cleanup.d.ts.map +1 -1
  318. package/dist/uploads/fileVersioning/cleanup.js +0 -12
  319. package/dist/uploads/fileVersioning/cleanup.js.map +1 -1
  320. package/dist/uploads/fileVersioning/cloudStorage.d.ts.map +1 -1
  321. package/dist/uploads/fileVersioning/cloudStorage.js +1 -16
  322. package/dist/uploads/fileVersioning/cloudStorage.js.map +1 -1
  323. package/dist/uploads/fileVersioning/resolveHistoricalFile.js.map +1 -1
  324. package/dist/uploads/formatFilesize.js +1 -1
  325. package/dist/uploads/formatFilesize.js.map +1 -1
  326. package/dist/uploads/generateFileData.d.ts +0 -5
  327. package/dist/uploads/generateFileData.d.ts.map +1 -1
  328. package/dist/uploads/generateFileData.js +2 -74
  329. package/dist/uploads/generateFileData.js.map +1 -1
  330. package/dist/uploads/getBaseFields.d.ts.map +1 -1
  331. package/dist/uploads/getBaseFields.js +29 -46
  332. package/dist/uploads/getBaseFields.js.map +1 -1
  333. package/dist/uploads/getFileContentRequirement.js.map +1 -1
  334. package/dist/uploads/getFileFromUploadInstructions.js.map +1 -1
  335. package/dist/uploads/getSafeFilename.d.ts.map +1 -1
  336. package/dist/uploads/getSafeFilename.js +3 -5
  337. package/dist/uploads/getSafeFilename.js.map +1 -1
  338. package/dist/uploads/safeFetch.js.map +1 -1
  339. package/dist/uploads/stagedUpload.js.map +1 -1
  340. package/dist/uploads/transformers/handleDynamicFileRequest.js +11 -2
  341. package/dist/uploads/transformers/handleDynamicFileRequest.js.map +1 -1
  342. package/dist/uploads/types.d.ts +0 -11
  343. package/dist/uploads/types.d.ts.map +1 -1
  344. package/dist/uploads/types.js.map +1 -1
  345. package/dist/uploads/uploadFiles.d.ts +1 -4
  346. package/dist/uploads/uploadFiles.d.ts.map +1 -1
  347. package/dist/uploads/uploadFiles.js +5 -29
  348. package/dist/uploads/uploadFiles.js.map +1 -1
  349. package/dist/utilities/addSelectGenericsToGeneretedTypes.d.ts.map +1 -1
  350. package/dist/utilities/addSelectGenericsToGeneretedTypes.js +0 -1
  351. package/dist/utilities/addSelectGenericsToGeneretedTypes.js.map +1 -1
  352. package/dist/utilities/appendDateTimezoneSelectFields.js.map +1 -1
  353. package/dist/utilities/assertNoValidationWrite.d.ts.map +1 -1
  354. package/dist/utilities/assertNoValidationWrite.js +0 -4
  355. package/dist/utilities/assertNoValidationWrite.js.map +1 -1
  356. package/dist/utilities/checkDocumentLockStatus.d.ts +6 -15
  357. package/dist/utilities/checkDocumentLockStatus.d.ts.map +1 -1
  358. package/dist/utilities/checkDocumentLockStatus.js +11 -44
  359. package/dist/utilities/checkDocumentLockStatus.js.map +1 -1
  360. package/dist/utilities/cloneValidationRequest.js.map +1 -1
  361. package/dist/utilities/commitTransaction.d.ts +0 -4
  362. package/dist/utilities/commitTransaction.d.ts.map +1 -1
  363. package/dist/utilities/commitTransaction.js +1 -41
  364. package/dist/utilities/commitTransaction.js.map +1 -1
  365. package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
  366. package/dist/utilities/configToJSONSchema.js +2 -18
  367. package/dist/utilities/configToJSONSchema.js.map +1 -1
  368. package/dist/utilities/createPayloadRequest.d.ts +0 -5
  369. package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
  370. package/dist/utilities/createPayloadRequest.js +3 -50
  371. package/dist/utilities/createPayloadRequest.js.map +1 -1
  372. package/dist/utilities/createPayloadRequestFromWebRequest.d.ts +12 -1
  373. package/dist/utilities/createPayloadRequestFromWebRequest.d.ts.map +1 -1
  374. package/dist/utilities/createPayloadRequestFromWebRequest.js +9 -5
  375. package/dist/utilities/createPayloadRequestFromWebRequest.js.map +1 -1
  376. package/dist/utilities/deepCopyObject.js.map +1 -1
  377. package/dist/utilities/documentMatchingWhereExists.js +1 -1
  378. package/dist/utilities/documentMatchingWhereExists.js.map +1 -1
  379. package/dist/utilities/entityInputSchema/validateEntityData.d.ts.map +1 -1
  380. package/dist/utilities/entityInputSchema/validateEntityData.js.map +1 -1
  381. package/dist/utilities/filterDataToSelectedLocales.js.map +1 -1
  382. package/dist/utilities/getEntityPermissions/getEntityPermissions.d.ts.map +1 -1
  383. package/dist/utilities/getEntityPermissions/getEntityPermissions.js +1 -0
  384. package/dist/utilities/getEntityPermissions/getEntityPermissions.js.map +1 -1
  385. package/dist/utilities/getEntityPermissions/populateFieldPermissions.js.map +1 -1
  386. package/dist/utilities/getVersionsConfig.d.ts +4 -0
  387. package/dist/utilities/getVersionsConfig.d.ts.map +1 -1
  388. package/dist/utilities/getVersionsConfig.js +5 -0
  389. package/dist/utilities/getVersionsConfig.js.map +1 -1
  390. package/dist/utilities/handleEndpoints.d.ts.map +1 -1
  391. package/dist/utilities/handleEndpoints.js +10 -9
  392. package/dist/utilities/handleEndpoints.js.map +1 -1
  393. package/dist/utilities/httpStatus.d.ts +0 -2
  394. package/dist/utilities/httpStatus.d.ts.map +1 -1
  395. package/dist/utilities/httpStatus.js +1 -3
  396. package/dist/utilities/httpStatus.js.map +1 -1
  397. package/dist/utilities/initTransaction.d.ts.map +1 -1
  398. package/dist/utilities/initTransaction.js +7 -35
  399. package/dist/utilities/initTransaction.js.map +1 -1
  400. package/dist/utilities/killTransaction.d.ts.map +1 -1
  401. package/dist/utilities/killTransaction.js +0 -27
  402. package/dist/utilities/killTransaction.js.map +1 -1
  403. package/dist/utilities/parseParams/index.js.map +1 -1
  404. package/dist/utilities/parseValidationLocale.js.map +1 -1
  405. package/dist/utilities/sanitizePopulateParam.js.map +1 -1
  406. package/dist/utilities/telemetry/conf/index.d.ts +4 -1
  407. package/dist/utilities/telemetry/conf/index.d.ts.map +1 -1
  408. package/dist/utilities/telemetry/conf/index.js.map +1 -1
  409. package/dist/utilities/telemetry/featureInfo/getFeatureInfo.js.map +1 -1
  410. package/dist/versions/allLocalesPublicationStatus.js.map +1 -1
  411. package/dist/versions/buildCollectionFields.d.ts.map +1 -1
  412. package/dist/versions/buildCollectionFields.js +0 -23
  413. package/dist/versions/buildCollectionFields.js.map +1 -1
  414. package/dist/versions/buildGlobalFields.d.ts.map +1 -1
  415. package/dist/versions/buildGlobalFields.js +0 -14
  416. package/dist/versions/buildGlobalFields.js.map +1 -1
  417. package/dist/versions/buildVersionCompoundIndexes.d.ts.map +1 -1
  418. package/dist/versions/buildVersionCompoundIndexes.js +2 -8
  419. package/dist/versions/buildVersionCompoundIndexes.js.map +1 -1
  420. package/dist/versions/deleteCollectionVersions.d.ts +1 -2
  421. package/dist/versions/deleteCollectionVersions.d.ts.map +1 -1
  422. package/dist/versions/deleteCollectionVersions.js +8 -37
  423. package/dist/versions/deleteCollectionVersions.js.map +1 -1
  424. package/dist/versions/deleteScheduledPublishJobs.d.ts.map +1 -1
  425. package/dist/versions/deleteScheduledPublishJobs.js +0 -4
  426. package/dist/versions/deleteScheduledPublishJobs.js.map +1 -1
  427. package/dist/versions/drafts/appendVersionToQueryKey.d.ts.map +1 -1
  428. package/dist/versions/drafts/appendVersionToQueryKey.js +1 -9
  429. package/dist/versions/drafts/appendVersionToQueryKey.js.map +1 -1
  430. package/dist/versions/drafts/replaceWithDraftIfAvailable.d.ts.map +1 -1
  431. package/dist/versions/drafts/replaceWithDraftIfAvailable.js +1 -8
  432. package/dist/versions/drafts/replaceWithDraftIfAvailable.js.map +1 -1
  433. package/dist/versions/enforceMaxVersions.d.ts +0 -1
  434. package/dist/versions/enforceMaxVersions.d.ts.map +1 -1
  435. package/dist/versions/enforceMaxVersions.js +6 -22
  436. package/dist/versions/enforceMaxVersions.js.map +1 -1
  437. package/dist/versions/getLatestCollectionVersion.d.ts.map +1 -1
  438. package/dist/versions/getLatestCollectionVersion.js +2 -10
  439. package/dist/versions/getLatestCollectionVersion.js.map +1 -1
  440. package/dist/versions/getLatestGlobalVersion.d.ts +2 -6
  441. package/dist/versions/getLatestGlobalVersion.d.ts.map +1 -1
  442. package/dist/versions/getLatestGlobalVersion.js +21 -65
  443. package/dist/versions/getLatestGlobalVersion.js.map +1 -1
  444. package/dist/versions/isInheritedReadVersionsAccess.js.map +1 -1
  445. package/dist/versions/saveVersion.d.ts +0 -7
  446. package/dist/versions/saveVersion.d.ts.map +1 -1
  447. package/dist/versions/saveVersion.js +4 -27
  448. package/dist/versions/saveVersion.js.map +1 -1
  449. package/dist/versions/updateLatestVersion.d.ts +0 -1
  450. package/dist/versions/updateLatestVersion.d.ts.map +1 -1
  451. package/dist/versions/updateLatestVersion.js +7 -24
  452. package/dist/versions/updateLatestVersion.js.map +1 -1
  453. package/package.json +30 -28
  454. package/skills/payload/reference/ENDPOINTS.md +3 -9
  455. package/skills/payload/reference/PLUGIN-DEVELOPMENT.md +4 -4
  456. package/dist/admin/getAdminPreferences.d.ts +0 -10
  457. package/dist/admin/getAdminPreferences.d.ts.map +0 -1
  458. package/dist/admin/getAdminPreferences.js +0 -53
  459. package/dist/admin/getAdminPreferences.js.map +0 -1
  460. package/dist/admin/getRequestBranch.d.ts +0 -6
  461. package/dist/admin/getRequestBranch.d.ts.map +0 -1
  462. package/dist/admin/getRequestBranch.js +0 -17
  463. package/dist/admin/getRequestBranch.js.map +0 -1
  464. package/dist/branching/appendBranchFilter.d.ts +0 -30
  465. package/dist/branching/appendBranchFilter.d.ts.map +0 -1
  466. package/dist/branching/appendBranchFilter.js +0 -105
  467. package/dist/branching/appendBranchFilter.js.map +0 -1
  468. package/dist/branching/assertBranchAccess.d.ts +0 -10
  469. package/dist/branching/assertBranchAccess.d.ts.map +0 -1
  470. package/dist/branching/assertBranchAccess.js +0 -36
  471. package/dist/branching/assertBranchAccess.js.map +0 -1
  472. package/dist/branching/assertBranchActionAccess.d.ts +0 -10
  473. package/dist/branching/assertBranchActionAccess.d.ts.map +0 -1
  474. package/dist/branching/assertBranchActionAccess.js +0 -15
  475. package/dist/branching/assertBranchActionAccess.js.map +0 -1
  476. package/dist/branching/assertBranchCreatedDocumentsUnreferenced.d.ts +0 -53
  477. package/dist/branching/assertBranchCreatedDocumentsUnreferenced.d.ts.map +0 -1
  478. package/dist/branching/assertBranchCreatedDocumentsUnreferenced.js +0 -833
  479. package/dist/branching/assertBranchCreatedDocumentsUnreferenced.js.map +0 -1
  480. package/dist/branching/assertBranchReadable.d.ts +0 -36
  481. package/dist/branching/assertBranchReadable.d.ts.map +0 -1
  482. package/dist/branching/assertBranchReadable.js +0 -83
  483. package/dist/branching/assertBranchReadable.js.map +0 -1
  484. package/dist/branching/assertBranchUpdateAccess.d.ts +0 -8
  485. package/dist/branching/assertBranchUpdateAccess.d.ts.map +0 -1
  486. package/dist/branching/assertBranchUpdateAccess.js +0 -12
  487. package/dist/branching/assertBranchUpdateAccess.js.map +0 -1
  488. package/dist/branching/assertBranchWritable.d.ts +0 -18
  489. package/dist/branching/assertBranchWritable.d.ts.map +0 -1
  490. package/dist/branching/assertBranchWritable.js +0 -46
  491. package/dist/branching/assertBranchWritable.js.map +0 -1
  492. package/dist/branching/branchIDs.d.ts +0 -38
  493. package/dist/branching/branchIDs.d.ts.map +0 -1
  494. package/dist/branching/branchIDs.js +0 -113
  495. package/dist/branching/branchIDs.js.map +0 -1
  496. package/dist/branching/branchSelect.d.ts +0 -42
  497. package/dist/branching/branchSelect.d.ts.map +0 -1
  498. package/dist/branching/branchSelect.js +0 -97
  499. package/dist/branching/branchSelect.js.map +0 -1
  500. package/dist/branching/checkFieldAccess.d.ts +0 -21
  501. package/dist/branching/checkFieldAccess.d.ts.map +0 -1
  502. package/dist/branching/checkFieldAccess.js +0 -238
  503. package/dist/branching/checkFieldAccess.js.map +0 -1
  504. package/dist/branching/collections.d.ts +0 -14
  505. package/dist/branching/collections.d.ts.map +0 -1
  506. package/dist/branching/collections.js +0 -713
  507. package/dist/branching/collections.js.map +0 -1
  508. package/dist/branching/combineBranchAccess.d.ts +0 -6
  509. package/dist/branching/combineBranchAccess.d.ts.map +0 -1
  510. package/dist/branching/combineBranchAccess.js +0 -22
  511. package/dist/branching/combineBranchAccess.js.map +0 -1
  512. package/dist/branching/copyUploadFilesToBranch.d.ts +0 -9
  513. package/dist/branching/copyUploadFilesToBranch.d.ts.map +0 -1
  514. package/dist/branching/copyUploadFilesToBranch.js +0 -126
  515. package/dist/branching/copyUploadFilesToBranch.js.map +0 -1
  516. package/dist/branching/createShadowRow.d.ts +0 -70
  517. package/dist/branching/createShadowRow.d.ts.map +0 -1
  518. package/dist/branching/createShadowRow.js +0 -296
  519. package/dist/branching/createShadowRow.js.map +0 -1
  520. package/dist/branching/discard.d.ts +0 -52
  521. package/dist/branching/discard.d.ts.map +0 -1
  522. package/dist/branching/discard.js +0 -428
  523. package/dist/branching/discard.js.map +0 -1
  524. package/dist/branching/effectiveOperations.d.ts +0 -55
  525. package/dist/branching/effectiveOperations.d.ts.map +0 -1
  526. package/dist/branching/effectiveOperations.js +0 -472
  527. package/dist/branching/effectiveOperations.js.map +0 -1
  528. package/dist/branching/endpoints/discard.d.ts +0 -15
  529. package/dist/branching/endpoints/discard.d.ts.map +0 -1
  530. package/dist/branching/endpoints/discard.js +0 -55
  531. package/dist/branching/endpoints/discard.js.map +0 -1
  532. package/dist/branching/endpoints/merge.d.ts +0 -34
  533. package/dist/branching/endpoints/merge.d.ts.map +0 -1
  534. package/dist/branching/endpoints/merge.js +0 -119
  535. package/dist/branching/endpoints/merge.js.map +0 -1
  536. package/dist/branching/forkDocument.d.ts +0 -20
  537. package/dist/branching/forkDocument.d.ts.map +0 -1
  538. package/dist/branching/forkDocument.js +0 -169
  539. package/dist/branching/forkDocument.js.map +0 -1
  540. package/dist/branching/globalMergeWrites.d.ts +0 -21
  541. package/dist/branching/globalMergeWrites.d.ts.map +0 -1
  542. package/dist/branching/globalMergeWrites.js +0 -146
  543. package/dist/branching/globalMergeWrites.js.map +0 -1
  544. package/dist/branching/globals.d.ts +0 -49
  545. package/dist/branching/globals.d.ts.map +0 -1
  546. package/dist/branching/globals.js +0 -197
  547. package/dist/branching/globals.js.map +0 -1
  548. package/dist/branching/hooks.d.ts +0 -24
  549. package/dist/branching/hooks.d.ts.map +0 -1
  550. package/dist/branching/hooks.js +0 -92
  551. package/dist/branching/hooks.js.map +0 -1
  552. package/dist/branching/injectBranchFields.d.ts +0 -40
  553. package/dist/branching/injectBranchFields.d.ts.map +0 -1
  554. package/dist/branching/injectBranchFields.js +0 -229
  555. package/dist/branching/injectBranchFields.js.map +0 -1
  556. package/dist/branching/merge/applyMergeChange.d.ts +0 -27
  557. package/dist/branching/merge/applyMergeChange.d.ts.map +0 -1
  558. package/dist/branching/merge/applyMergeChange.js +0 -853
  559. package/dist/branching/merge/applyMergeChange.js.map +0 -1
  560. package/dist/branching/merge/branchMergeStatus.d.ts +0 -12
  561. package/dist/branching/merge/branchMergeStatus.d.ts.map +0 -1
  562. package/dist/branching/merge/branchMergeStatus.js +0 -74
  563. package/dist/branching/merge/branchMergeStatus.js.map +0 -1
  564. package/dist/branching/merge/executeMerge.d.ts +0 -22
  565. package/dist/branching/merge/executeMerge.d.ts.map +0 -1
  566. package/dist/branching/merge/executeMerge.js +0 -600
  567. package/dist/branching/merge/executeMerge.js.map +0 -1
  568. package/dist/branching/merge/finalizeMerge.d.ts +0 -40
  569. package/dist/branching/merge/finalizeMerge.d.ts.map +0 -1
  570. package/dist/branching/merge/finalizeMerge.js +0 -237
  571. package/dist/branching/merge/finalizeMerge.js.map +0 -1
  572. package/dist/branching/merge/mergeLedger.d.ts +0 -40
  573. package/dist/branching/merge/mergeLedger.d.ts.map +0 -1
  574. package/dist/branching/merge/mergeLedger.js +0 -130
  575. package/dist/branching/merge/mergeLedger.js.map +0 -1
  576. package/dist/branching/merge/prepareMerge.d.ts +0 -41
  577. package/dist/branching/merge/prepareMerge.d.ts.map +0 -1
  578. package/dist/branching/merge/prepareMerge.js +0 -234
  579. package/dist/branching/merge/prepareMerge.js.map +0 -1
  580. package/dist/branching/merge/recoverMerge.d.ts +0 -16
  581. package/dist/branching/merge/recoverMerge.d.ts.map +0 -1
  582. package/dist/branching/merge/recoverMerge.js +0 -199
  583. package/dist/branching/merge/recoverMerge.js.map +0 -1
  584. package/dist/branching/merge/retryFailedCleanups.d.ts +0 -36
  585. package/dist/branching/merge/retryFailedCleanups.d.ts.map +0 -1
  586. package/dist/branching/merge/retryFailedCleanups.js +0 -335
  587. package/dist/branching/merge/retryFailedCleanups.js.map +0 -1
  588. package/dist/branching/merge/utilities.d.ts +0 -35
  589. package/dist/branching/merge/utilities.d.ts.map +0 -1
  590. package/dist/branching/merge/utilities.js +0 -54
  591. package/dist/branching/merge/utilities.js.map +0 -1
  592. package/dist/branching/merge.d.ts +0 -88
  593. package/dist/branching/merge.d.ts.map +0 -1
  594. package/dist/branching/merge.js +0 -163
  595. package/dist/branching/merge.js.map +0 -1
  596. package/dist/branching/mergeWriteGuard.d.ts +0 -20
  597. package/dist/branching/mergeWriteGuard.d.ts.map +0 -1
  598. package/dist/branching/mergeWriteGuard.js +0 -27
  599. package/dist/branching/mergeWriteGuard.js.map +0 -1
  600. package/dist/branching/preflight.d.ts +0 -71
  601. package/dist/branching/preflight.d.ts.map +0 -1
  602. package/dist/branching/preflight.js +0 -757
  603. package/dist/branching/preflight.js.map +0 -1
  604. package/dist/branching/readLocalizedBranchWrite.d.ts +0 -14
  605. package/dist/branching/readLocalizedBranchWrite.d.ts.map +0 -1
  606. package/dist/branching/readLocalizedBranchWrite.js +0 -90
  607. package/dist/branching/readLocalizedBranchWrite.js.map +0 -1
  608. package/dist/branching/readMergeSnapshot.d.ts +0 -18
  609. package/dist/branching/readMergeSnapshot.d.ts.map +0 -1
  610. package/dist/branching/readMergeSnapshot.js +0 -99
  611. package/dist/branching/readMergeSnapshot.js.map +0 -1
  612. package/dist/branching/resolveBranch.d.ts +0 -153
  613. package/dist/branching/resolveBranch.d.ts.map +0 -1
  614. package/dist/branching/resolveBranch.js +0 -363
  615. package/dist/branching/resolveBranch.js.map +0 -1
  616. package/dist/branching/resolveBranchActionAccess.d.ts +0 -8
  617. package/dist/branching/resolveBranchActionAccess.d.ts.map +0 -1
  618. package/dist/branching/resolveBranchActionAccess.js +0 -9
  619. package/dist/branching/resolveBranchActionAccess.js.map +0 -1
  620. package/dist/branching/resolveBranchQuery.d.ts +0 -48
  621. package/dist/branching/resolveBranchQuery.d.ts.map +0 -1
  622. package/dist/branching/resolveBranchQuery.js +0 -115
  623. package/dist/branching/resolveBranchQuery.js.map +0 -1
  624. package/dist/branching/resolveBranchRowID.d.ts +0 -22
  625. package/dist/branching/resolveBranchRowID.d.ts.map +0 -1
  626. package/dist/branching/resolveBranchRowID.js +0 -70
  627. package/dist/branching/resolveBranchRowID.js.map +0 -1
  628. package/dist/branching/sanitizeBranchingConfig.d.ts +0 -31
  629. package/dist/branching/sanitizeBranchingConfig.d.ts.map +0 -1
  630. package/dist/branching/sanitizeBranchingConfig.js +0 -110
  631. package/dist/branching/sanitizeBranchingConfig.js.map +0 -1
  632. package/dist/branching/schedule/job.d.ts +0 -51
  633. package/dist/branching/schedule/job.d.ts.map +0 -1
  634. package/dist/branching/schedule/job.js +0 -151
  635. package/dist/branching/schedule/job.js.map +0 -1
  636. package/dist/branching/selectBranchChanges.d.ts +0 -8
  637. package/dist/branching/selectBranchChanges.d.ts.map +0 -1
  638. package/dist/branching/selectBranchChanges.js +0 -9
  639. package/dist/branching/selectBranchChanges.js.map +0 -1
  640. package/dist/branching/stripBranchMergeData.d.ts +0 -11
  641. package/dist/branching/stripBranchMergeData.d.ts.map +0 -1
  642. package/dist/branching/stripBranchMergeData.js +0 -20
  643. package/dist/branching/stripBranchMergeData.js.map +0 -1
  644. package/dist/branching/tombstone.d.ts +0 -91
  645. package/dist/branching/tombstone.d.ts.map +0 -1
  646. package/dist/branching/tombstone.js +0 -546
  647. package/dist/branching/tombstone.js.map +0 -1
  648. package/dist/branching/types.d.ts +0 -158
  649. package/dist/branching/types.d.ts.map +0 -1
  650. package/dist/branching/types.js +0 -54
  651. package/dist/branching/types.js.map +0 -1
  652. package/dist/branching/validation.d.ts +0 -47
  653. package/dist/branching/validation.d.ts.map +0 -1
  654. package/dist/branching/validation.js +0 -272
  655. package/dist/branching/validation.js.map +0 -1
  656. package/dist/branching/versions.d.ts +0 -131
  657. package/dist/branching/versions.d.ts.map +0 -1
  658. package/dist/branching/versions.js +0 -572
  659. package/dist/branching/versions.js.map +0 -1
  660. package/dist/collections/operations/utilities/createOperationRetryRequest.d.ts +0 -23
  661. package/dist/collections/operations/utilities/createOperationRetryRequest.d.ts.map +0 -1
  662. package/dist/collections/operations/utilities/createOperationRetryRequest.js +0 -683
  663. package/dist/collections/operations/utilities/createOperationRetryRequest.js.map +0 -1
  664. package/dist/fields/hooks/beforeValidate/throwOnAccessDenied.d.ts +0 -3
  665. package/dist/fields/hooks/beforeValidate/throwOnAccessDenied.d.ts.map +0 -1
  666. package/dist/fields/hooks/beforeValidate/throwOnAccessDenied.js +0 -3
  667. package/dist/fields/hooks/beforeValidate/throwOnAccessDenied.js.map +0 -1
  668. package/dist/uploads/appendBranchToFileURL.d.ts +0 -6
  669. package/dist/uploads/appendBranchToFileURL.d.ts.map +0 -1
  670. package/dist/uploads/appendBranchToFileURL.js +0 -24
  671. package/dist/uploads/appendBranchToFileURL.js.map +0 -1
  672. package/dist/uploads/deleteUploadFilesExclusiveToDocument.d.ts +0 -15
  673. package/dist/uploads/deleteUploadFilesExclusiveToDocument.d.ts.map +0 -1
  674. package/dist/uploads/deleteUploadFilesExclusiveToDocument.js +0 -62
  675. package/dist/uploads/deleteUploadFilesExclusiveToDocument.js.map +0 -1
  676. package/dist/uploads/fileIdentity.d.ts +0 -24
  677. package/dist/uploads/fileIdentity.d.ts.map +0 -1
  678. package/dist/uploads/fileIdentity.js +0 -36
  679. package/dist/uploads/fileIdentity.js.map +0 -1
  680. package/dist/uploads/fileQuarantine.d.ts +0 -17
  681. package/dist/uploads/fileQuarantine.d.ts.map +0 -1
  682. package/dist/uploads/fileQuarantine.js +0 -52
  683. package/dist/uploads/fileQuarantine.js.map +0 -1
  684. package/dist/uploads/linkFileWithoutOverwrite.d.ts +0 -13
  685. package/dist/uploads/linkFileWithoutOverwrite.d.ts.map +0 -1
  686. package/dist/uploads/linkFileWithoutOverwrite.js +0 -13
  687. package/dist/uploads/linkFileWithoutOverwrite.js.map +0 -1
  688. package/dist/uploads/uploadFileRollback.d.ts +0 -31
  689. package/dist/uploads/uploadFileRollback.d.ts.map +0 -1
  690. package/dist/uploads/uploadFileRollback.js +0 -269
  691. package/dist/uploads/uploadFileRollback.js.map +0 -1
  692. package/dist/utilities/extractRelationshipID.d.ts +0 -4
  693. package/dist/utilities/extractRelationshipID.d.ts.map +0 -1
  694. package/dist/utilities/extractRelationshipID.js +0 -14
  695. package/dist/utilities/extractRelationshipID.js.map +0 -1
  696. package/dist/utilities/transactionCallbacks.d.ts +0 -77
  697. package/dist/utilities/transactionCallbacks.d.ts.map +0 -1
  698. package/dist/utilities/transactionCallbacks.js +0 -299
  699. package/dist/utilities/transactionCallbacks.js.map +0 -1
  700. package/dist/utilities/transactionMutationTracker.d.ts +0 -21
  701. package/dist/utilities/transactionMutationTracker.d.ts.map +0 -1
  702. package/dist/utilities/transactionMutationTracker.js +0 -71
  703. package/dist/utilities/transactionMutationTracker.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"countVersions.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/countVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAOzE,MAAM,MAAM,oBAAoB,CAAC,KAAK,SAAS,cAAc,IAAI;IAC/D;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACvB;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAEjD,wBAAsB,kBAAkB,CAAC,KAAK,SAAS,cAAc,EACnE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,oBAAoB,CAAC,KAAK,CAAC,GACnC,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAqBhC"}
1
+ {"version":3,"file":"countVersions.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/countVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACnG,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAOzE,MAAM,MAAM,oBAAoB,CAAC,KAAK,SAAS,cAAc,IAAI;IAC/D;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAEjD,wBAAsB,kBAAkB,CAAC,KAAK,SAAS,cAAc,EACnE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,oBAAoB,CAAC,KAAK,CAAC,GACnC,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAqBhC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/countVersions.ts"],"sourcesContent":["import type { CollectionSlug, Payload, RequestContext, TypedLocale, User } from '../../../index.js'\nimport type { PayloadRequest, Where } from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { countVersionsOperation } from '../countVersions.js'\n\nexport type CountVersionsOptions<TSlug extends CollectionSlug> = {\n /**\n * Count versions as seen from this branch. `false` bypasses branching entirely.\n */\n branch?: false | string\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * When set to `true`, errors will not be thrown.\n */\n disableErrors?: boolean\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: TypedLocale\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n /**\n * A filter [query](https://payloadcms.com/docs/queries/overview)\n */\n where?: Where\n} & Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport async function countVersionsLocal<TSlug extends CollectionSlug>(\n payload: Payload,\n options: CountVersionsOptions<TSlug>,\n): Promise<{ totalDocs: number }> {\n const { collection: collectionSlug, disableErrors, overrideAccess = false, where } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Count Versions Operation.`,\n )\n }\n\n return countVersionsOperation<TSlug>({\n collection,\n disableErrors,\n overrideAccess,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n where,\n })\n}\n"],"names":["APIError","createPayloadRequest","countVersionsOperation","countVersionsLocal","payload","options","collection","collectionSlug","disableErrors","overrideAccess","where","collections","String","req"],"mappings":"AAKA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,sBAAsB,QAAQ,sBAAqB;AAyC5D,OAAO,eAAeC,mBACpBC,OAAgB,EAChBC,OAAoC;IAEpC,MAAM,EAAEC,YAAYC,cAAc,EAAEC,aAAa,EAAEC,iBAAiB,KAAK,EAAEC,KAAK,EAAE,GAAGL;IAErF,MAAMC,aAAaF,QAAQO,WAAW,CAACJ,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEY,OAAOL,gBAAgB,0CAA0C,CAAC;IAElG;IAEA,OAAOL,uBAA8B;QACnCI;QACAE;QACAC;QACAI,KAAK,MAAMZ,qBAAqB;YAC9B,GAAII,OAAO;YACXD;QACF;QACAM;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/countVersions.ts"],"sourcesContent":["import type { CollectionSlug, Payload, RequestContext, TypedLocale, User } from '../../../index.js'\nimport type { PayloadRequest, Where } from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { countVersionsOperation } from '../countVersions.js'\n\nexport type CountVersionsOptions<TSlug extends CollectionSlug> = {\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * When set to `true`, errors will not be thrown.\n */\n disableErrors?: boolean\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: TypedLocale\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n /**\n * A filter [query](https://payloadcms.com/docs/queries/overview)\n */\n where?: Where\n} & Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport async function countVersionsLocal<TSlug extends CollectionSlug>(\n payload: Payload,\n options: CountVersionsOptions<TSlug>,\n): Promise<{ totalDocs: number }> {\n const { collection: collectionSlug, disableErrors, overrideAccess = false, where } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Count Versions Operation.`,\n )\n }\n\n return countVersionsOperation<TSlug>({\n collection,\n disableErrors,\n overrideAccess,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n where,\n })\n}\n"],"names":["APIError","createPayloadRequest","countVersionsOperation","countVersionsLocal","payload","options","collection","collectionSlug","disableErrors","overrideAccess","where","collections","String","req"],"mappings":"AAKA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,sBAAsB,QAAQ,sBAAqB;AAqC5D,OAAO,eAAeC,mBACpBC,OAAgB,EAChBC,OAAoC;IAEpC,MAAM,EAAEC,YAAYC,cAAc,EAAEC,aAAa,EAAEC,iBAAiB,KAAK,EAAEC,KAAK,EAAE,GAAGL;IAErF,MAAMC,aAAaF,QAAQO,WAAW,CAACJ,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEY,OAAOL,gBAAgB,0CAA0C,CAAC;IAElG;IAEA,OAAOL,uBAA8B;QACnCI;QACAE;QACAC;QACAI,KAAK,MAAMZ,qBAAqB;YAC9B,GAAII,OAAO;YACXD;QACF;QACAM;IACF;AACF"}
@@ -4,21 +4,16 @@ import type { File } from '../../../uploads/types.js';
4
4
  import type { CollectionsWithoutDrafts, DataFromCollectionSlug, DraftDataFromCollectionSlug, RequiredDataFromCollectionSlug, SelectFromCollectionSlug } from '../../config/types.js';
5
5
  import { type CollectionSlug, type FindOptions, type GeneratedTypes, type Payload, type RequestContext, type TypedLocale, type User } from '../../../index.js';
6
6
  type BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {
7
+ /**
8
+ * the Collection slug to operate against.
9
+ */
10
+ collection: TSlug;
7
11
  /**
8
12
  * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,
9
13
  * which can be read by hooks. Useful if you want to pass additional information to the hooks which
10
14
  * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook
11
15
  * to determine if it should run or not.
12
16
  */
13
- /**
14
- * Read and write against a specific content branch instead of resolving one
15
- * from the request. `false` bypasses branching entirely.
16
- */
17
- branch?: false | string;
18
- /**
19
- * the Collection slug to operate against.
20
- */
21
- collection: TSlug;
22
17
  context?: RequestContext;
23
18
  /**
24
19
  * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACtB,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,OAAO,EACZ,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,IAAI,EACV,MAAM,mBAAmB,CAAA;AAK1B,KAAK,WAAW,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI;IAC3E;;;;;OAKG;IACH;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACvB;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAA;IAClC;;OAEG;IACH,eAAe,CAAC,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAA;IACrD;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,GA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AC,EAAE,KAAK,CAAA;CACd,GACD;IACE;;;OAGG;IACH,IAAI,EAAE,2BAA2B,CAAC,KAAK,CAAC,CAAA;IACxC;;OAEG;IACH,KAAK,EAAE,IAAI,CAAA;CACZ,CACJ,GACC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,GAE7B,CAAC;IACC;;OAEG;IACH,IAAI,EAAE,8BAA8B,CAAC,KAAK,CAAC,CAAA;IAC3C;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,GAChC,CAAC;IACC;;;OAGG;IACH,IAAI,EAAE,2BAA2B,CAAC,KAAK,CAAC,CAAA;IACxC;;OAEG;IACH,KAAK,EAAE,IAAI,CAAA;CACZ,GAAG,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAA;AAExC,wBAAsB,WAAW,CAC/B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAE/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAkDxD"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACzE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,2BAA2B,CAAA;AAErD,OAAO,KAAK,EACV,wBAAwB,EACxB,sBAAsB,EACtB,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EACL,KAAK,cAAc,EAEnB,KA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AO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAkDxD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/create.ts"],"sourcesContent":["import type {\n PayloadRequest,\n PopulateType,\n SelectType,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { File } from '../../../uploads/types.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type {\n CollectionsWithoutDrafts,\n DataFromCollectionSlug,\n DraftDataFromCollectionSlug,\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n} from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport {\n type CollectionSlug,\n deepCopyObjectSimple,\n type FindOptions,\n type GeneratedTypes,\n type Payload,\n type RequestContext,\n type TypedLocale,\n type User,\n} from '../../../index.js'\nimport { getFileByPath } from '../../../uploads/getFileByPath.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { createOperation } from '../create.js'\n\ntype BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n /**\n * Read and write against a specific content branch instead of resolving one\n * from the request. `false` bypasses branching entirely.\n */\n branch?: false | string\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n context?: RequestContext\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, a [database transactions](https://payloadcms.com/docs/database/transactions) will not be initialized.\n * @default false\n */\n disableTransaction?: boolean\n /**\n * If creating verification-enabled auth doc,\n * you can disable the email that is auto-sent\n */\n disableVerificationEmail?: boolean\n /**\n * If you want to create a document that is a duplicate of another document\n */\n duplicateFromID?: DataFromCollectionSlug<TSlug>['id']\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale\n /**\n * A `File` object when creating a collection with `upload: true`.\n */\n file?: File\n /**\n * A file path when creating a collection with `upload: true`.\n */\n filePath?: string\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: TypedLocale\n /**\n * If you are uploading a file and would like to replace\n * the existing file instead of generating a new filename,\n * you can set the following property to `true`\n */\n overwriteExistingFiles?: boolean\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * Publish to all locales\n */\n publishAllLocales?: boolean\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n} & Pick<FindOptions<TSlug, TSelect>, 'select'> &\n Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type Options<\n TSlug extends CollectionSlug,\n TSelect extends SelectType,\n> = GeneratedTypes extends { strictDraftTypes: true }\n ? CollectionsWithoutDrafts extends TSlug\n ? {\n /**\n * The data for the document to create.\n */\n data: DataFromCollectionSlug<TSlug>\n /**\n * Create a **draft** document. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n } & BaseOptions<TSlug, TSelect>\n : TSlug extends CollectionsWithoutDrafts\n ? {\n data: RequiredDataFromCollectionSlug<TSlug>\n /**\n * The `draft` property is not allowed because this collection does not have `versions.drafts` enabled.\n */\n draft?: never\n } & BaseOptions<TSlug, TSelect>\n : (\n | {\n /**\n * The data for the document to create.\n */\n data: RequiredDataFromCollectionSlug<TSlug>\n /**\n * Create a **draft** document. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n * Omit this property or set to `false` to create a published document.\n */\n draft?: false\n }\n | {\n /**\n * The data for the document to create.\n * When creating a draft, required fields are optional as validation is skipped by default.\n */\n data: DraftDataFromCollectionSlug<TSlug>\n /**\n * Create a **draft** document. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft: true\n }\n ) &\n BaseOptions<TSlug, TSelect>\n :\n | ({\n /**\n * The data for the document to create.\n */\n data: RequiredDataFromCollectionSlug<TSlug>\n /**\n * Create a **draft** document. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: false\n } & BaseOptions<TSlug, TSelect>)\n | ({\n /**\n * The data for the document to create.\n * When creating a draft, required fields are optional as validation is skipped by default.\n */\n data: DraftDataFromCollectionSlug<TSlug>\n /**\n * Create a **draft** document. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft: true\n } & BaseOptions<TSlug, TSelect>)\n\nexport async function createLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n collection: collectionSlug,\n data,\n depth,\n disableTransaction,\n disableVerificationEmail,\n draft,\n duplicateFromID,\n file,\n filePath,\n overrideAccess = false,\n overwriteExistingFiles = false,\n populate,\n publishAllLocales,\n select,\n showHiddenFields,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Create Operation.`,\n )\n }\n\n const req = await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n })\n\n req.file = file ?? (await getFileByPath(filePath!))\n\n return createOperation<TSlug, TSelect>({\n collection,\n data: deepCopyObjectSimple(data), // Ensure mutation of data in create operation hooks doesn't affect the original data\n depth,\n disableTransaction,\n disableVerificationEmail,\n draft,\n duplicateFromID,\n overrideAccess,\n overwriteExistingFiles,\n populate,\n publishAllLocales,\n req,\n select,\n showHiddenFields,\n })\n}\n"],"names":["APIError","deepCopyObjectSimple","getFileByPath","createPayloadRequest","createOperation","createLocal","payload","options","collection","collectionSlug","data","depth","disableTransaction","disableVerificationEmail","draft","duplicateFromID","file","filePath","overrideAccess","overwriteExistingFiles","populate","publishAllLocales","select","showHiddenFields","collections","String","req"],"mappings":"AAiBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAEEC,oBAAoB,QAOf,oBAAmB;AAC1B,SAASC,aAAa,QAAQ,oCAAmC;AACjE,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,eAAe,QAAQ,eAAc;AA2J9C,OAAO,eAAeC,YAIpBC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,YAAYC,cAAc,EAC1BC,IAAI,EACJC,KAAK,EACLC,kBAAkB,EAClBC,wBAAwB,EACxBC,KAAK,EACLC,eAAe,EACfC,IAAI,EACJC,QAAQ,EACRC,iBAAiB,KAAK,EACtBC,yBAAyB,KAAK,EAC9BC,QAAQ,EACRC,iBAAiB,EACjBC,MAAM,EACNC,gBAAgB,EACjB,GAAGhB;IAEJ,MAAMC,aAAaF,QAAQkB,WAAW,CAACf,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIR,SACR,CAAC,yBAAyB,EAAEyB,OAAOhB,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMiB,MAAM,MAAMvB,qBAAqB;QACrC,GAAII,OAAO;QACXD;IACF;IAEAoB,IAAIV,IAAI,GAAGA,QAAS,MAAMd,cAAce;IAExC,OAAOb,gBAAgC;QACrCI;QACAE,MAAMT,qBAAqBS;QAC3BC;QACAC;QACAC;QACAC;QACAC;QACAG;QACAC;QACAC;QACAC;QACAK;QACAJ;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/create.ts"],"sourcesContent":["import type {\n PayloadRequest,\n PopulateType,\n SelectType,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { File } from '../../../uploads/types.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type {\n CollectionsWithoutDrafts,\n DataFromCollectionSlug,\n DraftDataFromCollectionSlug,\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n} from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport {\n type CollectionSlug,\n deepCopyObjectSimple,\n type FindOptions,\n type GeneratedTypes,\n type Payload,\n type RequestContext,\n type TypedLocale,\n type User,\n} from '../../../index.js'\nimport { getFileByPath } from '../../../uploads/getFileByPath.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { createOperation } from '../create.js'\n\ntype BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, a [database transactions](https://payloadcms.com/docs/database/transactions) will not be initialized.\n * @default false\n */\n disableTransaction?: boolean\n /**\n * If creating verification-enabled auth doc,\n * you can disable the email that is auto-sent\n */\n disableVerificationEmail?: boolean\n /**\n * If you want to create a document that is a duplicate of another document\n */\n duplicateFromID?: DataFromCollectionSlug<TSlug>['id']\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale\n /**\n * A `File` object when creating a collection with `upload: true`.\n */\n file?: File\n /**\n * A file path when creating a collection with `upload: true`.\n */\n filePath?: string\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: TypedLocale\n /**\n * If you are uploading a file and would like to replace\n * the existing file instead of generating a new filename,\n * you can set the following property to `true`\n */\n overwriteExistingFiles?: boolean\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * Publish to all locales\n */\n publishAllLocales?: boolean\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n} & Pick<FindOptions<TSlug, TSelect>, 'select'> &\n Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type Options<\n TSlug extends CollectionSlug,\n TSelect extends SelectType,\n> = GeneratedTypes extends { strictDraftTypes: true }\n ? CollectionsWithoutDrafts extends TSlug\n ? {\n /**\n * The data for the document to create.\n */\n data: DataFromCollectionSlug<TSlug>\n /**\n * Create a **draft** document. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: boolean\n } & BaseOptions<TSlug, TSelect>\n : TSlug extends CollectionsWithoutDrafts\n ? {\n data: RequiredDataFromCollectionSlug<TSlug>\n /**\n * The `draft` property is not allowed because this collection does not have `versions.drafts` enabled.\n */\n draft?: never\n } & BaseOptions<TSlug, TSelect>\n : (\n | {\n /**\n * The data for the document to create.\n */\n data: RequiredDataFromCollectionSlug<TSlug>\n /**\n * Create a **draft** document. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n * Omit this property or set to `false` to create a published document.\n */\n draft?: false\n }\n | {\n /**\n * The data for the document to create.\n * When creating a draft, required fields are optional as validation is skipped by default.\n */\n data: DraftDataFromCollectionSlug<TSlug>\n /**\n * Create a **draft** document. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft: true\n }\n ) &\n BaseOptions<TSlug, TSelect>\n :\n | ({\n /**\n * The data for the document to create.\n */\n data: RequiredDataFromCollectionSlug<TSlug>\n /**\n * Create a **draft** document. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft?: false\n } & BaseOptions<TSlug, TSelect>)\n | ({\n /**\n * The data for the document to create.\n * When creating a draft, required fields are optional as validation is skipped by default.\n */\n data: DraftDataFromCollectionSlug<TSlug>\n /**\n * Create a **draft** document. [More](https://payloadcms.com/docs/versions/drafts#draft-api)\n */\n draft: true\n } & BaseOptions<TSlug, TSelect>)\n\nexport async function createLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n collection: collectionSlug,\n data,\n depth,\n disableTransaction,\n disableVerificationEmail,\n draft,\n duplicateFromID,\n file,\n filePath,\n overrideAccess = false,\n overwriteExistingFiles = false,\n populate,\n publishAllLocales,\n select,\n showHiddenFields,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Create Operation.`,\n )\n }\n\n const req = await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n })\n\n req.file = file ?? (await getFileByPath(filePath!))\n\n return createOperation<TSlug, TSelect>({\n collection,\n data: deepCopyObjectSimple(data), // Ensure mutation of data in create operation hooks doesn't affect the original data\n depth,\n disableTransaction,\n disableVerificationEmail,\n draft,\n duplicateFromID,\n overrideAccess,\n overwriteExistingFiles,\n populate,\n publishAllLocales,\n req,\n select,\n showHiddenFields,\n })\n}\n"],"names":["APIError","deepCopyObjectSimple","getFileByPath","createPayloadRequest","createOperation","createLocal","payload","options","collection","collectionSlug","data","depth","disableTransaction","disableVerificationEmail","draft","duplicateFromID","file","filePath","overrideAccess","overwriteExistingFiles","populate","publishAllLocales","select","showHiddenFields","collections","String","req"],"mappings":"AAiBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAEEC,oBAAoB,QAOf,oBAAmB;AAC1B,SAASC,aAAa,QAAQ,oCAAmC;AACjE,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,eAAe,QAAQ,eAAc;AAsJ9C,OAAO,eAAeC,YAIpBC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,YAAYC,cAAc,EAC1BC,IAAI,EACJC,KAAK,EACLC,kBAAkB,EAClBC,wBAAwB,EACxBC,KAAK,EACLC,eAAe,EACfC,IAAI,EACJC,QAAQ,EACRC,iBAAiB,KAAK,EACtBC,yBAAyB,KAAK,EAC9BC,QAAQ,EACRC,iBAAiB,EACjBC,MAAM,EACNC,gBAAgB,EACjB,GAAGhB;IAEJ,MAAMC,aAAaF,QAAQkB,WAAW,CAACf,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIR,SACR,CAAC,yBAAyB,EAAEyB,OAAOhB,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMiB,MAAM,MAAMvB,qBAAqB;QACrC,GAAII,OAAO;QACXD;IACF;IAEAoB,IAAIV,IAAI,GAAGA,QAAS,MAAMd,cAAce;IAExC,OAAOb,gBAAgC;QACrCI;QACAE,MAAMT,qBAAqBS;QAC3BC;QACAC;QACAC;QACAC;QACAC;QACAG;QACAC;QACAC;QACAC;QACAK;QACAJ;QACAC;IACF;AACF"}
@@ -3,21 +3,16 @@ import type { PayloadRequest, PopulateType, SelectType, TransformCollectionWithS
3
3
  import type { SharedLocalAPIOptions } from '../../../types/operations.js';
4
4
  import type { BulkOperationResult, SelectFromCollectionSlug } from '../../config/types.js';
5
5
  export type BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {
6
+ /**
7
+ * the Collection slug to operate against.
8
+ */
9
+ collection: TSlug;
6
10
  /**
7
11
  * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,
8
12
  * which can be read by hooks. Useful if you want to pass additional information to the hooks which
9
13
  * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook
10
14
  * to determine if it should run or not.
11
15
  */
12
- /**
13
- * Read and write against a specific content branch instead of resolving one
14
- * from the request. `false` bypasses branching entirely.
15
- */
16
- branch?: false | string;
17
- /**
18
- * the Collection slug to operate against.
19
- */
20
- collection: TSlug;
21
16
  context?: RequestContext;
22
17
  /**
23
18
  * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.
@@ -1 +1 @@
1
- {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,OAAO,EACP,cAAc,EACd,WAAW,EACX,IAAI,EACL,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC7B,KAAK,EACN,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEzE,OAAO,KAAK,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAO1F,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI;IAClF;;;;;OAKG;IACH;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACvB;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB,OA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AAW,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/delete.ts"],"sourcesContent":["import type {\n CollectionSlug,\n FindOptions,\n Payload,\n RequestContext,\n TypedLocale,\n User,\n} from '../../../index.js'\nimport type {\n PayloadRequest,\n PopulateType,\n SelectType,\n TransformCollectionWithSelect,\n Where,\n} from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type { BulkOperationResult, SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { deleteOperation } from '../delete.js'\nimport { deleteByIDOperation } from '../deleteByID.js'\n\nexport type BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n /**\n * Read and write against a specific content branch instead of resolving one\n * from the request. `false` bypasses branching entirely.\n */\n branch?: false | string\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n context?: RequestContext\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, a [database transactions](https://payloadcms.com/docs/database/transactions) will not be initialized.\n * @default false\n */\n disableTransaction?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: TypedLocale\n /**\n * By default, document locks are ignored (`true`). Set to `false` to enforce locks and prevent operations when a document is locked by another user. [More details](https://payloadcms.com/docs/admin/locked-documents).\n * @default true\n */\n overrideLock?: boolean\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * When set to `true`, the operation will permanently delete both normal and trashed documents.\n * By default (`false`), only normal (non-trashed) documents will be permanently deleted.\n *\n * This argument has no effect unless `trash` is enabled on the collection.\n * @default false\n */\n trash?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n} & Pick<FindOptions<TSlug, TSelect>, 'select'> &\n Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type ByIDOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n /**\n * The ID of the document to delete.\n */\n id: number | string\n /**\n * A filter [query](https://payloadcms.com/docs/queries/overview)\n */\n where?: never\n} & BaseOptions<TSlug, TSelect>\n\nexport type ManyOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n /**\n * The ID of the document to delete.\n */\n id?: never\n /**\n * A filter [query](https://payloadcms.com/docs/queries/overview)\n */\n where: Where\n} & BaseOptions<TSlug, TSelect>\n\nexport type Options<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = ByIDOptions<TSlug, TSelect> | ManyOptions<TSlug, TSelect>\n\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ByIDOptions<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ManyOptions<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n disableTransaction,\n overrideAccess = false,\n overrideLock,\n populate,\n select,\n showHiddenFields,\n trash = false,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Delete Operation.`,\n )\n }\n\n const args = {\n id,\n collection,\n depth,\n disableTransaction,\n overrideAccess,\n overrideLock,\n populate,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n select,\n showHiddenFields,\n trash,\n where,\n }\n\n if (options.id) {\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return deleteByIDOperation<TSlug, TSelect>(args)\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return deleteOperation<TSlug, TSelect>(args)\n}\n\nexport { deleteLocal }\n"],"names":["APIError","createPayloadRequest","deleteOperation","deleteByIDOperation","deleteLocal","payload","options","id","collection","collectionSlug","depth","disableTransaction","overrideAccess","overrideLock","populate","select","showHiddenFields","trash","where","collections","String","args","req"],"mappings":"AAmBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,eAAe,QAAQ,eAAc;AAC9C,SAASC,mBAAmB,QAAQ,mBAAkB;AA4HtD,eAAeC,YAIbC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,kBAAkB,EAClBC,iBAAiB,KAAK,EACtBC,YAAY,EACZC,QAAQ,EACRC,MAAM,EACNC,gBAAgB,EAChBC,QAAQ,KAAK,EACbC,KAAK,EACN,GAAGZ;IAEJ,MAAME,aAAaH,QAAQc,WAAW,CAACV,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIR,SACR,CAAC,yBAAyB,EAAEoB,OAAOX,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMY,OAAO;QACXd;QACAC;QACAE;QACAC;QACAC;QACAC;QACAC;QACAQ,KAAK,MAAMrB,qBAAqB;YAC9B,GAAIK,OAAO;YACXD;QACF;QACAU;QACAC;QACAC;QACAC;IACF;IAEA,IAAIZ,QAAQC,EAAE,EAAE;QACd,oFAAoF;QACpF,OAAOJ,oBAAoCkB;IAC7C;IACA,oFAAoF;IACpF,OAAOnB,gBAAgCmB;AACzC;AAEA,SAASjB,WAAW,GAAE"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/delete.ts"],"sourcesContent":["import type {\n CollectionSlug,\n FindOptions,\n Payload,\n RequestContext,\n TypedLocale,\n User,\n} from '../../../index.js'\nimport type {\n PayloadRequest,\n PopulateType,\n SelectType,\n TransformCollectionWithSelect,\n Where,\n} from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type { BulkOperationResult, SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { deleteOperation } from '../delete.js'\nimport { deleteByIDOperation } from '../deleteByID.js'\n\nexport type BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, a [database transactions](https://payloadcms.com/docs/database/transactions) will not be initialized.\n * @default false\n */\n disableTransaction?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: TypedLocale\n /**\n * By default, document locks are ignored (`true`). Set to `false` to enforce locks and prevent operations when a document is locked by another user. [More details](https://payloadcms.com/docs/admin/locked-documents).\n * @default true\n */\n overrideLock?: boolean\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * When set to `true`, the operation will permanently delete both normal and trashed documents.\n * By default (`false`), only normal (non-trashed) documents will be permanently deleted.\n *\n * This argument has no effect unless `trash` is enabled on the collection.\n * @default false\n */\n trash?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n} & Pick<FindOptions<TSlug, TSelect>, 'select'> &\n Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type ByIDOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n /**\n * The ID of the document to delete.\n */\n id: number | string\n /**\n * A filter [query](https://payloadcms.com/docs/queries/overview)\n */\n where?: never\n} & BaseOptions<TSlug, TSelect>\n\nexport type ManyOptions<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = {\n /**\n * The ID of the document to delete.\n */\n id?: never\n /**\n * A filter [query](https://payloadcms.com/docs/queries/overview)\n */\n where: Where\n} & BaseOptions<TSlug, TSelect>\n\nexport type Options<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n> = ByIDOptions<TSlug, TSelect> | ManyOptions<TSlug, TSelect>\n\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ByIDOptions<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: ManyOptions<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>>\nasync function deleteLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<BulkOperationResult<TSlug, TSelect> | TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n disableTransaction,\n overrideAccess = false,\n overrideLock,\n populate,\n select,\n showHiddenFields,\n trash = false,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Delete Operation.`,\n )\n }\n\n const args = {\n id,\n collection,\n depth,\n disableTransaction,\n overrideAccess,\n overrideLock,\n populate,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n select,\n showHiddenFields,\n trash,\n where,\n }\n\n if (options.id) {\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return deleteByIDOperation<TSlug, TSelect>(args)\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return deleteOperation<TSlug, TSelect>(args)\n}\n\nexport { deleteLocal }\n"],"names":["APIError","createPayloadRequest","deleteOperation","deleteByIDOperation","deleteLocal","payload","options","id","collection","collectionSlug","depth","disableTransaction","overrideAccess","overrideLock","populate","select","showHiddenFields","trash","where","collections","String","args","req"],"mappings":"AAmBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,eAAe,QAAQ,eAAc;AAC9C,SAASC,mBAAmB,QAAQ,mBAAkB;AAuHtD,eAAeC,YAIbC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,kBAAkB,EAClBC,iBAAiB,KAAK,EACtBC,YAAY,EACZC,QAAQ,EACRC,MAAM,EACNC,gBAAgB,EAChBC,QAAQ,KAAK,EACbC,KAAK,EACN,GAAGZ;IAEJ,MAAME,aAAaH,QAAQc,WAAW,CAACV,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIR,SACR,CAAC,yBAAyB,EAAEoB,OAAOX,gBAAgB,kCAAkC,CAAC;IAE1F;IAEA,MAAMY,OAAO;QACXd;QACAC;QACAE;QACAC;QACAC;QACAC;QACAC;QACAQ,KAAK,MAAMrB,qBAAqB;YAC9B,GAAIK,OAAO;YACXD;QACF;QACAU;QACAC;QACAC;QACAC;IACF;IAEA,IAAIZ,QAAQC,EAAE,EAAE;QACd,oFAAoF;QACpF,OAAOJ,oBAAoCkB;IAC7C;IACA,oFAAoF;IACpF,OAAOnB,gBAAgCmB;AACzC;AAEA,SAASjB,WAAW,GAAE"}
@@ -5,11 +5,6 @@ import type { PayloadRequest, PopulateType, SelectType, TransformCollectionWithS
5
5
  import type { SharedLocalAPIOptions } from '../../../types/operations.js';
6
6
  import type { DraftFlagFromCollectionSlug, RequiredDataFromCollectionSlug, SelectFromCollectionSlug } from '../../config/types.js';
7
7
  type BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {
8
- /**
9
- * Read and write against a specific content branch instead of resolving one
10
- * from the request. `false` bypasses branching entirely.
11
- */
12
- branch?: false | string;
13
8
  /**
14
9
  * the Collection slug to operate against.
15
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"duplicate.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/duplicate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAA;AACnF,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EACZ,UAAU,EACV,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEzE,OAAO,KAAK,EACV,2BAA2B,EAC3B,8BAA8B,EAC9B,wBAAwB,EACzB,MAAM,uBAAuB,CAAA;AAM9B,KAAK,WAAW,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI;IAC3E;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACvB;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;;;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BAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACnB,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,GAC7C,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAE/C,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI,WAAW,CACzF,KAAK,EACL,OAAO,CACR,GACC,2BAA2B,CAAC,KAAK,CAAC,CAAA;AAEpC,wBAAsB,cAAc,CAClC,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAE/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAiDxD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/duplicate.ts"],"sourcesContent":["import type { DeepPartial } from 'ts-essentials'\n\nimport type { CollectionSlug, TypedLocale } from '../../..//index.js'\nimport type { FindOptions, Payload, RequestContext, User } from '../../../index.js'\nimport type {\n PayloadRequest,\n PopulateType,\n SelectType,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type {\n DraftFlagFromCollectionSlug,\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n} from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { duplicateOperation } from '../duplicate.js'\n\ntype BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n /**\n * Read and write against a specific content branch instead of resolving one\n * from the request. `false` bypasses branching entirely.\n */\n branch?: false | string\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * Override the data for the document to duplicate.\n */\n data?: DeepPartial<RequiredDataFromCollectionSlug<TSlug>>\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, a [database transactions](https://payloadcms.com/docs/database/transactions) will not be initialized.\n * @default false\n */\n disableTransaction?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale\n /**\n * The ID of the document to duplicate from.\n */\n id: number | string\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: TypedLocale\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Specifies which locales to include when duplicating localized fields. Non-localized data is always duplicated.\n * By default, all locales are duplicated.\n */\n selectedLocales?: string[]\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n} & Pick<FindOptions<TSlug, TSelect>, 'select'> &\n Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = BaseOptions<\n TSlug,\n TSelect\n> &\n DraftFlagFromCollectionSlug<TSlug>\n\nexport async function duplicateLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n id,\n collection: collectionSlug,\n data,\n depth,\n disableTransaction,\n draft,\n overrideAccess = false,\n populate,\n select,\n selectedLocales,\n showHiddenFields,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Duplicate Operation.`,\n )\n }\n\n if (collection.config.disableDuplicate === true) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} cannot be duplicated.`,\n 400,\n )\n }\n\n const req = await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n })\n\n return duplicateOperation<TSlug, TSelect>({\n id,\n collection,\n data,\n depth,\n disableTransaction,\n draft,\n overrideAccess,\n populate,\n req,\n select,\n selectedLocales,\n showHiddenFields,\n })\n}\n"],"names":["APIError","createPayloadRequest","duplicateOperation","duplicateLocal","payload","options","id","collection","collectionSlug","data","depth","disableTransaction","draft","overrideAccess","populate","select","selectedLocales","showHiddenFields","collections","String","config","disableDuplicate","req"],"mappings":"AAkBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,kBAAkB,QAAQ,kBAAiB;AA4EpD,OAAO,eAAeC,eAIpBC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,IAAI,EACJC,KAAK,EACLC,kBAAkB,EAClBC,KAAK,EACLC,iBAAiB,KAAK,EACtBC,QAAQ,EACRC,MAAM,EACNC,eAAe,EACfC,gBAAgB,EACjB,GAAGZ;IAEJ,MAAME,aAAaH,QAAQc,WAAW,CAACV,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEmB,OAAOX,gBAAgB,qCAAqC,CAAC;IAE7F;IAEA,IAAID,WAAWa,MAAM,CAACC,gBAAgB,KAAK,MAAM;QAC/C,MAAM,IAAIrB,SACR,CAAC,yBAAyB,EAAEmB,OAAOX,gBAAgB,sBAAsB,CAAC,EAC1E;IAEJ;IAEA,MAAMc,MAAM,MAAMrB,qBAAqB;QACrC,GAAII,OAAO;QACXD;IACF;IAEA,OAAOF,mBAAmC;QACxCI;QACAC;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAQ;QACAP;QACAC;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/duplicate.ts"],"sourcesContent":["import type { DeepPartial } from 'ts-essentials'\n\nimport type { CollectionSlug, TypedLocale } from '../../..//index.js'\nimport type { FindOptions, Payload, RequestContext, User } from '../../../index.js'\nimport type {\n PayloadRequest,\n PopulateType,\n SelectType,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type {\n DraftFlagFromCollectionSlug,\n RequiredDataFromCollectionSlug,\n SelectFromCollectionSlug,\n} from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { duplicateOperation } from '../duplicate.js'\n\ntype BaseOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * Override the data for the document to duplicate.\n */\n data?: DeepPartial<RequiredDataFromCollectionSlug<TSlug>>\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, a [database transactions](https://payloadcms.com/docs/database/transactions) will not be initialized.\n * @default false\n */\n disableTransaction?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale\n /**\n * The ID of the document to duplicate from.\n */\n id: number | string\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: TypedLocale\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Specifies which locales to include when duplicating localized fields. Non-localized data is always duplicated.\n * By default, all locales are duplicated.\n */\n selectedLocales?: string[]\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n} & Pick<FindOptions<TSlug, TSelect>, 'select'> &\n Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = BaseOptions<\n TSlug,\n TSelect\n> &\n DraftFlagFromCollectionSlug<TSlug>\n\nexport async function duplicateLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TSelect>,\n): Promise<TransformCollectionWithSelect<TSlug, TSelect>> {\n const {\n id,\n collection: collectionSlug,\n data,\n depth,\n disableTransaction,\n draft,\n overrideAccess = false,\n populate,\n select,\n selectedLocales,\n showHiddenFields,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Duplicate Operation.`,\n )\n }\n\n if (collection.config.disableDuplicate === true) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} cannot be duplicated.`,\n 400,\n )\n }\n\n const req = await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n })\n\n return duplicateOperation<TSlug, TSelect>({\n id,\n collection,\n data,\n depth,\n disableTransaction,\n draft,\n overrideAccess,\n populate,\n req,\n select,\n selectedLocales,\n showHiddenFields,\n })\n}\n"],"names":["APIError","createPayloadRequest","duplicateOperation","duplicateLocal","payload","options","id","collection","collectionSlug","data","depth","disableTransaction","draft","overrideAccess","populate","select","selectedLocales","showHiddenFields","collections","String","config","disableDuplicate","req"],"mappings":"AAkBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,kBAAkB,QAAQ,kBAAiB;AAuEpD,OAAO,eAAeC,eAIpBC,OAAgB,EAChBC,OAAgC;IAEhC,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,IAAI,EACJC,KAAK,EACLC,kBAAkB,EAClBC,KAAK,EACLC,iBAAiB,KAAK,EACtBC,QAAQ,EACRC,MAAM,EACNC,eAAe,EACfC,gBAAgB,EACjB,GAAGZ;IAEJ,MAAME,aAAaH,QAAQc,WAAW,CAACV,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEmB,OAAOX,gBAAgB,qCAAqC,CAAC;IAE7F;IAEA,IAAID,WAAWa,MAAM,CAACC,gBAAgB,KAAK,MAAM;QAC/C,MAAM,IAAIrB,SACR,CAAC,yBAAyB,EAAEmB,OAAOX,gBAAgB,sBAAsB,CAAC,EAC1E;IAEJ;IAEA,MAAMc,MAAM,MAAMrB,qBAAqB;QACrC,GAAII,OAAO;QACXD;IACF;IAEA,OAAOF,mBAAmC;QACxCI;QACAC;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAQ;QACAP;QACAC;QACAC;IACF;AACF"}
@@ -4,21 +4,16 @@ import type { DraftTransformCollectionWithSelect, PayloadRequest, PopulateType,
4
4
  import type { SharedLocalAPIOptions } from '../../../types/operations.js';
5
5
  import type { DraftFlagFromCollectionSlug, SelectFromCollectionSlug } from '../../config/types.js';
6
6
  type BaseFindOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {
7
+ /**
8
+ * the Collection slug to operate against.
9
+ */
10
+ collection: TSlug;
7
11
  /**
8
12
  * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,
9
13
  * which can be read by hooks. Useful if you want to pass additional information to the hooks which
10
14
  * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook
11
15
  * to determine if it should run or not.
12
16
  */
13
- /**
14
- * Read and write against a specific content branch instead of resolving one
15
- * from the request. `false` bypasses branching entirely.
16
- */
17
- branch?: false | string;
18
- /**
19
- * the Collection slug to operate against.
20
- */
21
- collection: TSlug;
22
17
  context?: RequestContext;
23
18
  /**
24
19
  * The current population depth, used internally for relationships population.
@@ -1 +1 @@
1
- {"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/find.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,OAAO,EACP,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,IAAI,EACL,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,kCAAkC,EAClC,cAAc,EACd,YAAY,EACZ,UAAU,EACV,IAAI,EACJ,6BAA6B,EAC7B,KAAK,EACN,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEzE,OAAO,KAAK,EAAE,2BAA2B,E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;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAEjD,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI,eAAe,CAC7F,KAAK,EACL,OAAO,CACR,GACC,2BAA2B,CAAC,KAAK,CAAC,CAAA;AAGpC,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI,OAAO,CACzF,KAAK,EACL,OAAO,CACR,CAAA;AAED,wBAAsB,SAAS,CAC7B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAC/C,MAAM,SAAS,OAAO,GAAG,KAAK,EAE9B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,GACxD,OAAO,CACR,aAAa,CACX,MAAM,SAAS,IAAI,GACf,YAAY,SAAS;IAAE,gBAAgB,EAAE,IAAI,CAAA;CAAE,GAC7C,kCAAkC,CAAC,KAAK,EAAE,OAAO,CAAC,GAClD,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,GAC/C,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAClD,CACF,CAoDA"}
1
+ {"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/find.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,KAAK,EACV,cAAc,EACd,SAAS,EACT,OAAO,EACP,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,IAAI,EACL,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,kCAAkC,EAClC,cAAc,EACd,YAAY,EACZ,UAAU,EACV,IAAI,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C,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAEjD,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI,eAAe,CAC7F,KAAK,EACL,OAAO,CACR,GACC,2BAA2B,CAAC,KAAK,CAAC,CAAA;AAGpC,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,cAAc,EAAE,OAAO,SAAS,UAAU,IAAI,OAAO,CACzF,KAAK,EACL,OAAO,CACR,CAAA;AAED,wBAAsB,SAAS,CAC7B,KAAK,SAAS,cAAc,EAC5B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAC/C,MAAM,SAAS,OAAO,GAAG,KAAK,EAE9B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,GACxD,OAAO,CACR,aAAa,CACX,MAAM,SAAS,IAAI,GACf,YAAY,SAAS;IAAE,gBAAgB,EAAE,IAAI,CAAA;CAAE,GAC7C,kCAAkC,CAAC,KAAK,EAAE,OAAO,CAAC,GAClD,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,GAC/C,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,CAClD,CACF,CAoDA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/find.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type {\n CollectionSlug,\n JoinQuery,\n Payload,\n PayloadTypes,\n RequestContext,\n TypedFallbackLocale,\n TypedLocale,\n User,\n} from '../../../index.js'\nimport type {\n DraftTransformCollectionWithSelect,\n PayloadRequest,\n PopulateType,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type { DraftFlagFromCollectionSlug, SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { findOperation } from '../find.js'\n\ntype BaseFindOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n /**\n * Read and write against a specific content branch instead of resolving one\n * from the request. `false` bypasses branching entirely.\n */\n branch?: false | string\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n context?: RequestContext\n /**\n * The current population depth, used internally for relationships population.\n * @internal\n */\n currentDepth?: number\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, errors will not be thrown.\n */\n disableErrors?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: TypedFallbackLocale\n /**\n * Include info about the lock status to the result into all documents with fields: `_isLocked` and `_userEditing`\n */\n includeLockStatus?: boolean\n /**\n * The [Join Field Query](https://payloadcms.com/docs/fields/join#query-options).\n * Pass `false` to disable all join fields from the result.\n */\n joins?: JoinQuery<TSlug>\n /**\n * The maximum related documents to be returned.\n * Defaults unless `defaultLimit` is specified for the collection config\n * @default 10\n */\n limit?: number\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: 'all' | TypedLocale\n /**\n * Get a specific page number\n * @default 1\n */\n page?: number\n /**\n * Set to `false` to return all documents and avoid querying for document counts which introduces some overhead.\n * You can also combine that property with a specified `limit` to limit documents but avoid the count query.\n */\n pagination?: boolean\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * By default, Payload's APIs will return all fields for a given collection or global.\n * But you may not need all of that data for all of your queries.\n * Sometimes, you might want just a few fields from the response.\n *\n * With the Select API, you can define exactly which fields you'd like to retrieve.\n * This can impact performance by reducing database load and response size.\n *\n *\n * **Example: Select specific fields**\n * ```ts\n * const post = await payload.findByID({\n * collection: 'posts',\n * id: '1',\n * select: { title: true, content: true },\n * })\n *\n * console.log(post) // { id: '1', title: 'My Post', content: 'This is my post' }\n * ```\n *\n * **Example: Select all fields except `content`**\n *\n * ```ts\n * const post = await payload.findByID({\n * collection: 'posts',\n * id: '1',\n * select: { content: false },\n * })\n *\n * console.log(post) // { id: '1', title: 'My Post', number: 3 }\n * ```\n *\n * **Example: Empty select returns only `id`**\n *\n * ```ts\n * const post = await payload.findByID({\n * collection: 'posts',\n * id: '1',\n * select: {},\n * })\n *\n * console.log(post) // { id: '1' }\n * ```\n *\n * @see https://payloadcms.com/docs/queries/select\n */\n select?: TSelect\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * Sort the documents, can be a string or an array of strings\n * @example '-createdAt' // Sort DESC by createdAt\n * @example ['group', '-createdAt'] // sort by 2 fields, ASC group and DESC createdAt\n */\n sort?: Sort\n /**\n * When set to `true`, the query will include both normal and trashed documents.\n * To query only trashed documents, pass `trash: true` and combine with a `where` clause filtering by `deletedAt`.\n * By default (`false`), the query will only include normal documents and exclude those with a `deletedAt` field.\n *\n * This argument has no effect unless `trash` is enabled on the collection.\n * @default false\n */\n trash?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n /**\n * A filter [query](https://payloadcms.com/docs/queries/overview)\n */\n where?: Where\n} & Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = BaseFindOptions<\n TSlug,\n TSelect\n> &\n DraftFlagFromCollectionSlug<TSlug>\n\n// Backward compatibility export\nexport type FindOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = Options<\n TSlug,\n TSelect\n>\n\nexport async function findLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n TDraft extends boolean = false,\n>(\n payload: Payload,\n options: { draft?: TDraft } & FindOptions<TSlug, TSelect>,\n): Promise<\n PaginatedDocs<\n TDraft extends true\n ? PayloadTypes extends { strictDraftTypes: true }\n ? DraftTransformCollectionWithSelect<TSlug, TSelect>\n : TransformCollectionWithSelect<TSlug, TSelect>\n : TransformCollectionWithSelect<TSlug, TSelect>\n >\n> {\n const {\n collection: collectionSlug,\n currentDepth,\n depth,\n disableErrors,\n draft = false,\n includeLockStatus,\n joins,\n limit,\n overrideAccess = false,\n page,\n pagination = true,\n populate,\n select,\n showHiddenFields,\n sort,\n trash = false,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find Operation.`,\n )\n }\n\n return findOperation<TSlug, TSelect>({\n collection,\n currentDepth,\n depth,\n disableErrors,\n draft,\n includeLockStatus,\n joins,\n limit,\n overrideAccess,\n page,\n pagination,\n populate,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n select,\n showHiddenFields,\n sort,\n trash,\n where,\n })\n}\n"],"names":["APIError","createPayloadRequest","findOperation","findLocal","payload","options","collection","collectionSlug","currentDepth","depth","disableErrors","draft","includeLockStatus","joins","limit","overrideAccess","page","pagination","populate","select","showHiddenFields","sort","trash","where","collections","String","req"],"mappings":"AAwBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,aAAa,QAAQ,aAAY;AAmK1C,OAAO,eAAeC,UAKpBC,OAAgB,EAChBC,OAAyD;IAUzD,MAAM,EACJC,YAAYC,cAAc,EAC1BC,YAAY,EACZC,KAAK,EACLC,aAAa,EACbC,QAAQ,KAAK,EACbC,iBAAiB,EACjBC,KAAK,EACLC,KAAK,EACLC,iBAAiB,KAAK,EACtBC,IAAI,EACJC,aAAa,IAAI,EACjBC,QAAQ,EACRC,MAAM,EACNC,gBAAgB,EAChBC,IAAI,EACJC,QAAQ,KAAK,EACbC,KAAK,EACN,GAAGlB;IAEJ,MAAMC,aAAaF,QAAQoB,WAAW,CAACjB,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEyB,OAAOlB,gBAAgB,gCAAgC,CAAC;IAExF;IAEA,OAAOL,cAA8B;QACnCI;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAQ,KAAK,MAAMzB,qBAAqB;YAC9B,GAAII,OAAO;YACXD;QACF;QACAe;QACAC;QACAC;QACAC;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/find.ts"],"sourcesContent":["import type { PaginatedDocs } from '../../../database/types.js'\nimport type {\n CollectionSlug,\n JoinQuery,\n Payload,\n PayloadTypes,\n RequestContext,\n TypedFallbackLocale,\n TypedLocale,\n User,\n} from '../../../index.js'\nimport type {\n DraftTransformCollectionWithSelect,\n PayloadRequest,\n PopulateType,\n SelectType,\n Sort,\n TransformCollectionWithSelect,\n Where,\n} from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type { DraftFlagFromCollectionSlug, SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { findOperation } from '../find.js'\n\ntype BaseFindOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = {\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * The current population depth, used internally for relationships population.\n * @internal\n */\n currentDepth?: number\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, errors will not be thrown.\n */\n disableErrors?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: TypedFallbackLocale\n /**\n * Include info about the lock status to the result into all documents with fields: `_isLocked` and `_userEditing`\n */\n includeLockStatus?: boolean\n /**\n * The [Join Field Query](https://payloadcms.com/docs/fields/join#query-options).\n * Pass `false` to disable all join fields from the result.\n */\n joins?: JoinQuery<TSlug>\n /**\n * The maximum related documents to be returned.\n * Defaults unless `defaultLimit` is specified for the collection config\n * @default 10\n */\n limit?: number\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: 'all' | TypedLocale\n /**\n * Get a specific page number\n * @default 1\n */\n page?: number\n /**\n * Set to `false` to return all documents and avoid querying for document counts which introduces some overhead.\n * You can also combine that property with a specified `limit` to limit documents but avoid the count query.\n */\n pagination?: boolean\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * By default, Payload's APIs will return all fields for a given collection or global.\n * But you may not need all of that data for all of your queries.\n * Sometimes, you might want just a few fields from the response.\n *\n * With the Select API, you can define exactly which fields you'd like to retrieve.\n * This can impact performance by reducing database load and response size.\n *\n *\n * **Example: Select specific fields**\n * ```ts\n * const post = await payload.findByID({\n * collection: 'posts',\n * id: '1',\n * select: { title: true, content: true },\n * })\n *\n * console.log(post) // { id: '1', title: 'My Post', content: 'This is my post' }\n * ```\n *\n * **Example: Select all fields except `content`**\n *\n * ```ts\n * const post = await payload.findByID({\n * collection: 'posts',\n * id: '1',\n * select: { content: false },\n * })\n *\n * console.log(post) // { id: '1', title: 'My Post', number: 3 }\n * ```\n *\n * **Example: Empty select returns only `id`**\n *\n * ```ts\n * const post = await payload.findByID({\n * collection: 'posts',\n * id: '1',\n * select: {},\n * })\n *\n * console.log(post) // { id: '1' }\n * ```\n *\n * @see https://payloadcms.com/docs/queries/select\n */\n select?: TSelect\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * Sort the documents, can be a string or an array of strings\n * @example '-createdAt' // Sort DESC by createdAt\n * @example ['group', '-createdAt'] // sort by 2 fields, ASC group and DESC createdAt\n */\n sort?: Sort\n /**\n * When set to `true`, the query will include both normal and trashed documents.\n * To query only trashed documents, pass `trash: true` and combine with a `where` clause filtering by `deletedAt`.\n * By default (`false`), the query will only include normal documents and exclude those with a `deletedAt` field.\n *\n * This argument has no effect unless `trash` is enabled on the collection.\n * @default false\n */\n trash?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n /**\n * A filter [query](https://payloadcms.com/docs/queries/overview)\n */\n where?: Where\n} & Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type Options<TSlug extends CollectionSlug, TSelect extends SelectType> = BaseFindOptions<\n TSlug,\n TSelect\n> &\n DraftFlagFromCollectionSlug<TSlug>\n\n// Backward compatibility export\nexport type FindOptions<TSlug extends CollectionSlug, TSelect extends SelectType> = Options<\n TSlug,\n TSelect\n>\n\nexport async function findLocal<\n TSlug extends CollectionSlug,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n TDraft extends boolean = false,\n>(\n payload: Payload,\n options: { draft?: TDraft } & FindOptions<TSlug, TSelect>,\n): Promise<\n PaginatedDocs<\n TDraft extends true\n ? PayloadTypes extends { strictDraftTypes: true }\n ? DraftTransformCollectionWithSelect<TSlug, TSelect>\n : TransformCollectionWithSelect<TSlug, TSelect>\n : TransformCollectionWithSelect<TSlug, TSelect>\n >\n> {\n const {\n collection: collectionSlug,\n currentDepth,\n depth,\n disableErrors,\n draft = false,\n includeLockStatus,\n joins,\n limit,\n overrideAccess = false,\n page,\n pagination = true,\n populate,\n select,\n showHiddenFields,\n sort,\n trash = false,\n where,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find Operation.`,\n )\n }\n\n return findOperation<TSlug, TSelect>({\n collection,\n currentDepth,\n depth,\n disableErrors,\n draft,\n includeLockStatus,\n joins,\n limit,\n overrideAccess,\n page,\n pagination,\n populate,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n select,\n showHiddenFields,\n sort,\n trash,\n where,\n })\n}\n"],"names":["APIError","createPayloadRequest","findOperation","findLocal","payload","options","collection","collectionSlug","currentDepth","depth","disableErrors","draft","includeLockStatus","joins","limit","overrideAccess","page","pagination","populate","select","showHiddenFields","sort","trash","where","collections","String","req"],"mappings":"AAwBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,aAAa,QAAQ,aAAY;AA8J1C,OAAO,eAAeC,UAKpBC,OAAgB,EAChBC,OAAyD;IAUzD,MAAM,EACJC,YAAYC,cAAc,EAC1BC,YAAY,EACZC,KAAK,EACLC,aAAa,EACbC,QAAQ,KAAK,EACbC,iBAAiB,EACjBC,KAAK,EACLC,KAAK,EACLC,iBAAiB,KAAK,EACtBC,IAAI,EACJC,aAAa,IAAI,EACjBC,QAAQ,EACRC,MAAM,EACNC,gBAAgB,EAChBC,IAAI,EACJC,QAAQ,KAAK,EACbC,KAAK,EACN,GAAGlB;IAEJ,MAAMC,aAAaF,QAAQoB,WAAW,CAACjB,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEyB,OAAOlB,gBAAgB,gCAAgC,CAAC;IAExF;IAEA,OAAOL,cAA8B;QACnCI;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAQ,KAAK,MAAMzB,qBAAqB;YAC9B,GAAII,OAAO;YACXD;QACF;QACAe;QACAC;QACAC;QACAC;QACAC;IACF;AACF"}
@@ -4,21 +4,16 @@ import type { SharedLocalAPIOptions } from '../../../types/operations.js';
4
4
  import type { DraftFlagFromCollectionSlug, SelectFromCollectionSlug } from '../../config/types.js';
5
5
  import { type FindByIDArgs } from '../findByID.js';
6
6
  type BaseFindByIDOptions<TSlug extends CollectionSlug, TDisableErrors extends boolean, TSelect extends SelectType> = {
7
+ /**
8
+ * the Collection slug to operate against.
9
+ */
10
+ collection: TSlug;
7
11
  /**
8
12
  * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,
9
13
  * which can be read by hooks. Useful if you want to pass additional information to the hooks which
10
14
  * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook
11
15
  * to determine if it should run or not.
12
16
  */
13
- /**
14
- * Read and write against a specific content branch instead of resolving one
15
- * from the request. `false` bypasses branching entirely.
16
- */
17
- branch?: false | string;
18
- /**
19
- * the Collection slug to operate against.
20
- */
21
- collection: TSlug;
22
17
  context?: RequestContext;
23
18
  /**
24
19
  * The current population depth, used internally for relationships population.
@@ -1 +1 @@
1
- {"version":3,"file":"findByID.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,SAAS,EACT,OAAO,EACP,cAAc,EACd,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,IAAI,EACL,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,YAAY,EACZ,6BAA6B,EAC9B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEzE,OAAO,KAAK,EAAE,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAIlG,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,gBAAgB,CAAA;AAErE,KAAK,mBAAmB,CACtB,KAAK,SAAS,cAAc,EAC5B,cAAc,SAAS,OAAO,EAC9B,OAAO,SAAS,UAAU,IACxB;IACF;;;;;OAKG;IACH;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACvB;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,cAAc,CAAA;IAC9B;;OAEG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAA;IACpC;;OAEG;IACH,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IACnB;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO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;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACnB,GAAG,IAAI,CAAC,YAAY,EAAE,gBAAgB,CAAC,GACtC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,GAC3C,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAE/C,MAAM,MAAM,OAAO,CACjB,KAAK,SAAS,cAAc,EAC5B,cAAc,SAAS,OAAO,EAC9B,OAAO,SAAS,UAAU,IACxB,mBAAmB,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,GAAG,2BAA2B,CAAC,KAAK,CAAC,CAAA;AAE5F,wBAAsB,aAAa,CACjC,KAAK,SAAS,cAAc,EAC5B,cAAc,SAAS,OAAO,EAC9B,OAAO,SAAS,wBAAwB,CAAC,KAAK,CAAC,EAE/C,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,CAAC,GAC/C,OAAO,CAAC,kBAAkB,CAAC,6BAA6B,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC,CAgD5F"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/findByID.ts"],"sourcesContent":["import type {\n CollectionSlug,\n FindOptions,\n JoinQuery,\n Payload,\n RequestContext,\n SelectType,\n TypedFallbackLocale,\n TypedLocale,\n User,\n} from '../../../index.js'\nimport type {\n ApplyDisableErrors,\n PayloadRequest,\n PopulateType,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type { DraftFlagFromCollectionSlug, SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { type FindByIDArgs, findByIDOperation } from '../findByID.js'\n\ntype BaseFindByIDOptions<\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectType,\n> = {\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n /**\n * Read and write against a specific content branch instead of resolving one\n * from the request. `false` bypasses branching entirely.\n */\n branch?: false | string\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n context?: RequestContext\n /**\n * The current population depth, used internally for relationships population.\n * @internal\n */\n currentDepth?: number\n /**\n * You may pass the document data directly which will skip the `db.findOne` database query.\n * This is useful if you want to use this endpoint solely for running hooks and populating data.\n */\n data?: Record<string, unknown>\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, errors will not be thrown.\n * `null` will be returned instead, if the document on this ID was not found.\n */\n disableErrors?: TDisableErrors\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: TypedFallbackLocale\n /**\n * The ID of the document to find.\n */\n id: number | string\n /**\n * Include info about the lock status to the result with fields: `_isLocked` and `_userEditing`\n */\n includeLockStatus?: boolean\n /**\n * The [Join Field Query](https://payloadcms.com/docs/fields/join#query-options).\n * Pass `false` to disable all join fields from the result.\n */\n joins?: JoinQuery<TSlug>\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: 'all' | TypedLocale\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * When set to `true`, the operation will return a document by ID, even if it is trashed (soft-deleted).\n * By default (`false`), the operation will exclude trashed documents.\n * To fetch a trashed document, set `trash: true`.\n *\n * This argument has no effect unless `trash` is enabled on the collection.\n * @default false\n */\n trash?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n} & Pick<FindByIDArgs, 'flattenLocales'> &\n Pick<FindOptions<TSlug, TSelect>, 'select'> &\n Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type Options<\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectType,\n> = BaseFindByIDOptions<TSlug, TDisableErrors, TSelect> & DraftFlagFromCollectionSlug<TSlug>\n\nexport async function findByIDLocal<\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TDisableErrors, TSelect>,\n): Promise<ApplyDisableErrors<TransformCollectionWithSelect<TSlug, TSelect>, TDisableErrors>> {\n const {\n id,\n collection: collectionSlug,\n currentDepth,\n data,\n depth,\n disableErrors = false,\n draft = false,\n flattenLocales,\n includeLockStatus,\n joins,\n overrideAccess = false,\n populate,\n select,\n showHiddenFields,\n trash = false,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find By ID Operation.`,\n )\n }\n\n return findByIDOperation<TSlug, TDisableErrors, TSelect>({\n id,\n collection,\n currentDepth,\n data,\n depth,\n disableErrors,\n draft,\n flattenLocales,\n includeLockStatus,\n joins,\n overrideAccess,\n populate,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n select,\n showHiddenFields,\n trash,\n })\n}\n"],"names":["APIError","createPayloadRequest","findByIDOperation","findByIDLocal","payload","options","id","collection","collectionSlug","currentDepth","data","depth","disableErrors","draft","flattenLocales","includeLockStatus","joins","overrideAccess","populate","select","showHiddenFields","trash","collections","String","req"],"mappings":"AAqBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAA4BC,iBAAiB,QAAQ,iBAAgB;AAoGrE,OAAO,eAAeC,cAKpBC,OAAgB,EAChBC,OAAgD;IAEhD,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,YAAY,EACZC,IAAI,EACJC,KAAK,EACLC,gBAAgB,KAAK,EACrBC,QAAQ,KAAK,EACbC,cAAc,EACdC,iBAAiB,EACjBC,KAAK,EACLC,iBAAiB,KAAK,EACtBC,QAAQ,EACRC,MAAM,EACNC,gBAAgB,EAChBC,QAAQ,KAAK,EACd,GAAGhB;IAEJ,MAAME,aAAaH,QAAQkB,WAAW,CAACd,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEuB,OAAOf,gBAAgB,sCAAsC,CAAC;IAE9F;IAEA,OAAON,kBAAkD;QACvDI;QACAC;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAM,KAAK,MAAMvB,qBAAqB;YAC9B,GAAII,OAAO;YACXD;QACF;QACAe;QACAC;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/findByID.ts"],"sourcesContent":["import type {\n CollectionSlug,\n FindOptions,\n JoinQuery,\n Payload,\n RequestContext,\n SelectType,\n TypedFallbackLocale,\n TypedLocale,\n User,\n} from '../../../index.js'\nimport type {\n ApplyDisableErrors,\n PayloadRequest,\n PopulateType,\n TransformCollectionWithSelect,\n} from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type { DraftFlagFromCollectionSlug, SelectFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { type FindByIDArgs, findByIDOperation } from '../findByID.js'\n\ntype BaseFindByIDOptions<\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectType,\n> = {\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * The current population depth, used internally for relationships population.\n * @internal\n */\n currentDepth?: number\n /**\n * You may pass the document data directly which will skip the `db.findOne` database query.\n * This is useful if you want to use this endpoint solely for running hooks and populating data.\n */\n data?: Record<string, unknown>\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, errors will not be thrown.\n * `null` will be returned instead, if the document on this ID was not found.\n */\n disableErrors?: TDisableErrors\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: TypedFallbackLocale\n /**\n * The ID of the document to find.\n */\n id: number | string\n /**\n * Include info about the lock status to the result with fields: `_isLocked` and `_userEditing`\n */\n includeLockStatus?: boolean\n /**\n * The [Join Field Query](https://payloadcms.com/docs/fields/join#query-options).\n * Pass `false` to disable all join fields from the result.\n */\n joins?: JoinQuery<TSlug>\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: 'all' | TypedLocale\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * When set to `true`, the operation will return a document by ID, even if it is trashed (soft-deleted).\n * By default (`false`), the operation will exclude trashed documents.\n * To fetch a trashed document, set `trash: true`.\n *\n * This argument has no effect unless `trash` is enabled on the collection.\n * @default false\n */\n trash?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n} & Pick<FindByIDArgs, 'flattenLocales'> &\n Pick<FindOptions<TSlug, TSelect>, 'select'> &\n Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type Options<\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectType,\n> = BaseFindByIDOptions<TSlug, TDisableErrors, TSelect> & DraftFlagFromCollectionSlug<TSlug>\n\nexport async function findByIDLocal<\n TSlug extends CollectionSlug,\n TDisableErrors extends boolean,\n TSelect extends SelectFromCollectionSlug<TSlug>,\n>(\n payload: Payload,\n options: Options<TSlug, TDisableErrors, TSelect>,\n): Promise<ApplyDisableErrors<TransformCollectionWithSelect<TSlug, TSelect>, TDisableErrors>> {\n const {\n id,\n collection: collectionSlug,\n currentDepth,\n data,\n depth,\n disableErrors = false,\n draft = false,\n flattenLocales,\n includeLockStatus,\n joins,\n overrideAccess = false,\n populate,\n select,\n showHiddenFields,\n trash = false,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find By ID Operation.`,\n )\n }\n\n return findByIDOperation<TSlug, TDisableErrors, TSelect>({\n id,\n collection,\n currentDepth,\n data,\n depth,\n disableErrors,\n draft,\n flattenLocales,\n includeLockStatus,\n joins,\n overrideAccess,\n populate,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n select,\n showHiddenFields,\n trash,\n })\n}\n"],"names":["APIError","createPayloadRequest","findByIDOperation","findByIDLocal","payload","options","id","collection","collectionSlug","currentDepth","data","depth","disableErrors","draft","flattenLocales","includeLockStatus","joins","overrideAccess","populate","select","showHiddenFields","trash","collections","String","req"],"mappings":"AAqBA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAA4BC,iBAAiB,QAAQ,iBAAgB;AA+FrE,OAAO,eAAeC,cAKpBC,OAAgB,EAChBC,OAAgD;IAEhD,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,YAAY,EACZC,IAAI,EACJC,KAAK,EACLC,gBAAgB,KAAK,EACrBC,QAAQ,KAAK,EACbC,cAAc,EACdC,iBAAiB,EACjBC,KAAK,EACLC,iBAAiB,KAAK,EACtBC,QAAQ,EACRC,MAAM,EACNC,gBAAgB,EAChBC,QAAQ,KAAK,EACd,GAAGhB;IAEJ,MAAME,aAAaH,QAAQkB,WAAW,CAACd,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEuB,OAAOf,gBAAgB,sCAAsC,CAAC;IAE9F;IAEA,OAAON,kBAAkD;QACvDI;QACAC;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAM,KAAK,MAAMvB,qBAAqB;YAC9B,GAAII,OAAO;YACXD;QACF;QACAe;QACAC;QACAC;IACF;AACF"}
@@ -1,11 +1,6 @@
1
1
  import type { CollectionSlug, DataFromCollectionSlug, PaginatedDistinctDocs, Payload, PayloadRequest, PopulateType, RequestContext, Sort, TypedLocale, User, Where } from '../../../index.js';
2
2
  import type { SharedLocalAPIOptions } from '../../../types/operations.js';
3
3
  export type Options<TSlug extends CollectionSlug, TField extends keyof DataFromCollectionSlug<TSlug>> = {
4
- /**
5
- * Read against a specific content branch instead of resolving one from the
6
- * request. `false` bypasses branching entirely.
7
- */
8
- branch?: false | string;
9
4
  /**
10
5
  * the Collection slug to operate against.
11
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"findDistinct.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findDistinct.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,KAAK,EACN,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAMzE,MAAM,MAAM,OAAO,CACjB,KAAK,SAAS,cAAc,EAC5B,MAAM,SAAS,MAAM,sBAAsB,CAAC,KAAK,CAAC,IAChD;IACF;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACvB;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,KAAK,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,MAAM,CAAA;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAA;IACX;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAEjD,wBAAsB,YAAY,CAChC,KAAK,SAAS,cAAc,EAC5B,MAAM,SAAS,MAAM,sBAAsB,CAAC,KAAK,CAAC,GAAG,MAAM,EAE3D,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAC9B,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAyCvF"}
1
+ {"version":3,"file":"findDistinct.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findDistinct.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,qBAAqB,EACrB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,cAAc,EACd,IAAI,EACJ,WAAW,EACX,IAAI,EACJ,KAAK,EACN,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAMzE,MAAM,MAAM,OAAO,CACjB,KAAK,SAAS,cAAc,EAC5B,MAAM,SAAS,MAAM,sBAAsB,CAAC,KAAK,CAAC,IAChD;IACF;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,KAAK,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,GAAG,MAAM,CAAA;IAC7B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,IAAI,CAAA;IACX;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAEjD,wBAAsB,YAAY,CAChC,KAAK,SAAS,cAAc,EAC5B,MAAM,SAAS,MAAM,sBAAsB,CAAC,KAAK,CAAC,GAAG,MAAM,EAE3D,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,GAC9B,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAyCvF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/findDistinct.ts"],"sourcesContent":["import type {\n CollectionSlug,\n DataFromCollectionSlug,\n PaginatedDistinctDocs,\n Payload,\n PayloadRequest,\n PopulateType,\n RequestContext,\n Sort,\n TypedLocale,\n User,\n Where,\n} from '../../../index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\n\nimport { APIError, createPayloadRequest } from '../../../index.js'\nimport { findDistinctOperation } from '../findDistinct.js'\n\nexport type Options<\n TSlug extends CollectionSlug,\n TField extends keyof DataFromCollectionSlug<TSlug>,\n> = {\n /**\n * Read against a specific content branch instead of resolving one from the\n * request. `false` bypasses branching entirely.\n */\n branch?: false | string\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, errors will not be thrown.\n */\n disableErrors?: boolean\n /**\n * The field to get distinct values for\n */\n field: ({} & string) | TField\n /**\n * The maximum distinct field values to be returned.\n * By default the operation returns all the values.\n */\n limit?: number\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: 'all' | TypedLocale\n /**\n * Get a specific page number (if limit is specified)\n * @default 1\n */\n page?: number\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * Sort the documents, can be a string or an array of strings\n * @example '-createdAt' // Sort DESC by createdAt\n * @example ['group', '-createdAt'] // sort by 2 fields, ASC group and DESC createdAt\n */\n sort?: Sort\n /**\n * When set to `true`, the query will include both normal and trashed documents.\n * To query only trashed documents, pass `trash: true` and combine with a `where` clause filtering by `deletedAt`.\n * By default (`false`), the query will only include normal documents and exclude those with a `deletedAt` field.\n *\n * This argument has no effect unless `trash` is enabled on the collection.\n * @default false\n */\n trash?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n /**\n * A filter [query](https://payloadcms.com/docs/queries/overview)\n */\n where?: Where\n} & Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport async function findDistinct<\n TSlug extends CollectionSlug,\n TField extends keyof DataFromCollectionSlug<TSlug> & string,\n>(\n payload: Payload,\n options: Options<TSlug, TField>,\n): Promise<PaginatedDistinctDocs<Record<TField, DataFromCollectionSlug<TSlug>[TField]>>> {\n const {\n collection: collectionSlug,\n depth = 0,\n disableErrors,\n field,\n limit,\n overrideAccess = false,\n page,\n populate,\n showHiddenFields,\n sort,\n trash = false,\n where,\n } = options\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find Operation.`,\n )\n }\n\n return findDistinctOperation({\n collection,\n depth,\n disableErrors,\n field,\n limit,\n overrideAccess,\n page,\n populate,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n showHiddenFields,\n sort,\n trash,\n where,\n }) as Promise<PaginatedDistinctDocs<Record<TField, DataFromCollectionSlug<TSlug>[TField]>>>\n}\n"],"names":["APIError","createPayloadRequest","findDistinctOperation","findDistinct","payload","options","collection","collectionSlug","depth","disableErrors","field","limit","overrideAccess","page","populate","showHiddenFields","sort","trash","where","collections","String","req"],"mappings":"AAgBA,SAASA,QAAQ,EAAEC,oBAAoB,QAAQ,oBAAmB;AAClE,SAASC,qBAAqB,QAAQ,qBAAoB;AAuF1D,OAAO,eAAeC,aAIpBC,OAAgB,EAChBC,OAA+B;IAE/B,MAAM,EACJC,YAAYC,cAAc,EAC1BC,QAAQ,CAAC,EACTC,aAAa,EACbC,KAAK,EACLC,KAAK,EACLC,iBAAiB,KAAK,EACtBC,IAAI,EACJC,QAAQ,EACRC,gBAAgB,EAChBC,IAAI,EACJC,QAAQ,KAAK,EACbC,KAAK,EACN,GAAGb;IACJ,MAAMC,aAAaF,QAAQe,WAAW,CAACZ,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEoB,OAAOb,gBAAgB,gCAAgC,CAAC;IAExF;IAEA,OAAOL,sBAAsB;QAC3BI;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAO,KAAK,MAAMpB,qBAAqB;YAC9B,GAAII,OAAO;YACXD;QACF;QACAW;QACAC;QACAC;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/findDistinct.ts"],"sourcesContent":["import type {\n CollectionSlug,\n DataFromCollectionSlug,\n PaginatedDistinctDocs,\n Payload,\n PayloadRequest,\n PopulateType,\n RequestContext,\n Sort,\n TypedLocale,\n User,\n Where,\n} from '../../../index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\n\nimport { APIError, createPayloadRequest } from '../../../index.js'\nimport { findDistinctOperation } from '../findDistinct.js'\n\nexport type Options<\n TSlug extends CollectionSlug,\n TField extends keyof DataFromCollectionSlug<TSlug>,\n> = {\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, errors will not be thrown.\n */\n disableErrors?: boolean\n /**\n * The field to get distinct values for\n */\n field: ({} & string) | TField\n /**\n * The maximum distinct field values to be returned.\n * By default the operation returns all the values.\n */\n limit?: number\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: 'all' | TypedLocale\n /**\n * Get a specific page number (if limit is specified)\n * @default 1\n */\n page?: number\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * Sort the documents, can be a string or an array of strings\n * @example '-createdAt' // Sort DESC by createdAt\n * @example ['group', '-createdAt'] // sort by 2 fields, ASC group and DESC createdAt\n */\n sort?: Sort\n /**\n * When set to `true`, the query will include both normal and trashed documents.\n * To query only trashed documents, pass `trash: true` and combine with a `where` clause filtering by `deletedAt`.\n * By default (`false`), the query will only include normal documents and exclude those with a `deletedAt` field.\n *\n * This argument has no effect unless `trash` is enabled on the collection.\n * @default false\n */\n trash?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n /**\n * A filter [query](https://payloadcms.com/docs/queries/overview)\n */\n where?: Where\n} & Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport async function findDistinct<\n TSlug extends CollectionSlug,\n TField extends keyof DataFromCollectionSlug<TSlug> & string,\n>(\n payload: Payload,\n options: Options<TSlug, TField>,\n): Promise<PaginatedDistinctDocs<Record<TField, DataFromCollectionSlug<TSlug>[TField]>>> {\n const {\n collection: collectionSlug,\n depth = 0,\n disableErrors,\n field,\n limit,\n overrideAccess = false,\n page,\n populate,\n showHiddenFields,\n sort,\n trash = false,\n where,\n } = options\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(collectionSlug)} can't be found. Find Operation.`,\n )\n }\n\n return findDistinctOperation({\n collection,\n depth,\n disableErrors,\n field,\n limit,\n overrideAccess,\n page,\n populate,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n showHiddenFields,\n sort,\n trash,\n where,\n })\n}\n"],"names":["APIError","createPayloadRequest","findDistinctOperation","findDistinct","payload","options","collection","collectionSlug","depth","disableErrors","field","limit","overrideAccess","page","populate","showHiddenFields","sort","trash","where","collections","String","req"],"mappings":"AAgBA,SAASA,QAAQ,EAAEC,oBAAoB,QAAQ,oBAAmB;AAClE,SAASC,qBAAqB,QAAQ,qBAAoB;AAkF1D,OAAO,eAAeC,aAIpBC,OAAgB,EAChBC,OAA+B;IAE/B,MAAM,EACJC,YAAYC,cAAc,EAC1BC,QAAQ,CAAC,EACTC,aAAa,EACbC,KAAK,EACLC,KAAK,EACLC,iBAAiB,KAAK,EACtBC,IAAI,EACJC,QAAQ,EACRC,gBAAgB,EAChBC,IAAI,EACJC,QAAQ,KAAK,EACbC,KAAK,EACN,GAAGb;IACJ,MAAMC,aAAaF,QAAQe,WAAW,CAACZ,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIN,SACR,CAAC,yBAAyB,EAAEoB,OAAOb,gBAAgB,gCAAgC,CAAC;IAExF;IAEA,OAAOL,sBAAsB;QAC3BI;QACAE;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAO,KAAK,MAAMpB,qBAAqB;YAC9B,GAAII,OAAO;YACXD;QACF;QACAW;QACAC;QACAC;QACAC;IACF;AACF"}
@@ -4,11 +4,6 @@ import type { SharedLocalAPIOptions } from '../../../types/operations.js';
4
4
  import type { TypeWithVersion } from '../../../versions/types.js';
5
5
  import type { DataFromCollectionSlug, DraftFlagFromCollectionSlug } from '../../config/types.js';
6
6
  type BaseOptions<TSlug extends CollectionSlug> = {
7
- /**
8
- * Read against a specific content branch instead of resolving one from the
9
- * request. `false` bypasses branching entirely.
10
- */
11
- branch?: false | string;
12
7
  /**
13
8
  * the Collection slug to operate against.
14
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findVersionByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,OAAO,EACP,cAAc,EACd,WAAW,EACX,IAAI,EACL,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AAMhG,KAAK,WAAW,CAAC,KAAK,SAAS,cAAc,IAAI;IAC/C;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACvB;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IACpC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACnB,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,GAChD,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAE/C,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,IAAI,WAAW,CAAC,KAAK,CAAC,GACpE,2BAA2B,CAAC,KAAK,CAAC,CAAA;AAEpC,wBAAsB,oBAAoB,CAAC,KAAK,SAAS,cAAc,EACrE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,eAAe,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAsCzD"}
1
+ {"version":3,"file":"findVersionByID.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findVersionByID.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,OAAO,EACP,cAAc,EACd,WAAW,EACX,IAAI,EACL,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACvF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AAMhG,KAAK,WAAW,CAAC,KAAK,SAAS,cAAc,IAAI;IAC/C;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IACpC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,WAAW,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,CAAA;IACvB;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IACf;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAA;CACnB,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,GAChD,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAE/C,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,IAAI,WAAW,CAAC,KAAK,CAAC,GACpE,2BAA2B,CAAC,KAAK,CAAC,CAAA;AAEpC,wBAAsB,oBAAoB,CAAC,KAAK,SAAS,cAAc,EACrE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,eAAe,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAsCzD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/local/findVersionByID.ts"],"sourcesContent":["import type {\n CollectionSlug,\n FindOptions,\n Payload,\n RequestContext,\n TypedLocale,\n User,\n} from '../../../index.js'\nimport type { PayloadRequest, PopulateType, SelectType } from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\nimport type { DataFromCollectionSlug, DraftFlagFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { findVersionByIDOperation } from '../findVersionByID.js'\n\ntype BaseOptions<TSlug extends CollectionSlug> = {\n /**\n * Read against a specific content branch instead of resolving one from the\n * request. `false` bypasses branching entirely.\n */\n branch?: false | string\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, errors will not be thrown.\n * `null` will be returned instead, if the document on this ID was not found.\n */\n disableErrors?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale\n /**\n * The ID of the version to find.\n */\n id: string\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: 'all' | TypedLocale\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * When set to `true`, the operation will return a document by ID, even if it is trashed (soft-deleted).\n * By default (`false`), the operation will exclude trashed documents.\n * To fetch a trashed document, set `trash: true`.\n *\n * This argument has no effect unless `trash` is enabled on the collection.\n * @default false\n */\n trash?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n} & Pick<FindOptions<TSlug, SelectType>, 'select'> &\n Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type Options<TSlug extends CollectionSlug> = BaseOptions<TSlug> &\n DraftFlagFromCollectionSlug<TSlug>\n\nexport async function findVersionByIDLocal<TSlug extends CollectionSlug>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<TypeWithVersion<DataFromCollectionSlug<TSlug>>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n disableErrors = false,\n overrideAccess = false,\n populate,\n select,\n showHiddenFields,\n trash = false,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(\n collectionSlug,\n )} can't be found. Find Version By ID Operation.`,\n )\n }\n\n return findVersionByIDOperation({\n id,\n collection,\n depth,\n disableErrors,\n overrideAccess,\n populate,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n select,\n showHiddenFields,\n trash,\n })\n}\n"],"names":["APIError","createPayloadRequest","findVersionByIDOperation","findVersionByIDLocal","payload","options","id","collection","collectionSlug","depth","disableErrors","overrideAccess","populate","select","showHiddenFields","trash","collections","String","req"],"mappings":"AAcA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,wBAAwB,QAAQ,wBAAuB;AAyEhE,OAAO,eAAeC,qBACpBC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,gBAAgB,KAAK,EACrBC,iBAAiB,KAAK,EACtBC,QAAQ,EACRC,MAAM,EACNC,gBAAgB,EAChBC,QAAQ,KAAK,EACd,GAAGV;IAEJ,MAAME,aAAaH,QAAQY,WAAW,CAACR,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEiB,OAC1BT,gBACA,8CAA8C,CAAC;IAErD;IAEA,OAAON,yBAAyB;QAC9BI;QACAC;QACAE;QACAC;QACAC;QACAC;QACAM,KAAK,MAAMjB,qBAAqB;YAC9B,GAAII,OAAO;YACXD;QACF;QACAS;QACAC;QACAC;IACF;AACF"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/local/findVersionByID.ts"],"sourcesContent":["import type {\n CollectionSlug,\n FindOptions,\n Payload,\n RequestContext,\n TypedLocale,\n User,\n} from '../../../index.js'\nimport type { PayloadRequest, PopulateType, SelectType } from '../../../types/index.js'\nimport type { SharedLocalAPIOptions } from '../../../types/operations.js'\nimport type { CreatePayloadRequestArgs } from '../../../utilities/createPayloadRequest.js'\nimport type { TypeWithVersion } from '../../../versions/types.js'\nimport type { DataFromCollectionSlug, DraftFlagFromCollectionSlug } from '../../config/types.js'\n\nimport { APIError } from '../../../errors/index.js'\nimport { createPayloadRequest } from '../../../utilities/createPayloadRequest.js'\nimport { findVersionByIDOperation } from '../findVersionByID.js'\n\ntype BaseOptions<TSlug extends CollectionSlug> = {\n /**\n * the Collection slug to operate against.\n */\n collection: TSlug\n /**\n * [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,\n * which can be read by hooks. Useful if you want to pass additional information to the hooks which\n * shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook\n * to determine if it should run or not.\n */\n context?: RequestContext\n /**\n * [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.\n */\n depth?: number\n /**\n * When set to `true`, errors will not be thrown.\n * `null` will be returned instead, if the document on this ID was not found.\n */\n disableErrors?: boolean\n /**\n * Specify a [fallback locale](https://payloadcms.com/docs/configuration/localization) to use for any returned documents.\n */\n fallbackLocale?: false | TypedLocale\n /**\n * The ID of the version to find.\n */\n id: string\n /**\n * Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.\n */\n locale?: 'all' | TypedLocale\n /**\n * Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.\n */\n populate?: PopulateType\n /**\n * The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.\n * Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.\n */\n req?: Partial<PayloadRequest>\n /**\n * Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.\n * @default false\n */\n showHiddenFields?: boolean\n /**\n * When set to `true`, the operation will return a document by ID, even if it is trashed (soft-deleted).\n * By default (`false`), the operation will exclude trashed documents.\n * To fetch a trashed document, set `trash: true`.\n *\n * This argument has no effect unless `trash` is enabled on the collection.\n * @default false\n */\n trash?: boolean\n /**\n * If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.\n */\n user?: null | User\n} & Pick<FindOptions<TSlug, SelectType>, 'select'> &\n Pick<SharedLocalAPIOptions, 'overrideAccess'>\n\nexport type Options<TSlug extends CollectionSlug> = BaseOptions<TSlug> &\n DraftFlagFromCollectionSlug<TSlug>\n\nexport async function findVersionByIDLocal<TSlug extends CollectionSlug>(\n payload: Payload,\n options: Options<TSlug>,\n): Promise<TypeWithVersion<DataFromCollectionSlug<TSlug>>> {\n const {\n id,\n collection: collectionSlug,\n depth,\n disableErrors = false,\n overrideAccess = false,\n populate,\n select,\n showHiddenFields,\n trash = false,\n } = options\n\n const collection = payload.collections[collectionSlug]\n\n if (!collection) {\n throw new APIError(\n `The collection with slug ${String(\n collectionSlug,\n )} can't be found. Find Version By ID Operation.`,\n )\n }\n\n return findVersionByIDOperation({\n id,\n collection,\n depth,\n disableErrors,\n overrideAccess,\n populate,\n req: await createPayloadRequest({\n ...(options as Omit<CreatePayloadRequestArgs, 'payload'>),\n payload,\n }),\n select,\n showHiddenFields,\n trash,\n })\n}\n"],"names":["APIError","createPayloadRequest","findVersionByIDOperation","findVersionByIDLocal","payload","options","id","collection","collectionSlug","depth","disableErrors","overrideAccess","populate","select","showHiddenFields","trash","collections","String","req"],"mappings":"AAcA,SAASA,QAAQ,QAAQ,2BAA0B;AACnD,SAASC,oBAAoB,QAAQ,6CAA4C;AACjF,SAASC,wBAAwB,QAAQ,wBAAuB;AAoEhE,OAAO,eAAeC,qBACpBC,OAAgB,EAChBC,OAAuB;IAEvB,MAAM,EACJC,EAAE,EACFC,YAAYC,cAAc,EAC1BC,KAAK,EACLC,gBAAgB,KAAK,EACrBC,iBAAiB,KAAK,EACtBC,QAAQ,EACRC,MAAM,EACNC,gBAAgB,EAChBC,QAAQ,KAAK,EACd,GAAGV;IAEJ,MAAME,aAAaH,QAAQY,WAAW,CAACR,eAAe;IAEtD,IAAI,CAACD,YAAY;QACf,MAAM,IAAIP,SACR,CAAC,yBAAyB,EAAEiB,OAC1BT,gBACA,8CAA8C,CAAC;IAErD;IAEA,OAAON,yBAAyB;QAC9BI;QACAC;QACAE;QACAC;QACAC;QACAC;QACAM,KAAK,MAAMjB,qBAAqB;YAC9B,GAAII,OAAO;YACXD;QACF;QACAS;QACAC;QACAC;IACF;AACF"}
@@ -5,11 +5,6 @@ import type { SharedLocalAPIOptions } from '../../../types/operations.js';
5
5
  import type { TypeWithVersion } from '../../../versions/types.js';
6
6
  import type { DataFromCollectionSlug, DraftFlagFromCollectionSlug } from '../../config/types.js';
7
7
  type BaseOptions<TSlug extends CollectionSlug> = {
8
- /**
9
- * Read version history as seen from this branch. `false` bypasses branching
10
- * entirely.
11
- */
12
- branch?: false | string;
13
8
  /**
14
9
  * the Collection slug to operate against.
15
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,OAAO,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CAAC,EAAE,KAAK,CAAA;CACd,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,QAAQ,CAAC,GAChD,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAA;AAE/C,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,cAAc,IAAI,WAAW,CAAC,KAAK,CAAC,GACpE,2BAA2B,CAAC,KAAK,CAAC,CAAA;AAEpC,wBAAsB,iBAAiB,CAAC,KAAK,SAAS,cAAc,EAClE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACtB,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CA0CxE"}
1
+ {"version":3,"file":"findVersions.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/local/findVersions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,OAAO,EACP,cAAc,EACd,WAAW,EACX,IAAI,EACL,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAA;AACpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEzE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AAMhG,KAAK,WAAW,CAAC,KAAK,SAAS,cAAc,IAAI;IAC/C;;OAEG;IACH,UAAU,EAAE,KAAK,CAAA;IACjB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;O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