payload 4.0.0-internal.2fddfc0 → 4.0.0-internal.3aa3d85

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 (262) hide show
  1. package/LICENSE.md +1 -1
  2. package/bin.js +11 -0
  3. package/dist/admin/RichText.d.ts +1 -21
  4. package/dist/admin/RichText.d.ts.map +1 -1
  5. package/dist/admin/RichText.js.map +1 -1
  6. package/dist/admin/forms/Field.d.ts +2 -2
  7. package/dist/admin/forms/Field.d.ts.map +1 -1
  8. package/dist/admin/forms/Field.js.map +1 -1
  9. package/dist/admin/forms/Form.d.ts +0 -29
  10. package/dist/admin/forms/Form.d.ts.map +1 -1
  11. package/dist/admin/forms/Form.js.map +1 -1
  12. package/dist/admin/functions/index.d.ts +1 -1
  13. package/dist/admin/functions/index.js.map +1 -1
  14. package/dist/admin/types.d.ts +1 -0
  15. package/dist/admin/types.d.ts.map +1 -1
  16. package/dist/admin/types.js.map +1 -1
  17. package/dist/auth/operations/auth.d.ts +2 -2
  18. package/dist/auth/operations/auth.d.ts.map +1 -1
  19. package/dist/auth/operations/auth.js.map +1 -1
  20. package/dist/auth/operations/login.d.ts +2 -1
  21. package/dist/auth/operations/login.d.ts.map +1 -1
  22. package/dist/auth/operations/login.js.map +1 -1
  23. package/dist/auth/operations/me.js.map +1 -1
  24. package/dist/auth/operations/refresh.d.ts.map +1 -1
  25. package/dist/auth/operations/refresh.js +9 -3
  26. package/dist/auth/operations/refresh.js.map +1 -1
  27. package/dist/auth/operations/resetPassword.d.ts.map +1 -1
  28. package/dist/auth/operations/resetPassword.js.map +1 -1
  29. package/dist/auth/sendVerificationEmail.d.ts +2 -2
  30. package/dist/auth/sendVerificationEmail.d.ts.map +1 -1
  31. package/dist/auth/sendVerificationEmail.js +1 -1
  32. package/dist/auth/sendVerificationEmail.js.map +1 -1
  33. package/dist/auth/sessions.d.ts +4 -5
  34. package/dist/auth/sessions.d.ts.map +1 -1
  35. package/dist/auth/sessions.js +5 -3
  36. package/dist/auth/sessions.js.map +1 -1
  37. package/dist/auth/strategies/apiKey.js.map +1 -1
  38. package/dist/auth/strategies/local/incrementLoginAttempts.d.ts +2 -2
  39. package/dist/auth/strategies/local/incrementLoginAttempts.d.ts.map +1 -1
  40. package/dist/auth/strategies/local/incrementLoginAttempts.js +1 -1
  41. package/dist/auth/strategies/local/incrementLoginAttempts.js.map +1 -1
  42. package/dist/auth/types.d.ts +28 -21
  43. package/dist/auth/types.d.ts.map +1 -1
  44. package/dist/auth/types.js.map +1 -1
  45. package/dist/bin/generateImportMap/iterateCollections.d.ts.map +1 -1
  46. package/dist/bin/generateImportMap/iterateCollections.js +10 -0
  47. package/dist/bin/generateImportMap/iterateCollections.js.map +1 -1
  48. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.d.ts.map +1 -1
  49. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js +11 -3
  50. package/dist/bin/generateImportMap/utilities/resolveImportMapFilePath.js.map +1 -1
  51. package/dist/collections/config/client.d.ts +1 -1
  52. package/dist/collections/config/client.d.ts.map +1 -1
  53. package/dist/collections/config/client.js +1 -0
  54. package/dist/collections/config/client.js.map +1 -1
  55. package/dist/collections/config/defaults.d.ts +0 -4
  56. package/dist/collections/config/defaults.d.ts.map +1 -1
  57. package/dist/collections/config/defaults.js +0 -15
  58. package/dist/collections/config/defaults.js.map +1 -1
  59. package/dist/collections/config/types.d.ts +6 -0
  60. package/dist/collections/config/types.d.ts.map +1 -1
  61. package/dist/collections/config/types.js.map +1 -1
  62. package/dist/collections/operations/findDistinct.d.ts.map +1 -1
  63. package/dist/collections/operations/findDistinct.js +1 -0
  64. package/dist/collections/operations/findDistinct.js.map +1 -1
  65. package/dist/collections/operations/local/count.d.ts +3 -3
  66. package/dist/collections/operations/local/count.d.ts.map +1 -1
  67. package/dist/collections/operations/local/count.js.map +1 -1
  68. package/dist/collections/operations/local/countVersions.d.ts +3 -3
  69. package/dist/collections/operations/local/countVersions.d.ts.map +1 -1
  70. package/dist/collections/operations/local/countVersions.js.map +1 -1
  71. package/dist/collections/operations/local/create.d.ts +3 -3
  72. package/dist/collections/operations/local/create.d.ts.map +1 -1
  73. package/dist/collections/operations/local/create.js.map +1 -1
  74. package/dist/collections/operations/local/delete.d.ts +3 -3
  75. package/dist/collections/operations/local/delete.d.ts.map +1 -1
  76. package/dist/collections/operations/local/delete.js.map +1 -1
  77. package/dist/collections/operations/local/duplicate.d.ts +3 -3
  78. package/dist/collections/operations/local/duplicate.d.ts.map +1 -1
  79. package/dist/collections/operations/local/duplicate.js.map +1 -1
  80. package/dist/collections/operations/local/find.d.ts +3 -3
  81. package/dist/collections/operations/local/find.d.ts.map +1 -1
  82. package/dist/collections/operations/local/find.js.map +1 -1
  83. package/dist/collections/operations/local/findByID.d.ts +3 -3
  84. package/dist/collections/operations/local/findByID.d.ts.map +1 -1
  85. package/dist/collections/operations/local/findByID.js.map +1 -1
  86. package/dist/collections/operations/local/findDistinct.d.ts +2 -2
  87. package/dist/collections/operations/local/findDistinct.d.ts.map +1 -1
  88. package/dist/collections/operations/local/findDistinct.js.map +1 -1
  89. package/dist/collections/operations/local/findVersionByID.d.ts +3 -3
  90. package/dist/collections/operations/local/findVersionByID.d.ts.map +1 -1
  91. package/dist/collections/operations/local/findVersionByID.js.map +1 -1
  92. package/dist/collections/operations/local/findVersions.d.ts +3 -3
  93. package/dist/collections/operations/local/findVersions.d.ts.map +1 -1
  94. package/dist/collections/operations/local/findVersions.js.map +1 -1
  95. package/dist/collections/operations/local/restoreVersion.d.ts +3 -3
  96. package/dist/collections/operations/local/restoreVersion.d.ts.map +1 -1
  97. package/dist/collections/operations/local/restoreVersion.js.map +1 -1
  98. package/dist/collections/operations/local/update.d.ts +3 -3
  99. package/dist/collections/operations/local/update.d.ts.map +1 -1
  100. package/dist/collections/operations/local/update.js.map +1 -1
  101. package/dist/collections/operations/utilities/types.d.ts +0 -9
  102. package/dist/collections/operations/utilities/types.d.ts.map +1 -1
  103. package/dist/collections/operations/utilities/types.js.map +1 -1
  104. package/dist/config/client.d.ts +2 -2
  105. package/dist/config/client.d.ts.map +1 -1
  106. package/dist/config/client.js.map +1 -1
  107. package/dist/config/defaults.d.ts +0 -4
  108. package/dist/config/defaults.d.ts.map +1 -1
  109. package/dist/config/defaults.js +0 -78
  110. package/dist/config/defaults.js.map +1 -1
  111. package/dist/config/definePlugin.d.ts +10 -10
  112. package/dist/config/definePlugin.d.ts.map +1 -1
  113. package/dist/config/definePlugin.js +7 -11
  114. package/dist/config/definePlugin.js.map +1 -1
  115. package/dist/config/sanitize.d.ts.map +1 -1
  116. package/dist/config/sanitize.js +137 -13
  117. package/dist/config/sanitize.js.map +1 -1
  118. package/dist/config/types.d.ts +35 -3
  119. package/dist/config/types.d.ts.map +1 -1
  120. package/dist/config/types.js.map +1 -1
  121. package/dist/exports/internal.d.ts +1 -0
  122. package/dist/exports/internal.d.ts.map +1 -1
  123. package/dist/exports/internal.js +1 -0
  124. package/dist/exports/internal.js.map +1 -1
  125. package/dist/exports/shared.d.ts +3 -2
  126. package/dist/exports/shared.d.ts.map +1 -1
  127. package/dist/exports/shared.js +2 -1
  128. package/dist/exports/shared.js.map +1 -1
  129. package/dist/fields/baseFields/slug/countVersions.d.ts.map +1 -1
  130. package/dist/fields/baseFields/slug/countVersions.js +6 -8
  131. package/dist/fields/baseFields/slug/countVersions.js.map +1 -1
  132. package/dist/fields/baseFields/slug/generateSlug.d.ts +14 -7
  133. package/dist/fields/baseFields/slug/generateSlug.d.ts.map +1 -1
  134. package/dist/fields/baseFields/slug/generateSlug.js +53 -73
  135. package/dist/fields/baseFields/slug/generateSlug.js.map +1 -1
  136. package/dist/fields/baseFields/slug/types.d.ts +14 -0
  137. package/dist/fields/baseFields/slug/types.d.ts.map +1 -0
  138. package/dist/fields/baseFields/slug/types.js +6 -0
  139. package/dist/fields/baseFields/slug/types.js.map +1 -0
  140. package/dist/fields/config/client.d.ts +1 -1
  141. package/dist/fields/config/client.d.ts.map +1 -1
  142. package/dist/fields/config/client.js +2 -1
  143. package/dist/fields/config/client.js.map +1 -1
  144. package/dist/fields/config/sanitize.d.ts.map +1 -1
  145. package/dist/fields/config/sanitize.js +39 -0
  146. package/dist/fields/config/sanitize.js.map +1 -1
  147. package/dist/fields/config/types.d.ts +44 -8
  148. package/dist/fields/config/types.d.ts.map +1 -1
  149. package/dist/fields/config/types.js.map +1 -1
  150. package/dist/fields/hooks/afterRead/promise.d.ts.map +1 -1
  151. package/dist/fields/hooks/afterRead/promise.js +11 -1
  152. package/dist/fields/hooks/afterRead/promise.js.map +1 -1
  153. package/dist/fields/hooks/beforeValidate/promise.d.ts.map +1 -1
  154. package/dist/fields/hooks/beforeValidate/promise.js +10 -1
  155. package/dist/fields/hooks/beforeValidate/promise.js.map +1 -1
  156. package/dist/fields/setDefaultBeforeDuplicate.js +1 -0
  157. package/dist/fields/setDefaultBeforeDuplicate.js.map +1 -1
  158. package/dist/fields/sortableFieldTypes.d.ts.map +1 -1
  159. package/dist/fields/sortableFieldTypes.js +1 -0
  160. package/dist/fields/sortableFieldTypes.js.map +1 -1
  161. package/dist/fields/validations.d.ts +4 -1
  162. package/dist/fields/validations.d.ts.map +1 -1
  163. package/dist/fields/validations.js +7 -0
  164. package/dist/fields/validations.js.map +1 -1
  165. package/dist/globals/operations/local/countVersions.d.ts +3 -3
  166. package/dist/globals/operations/local/countVersions.d.ts.map +1 -1
  167. package/dist/globals/operations/local/countVersions.js.map +1 -1
  168. package/dist/globals/operations/local/findOne.d.ts +3 -3
  169. package/dist/globals/operations/local/findOne.d.ts.map +1 -1
  170. package/dist/globals/operations/local/findOne.js.map +1 -1
  171. package/dist/globals/operations/local/findVersionByID.d.ts +3 -3
  172. package/dist/globals/operations/local/findVersionByID.d.ts.map +1 -1
  173. package/dist/globals/operations/local/findVersionByID.js.map +1 -1
  174. package/dist/globals/operations/local/findVersions.d.ts +3 -3
  175. package/dist/globals/operations/local/findVersions.d.ts.map +1 -1
  176. package/dist/globals/operations/local/findVersions.js.map +1 -1
  177. package/dist/globals/operations/local/restoreVersion.d.ts +3 -3
  178. package/dist/globals/operations/local/restoreVersion.d.ts.map +1 -1
  179. package/dist/globals/operations/local/restoreVersion.js.map +1 -1
  180. package/dist/globals/operations/local/update.d.ts +3 -3
  181. package/dist/globals/operations/local/update.d.ts.map +1 -1
  182. package/dist/globals/operations/local/update.js.map +1 -1
  183. package/dist/index.bundled.d.ts +365 -300
  184. package/dist/index.d.ts +59 -15
  185. package/dist/index.d.ts.map +1 -1
  186. package/dist/index.js +1 -2
  187. package/dist/index.js.map +1 -1
  188. package/dist/preferences/keys.d.ts +4 -0
  189. package/dist/preferences/keys.d.ts.map +1 -1
  190. package/dist/preferences/keys.js +4 -1
  191. package/dist/preferences/keys.js.map +1 -1
  192. package/dist/preferences/types.d.ts +15 -0
  193. package/dist/preferences/types.d.ts.map +1 -1
  194. package/dist/preferences/types.js +3 -1
  195. package/dist/preferences/types.js.map +1 -1
  196. package/dist/types/index.d.ts +8 -3
  197. package/dist/types/index.d.ts.map +1 -1
  198. package/dist/types/index.js.map +1 -1
  199. package/dist/uploads/fetchAPI-multipart/processMultipart.d.ts.map +1 -1
  200. package/dist/uploads/fetchAPI-multipart/processMultipart.js +1 -14
  201. package/dist/uploads/fetchAPI-multipart/processMultipart.js.map +1 -1
  202. package/dist/uploads/matchMimeType.d.ts +8 -0
  203. package/dist/uploads/matchMimeType.d.ts.map +1 -0
  204. package/dist/uploads/matchMimeType.js +19 -0
  205. package/dist/uploads/matchMimeType.js.map +1 -0
  206. package/dist/uploads/matchMimeType.spec.js +66 -0
  207. package/dist/uploads/matchMimeType.spec.js.map +1 -0
  208. package/dist/uploads/types.d.ts +21 -0
  209. package/dist/uploads/types.d.ts.map +1 -1
  210. package/dist/uploads/types.js.map +1 -1
  211. package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
  212. package/dist/utilities/addDataAndFileToRequest.js +6 -0
  213. package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
  214. package/dist/utilities/configToJSONSchema.d.ts +13 -4
  215. package/dist/utilities/configToJSONSchema.d.ts.map +1 -1
  216. package/dist/utilities/configToJSONSchema.js +139 -61
  217. package/dist/utilities/configToJSONSchema.js.map +1 -1
  218. package/dist/utilities/configToJSONSchema.spec.js +319 -0
  219. package/dist/utilities/configToJSONSchema.spec.js.map +1 -1
  220. package/dist/utilities/createLocalReq.d.ts +2 -2
  221. package/dist/utilities/createLocalReq.d.ts.map +1 -1
  222. package/dist/utilities/createLocalReq.js.map +1 -1
  223. package/dist/utilities/createPayloadRequest.d.ts.map +1 -1
  224. package/dist/utilities/createPayloadRequest.js +1 -0
  225. package/dist/utilities/createPayloadRequest.js.map +1 -1
  226. package/dist/utilities/getEntityPermissions/getEntityPermissions.d.ts.map +1 -1
  227. package/dist/utilities/getEntityPermissions/getEntityPermissions.js +2 -0
  228. package/dist/utilities/getEntityPermissions/getEntityPermissions.js.map +1 -1
  229. package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts +7 -1
  230. package/dist/utilities/getEntityPermissions/populateFieldPermissions.d.ts.map +1 -1
  231. package/dist/utilities/getEntityPermissions/populateFieldPermissions.js +19 -2
  232. package/dist/utilities/getEntityPermissions/populateFieldPermissions.js.map +1 -1
  233. package/dist/utilities/isURLAllowed.d.ts.map +1 -1
  234. package/dist/utilities/isURLAllowed.js +9 -3
  235. package/dist/utilities/isURLAllowed.js.map +1 -1
  236. package/dist/utilities/isURLAllowed.spec.js +78 -0
  237. package/dist/utilities/isURLAllowed.spec.js.map +1 -0
  238. package/dist/utilities/telemetry/conf/envPaths.d.ts.map +1 -1
  239. package/dist/utilities/telemetry/conf/envPaths.js +40 -31
  240. package/dist/utilities/telemetry/conf/envPaths.js.map +1 -1
  241. package/dist/utilities/telemetry/events/adminInit.d.ts.map +1 -1
  242. package/dist/utilities/telemetry/events/adminInit.js +2 -3
  243. package/dist/utilities/telemetry/events/adminInit.js.map +1 -1
  244. package/dist/utilities/telemetry/events/serverInit.d.ts.map +1 -1
  245. package/dist/utilities/telemetry/events/serverInit.js +2 -3
  246. package/dist/utilities/telemetry/events/serverInit.js.map +1 -1
  247. package/dist/utilities/telemetry/index.d.ts +14 -3
  248. package/dist/utilities/telemetry/index.d.ts.map +1 -1
  249. package/dist/utilities/telemetry/index.js +6 -1
  250. package/dist/utilities/telemetry/index.js.map +1 -1
  251. package/dist/utilities/telemetry/index.spec.js +43 -0
  252. package/dist/utilities/telemetry/index.spec.js.map +1 -0
  253. package/dist/versions/schedule/job.js.map +1 -1
  254. package/package.json +3 -3
  255. package/dist/fields/baseFields/slug/index.d.ts +0 -89
  256. package/dist/fields/baseFields/slug/index.d.ts.map +0 -1
  257. package/dist/fields/baseFields/slug/index.js +0 -81
  258. package/dist/fields/baseFields/slug/index.js.map +0 -1
  259. package/dist/utilities/isRSCEnabled.d.ts +0 -12
  260. package/dist/utilities/isRSCEnabled.d.ts.map +0 -1
  261. package/dist/utilities/isRSCEnabled.js +0 -14
  262. package/dist/utilities/isRSCEnabled.js.map +0 -1
