payload 4.0.0-internal.c2b57ce → 4.0.0-internal.c3ac604

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 (961) hide show
  1. package/LICENSE.md +1 -1
  2. package/bin.js +11 -0
  3. package/dist/__testing__/predefinedMigration.d.ts +4 -3
  4. package/dist/__testing__/predefinedMigration.d.ts.map +1 -1
  5. package/dist/admin/RichText.d.ts +3 -11
  6. package/dist/admin/RichText.d.ts.map +1 -1
  7. package/dist/admin/RichText.js.map +1 -1
  8. package/dist/admin/adapters/devReload.d.ts +9 -0
  9. package/dist/admin/adapters/devReload.d.ts.map +1 -0
  10. package/dist/admin/adapters/devReload.js +6 -0
  11. package/dist/admin/adapters/devReload.js.map +1 -0
  12. package/dist/admin/adapters/index.d.ts +3 -0
  13. package/dist/admin/adapters/index.d.ts.map +1 -1
  14. package/dist/admin/adapters/index.js.map +1 -1
  15. package/dist/admin/adapters/render.d.ts +16 -0
  16. package/dist/admin/adapters/render.d.ts.map +1 -0
  17. package/dist/admin/adapters/render.js +7 -0
  18. package/dist/admin/adapters/render.js.map +1 -0
  19. package/dist/admin/adapters/router.d.ts +8 -0
  20. package/dist/admin/adapters/router.d.ts.map +1 -1
  21. package/dist/admin/adapters/router.js.map +1 -1
  22. package/dist/admin/adapters/views.d.ts +36 -0
  23. package/dist/admin/adapters/views.d.ts.map +1 -0
  24. package/dist/admin/adapters/views.js +7 -0
  25. package/dist/admin/adapters/views.js.map +1 -0
  26. package/dist/admin/fields/Row.d.ts +2 -2
  27. package/dist/admin/fields/Row.d.ts.map +1 -1
  28. package/dist/admin/fields/Row.js.map +1 -1
  29. package/dist/admin/forms/Description.d.ts +2 -2
  30. package/dist/admin/forms/Description.d.ts.map +1 -1
  31. package/dist/admin/forms/Description.js.map +1 -1
  32. package/dist/admin/forms/Field.d.ts +10 -5
  33. package/dist/admin/forms/Field.d.ts.map +1 -1
  34. package/dist/admin/forms/Field.js.map +1 -1
  35. package/dist/admin/functions/index.d.ts +13 -2
  36. package/dist/admin/functions/index.d.ts.map +1 -1
  37. package/dist/admin/functions/index.js.map +1 -1
  38. package/dist/admin/types.d.ts +3 -2
  39. package/dist/admin/types.d.ts.map +1 -1
  40. package/dist/admin/types.js.map +1 -1
  41. package/dist/admin/views/dashboard.d.ts +7 -0
  42. package/dist/admin/views/dashboard.d.ts.map +1 -1
  43. package/dist/admin/views/dashboard.js.map +1 -1
  44. package/dist/admin/views/document.d.ts +5 -3
  45. package/dist/admin/views/document.d.ts.map +1 -1
  46. package/dist/admin/views/document.js.map +1 -1
  47. package/dist/admin/views/list.d.ts +10 -1
  48. package/dist/admin/views/list.d.ts.map +1 -1
  49. package/dist/admin/views/list.js.map +1 -1
  50. package/dist/auth/baseFields/apiKey.d.ts +10 -2
  51. package/dist/auth/baseFields/apiKey.d.ts.map +1 -1
  52. package/dist/auth/baseFields/apiKey.js +35 -24
  53. package/dist/auth/baseFields/apiKey.js.map +1 -1
  54. package/dist/auth/cookies.d.ts +2 -2
  55. package/dist/auth/cookies.d.ts.map +1 -1
  56. package/dist/auth/defaultAccess.d.ts +1 -1
  57. package/dist/auth/defaultAccess.d.ts.map +1 -1
  58. package/dist/auth/defaultAccess.js +1 -1
  59. package/dist/auth/defaultAccess.js.map +1 -1
  60. package/dist/auth/defaultUser.d.ts.map +1 -1
  61. package/dist/auth/defaultUser.js +2 -1
  62. package/dist/auth/defaultUser.js.map +1 -1
  63. package/dist/auth/endpoints/login.d.ts.map +1 -1
  64. package/dist/auth/endpoints/login.js +2 -11
  65. package/dist/auth/endpoints/login.js.map +1 -1
  66. package/dist/auth/ensureUsernameOrEmail.d.ts.map +1 -1
  67. package/dist/auth/executeAccess.d.ts.map +1 -1
  68. package/dist/auth/executeAuthStrategies.d.ts.map +1 -1
  69. package/dist/auth/extractAccessFromPermission.d.ts.map +1 -1
  70. package/dist/auth/extractJWT.d.ts +1 -1
  71. package/dist/auth/extractJWT.d.ts.map +1 -1
  72. package/dist/auth/getAuthFields.d.ts.map +1 -1
  73. package/dist/auth/getAuthFields.js +2 -2
  74. package/dist/auth/getAuthFields.js.map +1 -1
  75. package/dist/auth/getFieldsToSign.d.ts +1 -1
  76. package/dist/auth/getFieldsToSign.d.ts.map +1 -1
  77. package/dist/auth/getLoginOptions.d.ts +1 -1
  78. package/dist/auth/getLoginOptions.d.ts.map +1 -1
  79. package/dist/auth/isUserLocked.d.ts.map +1 -1
  80. package/dist/auth/jwt.d.ts.map +1 -1
  81. package/dist/auth/loginWithCookie.d.ts +33 -0
  82. package/dist/auth/loginWithCookie.d.ts.map +1 -0
  83. package/dist/auth/loginWithCookie.js +34 -0
  84. package/dist/auth/loginWithCookie.js.map +1 -0
  85. package/dist/auth/operations/access.d.ts.map +1 -1
  86. package/dist/auth/operations/auth.d.ts +2 -2
  87. package/dist/auth/operations/auth.d.ts.map +1 -1
  88. package/dist/auth/operations/auth.js.map +1 -1
  89. package/dist/auth/operations/forgotPassword.d.ts.map +1 -1
  90. package/dist/auth/operations/init.d.ts.map +1 -1
  91. package/dist/auth/operations/local/auth.d.ts.map +1 -1
  92. package/dist/auth/operations/login.d.ts +2 -1
  93. package/dist/auth/operations/login.d.ts.map +1 -1
  94. package/dist/auth/operations/login.js.map +1 -1
  95. package/dist/auth/operations/logout.d.ts.map +1 -1
  96. package/dist/auth/operations/me.d.ts +2 -2
  97. package/dist/auth/operations/me.d.ts.map +1 -1
  98. package/dist/auth/operations/me.js.map +1 -1
  99. package/dist/auth/operations/refresh.d.ts.map +1 -1
  100. package/dist/auth/operations/refresh.js +9 -3
  101. package/dist/auth/operations/refresh.js.map +1 -1
  102. package/dist/auth/operations/registerFirstUser.d.ts.map +1 -1
  103. package/dist/auth/operations/resetPassword.d.ts.map +1 -1
  104. package/dist/auth/operations/resetPassword.js.map +1 -1
  105. package/dist/auth/operations/unlock.d.ts.map +1 -1
  106. package/dist/auth/operations/verifyEmail.d.ts.map +1 -1
  107. package/dist/auth/sendVerificationEmail.d.ts +2 -2
  108. package/dist/auth/sendVerificationEmail.d.ts.map +1 -1
  109. package/dist/auth/sendVerificationEmail.js +1 -1
  110. package/dist/auth/sendVerificationEmail.js.map +1 -1
  111. package/dist/auth/serverFunctions/cookies.d.ts +47 -0
  112. package/dist/auth/serverFunctions/cookies.d.ts.map +1 -0
  113. package/dist/auth/serverFunctions/cookies.js +52 -0
  114. package/dist/auth/serverFunctions/cookies.js.map +1 -0
  115. package/dist/auth/serverFunctions/login.d.ts +29 -0
  116. package/dist/auth/serverFunctions/login.d.ts.map +1 -0
  117. package/dist/auth/serverFunctions/login.js +63 -0
  118. package/dist/auth/serverFunctions/login.js.map +1 -0
  119. package/dist/auth/serverFunctions/logout.d.ts +17 -0
  120. package/dist/auth/serverFunctions/logout.d.ts.map +1 -0
  121. package/dist/auth/serverFunctions/logout.js +58 -0
  122. package/dist/auth/serverFunctions/logout.js.map +1 -0
  123. package/dist/auth/serverFunctions/refresh.d.ts +17 -0
  124. package/dist/auth/serverFunctions/refresh.d.ts.map +1 -0
  125. package/dist/auth/serverFunctions/refresh.js +61 -0
  126. package/dist/auth/serverFunctions/refresh.js.map +1 -0
  127. package/dist/auth/sessions.d.ts +4 -5
  128. package/dist/auth/sessions.d.ts.map +1 -1
  129. package/dist/auth/sessions.js +5 -3
  130. package/dist/auth/sessions.js.map +1 -1
  131. package/dist/auth/strategies/apiKey.d.ts.map +1 -1
  132. package/dist/auth/strategies/apiKey.js.map +1 -1
  133. package/dist/auth/strategies/local/authenticate.d.ts.map +1 -1
  134. package/dist/auth/strategies/local/generatePasswordSaltHash.d.ts.map +1 -1
  135. package/dist/auth/strategies/local/incrementLoginAttempts.d.ts +2 -2
  136. package/dist/auth/strategies/local/incrementLoginAttempts.d.ts.map +1 -1
  137. package/dist/auth/strategies/local/incrementLoginAttempts.js +1 -1
  138. package/dist/auth/strategies/local/incrementLoginAttempts.js.map +1 -1
  139. package/dist/auth/strategies/local/register.d.ts.map +1 -1
  140. package/dist/auth/strategies/local/resetLoginAttempts.d.ts.map +1 -1
  141. package/dist/auth/types.d.ts +25 -21
  142. package/dist/auth/types.d.ts.map +1 -1
  143. package/dist/auth/types.js.map +1 -1
  144. package/dist/bin/build.d.ts +49 -0
  145. package/dist/bin/build.d.ts.map +1 -0
  146. package/dist/bin/build.js +226 -0
  147. package/dist/bin/build.js.map +1 -0
  148. package/dist/bin/build.spec.js +594 -0
  149. package/dist/bin/build.spec.js.map +1 -0
  150. package/dist/bin/frameworkConventions.d.ts +8 -0
  151. package/dist/bin/frameworkConventions.d.ts.map +1 -0
  152. package/dist/bin/frameworkConventions.js +8 -0
  153. package/dist/bin/frameworkConventions.js.map +1 -0
  154. package/dist/bin/generateImportMap/index.d.ts.map +1 -1
  155. package/dist/bin/generateImportMap/index.js +8 -5
  156. package/dist/bin/generateImportMap/index.js.map +1 -1
  157. package/dist/bin/generateImportMap/iterateCollections.d.ts.map +1 -1
  158. package/dist/bin/generateImportMap/iterateCollections.js +11 -0
  159. package/dist/bin/generateImportMap/iterateCollections.js.map +1 -1
  160. package/dist/bin/generateImportMap/iterateConfig.d.ts.map +1 -1
  161. package/dist/bin/generateImportMap/iterateConfig.js +12 -0
  162. package/dist/bin/generateImportMap/iterateConfig.js.map +1 -1
  163. package/dist/bin/generateImportMap/iterateFields.d.ts.map +1 -1
  164. package/dist/bin/generateImportMap/iterateFields.js +4 -1
  165. package/dist/bin/generateImportMap/iterateFields.js.map +1 -1
  166. package/dist/bin/generateImportMap/utilities/getFromImportMap.d.ts.map +1 -1
  167. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts +5 -1
  168. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts.map +1 -1
  169. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js +33 -18
  170. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js.map +1 -1
  171. package/dist/bin/generateTypes.d.ts +3 -2
  172. package/dist/bin/generateTypes.d.ts.map +1 -1
  173. package/dist/bin/generateTypes.js +11 -1
  174. package/dist/bin/generateTypes.js.map +1 -1
  175. package/dist/bin/index.d.ts.map +1 -1
  176. package/dist/bin/index.js +9 -0
  177. package/dist/bin/index.js.map +1 -1
  178. package/dist/bin/loadEnv.d.ts +3 -1
  179. package/dist/bin/loadEnv.d.ts.map +1 -1
  180. package/dist/bin/loadEnv.js +40 -10
  181. package/dist/bin/loadEnv.js.map +1 -1
  182. package/dist/bin/migrate.d.ts.map +1 -1
  183. package/dist/collections/config/client.d.ts +10 -4
  184. package/dist/collections/config/client.d.ts.map +1 -1
  185. package/dist/collections/config/client.js +7 -1
  186. package/dist/collections/config/client.js.map +1 -1
  187. package/dist/collections/config/defaults.d.ts +0 -4
  188. package/dist/collections/config/defaults.d.ts.map +1 -1
  189. package/dist/collections/config/defaults.js +3 -17
  190. package/dist/collections/config/defaults.js.map +1 -1
  191. package/dist/collections/config/defaults.spec.js +47 -0
  192. package/dist/collections/config/defaults.spec.js.map +1 -0
  193. package/dist/collections/config/sanitize.d.ts.map +1 -1
  194. package/dist/collections/config/sanitize.js +1 -11
  195. package/dist/collections/config/sanitize.js.map +1 -1
  196. package/dist/collections/config/sanitizeCompoundIndexes.d.ts.map +1 -1
  197. package/dist/collections/config/types.d.ts +14 -10
  198. package/dist/collections/config/types.d.ts.map +1 -1
  199. package/dist/collections/config/types.js.map +1 -1
  200. package/dist/collections/config/useAsTitle.d.ts.map +1 -1
  201. package/dist/collections/dataloader.d.ts +1 -1
  202. package/dist/collections/dataloader.d.ts.map +1 -1
  203. package/dist/collections/endpoints/create.d.ts.map +1 -1
  204. package/dist/collections/endpoints/create.js +0 -2
  205. package/dist/collections/endpoints/create.js.map +1 -1
  206. package/dist/collections/endpoints/updateByID.d.ts.map +1 -1
  207. package/dist/collections/endpoints/updateByID.js +1 -2
  208. package/dist/collections/endpoints/updateByID.js.map +1 -1
  209. package/dist/collections/operations/count.d.ts.map +1 -1
  210. package/dist/collections/operations/count.js +1 -0
  211. package/dist/collections/operations/count.js.map +1 -1
  212. package/dist/collections/operations/countVersions.d.ts.map +1 -1
  213. package/dist/collections/operations/create.d.ts +0 -1
  214. package/dist/collections/operations/create.d.ts.map +1 -1
  215. package/dist/collections/operations/create.js +25 -6
  216. package/dist/collections/operations/create.js.map +1 -1
  217. package/dist/collections/operations/delete.d.ts.map +1 -1
  218. package/dist/collections/operations/delete.js +3 -0
  219. package/dist/collections/operations/delete.js.map +1 -1
  220. package/dist/collections/operations/deleteByID.d.ts.map +1 -1
  221. package/dist/collections/operations/duplicate.d.ts.map +1 -1
  222. package/dist/collections/operations/find.d.ts.map +1 -1
  223. package/dist/collections/operations/findByID.d.ts.map +1 -1
  224. package/dist/collections/operations/findDistinct.d.ts.map +1 -1
  225. package/dist/collections/operations/findDistinct.js +1 -0
  226. package/dist/collections/operations/findDistinct.js.map +1 -1
  227. package/dist/collections/operations/findVersionByID.d.ts.map +1 -1
  228. package/dist/collections/operations/findVersions.d.ts.map +1 -1
  229. package/dist/collections/operations/local/count.d.ts +3 -3
  230. package/dist/collections/operations/local/count.d.ts.map +1 -1
  231. package/dist/collections/operations/local/count.js.map +1 -1
  232. package/dist/collections/operations/local/countVersions.d.ts +3 -3
  233. package/dist/collections/operations/local/countVersions.d.ts.map +1 -1
  234. package/dist/collections/operations/local/countVersions.js.map +1 -1
  235. package/dist/collections/operations/local/create.d.ts +3 -3
  236. package/dist/collections/operations/local/create.d.ts.map +1 -1
  237. package/dist/collections/operations/local/create.js.map +1 -1
  238. package/dist/collections/operations/local/delete.d.ts +3 -3
  239. package/dist/collections/operations/local/delete.d.ts.map +1 -1
  240. package/dist/collections/operations/local/delete.js.map +1 -1
  241. package/dist/collections/operations/local/duplicate.d.ts +3 -3
  242. package/dist/collections/operations/local/duplicate.d.ts.map +1 -1
  243. package/dist/collections/operations/local/duplicate.js.map +1 -1
  244. package/dist/collections/operations/local/find.d.ts +3 -3
  245. package/dist/collections/operations/local/find.d.ts.map +1 -1
  246. package/dist/collections/operations/local/find.js.map +1 -1
  247. package/dist/collections/operations/local/findByID.d.ts +3 -3
  248. package/dist/collections/operations/local/findByID.d.ts.map +1 -1
  249. package/dist/collections/operations/local/findByID.js.map +1 -1
  250. package/dist/collections/operations/local/findDistinct.d.ts +2 -2
  251. package/dist/collections/operations/local/findDistinct.d.ts.map +1 -1
  252. package/dist/collections/operations/local/findDistinct.js.map +1 -1
  253. package/dist/collections/operations/local/findVersionByID.d.ts +3 -3
  254. package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
  255. package/dist/collections/operations/local/findVersionByID.js.map +1 -1
  256. package/dist/collections/operations/local/findVersions.d.ts +3 -3
  257. package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
  258. package/dist/collections/operations/local/findVersions.js.map +1 -1
  259. package/dist/collections/operations/local/restoreVersion.d.ts +3 -3
  260. package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
  261. package/dist/collections/operations/local/restoreVersion.js.map +1 -1
  262. package/dist/collections/operations/local/update.d.ts +7 -11
  263. package/dist/collections/operations/local/update.d.ts.map +1 -1
  264. package/dist/collections/operations/local/update.js +1 -2
  265. package/dist/collections/operations/local/update.js.map +1 -1
  266. package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
  267. package/dist/collections/operations/restoreVersion.js +7 -4
  268. package/dist/collections/operations/restoreVersion.js.map +1 -1
  269. package/dist/collections/operations/update.d.ts +0 -1
  270. package/dist/collections/operations/update.d.ts.map +1 -1
  271. package/dist/collections/operations/update.js +8 -4
  272. package/dist/collections/operations/update.js.map +1 -1
  273. package/dist/collections/operations/updateByID.d.ts +0 -1
  274. package/dist/collections/operations/updateByID.d.ts.map +1 -1
  275. package/dist/collections/operations/updateByID.js +2 -5
  276. package/dist/collections/operations/updateByID.js.map +1 -1
  277. package/dist/collections/operations/utilities/buildAfterOperation.d.ts +1 -1
  278. package/dist/collections/operations/utilities/buildAfterOperation.d.ts.map +1 -1
  279. package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.d.ts +9 -0
  280. package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.d.ts.map +1 -0
  281. package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.js +170 -0
  282. package/dist/collections/operations/utilities/copyDataWithFreshRowIDs.js.map +1 -0
  283. package/dist/collections/operations/utilities/sanitizeSortQuery.d.ts.map +1 -1
  284. package/dist/collections/operations/utilities/types.d.ts +20 -29
  285. package/dist/collections/operations/utilities/types.d.ts.map +1 -1
  286. package/dist/collections/operations/utilities/types.js.map +1 -1
  287. package/dist/collections/operations/utilities/update.d.ts +1 -2
  288. package/dist/collections/operations/utilities/update.d.ts.map +1 -1
  289. package/dist/collections/operations/utilities/update.js +64 -65
  290. package/dist/collections/operations/utilities/update.js.map +1 -1
  291. package/dist/config/client.d.ts +2 -2
  292. package/dist/config/client.d.ts.map +1 -1
  293. package/dist/config/client.js.map +1 -1
  294. package/dist/config/defaults.d.ts +0 -4
  295. package/dist/config/defaults.d.ts.map +1 -1
  296. package/dist/config/defaults.js +5 -80
  297. package/dist/config/defaults.js.map +1 -1
  298. package/dist/config/definePlugin.d.ts +10 -10
  299. package/dist/config/definePlugin.d.ts.map +1 -1
  300. package/dist/config/definePlugin.js +7 -11
  301. package/dist/config/definePlugin.js.map +1 -1
  302. package/dist/config/orderable/fractional-indexing.d.ts +23 -23
  303. package/dist/config/orderable/fractional-indexing.d.ts.map +1 -1
  304. package/dist/config/orderable/index.d.ts.map +1 -1
  305. package/dist/config/orderable/index.js +23 -0
  306. package/dist/config/orderable/index.js.map +1 -1
  307. package/dist/config/sanitize.d.ts.map +1 -1
  308. package/dist/config/sanitize.js +149 -15
  309. package/dist/config/sanitize.js.map +1 -1
  310. package/dist/config/types.d.ts +68 -21
  311. package/dist/config/types.d.ts.map +1 -1
  312. package/dist/config/types.js +2 -0
  313. package/dist/config/types.js.map +1 -1
  314. package/dist/database/combineQueries.d.ts.map +1 -1
  315. package/dist/database/createDatabaseAdapter.d.ts +1 -1
  316. package/dist/database/createDatabaseAdapter.d.ts.map +1 -1
  317. package/dist/database/createDatabaseAdapter.js +0 -2
  318. package/dist/database/createDatabaseAdapter.js.map +1 -1
  319. package/dist/database/getLocalizedPaths.d.ts.map +1 -1
  320. package/dist/database/getLocalizedPaths.js +1 -1
  321. package/dist/database/getLocalizedPaths.js.map +1 -1
  322. package/dist/database/migrations/findMigrationDir.d.ts.map +1 -1
  323. package/dist/database/migrations/getPredefinedMigration.d.ts.map +1 -1
  324. package/dist/database/migrations/migrationsCollection.d.ts.map +1 -1
  325. package/dist/database/migrations/migrationsCollection.js +2 -1
  326. package/dist/database/migrations/migrationsCollection.js.map +1 -1
  327. package/dist/database/migrations/readMigrationFiles.d.ts.map +1 -1
  328. package/dist/database/migrations/writeMigrationIndex.d.ts.map +1 -1
  329. package/dist/database/sanitizeJoinQuery.d.ts.map +1 -1
  330. package/dist/database/sanitizeWhereQuery.d.ts.map +1 -1
  331. package/dist/database/types.d.ts +7 -5
  332. package/dist/database/types.d.ts.map +1 -1
  333. package/dist/database/types.js.map +1 -1
  334. package/dist/duplicateDocument/index.d.ts.map +1 -1
  335. package/dist/email/getStringifiedToAddress.d.ts.map +1 -1
  336. package/dist/errors/APIError.d.ts.map +1 -1
  337. package/dist/errors/AuthenticationError.d.ts.map +1 -1
  338. package/dist/errors/DuplicateCollection.d.ts.map +1 -1
  339. package/dist/errors/DuplicateFieldName.d.ts.map +1 -1
  340. package/dist/errors/DuplicateGlobal.d.ts.map +1 -1
  341. package/dist/errors/ErrorDeletingFile.d.ts.map +1 -1
  342. package/dist/errors/FileRetrievalError.d.ts.map +1 -1
  343. package/dist/errors/FileUploadError.d.ts.map +1 -1
  344. package/dist/errors/Forbidden.d.ts.map +1 -1
  345. package/dist/errors/InvalidConfiguration.d.ts.map +1 -1
  346. package/dist/errors/InvalidFieldJoin.d.ts.map +1 -1
  347. package/dist/errors/InvalidFieldName.d.ts.map +1 -1
  348. package/dist/errors/InvalidFieldRelationship.d.ts.map +1 -1
  349. package/dist/errors/InvalidSchema.d.ts.map +1 -1
  350. package/dist/errors/Locked.d.ts.map +1 -1
  351. package/dist/errors/LockedAuth.d.ts.map +1 -1
  352. package/dist/errors/MissingCollectionLabel.d.ts.map +1 -1
  353. package/dist/errors/MissingEditorProp.d.ts.map +1 -1
  354. package/dist/errors/MissingFieldInputOptions.d.ts.map +1 -1
  355. package/dist/errors/MissingFieldType.d.ts.map +1 -1
  356. package/dist/errors/MissingFile.d.ts.map +1 -1
  357. package/dist/errors/NotFound.d.ts.map +1 -1
  358. package/dist/errors/QueryError.d.ts.map +1 -1
  359. package/dist/errors/ReservedFieldName.d.ts.map +1 -1
  360. package/dist/errors/TimestampsRequired.d.ts.map +1 -1
  361. package/dist/errors/UnauthorizedError.d.ts.map +1 -1
  362. package/dist/errors/UnverifiedEmail.d.ts.map +1 -1
  363. package/dist/errors/ValidationError.d.ts +1 -0
  364. package/dist/errors/ValidationError.d.ts.map +1 -1
  365. package/dist/errors/ValidationError.js.map +1 -1
  366. package/dist/exports/auth.d.ts +5 -0
  367. package/dist/exports/auth.d.ts.map +1 -0
  368. package/dist/exports/auth.js +6 -0
  369. package/dist/exports/auth.js.map +1 -0
  370. package/dist/exports/internal.d.ts +4 -0
  371. package/dist/exports/internal.d.ts.map +1 -1
  372. package/dist/exports/internal.js +5 -1
  373. package/dist/exports/internal.js.map +1 -1
  374. package/dist/exports/migrations.d.ts +5 -13
  375. package/dist/exports/migrations.d.ts.map +1 -1
  376. package/dist/exports/migrations.js +5 -13
  377. package/dist/exports/migrations.js.map +1 -1
  378. package/dist/exports/shared.d.ts +23 -2
  379. package/dist/exports/shared.d.ts.map +1 -1
  380. package/dist/exports/shared.js +22 -1
  381. package/dist/exports/shared.js.map +1 -1
  382. package/dist/fields/baseFields/slug/duplicateContext.d.ts +11 -0
  383. package/dist/fields/baseFields/slug/duplicateContext.d.ts.map +1 -0
  384. package/dist/fields/baseFields/slug/duplicateContext.js +21 -0
  385. package/dist/fields/baseFields/slug/duplicateContext.js.map +1 -0
  386. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.d.ts +22 -0
  387. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.d.ts.map +1 -0
  388. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.js +63 -0
  389. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.js.map +1 -0
  390. package/dist/fields/baseFields/slug/generateSlug.d.ts +19 -7
  391. package/dist/fields/baseFields/slug/generateSlug.d.ts.map +1 -1
  392. package/dist/fields/baseFields/slug/generateSlug.js +107 -74
  393. package/dist/fields/baseFields/slug/generateSlug.js.map +1 -1
  394. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.d.ts +18 -0
  395. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.d.ts.map +1 -0
  396. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.js +20 -0
  397. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.js.map +1 -0
  398. package/dist/fields/baseFields/slug/getSlugFallbackValue.d.ts +22 -0
  399. package/dist/fields/baseFields/slug/getSlugFallbackValue.d.ts.map +1 -0
  400. package/dist/fields/baseFields/slug/getSlugFallbackValue.js +23 -0
  401. package/dist/fields/baseFields/slug/getSlugFallbackValue.js.map +1 -0
  402. package/dist/fields/baseFields/slug/hasValue.d.ts +3 -0
  403. package/dist/fields/baseFields/slug/hasValue.d.ts.map +1 -0
  404. package/dist/fields/baseFields/slug/hasValue.js +3 -0
  405. package/dist/fields/baseFields/slug/hasValue.js.map +1 -0
  406. package/dist/fields/baseFields/slug/types.d.ts +14 -0
  407. package/dist/fields/baseFields/slug/types.d.ts.map +1 -0
  408. package/dist/fields/baseFields/slug/types.js +6 -0
  409. package/dist/fields/baseFields/slug/types.js.map +1 -0
  410. package/dist/fields/config/client.d.ts +6 -6
  411. package/dist/fields/config/client.d.ts.map +1 -1
  412. package/dist/fields/config/client.js +14 -14
  413. package/dist/fields/config/client.js.map +1 -1
  414. package/dist/fields/config/sanitize.d.ts.map +1 -1
  415. package/dist/fields/config/sanitize.js +51 -4
  416. package/dist/fields/config/sanitize.js.map +1 -1
  417. package/dist/fields/config/sanitizeJoinField.d.ts.map +1 -1
  418. package/dist/fields/config/types.d.ts +82 -77
  419. package/dist/fields/config/types.d.ts.map +1 -1
  420. package/dist/fields/config/types.js.map +1 -1
  421. package/dist/fields/getDefaultValue.d.ts.map +1 -1
  422. package/dist/fields/hooks/afterChange/index.d.ts.map +1 -1
  423. package/dist/fields/hooks/afterChange/promise.d.ts.map +1 -1
  424. package/dist/fields/hooks/afterChange/promise.js +1 -1
  425. package/dist/fields/hooks/afterChange/promise.js.map +1 -1
  426. package/dist/fields/hooks/afterChange/traverseFields.d.ts.map +1 -1
  427. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
  428. package/dist/fields/hooks/afterRead/promise.js +13 -3
  429. package/dist/fields/hooks/afterRead/promise.js.map +1 -1
  430. package/dist/fields/hooks/afterRead/relationshipPopulationPromise.d.ts.map +1 -1
  431. package/dist/fields/hooks/afterRead/traverseFields.d.ts.map +1 -1
  432. package/dist/fields/hooks/afterRead/virtualFieldPopulationPromise.d.ts.map +1 -1
  433. package/dist/fields/hooks/beforeChange/cloneDataFromOriginalDoc.d.ts.map +1 -1
  434. package/dist/fields/hooks/beforeChange/getExistingRowDoc.d.ts.map +1 -1
  435. package/dist/fields/hooks/beforeChange/index.d.ts.map +1 -1
  436. package/dist/fields/hooks/beforeChange/promise.d.ts.map +1 -1
  437. package/dist/fields/hooks/beforeChange/promise.js +3 -3
  438. package/dist/fields/hooks/beforeChange/promise.js.map +1 -1
  439. package/dist/fields/hooks/beforeChange/traverseFields.d.ts.map +1 -1
  440. package/dist/fields/hooks/beforeDuplicate/index.d.ts.map +1 -1
  441. package/dist/fields/hooks/beforeDuplicate/promise.d.ts.map +1 -1
  442. package/dist/fields/hooks/beforeDuplicate/promise.js +2 -2
  443. package/dist/fields/hooks/beforeDuplicate/promise.js.map +1 -1
  444. package/dist/fields/hooks/beforeDuplicate/traverseFields.d.ts.map +1 -1
  445. package/dist/fields/hooks/beforeValidate/index.d.ts.map +1 -1
  446. package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
  447. package/dist/fields/hooks/beforeValidate/promise.js +16 -5
  448. package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
  449. package/dist/fields/hooks/beforeValidate/stripNullRows.d.ts +10 -0
  450. package/dist/fields/hooks/beforeValidate/stripNullRows.d.ts.map +1 -0
  451. package/dist/fields/hooks/beforeValidate/stripNullRows.js +18 -0
  452. package/dist/fields/hooks/beforeValidate/stripNullRows.js.map +1 -0
  453. package/dist/fields/hooks/beforeValidate/traverseFields.d.ts.map +1 -1
  454. package/dist/fields/isFieldDisabled.d.ts.map +1 -1
  455. package/dist/fields/mergeBaseFields.d.ts.map +1 -1
  456. package/dist/fields/setDefaultBeforeDuplicate.d.ts.map +1 -1
  457. package/dist/fields/setDefaultBeforeDuplicate.js +1 -0
  458. package/dist/fields/setDefaultBeforeDuplicate.js.map +1 -1
  459. package/dist/fields/sortableFieldTypes.d.ts.map +1 -1
  460. package/dist/fields/sortableFieldTypes.js +1 -0
  461. package/dist/fields/sortableFieldTypes.js.map +1 -1
  462. package/dist/fields/validations.d.ts +4 -1
  463. package/dist/fields/validations.d.ts.map +1 -1
  464. package/dist/fields/validations.js +13 -6
  465. package/dist/fields/validations.js.map +1 -1
  466. package/dist/fields/validations.spec.js +61 -37
  467. package/dist/fields/validations.spec.js.map +1 -1
  468. package/dist/globals/config/client.d.ts +4 -4
  469. package/dist/globals/config/client.d.ts.map +1 -1
  470. package/dist/globals/config/sanitize.d.ts.map +1 -1
  471. package/dist/globals/config/sanitize.js +2 -6
  472. package/dist/globals/config/sanitize.js.map +1 -1
  473. package/dist/globals/config/sanitize.spec.js +43 -0
  474. package/dist/globals/config/sanitize.spec.js.map +1 -0
  475. package/dist/globals/endpoints/update.d.ts.map +1 -1
  476. package/dist/globals/endpoints/update.js +0 -2
  477. package/dist/globals/endpoints/update.js.map +1 -1
  478. package/dist/globals/operations/countGlobalVersions.d.ts.map +1 -1
  479. package/dist/globals/operations/docAccess.d.ts.map +1 -1
  480. package/dist/globals/operations/findOne.d.ts.map +1 -1
  481. package/dist/globals/operations/findVersionByID.d.ts.map +1 -1
  482. package/dist/globals/operations/findVersions.d.ts.map +1 -1
  483. package/dist/globals/operations/local/countVersions.d.ts +3 -3
  484. package/dist/globals/operations/local/countVersions.d.ts.map +1 -1
  485. package/dist/globals/operations/local/countVersions.js.map +1 -1
  486. package/dist/globals/operations/local/findOne.d.ts +3 -3
  487. package/dist/globals/operations/local/findOne.d.ts.map +1 -1
  488. package/dist/globals/operations/local/findOne.js.map +1 -1
  489. package/dist/globals/operations/local/findVersionByID.d.ts +3 -3
  490. package/dist/globals/operations/local/findVersionByID.d.ts.map +1 -1
  491. package/dist/globals/operations/local/findVersionByID.js.map +1 -1
  492. package/dist/globals/operations/local/findVersions.d.ts +3 -3
  493. package/dist/globals/operations/local/findVersions.d.ts.map +1 -1
  494. package/dist/globals/operations/local/findVersions.js.map +1 -1
  495. package/dist/globals/operations/local/restoreVersion.d.ts +3 -3
  496. package/dist/globals/operations/local/restoreVersion.d.ts.map +1 -1
  497. package/dist/globals/operations/local/restoreVersion.js.map +1 -1
  498. package/dist/globals/operations/local/update.d.ts +7 -9
  499. package/dist/globals/operations/local/update.d.ts.map +1 -1
  500. package/dist/globals/operations/local/update.js +1 -2
  501. package/dist/globals/operations/local/update.js.map +1 -1
  502. package/dist/globals/operations/restoreVersion.d.ts.map +1 -1
  503. package/dist/globals/operations/update.d.ts +0 -1
  504. package/dist/globals/operations/update.d.ts.map +1 -1
  505. package/dist/globals/operations/update.js +52 -58
  506. package/dist/globals/operations/update.js.map +1 -1
  507. package/dist/hierarchy/addHierarchyToCollection.d.ts.map +1 -1
  508. package/dist/hierarchy/buildParentField.d.ts.map +1 -1
  509. package/dist/hierarchy/constants.d.ts.map +1 -1
  510. package/dist/hierarchy/getInitialTreeData.d.ts.map +1 -1
  511. package/dist/hierarchy/hooks/collectionAfterDelete.d.ts.map +1 -1
  512. package/dist/hierarchy/hooks/collectionAfterRead.d.ts.map +1 -1
  513. package/dist/hierarchy/hooks/collectionBeforeChange.d.ts.map +1 -1
  514. package/dist/hierarchy/hooks/collectionBeforeDelete.d.ts.map +1 -1
  515. package/dist/hierarchy/hooks/collectionBeforeOperation.d.ts.map +1 -1
  516. package/dist/hierarchy/hooks/ensureSafeCollectionsChange.d.ts.map +1 -1
  517. package/dist/hierarchy/injectHierarchyButton.d.ts.map +1 -1
  518. package/dist/hierarchy/resolveHierarchyCollections.d.ts.map +1 -1
  519. package/dist/hierarchy/resolveHierarchyCollections.js +1 -1
  520. package/dist/hierarchy/resolveHierarchyCollections.js.map +1 -1
  521. package/dist/hierarchy/sanitizeHierarchyCollection.d.ts.map +1 -1
  522. package/dist/hierarchy/sanitizeHierarchyCollection.js +3 -1
  523. package/dist/hierarchy/sanitizeHierarchyCollection.js.map +1 -1
  524. package/dist/hierarchy/types.d.ts +8 -1
  525. package/dist/hierarchy/types.d.ts.map +1 -1
  526. package/dist/hierarchy/types.js.map +1 -1
  527. package/dist/index.bundled.d.ts +4588 -4200
  528. package/dist/index.d.ts +124 -47
  529. package/dist/index.d.ts.map +1 -1
  530. package/dist/index.js +57 -37
  531. package/dist/index.js.map +1 -1
  532. package/dist/kv/adapters/DatabaseKVAdapter.d.ts.map +1 -1
  533. package/dist/kv/adapters/DatabaseKVAdapter.js +1 -0
  534. package/dist/kv/adapters/DatabaseKVAdapter.js.map +1 -1
  535. package/dist/kv/adapters/InMemoryKVAdapter.d.ts.map +1 -1
  536. package/dist/locked-documents/config.d.ts.map +1 -1
  537. package/dist/locked-documents/config.js +2 -1
  538. package/dist/locked-documents/config.js.map +1 -1
  539. package/dist/preferences/config.d.ts.map +1 -1
  540. package/dist/preferences/config.js +2 -1
  541. package/dist/preferences/config.js.map +1 -1
  542. package/dist/preferences/deleteUserPreferences.d.ts.map +1 -1
  543. package/dist/preferences/keys.d.ts +8 -4
  544. package/dist/preferences/keys.d.ts.map +1 -1
  545. package/dist/preferences/keys.js +4 -1
  546. package/dist/preferences/keys.js.map +1 -1
  547. package/dist/preferences/types.d.ts +15 -0
  548. package/dist/preferences/types.d.ts.map +1 -1
  549. package/dist/preferences/types.js +3 -1
  550. package/dist/preferences/types.js.map +1 -1
  551. package/dist/query-presets/access.d.ts.map +1 -1
  552. package/dist/query-presets/config.d.ts.map +1 -1
  553. package/dist/query-presets/config.js +77 -37
  554. package/dist/query-presets/config.js.map +1 -1
  555. package/dist/query-presets/constraints.d.ts.map +1 -1
  556. package/dist/query-presets/constraints.js +4 -3
  557. package/dist/query-presets/constraints.js.map +1 -1
  558. package/dist/query-presets/types.d.ts +1 -1
  559. package/dist/query-presets/types.d.ts.map +1 -1
  560. package/dist/queues/config/collection.d.ts.map +1 -1
  561. package/dist/queues/config/collection.js +39 -44
  562. package/dist/queues/config/collection.js.map +1 -1
  563. package/dist/queues/config/generateJobsJSONSchemas.d.ts +1 -1
  564. package/dist/queues/config/generateJobsJSONSchemas.d.ts.map +1 -1
  565. package/dist/queues/config/generateJobsJSONSchemas.js +33 -12
  566. package/dist/queues/config/generateJobsJSONSchemas.js.map +1 -1
  567. package/dist/queues/config/global.d.ts +5 -6
  568. package/dist/queues/config/global.d.ts.map +1 -1
  569. package/dist/queues/config/global.js +3 -2
  570. package/dist/queues/config/global.js.map +1 -1
  571. package/dist/queues/config/types/index.d.ts +29 -24
  572. package/dist/queues/config/types/index.d.ts.map +1 -1
  573. package/dist/queues/config/types/index.js.map +1 -1
  574. package/dist/queues/config/types/taskTypes.d.ts +4 -7
  575. package/dist/queues/config/types/taskTypes.d.ts.map +1 -1
  576. package/dist/queues/config/types/taskTypes.js.map +1 -1
  577. package/dist/queues/config/types/workflowJSONTypes.d.ts +10 -9
  578. package/dist/queues/config/types/workflowJSONTypes.d.ts.map +1 -1
  579. package/dist/queues/config/types/workflowJSONTypes.js.map +1 -1
  580. package/dist/queues/config/types/workflowTypes.d.ts +11 -58
  581. package/dist/queues/config/types/workflowTypes.d.ts.map +1 -1
  582. package/dist/queues/config/types/workflowTypes.js.map +1 -1
  583. package/dist/queues/endpoints/handleSchedules.js +1 -1
  584. package/dist/queues/endpoints/handleSchedules.js.map +1 -1
  585. package/dist/queues/endpoints/run.d.ts.map +1 -1
  586. package/dist/queues/errors/handleTaskError.js +4 -4
  587. package/dist/queues/errors/handleTaskError.js.map +1 -1
  588. package/dist/queues/errors/handleWorkflowError.js +1 -1
  589. package/dist/queues/errors/handleWorkflowError.js.map +1 -1
  590. package/dist/queues/errors/index.d.ts +6 -0
  591. package/dist/queues/errors/index.d.ts.map +1 -1
  592. package/dist/queues/errors/index.js +5 -0
  593. package/dist/queues/errors/index.js.map +1 -1
  594. package/dist/queues/localAPI.d.ts +9 -9
  595. package/dist/queues/localAPI.d.ts.map +1 -1
  596. package/dist/queues/localAPI.js +63 -66
  597. package/dist/queues/localAPI.js.map +1 -1
  598. package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.d.ts +4 -4
  599. package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.d.ts.map +1 -1
  600. package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.js.map +1 -1
  601. package/dist/queues/operations/handleSchedules/getQueuesWithSchedules.d.ts.map +1 -1
  602. package/dist/queues/operations/handleSchedules/index.d.ts +1 -1
  603. package/dist/queues/operations/handleSchedules/index.d.ts.map +1 -1
  604. package/dist/queues/operations/handleSchedules/index.js +1 -1
  605. package/dist/queues/operations/handleSchedules/index.js.map +1 -1
  606. package/dist/queues/operations/runJobs/heartbeat.d.ts +13 -0
  607. package/dist/queues/operations/runJobs/heartbeat.d.ts.map +1 -0
  608. package/dist/queues/operations/runJobs/heartbeat.js +66 -0
  609. package/dist/queues/operations/runJobs/heartbeat.js.map +1 -0
  610. package/dist/queues/operations/runJobs/index.d.ts.map +1 -1
  611. package/dist/queues/operations/runJobs/index.js +133 -84
  612. package/dist/queues/operations/runJobs/index.js.map +1 -1
  613. package/dist/queues/operations/runJobs/runJSONJob/index.d.ts.map +1 -1
  614. package/dist/queues/operations/runJobs/runJSONJob/index.js +6 -3
  615. package/dist/queues/operations/runJobs/runJSONJob/index.js.map +1 -1
  616. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.d.ts.map +1 -1
  617. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js +5 -5
  618. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js.map +1 -1
  619. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.d.ts +2 -1
  620. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.d.ts.map +1 -1
  621. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.js +39 -8
  622. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.js.map +1 -1
  623. package/dist/queues/operations/runJobs/runJob/importHandlerPath.d.ts +1 -1
  624. package/dist/queues/operations/runJobs/runJob/importHandlerPath.d.ts.map +1 -1
  625. package/dist/queues/operations/runJobs/runJob/importHandlerPath.js.map +1 -1
  626. package/dist/queues/operations/runJobs/runJob/index.d.ts.map +1 -1
  627. package/dist/queues/operations/runJobs/runJob/index.js +4 -4
  628. package/dist/queues/operations/runJobs/runJob/index.js.map +1 -1
  629. package/dist/queues/utilities/getCurrentDate.d.ts.map +1 -1
  630. package/dist/queues/utilities/getJobTaskStatus.d.ts.map +1 -1
  631. package/dist/queues/utilities/updateJob.d.ts.map +1 -1
  632. package/dist/queues/utilities/updateJob.js +3 -0
  633. package/dist/queues/utilities/updateJob.js.map +1 -1
  634. package/dist/translations/getLocalI18n.d.ts.map +1 -1
  635. package/dist/types/constants.d.ts +2 -2
  636. package/dist/types/constants.d.ts.map +1 -1
  637. package/dist/types/index.d.ts +10 -8
  638. package/dist/types/index.d.ts.map +1 -1
  639. package/dist/types/index.js.map +1 -1
  640. package/dist/uploads/checkFileAccess.d.ts.map +1 -1
  641. package/dist/uploads/checkFileRestrictions.d.ts +1 -1
  642. package/dist/uploads/checkFileRestrictions.d.ts.map +1 -1
  643. package/dist/uploads/checkFileRestrictions.js +15 -1
  644. package/dist/uploads/checkFileRestrictions.js.map +1 -1
  645. package/dist/uploads/cropImage.d.ts.map +1 -1
  646. package/dist/uploads/docWithFilenameExists.d.ts.map +1 -1
  647. package/dist/uploads/endpoints/uploadInstructions.d.ts +15 -0
  648. package/dist/uploads/endpoints/uploadInstructions.d.ts.map +1 -0
  649. package/dist/uploads/endpoints/uploadInstructions.js +84 -0
  650. package/dist/uploads/endpoints/uploadInstructions.js.map +1 -0
  651. package/dist/uploads/fetchAPI-multipart/isEligibleRequest.d.ts.map +1 -1
  652. package/dist/uploads/fetchAPI-multipart/processMultipart.d.ts.map +1 -1
  653. package/dist/uploads/fetchAPI-multipart/processMultipart.js +4 -0
  654. package/dist/uploads/fetchAPI-multipart/processMultipart.js.map +1 -1
  655. package/dist/uploads/fetchAPI-multipart/processNested.d.ts.map +1 -1
  656. package/dist/uploads/fetchAPI-multipart/utilities.d.ts.map +1 -1
  657. package/dist/uploads/fileExists.d.ts.map +1 -1
  658. package/dist/uploads/generateFileData.d.ts +2 -1
  659. package/dist/uploads/generateFileData.d.ts.map +1 -1
  660. package/dist/uploads/generateFileData.js +5 -2
  661. package/dist/uploads/generateFileData.js.map +1 -1
  662. package/dist/uploads/getBaseFields.d.ts.map +1 -1
  663. package/dist/uploads/getExternalFile.d.ts.map +1 -1
  664. package/dist/uploads/getFileByPath.d.ts +1 -1
  665. package/dist/uploads/getFileByPath.d.ts.map +1 -1
  666. package/dist/uploads/getFileFromUploadInstructions.d.ts +8 -0
  667. package/dist/uploads/getFileFromUploadInstructions.d.ts.map +1 -0
  668. package/dist/uploads/getFileFromUploadInstructions.js +62 -0
  669. package/dist/uploads/getFileFromUploadInstructions.js.map +1 -0
  670. package/dist/uploads/getFileTypeFallback.d.ts.map +1 -1
  671. package/dist/uploads/getSafeFilename.d.ts.map +1 -1
  672. package/dist/uploads/image-resizing/createImageSize.d.ts.map +1 -1
  673. package/dist/uploads/image-resizing/generateImageSizeFilename.d.ts.map +1 -1
  674. package/dist/uploads/image-resizing/getImageResizeAction.d.ts +1 -1
  675. package/dist/uploads/image-resizing/getImageResizeAction.d.ts.map +1 -1
  676. package/dist/uploads/image-resizing/parseFilename.d.ts.map +1 -1
  677. package/dist/uploads/image-resizing/sanitizeResizeConfig.d.ts.map +1 -1
  678. package/dist/uploads/matchMimeType.d.ts +8 -0
  679. package/dist/uploads/matchMimeType.d.ts.map +1 -0
  680. package/dist/uploads/matchMimeType.js +19 -0
  681. package/dist/uploads/matchMimeType.js.map +1 -0
  682. package/dist/uploads/matchMimeType.spec.js +66 -0
  683. package/dist/uploads/matchMimeType.spec.js.map +1 -0
  684. package/dist/uploads/mimeTypeValidator.d.ts.map +1 -1
  685. package/dist/uploads/safeFetch.d.ts.map +1 -1
  686. package/dist/uploads/safeFetch.js +11 -5
  687. package/dist/uploads/safeFetch.js.map +1 -1
  688. package/dist/uploads/saveBufferToFile.d.ts.map +1 -1
  689. package/dist/uploads/stagedUpload.d.ts +27 -0
  690. package/dist/uploads/stagedUpload.d.ts.map +1 -0
  691. package/dist/uploads/stagedUpload.js +197 -0
  692. package/dist/uploads/stagedUpload.js.map +1 -0
  693. package/dist/uploads/tempFile.d.ts.map +1 -1
  694. package/dist/uploads/types.d.ts +102 -7
  695. package/dist/uploads/types.d.ts.map +1 -1
  696. package/dist/uploads/types.js.map +1 -1
  697. package/dist/uploads/uploadFiles.d.ts.map +1 -1
  698. package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
  699. package/dist/utilities/addDataAndFileToRequest.js +12 -39
  700. package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
  701. package/dist/utilities/addLocalesToRequest.d.ts.map +1 -1
  702. package/dist/utilities/addSelectGenericsToGeneretedTypes.d.ts.map +1 -1
  703. package/dist/utilities/appendDateTimezoneSelectFields.d.ts.map +1 -1
  704. package/dist/utilities/appendDateTimezoneSelectFields.js +2 -2
  705. package/dist/utilities/appendDateTimezoneSelectFields.js.map +1 -1
  706. package/dist/utilities/appendNonTrashedFilter.d.ts.map +1 -1
  707. package/dist/utilities/appendUploadSelectFields.d.ts.map +1 -1
  708. package/dist/utilities/canAccessAdmin.d.ts.map +1 -1
  709. package/dist/utilities/checkDocumentLockStatus.d.ts.map +1 -1
  710. package/dist/utilities/configToJSONSchema.d.ts +68 -16
  711. package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
  712. package/dist/utilities/configToJSONSchema.js +312 -117
  713. package/dist/utilities/configToJSONSchema.js.map +1 -1
  714. package/dist/utilities/configToJSONSchema.spec.js +656 -85
  715. package/dist/utilities/configToJSONSchema.spec.js.map +1 -1
  716. package/dist/utilities/createLocalReq.d.ts +2 -2
  717. package/dist/utilities/createLocalReq.d.ts.map +1 -1
  718. package/dist/utilities/createLocalReq.js.map +1 -1
  719. package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
  720. package/dist/utilities/createPayloadRequest.js +1 -0
  721. package/dist/utilities/createPayloadRequest.js.map +1 -1
  722. package/dist/utilities/deepCopyObject.d.ts.map +1 -1
  723. package/dist/utilities/deepCopyObject.js +8 -0
  724. package/dist/utilities/deepCopyObject.js.map +1 -1
  725. package/dist/utilities/dependencies/dependencyChecker.js +1 -1
  726. package/dist/utilities/dependencies/dependencyChecker.js.map +1 -1
  727. package/dist/utilities/dependencies/getDependencies.d.ts.map +1 -1
  728. package/dist/utilities/dependencies/getDependencies.js +5 -5
  729. package/dist/utilities/dependencies/getDependencies.js.map +1 -1
  730. package/dist/utilities/dependencies/resolveFrom.d.ts.map +1 -1
  731. package/dist/utilities/dynamicImport.js +1 -1
  732. package/dist/utilities/dynamicImport.js.map +1 -1
  733. package/dist/utilities/escapeRegExp.d.ts.map +1 -1
  734. package/dist/utilities/extractID.d.ts.map +1 -1
  735. package/dist/utilities/fieldValueExists.d.ts +29 -0
  736. package/dist/utilities/fieldValueExists.d.ts.map +1 -0
  737. package/dist/utilities/fieldValueExists.js +27 -0
  738. package/dist/utilities/fieldValueExists.js.map +1 -0
  739. package/dist/utilities/filterDataToSelectedLocales.d.ts.map +1 -1
  740. package/dist/utilities/filterDataToSelectedLocales.js +5 -12
  741. package/dist/utilities/filterDataToSelectedLocales.js.map +1 -1
  742. package/dist/utilities/filterDataToSelectedLocales.spec.js +1 -2
  743. package/dist/utilities/filterDataToSelectedLocales.spec.js.map +1 -1
  744. package/dist/utilities/flattenAllFields.d.ts.map +1 -1
  745. package/dist/utilities/flattenAllFields.js +7 -22
  746. package/dist/utilities/flattenAllFields.js.map +1 -1
  747. package/dist/utilities/formatAdminURL.d.ts.map +1 -1
  748. package/dist/utilities/formatErrors.d.ts.map +1 -1
  749. package/dist/utilities/formatErrors.js +3 -1
  750. package/dist/utilities/formatErrors.js.map +1 -1
  751. package/dist/utilities/formatLabels.d.ts.map +1 -1
  752. package/dist/utilities/getBestFitFromSizes.d.ts.map +1 -1
  753. package/dist/utilities/getBlockSelect.d.ts.map +1 -1
  754. package/dist/utilities/getDataByPath.d.ts.map +1 -1
  755. package/dist/utilities/getEntityPermissions/getEntityPermissions.d.ts.map +1 -1
  756. package/dist/utilities/getEntityPermissions/getEntityPermissions.js +2 -0
  757. package/dist/utilities/getEntityPermissions/getEntityPermissions.js.map +1 -1
  758. package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts +7 -1
  759. package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts.map +1 -1
  760. package/dist/utilities/getEntityPermissions/populateFieldPermissions.js +24 -7
  761. package/dist/utilities/getEntityPermissions/populateFieldPermissions.js.map +1 -1
  762. package/dist/utilities/getFieldByPath.d.ts.map +1 -1
  763. package/dist/utilities/getFieldByPath.js +1 -1
  764. package/dist/utilities/getFieldByPath.js.map +1 -1
  765. package/dist/utilities/getFieldPermissions.d.ts.map +1 -1
  766. package/dist/utilities/getObjectDotNotation.d.ts.map +1 -1
  767. package/dist/utilities/getRequestEntity.d.ts.map +1 -1
  768. package/dist/utilities/getRequestLanguage.d.ts +2 -2
  769. package/dist/utilities/getRequestLanguage.d.ts.map +1 -1
  770. package/dist/utilities/getRequestLanguage.js.map +1 -1
  771. package/dist/utilities/getRequestOrigin.d.ts +2 -2
  772. package/dist/utilities/getRequestOrigin.d.ts.map +1 -1
  773. package/dist/utilities/getSafeRedirect.d.ts.map +1 -1
  774. package/dist/utilities/getSelectMode.d.ts.map +1 -1
  775. package/dist/utilities/getSiblingData.d.ts.map +1 -1
  776. package/dist/utilities/getTranslatedLabel.d.ts.map +1 -1
  777. package/dist/utilities/getUniqueFieldValue.d.ts +27 -0
  778. package/dist/utilities/getUniqueFieldValue.d.ts.map +1 -0
  779. package/dist/utilities/getUniqueFieldValue.js +26 -0
  780. package/dist/utilities/getUniqueFieldValue.js.map +1 -0
  781. package/dist/utilities/getVersionsConfig.d.ts +1 -1
  782. package/dist/utilities/getVersionsConfig.d.ts.map +1 -1
  783. package/dist/utilities/getVersionsConfig.js.map +1 -1
  784. package/dist/utilities/handleEndpoints.d.ts.map +1 -1
  785. package/dist/utilities/handleEndpoints.js +7 -3
  786. package/dist/utilities/handleEndpoints.js.map +1 -1
  787. package/dist/utilities/headersWithCors.d.ts.map +1 -1
  788. package/dist/utilities/isEntityHidden.d.ts +2 -2
  789. package/dist/utilities/isEntityHidden.d.ts.map +1 -1
  790. package/dist/utilities/isURLAllowed.d.ts.map +1 -1
  791. package/dist/utilities/isURLAllowed.js +9 -3
  792. package/dist/utilities/isURLAllowed.js.map +1 -1
  793. package/dist/utilities/isURLAllowed.spec.js +78 -0
  794. package/dist/utilities/isURLAllowed.spec.js.map +1 -0
  795. package/dist/utilities/isValidID.d.ts +1 -1
  796. package/dist/utilities/isValidID.d.ts.map +1 -1
  797. package/dist/utilities/logError.d.ts.map +1 -1
  798. package/dist/utilities/logger.d.ts +1 -1
  799. package/dist/utilities/logger.d.ts.map +1 -1
  800. package/dist/utilities/mergeHeaders.d.ts.map +1 -1
  801. package/dist/utilities/mergeListSearchAndWhere.d.ts.map +1 -1
  802. package/dist/utilities/mergeLocalizedData.d.ts +14 -4
  803. package/dist/utilities/mergeLocalizedData.d.ts.map +1 -1
  804. package/dist/utilities/mergeLocalizedData.js +54 -46
  805. package/dist/utilities/mergeLocalizedData.js.map +1 -1
  806. package/dist/utilities/mergeLocalizedData.spec.js +23 -23
  807. package/dist/utilities/mergeLocalizedData.spec.js.map +1 -1
  808. package/dist/utilities/miniChalk.d.ts.map +1 -1
  809. package/dist/utilities/optionsAreEqual.d.ts.map +1 -1
  810. package/dist/utilities/parseBooleanString.d.ts.map +1 -1
  811. package/dist/utilities/parseCookies.d.ts +1 -1
  812. package/dist/utilities/parseCookies.d.ts.map +1 -1
  813. package/dist/utilities/parseParams/index.d.ts +2 -5
  814. package/dist/utilities/parseParams/index.d.ts.map +1 -1
  815. package/dist/utilities/parseParams/index.js.map +1 -1
  816. package/dist/utilities/parseParams/index.spec.js +0 -9
  817. package/dist/utilities/parseParams/index.spec.js.map +1 -1
  818. package/dist/utilities/profiling.d.ts.map +1 -1
  819. package/dist/utilities/reduceFieldsToValues.d.ts.map +1 -1
  820. package/dist/utilities/resolveSelect.d.ts.map +1 -1
  821. package/dist/utilities/routeError.d.ts.map +1 -1
  822. package/dist/utilities/sanitizeFallbackLocale.d.ts.map +1 -1
  823. package/dist/utilities/sanitizeInternalFields.d.ts.map +1 -1
  824. package/dist/utilities/sanitizeJoinParams.d.ts.map +1 -1
  825. package/dist/utilities/sanitizePopulateParam.d.ts.map +1 -1
  826. package/dist/utilities/sanitizeSelect.d.ts.map +1 -1
  827. package/dist/utilities/sanitizeSelectParam.d.ts.map +1 -1
  828. package/dist/utilities/sanitizeSortParams.d.ts.map +1 -1
  829. package/dist/utilities/setsAreEqual.d.ts.map +1 -1
  830. package/dist/utilities/slugify.d.ts.map +1 -1
  831. package/dist/utilities/stripUnselectedFields.d.ts.map +1 -1
  832. package/dist/utilities/telemetry/conf/index.d.ts.map +1 -1
  833. package/dist/utilities/telemetry/events/adminInit.d.ts.map +1 -1
  834. package/dist/utilities/telemetry/events/adminInit.js +2 -3
  835. package/dist/utilities/telemetry/events/adminInit.js.map +1 -1
  836. package/dist/utilities/telemetry/events/serverInit.d.ts.map +1 -1
  837. package/dist/utilities/telemetry/events/serverInit.js +2 -3
  838. package/dist/utilities/telemetry/events/serverInit.js.map +1 -1
  839. package/dist/utilities/telemetry/index.d.ts +15 -4
  840. package/dist/utilities/telemetry/index.d.ts.map +1 -1
  841. package/dist/utilities/telemetry/index.js +6 -1
  842. package/dist/utilities/telemetry/index.js.map +1 -1
  843. package/dist/utilities/telemetry/index.spec.js +43 -0
  844. package/dist/utilities/telemetry/index.spec.js.map +1 -0
  845. package/dist/utilities/telemetry/oneWayHash.d.ts.map +1 -1
  846. package/dist/utilities/timestamp.d.ts.map +1 -1
  847. package/dist/utilities/toKebabCase.d.ts.map +1 -1
  848. package/dist/utilities/transformColumnPreferences.d.ts.map +1 -1
  849. package/dist/utilities/transformColumnPreferences.js +4 -2
  850. package/dist/utilities/transformColumnPreferences.js.map +1 -1
  851. package/dist/utilities/transformWhereQuery.d.ts.map +1 -1
  852. package/dist/utilities/traverseFields.d.ts.map +1 -1
  853. package/dist/utilities/traverseFields.js +2 -4
  854. package/dist/utilities/traverseFields.js.map +1 -1
  855. package/dist/utilities/traverseForLocalizedFields.d.ts.map +1 -1
  856. package/dist/utilities/traverseForLocalizedFields.js +3 -0
  857. package/dist/utilities/traverseForLocalizedFields.js.map +1 -1
  858. package/dist/utilities/unflatten.d.ts.map +1 -1
  859. package/dist/utilities/validateMimeType.d.ts.map +1 -1
  860. package/dist/utilities/validateTimezones.d.ts.map +1 -1
  861. package/dist/utilities/validateWhereQuery.d.ts.map +1 -1
  862. package/dist/utilities/wordBoundariesRegex.d.ts.map +1 -1
  863. package/dist/utilities/wrapInternalEndpoints.d.ts.map +1 -1
  864. package/dist/versions/baseFields.d.ts +1 -2
  865. package/dist/versions/baseFields.d.ts.map +1 -1
  866. package/dist/versions/baseFields.js +0 -13
  867. package/dist/versions/baseFields.js.map +1 -1
  868. package/dist/versions/buildCollectionFields.d.ts.map +1 -1
  869. package/dist/versions/buildCollectionFields.js +0 -2
  870. package/dist/versions/buildCollectionFields.js.map +1 -1
  871. package/dist/versions/buildGlobalFields.d.ts.map +1 -1
  872. package/dist/versions/buildGlobalFields.js +0 -2
  873. package/dist/versions/buildGlobalFields.js.map +1 -1
  874. package/dist/versions/buildSingleLocalePublishData.d.ts +32 -0
  875. package/dist/versions/buildSingleLocalePublishData.d.ts.map +1 -0
  876. package/dist/versions/buildSingleLocalePublishData.js +37 -0
  877. package/dist/versions/buildSingleLocalePublishData.js.map +1 -0
  878. package/dist/versions/buildVersionCompoundIndexes.d.ts.map +1 -1
  879. package/dist/versions/defaults.d.ts.map +1 -1
  880. package/dist/versions/deleteCollectionVersions.d.ts.map +1 -1
  881. package/dist/versions/deleteScheduledPublishJobs.d.ts.map +1 -1
  882. package/dist/versions/deleteScheduledPublishJobs.js +2 -2
  883. package/dist/versions/deleteScheduledPublishJobs.js.map +1 -1
  884. package/dist/versions/drafts/appendVersionToQueryKey.d.ts.map +1 -1
  885. package/dist/versions/drafts/getQueryDraftsSelect.d.ts.map +1 -1
  886. package/dist/versions/drafts/getQueryDraftsSort.d.ts.map +1 -1
  887. package/dist/versions/drafts/replaceWithDraftIfAvailable.d.ts.map +1 -1
  888. package/dist/versions/enforceMaxVersions.d.ts.map +1 -1
  889. package/dist/versions/getLatestCollectionVersion.d.ts.map +1 -1
  890. package/dist/versions/getLatestGlobalVersion.d.ts.map +1 -1
  891. package/dist/versions/migrations/localizeStatus/shared.d.ts.map +1 -1
  892. package/dist/versions/payloadPackageList.d.ts.map +1 -1
  893. package/dist/versions/payloadPackageList.js +0 -1
  894. package/dist/versions/payloadPackageList.js.map +1 -1
  895. package/dist/versions/saveVersion.d.ts +0 -2
  896. package/dist/versions/saveVersion.d.ts.map +1 -1
  897. package/dist/versions/saveVersion.js +12 -17
  898. package/dist/versions/saveVersion.js.map +1 -1
  899. package/dist/versions/schedule/job.d.ts.map +1 -1
  900. package/dist/versions/schedule/job.js +6 -10
  901. package/dist/versions/schedule/job.js.map +1 -1
  902. package/dist/versions/types.d.ts +2 -15
  903. package/dist/versions/types.d.ts.map +1 -1
  904. package/dist/versions/types.js.map +1 -1
  905. package/package.json +14 -6
  906. package/dist/database/defaultUpdateJobs.d.ts +0 -3
  907. package/dist/database/defaultUpdateJobs.d.ts.map +0 -1
  908. package/dist/database/defaultUpdateJobs.js +0 -41
  909. package/dist/database/defaultUpdateJobs.js.map +0 -1
  910. package/dist/database/migrations/templates/localizeStatus.d.ts +0 -10
  911. package/dist/database/migrations/templates/localizeStatus.d.ts.map +0 -1
  912. package/dist/database/migrations/templates/localizeStatus.js +0 -54
  913. package/dist/database/migrations/templates/localizeStatus.js.map +0 -1
  914. package/dist/fields/baseFields/slug/countVersions.d.ts +0 -13
  915. package/dist/fields/baseFields/slug/countVersions.d.ts.map +0 -1
  916. package/dist/fields/baseFields/slug/countVersions.js +0 -29
  917. package/dist/fields/baseFields/slug/countVersions.js.map +0 -1
  918. package/dist/fields/baseFields/slug/index.d.ts +0 -89
  919. package/dist/fields/baseFields/slug/index.d.ts.map +0 -1
  920. package/dist/fields/baseFields/slug/index.js +0 -81
  921. package/dist/fields/baseFields/slug/index.js.map +0 -1
  922. package/dist/versions/migrations/localizeStatus/index.d.ts +0 -12
  923. package/dist/versions/migrations/localizeStatus/index.d.ts.map +0 -1
  924. package/dist/versions/migrations/localizeStatus/index.js +0 -33
  925. package/dist/versions/migrations/localizeStatus/index.js.map +0 -1
  926. package/dist/versions/migrations/localizeStatus/mongo/down.d.ts +0 -9
  927. package/dist/versions/migrations/localizeStatus/mongo/down.d.ts.map +0 -1
  928. package/dist/versions/migrations/localizeStatus/mongo/down.js +0 -112
  929. package/dist/versions/migrations/localizeStatus/mongo/down.js.map +0 -1
  930. package/dist/versions/migrations/localizeStatus/mongo/index.d.ts +0 -8
  931. package/dist/versions/migrations/localizeStatus/mongo/index.d.ts.map +0 -1
  932. package/dist/versions/migrations/localizeStatus/mongo/index.js +0 -8
  933. package/dist/versions/migrations/localizeStatus/mongo/index.js.map +0 -1
  934. package/dist/versions/migrations/localizeStatus/mongo/up.d.ts +0 -9
  935. package/dist/versions/migrations/localizeStatus/mongo/up.d.ts.map +0 -1
  936. package/dist/versions/migrations/localizeStatus/mongo/up.js +0 -220
  937. package/dist/versions/migrations/localizeStatus/mongo/up.js.map +0 -1
  938. package/dist/versions/migrations/localizeStatus/sql/down.d.ts +0 -11
  939. package/dist/versions/migrations/localizeStatus/sql/down.d.ts.map +0 -1
  940. package/dist/versions/migrations/localizeStatus/sql/down.js +0 -213
  941. package/dist/versions/migrations/localizeStatus/sql/down.js.map +0 -1
  942. package/dist/versions/migrations/localizeStatus/sql/index.d.ts +0 -8
  943. package/dist/versions/migrations/localizeStatus/sql/index.d.ts.map +0 -1
  944. package/dist/versions/migrations/localizeStatus/sql/index.js +0 -8
  945. package/dist/versions/migrations/localizeStatus/sql/index.js.map +0 -1
  946. package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.d.ts +0 -13
  947. package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.d.ts.map +0 -1
  948. package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.js +0 -51
  949. package/dist/versions/migrations/localizeStatus/sql/migrateMainCollection.js.map +0 -1
  950. package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.d.ts +0 -13
  951. package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.d.ts.map +0 -1
  952. package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.js +0 -54
  953. package/dist/versions/migrations/localizeStatus/sql/migrateMainGlobal.js.map +0 -1
  954. package/dist/versions/migrations/localizeStatus/sql/up.d.ts +0 -11
  955. package/dist/versions/migrations/localizeStatus/sql/up.d.ts.map +0 -1
  956. package/dist/versions/migrations/localizeStatus/sql/up.js +0 -277
  957. package/dist/versions/migrations/localizeStatus/sql/up.js.map +0 -1
  958. package/dist/versions/saveSnapshot.d.ts +0 -18
  959. package/dist/versions/saveSnapshot.d.ts.map +0 -1
  960. package/dist/versions/saveSnapshot.js +0 -38
  961. package/dist/versions/saveSnapshot.js.map +0 -1
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018-2025 Payload CMS, Inc. <info@payloadcms.com>
3
+ Copyright (c) 2018-2026 Payload CMS, LLC <info@payloadcms.com>
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
package/bin.js CHANGED
@@ -23,6 +23,17 @@ if (disableTranspile) {
23
23
 
24
24
  if (!useSwc) {
25
25
  const start = async () => {
26
+ // tsx 4.22.4 uses Node's synchronous `module.registerHooks` API when it is available
27
+ // (Node v23.5+). On those versions that code path leaks tsx's internal `?namespace=...`
28
+ // query string onto resolved specifiers — including Node built-ins like `node:crypto` —
29
+ // which Node then tries to open as a file, failing with ENOENT. Removing `registerHooks`
30
+ // forces tsx to fall back to its older async `module.register()` worker path, which does
31
+ // not have this bug. See https://github.com/payloadcms/payload/issues/16949
32
+ const nodeModule = await import('node:module')
33
+ if (typeof nodeModule.default.registerHooks === 'function') {
34
+ nodeModule.default.registerHooks = undefined
35
+ }
36
+
26
37
  // Use tsx
27
38
  let tsImport = (await import('tsx/esm/api')).tsImport
28
39
 
@@ -1,4 +1,3 @@
1
- export const downSQL: " // Test predefined migration DOWN from payload package\n payload.logger.info('Test migration DOWN from payload package executed')";
2
1
  /**
3
2
  * Test predefined migration for testing plugin-style module specifier imports.
4
3
  * This is used in integration tests to verify that external packages (without @payloadcms/db-* prefix)
@@ -10,6 +9,8 @@ export const downSQL: " // Test predefined migration DOWN from payload package\
10
9
  * cannot import .ts files via module specifiers. Absolute file paths work because Vitest's
11
10
  * loader intercepts file:// URLs, but module specifiers are resolved by Node.js first.
12
11
  */
13
- export const imports: "";
14
- export const upSQL: " // Test predefined migration from payload/__testing__/predefinedMigration\n payload.logger.info('Test migration UP from payload package executed')";
12
+ declare const imports = "";
13
+ declare const upSQL = " // Test predefined migration from payload/__testing__/predefinedMigration\n payload.logger.info('Test migration UP from payload package executed')";
14
+ declare const downSQL = " // Test predefined migration DOWN from payload package\n payload.logger.info('Test migration DOWN from payload package executed')";
15
+ export { downSQL, imports, upSQL };
15
16
  //# sourceMappingURL=predefinedMigration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"predefinedMigration.d.ts","sourceRoot":"","sources":["../../src/__testing__/predefinedMigration.js"],"names":[],"mappings":"AAcA,6JAC2E;AAf3E;;;;;;;;;;GAUG;AACH,yBAAkB;AAClB,4KACyE"}
1
+ {"version":3,"file":"predefinedMigration.d.ts","sourceRoot":"","sources":["../../src/__testing__/predefinedMigration.js"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,QAAA,MAAM,OAAO,KAAK,CAAA;AAClB,QAAA,MAAM,KAAK,0JAC8D,CAAA;AACzE,QAAA,MAAM,OAAO,yIAC8D,CAAA;AAE3E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA"}
@@ -7,6 +7,7 @@ import type { FieldAffectingData, RichTextField, RichTextFieldClient, Validate }
7
7
  import type { SanitizedGlobalConfig } from '../globals/config/types.js';
8
8
  import type { RequestContext, TypedFallbackLocale } from '../index.js';
9
9
  import type { JsonObject, PayloadRequest, PopulateType } from '../types/index.js';
10
+ import type { FieldsToJSONSchemaArgs } from '../utilities/configToJSONSchema.js';
10
11
  import type { RichTextFieldClientProps, RichTextFieldServerProps } from './fields/RichText.js';
11
12
  import type { FieldDiffClientProps, FieldDiffServerProps, FieldSchemaMap } from './types.js';
12
13
  export type AfterReadRichTextHookArgs<TData extends TypeWithID = any, TValue = any, TSiblingData = any> = {
@@ -162,19 +163,10 @@ type RichTextAdapterBase<Value extends object = object, AdapterProps = any, Extr
162
163
  * `json-schema-to-typescript` which is used to generate types for this richtext field
163
164
  * payload-types.ts)
164
165
  */
165
- outputSchema?: (args: {
166
- collectionIDFieldTypes: {
167
- [key: string]: 'number' | 'string';
168
- };
169
- config?: SanitizedConfig;
166
+ jsonSchema?: (args: {
170
167
  field: RichTextField<Value, AdapterProps, ExtraFieldProperties>;
171
- i18n?: I18n;
172
- /**
173
- * Allows you to define new top-level interfaces that can be re-used in the output schema.
174
- */
175
- interfaceNameDefinitions: Map<string, JSONSchema4>;
176
168
  isRequired: boolean;
177
- }) => JSONSchema4;
169
+ } & Pick<FieldsToJSONSchemaArgs, 'collectionIDFieldTypes' | 'config' | 'i18n' | 'interfaceNameDefinitions' | 'typeStringDefinitions' | 'variant'>) => JSONSchema4;
178
170
  /**
179
171
  * Provide validation function for the richText field. This function is run the same way
180
172
  * as other field validation functions.
@@ -1 +1 @@
1
- {"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../src/admin/RichText.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAC3F,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAChG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,mBAAmB,EACnB,QAAQ,EACT,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACjF,OAAO,KAAK,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAA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eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAC,GACnE,eAAe,CAAC,KAAK,EAAE,YAAY,EAAE,oBAAoB,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/admin/RichText.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { I18n } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\n\nimport type { SanitizedCollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { ImportMapGenerators, PayloadComponent, SanitizedConfig } from '../config/types.js'\nimport type { ValidationFieldError } from '../errors/ValidationError.js'\nimport type {\n FieldAffectingData,\n RichTextField,\n RichTextFieldClient,\n Validate,\n} from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { RequestContext, TypedFallbackLocale } from '../index.js'\nimport type { JsonObject, PayloadRequest, PopulateType } from '../types/index.js'\nimport type { RichTextFieldClientProps, RichTextFieldServerProps } from './fields/RichText.js'\nimport type { FieldDiffClientProps, FieldDiffServerProps, FieldSchemaMap } from './types.js'\n\nexport type AfterReadRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TValue = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TSiblingData = any,\n> = {\n currentDepth?: number\n\n depth?: number\n\n draft?: boolean\n\n fallbackLocale?: TypedFallbackLocale\n fieldPromises?: Promise<void>[]\n\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n\n flattenLocales?: boolean\n\n locale?: string\n\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n\n overrideAccess?: boolean\n\n populate?: PopulateType\n\n populationPromises?: Promise<void>[]\n showHiddenFields?: boolean\n triggerAccessControl?: boolean\n triggerHooks?: boolean\n}\n\nexport type AfterChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n /** The document before changes were applied. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeValidateRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n overrideAccess?: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeChangeRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /**\n * The original data with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n docWithLocales?: JsonObject\n\n duplicate?: boolean\n\n errors?: ValidationFieldError[]\n /**\n * Built up field label\n *\n * @example \"Group Field > Tab Field > Rich Text Field\"\n */\n fieldLabelPath: string\n /** Only available in `beforeChange` field hooks */\n mergeLocaleActions?: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n overrideAccess: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n /**\n * The original siblingData with locales (not modified by any hooks).\n */\n siblingDocWithLocales?: JsonObject\n skipValidation?: boolean\n}\n\nexport type BaseRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** The collection which the field belongs to. If the field belongs to a global, this will be null. */\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */\n data?: Partial<TData>\n /** The field which the hook is running against. */\n field: FieldAffectingData\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: null | SanitizedGlobalConfig\n indexPath: number[]\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n parentIsLocalized: boolean\n /**\n * The path of the field, e.g. [\"group\", \"myArray\", 1, \"textField\"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas.\n */\n path: (number | string)[]\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequest\n /**\n * The schemaPath of the field, e.g. [\"group\", \"myArray\", \"textField\"]. The schemaPath is the path but without indexes and would be used in the context of field schemas, not field data.\n */\n schemaPath: string[]\n /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type AfterReadRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterReadRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type AfterChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterChangeRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeChangeRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeValidateRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeValidateRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type RichTextHooks = {\n afterChange?: AfterChangeRichTextHook[]\n afterRead?: AfterReadRichTextHook[]\n beforeChange?: BeforeChangeRichTextHook[]\n beforeValidate?: BeforeValidateRichTextHook[]\n}\n\ntype RichTextAdapterBase<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = {\n /**\n * Provide a function that can be used to add items to the import map. This is useful for\n * making modules available to the client.\n */\n generateImportMap?: ImportMapGenerators[0]\n /**\n * Provide a function that can be used to add items to the schema map. This is useful for\n * richtext sub-fields the server needs to \"know\" about in order to do things like calculate form state.\n *\n * This function is run within `buildFieldSchemaMap`.\n */\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18n<any, any>\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap\n /**\n * Like an afterRead hook, but runs only for the GraphQL resolver. For populating data, this should be used, as afterRead hooks do not have a depth in graphQL.\n *\n * To populate stuff / resolve field hooks, mutate the incoming populationPromises or fieldPromises array. They will then be awaited in the correct order within payload itself.\n * @param data\n */\n graphQLPopulationPromises?: (data: {\n context: RequestContext\n currentDepth?: number\n depth: number\n draft: boolean\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n overrideAccess?: boolean\n parentIsLocalized: boolean\n populateArg?: PopulateType\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n }) => void\n hooks?: RichTextHooks\n /**\n * Return the JSON schema for the field value. The JSON schema is read by\n * `json-schema-to-typescript` which is used to generate types for this richtext field\n * payload-types.ts)\n */\n outputSchema?: (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n /**\n * Provide validation function for the richText field. This function is run the same way\n * as other field validation functions.\n */\n validate: Validate<\n Value,\n Value,\n unknown,\n RichTextField<Value, AdapterProps, ExtraFieldProperties>\n >\n}\n\nexport type RichTextAdapter<\n Value extends object = any,\n AdapterProps = any,\n ExtraFieldProperties = any,\n> = {\n /**\n * Component that will be displayed in the list view. Can be typed as\n * `DefaultCellComponentProps` or `DefaultServerCellComponentProps`.\n */\n CellComponent: PayloadComponent<never>\n /**\n * Component that will be displayed in the version diff view.\n * If not provided, richtext content will be diffed as JSON.\n */\n DiffComponent?: PayloadComponent<\n FieldDiffServerProps<RichTextField, RichTextFieldClient>,\n FieldDiffClientProps<RichTextFieldClient>\n >\n /**\n * Component that will be displayed in the edit view.\n */\n FieldComponent: PayloadComponent<RichTextFieldServerProps, RichTextFieldClientProps>\n} & RichTextAdapterBase<Value, AdapterProps, ExtraFieldProperties>\n\nexport type RichTextAdapterProvider<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = ({\n config,\n isRoot,\n parentIsLocalized,\n}: {\n config: SanitizedConfig\n /**\n * Whether or not this is the root richText editor, defined in the top-level `editor` property\n * of the Payload Config.\n *\n * @default false\n */\n isRoot?: boolean\n parentIsLocalized: boolean\n}) =>\n | Promise<RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>>\n | RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>\n"],"names":[],"mappings":"AAAA,qDAAqD,GA0SrD,WAoB8D"}
1
+ {"version":3,"sources":["../../src/admin/RichText.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type { I18n } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\n\nimport type { SanitizedCollectionConfig, TypeWithID } from '../collections/config/types.js'\nimport type { ImportMapGenerators, PayloadComponent, SanitizedConfig } from '../config/types.js'\nimport type { ValidationFieldError } from '../errors/ValidationError.js'\nimport type {\n FieldAffectingData,\n RichTextField,\n RichTextFieldClient,\n Validate,\n} from '../fields/config/types.js'\nimport type { SanitizedGlobalConfig } from '../globals/config/types.js'\nimport type { RequestContext, TypedFallbackLocale } from '../index.js'\nimport type { JsonObject, PayloadRequest, PopulateType } from '../types/index.js'\nimport type { FieldsToJSONSchemaArgs } from '../utilities/configToJSONSchema.js'\nimport type { RichTextFieldClientProps, RichTextFieldServerProps } from './fields/RichText.js'\nimport type { FieldDiffClientProps, FieldDiffServerProps, FieldSchemaMap } from './types.js'\n\nexport type AfterReadRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TValue = any,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TSiblingData = any,\n> = {\n currentDepth?: number\n\n depth?: number\n\n draft?: boolean\n\n fallbackLocale?: TypedFallbackLocale\n fieldPromises?: Promise<void>[]\n\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n\n flattenLocales?: boolean\n\n locale?: string\n\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n\n overrideAccess?: boolean\n\n populate?: PopulateType\n\n populationPromises?: Promise<void>[]\n showHiddenFields?: boolean\n triggerAccessControl?: boolean\n triggerHooks?: boolean\n}\n\nexport type AfterChangeRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n /** The document before changes were applied. */\n previousDoc?: TData\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeValidateRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** A string relating to which operation the field type is currently executing within. */\n operation: 'create' | 'update'\n overrideAccess?: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n}\n\nexport type BeforeChangeRichTextHookArgs<\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /**\n * The original data with locales (not modified by any hooks). Only available in `beforeChange` and `beforeDuplicate` field hooks.\n */\n docWithLocales?: JsonObject\n\n duplicate?: boolean\n\n errors?: ValidationFieldError[]\n /**\n * Built up field label\n *\n * @example \"Group Field > Tab Field > Rich Text Field\"\n */\n fieldLabelPath: string\n /** Only available in `beforeChange` field hooks */\n mergeLocaleActions?: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n overrideAccess: boolean\n /** The sibling data of the document before changes being applied. */\n previousSiblingDoc?: TSiblingData\n /** The previous value of the field, before changes */\n previousValue?: TValue\n /**\n * The original siblingData with locales (not modified by any hooks).\n */\n siblingDocWithLocales?: JsonObject\n skipValidation?: boolean\n}\n\nexport type BaseRichTextHookArgs<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = {\n /** The collection which the field belongs to. If the field belongs to a global, this will be null. */\n collection: null | SanitizedCollectionConfig\n context: RequestContext\n /** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */\n data?: Partial<TData>\n /** The field which the hook is running against. */\n field: FieldAffectingData\n /** The global which the field belongs to. If the field belongs to a collection, this will be null. */\n global: null | SanitizedGlobalConfig\n indexPath: number[]\n /** The full original document in `update` operations. In the `afterChange` hook, this is the resulting document of the operation. */\n originalDoc?: TData\n parentIsLocalized: boolean\n /**\n * The path of the field, e.g. [\"group\", \"myArray\", 1, \"textField\"]. The path is the schemaPath but with indexes and would be used in the context of field data, not field schemas.\n */\n path: (number | string)[]\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequest\n /**\n * The schemaPath of the field, e.g. [\"group\", \"myArray\", \"textField\"]. The schemaPath is the path but without indexes and would be used in the context of field schemas, not field data.\n */\n schemaPath: string[]\n /** The sibling data passed to a field that the hook is running against. */\n siblingData: Partial<TSiblingData>\n /** The value of the field. */\n value?: TValue\n}\n\nexport type AfterReadRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterReadRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type AfterChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: AfterChangeRichTextHookArgs<TData, TValue, TSiblingData> &\n BaseRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeChangeRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeChangeRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type BeforeValidateRichTextHook<\n TData extends TypeWithID = any,\n TValue = any,\n TSiblingData = any,\n> = (\n args: BaseRichTextHookArgs<TData, TValue, TSiblingData> &\n BeforeValidateRichTextHookArgs<TData, TValue, TSiblingData>,\n) => Promise<TValue> | TValue\n\nexport type RichTextHooks = {\n afterChange?: AfterChangeRichTextHook[]\n afterRead?: AfterReadRichTextHook[]\n beforeChange?: BeforeChangeRichTextHook[]\n beforeValidate?: BeforeValidateRichTextHook[]\n}\n\ntype RichTextAdapterBase<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = {\n /**\n * Provide a function that can be used to add items to the import map. This is useful for\n * making modules available to the client.\n */\n generateImportMap?: ImportMapGenerators[0]\n /**\n * Provide a function that can be used to add items to the schema map. This is useful for\n * richtext sub-fields the server needs to \"know\" about in order to do things like calculate form state.\n *\n * This function is run within `buildFieldSchemaMap`.\n */\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18n<any, any>\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap\n /**\n * Like an afterRead hook, but runs only for the GraphQL resolver. For populating data, this should be used, as afterRead hooks do not have a depth in graphQL.\n *\n * To populate stuff / resolve field hooks, mutate the incoming populationPromises or fieldPromises array. They will then be awaited in the correct order within payload itself.\n * @param data\n */\n graphQLPopulationPromises?: (data: {\n context: RequestContext\n currentDepth?: number\n depth: number\n draft: boolean\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n overrideAccess?: boolean\n parentIsLocalized: boolean\n populateArg?: PopulateType\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n }) => void\n hooks?: RichTextHooks\n /**\n * Return the JSON schema for the field value. The JSON schema is read by\n * `json-schema-to-typescript` which is used to generate types for this richtext field\n * payload-types.ts)\n */\n jsonSchema?: (\n args: {\n field: RichTextField<Value, AdapterProps, ExtraFieldProperties>\n isRequired: boolean\n } & Pick<\n FieldsToJSONSchemaArgs,\n | 'collectionIDFieldTypes'\n | 'config'\n | 'i18n'\n | 'interfaceNameDefinitions'\n | 'typeStringDefinitions'\n | 'variant'\n >,\n ) => JSONSchema4\n /**\n * Provide validation function for the richText field. This function is run the same way\n * as other field validation functions.\n */\n validate: Validate<\n Value,\n Value,\n unknown,\n RichTextField<Value, AdapterProps, ExtraFieldProperties>\n >\n}\n\nexport type RichTextAdapter<\n Value extends object = any,\n AdapterProps = any,\n ExtraFieldProperties = any,\n> = {\n /**\n * Component that will be displayed in the list view. Can be typed as\n * `DefaultCellComponentProps` or `DefaultServerCellComponentProps`.\n */\n CellComponent: PayloadComponent<never>\n /**\n * Component that will be displayed in the version diff view.\n * If not provided, richtext content will be diffed as JSON.\n */\n DiffComponent?: PayloadComponent<\n FieldDiffServerProps<RichTextField, RichTextFieldClient>,\n FieldDiffClientProps<RichTextFieldClient>\n >\n /**\n * Component that will be displayed in the edit view.\n */\n FieldComponent: PayloadComponent<RichTextFieldServerProps, RichTextFieldClientProps>\n} & RichTextAdapterBase<Value, AdapterProps, ExtraFieldProperties>\n\nexport type RichTextAdapterProvider<\n Value extends object = object,\n AdapterProps = any,\n ExtraFieldProperties = {},\n> = ({\n config,\n isRoot,\n parentIsLocalized,\n}: {\n config: SanitizedConfig\n /**\n * Whether or not this is the root richText editor, defined in the top-level `editor` property\n * of the Payload Config.\n *\n * @default false\n */\n isRoot?: boolean\n parentIsLocalized: boolean\n}) =>\n | Promise<RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>>\n | RichTextAdapter<Value, AdapterProps, ExtraFieldProperties>\n"],"names":[],"mappings":"AAAA,qDAAqD,GA8SrD,WAoB8D"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Strategy for dev-mode HMR/reload detection.
3
+ * Each framework adapter provides its own implementation.
4
+ */
5
+ export type DevReloadStrategy = {
6
+ connect: (onReload: () => void) => DevReloadCleanup;
7
+ };
8
+ export type DevReloadCleanup = () => void;
9
+ //# sourceMappingURL=devReload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"devReload.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/devReload.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,gBAAgB,CAAA;CACpD,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAA"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Strategy for dev-mode HMR/reload detection.
3
+ * Each framework adapter provides its own implementation.
4
+ */ export { };
5
+
6
+ //# sourceMappingURL=devReload.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/admin/adapters/devReload.ts"],"sourcesContent":["/**\n * Strategy for dev-mode HMR/reload detection.\n * Each framework adapter provides its own implementation.\n */\nexport type DevReloadStrategy = {\n connect: (onReload: () => void) => DevReloadCleanup\n}\n\nexport type DevReloadCleanup = () => void\n"],"names":[],"mappings":"AAAA;;;CAGC,GAKD,WAAyC"}
@@ -1,4 +1,7 @@
1
1
  export type * from './cookies.js';
2
+ export type * from './devReload.js';
3
+ export type * from './render.js';
2
4
  export type * from './router.js';
3
5
  export type * from './server.js';
6
+ export type * from './views.js';
4
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,cAAc,CAAA;AACjC,mBAAmB,gBAAgB,CAAA;AACnC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,aAAa,CAAA;AAChC,mBAAmB,YAAY,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/adapters/index.ts"],"sourcesContent":["export type * from './cookies.js'\nexport type * from './router.js'\nexport type * from './server.js'\n"],"names":[],"mappings":"AAEA,WAAgC"}
1
+ {"version":3,"sources":["../../../src/admin/adapters/index.ts"],"sourcesContent":["export type * from './cookies.js'\nexport type * from './devReload.js'\nexport type * from './render.js'\nexport type * from './router.js'\nexport type * from './server.js'\nexport type * from './views.js'\n"],"names":[],"mappings":"AAKA,WAA+B"}
@@ -0,0 +1,16 @@
1
+ import type React from 'react';
2
+ import type { ImportMap, PayloadComponent } from '../../index.js';
3
+ /**
4
+ * Pluggable component renderer.
5
+ * RSC-capable frameworks use the current RenderServerComponent logic.
6
+ * Non-RSC frameworks treat all components as client components.
7
+ */
8
+ export type ComponentRenderer = (args: {
9
+ readonly clientProps?: object;
10
+ readonly Component?: PayloadComponent | PayloadComponent[] | React.ComponentType | React.ComponentType[];
11
+ readonly Fallback?: React.ComponentType;
12
+ readonly importMap: ImportMap;
13
+ readonly key?: string;
14
+ readonly serverProps?: object;
15
+ }) => React.ReactNode;
16
+ //# sourceMappingURL=render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/render.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEjE;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE;IACrC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,SAAS,CAAC,EACf,gBAAgB,GAChB,gBAAgB,EAAE,GAClB,KAAK,CAAC,aAAa,GACnB,KAAK,CAAC,aAAa,EAAE,CAAA;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IACvC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B,KAAK,KAAK,CAAC,SAAS,CAAA"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Pluggable component renderer.
3
+ * RSC-capable frameworks use the current RenderServerComponent logic.
4
+ * Non-RSC frameworks treat all components as client components.
5
+ */ export { };
6
+
7
+ //# sourceMappingURL=render.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/admin/adapters/render.ts"],"sourcesContent":["import type React from 'react'\n\nimport type { ImportMap, PayloadComponent } from '../../index.js'\n\n/**\n * Pluggable component renderer.\n * RSC-capable frameworks use the current RenderServerComponent logic.\n * Non-RSC frameworks treat all components as client components.\n */\nexport type ComponentRenderer = (args: {\n readonly clientProps?: object\n readonly Component?:\n | PayloadComponent\n | PayloadComponent[]\n | React.ComponentType\n | React.ComponentType[]\n readonly Fallback?: React.ComponentType\n readonly importMap: ImportMap\n readonly key?: string\n readonly serverProps?: object\n}) => React.ReactNode\n"],"names":[],"mappings":"AAIA;;;;CAIC,GACD,WAWqB"}
@@ -44,6 +44,14 @@ export type RouterAdapterRouter = {
44
44
  replace: (path: string, options?: {
45
45
  scroll?: boolean;
46
46
  }) => void;
47
+ /**
48
+ * Use this property to standardize behaviors across different router implementations.
49
+ * Set it up to sync client state to the URL without triggering a second server load.
50
+ *
51
+ * In Next.js, calling `window.history.replaceState` directly is sufficient, as Next.js does not observe history mutations.
52
+ * In TanStack Router, however, `history.replaceState` is monkeypatched to notify the router of changes.
53
+ */
54
+ replaceState?: (url: string) => void;
47
55
  };
48
56
  export type LinkAdapterProps = {
49
57
  children?: React.ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/router.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,aAAa,CAAC;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC,CAAA;AAEvF,MAAM,MAAM,mBAAmB,GAAG;IAChC;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB;;OAEG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAA;IAC5D;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAA;CAChE,CAA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AAS,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IAClC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/adapters/router.ts"],"sourcesContent":["import type React from 'react'\n\n/**\n * Client-side router adapter to abstract away framework-specific routing implementations.\n * This way plugins and server components can use server-only APIs without directly importing any framework-specific modules.\n *\n * @example\n * ```tsx\n * // Next.js router adapter (simplified):\n * import { useRouter as useNextRouter, usePathname as useNextPathname } from 'next/navigation'\n *\n * const NextRouterAdapter: RouterAdapterComponent = ({ children }) => {\n * const router = useNextRouter()\n * const pathname = useNextPathname()\n *\n * return (\n * <RouterAdapterContext value={{ router, pathname, ... }}>\n * {children}\n * </RouterAdapterContext>\n * )\n * }\n * ```\n */\nexport type RouterAdapterComponent = React.ComponentType<{ children: React.ReactNode }>\n\nexport type RouterAdapterRouter = {\n /**\n * Navigate back to the previous page in the history stack.\n */\n back: () => void\n /**\n * Navigate to a new path.\n */\n push: (path: string, options?: { scroll?: boolean }) => void\n /**\n * Refresh the current route.\n */\n refresh: () => void\n /**\n * Replace the current path with a new one.\n */\n replace: (path: string, options?: { scroll?: boolean }) => void\n}\n\nexport type LinkAdapterProps = {\n children?: React.ReactNode\n href: string\n prefetch?: boolean\n ref?: React.Ref<HTMLAnchorElement>\n replace?: boolean\n scroll?: boolean\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>\n"],"names":[],"mappings":"AA4CA,WAO+D"}
1
+ {"version":3,"sources":["../../../src/admin/adapters/router.ts"],"sourcesContent":["import type React from 'react'\n\n/**\n * Client-side router adapter to abstract away framework-specific routing implementations.\n * This way plugins and server components can use server-only APIs without directly importing any framework-specific modules.\n *\n * @example\n * ```tsx\n * // Next.js router adapter (simplified):\n * import { useRouter as useNextRouter, usePathname as useNextPathname } from 'next/navigation'\n *\n * const NextRouterAdapter: RouterAdapterComponent = ({ children }) => {\n * const router = useNextRouter()\n * const pathname = useNextPathname()\n *\n * return (\n * <RouterAdapterContext value={{ router, pathname, ... }}>\n * {children}\n * </RouterAdapterContext>\n * )\n * }\n * ```\n */\nexport type RouterAdapterComponent = React.ComponentType<{ children: React.ReactNode }>\n\nexport type RouterAdapterRouter = {\n /**\n * Navigate back to the previous page in the history stack.\n */\n back: () => void\n /**\n * Navigate to a new path.\n */\n push: (path: string, options?: { scroll?: boolean }) => void\n /**\n * Refresh the current route.\n */\n refresh: () => void\n /**\n * Replace the current path with a new one.\n */\n replace: (path: string, options?: { scroll?: boolean }) => void\n /**\n * Use this property to standardize behaviors across different router implementations.\n * Set it up to sync client state to the URL without triggering a second server load.\n *\n * In Next.js, calling `window.history.replaceState` directly is sufficient, as Next.js does not observe history mutations.\n * In TanStack Router, however, `history.replaceState` is monkeypatched to notify the router of changes.\n */\n replaceState?: (url: string) => void\n}\n\nexport type LinkAdapterProps = {\n children?: React.ReactNode\n href: string\n prefetch?: boolean\n ref?: React.Ref<HTMLAnchorElement>\n replace?: boolean\n scroll?: boolean\n} & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>\n"],"names":[],"mappings":"AAoDA,WAO+D"}
@@ -0,0 +1,36 @@
1
+ import type { I18nClient } from '@payloadcms/translations';
2
+ import type React from 'react';
3
+ import type { MetaConfig, SanitizedConfig } from '../../config/types.js';
4
+ /**
5
+ * Signature for ui-side view metadata generators. Returns a framework-agnostic
6
+ * `MetaConfig` that adapter-side code formats into framework metadata.
7
+ */
8
+ export type GenerateViewMetadata = (args: {
9
+ config: SanitizedConfig;
10
+ i18n: I18nClient;
11
+ isEditing?: boolean;
12
+ params?: {
13
+ [key: string]: string | string[];
14
+ };
15
+ }) => Promise<MetaConfig>;
16
+ /**
17
+ * One entry in a framework's `AdminViewAdapter`. Pairs a React component with
18
+ * a metadata generator. `TComponentProps` and `TMetadata` are framework-specific
19
+ * (Next narrows `TMetadata` to `next`'s `Metadata` type).
20
+ */
21
+ export type AdminView<TComponentProps = any, TMetadata = unknown> = {
22
+ Component: React.ComponentType<TComponentProps>;
23
+ generateMetadata: (args: Parameters<GenerateViewMetadata>[0]) => Promise<TMetadata>;
24
+ };
25
+ /**
26
+ * The canonical set of admin view keys that every framework adapter must implement.
27
+ * Adding a new admin view requires adding its key here so all adapters stay in sync.
28
+ */
29
+ export type AdminViewKey = 'account' | 'createFirstUser' | 'dashboard' | 'forgot' | 'login' | 'logout' | 'logoutInactivity' | 'notFound' | 'reset' | 'unauthorized' | 'unauthorizedWithGutter' | 'verify';
30
+ /**
31
+ * Keyed map of `AdminView` — exactly one entry per `AdminViewKey`.
32
+ * Framework adapters export an instance of this; missing or misspelled keys are
33
+ * a type error.
34
+ */
35
+ export type AdminViewAdapter<TComponentProps = any, TMetadata = unknown> = Record<AdminViewKey, AdminView<TComponentProps, TMetadata>>;
36
+ //# sourceMappingURL=views.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views.d.ts","sourceRoot":"","sources":["../../../src/admin/adapters/views.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAExE;;;GAGG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE;IACxC,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,UAAU,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAA;CAC9C,KAAK,OAAO,CAAC,UAAU,CAAC,CAAA;AAEzB;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,eAAe,GAAG,GAAG,EAAE,SAAS,GAAG,OAAO,IAAI;IAClE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,eAAe,CAAC,CAAA;IAC/C,gBAAgB,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,SAAS,CAAC,CAAA;CACpF,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GACpB,SAAS,GACT,iBAAiB,GACjB,WAAW,GACX,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,kBAAkB,GAClB,UAAU,GACV,OAAO,GACP,cAAc,GACd,wBAAwB,GACxB,QAAQ,CAAA;AAEZ;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,CAAC,eAAe,GAAG,GAAG,EAAE,SAAS,GAAG,OAAO,IAAI,MAAM,CAC/E,YAAY,EACZ,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC,CACtC,CAAA"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Keyed map of `AdminView` — exactly one entry per `AdminViewKey`.
3
+ * Framework adapters export an instance of this; missing or misspelled keys are
4
+ * a type error.
5
+ */ export { };
6
+
7
+ //# sourceMappingURL=views.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/admin/adapters/views.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type React from 'react'\n\nimport type { MetaConfig, SanitizedConfig } from '../../config/types.js'\n\n/**\n * Signature for ui-side view metadata generators. Returns a framework-agnostic\n * `MetaConfig` that adapter-side code formats into framework metadata.\n */\nexport type GenerateViewMetadata = (args: {\n config: SanitizedConfig\n i18n: I18nClient\n isEditing?: boolean\n params?: { [key: string]: string | string[] }\n}) => Promise<MetaConfig>\n\n/**\n * One entry in a framework's `AdminViewAdapter`. Pairs a React component with\n * a metadata generator. `TComponentProps` and `TMetadata` are framework-specific\n * (Next narrows `TMetadata` to `next`'s `Metadata` type).\n */\nexport type AdminView<TComponentProps = any, TMetadata = unknown> = {\n Component: React.ComponentType<TComponentProps>\n generateMetadata: (args: Parameters<GenerateViewMetadata>[0]) => Promise<TMetadata>\n}\n\n/**\n * The canonical set of admin view keys that every framework adapter must implement.\n * Adding a new admin view requires adding its key here so all adapters stay in sync.\n */\nexport type AdminViewKey =\n | 'account'\n | 'createFirstUser'\n | 'dashboard'\n | 'forgot'\n | 'login'\n | 'logout'\n | 'logoutInactivity'\n | 'notFound'\n | 'reset'\n | 'unauthorized'\n | 'unauthorizedWithGutter'\n | 'verify'\n\n/**\n * Keyed map of `AdminView` — exactly one entry per `AdminViewKey`.\n * Framework adapters export an instance of this; missing or misspelled keys are\n * a type error.\n */\nexport type AdminViewAdapter<TComponentProps = any, TMetadata = unknown> = Record<\n AdminViewKey,\n AdminView<TComponentProps, TMetadata>\n>\n"],"names":[],"mappings":"AA4CA;;;;CAIC,GACD,WAGC"}
@@ -3,8 +3,8 @@ import type { RowField, RowFieldClient } from '../../fields/config/types.js';
3
3
  import type { ClientComponentProps, ClientFieldBase, FieldClientComponent, FieldPaths, FieldServerComponent, ServerFieldBase } from '../forms/Field.js';
4
4
  import type { FieldDescriptionClientComponent, FieldDescriptionServerComponent, FieldDiffClientComponent, FieldDiffServerComponent, FieldErrorClientComponent, FieldErrorServerComponent, FieldLabelClientComponent, FieldLabelServerComponent } from '../types.js';
5
5
  type RowFieldClientWithoutType = MarkOptional<RowFieldClient, 'type'>;
6
- type RowFieldBaseClientProps = Omit<FieldPaths, 'path'> & Pick<ClientComponentProps, 'forceRender'>;
7
- export type RowFieldClientProps = Omit<ClientFieldBase<RowFieldClientWithoutType>, 'path'> & RowFieldBaseClientProps;
6
+ type RowFieldBaseClientProps = FieldPaths & Pick<ClientComponentProps, 'forceRender'>;
7
+ export type RowFieldClientProps = ClientFieldBase<RowFieldClientWithoutType> & RowFieldBaseClientProps;
8
8
  export type RowFieldServerProps = ServerFieldBase<RowField, RowFieldClientWithoutType>;
9
9
  export type RowFieldServerComponent = FieldServerComponent<RowField, RowFieldClientWithoutType>;
10
10
  export type RowFieldClientComponent = FieldClientComponent<RowFieldClientWithoutType, RowFieldBaseClientProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"Row.d.ts","sourceRoot":"","sources":["../../../src/admin/fields/Row.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC5E,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EACf,oBAAoB,EACpB,UAAU,EACV,oBAAoB,EACpB,eAAe,EAChB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EACV,+BAA+B,EAC/B,+BAA+B,EAC/B,wBAAwB,EACxB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,aAAa,CAAA;AAEpB,KAAK,yBAAyB,GAAG,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AAErE,KAAK,uBAAuB,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC,CAAA;AAEnG,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC,GACxF,uBAAuB,CAAA;AAEzB,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,QAAQ,EAAE,yBAAyB,CAAC,CAAA;AAEtF,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,QAAQ,EAAE,yBAAyB,CAAC,CAAA;AAE/F,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CACxD,yBA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AoB,EAAE,aAAa,CAAC,CAAA;AAErF,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,yBAAyB,CAAC,GAC1E,uBAAuB,CAAA;AAEzB,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,QAAQ,EAAE,yBAAyB,CAAC,CAAA;AAEtF,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC,QAAQ,EAAE,yBAAyB,CAAC,CAAA;AAE/F,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CACxD,yBAAyB,EACzB,uBAAuB,CACxB,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,CAClE,QAAQ,EACR,yBAAyB,CAC1B,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,CAAC,yBAAyB,CAAC,CAAA;AAE/F,MAAM,MAAM,kCAAkC,GAAG,+BAA+B,CAC9E,QAAQ,EACR,yBAAyB,CAC1B,CAAA;AAED,MAAM,MAAM,kCAAkC,GAC5C,+BAA+B,CAAC,yBAAyB,CAAC,CAAA;AAE5D,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,CAClE,QAAQ,EACR,yBAAyB,CAC1B,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG,yBAAyB,CAAC,yBAAyB,CAAC,CAAA;AAE/F,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;AAE5F,MAAM,MAAM,2BAA2B,GAAG,wBAAwB,CAAC,cAAc,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/fields/Row.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { RowField, RowFieldClient } from '../../fields/config/types.js'\nimport type {\n ClientComponentProps,\n ClientFieldBase,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerFieldBase,\n} from '../forms/Field.js'\nimport type {\n FieldDescriptionClientComponent,\n FieldDescriptionServerComponent,\n FieldDiffClientComponent,\n FieldDiffServerComponent,\n FieldErrorClientComponent,\n FieldErrorServerComponent,\n FieldLabelClientComponent,\n FieldLabelServerComponent,\n} from '../types.js'\n\ntype RowFieldClientWithoutType = MarkOptional<RowFieldClient, 'type'>\n\ntype RowFieldBaseClientProps = Omit<FieldPaths, 'path'> & Pick<ClientComponentProps, 'forceRender'>\n\nexport type RowFieldClientProps = Omit<ClientFieldBase<RowFieldClientWithoutType>, 'path'> &\n RowFieldBaseClientProps\n\nexport type RowFieldServerProps = ServerFieldBase<RowField, RowFieldClientWithoutType>\n\nexport type RowFieldServerComponent = FieldServerComponent<RowField, RowFieldClientWithoutType>\n\nexport type RowFieldClientComponent = FieldClientComponent<\n RowFieldClientWithoutType,\n RowFieldBaseClientProps\n>\n\nexport type RowFieldLabelServerComponent = FieldLabelServerComponent<\n RowField,\n RowFieldClientWithoutType\n>\n\nexport type RowFieldLabelClientComponent = FieldLabelClientComponent<RowFieldClientWithoutType>\n\nexport type RowFieldDescriptionServerComponent = FieldDescriptionServerComponent<\n RowField,\n RowFieldClientWithoutType\n>\n\nexport type RowFieldDescriptionClientComponent =\n FieldDescriptionClientComponent<RowFieldClientWithoutType>\n\nexport type RowFieldErrorServerComponent = FieldErrorServerComponent<\n RowField,\n RowFieldClientWithoutType\n>\n\nexport type RowFieldErrorClientComponent = FieldErrorClientComponent<RowFieldClientWithoutType>\n\nexport type RowFieldDiffServerComponent = FieldDiffServerComponent<RowField, RowFieldClient>\n\nexport type RowFieldDiffClientComponent = FieldDiffClientComponent<RowFieldClient>\n"],"names":[],"mappings":"AA8DA,WAAkF"}
1
+ {"version":3,"sources":["../../../src/admin/fields/Row.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { RowField, RowFieldClient } from '../../fields/config/types.js'\nimport type {\n ClientComponentProps,\n ClientFieldBase,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerFieldBase,\n} from '../forms/Field.js'\nimport type {\n FieldDescriptionClientComponent,\n FieldDescriptionServerComponent,\n FieldDiffClientComponent,\n FieldDiffServerComponent,\n FieldErrorClientComponent,\n FieldErrorServerComponent,\n FieldLabelClientComponent,\n FieldLabelServerComponent,\n} from '../types.js'\n\ntype RowFieldClientWithoutType = MarkOptional<RowFieldClient, 'type'>\n\ntype RowFieldBaseClientProps = FieldPaths & Pick<ClientComponentProps, 'forceRender'>\n\nexport type RowFieldClientProps = ClientFieldBase<RowFieldClientWithoutType> &\n RowFieldBaseClientProps\n\nexport type RowFieldServerProps = ServerFieldBase<RowField, RowFieldClientWithoutType>\n\nexport type RowFieldServerComponent = FieldServerComponent<RowField, RowFieldClientWithoutType>\n\nexport type RowFieldClientComponent = FieldClientComponent<\n RowFieldClientWithoutType,\n RowFieldBaseClientProps\n>\n\nexport type RowFieldLabelServerComponent = FieldLabelServerComponent<\n RowField,\n RowFieldClientWithoutType\n>\n\nexport type RowFieldLabelClientComponent = FieldLabelClientComponent<RowFieldClientWithoutType>\n\nexport type RowFieldDescriptionServerComponent = FieldDescriptionServerComponent<\n RowField,\n RowFieldClientWithoutType\n>\n\nexport type RowFieldDescriptionClientComponent =\n FieldDescriptionClientComponent<RowFieldClientWithoutType>\n\nexport type RowFieldErrorServerComponent = FieldErrorServerComponent<\n RowField,\n RowFieldClientWithoutType\n>\n\nexport type RowFieldErrorClientComponent = FieldErrorClientComponent<RowFieldClientWithoutType>\n\nexport type RowFieldDiffServerComponent = FieldDiffServerComponent<RowField, RowFieldClient>\n\nexport type RowFieldDiffClientComponent = FieldDiffClientComponent<RowFieldClient>\n"],"names":[],"mappings":"AA8DA,WAAkF"}
@@ -1,9 +1,9 @@
1
- import type { I18nClient, TFunction } from '@payloadcms/translations';
1
+ import type { ClientTranslationKeys, I18nClient, TFunction } from '@payloadcms/translations';
2
2
  import type { Field } from '../../fields/config/types.js';
3
3
  import type { ClientFieldWithOptionalType, ServerComponentProps } from './Field.js';
4
4
  export type DescriptionFunction = (args: {
5
5
  i18n: I18nClient;
6
- t: TFunction;
6
+ t: TFunction<ClientTranslationKeys>;
7
7
  }) => string;
8
8
  export type FieldDescriptionClientComponent<TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = React.ComponentType<FieldDescriptionClientProps<TFieldClient>>;
9
9
  export type FieldDescriptionServerComponent<TFieldServer extends Field = Field, TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = React.ComponentType<FieldDescriptionServerProps<TFieldServer, TFieldClient>>;
@@ -1 +1 @@
1
- {"version":3,"file":"Description.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Description.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAErE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACzD,OAAO,KAAK,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEnF,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,CAAC,EAAE,SAAS,CAAA;CAAE,KAAK,MAAM,CAAA;AAEtF,MAAM,MAAM,+BAA+B,CACzC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E,KAAK,CAAC,aAAa,CAAC,2BAA2B,CAAC,YAAY,CAAC,CAAC,CAAA;AAElE,MAAM,MAAM,+BAA+B,CACzC,YAAY,SAAS,KAAK,GAAG,KAAK,EAClC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E,KAAK,CAAC,aAAa,CAAC,2BAA2B,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;AAEhF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;AAE/D,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,iBAAiB,CAAA;AAEjE,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,SA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AG,2BAA2B,IAC5E,KAAK,CAAC,aAAa,CAAC,2BAA2B,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA;AAEhF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;AAE/D,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,iBAAiB,CAAA;AAEjE,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAA;IACxC,QAAQ,CAAC,eAAe,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,MAAM,MAAM,2BAA2B,CACrC,YAAY,SAAS,KAAK,GAAG,KAAK,EAClC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E;IACF,WAAW,EAAE,YAAY,CAAA;IACzB,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;CAC7B,GAAG,uBAAuB,GACzB,oBAAoB,CAAA;AAEtB,MAAM,MAAM,2BAA2B,CACrC,YAAY,SAAS,2BAA2B,GAAG,2BAA2B,IAC5E;IACF,KAAK,EAAE,YAAY,CAAA;CACpB,GAAG,uBAAuB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/forms/Description.ts"],"sourcesContent":["import type { I18nClient, TFunction } from '@payloadcms/translations'\n\nimport type { Field } from '../../fields/config/types.js'\nimport type { ClientFieldWithOptionalType, ServerComponentProps } from './Field.js'\n\nexport type DescriptionFunction = (args: { i18n: I18nClient; t: TFunction }) => string\n\nexport type FieldDescriptionClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldDescriptionClientProps<TFieldClient>>\n\nexport type FieldDescriptionServerComponent<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldDescriptionServerProps<TFieldServer, TFieldClient>>\n\nexport type StaticDescription = Record<string, string> | string\n\nexport type Description = DescriptionFunction | StaticDescription\n\nexport type GenericDescriptionProps = {\n readonly className?: string\n readonly description?: StaticDescription\n readonly marginPlacement?: 'bottom' | 'top'\n readonly path: string\n}\n\nexport type FieldDescriptionServerProps<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n clientField: TFieldClient\n readonly field: TFieldServer\n} & GenericDescriptionProps &\n ServerComponentProps\n\nexport type FieldDescriptionClientProps<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n field: TFieldClient\n} & GenericDescriptionProps\n"],"names":[],"mappings":"AAoCA,WAI2B"}
1
+ {"version":3,"sources":["../../../src/admin/forms/Description.ts"],"sourcesContent":["import type { ClientTranslationKeys, I18nClient, TFunction } from '@payloadcms/translations'\n\nimport type { Field } from '../../fields/config/types.js'\nimport type { ClientFieldWithOptionalType, ServerComponentProps } from './Field.js'\n\nexport type DescriptionFunction = (args: {\n i18n: I18nClient\n t: TFunction<ClientTranslationKeys>\n}) => string\n\nexport type FieldDescriptionClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldDescriptionClientProps<TFieldClient>>\n\nexport type FieldDescriptionServerComponent<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = React.ComponentType<FieldDescriptionServerProps<TFieldServer, TFieldClient>>\n\nexport type StaticDescription = Record<string, string> | string\n\nexport type Description = DescriptionFunction | StaticDescription\n\nexport type GenericDescriptionProps = {\n readonly className?: string\n readonly description?: StaticDescription\n readonly marginPlacement?: 'bottom' | 'top'\n readonly path: string\n}\n\nexport type FieldDescriptionServerProps<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n clientField: TFieldClient\n readonly field: TFieldServer\n} & GenericDescriptionProps &\n ServerComponentProps\n\nexport type FieldDescriptionClientProps<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n field: TFieldClient\n} & GenericDescriptionProps\n"],"names":[],"mappings":"AAuCA,WAI2B"}
@@ -2,9 +2,10 @@ import type { I18nClient } from '@payloadcms/translations';
2
2
  import type { MarkOptional } from 'ts-essentials';
3
3
  import type { SanitizedFieldPermissions } from '../../auth/types.js';
4
4
  import type { ClientBlock, ClientField, Field } from '../../fields/config/types.js';
5
- import type { TypedUser } from '../../index.js';
5
+ import type { User } from '../../index.js';
6
6
  import type { DocumentPreferences } from '../../preferences/types.js';
7
7
  import type { Operation, Payload, PayloadRequest } from '../../types/index.js';
8
+ import type { ComponentRenderer } from '../adapters/render.js';
8
9
  import type { ClientFieldSchemaMap, ClientTab, Data, FieldSchemaMap, FormField, FormState, RenderedField } from '../types.js';
9
10
  export type ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>;
10
11
  export type ClientComponentProps = {
@@ -50,11 +51,9 @@ export type FieldPaths = {
50
51
  * Nested fields will have a path that includes the parent field names
51
52
  * if they are nested within a group, array, block or named tab.
52
53
  *
53
- * Collapsibles and unnamed tabs will have arbitrary paths
54
+ * Collapsibles, rows and unnamed tabs will have arbitrary paths
54
55
  * that look like _index-0, _index-1, etc.
55
56
  *
56
- * Row fields will not have a path.
57
- *
58
57
  * @example 'parentGroupField.childTextField'
59
58
  *
60
59
  * @default field.name
@@ -85,9 +84,15 @@ export type ServerComponentProps = {
85
84
  payload: Payload;
86
85
  permissions: SanitizedFieldPermissions;
87
86
  preferences: DocumentPreferences;
87
+ /**
88
+ * Adapter-injected component renderer. Server components can use this
89
+ * to render other import map components without importing a
90
+ * framework-specific renderer directly.
91
+ */
92
+ renderComponent?: ComponentRenderer;
88
93
  req: PayloadRequest;
89
94
  siblingData: Data;
90
- user: TypedUser;
95
+ user: User;
91
96
  value?: unknown;
92
97
  };
93
98
  export type ClientFieldBase<TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType> = {
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/admin/forms/Field.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AACrE,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC9E,OAAO,KAAK,EACV,oBAAoB,EACpB,SAAS,EACT,IAAI,EACJ,cAAc,EACd,SAAS,EACT,SAAS,EACT,aAAa,EACd,MAAM,aAAa,CAAA;AAEpB,MAAM,MAAM,2BAA2B,GAAG,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;AAE3E,MAAM,MAAM,oBAAoB,GAAG;IACjC,gBAAgB,CAAC,EAAE,SAAS,CAAC,kBAAkB,CAAC,CAAA;IAChD,KAAK,EAAE,WAAW,GAAG,WAAW,GAAG,SAAS,CAAA;IAC5C;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,WAAW,CAAC,EAAE,yBAAyB,CAAA;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,aAAa,EAAE,CAAA;IAChC;;;;;QAKI;IACJ,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAG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OAAO,CAAC,IACvE,KAAK,CAAC,aAAa,CAAC,eAAe,GAAG,eAAe,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/admin/forms/Field.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { MarkOptional } from 'ts-essentials'\n\nimport type { SanitizedFieldPermissions } from '../../auth/types.js'\nimport type { ClientBlock, ClientField, Field } from '../../fields/config/types.js'\nimport type { TypedUser } from '../../index.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { Operation, Payload, PayloadRequest } from '../../types/index.js'\nimport type {\n ClientFieldSchemaMap,\n ClientTab,\n Data,\n FieldSchemaMap,\n FormField,\n FormState,\n RenderedField,\n} from '../types.js'\n\nexport type ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>\n\nexport type ClientComponentProps = {\n customComponents?: FormField['customComponents']\n field: ClientBlock | ClientField | ClientTab\n /**\n * Controls the rendering behavior of the fields, i.e. defers rendering until they intersect with the viewport using the Intersection Observer API.\n *\n * If true, the fields will be rendered immediately, rather than waiting for them to intersect with the viewport.\n *\n * If a number is provided, will immediately render fields _up to that index_.\n */\n forceRender?: boolean\n permissions?: SanitizedFieldPermissions\n readOnly?: boolean\n renderedBlocks?: RenderedField[]\n /**\n * Used to extract field configs from a schemaMap.\n * Does not include indexes.\n *\n * @default field.name\n **/\n schemaPath?: string\n}\n\n// TODO: maybe we can come up with a better name?\nexport type FieldPaths = {\n /**\n * @default ''\n */\n indexPath?: string\n /**\n * @default ''\n */\n parentPath?: string\n /**\n * The path built up to the point of the field\n * excluding the field name.\n *\n * @default ''\n */\n parentSchemaPath?: string\n /**\n * A built up path to access FieldState in the form state.\n * Nested fields will have a path that includes the parent field names\n * if they are nested within a group, array, block or named tab.\n *\n * Collapsibles and unnamed tabs will have arbitrary paths\n * that look like _index-0, _index-1, etc.\n *\n * Row fields will not have a path.\n *\n * @example 'parentGroupField.childTextField'\n *\n * @default field.name\n */\n path: string\n}\n\n/**\n * TODO: This should be renamed to `FieldComponentServerProps` or similar\n */\nexport type ServerComponentProps = {\n clientField: ClientFieldWithOptionalType\n clientFieldSchemaMap: ClientFieldSchemaMap\n collectionSlug: string\n data: Data\n field: Field\n /**\n * The fieldSchemaMap that is created before form state is built is made available here.\n */\n fieldSchemaMap: FieldSchemaMap\n /**\n * Server Components will also have available to the entire form state.\n * We cannot add it to ClientComponentProps as that would blow up the size of the props sent to the client.\n */\n formState: FormState\n i18n: I18nClient\n id?: number | string\n operation: Operation\n payload: Payload\n permissions: SanitizedFieldPermissions\n preferences: DocumentPreferences\n req: PayloadRequest\n siblingData: Data\n user: TypedUser\n value?: unknown\n}\n\nexport type ClientFieldBase<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n readonly field: TFieldClient\n} & Omit<ClientComponentProps, 'customComponents' | 'field'>\n\nexport type ServerFieldBase<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n readonly clientField: TFieldClient\n readonly field: TFieldServer\n} & Omit<ClientComponentProps, 'field'> &\n Omit<ServerComponentProps, 'clientField' | 'field'>\n\nexport type FieldClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ClientFieldBase<TFieldClient>>\n\nexport type FieldServerComponent<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ServerFieldBase<TFieldServer, TFieldClient>>\n"],"names":[],"mappings":"AA+HA,WAIsF"}
1
+ {"version":3,"sources":["../../../src/admin/forms/Field.ts"],"sourcesContent":["import type { I18nClient } from '@payloadcms/translations'\nimport type { MarkOptional } from 'ts-essentials'\n\nimport type { SanitizedFieldPermissions } from '../../auth/types.js'\nimport type { ClientBlock, ClientField, Field } from '../../fields/config/types.js'\nimport type { User } from '../../index.js'\nimport type { DocumentPreferences } from '../../preferences/types.js'\nimport type { Operation, Payload, PayloadRequest } from '../../types/index.js'\nimport type { ComponentRenderer } from '../adapters/render.js'\nimport type {\n ClientFieldSchemaMap,\n ClientTab,\n Data,\n FieldSchemaMap,\n FormField,\n FormState,\n RenderedField,\n} from '../types.js'\n\nexport type ClientFieldWithOptionalType = MarkOptional<ClientField, 'type'>\n\nexport type ClientComponentProps = {\n customComponents?: FormField['customComponents']\n field: ClientBlock | ClientField | ClientTab\n /**\n * Controls the rendering behavior of the fields, i.e. defers rendering until they intersect with the viewport using the Intersection Observer API.\n *\n * If true, the fields will be rendered immediately, rather than waiting for them to intersect with the viewport.\n *\n * If a number is provided, will immediately render fields _up to that index_.\n */\n forceRender?: boolean\n permissions?: SanitizedFieldPermissions\n readOnly?: boolean\n renderedBlocks?: RenderedField[]\n /**\n * Used to extract field configs from a schemaMap.\n * Does not include indexes.\n *\n * @default field.name\n **/\n schemaPath?: string\n}\n\n// TODO: maybe we can come up with a better name?\nexport type FieldPaths = {\n /**\n * @default ''\n */\n indexPath?: string\n /**\n * @default ''\n */\n parentPath?: string\n /**\n * The path built up to the point of the field\n * excluding the field name.\n *\n * @default ''\n */\n parentSchemaPath?: string\n /**\n * A built up path to access FieldState in the form state.\n * Nested fields will have a path that includes the parent field names\n * if they are nested within a group, array, block or named tab.\n *\n * Collapsibles, rows and unnamed tabs will have arbitrary paths\n * that look like _index-0, _index-1, etc.\n *\n * @example 'parentGroupField.childTextField'\n *\n * @default field.name\n */\n path: string\n}\n\n/**\n * TODO: This should be renamed to `FieldComponentServerProps` or similar\n */\nexport type ServerComponentProps = {\n clientField: ClientFieldWithOptionalType\n clientFieldSchemaMap: ClientFieldSchemaMap\n collectionSlug: string\n data: Data\n field: Field\n /**\n * The fieldSchemaMap that is created before form state is built is made available here.\n */\n fieldSchemaMap: FieldSchemaMap\n /**\n * Server Components will also have available to the entire form state.\n * We cannot add it to ClientComponentProps as that would blow up the size of the props sent to the client.\n */\n formState: FormState\n i18n: I18nClient\n id?: number | string\n operation: Operation\n payload: Payload\n permissions: SanitizedFieldPermissions\n preferences: DocumentPreferences\n /**\n * Adapter-injected component renderer. Server components can use this\n * to render other import map components without importing a\n * framework-specific renderer directly.\n */\n renderComponent?: ComponentRenderer\n req: PayloadRequest\n siblingData: Data\n user: User\n value?: unknown\n}\n\nexport type ClientFieldBase<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n readonly field: TFieldClient\n} & Omit<ClientComponentProps, 'customComponents' | 'field'>\n\nexport type ServerFieldBase<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n> = {\n readonly clientField: TFieldClient\n readonly field: TFieldServer\n} & Omit<ClientComponentProps, 'field'> &\n Omit<ServerComponentProps, 'clientField' | 'field'>\n\nexport type FieldClientComponent<\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ClientFieldBase<TFieldClient>>\n\nexport type FieldServerComponent<\n TFieldServer extends Field = Field,\n TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,\n AdditionalProps extends Record<string, unknown> = Record<string, unknown>,\n> = React.ComponentType<AdditionalProps & ServerFieldBase<TFieldServer, TFieldClient>>\n"],"names":[],"mappings":"AAoIA,WAIsF"}
@@ -2,10 +2,11 @@ import type { AcceptedLanguages } from '@payloadcms/translations';
2
2
  import type { ImportMap } from '../../bin/generateImportMap/index.js';
3
3
  import type { Locale, SanitizedConfig } from '../../config/types.js';
4
4
  import type { PaginatedDocs } from '../../database/types.js';
5
- import type { Slugify } from '../../fields/baseFields/slug/index.js';
6
- import type { CollectionSlug, ColumnPreference, FieldPaths, GlobalSlug, SanitizedPermissions } from '../../index.js';
5
+ import type { Slugify } from '../../fields/baseFields/slug/types.js';
6
+ import type { CollectionSlug, ColumnPreference, DefaultDocumentIDType, FieldPaths, GlobalSlug, SanitizedPermissions } from '../../index.js';
7
7
  import type { PayloadRequest, Sort, Where } from '../../types/index.js';
8
8
  import type { ColumnsFromURL } from '../../utilities/transformColumnPreferences.js';
9
+ import type { ComponentRenderer } from '../adapters/render.js';
9
10
  export type InitReqResult = {
10
11
  cookies: Map<string, string>;
11
12
  headers: Headers;
@@ -16,6 +17,7 @@ export type InitReqResult = {
16
17
  };
17
18
  export type DefaultServerFunctionArgs = {
18
19
  importMap: ImportMap;
20
+ renderComponent?: ComponentRenderer;
19
21
  } & Pick<InitReqResult, 'cookies' | 'locale' | 'permissions' | 'req'>;
20
22
  export type ServerFunctionArgs = {
21
23
  args: Record<string, unknown>;
@@ -96,6 +98,15 @@ export type BuildTableStateArgs = {
96
98
  export type SlugifyServerFunctionArgs = {
97
99
  collectionSlug?: CollectionSlug;
98
100
  globalSlug?: GlobalSlug;
101
+ /**
102
+ * Current doc ID, needed to exclude this doc from uniqueness checks.
103
+ * This ensures that this doc can reuse its own slug rather than bumping past itself when regenerating.
104
+ */
105
+ id?: DefaultDocumentIDType;
106
+ /**
107
+ * Active admin locale, so a localized slug's fallback is deduped within the right locale.
108
+ */
109
+ locale?: Locale['code'];
99
110
  path?: FieldPaths['path'];
100
111
  } & Omit<Parameters<Slugify>[0], 'req'>;
101
112
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/admin/functions/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAA;AACrE,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CA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