@@ -66,15 +66,6 @@ export type AfterOperationArg<TOperationGeneric extends CollectionSlug> = {
66
66
  args: Parameters<OperationMap<TOperationGeneric>['deleteByID']>[0];
67
67
  operation: 'deleteByID';
68
68
  result: Awaited<ReturnType<OperationMap<TOperationGeneric>['deleteByID']>>;
69
- } | {
70
- args: Parameters<OperationMap<TOperationGeneric>['find']>[0];
71
- /**
72
- * @deprecated Use 'find' or 'findByID' operation instead
73
- *
74
- * TODO: v4 - remove this union option
75
- */
76
- operation: 'read';
77
- result: Awaited<ReturnType<OperationMap<TOperationGeneric>['find']>>;
78
69
  } | {
79
70
  args: Parameters<OperationMap<TOperationGeneric>['find']>[0];
80
71
  operation: 'find';
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/utilities/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAA;AACzF,OAA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@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/collections/operations/utilities/types.ts"],"sourcesContent":["import type { forgotPasswordOperation } from '../../../auth/operations/forgotPassword.js'\nimport type { loginOperation } from '../../../auth/operations/login.js'\nimport type { refreshOperation } from '../../../auth/operations/refresh.js'\nimport type { resetPasswordOperation } from '../../../auth/operations/resetPassword.js'\nimport type { unlockOperation } from '../../../auth/operations/unlock.js'\nimport type { CollectionSlug, RequestContext, restoreVersionOperation } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\nimport type { SanitizedCollectionConfig, SelectFromCollectionSlug } from '../../config/types.js'\nimport type { countOperation } from '../count.js'\nimport type { countVersionsOperation } from '../countVersions.js'\nimport type { createOperation } from '../create.js'\nimport type { deleteOperation } from '../delete.js'\nimport type { deleteByIDOperation } from '../deleteByID.js'\nimport type { findOperation } from '../find.js'\nimport type { findByIDOperation } from '../findByID.js'\nimport type { findDistinctOperation } from '../findDistinct.js'\nimport type { findVersionByIDOperation } from '../findVersionByID.js'\nimport type { findVersionsOperation } from '../findVersions.js'\nimport type { updateOperation } from '../update.js'\nimport type { updateByIDOperation } from '../updateByID.js'\n\nexport type OperationMap<TOperationGeneric extends CollectionSlug> = {\n count: typeof countOperation<TOperationGeneric>\n countVersions: typeof countVersionsOperation<TOperationGeneric>\n create: typeof createOperation<TOperationGeneric, SelectFromCollectionSlug<TOperationGeneric>>\n delete: typeof deleteOperation<TOperationGeneric, SelectFromCollectionSlug<TOperationGeneric>>\n deleteByID: typeof deleteByIDOperation<\n TOperationGeneric,\n SelectFromCollectionSlug<TOperationGeneric>\n >\n find: typeof findOperation<TOperationGeneric, SelectFromCollectionSlug<TOperationGeneric>>\n findByID: typeof findByIDOperation<\n TOperationGeneric,\n boolean,\n SelectFromCollectionSlug<TOperationGeneric>\n >\n findDistinct: typeof findDistinctOperation\n findVersionByID: typeof findVersionByIDOperation\n findVersions: typeof findVersionsOperation\n forgotPassword: typeof forgotPasswordOperation\n login: typeof loginOperation<TOperationGeneric>\n refresh: typeof refreshOperation\n resetPassword: typeof resetPasswordOperation<TOperationGeneric>\n restoreVersion: typeof restoreVersionOperation\n unlock: typeof unlockOperation<TOperationGeneric>\n update: typeof updateOperation<TOperationGeneric, SelectFromCollectionSlug<TOperationGeneric>>\n updateByID: typeof updateByIDOperation<\n TOperationGeneric,\n SelectFromCollectionSlug<TOperationGeneric>\n >\n}\n\nexport type AfterOperationArg<TOperationGeneric extends CollectionSlug> = {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n} & (\n | {\n args: Parameters<OperationMap<TOperationGeneric>['count']>[0]\n operation: 'count'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['count']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['countVersions']>[0]\n operation: 'countVersions'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['countVersions']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['create']>[0]\n operation: 'create'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['create']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['delete']>[0]\n operation: 'delete'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['delete']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['deleteByID']>[0]\n operation: 'deleteByID'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['deleteByID']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['find']>[0]\n /**\n * @deprecated Use 'find' or 'findByID' operation instead\n *\n * TODO: v4 - remove this union option\n */\n operation: 'read'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['find']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['find']>[0]\n operation: 'find'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['find']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findByID']>[0]\n operation: 'findByID'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['findByID']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findDistinct']>[0]\n operation: 'findDistinct'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['findDistinct']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findVersionByID']>[0]\n operation: 'findVersionByID'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['findVersionByID']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findVersions']>[0]\n operation: 'findVersions'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['findVersions']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['forgotPassword']>[0]\n operation: 'forgotPassword'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['forgotPassword']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['login']>[0]\n operation: 'login'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['login']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['refresh']>[0]\n operation: 'refresh'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['refresh']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['resetPassword']>[0]\n operation: 'resetPassword'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['resetPassword']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['restoreVersion']>[0]\n operation: 'restoreVersion'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['restoreVersion']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['unlock']>[0]\n operation: 'unlock'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['unlock']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['update']>[0]\n operation: 'update'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['update']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['updateByID']>[0]\n operation: 'updateByID'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['updateByID']>>\n }\n)\n\nexport type OperationResult<\n TOperationGeneric extends CollectionSlug,\n O extends keyof OperationMap<TOperationGeneric>,\n> = Awaited<ReturnType<OperationMap<TOperationGeneric>[O]>>\n\nexport type OperationArgs<\n TOperationGeneric extends CollectionSlug,\n O extends keyof OperationMap<TOperationGeneric>,\n> = Parameters<OperationMap<TOperationGeneric>[O]>[0]\n\n// Map internal operation names to HookOperationType\nexport const operationToHookOperation = {\n count: 'count',\n countVersions: 'countVersions',\n create: 'create',\n delete: 'delete',\n deleteByID: 'delete',\n find: 'read',\n findByID: 'read',\n findDistinct: 'readDistinct',\n findVersionByID: 'read',\n findVersions: 'read',\n forgotPassword: 'forgotPassword',\n login: 'login',\n read: 'read',\n readDistinct: 'readDistinct',\n refresh: 'refresh',\n resetPassword: 'resetPassword',\n restoreVersion: 'restoreVersion',\n unlock: 'unlock',\n update: 'update',\n updateByID: 'update',\n} as const\n\nexport type BeforeOperationArg<TOperationGeneric extends CollectionSlug> = {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n} & (\n | {\n args:\n | Parameters<OperationMap<TOperationGeneric>['find']>[0]\n | Parameters<OperationMap<TOperationGeneric>['findByID']>[0]\n /**\n * @deprecated Use 'find' or 'findByID' operation instead\n *\n * TODO: v4 - remove this union option\n */\n operation: 'read'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['count']>[0]\n operation: 'count'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['countVersions']>[0]\n operation: 'countVersions'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['create']>[0]\n operation: 'create'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['delete']>[0]\n operation: 'delete'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['deleteByID']>[0]\n operation: 'deleteByID'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['find']>[0]\n operation: 'find'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findByID']>[0]\n operation: 'findByID'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findDistinct']>[0]\n /**\n * @deprecated Use 'findDistinct' operation instead\n *\n * TODO: v4 - remove this union option\n */\n operation: 'readDistinct'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findDistinct']>[0]\n operation: 'findDistinct'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findVersionByID']>[0]\n operation: 'findVersionByID'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findVersions']>[0]\n operation: 'findVersions'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['forgotPassword']>[0]\n operation: 'forgotPassword'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['login']>[0]\n operation: 'login'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['refresh']>[0]\n operation: 'refresh'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['resetPassword']>[0]\n operation: 'resetPassword'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['restoreVersion']>[0]\n operation: 'restoreVersion'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['unlock']>[0]\n operation: 'unlock'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['update']>[0]\n operation: 'update'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['updateByID']>[0]\n operation: 'updateByID'\n }\n)\n"],"names":["operationToHookOperation","count","countVersions","create","delete","deleteByID","find","findByID","findDistinct","findVersionByID","findVersions","forgotPassword","login","read","readDistinct","refresh","resetPassword","restoreVersion","unlock","update","updateByID"],"mappings":"AA6KA,oDAAoD;AACpD,OAAO,MAAMA,2BAA2B;IACtCC,OAAO;IACPC,eAAe;IACfC,QAAQ;IACRC,QAAQ;IACRC,YAAY;IACZC,MAAM;IACNC,UAAU;IACVC,cAAc;IACdC,iBAAiB;IACjBC,cAAc;IACdC,gBAAgB;IAChBC,OAAO;IACPC,MAAM;IACNC,cAAc;IACdC,SAAS;IACTC,eAAe;IACfC,gBAAgB;IAChBC,QAAQ;IACRC,QAAQ;IACRC,YAAY;AACd,EAAU"}
1
+ {"version":3,"sources":["../../../../src/collections/operations/utilities/types.ts"],"sourcesContent":["import type { forgotPasswordOperation } from '../../../auth/operations/forgotPassword.js'\nimport type { loginOperation } from '../../../auth/operations/login.js'\nimport type { refreshOperation } from '../../../auth/operations/refresh.js'\nimport type { resetPasswordOperation } from '../../../auth/operations/resetPassword.js'\nimport type { unlockOperation } from '../../../auth/operations/unlock.js'\nimport type { CollectionSlug, RequestContext, restoreVersionOperation } from '../../../index.js'\nimport type { PayloadRequest } from '../../../types/index.js'\nimport type { SanitizedCollectionConfig, SelectFromCollectionSlug } from '../../config/types.js'\nimport type { countOperation } from '../count.js'\nimport type { countVersionsOperation } from '../countVersions.js'\nimport type { createOperation } from '../create.js'\nimport type { deleteOperation } from '../delete.js'\nimport type { deleteByIDOperation } from '../deleteByID.js'\nimport type { findOperation } from '../find.js'\nimport type { findByIDOperation } from '../findByID.js'\nimport type { findDistinctOperation } from '../findDistinct.js'\nimport type { findVersionByIDOperation } from '../findVersionByID.js'\nimport type { findVersionsOperation } from '../findVersions.js'\nimport type { updateOperation } from '../update.js'\nimport type { updateByIDOperation } from '../updateByID.js'\n\nexport type OperationMap<TOperationGeneric extends CollectionSlug> = {\n count: typeof countOperation<TOperationGeneric>\n countVersions: typeof countVersionsOperation<TOperationGeneric>\n create: typeof createOperation<TOperationGeneric, SelectFromCollectionSlug<TOperationGeneric>>\n delete: typeof deleteOperation<TOperationGeneric, SelectFromCollectionSlug<TOperationGeneric>>\n deleteByID: typeof deleteByIDOperation<\n TOperationGeneric,\n SelectFromCollectionSlug<TOperationGeneric>\n >\n find: typeof findOperation<TOperationGeneric, SelectFromCollectionSlug<TOperationGeneric>>\n findByID: typeof findByIDOperation<\n TOperationGeneric,\n boolean,\n SelectFromCollectionSlug<TOperationGeneric>\n >\n findDistinct: typeof findDistinctOperation\n findVersionByID: typeof findVersionByIDOperation\n findVersions: typeof findVersionsOperation\n forgotPassword: typeof forgotPasswordOperation\n login: typeof loginOperation<TOperationGeneric>\n refresh: typeof refreshOperation\n resetPassword: typeof resetPasswordOperation<TOperationGeneric>\n restoreVersion: typeof restoreVersionOperation\n unlock: typeof unlockOperation<TOperationGeneric>\n update: typeof updateOperation<TOperationGeneric, SelectFromCollectionSlug<TOperationGeneric>>\n updateByID: typeof updateByIDOperation<\n TOperationGeneric,\n SelectFromCollectionSlug<TOperationGeneric>\n >\n}\n\nexport type AfterOperationArg<TOperationGeneric extends CollectionSlug> = {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n} & (\n | {\n args: Parameters<OperationMap<TOperationGeneric>['count']>[0]\n operation: 'count'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['count']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['countVersions']>[0]\n operation: 'countVersions'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['countVersions']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['create']>[0]\n operation: 'create'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['create']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['delete']>[0]\n operation: 'delete'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['delete']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['deleteByID']>[0]\n operation: 'deleteByID'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['deleteByID']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['find']>[0]\n operation: 'find'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['find']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findByID']>[0]\n operation: 'findByID'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['findByID']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findDistinct']>[0]\n operation: 'findDistinct'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['findDistinct']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findVersionByID']>[0]\n operation: 'findVersionByID'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['findVersionByID']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findVersions']>[0]\n operation: 'findVersions'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['findVersions']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['forgotPassword']>[0]\n operation: 'forgotPassword'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['forgotPassword']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['login']>[0]\n operation: 'login'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['login']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['refresh']>[0]\n operation: 'refresh'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['refresh']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['resetPassword']>[0]\n operation: 'resetPassword'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['resetPassword']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['restoreVersion']>[0]\n operation: 'restoreVersion'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['restoreVersion']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['unlock']>[0]\n operation: 'unlock'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['unlock']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['update']>[0]\n operation: 'update'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['update']>>\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['updateByID']>[0]\n operation: 'updateByID'\n result: Awaited<ReturnType<OperationMap<TOperationGeneric>['updateByID']>>\n }\n)\n\nexport type OperationResult<\n TOperationGeneric extends CollectionSlug,\n O extends keyof OperationMap<TOperationGeneric>,\n> = Awaited<ReturnType<OperationMap<TOperationGeneric>[O]>>\n\nexport type OperationArgs<\n TOperationGeneric extends CollectionSlug,\n O extends keyof OperationMap<TOperationGeneric>,\n> = Parameters<OperationMap<TOperationGeneric>[O]>[0]\n\n// Map internal operation names to HookOperationType\nexport const operationToHookOperation = {\n count: 'count',\n countVersions: 'countVersions',\n create: 'create',\n delete: 'delete',\n deleteByID: 'delete',\n find: 'read',\n findByID: 'read',\n findDistinct: 'readDistinct',\n findVersionByID: 'read',\n findVersions: 'read',\n forgotPassword: 'forgotPassword',\n login: 'login',\n read: 'read',\n readDistinct: 'readDistinct',\n refresh: 'refresh',\n resetPassword: 'resetPassword',\n restoreVersion: 'restoreVersion',\n unlock: 'unlock',\n update: 'update',\n updateByID: 'update',\n} as const\n\nexport type BeforeOperationArg<TOperationGeneric extends CollectionSlug> = {\n /** The collection which this hook is being run on */\n collection: SanitizedCollectionConfig\n context: RequestContext\n /**\n * Whether access control is being overridden for this operation\n */\n overrideAccess?: boolean\n req: PayloadRequest\n} & (\n | {\n args:\n | Parameters<OperationMap<TOperationGeneric>['find']>[0]\n | Parameters<OperationMap<TOperationGeneric>['findByID']>[0]\n /**\n * @deprecated Use 'find' or 'findByID' operation instead\n *\n * TODO: v4 - remove this union option\n */\n operation: 'read'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['count']>[0]\n operation: 'count'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['countVersions']>[0]\n operation: 'countVersions'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['create']>[0]\n operation: 'create'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['delete']>[0]\n operation: 'delete'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['deleteByID']>[0]\n operation: 'deleteByID'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['find']>[0]\n operation: 'find'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findByID']>[0]\n operation: 'findByID'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findDistinct']>[0]\n /**\n * @deprecated Use 'findDistinct' operation instead\n *\n * TODO: v4 - remove this union option\n */\n operation: 'readDistinct'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findDistinct']>[0]\n operation: 'findDistinct'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findVersionByID']>[0]\n operation: 'findVersionByID'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['findVersions']>[0]\n operation: 'findVersions'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['forgotPassword']>[0]\n operation: 'forgotPassword'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['login']>[0]\n operation: 'login'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['refresh']>[0]\n operation: 'refresh'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['resetPassword']>[0]\n operation: 'resetPassword'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['restoreVersion']>[0]\n operation: 'restoreVersion'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['unlock']>[0]\n operation: 'unlock'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['update']>[0]\n operation: 'update'\n }\n | {\n args: Parameters<OperationMap<TOperationGeneric>['updateByID']>[0]\n operation: 'updateByID'\n }\n)\n"],"names":["operationToHookOperation","count","countVersions","create","delete","deleteByID","find","findByID","findDistinct","findVersionByID","findVersions","forgotPassword","login","read","readDistinct","refresh","resetPassword","restoreVersion","unlock","update","updateByID"],"mappings":"AAmKA,oDAAoD;AACpD,OAAO,MAAMA,2BAA2B;IACtCC,OAAO;IACPC,eAAe;IACfC,QAAQ;IACRC,QAAQ;IACRC,YAAY;IACZC,MAAM;IACNC,UAAU;IACVC,cAAc;IACdC,iBAAiB;IACjBC,cAAc;IACdC,gBAAgB;IAChBC,OAAO;IACPC,MAAM;IACNC,cAAc;IACdC,SAAS;IACTC,eAAe;IACfC,gBAAgB;IAChBC,QAAQ;IACRC,QAAQ;IACRC,YAAY;AACd,EAAU"}
@@ -1,7 +1,7 @@
1
1
  import type { I18nClient } from '@payloadcms/translations';
2
2
  import type { ImportMap } from '../bin/generateImportMap/index.js';
3
3
  import type { ClientBlock } from '../fields/config/types.js';
4
- import type { BlockSlug, TypedUser } from '../index.js';
4
+ import type { BlockSlug, User } from '../index.js';
5
5
  import type { ClientWidget, RootLivePreviewConfig, SanitizedConfig, ServerOnlyLivePreviewProperties } from './types.js';
6
6
  import { type ClientCollectionConfig } from '../collections/config/client.js';
7
7
  import { type ClientGlobalConfig } from '../globals/config/client.js';
@@ -51,7 +51,7 @@ export type CreateClientConfigArgs = {
51
51
  * For example, allow `true` to generate a client config for the "create first user" page
52
52
  * where there is no user yet, but the config should still be complete.
53
53
  */
54
- user: true | TypedUser;
54
+ user: true | User;
55
55
  };
56
56
  export declare const createUnauthenticatedClientConfig: ({ clientConfig, }: {
57
57
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/config/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,0BAA0B,CAAA;AAGrE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EACV,YAAY,EACZ,qBAAqB,EACrB,eAAe,EACf,+BAA+B,EAChC,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAAE,KAAK,kBAAkB,EAA6B,MAAM,6BAA6B,CAAA;AAEhG,MAAM,MAAM,wBAAwB,GAAG,MAAM,IAAI,CAC/C,eAAe,EACb,KAAK,GACL,MAAM,G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AAC,OAAO,CAAC,CAAC,QAAQ,CAAC,CAAA;QACvC,IAAI,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAA;KACpC,CAAA;IACD,WAAW,EAAE;QACX;YACE,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAA;YACpC,IAAI,EAAE,MAAM,CAAA;SACb;KACF,CAAA;IACD,OAAO,EAAE,EAAE,CAAA;IACX,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAA;IAC9B,SAAS,EAAE,YAAY,CAAC,WAAW,CAAC,CAAA;IACpC,eAAe,EAAE,IAAI,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,+BAA+B,EAAE,SAAS,OAAO,CAAC,6BAA6B,CAAC,EAAO,CAAA;AAEpG,eAAO,MAAM,0BAA0B,EAAE,SAAS,OAAO,CAAC,wBAAwB,CAAC,EAuBlF,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,UAAU,CAAA;IAChB,SAAS,EAAE,SAAS,CAAA;IACpB;;;;;;;OAOG;IACH,IAAI,EAAE,IAAI,GAAG,IAAI,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,iCAAiC,GAAI,mBAE/C;IACD;;;OAGG;IACH,YAAY,EAAE,YAAY,CAAA;CAC3B,KAAG,2BAwBH,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,8BAIhC,sBAAsB,KAAG,YAuK3B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/config/client.ts"],"sourcesContent":["import type { I18nClient, TFunction } from '@payloadcms/translations'\nimport type { DeepPartial } from 'ts-essentials'\n\nimport type { ImportMap } from '../bin/generateImportMap/index.js'\nimport type { ClientBlock } from '../fields/config/types.js'\nimport type { BlockSlug, TypedUser } from '../index.js'\nimport type {\n ClientWidget,\n RootLivePreviewConfig,\n SanitizedConfig,\n ServerOnlyLivePreviewProperties,\n} from './types.js'\n\nimport {\n type ClientCollectionConfig,\n createClientCollectionConfigs,\n} from '../collections/config/client.js'\nimport { createClientBlocks, createClientFields } from '../fields/config/client.js'\nimport { type ClientGlobalConfig, createClientGlobalConfigs } from '../globals/config/client.js'\n\nexport type ServerOnlyRootProperties = keyof Pick<\n SanitizedConfig,\n | 'bin'\n | 'cors'\n | 'csrf'\n | 'custom'\n | 'db'\n | 'editor'\n | 'email'\n | 'endpoints'\n | 'graphQL'\n | 'hooks'\n | 'i18n'\n | 'jobs'\n | 'kv'\n | 'logger'\n | 'onInit'\n | 'plugins'\n | 'queryPresets'\n | 'secret'\n | 'sharp'\n | 'storage'\n | 'typescript'\n>\n\nexport type ServerOnlyRootAdminProperties = keyof Pick<SanitizedConfig['admin'], 'components'>\n\nexport type ClientConfig = {\n admin: {\n dashboard?: {\n widgets: ClientWidget[]\n }\n livePreview?: Omit<RootLivePreviewConfig, ServerOnlyLivePreviewProperties>\n } & Omit<SanitizedConfig['admin'], 'components' | 'dashboard' | 'dependencies' | 'livePreview'>\n blocks: ClientBlock[]\n blocksMap: Record<BlockSlug, ClientBlock>\n collections: ClientCollectionConfig[]\n custom?: Record<string, any>\n globals: ClientGlobalConfig[]\n unauthenticated?: boolean\n} & Omit<SanitizedConfig, 'admin' | 'collections' | 'globals' | 'i18n' | ServerOnlyRootProperties>\n\nexport type UnauthenticatedClientConfig = {\n admin: {\n routes: ClientConfig['admin']['routes']\n user: ClientConfig['admin']['user']\n }\n collections: [\n {\n auth: ClientCollectionConfig['auth']\n slug: string\n },\n ]\n globals: []\n routes: ClientConfig['routes']\n serverURL: ClientConfig['serverURL']\n unauthenticated: true\n}\n\nexport const serverOnlyAdminConfigProperties: readonly Partial<ServerOnlyRootAdminProperties>[] = []\n\nexport const serverOnlyConfigProperties: readonly Partial<ServerOnlyRootProperties>[] = [\n 'endpoints',\n 'db',\n 'editor',\n 'plugins',\n 'sharp',\n 'onInit',\n 'secret',\n 'hooks',\n 'bin',\n 'i18n',\n 'typescript',\n 'cors',\n 'csrf',\n 'email',\n 'custom',\n 'graphQL',\n 'jobs',\n 'logger',\n 'kv',\n 'queryPresets',\n 'storage',\n // `admin`, `onInit`, `localization`, `collections`, and `globals` are all handled separately\n]\n\nexport type CreateClientConfigArgs = {\n config: SanitizedConfig\n i18n: I18nClient\n importMap: ImportMap\n /**\n * If unauthenticated, the client config will omit some sensitive properties\n * such as field schemas, etc. This is useful for login and error pages where\n * the page source should not contain this information.\n *\n * For example, allow `true` to generate a client config for the \"create first user\" page\n * where there is no user yet, but the config should still be complete.\n */\n user: true | TypedUser\n}\n\nexport const createUnauthenticatedClientConfig = ({\n clientConfig,\n}: {\n /**\n * Send the previously generated client config to share memory when applicable.\n * E.g. the admin-enabled collection config can reference the existing collection rather than creating a new object.\n */\n clientConfig: ClientConfig\n}): UnauthenticatedClientConfig => {\n /**\n * To share memory, find the admin user collection from the existing client config.\n */\n const adminUserCollection = clientConfig.collections.find(\n ({ slug }) => slug === clientConfig.admin.user,\n )!\n\n return {\n admin: {\n routes: clientConfig.admin.routes,\n user: clientConfig.admin.user,\n },\n collections: [\n {\n slug: adminUserCollection.slug,\n auth: adminUserCollection.auth,\n },\n ],\n globals: [],\n routes: clientConfig.routes,\n serverURL: clientConfig.serverURL,\n unauthenticated: true,\n }\n}\n\nexport const createClientConfig = ({\n config,\n i18n,\n importMap,\n}: CreateClientConfigArgs): ClientConfig => {\n const clientConfig = {} as DeepPartial<ClientConfig>\n\n for (const key in config) {\n if (serverOnlyConfigProperties.includes(key as any)) {\n continue\n }\n\n switch (key) {\n case 'admin':\n clientConfig.admin = {\n autoLogin: config.admin.autoLogin,\n autoRefresh: config.admin.autoRefresh,\n avatar: config.admin.avatar,\n custom: config.admin.custom,\n dateFormat: config.admin.dateFormat,\n importMap: config.admin.importMap,\n meta: config.admin.meta,\n routes: config.admin.routes,\n theme: config.admin.theme,\n timezones: config.admin.timezones,\n toast: config.admin.toast,\n user: config.admin.user,\n }\n\n if (config.admin.dashboard?.widgets) {\n ;(clientConfig.admin.dashboard ??= {}).widgets = config.admin.dashboard.widgets.map(\n (widget) => {\n const { Component: _, fields, label, ...rest } = widget\n return {\n ...rest,\n ...(fields?.length\n ? {\n fields: createClientFields({\n defaultIDType: config.db.defaultIDType,\n fields,\n i18n,\n importMap,\n }),\n }\n : {}),\n // Resolve label function to string for client\n label:\n typeof label === 'function' ? label({ i18n, t: i18n.t as TFunction }) : label,\n }\n },\n )\n }\n\n if (config.admin.livePreview) {\n clientConfig.admin.livePreview = {}\n\n if (config.admin.livePreview.breakpoints) {\n clientConfig.admin.livePreview.breakpoints = config.admin.livePreview.breakpoints\n }\n\n if (config.admin.livePreview.collections) {\n clientConfig.admin.livePreview.collections = config.admin.livePreview.collections\n }\n\n if (config.admin.livePreview.globals) {\n clientConfig.admin.livePreview.globals = config.admin.livePreview.globals\n }\n }\n\n break\n\n case 'blocks': {\n ;(clientConfig.blocks as ClientBlock[]) = createClientBlocks({\n blocks: config.blocks!,\n defaultIDType: config.db.defaultIDType,\n i18n,\n importMap,\n }).filter((block) => typeof block !== 'string')\n\n clientConfig.blocksMap = {}\n if (clientConfig.blocks?.length) {\n for (const block of clientConfig.blocks) {\n if (!block?.slug) {\n continue\n }\n\n clientConfig.blocksMap[block.slug] = block as ClientBlock\n }\n }\n\n break\n }\n\n case 'collections':\n ;(clientConfig.collections as ClientCollectionConfig[]) = createClientCollectionConfigs({\n collections: config.collections,\n defaultIDType: config.db.defaultIDType,\n i18n,\n importMap,\n })\n\n break\n\n case 'globals':\n ;(clientConfig.globals as ClientGlobalConfig[]) = createClientGlobalConfigs({\n defaultIDType: config.db.defaultIDType,\n globals: config.globals,\n i18n,\n importMap,\n })\n\n break\n\n case 'localization':\n if (typeof config.localization === 'object' && config.localization) {\n clientConfig.localization = {}\n\n if (config.localization.defaultLocale) {\n clientConfig.localization.defaultLocale = config.localization.defaultLocale\n }\n\n if (config.localization.defaultLocalePublishOption) {\n clientConfig.localization.defaultLocalePublishOption =\n config.localization.defaultLocalePublishOption\n }\n\n if (config.localization.fallback) {\n clientConfig.localization.fallback = config.localization.fallback\n }\n\n if (config.localization.localeCodes) {\n clientConfig.localization.localeCodes = config.localization.localeCodes\n }\n\n if (config.localization.locales) {\n clientConfig.localization.locales = []\n\n for (const locale of config.localization.locales) {\n if (locale) {\n const clientLocale: Partial<(typeof config.localization.locales)[0]> = {}\n\n if (locale.code) {\n clientLocale.code = locale.code\n }\n\n if (locale.fallbackLocale) {\n clientLocale.fallbackLocale = locale.fallbackLocale\n }\n\n if (locale.label) {\n clientLocale.label = locale.label\n }\n\n if (locale.rtl) {\n clientLocale.rtl = locale.rtl\n }\n\n clientConfig.localization.locales.push(clientLocale)\n }\n }\n }\n }\n\n break\n\n default:\n ;(clientConfig as any)[key] = config[key as keyof SanitizedConfig]\n }\n }\n\n return clientConfig as ClientConfig\n}\n"],"names":["createClientCollectionConfigs","createClientBlocks","createClientFields","createClientGlobalConfigs","serverOnlyAdminConfigProperties","serverOnlyConfigProperties","createUnauthenticatedClientConfig","clientConfig","adminUserCollection","collections","find","slug","admin","user","routes","auth","globals","serverURL","unauthenticated","createClientConfig","config","i18n","importMap","key","includes","autoLogin","autoRefresh","avatar","custom","dateFormat","meta","theme","timezones","toast","dashboard","widgets","map","widget","Component","_","fields","label","rest","length","defaultIDType","db","t","livePreview","breakpoints","blocks","filter","block","blocksMap","localization","defaultLocale","defaultLocalePublishOption","fallback","localeCodes","locales","locale","clientLocale","code","fallbackLocale","rtl","push"],"mappings":"AAaA,SAEEA,6BAA6B,QACxB,kCAAiC;AACxC,SAASC,kBAAkB,EAAEC,kBAAkB,QAAQ,6BAA4B;AACnF,SAAkCC,yBAAyB,QAAQ,8BAA6B;AA6DhG,OAAO,MAAMC,kCAAqF,EAAE,CAAA;AAEpG,OAAO,MAAMC,6BAA2E;IACtF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CAED,CAAA;A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Q,GAAGpC,OAAOiC,YAAY,CAACG,QAAQ;oBACnE;oBAEA,IAAIpC,OAAOiC,YAAY,CAACI,WAAW,EAAE;wBACnClD,aAAa8C,YAAY,CAACI,WAAW,GAAGrC,OAAOiC,YAAY,CAACI,WAAW;oBACzE;oBAEA,IAAIrC,OAAOiC,YAAY,CAACK,OAAO,EAAE;wBAC/BnD,aAAa8C,YAAY,CAACK,OAAO,GAAG,EAAE;wBAEtC,KAAK,MAAMC,UAAUvC,OAAOiC,YAAY,CAACK,OAAO,CAAE;4BAChD,IAAIC,QAAQ;gCACV,MAAMC,eAAiE,CAAC;gCAExE,IAAID,OAAOE,IAAI,EAAE;oCACfD,aAAaC,IAAI,GAAGF,OAAOE,IAAI;gCACjC;gCAEA,IAAIF,OAAOG,cAAc,EAAE;oCACzBF,aAAaE,cAAc,GAAGH,OAAOG,cAAc;gCACrD;gCAEA,IAAIH,OAAOlB,KAAK,EAAE;oCAChBmB,aAAanB,KAAK,GAAGkB,OAAOlB,KAAK;gCACnC;gCAEA,IAAIkB,OAAOI,GAAG,EAAE;oCACdH,aAAaG,GAAG,GAAGJ,OAAOI,GAAG;gCAC/B;gCAEAxD,aAAa8C,YAAY,CAACK,OAAO,CAACM,IAAI,CAACJ;4BACzC;wBACF;oBACF;gBACF;gBAEA;YAEF;;gBACIrD,YAAoB,CAACgB,IAAI,GAAGH,MAAM,CAACG,IAA6B;QACtE;IACF;IAEA,OAAOhB;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/config/client.ts"],"sourcesContent":["import type { I18nClient, TFunction } from '@payloadcms/translations'\nimport type { DeepPartial } from 'ts-essentials'\n\nimport type { ImportMap } from '../bin/generateImportMap/index.js'\nimport type { ClientBlock } from '../fields/config/types.js'\nimport type { BlockSlug, User } from '../index.js'\nimport type {\n ClientWidget,\n RootLivePreviewConfig,\n SanitizedConfig,\n ServerOnlyLivePreviewProperties,\n} from './types.js'\n\nimport {\n type ClientCollectionConfig,\n createClientCollectionConfigs,\n} from '../collections/config/client.js'\nimport { createClientBlocks, createClientFields } from '../fields/config/client.js'\nimport { type ClientGlobalConfig, createClientGlobalConfigs } from '../globals/config/client.js'\n\nexport type ServerOnlyRootProperties = keyof Pick<\n SanitizedConfig,\n | 'bin'\n | 'cors'\n | 'csrf'\n | 'custom'\n | 'db'\n | 'editor'\n | 'email'\n | 'endpoints'\n | 'graphQL'\n | 'hooks'\n | 'i18n'\n | 'jobs'\n | 'kv'\n | 'logger'\n | 'onInit'\n | 'plugins'\n | 'queryPresets'\n | 'secret'\n | 'sharp'\n | 'storage'\n | 'typescript'\n>\n\nexport type ServerOnlyRootAdminProperties = keyof Pick<SanitizedConfig['admin'], 'components'>\n\nexport type ClientConfig = {\n admin: {\n dashboard?: {\n widgets: ClientWidget[]\n }\n livePreview?: Omit<RootLivePreviewConfig, ServerOnlyLivePreviewProperties>\n } & Omit<SanitizedConfig['admin'], 'components' | 'dashboard' | 'dependencies' | 'livePreview'>\n blocks: ClientBlock[]\n blocksMap: Record<BlockSlug, ClientBlock>\n collections: ClientCollectionConfig[]\n custom?: Record<string, any>\n globals: ClientGlobalConfig[]\n unauthenticated?: boolean\n} & Omit<SanitizedConfig, 'admin' | 'collections' | 'globals' | 'i18n' | ServerOnlyRootProperties>\n\nexport type UnauthenticatedClientConfig = {\n admin: {\n routes: ClientConfig['admin']['routes']\n user: ClientConfig['admin']['user']\n }\n collections: [\n {\n auth: ClientCollectionConfig['auth']\n slug: string\n },\n ]\n globals: []\n routes: ClientConfig['routes']\n serverURL: ClientConfig['serverURL']\n unauthenticated: true\n}\n\nexport const serverOnlyAdminConfigProperties: readonly Partial<ServerOnlyRootAdminProperties>[] = []\n\nexport const serverOnlyConfigProperties: readonly Partial<ServerOnlyRootProperties>[] = [\n 'endpoints',\n 'db',\n 'editor',\n 'plugins',\n 'sharp',\n 'onInit',\n 'secret',\n 'hooks',\n 'bin',\n 'i18n',\n 'typescript',\n 'cors',\n 'csrf',\n 'email',\n 'custom',\n 'graphQL',\n 'jobs',\n 'logger',\n 'kv',\n 'queryPresets',\n 'storage',\n // `admin`, `onInit`, `localization`, `collections`, and `globals` are all handled separately\n]\n\nexport type CreateClientConfigArgs = {\n config: SanitizedConfig\n i18n: I18nClient\n importMap: ImportMap\n /**\n * If unauthenticated, the client config will omit some sensitive properties\n * such as field schemas, etc. This is useful for login and error pages where\n * the page source should not contain this information.\n *\n * For example, allow `true` to generate a client config for the \"create first user\" page\n * where there is no user yet, but the config should still be complete.\n */\n user: true | User\n}\n\nexport const createUnauthenticatedClientConfig = ({\n clientConfig,\n}: {\n /**\n * Send the previously generated client config to share memory when applicable.\n * E.g. the admin-enabled collection config can reference the existing collection rather than creating a new object.\n */\n clientConfig: ClientConfig\n}): UnauthenticatedClientConfig => {\n /**\n * To share memory, find the admin user collection from the existing client config.\n */\n const adminUserCollection = clientConfig.collections.find(\n ({ slug }) => slug === clientConfig.admin.user,\n )!\n\n return {\n admin: {\n routes: clientConfig.admin.routes,\n user: clientConfig.admin.user,\n },\n collections: [\n {\n slug: adminUserCollection.slug,\n auth: adminUserCollection.auth,\n },\n ],\n globals: [],\n routes: clientConfig.routes,\n serverURL: clientConfig.serverURL,\n unauthenticated: true,\n }\n}\n\nexport const createClientConfig = ({\n config,\n i18n,\n importMap,\n}: CreateClientConfigArgs): ClientConfig => {\n const clientConfig = {} as DeepPartial<ClientConfig>\n\n for (const key in config) {\n if (serverOnlyConfigProperties.includes(key as any)) {\n continue\n }\n\n switch (key) {\n case 'admin':\n clientConfig.admin = {\n autoLogin: config.admin.autoLogin,\n autoRefresh: config.admin.autoRefresh,\n avatar: config.admin.avatar,\n custom: config.admin.custom,\n dateFormat: config.admin.dateFormat,\n importMap: config.admin.importMap,\n meta: config.admin.meta,\n routes: config.admin.routes,\n theme: config.admin.theme,\n timezones: config.admin.timezones,\n toast: config.admin.toast,\n user: config.admin.user,\n }\n\n if (config.admin.dashboard?.widgets) {\n ;(clientConfig.admin.dashboard ??= {}).widgets = config.admin.dashboard.widgets.map(\n (widget) => {\n const { Component: _, fields, label, ...rest } = widget\n return {\n ...rest,\n ...(fields?.length\n ? {\n fields: createClientFields({\n defaultIDType: config.db.defaultIDType,\n fields,\n i18n,\n importMap,\n }),\n }\n : {}),\n // Resolve label function to string for client\n label:\n typeof label === 'function' ? label({ i18n, t: i18n.t as TFunction }) : label,\n }\n },\n )\n }\n\n if (config.admin.livePreview) {\n clientConfig.admin.livePreview = {}\n\n if (config.admin.livePreview.breakpoints) {\n clientConfig.admin.livePreview.breakpoints = config.admin.livePreview.breakpoints\n }\n\n if (config.admin.livePreview.collections) {\n clientConfig.admin.livePreview.collections = config.admin.livePreview.collections\n }\n\n if (config.admin.livePreview.globals) {\n clientConfig.admin.livePreview.globals = config.admin.livePreview.globals\n }\n }\n\n break\n\n case 'blocks': {\n ;(clientConfig.blocks as ClientBlock[]) = createClientBlocks({\n blocks: config.blocks!,\n defaultIDType: config.db.defaultIDType,\n i18n,\n importMap,\n }).filter((block) => typeof block !== 'string')\n\n clientConfig.blocksMap = {}\n if (clientConfig.blocks?.length) {\n for (const block of clientConfig.blocks) {\n if (!block?.slug) {\n continue\n }\n\n clientConfig.blocksMap[block.slug] = block as ClientBlock\n }\n }\n\n break\n }\n\n case 'collections':\n ;(clientConfig.collections as ClientCollectionConfig[]) = createClientCollectionConfigs({\n collections: config.collections,\n defaultIDType: config.db.defaultIDType,\n i18n,\n importMap,\n })\n\n break\n\n case 'globals':\n ;(clientConfig.globals as ClientGlobalConfig[]) = createClientGlobalConfigs({\n defaultIDType: config.db.defaultIDType,\n globals: config.globals,\n i18n,\n importMap,\n })\n\n break\n\n case 'localization':\n if (typeof config.localization === 'object' && config.localization) {\n clientConfig.localization = {}\n\n if (config.localization.defaultLocale) {\n clientConfig.localization.defaultLocale = config.localization.defaultLocale\n }\n\n if (config.localization.defaultLocalePublishOption) {\n clientConfig.localization.defaultLocalePublishOption =\n config.localization.defaultLocalePublishOption\n }\n\n if (config.localization.fallback) {\n clientConfig.localization.fallback = config.localization.fallback\n }\n\n if (config.localization.localeCodes) {\n clientConfig.localization.localeCodes = config.localization.localeCodes\n }\n\n if (config.localization.locales) {\n clientConfig.localization.locales = []\n\n for (const locale of config.localization.locales) {\n if (locale) {\n const clientLocale: Partial<(typeof config.localization.locales)[0]> = {}\n\n if (locale.code) {\n clientLocale.code = locale.code\n }\n\n if (locale.fallbackLocale) {\n clientLocale.fallbackLocale = locale.fallbackLocale\n }\n\n if (locale.label) {\n clientLocale.label = locale.label\n }\n\n if (locale.rtl) {\n clientLocale.rtl = locale.rtl\n }\n\n clientConfig.localization.locales.push(clientLocale)\n }\n }\n }\n }\n\n break\n\n default:\n ;(clientConfig as any)[key] = config[key as keyof SanitizedConfig]\n }\n }\n\n return clientConfig as ClientConfig\n}\n"],"names":["createClientCollectionConfigs","createClientBlocks","createClientFields","createClientGlobalConfigs","serverOnlyAdminConfigProperties","serverOnlyConfigProperties","createUnauthenticatedClientConfig","clientConfig","adminUserCollection","collections","find","slug","admin","user","routes","auth","globals","serverURL","unauthenticated","createClientConfig","config","i18n","importMap","key","includes","autoLogin","autoRefresh","avatar","custom","dateFormat","meta","theme","timezones","toast","dashboard","widgets","map","widget","Component","_","fields","label","rest","length","defaultIDType","db","t","livePreview","breakpoints","blocks","filter","block","blocksMap","localization","defaultLocale","defaultLocalePublishOption","fallback","localeCodes","locales","locale","clientLocale","code","fallbackLocale","rtl","push"],"mappings":"AAaA,SAEEA,6BAA6B,QACxB,kCAAiC;AACxC,SAASC,kBAAkB,EAAEC,kBAAkB,QAAQ,6BAA4B;AACnF,SAAkCC,yBAAyB,QAAQ,8BAA6B;AA6DhG,OAAO,MAAMC,kCAAqF,EAAE,CAAA;AAEpG,OAAO,MAAMC,6BAA2E;IACtF;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CAED,CAAA;AAiBD,OAAO,MAAMC,oCAAoC,CAAC,EAChDC,YAAY,EAOb;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,IAAIpC,OAAOiC,YAAY,CAACI,WAAW,EAAE;wBACnClD,aAAa8C,YAAY,CAACI,WAAW,GAAGrC,OAAOiC,YAAY,CAACI,WAAW;oBACzE;oBAEA,IAAIrC,OAAOiC,YAAY,CAACK,OAAO,EAAE;wBAC/BnD,aAAa8C,YAAY,CAACK,OAAO,GAAG,EAAE;wBAEtC,KAAK,MAAMC,UAAUvC,OAAOiC,YAAY,CAACK,OAAO,CAAE;4BAChD,IAAIC,QAAQ;gCACV,MAAMC,eAAiE,CAAC;gCAExE,IAAID,OAAOE,IAAI,EAAE;oCACfD,aAAaC,IAAI,GAAGF,OAAOE,IAAI;gCACjC;gCAEA,IAAIF,OAAOG,cAAc,EAAE;oCACzBF,aAAaE,cAAc,GAAGH,OAAOG,cAAc;gCACrD;gCAEA,IAAIH,OAAOlB,KAAK,EAAE;oCAChBmB,aAAanB,KAAK,GAAGkB,OAAOlB,KAAK;gCACnC;gCAEA,IAAIkB,OAAOI,GAAG,EAAE;oCACdH,aAAaG,GAAG,GAAGJ,OAAOI,GAAG;gCAC/B;gCAEAxD,aAAa8C,YAAY,CAACK,OAAO,CAACM,IAAI,CAACJ;4BACzC;wBACF;oBACF;gBACF;gBAEA;YAEF;;gBACIrD,YAAoB,CAACgB,IAAI,GAAGH,MAAM,CAACG,IAA6B;QACtE;IACF;IAEA,OAAOhB;AACT,EAAC"}
@@ -1,7 +1,3 @@
1
1
  import type { Config } from './types.js';
2
- /**
3
- * @deprecated - remove in 4.0. This is error-prone, as mutating this object will affect any objects that use the defaults as a base.
4
- */
5
- export declare const defaults: Omit<Config, 'db' | 'editor' | 'secret'>;
6
2
  export declare const addDefaultsToConfig: (config: Config) => Config;
7
3
  //# sourceMappingURL=defaults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAKxC;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,QAAQ,GAAG,QAAQ,CAwE7D,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG,MA4FpD,CAAA"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/config/defaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAKxC,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG,MA4FpD,CAAA"}
@@ -1,83 +1,5 @@
1
1
  import { defaultAccess } from '../auth/defaultAccess.js';
2
2
  import { databaseKVAdapter } from '../kv/adapters/DatabaseKVAdapter.js';
3
- /**
4
- * @deprecated - remove in 4.0. This is error-prone, as mutating this object will affect any objects that use the defaults as a base.
5
- */ export const defaults = {
6
- admin: {
7
- avatar: 'gravatar',
8
- components: {},
9
- custom: {},
10
- dateFormat: 'MMMM do yyyy, h:mm a',
11
- dependencies: {},
12
- importMap: {
13
- baseDir: `${typeof process?.cwd === 'function' ? process.cwd() : ''}`
14
- },
15
- meta: {
16
- defaultOGImageType: 'dynamic',
17
- robots: 'noindex, nofollow',
18
- titleSuffix: '- Payload'
19
- },
20
- routes: {
21
- account: '/account',
22
- createFirstUser: '/create-first-user',
23
- forgot: '/forgot',
24
- inactivity: '/logout-inactivity',
25
- login: '/login',
26
- logout: '/logout',
27
- reset: '/reset',
28
- unauthorized: '/unauthorized'
29
- },
30
- theme: 'all'
31
- },
32
- auth: {
33
- jwtOrder: [
34
- 'JWT',
35
- 'Bearer',
36
- 'cookie'
37
- ]
38
- },
39
- bin: [],
40
- collections: [],
41
- cookiePrefix: 'payload',
42
- cors: [],
43
- csrf: [],
44
- custom: {},
45
- defaultDepth: 2,
46
- defaultMaxTextLength: 40000,
47
- endpoints: [],
48
- globals: [],
49
- graphQL: {
50
- disablePlaygroundInProduction: true,
51
- maxComplexity: 1000,
52
- schemaOutputFile: `${typeof process?.cwd === 'function' ? process.cwd() : ''}/schema.graphql`
53
- },
54
- hooks: {},
55
- i18n: {},
56
- jobs: {
57
- access: {
58
- cancel: defaultAccess,
59
- queue: defaultAccess,
60
- run: defaultAccess
61
- },
62
- deleteJobOnComplete: true,
63
- depth: 0
64
- },
65
- localization: false,
66
- maxDepth: 10,
67
- routes: {
68
- admin: '/admin',
69
- api: '/api',
70
- graphQL: '/graphql',
71
- graphQLPlayground: '/graphql-playground'
72
- },
73
- serverURL: '',
74
- telemetry: true,
75
- typescript: {
76
- autoGenerate: true,
77
- outputFile: `${typeof process?.cwd === 'function' ? process.cwd() : ''}/payload-types.ts`
78
- },
79
- upload: {}
80
- };
81
3
  export const addDefaultsToConfig = (config)=>{
82
4
  config.admin = {
83
5
  avatar: 'gravatar',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/config/defaults.ts"],"sourcesContent":["import type { JobsConfig } from '../queues/config/types/index.js'\nimport type { Config } from './types.js'\n\nimport { defaultAccess } from '../auth/defaultAccess.js'\nimport { databaseKVAdapter } from '../kv/adapters/DatabaseKVAdapter.js'\n\n/**\n * @deprecated - remove in 4.0. This is error-prone, as mutating this object will affect any objects that use the defaults as a base.\n */\nexport const defaults: Omit<Config, 'db' | 'editor' | 'secret'> = {\n admin: {\n avatar: 'gravatar',\n components: {},\n custom: {},\n dateFormat: 'MMMM do yyyy, h:mm a',\n dependencies: {},\n importMap: {\n baseDir: `${typeof process?.cwd === 'function' ? process.cwd() : ''}`,\n },\n meta: {\n defaultOGImageType: 'dynamic',\n robots: 'noindex, nofollow',\n titleSuffix: '- Payload',\n },\n routes: {\n account: '/account',\n createFirstUser: '/create-first-user',\n forgot: '/forgot',\n inactivity: '/logout-inactivity',\n login: '/login',\n logout: '/logout',\n reset: '/reset',\n unauthorized: '/unauthorized',\n },\n theme: 'all',\n },\n auth: {\n jwtOrder: ['JWT', 'Bearer', 'cookie'],\n },\n bin: [],\n collections: [],\n cookiePrefix: 'payload',\n cors: [],\n csrf: [],\n custom: {},\n defaultDepth: 2,\n defaultMaxTextLength: 40000,\n endpoints: [],\n globals: [],\n graphQL: {\n disablePlaygroundInProduction: true,\n maxComplexity: 1000,\n schemaOutputFile: `${typeof process?.cwd === 'function' ? process.cwd() : ''}/schema.graphql`,\n },\n hooks: {},\n i18n: {},\n jobs: {\n access: {\n cancel: defaultAccess,\n queue: defaultAccess,\n run: defaultAccess,\n },\n deleteJobOnComplete: true,\n depth: 0,\n } as JobsConfig,\n\n localization: false,\n maxDepth: 10,\n routes: {\n admin: '/admin',\n api: '/api',\n graphQL: '/graphql',\n graphQLPlayground: '/graphql-playground',\n },\n serverURL: '',\n telemetry: true,\n typescript: {\n autoGenerate: true,\n outputFile: `${typeof process?.cwd === 'function' ? process.cwd() : ''}/payload-types.ts`,\n },\n upload: {},\n}\n\nexport const addDefaultsToConfig = (config: Config): Config => {\n config.admin = {\n avatar: 'gravatar',\n components: {},\n custom: {},\n dateFormat: 'MMMM do yyyy, h:mm a',\n dependencies: {},\n theme: 'all',\n ...(config.admin || {}),\n importMap: {\n baseDir: `${typeof process?.cwd === 'function' ? process.cwd() : ''}`,\n ...(config?.admin?.importMap || {}),\n },\n meta: {\n defaultOGImageType: 'dynamic',\n robots: 'noindex, nofollow',\n titleSuffix: '- Payload',\n ...(config?.admin?.meta || {}),\n },\n routes: {\n account: '/account',\n createFirstUser: '/create-first-user',\n forgot: '/forgot',\n inactivity: '/logout-inactivity',\n login: '/login',\n logout: '/logout',\n reset: '/reset',\n unauthorized: '/unauthorized',\n ...(config?.admin?.routes || {}),\n },\n }\n\n config.bin = config.bin ?? []\n config.collections = config.collections ?? []\n config.cookiePrefix = config.cookiePrefix ?? 'payload'\n config.cors = config.cors ?? []\n config.csrf = config.csrf ?? []\n config.custom = config.custom ?? {}\n config.defaultDepth = config.defaultDepth ?? 2\n config.defaultMaxTextLength = config.defaultMaxTextLength ?? 40000\n config.endpoints = config.endpoints ?? []\n config.globals = config.globals ?? []\n config.graphQL = {\n disableIntrospectionInProduction: true,\n disablePlaygroundInProduction: true,\n maxComplexity: 1000,\n schemaOutputFile: `${typeof process?.cwd === 'function' ? process.cwd() : ''}/schema.graphql`,\n ...(config.graphQL || {}),\n }\n config.hooks = config.hooks ?? {}\n config.i18n = config.i18n ?? {}\n config.jobs = {\n deleteJobOnComplete: true,\n depth: 0,\n ...(config.jobs || {}),\n access: {\n cancel: defaultAccess,\n queue: defaultAccess,\n run: defaultAccess,\n ...(config.jobs?.access || {}),\n },\n } as JobsConfig\n config.localization = config.localization ?? false\n config.maxDepth = config.maxDepth ?? 10\n config.routes = {\n admin: '/admin',\n api: '/api',\n graphQL: '/graphql',\n graphQLPlayground: '/graphql-playground',\n ...(config.routes || {}),\n }\n config.serverURL = config.serverURL ?? ''\n config.telemetry = config.telemetry ?? true\n config.typescript = {\n autoGenerate: true,\n outputFile: `${typeof process?.cwd === 'function' ? process.cwd() : ''}/payload-types.ts`,\n ...(config.typescript || {}),\n }\n config.upload = config.upload ?? {}\n\n config.auth = {\n jwtOrder: ['JWT', 'Bearer', 'cookie'],\n ...(config.auth || {}),\n }\n\n config.kv = config.kv ?? databaseKVAdapter()\n\n if (config.kv?.kvCollection) {\n config.collections.push(config.kv.kvCollection)\n }\n\n return config\n}\n"],"names":["defaultAccess","databaseKVAdapter","defaults","admin","avatar","components","custom","dateFormat","dependencies","importMap","baseDir","process","cwd","meta","defaultOGImageType","robots","titleSuffix","routes","account","createFirstUser","forgot","inactivity","login","logout","reset","unauthorized","theme","auth","jwtOrder","bin","collections","cookiePrefix","cors","csrf","defaultDepth","defaultMaxTextLength","endpoints","globals","graphQL","disablePlaygroundInProduction","maxComplexity","schemaOutputFile","hooks","i18n","jobs","access","cancel","queue","run","deleteJobOnComplete","depth","localization","maxDepth","api","graphQLPlayground","serverURL","telemetry","typescript","autoGenerate","outputFile","upload","addDefaultsToConfig","config","disableIntrospectionInProduction","kv","kvCollection","push"],"mappings":"AAGA,SAASA,aAAa,QAAQ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F,OAAOE,EAAE,IAAI/D;IAEzB,IAAI6D,OAAOE,EAAE,EAAEC,cAAc;QAC3BH,OAAOhC,WAAW,CAACoC,IAAI,CAACJ,OAAOE,EAAE,CAACC,YAAY;IAChD;IAEA,OAAOH;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/config/defaults.ts"],"sourcesContent":["import type { JobsConfig } from '../queues/config/types/index.js'\nimport type { Config } from './types.js'\n\nimport { defaultAccess } from '../auth/defaultAccess.js'\nimport { databaseKVAdapter } from '../kv/adapters/DatabaseKVAdapter.js'\n\nexport const addDefaultsToConfig = (config: Config): Config => {\n config.admin = {\n avatar: 'gravatar',\n components: {},\n custom: {},\n dateFormat: 'MMMM do yyyy, h:mm a',\n dependencies: {},\n theme: 'all',\n ...(config.admin || {}),\n importMap: {\n baseDir: `${typeof process?.cwd === 'function' ? process.cwd() : ''}`,\n ...(config?.admin?.importMap || {}),\n },\n meta: {\n defaultOGImageType: 'dynamic',\n robots: 'noindex, nofollow',\n titleSuffix: '- Payload',\n ...(config?.admin?.meta || {}),\n },\n routes: {\n account: '/account',\n createFirstUser: '/create-first-user',\n forgot: '/forgot',\n inactivity: '/logout-inactivity',\n login: '/login',\n logout: '/logout',\n reset: '/reset',\n unauthorized: '/unauthorized',\n ...(config?.admin?.routes || {}),\n },\n }\n\n config.bin = config.bin ?? []\n config.collections = config.collections ?? []\n config.cookiePrefix = config.cookiePrefix ?? 'payload'\n config.cors = config.cors ?? []\n config.csrf = config.csrf ?? []\n config.custom = config.custom ?? {}\n config.defaultDepth = config.defaultDepth ?? 2\n config.defaultMaxTextLength = config.defaultMaxTextLength ?? 40000\n config.endpoints = config.endpoints ?? []\n config.globals = config.globals ?? []\n config.graphQL = {\n disableIntrospectionInProduction: true,\n disablePlaygroundInProduction: true,\n maxComplexity: 1000,\n schemaOutputFile: `${typeof process?.cwd === 'function' ? process.cwd() : ''}/schema.graphql`,\n ...(config.graphQL || {}),\n }\n config.hooks = config.hooks ?? {}\n config.i18n = config.i18n ?? {}\n config.jobs = {\n deleteJobOnComplete: true,\n depth: 0,\n ...(config.jobs || {}),\n access: {\n cancel: defaultAccess,\n queue: defaultAccess,\n run: defaultAccess,\n ...(config.jobs?.access || {}),\n },\n } as JobsConfig\n config.localization = config.localization ?? false\n config.maxDepth = config.maxDepth ?? 10\n config.routes = {\n admin: '/admin',\n api: '/api',\n graphQL: '/graphql',\n graphQLPlayground: '/graphql-playground',\n ...(config.routes || {}),\n }\n config.serverURL = config.serverURL ?? ''\n config.telemetry = config.telemetry ?? true\n config.typescript = {\n autoGenerate: true,\n outputFile: `${typeof process?.cwd === 'function' ? process.cwd() : ''}/payload-types.ts`,\n ...(config.typescript || {}),\n }\n config.upload = config.upload ?? {}\n\n config.auth = {\n jwtOrder: ['JWT', 'Bearer', 'cookie'],\n ...(config.auth || {}),\n }\n\n config.kv = config.kv ?? databaseKVAdapter()\n\n if (config.kv?.kvCollection) {\n config.collections.push(config.kv.kvCollection)\n }\n\n return config\n}\n"],"names":["defaultAccess","databaseKVAdapter","addDefaultsToConfig","config","admin","avatar","components","custom","dateFormat","dependencies","theme","importMap","baseDir","process","cwd","meta","defaultOGImageType","robots","titleSuffix","routes","account","createFirstUser","forgot","inactivity","login","logout","reset","unauthorized","bin","collections","cookiePrefix","cors","csrf","defaultDepth","defaultMaxTextLength","endpoints","globals","graphQL","disableIntrospectionInProduction","disablePlaygroundInProduction","maxComplexity","schemaOutputFile","hooks","i18n","jobs","deleteJobOnComplete","depth","access","cancel","queue","run","localization","maxDepth","api","graphQLPlayground","serverURL","telemetry","typescript","autoGenerate","outputFile","upload","auth","jwtOrder","kv","kvCollection","push"],"mappings":"AAGA,SAASA,aAAa,QAAQ,2BAA0B;AACxD,SAASC,iBAAiB,QAAQ,sCAAqC;AAEvE,OAAO,MAAMC,sBAAsB,CAACC;IAClCA,OAAOC,KAAK,GAAG;QACbC,QAAQ;QACRC,YAAY,CAAC;QACbC,QAAQ,CAAC;QACTC,YAAY;QACZC,cAAc,CAA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IAChD;IAEA,OAAO7D;AACT,EAAC"}
@@ -3,17 +3,16 @@ import type { Config, Plugin, PluginsMap } from './types.js';
3
3
  * Helper for authoring plugins with order, slug, and typed options.
4
4
  * Eliminates boilerplate and ensures metadata is always set consistently.
5
5
  *
6
- * The `plugin` function receives a single object containing `config`, `plugins`
7
- * (a slug-keyed map of other plugins), and any user-provided options spread in.
6
+ * The `plugin` function receives `config`, `plugins` (a slug-keyed map of other
7
+ * plugins), and the user-provided `options`.
8
8
  *
9
9
  * @experimental
10
10
  *
11
11
  * @example
12
12
  * // With options:
13
- * export const seoPlugin = definePlugin<SEOPluginOptions>({
13
+ * export const seoPlugin = definePlugin<SEOPluginConfig>({
14
14
  * slug: 'plugin-seo',
15
- * order: 10,
16
- * plugin: ({ config, plugins, collections }) => ({ ...config }),
15
+ * plugin: ({ config, options }) => ({ ...config }),
17
16
  * })
18
17
  *
19
18
  * // Without options:
@@ -28,14 +27,15 @@ export declare function definePlugin(descriptor: {
28
27
  config: Config;
29
28
  plugins: PluginsMap;
30
29
  }) => Config | Promise<Config>;
31
- slug?: string;
30
+ slug: string;
32
31
  }): () => Plugin;
33
- export declare function definePlugin<TOptions extends Record<string, unknown>>(descriptor: {
32
+ export declare function definePlugin<TOptions>(descriptor: {
34
33
  order?: number;
35
34
  plugin: (args: {
36
35
  config: Config;
36
+ options: TOptions;
37
37
  plugins: PluginsMap;
38
- } & TOptions) => Config | Promise<Config>;
39
- slug?: string;
40
- }): (options: TOptions) => Plugin;
38
+ }) => Config | Promise<Config>;
39
+ slug: string;
40
+ }): undefined extends TOptions ? (options?: TOptions) => Plugin : (options: TOptions) => Plugin;
41
41
  //# sourceMappingURL=definePlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"definePlugin.d.ts","sourceRoot":"","sources":["../../src/config/definePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAc5D;;;;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ACjD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,CAAC,IAAI,EAAE;QACb,MAAM,EAAE,MAAM,CAAA;QACd,OAAO,EAAE,QAAQ,CAAA;QACjB,OAAO,EAAE,UAAU,CAAA;KACpB,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAC9B,IAAI,EAAE,MAAM,CAAA;CACb,GAAG,SAAS,SAAS,QAAQ,GAAG,CAAC,OAAO,CAAC,EAAE,QAAQ,KAAK,MAAM,GAAG,CAAC,OAAO,EAAE,QAAQ,KAAK,MAAM,CAAA"}
@@ -11,19 +11,15 @@ function buildPluginsMap(plugins) {
11
11
  }
12
12
  export function definePlugin(descriptor) {
13
13
  return (options)=>{
14
- const pluginFn = (config)=>{
15
- const plugins = buildPluginsMap(config.plugins);
16
- const args = {
17
- ...options,
14
+ const pluginFn = (config)=>descriptor.plugin({
18
15
  config,
19
- plugins
20
- };
21
- return descriptor.plugin(args);
22
- };
23
- pluginFn.options = options;
24
- if (descriptor.slug !== undefined) {
25
- pluginFn.slug = descriptor.slug;
16
+ options: options,
17
+ plugins: buildPluginsMap(config.plugins)
18
+ });
19
+ if (options !== undefined) {
20
+ pluginFn.options = options;
26
21
  }
22
+ pluginFn.slug = descriptor.slug;
27
23
  if (descriptor.order !== undefined) {
28
24
  pluginFn.order = descriptor.order;
29
25
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/config/definePlugin.ts"],"sourcesContent":["import type { Config, Plugin, PluginsMap } from './types.js'\n\nfunction buildPluginsMap(plugins: Plugin[] | undefined): PluginsMap {\n const map: Record<string, Plugin | undefined> = {}\n if (plugins) {\n for (const p of plugins) {\n if (p.slug) {\n map[p.slug] = p\n }\n }\n }\n return map as PluginsMap\n}\n\n/**\n * Helper for authoring plugins with order, slug, and typed options.\n * Eliminates boilerplate and ensures metadata is always set consistently.\n *\n * The `plugin` function receives a single object containing `config`, `plugins`\n * (a slug-keyed map of other plugins), and any user-provided options spread in.\n *\n * @experimental\n *\n * @example\n * // With options:\n * export const seoPlugin = definePlugin<SEOPluginOptions>({\n * slug: 'plugin-seo',\n * order: 10,\n * plugin: ({ config, plugins, collections }) => ({ ...config }),\n * })\n *\n * // Without options:\n * export const myPlugin = definePlugin({\n * slug: 'my-plugin',\n * plugin: ({ config }) => ({ ...config }),\n * })\n */\nexport function definePlugin(descriptor: {\n order?: number\n plugin: (args: { config: Config; plugins: PluginsMap }) => Config | Promise<Config>\n slug?: string\n}): () => Plugin\nexport function definePlugin<TOptions extends Record<string, unknown>>(descriptor: {\n order?: number\n plugin: (args: { config: Config; plugins: PluginsMap } & TOptions) => Config | Promise<Config>\n slug?: string\n}): (options: TOptions) => Plugin\nexport function definePlugin<TOptions extends Record<string, unknown>>(descriptor: {\n order?: number\n plugin: (args: { config: Config; plugins: PluginsMap } & TOptions) => Config | Promise<Config>\n slug?: string\n}): (options?: TOptions) => Plugin {\n return (options?: TOptions): Plugin => {\n const pluginFn: Plugin = (config) => {\n const plugins = buildPluginsMap(config.plugins)\n\n const args = {\n ...options,\n config,\n plugins,\n } as { config: Config; plugins: PluginsMap } & TOptions\n\n return descriptor.plugin(args)\n }\n\n pluginFn.options = options as Record<string, unknown>\n\n if (descriptor.slug !== undefined) {\n pluginFn.slug = descriptor.slug\n }\n if (descriptor.order !== undefined) {\n pluginFn.order = descriptor.order\n }\n\n return pluginFn\n }\n}\n"],"names":["buildPluginsMap","plugins","map","p","slug","definePlugin","descriptor","options","pluginFn","config","args","plugin","undefined","order"],"mappings":"AAEA,SAASA,gBAAgBC,OAA6B;IACpD,MAAMC,MAA0C,CAAC;IACjD,IAAID,SAAS;QACX,KAAK,MAAME,KAAKF,QAAS;YACvB,IAAIE,EAAEC,IAAI,EAAE;gBACVF,GAAG,CAACC,EAAEC,IAAI,CAAC,GAAGD;YAChB;QACF;IACF;IACA,OAAOD;AACT;AAmCA,OAAO,SAASG,aAAuDC,UAItE;IACC,OAAO,CAACC;QACN,MAAMC,WAAmB,CAACC;YACxB,MAAMR,UAAUD,gBAAgBS,OAAOR,OAAO;YAE9C,MAAMS,OAAO;gBACX,GAAGH,OAAO;gBACVE;gBACAR;YACF;YAEA,OAAOK,WAAWK,MAAM,CAACD;QAC3B;QAEAF,SAASD,OAAO,GAAGA;QAEnB,IAAID,WAAWF,IAAI,KAAKQ,WAAW;YACjCJ,SAASJ,IAAI,GAAGE,WAAWF,IAAI;QACjC;QACA,IAAIE,WAAWO,KAAK,KAAKD,WAAW;YAClCJ,SAASK,KAAK,GAAGP,WAAWO,KAAK;QACnC;QAEA,OAAOL;IACT;AACF"}
1
+ {"version":3,"sources":["../../src/config/definePlugin.ts"],"sourcesContent":["import type { Config, Plugin, PluginsMap } from './types.js'\n\nfunction buildPluginsMap(plugins: Plugin[] | undefined): PluginsMap {\n const map: Record<string, Plugin | undefined> = {}\n if (plugins) {\n for (const p of plugins) {\n if (p.slug) {\n map[p.slug] = p\n }\n }\n }\n return map as PluginsMap\n}\n\n/**\n * Helper for authoring plugins with order, slug, and typed options.\n * Eliminates boilerplate and ensures metadata is always set consistently.\n *\n * The `plugin` function receives `config`, `plugins` (a slug-keyed map of other\n * plugins), and the user-provided `options`.\n *\n * @experimental\n *\n * @example\n * // With options:\n * export const seoPlugin = definePlugin<SEOPluginConfig>({\n * slug: 'plugin-seo',\n * plugin: ({ config, options }) => ({ ...config }),\n * })\n *\n * // Without options:\n * export const myPlugin = definePlugin({\n * slug: 'my-plugin',\n * plugin: ({ config }) => ({ ...config }),\n * })\n */\nexport function definePlugin(descriptor: {\n order?: number\n plugin: (args: { config: Config; plugins: PluginsMap }) => Config | Promise<Config>\n slug: string\n}): () => Plugin\nexport function definePlugin<TOptions>(descriptor: {\n order?: number\n plugin: (args: {\n config: Config\n options: TOptions\n plugins: PluginsMap\n }) => Config | Promise<Config>\n slug: string\n}): undefined extends TOptions ? (options?: TOptions) => Plugin : (options: TOptions) => Plugin\nexport function definePlugin<TOptions>(descriptor: {\n order?: number\n plugin: (args: {\n config: Config\n options: TOptions\n plugins: PluginsMap\n }) => Config | Promise<Config>\n slug: string\n}): (options: TOptions) => Plugin {\n return (options?: TOptions): Plugin => {\n const pluginFn: Plugin = (config) =>\n descriptor.plugin({\n config,\n options: options as TOptions,\n plugins: buildPluginsMap(config.plugins),\n })\n\n if (options !== undefined) {\n pluginFn.options = options as Record<string, unknown>\n }\n pluginFn.slug = descriptor.slug\n if (descriptor.order !== undefined) {\n pluginFn.order = descriptor.order\n }\n\n return pluginFn\n }\n}\n"],"names":["buildPluginsMap","plugins","map","p","slug","definePlugin","descriptor","options","pluginFn","config","plugin","undefined","order"],"mappings":"AAEA,SAASA,gBAAgBC,OAA6B;IACpD,MAAMC,MAA0C,CAAC;IACjD,IAAID,SAAS;QACX,KAAK,MAAME,KAAKF,QAAS;YACvB,IAAIE,EAAEC,IAAI,EAAE;gBACVF,GAAG,CAACC,EAAEC,IAAI,CAAC,GAAGD;YAChB;QACF;IACF;IACA,OAAOD;AACT;AAsCA,OAAO,SAASG,aAAuBC,UAQtC;IACC,OAAO,CAACC;QACN,MAAMC,WAAmB,CAACC,SACxBH,WAAWI,MAAM,CAAC;gBAChBD;gBACAF,SAASA;gBACTN,SAASD,gBAAgBS,OAAOR,OAAO;YACzC;QAEF,IAAIM,YAAYI,WAAW;YACzBH,SAASD,OAAO,GAAGA;QACrB;QACAC,SAASJ,IAAI,GAAGE,WAAWF,IAAI;QAC/B,IAAIE,WAAWM,KAAK,KAAKD,WAAW;YAClCH,SAASI,KAAK,GAAGN,WAAWM,KAAK;QACnC;QAEA,OAAOJ;IACT;AACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,MAAM,EAGN,eAAe,EAIhB,MAAM,YAAY,CAAA;AA+FnB,eAAO,MAAM,cAAc,GAAU,gBAAgB,MAAM,KAAG,OAAO,CAAC,eAAe,CAgYpF,CAAA"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/config/sanitize.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,MAAM,EAIN,eAAe,EAIhB,MAAM,YAAY,CAAA;AAiOnB,eAAO,MAAM,cAAc,GAAU,gBAAgB,MAAM,KAAG,OAAO,CAAC,eAAe,CAsYpF,CAAA"}