payload 4.0.0-internal.e55ccef → 4.0.0-internal.f11981a

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 (296) hide show
  1. package/dist/admin/RichText.d.ts +1 -1
  2. package/dist/admin/RichText.d.ts.map +1 -1
  3. package/dist/admin/RichText.js.map +1 -1
  4. package/dist/admin/functions/index.d.ts +10 -8
  5. package/dist/admin/functions/index.d.ts.map +1 -1
  6. package/dist/admin/functions/index.js.map +1 -1
  7. package/dist/admin/types.d.ts +2 -2
  8. package/dist/admin/types.d.ts.map +1 -1
  9. package/dist/admin/types.js.map +1 -1
  10. package/dist/auth/endpoints/login.d.ts.map +1 -1
  11. package/dist/auth/endpoints/login.js +2 -11
  12. package/dist/auth/endpoints/login.js.map +1 -1
  13. package/dist/auth/endpoints/refresh.d.ts.map +1 -1
  14. package/dist/auth/endpoints/refresh.js +4 -6
  15. package/dist/auth/endpoints/refresh.js.map +1 -1
  16. package/dist/auth/executeAccess.d.ts +1 -1
  17. package/dist/auth/executeAccess.d.ts.map +1 -1
  18. package/dist/auth/executeAccess.js.map +1 -1
  19. package/dist/auth/getLoginOptions.js.map +1 -1
  20. package/dist/auth/loginWithCookie.d.ts +33 -0
  21. package/dist/auth/loginWithCookie.d.ts.map +1 -0
  22. package/dist/auth/loginWithCookie.js +34 -0
  23. package/dist/auth/loginWithCookie.js.map +1 -0
  24. package/dist/auth/serverFunctions/cookies.d.ts +47 -0
  25. package/dist/auth/serverFunctions/cookies.d.ts.map +1 -0
  26. package/dist/auth/serverFunctions/cookies.js +52 -0
  27. package/dist/auth/serverFunctions/cookies.js.map +1 -0
  28. package/dist/auth/serverFunctions/login.d.ts +29 -0
  29. package/dist/auth/serverFunctions/login.d.ts.map +1 -0
  30. package/dist/auth/serverFunctions/login.js +63 -0
  31. package/dist/auth/serverFunctions/login.js.map +1 -0
  32. package/dist/auth/serverFunctions/logout.d.ts +17 -0
  33. package/dist/auth/serverFunctions/logout.d.ts.map +1 -0
  34. package/dist/auth/serverFunctions/logout.js +58 -0
  35. package/dist/auth/serverFunctions/logout.js.map +1 -0
  36. package/dist/auth/serverFunctions/refresh.d.ts +17 -0
  37. package/dist/auth/serverFunctions/refresh.d.ts.map +1 -0
  38. package/dist/auth/serverFunctions/refresh.js +61 -0
  39. package/dist/auth/serverFunctions/refresh.js.map +1 -0
  40. package/dist/auth/types.d.ts +9 -14
  41. package/dist/auth/types.d.ts.map +1 -1
  42. package/dist/auth/types.js.map +1 -1
  43. package/dist/collections/config/client.d.ts +8 -2
  44. package/dist/collections/config/client.d.ts.map +1 -1
  45. package/dist/collections/config/client.js +6 -1
  46. package/dist/collections/config/client.js.map +1 -1
  47. package/dist/collections/config/defaults.d.ts +4 -4
  48. package/dist/collections/config/defaults.d.ts.map +1 -1
  49. package/dist/collections/config/defaults.js +37 -32
  50. package/dist/collections/config/defaults.js.map +1 -1
  51. package/dist/collections/config/sanitize.d.ts +4 -8
  52. package/dist/collections/config/sanitize.d.ts.map +1 -1
  53. package/dist/collections/config/sanitize.js +4 -21
  54. package/dist/collections/config/sanitize.js.map +1 -1
  55. package/dist/collections/config/types.d.ts +53 -49
  56. package/dist/collections/config/types.d.ts.map +1 -1
  57. package/dist/collections/config/types.js.map +1 -1
  58. package/dist/collections/config/useAsTitle.spec.js +27 -27
  59. package/dist/collections/config/useAsTitle.spec.js.map +1 -1
  60. package/dist/collections/operations/create.d.ts.map +1 -1
  61. package/dist/collections/operations/create.js +10 -0
  62. package/dist/collections/operations/create.js.map +1 -1
  63. package/dist/collections/operations/restoreVersion.d.ts.map +1 -1
  64. package/dist/collections/operations/restoreVersion.js +7 -4
  65. package/dist/collections/operations/restoreVersion.js.map +1 -1
  66. package/dist/collections/operations/updateByID.js +1 -0
  67. package/dist/collections/operations/updateByID.js.map +1 -1
  68. package/dist/config/build.js +1 -1
  69. package/dist/config/build.js.map +1 -1
  70. package/dist/config/defaults.d.ts.map +1 -1
  71. package/dist/config/defaults.js +5 -2
  72. package/dist/config/defaults.js.map +1 -1
  73. package/dist/config/orderable/index.d.ts +1 -1
  74. package/dist/config/orderable/index.d.ts.map +1 -1
  75. package/dist/config/orderable/index.js +2 -2
  76. package/dist/config/orderable/index.js.map +1 -1
  77. package/dist/config/sanitize.d.ts +1 -1
  78. package/dist/config/sanitize.d.ts.map +1 -1
  79. package/dist/config/sanitize.js +37 -31
  80. package/dist/config/sanitize.js.map +1 -1
  81. package/dist/config/types.d.ts +1 -1
  82. package/dist/config/types.js.map +1 -1
  83. package/dist/database/createDatabaseAdapter.d.ts +1 -1
  84. package/dist/database/createDatabaseAdapter.d.ts.map +1 -1
  85. package/dist/database/createDatabaseAdapter.js +0 -2
  86. package/dist/database/createDatabaseAdapter.js.map +1 -1
  87. package/dist/database/types.d.ts +6 -0
  88. package/dist/database/types.d.ts.map +1 -1
  89. package/dist/database/types.js.map +1 -1
  90. package/dist/exports/auth.d.ts +5 -0
  91. package/dist/exports/auth.d.ts.map +1 -0
  92. package/dist/exports/auth.js +6 -0
  93. package/dist/exports/auth.js.map +1 -0
  94. package/dist/exports/internal.d.ts +2 -0
  95. package/dist/exports/internal.d.ts.map +1 -1
  96. package/dist/exports/internal.js +3 -1
  97. package/dist/exports/internal.js.map +1 -1
  98. package/dist/fields/baseFields/slug/duplicateContext.d.ts +11 -0
  99. package/dist/fields/baseFields/slug/duplicateContext.d.ts.map +1 -0
  100. package/dist/fields/baseFields/slug/duplicateContext.js +21 -0
  101. package/dist/fields/baseFields/slug/duplicateContext.js.map +1 -0
  102. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.d.ts +22 -0
  103. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.d.ts.map +1 -0
  104. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.js +63 -0
  105. package/dist/fields/baseFields/slug/fillEmptyLocalizedSlugs.js.map +1 -0
  106. package/dist/fields/baseFields/slug/generateSlug.d.ts +13 -8
  107. package/dist/fields/baseFields/slug/generateSlug.d.ts.map +1 -1
  108. package/dist/fields/baseFields/slug/generateSlug.js +98 -45
  109. package/dist/fields/baseFields/slug/generateSlug.js.map +1 -1
  110. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.d.ts +18 -0
  111. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.d.ts.map +1 -0
  112. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.js +20 -0
  113. package/dist/fields/baseFields/slug/generateSlugBeforeDuplicate.js.map +1 -0
  114. package/dist/fields/baseFields/slug/getSlugFallbackValue.d.ts +22 -0
  115. package/dist/fields/baseFields/slug/getSlugFallbackValue.d.ts.map +1 -0
  116. package/dist/fields/baseFields/slug/getSlugFallbackValue.js +23 -0
  117. package/dist/fields/baseFields/slug/getSlugFallbackValue.js.map +1 -0
  118. package/dist/fields/baseFields/slug/hasValue.d.ts +3 -0
  119. package/dist/fields/baseFields/slug/hasValue.d.ts.map +1 -0
  120. package/dist/fields/baseFields/slug/hasValue.js +3 -0
  121. package/dist/fields/baseFields/slug/hasValue.js.map +1 -0
  122. package/dist/fields/config/reservedFieldNames.spec.js +18 -18
  123. package/dist/fields/config/reservedFieldNames.spec.js.map +1 -1
  124. package/dist/fields/config/sanitize.d.ts +6 -6
  125. package/dist/fields/config/sanitize.d.ts.map +1 -1
  126. package/dist/fields/config/sanitize.js +32 -22
  127. package/dist/fields/config/sanitize.js.map +1 -1
  128. package/dist/fields/config/sanitize.spec.js +105 -105
  129. package/dist/fields/config/sanitize.spec.js.map +1 -1
  130. package/dist/fields/config/types.d.ts +4 -3
  131. package/dist/fields/config/types.d.ts.map +1 -1
  132. package/dist/fields/config/types.js +1 -1
  133. package/dist/fields/config/types.js.map +1 -1
  134. package/dist/fields/hooks/beforeValidate/traverseFields.d.ts.map +1 -1
  135. package/dist/fields/hooks/beforeValidate/traverseFields.js +2 -0
  136. package/dist/fields/hooks/beforeValidate/traverseFields.js.map +1 -1
  137. package/dist/fields/validations.d.ts.map +1 -1
  138. package/dist/fields/validations.js +7 -8
  139. package/dist/fields/validations.js.map +1 -1
  140. package/dist/fields/validations.spec.js +61 -37
  141. package/dist/fields/validations.spec.js.map +1 -1
  142. package/dist/globals/config/sanitize.d.ts +3 -7
  143. package/dist/globals/config/sanitize.d.ts.map +1 -1
  144. package/dist/globals/config/sanitize.js +3 -6
  145. package/dist/globals/config/sanitize.js.map +1 -1
  146. package/dist/globals/config/sanitize.spec.js +6 -6
  147. package/dist/globals/config/sanitize.spec.js.map +1 -1
  148. package/dist/globals/operations/countGlobalVersions.d.ts.map +1 -1
  149. package/dist/globals/operations/countGlobalVersions.js +1 -0
  150. package/dist/globals/operations/countGlobalVersions.js.map +1 -1
  151. package/dist/index.bundled.d.ts +4095 -3972
  152. package/dist/index.d.ts +49 -17
  153. package/dist/index.d.ts.map +1 -1
  154. package/dist/index.js +3 -0
  155. package/dist/index.js.map +1 -1
  156. package/dist/query-presets/constraints.js +1 -1
  157. package/dist/query-presets/constraints.js.map +1 -1
  158. package/dist/queues/config/collection.d.ts.map +1 -1
  159. package/dist/queues/config/collection.js +37 -43
  160. package/dist/queues/config/collection.js.map +1 -1
  161. package/dist/queues/config/global.d.ts +5 -6
  162. package/dist/queues/config/global.d.ts.map +1 -1
  163. package/dist/queues/config/global.js +1 -1
  164. package/dist/queues/config/global.js.map +1 -1
  165. package/dist/queues/config/types/index.d.ts +29 -24
  166. package/dist/queues/config/types/index.d.ts.map +1 -1
  167. package/dist/queues/config/types/index.js.map +1 -1
  168. package/dist/queues/config/types/taskTypes.d.ts +4 -7
  169. package/dist/queues/config/types/taskTypes.d.ts.map +1 -1
  170. package/dist/queues/config/types/taskTypes.js.map +1 -1
  171. package/dist/queues/config/types/workflowJSONTypes.d.ts +10 -9
  172. package/dist/queues/config/types/workflowJSONTypes.d.ts.map +1 -1
  173. package/dist/queues/config/types/workflowJSONTypes.js.map +1 -1
  174. package/dist/queues/config/types/workflowTypes.d.ts +11 -58
  175. package/dist/queues/config/types/workflowTypes.d.ts.map +1 -1
  176. package/dist/queues/config/types/workflowTypes.js.map +1 -1
  177. package/dist/queues/endpoints/handleSchedules.js +1 -1
  178. package/dist/queues/endpoints/handleSchedules.js.map +1 -1
  179. package/dist/queues/errors/handleTaskError.js +4 -4
  180. package/dist/queues/errors/handleTaskError.js.map +1 -1
  181. package/dist/queues/errors/handleWorkflowError.js +1 -1
  182. package/dist/queues/errors/handleWorkflowError.js.map +1 -1
  183. package/dist/queues/errors/index.d.ts +6 -0
  184. package/dist/queues/errors/index.d.ts.map +1 -1
  185. package/dist/queues/errors/index.js +5 -0
  186. package/dist/queues/errors/index.js.map +1 -1
  187. package/dist/queues/localAPI.d.ts +4 -4
  188. package/dist/queues/localAPI.d.ts.map +1 -1
  189. package/dist/queues/localAPI.js +63 -66
  190. package/dist/queues/localAPI.js.map +1 -1
  191. package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.d.ts +4 -4
  192. package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.d.ts.map +1 -1
  193. package/dist/queues/operations/handleSchedules/countRunnableOrActiveJobsForQueue.js.map +1 -1
  194. package/dist/queues/operations/handleSchedules/index.d.ts +1 -1
  195. package/dist/queues/operations/handleSchedules/index.d.ts.map +1 -1
  196. package/dist/queues/operations/handleSchedules/index.js +1 -1
  197. package/dist/queues/operations/handleSchedules/index.js.map +1 -1
  198. package/dist/queues/operations/runJobs/heartbeat.d.ts +13 -0
  199. package/dist/queues/operations/runJobs/heartbeat.d.ts.map +1 -0
  200. package/dist/queues/operations/runJobs/heartbeat.js +66 -0
  201. package/dist/queues/operations/runJobs/heartbeat.js.map +1 -0
  202. package/dist/queues/operations/runJobs/index.d.ts.map +1 -1
  203. package/dist/queues/operations/runJobs/index.js +133 -84
  204. package/dist/queues/operations/runJobs/index.js.map +1 -1
  205. package/dist/queues/operations/runJobs/runJSONJob/index.d.ts.map +1 -1
  206. package/dist/queues/operations/runJobs/runJSONJob/index.js +6 -3
  207. package/dist/queues/operations/runJobs/runJSONJob/index.js.map +1 -1
  208. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js +5 -5
  209. package/dist/queues/operations/runJobs/runJob/getRunTaskFunction.js.map +1 -1
  210. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.d.ts +2 -1
  211. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.d.ts.map +1 -1
  212. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.js +39 -8
  213. package/dist/queues/operations/runJobs/runJob/getUpdateJobFunction.js.map +1 -1
  214. package/dist/queues/operations/runJobs/runJob/importHandlerPath.js.map +1 -1
  215. package/dist/queues/operations/runJobs/runJob/index.d.ts.map +1 -1
  216. package/dist/queues/operations/runJobs/runJob/index.js +4 -4
  217. package/dist/queues/operations/runJobs/runJob/index.js.map +1 -1
  218. package/dist/queues/utilities/updateJob.d.ts.map +1 -1
  219. package/dist/queues/utilities/updateJob.js +3 -0
  220. package/dist/queues/utilities/updateJob.js.map +1 -1
  221. package/dist/types/index.d.ts +2 -5
  222. package/dist/types/index.d.ts.map +1 -1
  223. package/dist/types/index.js.map +1 -1
  224. package/dist/uploads/checkFileRestrictions.d.ts +1 -1
  225. package/dist/uploads/checkFileRestrictions.d.ts.map +1 -1
  226. package/dist/uploads/checkFileRestrictions.js +15 -1
  227. package/dist/uploads/checkFileRestrictions.js.map +1 -1
  228. package/dist/uploads/endpoints/uploadInstructions.d.ts +15 -0
  229. package/dist/uploads/endpoints/uploadInstructions.d.ts.map +1 -0
  230. package/dist/uploads/endpoints/uploadInstructions.js +84 -0
  231. package/dist/uploads/endpoints/uploadInstructions.js.map +1 -0
  232. package/dist/uploads/generateFileData.js +4 -1
  233. package/dist/uploads/generateFileData.js.map +1 -1
  234. package/dist/uploads/getFileFromUploadInstructions.d.ts +8 -0
  235. package/dist/uploads/getFileFromUploadInstructions.d.ts.map +1 -0
  236. package/dist/uploads/getFileFromUploadInstructions.js +62 -0
  237. package/dist/uploads/getFileFromUploadInstructions.js.map +1 -0
  238. package/dist/uploads/getImageSize.d.ts +12 -1
  239. package/dist/uploads/getImageSize.d.ts.map +1 -1
  240. package/dist/uploads/getImageSize.js +20 -18
  241. package/dist/uploads/getImageSize.js.map +1 -1
  242. package/dist/uploads/getImageSize.spec.js +298 -0
  243. package/dist/uploads/getImageSize.spec.js.map +1 -0
  244. package/dist/uploads/probeImageSize.d.ts +39 -0
  245. package/dist/uploads/probeImageSize.d.ts.map +1 -0
  246. package/dist/uploads/probeImageSize.js +374 -0
  247. package/dist/uploads/probeImageSize.js.map +1 -0
  248. package/dist/uploads/probeImageSize.spec.js +366 -0
  249. package/dist/uploads/probeImageSize.spec.js.map +1 -0
  250. package/dist/uploads/stagedUpload.d.ts +27 -0
  251. package/dist/uploads/stagedUpload.d.ts.map +1 -0
  252. package/dist/uploads/stagedUpload.js +197 -0
  253. package/dist/uploads/stagedUpload.js.map +1 -0
  254. package/dist/uploads/types.d.ts +81 -7
  255. package/dist/uploads/types.d.ts.map +1 -1
  256. package/dist/uploads/types.js.map +1 -1
  257. package/dist/utilities/addDataAndFileToRequest.d.ts.map +1 -1
  258. package/dist/utilities/addDataAndFileToRequest.js +12 -45
  259. package/dist/utilities/addDataAndFileToRequest.js.map +1 -1
  260. package/dist/utilities/appendNonTrashedFilter.d.ts +1 -1
  261. package/dist/utilities/appendNonTrashedFilter.d.ts.map +1 -1
  262. package/dist/utilities/appendNonTrashedFilter.js.map +1 -1
  263. package/dist/utilities/configToJSONSchema.spec.js +33 -33
  264. package/dist/utilities/configToJSONSchema.spec.js.map +1 -1
  265. package/dist/utilities/fieldValueExists.d.ts +29 -0
  266. package/dist/utilities/fieldValueExists.d.ts.map +1 -0
  267. package/dist/utilities/fieldValueExists.js +27 -0
  268. package/dist/utilities/fieldValueExists.js.map +1 -0
  269. package/dist/utilities/getUniqueFieldValue.d.ts +27 -0
  270. package/dist/utilities/getUniqueFieldValue.d.ts.map +1 -0
  271. package/dist/utilities/getUniqueFieldValue.js +26 -0
  272. package/dist/utilities/getUniqueFieldValue.js.map +1 -0
  273. package/dist/utilities/traverseFields.d.ts.map +1 -1
  274. package/dist/utilities/traverseFields.js +20 -22
  275. package/dist/utilities/traverseFields.js.map +1 -1
  276. package/dist/utilities/traverseFields.spec.js +112 -0
  277. package/dist/utilities/traverseFields.spec.js.map +1 -1
  278. package/dist/utilities/unflattenData.d.ts +3 -0
  279. package/dist/utilities/unflattenData.d.ts.map +1 -0
  280. package/dist/utilities/unflattenData.js +14 -0
  281. package/dist/utilities/unflattenData.js.map +1 -0
  282. package/dist/versions/deleteScheduledPublishJobs.js +2 -2
  283. package/dist/versions/deleteScheduledPublishJobs.js.map +1 -1
  284. package/package.json +8 -3
  285. package/dist/database/defaultUpdateJobs.d.ts +0 -3
  286. package/dist/database/defaultUpdateJobs.d.ts.map +0 -1
  287. package/dist/database/defaultUpdateJobs.js +0 -41
  288. package/dist/database/defaultUpdateJobs.js.map +0 -1
  289. package/dist/fields/baseFields/slug/countVersions.d.ts +0 -13
  290. package/dist/fields/baseFields/slug/countVersions.d.ts.map +0 -1
  291. package/dist/fields/baseFields/slug/countVersions.js +0 -27
  292. package/dist/fields/baseFields/slug/countVersions.js.map +0 -1
  293. package/dist/uploads/tempFile.d.ts +0 -7
  294. package/dist/uploads/tempFile.d.ts.map +0 -1
  295. package/dist/uploads/tempFile.js +0 -39
  296. package/dist/uploads/tempFile.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/auth/loginWithCookie.ts"],"sourcesContent":["import type { Collection } from '../collections/config/types.js'\nimport type { AuthCollectionSlug } from '../index.js'\nimport type { PayloadRequest } from '../types/index.js'\nimport type { generateCookie } from './cookies.js'\nimport type { LoginResult } from './operations/login.js'\n\nimport { generatePayloadCookie } from './cookies.js'\nimport { loginOperation } from './operations/login.js'\n\ntype CookieObject = Extract<ReturnType<typeof generateCookie<true>>, { name: string }>\n\ntype LoginWithCookieArgs<TReturnCookieAsObject extends boolean> = {\n collection: Collection\n data: Parameters<typeof loginOperation>[0]['data']\n depth?: number\n overrideAccess?: boolean\n req: PayloadRequest\n /** Return the cookie as parts rather than a serialized header string. */\n returnCookieAsObject?: TReturnCookieAsObject\n}\n\n/**\n * Runs the login operation and builds the auth cookie from its token, then\n * applies `auth.removeTokenFromResponses` to the returned result.\n *\n * The order matters: the token has to be read before the flag strips it, or the\n * caller ends up returning a user with no way to establish a session. Shared by\n * the REST login handler and the framework adapters' `login` server function so\n * that ordering only exists in one place.\n */\nexport const loginWithCookie = async <\n TSlug extends AuthCollectionSlug,\n TReturnCookieAsObject extends boolean = false,\n>({\n collection,\n data,\n depth,\n overrideAccess,\n req,\n returnCookieAsObject,\n}: LoginWithCookieArgs<TReturnCookieAsObject>): Promise<{\n cookie: TReturnCookieAsObject extends true ? CookieObject : string\n result: LoginResult<TSlug>\n}> => {\n const result = await loginOperation({\n collection,\n data,\n depth,\n overrideAccess,\n req,\n })\n\n const cookie = generatePayloadCookie({\n collectionAuthConfig: collection.config.auth,\n cookiePrefix: req.payload.config.cookiePrefix,\n returnCookieAsObject: returnCookieAsObject ?? false,\n token: result.token!,\n }) as TReturnCookieAsObject extends true ? CookieObject : string\n\n if (collection.config.auth.removeTokenFromResponses) {\n delete result.token\n }\n\n return { cookie, result }\n}\n"],"names":["generatePayloadCookie","loginOperation","loginWithCookie","collection","data","depth","overrideAccess","req","returnCookieAsObject","result","cookie","collectionAuthConfig","config","auth","cookiePrefix","payload","token","removeTokenFromResponses"],"mappings":"AAMA,SAASA,qBAAqB,QAAQ,eAAc;AACpD,SAASC,cAAc,QAAQ,wBAAuB;AActD;;;;;;;;CAQC,GACD,OAAO,MAAMC,kBAAkB,OAG7B,EACAC,UAAU,EACVC,IAAI,EACJC,KAAK,EACLC,cAAc,EACdC,GAAG,EACHC,oBAAoB,EACuB;IAI3C,MAAMC,SAAS,MAAMR,eAAe;QAClCE;QACAC;QACAC;QACAC;QACAC;IACF;IAEA,MAAMG,SAASV,sBAAsB;QACnCW,sBAAsBR,WAAWS,MAAM,CAACC,IAAI;QAC5CC,cAAcP,IAAIQ,OAAO,CAACH,MAAM,CAACE,YAAY;QAC7CN,sBAAsBA,wBAAwB;QAC9CQ,OAAOP,OAAOO,KAAK;IACrB;IAEA,IAAIb,WAAWS,MAAM,CAACC,IAAI,CAACI,wBAAwB,EAAE;QACnD,OAAOR,OAAOO,KAAK;IACrB;IAEA,OAAO;QAAEN;QAAQD;IAAO;AAC1B,EAAC"}
@@ -0,0 +1,47 @@
1
+ import type { ServerAdapter } from '../../admin/adapters/server.js';
2
+ import type { Auth } from '../types.js';
3
+ /**
4
+ * Object form returned by `generatePayloadCookie`/`generateExpiredPayloadCookie`
5
+ * when `returnCookieAsObject` is `true`.
6
+ */
7
+ export type GeneratedCookie = {
8
+ domain?: string;
9
+ expires?: string;
10
+ httpOnly?: boolean;
11
+ maxAge?: number;
12
+ name: string;
13
+ path?: string;
14
+ sameSite?: 'Lax' | 'None' | 'Strict';
15
+ secure?: boolean;
16
+ value: string | undefined;
17
+ };
18
+ type AuthCookieArgs = {
19
+ authConfig: Auth;
20
+ cookiePrefix: string;
21
+ serverAdapter: ServerAdapter;
22
+ };
23
+ /** Writes an already-generated cookie through the framework's cookie API. */
24
+ export declare function applyAuthCookie({ cookie, serverAdapter, }: {
25
+ cookie: GeneratedCookie;
26
+ serverAdapter: ServerAdapter;
27
+ }): Promise<void>;
28
+ /** Writes the Payload auth cookie for `token` through the framework's cookie API. */
29
+ export declare function setAuthCookie({ authConfig, cookiePrefix, serverAdapter, token, }: {
30
+ token: string;
31
+ } & AuthCookieArgs): Promise<void>;
32
+ /**
33
+ * Expires the Payload auth cookie. Written with the same `domain`/`path`/`secure`
34
+ * attributes it was set with — a mismatched `domain` leaves the original cookie
35
+ * in place.
36
+ */
37
+ export declare function clearAuthCookie({ authConfig, cookiePrefix, serverAdapter, }: AuthCookieArgs): Promise<void>;
38
+ /** Reads the request's existing Payload auth cookie, if any. */
39
+ export declare function getExistingAuthToken({ cookiePrefix, serverAdapter, }: {
40
+ cookiePrefix: string;
41
+ serverAdapter: ServerAdapter;
42
+ }): Promise<{
43
+ name: string;
44
+ value: string;
45
+ } | undefined>;
46
+ export {};
47
+ //# sourceMappingURL=cookies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cookies.d.ts","sourceRoot":"","sources":["../../../src/auth/serverFunctions/cookies.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAIvC;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAA;IACpC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CAC1B,CAAA;AAcD,KAAK,cAAc,GAAG;IACpB,UAAU,EAAE,IAAI,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,aAAa,CAAA;CAC7B,CAAA;AAED,6EAA6E;AAC7E,wBAAsB,eAAe,CAAC,EACpC,MAAM,EACN,aAAa,GACd,EAAE;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,aAAa,EAAE,aAAa,CAAA;CAC7B,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhB;AAED,qFAAqF;AACrF,wBAAsB,aAAa,CAAC,EAClC,UAAU,EACV,YAAY,EACZ,aAAa,EACb,KAAK,GACN,EAAE;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CASpD;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,EACpC,UAAU,EACV,YAAY,EACZ,aAAa,GACd,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhC;AAED,gEAAgE;AAChE,wBAAsB,oBAAoB,CAAC,EACzC,YAAY,EACZ,aAAa,GACd,EAAE;IACD,YAAY,EAAE,MAAM,CAAA;IACpB,aAAa,EAAE,aAAa,CAAA;CAC7B,GAAG,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAAC,CASvD"}
@@ -0,0 +1,52 @@
1
+ import { generateExpiredPayloadCookie, generatePayloadCookie } from '../cookies.js';
2
+ // `generateCookie` emits capitalized `SameSite` values (as they appear in the
3
+ // header); `CookieOptions` takes the lowercase form.
4
+ const toCookieOptions = (cookie)=>({
5
+ domain: cookie.domain,
6
+ expires: cookie.expires ? new Date(cookie.expires) : undefined,
7
+ httpOnly: cookie.httpOnly,
8
+ maxAge: cookie.maxAge,
9
+ path: cookie.path,
10
+ sameSite: cookie.sameSite?.toLowerCase(),
11
+ secure: cookie.secure
12
+ });
13
+ /** Writes an already-generated cookie through the framework's cookie API. */ export async function applyAuthCookie({ cookie, serverAdapter }) {
14
+ if (!cookie.value) {
15
+ return;
16
+ }
17
+ await serverAdapter.setCookie(cookie.name, cookie.value, toCookieOptions(cookie));
18
+ }
19
+ /** Writes the Payload auth cookie for `token` through the framework's cookie API. */ export async function setAuthCookie({ authConfig, cookiePrefix, serverAdapter, token }) {
20
+ const cookie = generatePayloadCookie({
21
+ collectionAuthConfig: authConfig,
22
+ cookiePrefix,
23
+ returnCookieAsObject: true,
24
+ token
25
+ });
26
+ await applyAuthCookie({
27
+ cookie,
28
+ serverAdapter
29
+ });
30
+ }
31
+ /**
32
+ * Expires the Payload auth cookie. Written with the same `domain`/`path`/`secure`
33
+ * attributes it was set with — a mismatched `domain` leaves the original cookie
34
+ * in place.
35
+ */ export async function clearAuthCookie({ authConfig, cookiePrefix, serverAdapter }) {
36
+ const cookie = generateExpiredPayloadCookie({
37
+ collectionAuthConfig: authConfig,
38
+ cookiePrefix,
39
+ returnCookieAsObject: true
40
+ });
41
+ await serverAdapter.setCookie(cookie.name, '', toCookieOptions(cookie));
42
+ }
43
+ /** Reads the request's existing Payload auth cookie, if any. */ export async function getExistingAuthToken({ cookiePrefix, serverAdapter }) {
44
+ const store = await serverAdapter.getCookies();
45
+ const allCookies = store.getAll?.();
46
+ if (allCookies) {
47
+ return allCookies.find((cookie)=>cookie.name.startsWith(cookiePrefix));
48
+ }
49
+ return store.get(`${cookiePrefix}-token`) ?? undefined;
50
+ }
51
+
52
+ //# sourceMappingURL=cookies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/auth/serverFunctions/cookies.ts"],"sourcesContent":["import type { CookieOptions } from '../../admin/adapters/cookies.js'\nimport type { ServerAdapter } from '../../admin/adapters/server.js'\nimport type { Auth } from '../types.js'\n\nimport { generateExpiredPayloadCookie, generatePayloadCookie } from '../cookies.js'\n\n/**\n * Object form returned by `generatePayloadCookie`/`generateExpiredPayloadCookie`\n * when `returnCookieAsObject` is `true`.\n */\nexport type GeneratedCookie = {\n domain?: string\n expires?: string\n httpOnly?: boolean\n maxAge?: number\n name: string\n path?: string\n sameSite?: 'Lax' | 'None' | 'Strict'\n secure?: boolean\n value: string | undefined\n}\n\n// `generateCookie` emits capitalized `SameSite` values (as they appear in the\n// header); `CookieOptions` takes the lowercase form.\nconst toCookieOptions = (cookie: GeneratedCookie): CookieOptions => ({\n domain: cookie.domain,\n expires: cookie.expires ? new Date(cookie.expires) : undefined,\n httpOnly: cookie.httpOnly,\n maxAge: cookie.maxAge,\n path: cookie.path,\n sameSite: cookie.sameSite?.toLowerCase() as CookieOptions['sameSite'],\n secure: cookie.secure,\n})\n\ntype AuthCookieArgs = {\n authConfig: Auth\n cookiePrefix: string\n serverAdapter: ServerAdapter\n}\n\n/** Writes an already-generated cookie through the framework's cookie API. */\nexport async function applyAuthCookie({\n cookie,\n serverAdapter,\n}: {\n cookie: GeneratedCookie\n serverAdapter: ServerAdapter\n}): Promise<void> {\n if (!cookie.value) {\n return\n }\n\n await serverAdapter.setCookie(cookie.name, cookie.value, toCookieOptions(cookie))\n}\n\n/** Writes the Payload auth cookie for `token` through the framework's cookie API. */\nexport async function setAuthCookie({\n authConfig,\n cookiePrefix,\n serverAdapter,\n token,\n}: { token: string } & AuthCookieArgs): Promise<void> {\n const cookie = generatePayloadCookie({\n collectionAuthConfig: authConfig,\n cookiePrefix,\n returnCookieAsObject: true,\n token,\n }) as GeneratedCookie\n\n await applyAuthCookie({ cookie, serverAdapter })\n}\n\n/**\n * Expires the Payload auth cookie. Written with the same `domain`/`path`/`secure`\n * attributes it was set with — a mismatched `domain` leaves the original cookie\n * in place.\n */\nexport async function clearAuthCookie({\n authConfig,\n cookiePrefix,\n serverAdapter,\n}: AuthCookieArgs): Promise<void> {\n const cookie = generateExpiredPayloadCookie({\n collectionAuthConfig: authConfig,\n cookiePrefix,\n returnCookieAsObject: true,\n }) as GeneratedCookie\n\n await serverAdapter.setCookie(cookie.name, '', toCookieOptions(cookie))\n}\n\n/** Reads the request's existing Payload auth cookie, if any. */\nexport async function getExistingAuthToken({\n cookiePrefix,\n serverAdapter,\n}: {\n cookiePrefix: string\n serverAdapter: ServerAdapter\n}): Promise<{ name: string; value: string } | undefined> {\n const store = await serverAdapter.getCookies()\n const allCookies = store.getAll?.()\n\n if (allCookies) {\n return allCookies.find((cookie) => cookie.name.startsWith(cookiePrefix))\n }\n\n return store.get(`${cookiePrefix}-token`) ?? undefined\n}\n"],"names":["generateExpiredPayloadCookie","generatePayloadCookie","toCookieOptions","cookie","domain","expires","Date","undefined","httpOnly","maxAge","path","sameSite","toLowerCase","secure","applyAuthCookie","serverAdapter","value","setCookie","name","setAuthCookie","authConfig","cookiePrefix","token","collectionAuthConfig","returnCookieAsObject","clearAuthCookie","getExistingAuthToken","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G,MAAM;IAE/B,IAAID,YAAY;QACd,OAAOA,WAAWE,IAAI,CAAC,CAAC5B,SAAWA,OAAOe,IAAI,CAACc,UAAU,CAACX;IAC5D;IAEA,OAAOM,MAAMM,GAAG,CAAC,GAAGZ,aAAa,MAAM,CAAC,KAAKd;AAC/C"}
@@ -0,0 +1,29 @@
1
+ import type { ServerAdapter } from '../../admin/adapters/server.js';
2
+ import type { SanitizedConfig } from '../../config/types.js';
3
+ import type { AuthCollectionSlug } from '../../index.js';
4
+ import type { MaybePromise } from '../../types/index.js';
5
+ import type { LoginResult } from '../operations/login.js';
6
+ export type LoginArgs<TSlug extends AuthCollectionSlug> = {
7
+ collection: TSlug;
8
+ config: MaybePromise<SanitizedConfig>;
9
+ password: string;
10
+ serverAdapter: ServerAdapter;
11
+ } & ({
12
+ email: string;
13
+ username?: never;
14
+ } | {
15
+ email?: never;
16
+ username: string;
17
+ });
18
+ /**
19
+ * `LoginArgs` as the adapters expose it — they bind `serverAdapter` themselves.
20
+ * Distributes over the email/username union so the either-or survives; a plain
21
+ * `Omit` collapses the union and accepts both keys at once.
22
+ */
23
+ export type LoginArgsWithoutServerAdapter<TSlug extends AuthCollectionSlug> = LoginArgs<TSlug> extends infer TArgs ? TArgs extends unknown ? Omit<TArgs, 'serverAdapter'> : never : never;
24
+ /**
25
+ * Logs a user in and writes the auth cookie through the supplied `serverAdapter`,
26
+ * so the function is framework-agnostic; each adapter binds its own.
27
+ */
28
+ export declare function login<TSlug extends AuthCollectionSlug>({ collection, config, email, password, serverAdapter, username, }: LoginArgs<TSlug>): Promise<LoginResult<TSlug>>;
29
+ //# sourceMappingURL=login.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../src/auth/serverFunctions/login.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAOzD,MAAM,MAAM,SAAS,CAAC,KAAK,SAAS,kBAAkB,IAAI;IACxD,UAAU,EAAE,KAAK,CAAA;IACjB,MAAM,EAAE,YAAY,CAAC,eAAe,CAAC,CAAA;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,aAAa,CAAA;CAC7B,GAAG,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,KAAK,CAAC,EAAE,KAAK,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAE/E;;;;GAIG;AACH,MAAM,MAAM,6BAA6B,CAAC,KAAK,SAAS,kBAAkB,IACxE,SAAS,CAAC,KAAK,CAAC,SAAS,MAAM,KAAK,GAChC,KAAK,SAAS,OAAO,GACnB,IAAI,CAAC,KAAK,EAAE,eAAe,CAAC,GAC5B,KAAK,GACP,KAAK,CAAA;AAEX;;;GAGG;AACH,wBAAsB,KAAK,CAAC,KAAK,SAAS,kBAAkB,EAAE,EAC5D,UAAU,EACV,MAAM,EACN,KAAK,EACL,QAAQ,EACR,aAAa,EACb,QAAQ,GACT,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAgDhD"}
@@ -0,0 +1,63 @@
1
+ import { getPayload } from '../../index.js';
2
+ import { createLocalReq } from '../../utilities/createLocalReq.js';
3
+ import { loginWithCookie } from '../loginWithCookie.js';
4
+ import { applyAuthCookie } from './cookies.js';
5
+ /**
6
+ * Logs a user in and writes the auth cookie through the supplied `serverAdapter`,
7
+ * so the function is framework-agnostic; each adapter binds its own.
8
+ */ export async function login({ collection, config, email, password, serverAdapter, username }) {
9
+ const payload = await getPayload({
10
+ config,
11
+ cron: true
12
+ });
13
+ const authConfig = payload.collections[collection]?.config.auth;
14
+ if (!authConfig) {
15
+ throw new Error(`No auth config found for collection: ${collection}`);
16
+ }
17
+ const loginWithUsername = authConfig.loginWithUsername ?? false;
18
+ if (loginWithUsername) {
19
+ if (loginWithUsername.allowEmailLogin) {
20
+ if (!email && !username) {
21
+ throw new Error('Email or username is required.');
22
+ }
23
+ } else {
24
+ if (!username) {
25
+ throw new Error('Username is required.');
26
+ }
27
+ }
28
+ } else {
29
+ if (!email) {
30
+ throw new Error('Email is required.');
31
+ }
32
+ }
33
+ let loginData;
34
+ if (loginWithUsername) {
35
+ loginData = username ? {
36
+ password,
37
+ username
38
+ } : {
39
+ email,
40
+ password
41
+ };
42
+ } else {
43
+ loginData = {
44
+ email,
45
+ password
46
+ };
47
+ }
48
+ const collectionConfig = payload.collections[collection];
49
+ const { cookie, result } = await loginWithCookie({
50
+ collection: collectionConfig,
51
+ data: loginData,
52
+ overrideAccess: true,
53
+ req: await createLocalReq({}, payload),
54
+ returnCookieAsObject: true
55
+ });
56
+ await applyAuthCookie({
57
+ cookie,
58
+ serverAdapter
59
+ });
60
+ return result;
61
+ }
62
+
63
+ //# sourceMappingURL=login.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/auth/serverFunctions/login.ts"],"sourcesContent":["import type { ServerAdapter } from '../../admin/adapters/server.js'\nimport type { SanitizedConfig } from '../../config/types.js'\nimport type { AuthCollectionSlug } from '../../index.js'\nimport type { MaybePromise } from '../../types/index.js'\nimport type { LoginResult } from '../operations/login.js'\n\nimport { getPayload } from '../../index.js'\nimport { createLocalReq } from '../../utilities/createLocalReq.js'\nimport { loginWithCookie } from '../loginWithCookie.js'\nimport { applyAuthCookie } from './cookies.js'\n\nexport type LoginArgs<TSlug extends AuthCollectionSlug> = {\n collection: TSlug\n config: MaybePromise<SanitizedConfig>\n password: string\n serverAdapter: ServerAdapter\n} & ({ email: string; username?: never } | { email?: never; username: string })\n\n/**\n * `LoginArgs` as the adapters expose it — they bind `serverAdapter` themselves.\n * Distributes over the email/username union so the either-or survives; a plain\n * `Omit` collapses the union and accepts both keys at once.\n */\nexport type LoginArgsWithoutServerAdapter<TSlug extends AuthCollectionSlug> =\n LoginArgs<TSlug> extends infer TArgs\n ? TArgs extends unknown\n ? Omit<TArgs, 'serverAdapter'>\n : never\n : never\n\n/**\n * Logs a user in and writes the auth cookie through the supplied `serverAdapter`,\n * so the function is framework-agnostic; each adapter binds its own.\n */\nexport async function login<TSlug extends AuthCollectionSlug>({\n collection,\n config,\n email,\n password,\n serverAdapter,\n username,\n}: LoginArgs<TSlug>): Promise<LoginResult<TSlug>> {\n const payload = await getPayload({ config, cron: true })\n\n const authConfig = payload.collections[collection]?.config.auth\n\n if (!authConfig) {\n throw new Error(`No auth config found for collection: ${collection}`)\n }\n\n const loginWithUsername = authConfig.loginWithUsername ?? false\n\n if (loginWithUsername) {\n if (loginWithUsername.allowEmailLogin) {\n if (!email && !username) {\n throw new Error('Email or username is required.')\n }\n } else {\n if (!username) {\n throw new Error('Username is required.')\n }\n }\n } else {\n if (!email) {\n throw new Error('Email is required.')\n }\n }\n\n let loginData\n\n if (loginWithUsername) {\n loginData = username ? { password, username } : { email, password }\n } else {\n loginData = { email, password }\n }\n\n const collectionConfig = payload.collections[collection]!\n\n const { cookie, result } = await loginWithCookie({\n collection: collectionConfig,\n data: loginData as Parameters<typeof loginWithCookie>[0]['data'],\n overrideAccess: true,\n req: await createLocalReq({}, payload),\n returnCookieAsObject: true,\n })\n\n await applyAuthCookie({ cookie, serverAdapter })\n\n return result as LoginResult<TSlug>\n}\n"],"names":["getPayload","createLocalReq","loginWithCookie","applyAuthCookie","login","collection","config","email","password","serverAdapter","username","payload","cron","authConfig","collections","auth","Error","loginWithUsername","allowEmailLogin","loginData","collectionConfig","cookie","result","data","overrideAccess","req","returnCookieAsObject"],"mappings":"AAMA,SAAS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 import type { ServerAdapter } from '../../admin/adapters/server.js';
2
+ import type { SanitizedConfig } from '../../config/types.js';
3
+ import type { MaybePromise } from '../../types/index.js';
4
+ export type LogoutArgs = {
5
+ allSessions?: boolean;
6
+ config: MaybePromise<SanitizedConfig>;
7
+ serverAdapter: ServerAdapter;
8
+ };
9
+ /**
10
+ * Logs the current user out and expires the auth cookie through the supplied
11
+ * `serverAdapter`, so the function is framework-agnostic; each adapter binds its own.
12
+ */
13
+ export declare function logout({ allSessions, config, serverAdapter, }: LogoutArgs): Promise<{
14
+ message: string;
15
+ success: boolean;
16
+ }>;
17
+ //# sourceMappingURL=logout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logout.d.ts","sourceRoot":"","sources":["../../../src/auth/serverFunctions/logout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAOxD,MAAM,MAAM,UAAU,GAAG;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,EAAE,YAAY,CAAC,eAAe,CAAC,CAAA;IACrC,aAAa,EAAE,aAAa,CAAA;CAC7B,CAAA;AAED;;;GAGG;AACH,wBAAsB,MAAM,CAAC,EAC3B,WAAmB,EACnB,MAAM,EACN,aAAa,GACd,EAAE,UAAU,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CAoC7D"}
@@ -0,0 +1,58 @@
1
+ import { getPayload } from '../../index.js';
2
+ import { createLocalReq } from '../../utilities/createLocalReq.js';
3
+ import { logoutOperation } from '../operations/logout.js';
4
+ import { clearAuthCookie } from './cookies.js';
5
+ /**
6
+ * Logs the current user out and expires the auth cookie through the supplied
7
+ * `serverAdapter`, so the function is framework-agnostic; each adapter binds its own.
8
+ */ export async function logout({ allSessions = false, config, serverAdapter }) {
9
+ const payload = await getPayload({
10
+ config,
11
+ cron: true
12
+ });
13
+ const headers = await serverAdapter.getHeaders();
14
+ const authResult = await payload.auth({
15
+ headers
16
+ });
17
+ if (!authResult.user) {
18
+ return {
19
+ message: 'User already logged out',
20
+ success: true
21
+ };
22
+ }
23
+ const { user } = authResult;
24
+ const req = await createLocalReq({
25
+ user
26
+ }, payload);
27
+ const collection = payload.collections[user.collection];
28
+ if (!collection) {
29
+ return {
30
+ message: 'Collection not found',
31
+ success: false
32
+ };
33
+ }
34
+ const logoutResult = await logoutOperation({
35
+ allSessions,
36
+ collection,
37
+ req
38
+ });
39
+ if (!logoutResult) {
40
+ return {
41
+ message: 'Logout failed',
42
+ success: false
43
+ };
44
+ }
45
+ if (collection.config.auth) {
46
+ await clearAuthCookie({
47
+ authConfig: collection.config.auth,
48
+ cookiePrefix: payload.config.cookiePrefix,
49
+ serverAdapter
50
+ });
51
+ }
52
+ return {
53
+ message: 'User logged out successfully',
54
+ success: true
55
+ };
56
+ }
57
+
58
+ //# sourceMappingURL=logout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/auth/serverFunctions/logout.ts"],"sourcesContent":["import type { ServerAdapter } from '../../admin/adapters/server.js'\nimport type { SanitizedConfig } from '../../config/types.js'\nimport type { MaybePromise } from '../../types/index.js'\n\nimport { getPayload } from '../../index.js'\nimport { createLocalReq } from '../../utilities/createLocalReq.js'\nimport { logoutOperation } from '../operations/logout.js'\nimport { clearAuthCookie } from './cookies.js'\n\nexport type LogoutArgs = {\n allSessions?: boolean\n config: MaybePromise<SanitizedConfig>\n serverAdapter: ServerAdapter\n}\n\n/**\n * Logs the current user out and expires the auth cookie through the supplied\n * `serverAdapter`, so the function is framework-agnostic; each adapter binds its own.\n */\nexport async function logout({\n allSessions = false,\n config,\n serverAdapter,\n}: LogoutArgs): Promise<{ message: string; success: boolean }> {\n const payload = await getPayload({ config, cron: true })\n const headers = await serverAdapter.getHeaders()\n const authResult = await payload.auth({ headers })\n\n if (!authResult.user) {\n return { message: 'User already logged out', success: true }\n }\n\n const { user } = authResult\n const req = await createLocalReq({ user }, payload)\n const collection = payload.collections[user.collection]\n\n if (!collection) {\n return { message: 'Collection not found', success: false }\n }\n\n const logoutResult = await logoutOperation({\n allSessions,\n collection,\n req,\n })\n\n if (!logoutResult) {\n return { message: 'Logout failed', success: false }\n }\n\n if (collection.config.auth) {\n await clearAuthCookie({\n authConfig: collection.config.auth,\n cookiePrefix: payload.config.cookiePrefix,\n serverAdapter,\n })\n }\n\n return { message: 'User logged out successfully', success: true }\n}\n"],"names":["getPayload","createLocalReq","logoutOperation","clearAuthCookie","logout","allSessions","config","serverAdapter","payload","cron","headers","getHeaders","authResult","auth","user","message","success","req","collection","collections","logoutResult","authConfig","cookiePrefix"],"mappings":"AAIA,SAASA,UAAU,QAAQ,iBAAgB;AAC3C,SAASC,cAAc,QAAQ,oCAAmC;AAClE,SAASC,eAAe,QAAQ,0BAAyB;AACzD,SAASC,eAAe,QAAQ,eAAc;AAQ9C;;;CAGC,GACD,OAAO,eAAeC,OAAO,EAC3BC,cAAc,KAAK,EACnBC,MAAM,EACNC,aAAa,EACF;IACX,MAAMC,UAAU,MAAMR,WAAW;QAAEM;QAAQG,MAAM;IAAK;IACtD,MAAMC,UAAU,MAAMH,cAAcI,UAAU;IAC9C,MAAMC,aAAa,MAAMJ,QAAQK,IAAI,CAAC;QAAEH;IAAQ;IAEhD,IAAI,CAACE,WAAWE,IAAI,EAAE;QACpB,OAAO;YAAEC,SAAS;YAA2BC,SAAS;QAAK;IAC7D;IAEA,MAAM,EAAEF,IAAI,EAAE,GAAGF;IACjB,MAAMK,MAAM,MAAMhB,eAAe;QAAEa;IAAK,GAAGN;IAC3C,MAAMU,aAAaV,QAAQW,WAAW,CAACL,KAAKI,UAAU,CAAC;IAEvD,IAAI,CAACA,YAAY;QACf,OAAO;YAAEH,SAAS;YAAwBC,SAAS;QAAM;IAC3D;IAEA,MAAMI,eAAe,MAAMlB,gBAAgB;QACzCG;QACAa;QACAD;IACF;IAEA,IAAI,CAACG,cAAc;QACjB,OAAO;YAAEL,SAAS;YAAiBC,SAAS;QAAM;IACpD;IAEA,IAAIE,WAAWZ,MAAM,CAACO,IAAI,EAAE;QAC1B,MAAMV,gBAAgB;YACpBkB,YAAYH,WAAWZ,MAAM,CAACO,IAAI;YAClCS,cAAcd,QAAQF,MAAM,CAACgB,YAAY;YACzCf;QACF;IACF;IAEA,OAAO;QAAEQ,SAAS;QAAgCC,SAAS;IAAK;AAClE"}
@@ -0,0 +1,17 @@
1
+ import type { ServerAdapter } from '../../admin/adapters/server.js';
2
+ import type { SanitizedConfig } from '../../config/types.js';
3
+ import type { MaybePromise } from '../../types/index.js';
4
+ export type RefreshArgs = {
5
+ config: MaybePromise<SanitizedConfig>;
6
+ serverAdapter: ServerAdapter;
7
+ };
8
+ /**
9
+ * Refreshes the current user's auth token and rewrites the cookie through the
10
+ * supplied `serverAdapter`, so the function is framework-agnostic; each adapter
11
+ * binds its own.
12
+ */
13
+ export declare function refresh({ config, serverAdapter, }: RefreshArgs): Promise<{
14
+ message: string;
15
+ success: boolean;
16
+ }>;
17
+ //# sourceMappingURL=refresh.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/serverFunctions/refresh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAE5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAOxD,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,YAAY,CAAC,eAAe,CAAC,CAAA;IACrC,aAAa,EAAE,aAAa,CAAA;CAC7B,CAAA;AAED;;;;GAIG;AACH,wBAAsB,OAAO,CAAC,EAC5B,MAAM,EACN,aAAa,GACd,EAAE,WAAW,GAAG,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC,CA4C9D"}
@@ -0,0 +1,61 @@
1
+ import { getPayload } from '../../index.js';
2
+ import { createLocalReq } from '../../utilities/createLocalReq.js';
3
+ import { refreshOperation } from '../operations/refresh.js';
4
+ import { getExistingAuthToken, setAuthCookie } from './cookies.js';
5
+ /**
6
+ * Refreshes the current user's auth token and rewrites the cookie through the
7
+ * supplied `serverAdapter`, so the function is framework-agnostic; each adapter
8
+ * binds its own.
9
+ */ export async function refresh({ config, serverAdapter }) {
10
+ const payload = await getPayload({
11
+ config,
12
+ cron: true
13
+ });
14
+ const headers = await serverAdapter.getHeaders();
15
+ const result = await payload.auth({
16
+ headers
17
+ });
18
+ if (!result.user) {
19
+ throw new Error('Cannot refresh token: user not authenticated');
20
+ }
21
+ const existingCookie = await getExistingAuthToken({
22
+ cookiePrefix: payload.config.cookiePrefix,
23
+ serverAdapter
24
+ });
25
+ if (!existingCookie) {
26
+ return {
27
+ message: 'No valid token found to refresh',
28
+ success: false
29
+ };
30
+ }
31
+ const collection = result.user.collection;
32
+ const collectionConfig = payload.collections[collection];
33
+ if (!collectionConfig?.config.auth) {
34
+ throw new Error(`No auth config found for collection: ${collection}`);
35
+ }
36
+ const req = await createLocalReq({
37
+ user: result.user
38
+ }, payload);
39
+ const refreshResult = await refreshOperation({
40
+ collection: collectionConfig,
41
+ req
42
+ });
43
+ if (!refreshResult) {
44
+ return {
45
+ message: 'Token refresh failed',
46
+ success: false
47
+ };
48
+ }
49
+ await setAuthCookie({
50
+ authConfig: collectionConfig.config.auth,
51
+ cookiePrefix: payload.config.cookiePrefix,
52
+ serverAdapter,
53
+ token: refreshResult.refreshedToken
54
+ });
55
+ return {
56
+ message: 'Token refreshed successfully',
57
+ success: true
58
+ };
59
+ }
60
+
61
+ //# sourceMappingURL=refresh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/auth/serverFunctions/refresh.ts"],"sourcesContent":["import type { ServerAdapter } from '../../admin/adapters/server.js'\nimport type { SanitizedConfig } from '../../config/types.js'\nimport type { CollectionSlug } from '../../index.js'\nimport type { MaybePromise } from '../../types/index.js'\n\nimport { getPayload } from '../../index.js'\nimport { createLocalReq } from '../../utilities/createLocalReq.js'\nimport { refreshOperation } from '../operations/refresh.js'\nimport { getExistingAuthToken, setAuthCookie } from './cookies.js'\n\nexport type RefreshArgs = {\n config: MaybePromise<SanitizedConfig>\n serverAdapter: ServerAdapter\n}\n\n/**\n * Refreshes the current user's auth token and rewrites the cookie through the\n * supplied `serverAdapter`, so the function is framework-agnostic; each adapter\n * binds its own.\n */\nexport async function refresh({\n config,\n serverAdapter,\n}: RefreshArgs): Promise<{ message: string; success: boolean }> {\n const payload = await getPayload({ config, cron: true })\n const headers = await serverAdapter.getHeaders()\n const result = await payload.auth({ headers })\n\n if (!result.user) {\n throw new Error('Cannot refresh token: user not authenticated')\n }\n\n const existingCookie = await getExistingAuthToken({\n cookiePrefix: payload.config.cookiePrefix,\n serverAdapter,\n })\n\n if (!existingCookie) {\n return { message: 'No valid token found to refresh', success: false }\n }\n\n const collection: CollectionSlug | undefined = result.user.collection\n const collectionConfig = payload.collections[collection]\n\n if (!collectionConfig?.config.auth) {\n throw new Error(`No auth config found for collection: ${collection}`)\n }\n\n const req = await createLocalReq({ user: result.user }, payload)\n\n const refreshResult = await refreshOperation({\n collection: collectionConfig,\n req,\n })\n\n if (!refreshResult) {\n return { message: 'Token refresh failed', success: false }\n }\n\n await setAuthCookie({\n authConfig: collectionConfig.config.auth,\n cookiePrefix: payload.config.cookiePrefix,\n serverAdapter,\n token: refreshResult.refreshedToken,\n })\n\n return { message: 'Token refreshed successfully', success: true }\n}\n"],"names":["getPayload","createLocalReq","refreshOperation","getExistingAuthToken","setAuthCookie","refresh","config","serverAdapter","payload","cron","headers","getHeaders","result","auth","user","Error","existingCookie","cookiePrefix","message","success","collection","collectionConfig","collections","req","refreshResult","authConfig","token","refreshedToken"],"mappings":"AAKA,SAASA,UAAU,QAAQ,iBAAgB;AAC3C,SAASC,cAAc,QAAQ,oCAAmC;AAClE,SAASC,gBAAgB,QAAQ,2BAA0B;AAC3D,SAASC,oBAAoB,EAAEC,aAAa,QAAQ,eAAc;AAOlE;;;;CAIC,GACD,OAAO,eAAeC,QAAQ,EAC5BC,MAAM,EACNC,aAAa,EACD;IACZ,MAAMC,UAAU,MAAMR,WAAW;QAAEM;QAAQG,MAAM;IAAK;IACtD,MAAMC,UAAU,MAAMH,cAAcI,UAAU;IAC9C,MAAMC,SAAS,MAAMJ,QAAQK,IAAI,CAAC;QAAEH;IAAQ;IAE5C,IAAI,CAACE,OAAOE,IAAI,EAAE;QAChB,MAAM,IAAIC,MAAM;IAClB;IAEA,MAAMC,iBAAiB,MAAMb,qBAAqB;QAChDc,cAAcT,QAAQF,MAAM,CAACW,YAAY;QACzCV;IACF;IAEA,IAAI,CAACS,gBAAgB;QACnB,OAAO;YAAEE,SAAS;YAAmCC,SAAS;QAAM;IACtE;IAEA,MAAMC,aAAyCR,OAAOE,IAAI,CAACM,UAAU;IACrE,MAAMC,mBAAmBb,QAAQc,WAAW,CAACF,WAAW;IAExD,IAAI,CAACC,kBAAkBf,OAAOO,MAAM;QAClC,MAAM,IAAIE,MAAM,CAAC,qCAAqC,EAAEK,YAAY;IACtE;IAEA,MAAMG,MAAM,MAAMtB,eAAe;QAAEa,MAAMF,OAAOE,IAAI;IAAC,GAAGN;IAExD,MAAMgB,gBAAgB,MAAMtB,iBAAiB;QAC3CkB,YAAYC;QACZE;IACF;IAEA,IAAI,CAACC,eAAe;QAClB,OAAO;YAAEN,SAAS;YAAwBC,SAAS;QAAM;IAC3D;IAEA,MAAMf,cAAc;QAClBqB,YAAYJ,iBAAiBf,MAAM,CAACO,IAAI;QACxCI,cAAcT,QAAQF,MAAM,CAACW,YAAY;QACzCV;QACAmB,OAAOF,cAAcG,cAAc;IACrC;IAEA,OAAO;QAAET,SAAS;QAAgCC,SAAS;IAAK;AAClE"}
@@ -1,4 +1,3 @@
1
- import type { DeepRequired } from 'ts-essentials';
2
1
  import type { CollectionSlug, GlobalSlug, Payload, User } from '../index.js';
3
2
  import type { PayloadRequest, Where } from '../types/index.js';
4
3
  /**
@@ -172,15 +171,16 @@ export type LoginWithUsernameOptions = {
172
171
  requireEmail?: boolean;
173
172
  requireUsername?: boolean;
174
173
  };
174
+ type AuthCookies = {
175
+ domain?: string;
176
+ sameSite?: 'Lax' | 'None' | 'Strict' | boolean;
177
+ secure?: boolean;
178
+ };
175
179
  export interface IncomingAuthType {
176
180
  /**
177
181
  * Set cookie options, including secure, sameSite, and domain. For advanced users.
178
182
  */
179
- cookies?: {
180
- domain?: string;
181
- sameSite?: 'Lax' | 'None' | 'Strict' | boolean;
182
- secure?: boolean;
183
- };
183
+ cookies?: AuthCookies;
184
184
  /**
185
185
  * How many levels deep a user document should be populated when creating the JWT and binding the user to the req. Defaults to 0 and should only be modified if absolutely necessary, as this will affect performance.
186
186
  * @default 0
@@ -263,14 +263,9 @@ export type VerifyConfig = {
263
263
  generateEmailHTML?: GenerateVerifyEmailHTML;
264
264
  generateEmailSubject?: GenerateVerifyEmailSubject;
265
265
  };
266
- export interface Auth extends Omit<DeepRequired<IncomingAuthType>, 'forgotPassword' | 'loginWithUsername' | 'verify'> {
267
- forgotPassword?: {
268
- expiration?: number;
269
- generateEmailHTML?: GenerateForgotPasswordEmailHTML;
270
- generateEmailSubject?: GenerateForgotPasswordEmailSubject;
271
- };
272
- loginWithUsername: false | LoginWithUsernameOptions;
273
- verify?: boolean | VerifyConfig;
266
+ export interface Auth extends Omit<IncomingAuthType, 'cookies' | 'forgotPassword' | 'lockTime' | 'loginWithUsername' | 'maxLoginAttempts' | 'strategies' | 'tokenExpiration' | 'useSessions' | 'verify'>, Required<Pick<IncomingAuthType, 'forgotPassword' | 'lockTime' | 'maxLoginAttempts' | 'strategies' | 'tokenExpiration' | 'useSessions' | 'verify'>> {
267
+ cookies: Pick<AuthCookies, 'domain'> & Required<Pick<AuthCookies, 'sameSite' | 'secure'>>;
268
+ loginWithUsername: false | Required<LoginWithUsernameOptions>;
274
269
  }
275
270
  export declare function hasWhereAccessResult(result: boolean | Where): result is Where;
276
271
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAC5E,OAAO,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9D;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,UAAU,CAAA;IAClB,MAAM,EAAE,iBAAiB,CAAA;IACzB,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,UAAU,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,yBAAyB,GACjC;IACE,MAAM,EAAE,0BAA0B,CAAA;CACnC,GACD,IAAI,CAAA;AAER,MAAM,MAAM,iBAAiB,GAAG;IAC9B,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAAA;CACtC,CAAA;AAED,MAAM,MAAM,0BAA0B,GAClC;IACE,CAAC,SAAS,EAAE,MAAM,GAAG,yBAAyB,CAAA;CAC/C,GACD,IAAI,CAAA;AAER,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC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ACZ;AAED,MAAM,MAAM,YAAY,GAAG;IACzB,iBAAiB,CAAC,EAAE,uBAAuB,CAAA;IAC3C,oBAAoB,CAAC,EAAE,0BAA0B,CAAA;CAClD,CAAA;AAED,MAAM,WAAW,IACf,SAAQ,IAAI,CACR,gBAAgB,EACd,SAAS,GACT,gBAAgB,GAChB,UAAU,GACV,mBAAmB,GACnB,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,aAAa,GACb,QAAQ,CACX,EACD,QAAQ,CACN,IAAI,CACF,gBAAgB,EACd,gBAAgB,GAChB,UAAU,GACV,kBAAkB,GAClB,YAAY,GACZ,iBAAiB,GACjB,aAAa,GACb,QAAQ,CACX,CACF;IACH,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,GAAG,QAAQ,CAAC,CAAC,CAAA;IACzF,iBAAiB,EAAE,KAAK,GAAG,QAAQ,CAAC,wBAAwB,CAAC,CAAA;CAC9D;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,GAAG,KAAK,GAAG,MAAM,IAAI,KAAK,CAE7E"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/auth/types.ts"],"sourcesContent":["import type { DeepRequired } from 'ts-essentials'\n\nimport type { CollectionSlug, GlobalSlug, Payload, User } from '../index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\n\n/**\n * A permission object that can be used to determine if a user has access to a specific operation.\n */\nexport type Permission = {\n permission: boolean\n where?: Where\n}\n\nexport type FieldsPermissions = {\n [fieldName: string]: FieldPermissions\n}\n\nexport type BlockPermissions = {\n create: Permission\n fields: FieldsPermissions\n read: Permission\n update: Permission\n}\n\nexport type SanitizedBlockPermissions =\n | {\n fields: SanitizedFieldsPermissions\n }\n | true\n\nexport type BlocksPermissions = {\n [blockSlug: string]: BlockPermissions\n}\n\nexport type SanitizedBlocksPermissions =\n | {\n [blockSlug: string]: SanitizedBlockPermissions\n }\n | true\n\nexport type FieldPermissions = {\n blocks?: BlocksPermissions\n create?: Permission\n fields?: FieldsPermissions\n read?: Permission\n update?: Permission\n}\n\nexport type SanitizedFieldPermissions =\n | {\n blocks?: SanitizedBlocksPermissions\n create: true\n fields?: SanitizedFieldsPermissions\n read: true\n update: true\n }\n | true\n\nexport type SanitizedFieldsPermissions =\n | {\n [fieldName: string]: SanitizedFieldPermissions\n }\n | true\n\nexport type CollectionPermission = {\n create?: Permission\n delete?: Permission\n fields: FieldsPermissions\n read?: Permission\n readVersions?: Permission\n // Auth-enabled Collections only\n unlock?: Permission\n update?: Permission\n}\n\nexport type SanitizedCollectionPermission = {\n create?: true\n delete?: true\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n // Auth-enabled Collections only\n unlock?: true\n update?: true\n}\n\nexport type GlobalPermission = {\n fields: FieldsPermissions\n read?: Permission\n readVersions?: Permission\n update?: Permission\n}\n\nexport type SanitizedGlobalPermission = {\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n update?: true\n}\n\nexport type DocumentPermissions = CollectionPermission | GlobalPermission\n\nexport type SanitizedDocumentPermissions = SanitizedCollectionPermission | SanitizedGlobalPermission\n\nexport type Permissions = {\n canAccessAdmin: boolean\n collections?: Record<CollectionSlug, CollectionPermission>\n globals?: Record<GlobalSlug, GlobalPermission>\n}\n\nexport type SanitizedPermissions = {\n canAccessAdmin?: boolean\n collections?: {\n [collectionSlug: string]: SanitizedCollectionPermission\n }\n globals?: {\n [globalSlug: string]: SanitizedGlobalPermission\n }\n}\n\n/**\n * Fields injected onto a user at authentication time. They are never stored in the database and\n * never present on a plain document read (e.g. `payload.findByID`) - only on the authenticated\n * user (`req.user`, login/auth/me results, auth strategies).\n */\nexport type AuthRuntimeFields = {\n /**\n * The session ID of the current request. May be present on request-authenticated users when\n * sessions are enabled.\n */\n _sid?: string\n /**\n * The name of the auth strategy that authenticated the request (e.g. `local-jwt`).\n */\n _strategy?: string\n}\n\n/**\n * Note: AuthenticatedUser still carries the write-only `password` from `User` (always `undefined` at runtime).\n * Stripping it cleanly isn't possible, because auth operations build the authenticated user\n * from a read `User` doc, so a `never`-typed `password` would break those assignments\n */\n/**\n * The signed-in user: the read user plus the runtime auth markers (`_strategy`, `_sid`). This is\n * what `req.user`, `payload.auth()`, the `me` operation, auth strategies, and `useAuth().user`\n * return.\n */\nexport type AuthenticatedUser = AuthRuntimeFields & User\n\nexport type UserSession = {\n createdAt?: Date | null | string\n expiresAt: Date | string\n id: string\n}\ntype GenerateVerifyEmailHTML<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateVerifyEmailSubject<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailHTML<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailSubject<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\nexport type AuthStrategyFunctionArgs = {\n /**\n * Specifies whether or not response headers can be set from this strategy.\n */\n canSetHeaders?: boolean\n headers: Request['headers']\n isGraphQL?: boolean\n payload: Payload\n /**\n * The AuthStrategy name property from the payload config.\n */\n strategyName?: string\n}\n\nexport type AuthStrategyResult = {\n responseHeaders?: Headers\n user: AuthenticatedUser | null\n}\n\nexport type AuthStrategyFunction = (\n args: AuthStrategyFunctionArgs,\n) => AuthStrategyResult | Promise<AuthStrategyResult>\nexport type AuthStrategy = {\n authenticate: AuthStrategyFunction\n name: string\n}\n\nexport type LoginWithUsernameOptions =\n | {\n allowEmailLogin?: false\n requireEmail?: boolean\n // If `allowEmailLogin` is false, `requireUsername` must be true (default: true)\n requireUsername?: true\n }\n | {\n allowEmailLogin?: true\n requireEmail?: boolean\n requireUsername?: boolean\n }\n\nexport interface IncomingAuthType {\n /**\n * Set cookie options, including secure, sameSite, and domain. For advanced users.\n */\n cookies?: {\n domain?: string\n sameSite?: 'Lax' | 'None' | 'Strict' | boolean\n secure?: boolean\n }\n /**\n * How many levels deep a user document should be populated when creating the JWT and binding the user to the req. Defaults to 0 and should only be modified if absolutely necessary, as this will affect performance.\n * @default 0\n */\n depth?: number\n /**\n * Advanced - disable Payload's built-in local auth strategy. Only use this property if you have replaced Payload's auth mechanisms with your own.\n */\n disableLocalStrategy?:\n | {\n /**\n * Include auth fields on the collection even though the local strategy is disabled.\n * Useful when you do not want the database or types to vary depending on the auth configuration.\n */\n enableFields?: true\n optionalPassword?: true\n }\n | true\n /**\n * Customize the way that the forgotPassword operation functions.\n * @link https://payloadcms.com/docs/authentication/email#forgot-password\n */\n forgotPassword?: {\n /**\n * The number of milliseconds that the forgot password token should be valid for.\n * @default 3600000 // 1 hour\n */\n expiration?: number\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n /**\n * Set the time (in milliseconds) that a user should be locked out if they fail authentication more times than maxLoginAttempts allows for.\n */\n lockTime?: number\n /**\n * Ability to allow users to login with username/password.\n *\n * @link https://payloadcms.com/docs/authentication/overview#login-with-username\n */\n loginWithUsername?: boolean | LoginWithUsernameOptions\n /**\n * Only allow a user to attempt logging in X amount of times. Automatically locks out a user from authenticating if this limit is passed. Set to 0 to disable.\n */\n maxLoginAttempts?: number\n /***\n * Set to true if you want to remove the token from the returned authentication API responses such as login or refresh.\n */\n removeTokenFromResponses?: true\n /**\n * Advanced - an array of custom authentification strategies to extend this collection's authentication with.\n * @link https://payloadcms.com/docs/authentication/custom-strategies\n */\n strategies?: AuthStrategy[]\n /**\n * Controls how many seconds the token will be valid for. Default is 2 hours.\n * @default 7200\n * @link https://payloadcms.com/docs/authentication/overview#config-options\n */\n tokenExpiration?: number\n /**\n * Payload Authentication provides for API keys to be set on each user within an Authentication-enabled Collection.\n * @default false\n * @link https://payloadcms.com/docs/authentication/api-keys\n */\n useAPIKey?: boolean\n\n /**\n * Use sessions for authentication. Enabled by default.\n * @default true\n */\n useSessions?: boolean\n\n /**\n * Set to true or pass an object with verification options to require users to verify by email before they are allowed to log into your app.\n * @link https://payloadcms.com/docs/authentication/email#email-verification\n */\n verify?:\n | {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n }\n | boolean\n}\n\nexport type VerifyConfig = {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n}\n\nexport interface Auth\n extends Omit<DeepRequired<IncomingAuthType>, 'forgotPassword' | 'loginWithUsername' | 'verify'> {\n forgotPassword?: {\n expiration?: number\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n loginWithUsername: false | LoginWithUsernameOptions\n verify?: boolean | VerifyConfig\n}\n\nexport function hasWhereAccessResult(result: boolean | Where): result is Where {\n return result && typeof result === 'object'\n}\n"],"names":["hasWhereAccessResult","result"],"mappings":"AAwUA,OAAO,SAASA,qBAAqBC,MAAuB;IAC1D,OAAOA,UAAU,OAAOA,WAAW;AACrC"}
1
+ {"version":3,"sources":["../../src/auth/types.ts"],"sourcesContent":["import type { CollectionSlug, GlobalSlug, Payload, User } from '../index.js'\nimport type { PayloadRequest, Where } from '../types/index.js'\n\n/**\n * A permission object that can be used to determine if a user has access to a specific operation.\n */\nexport type Permission = {\n permission: boolean\n where?: Where\n}\n\nexport type FieldsPermissions = {\n [fieldName: string]: FieldPermissions\n}\n\nexport type BlockPermissions = {\n create: Permission\n fields: FieldsPermissions\n read: Permission\n update: Permission\n}\n\nexport type SanitizedBlockPermissions =\n | {\n fields: SanitizedFieldsPermissions\n }\n | true\n\nexport type BlocksPermissions = {\n [blockSlug: string]: BlockPermissions\n}\n\nexport type SanitizedBlocksPermissions =\n | {\n [blockSlug: string]: SanitizedBlockPermissions\n }\n | true\n\nexport type FieldPermissions = {\n blocks?: BlocksPermissions\n create?: Permission\n fields?: FieldsPermissions\n read?: Permission\n update?: Permission\n}\n\nexport type SanitizedFieldPermissions =\n | {\n blocks?: SanitizedBlocksPermissions\n create: true\n fields?: SanitizedFieldsPermissions\n read: true\n update: true\n }\n | true\n\nexport type SanitizedFieldsPermissions =\n | {\n [fieldName: string]: SanitizedFieldPermissions\n }\n | true\n\nexport type CollectionPermission = {\n create?: Permission\n delete?: Permission\n fields: FieldsPermissions\n read?: Permission\n readVersions?: Permission\n // Auth-enabled Collections only\n unlock?: Permission\n update?: Permission\n}\n\nexport type SanitizedCollectionPermission = {\n create?: true\n delete?: true\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n // Auth-enabled Collections only\n unlock?: true\n update?: true\n}\n\nexport type GlobalPermission = {\n fields: FieldsPermissions\n read?: Permission\n readVersions?: Permission\n update?: Permission\n}\n\nexport type SanitizedGlobalPermission = {\n fields: SanitizedFieldsPermissions\n read?: true\n readVersions?: true\n update?: true\n}\n\nexport type DocumentPermissions = CollectionPermission | GlobalPermission\n\nexport type SanitizedDocumentPermissions = SanitizedCollectionPermission | SanitizedGlobalPermission\n\nexport type Permissions = {\n canAccessAdmin: boolean\n collections?: Record<CollectionSlug, CollectionPermission>\n globals?: Record<GlobalSlug, GlobalPermission>\n}\n\nexport type SanitizedPermissions = {\n canAccessAdmin?: boolean\n collections?: {\n [collectionSlug: string]: SanitizedCollectionPermission\n }\n globals?: {\n [globalSlug: string]: SanitizedGlobalPermission\n }\n}\n\n/**\n * Fields injected onto a user at authentication time. They are never stored in the database and\n * never present on a plain document read (e.g. `payload.findByID`) - only on the authenticated\n * user (`req.user`, login/auth/me results, auth strategies).\n */\nexport type AuthRuntimeFields = {\n /**\n * The session ID of the current request. May be present on request-authenticated users when\n * sessions are enabled.\n */\n _sid?: string\n /**\n * The name of the auth strategy that authenticated the request (e.g. `local-jwt`).\n */\n _strategy?: string\n}\n\n/**\n * Note: AuthenticatedUser still carries the write-only `password` from `User` (always `undefined` at runtime).\n * Stripping it cleanly isn't possible, because auth operations build the authenticated user\n * from a read `User` doc, so a `never`-typed `password` would break those assignments\n */\n/**\n * The signed-in user: the read user plus the runtime auth markers (`_strategy`, `_sid`). This is\n * what `req.user`, `payload.auth()`, the `me` operation, auth strategies, and `useAuth().user`\n * return.\n */\nexport type AuthenticatedUser = AuthRuntimeFields & User\n\nexport type UserSession = {\n createdAt?: Date | null | string\n expiresAt: Date | string\n id: string\n}\ntype GenerateVerifyEmailHTML<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateVerifyEmailSubject<TUser = any> = (args: {\n req: PayloadRequest\n token: string\n user: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailHTML<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\ntype GenerateForgotPasswordEmailSubject<TUser = any> = (args?: {\n req?: PayloadRequest\n token?: string\n user?: TUser\n}) => Promise<string> | string\n\nexport type AuthStrategyFunctionArgs = {\n /**\n * Specifies whether or not response headers can be set from this strategy.\n */\n canSetHeaders?: boolean\n headers: Request['headers']\n isGraphQL?: boolean\n payload: Payload\n /**\n * The AuthStrategy name property from the payload config.\n */\n strategyName?: string\n}\n\nexport type AuthStrategyResult = {\n responseHeaders?: Headers\n user: AuthenticatedUser | null\n}\n\nexport type AuthStrategyFunction = (\n args: AuthStrategyFunctionArgs,\n) => AuthStrategyResult | Promise<AuthStrategyResult>\nexport type AuthStrategy = {\n authenticate: AuthStrategyFunction\n name: string\n}\n\nexport type LoginWithUsernameOptions =\n | {\n allowEmailLogin?: false\n requireEmail?: boolean\n // If `allowEmailLogin` is false, `requireUsername` must be true (default: true)\n requireUsername?: true\n }\n | {\n allowEmailLogin?: true\n requireEmail?: boolean\n requireUsername?: boolean\n }\n\ntype AuthCookies = {\n domain?: string\n sameSite?: 'Lax' | 'None' | 'Strict' | boolean\n secure?: boolean\n}\n\nexport interface IncomingAuthType {\n /**\n * Set cookie options, including secure, sameSite, and domain. For advanced users.\n */\n cookies?: AuthCookies\n /**\n * How many levels deep a user document should be populated when creating the JWT and binding the user to the req. Defaults to 0 and should only be modified if absolutely necessary, as this will affect performance.\n * @default 0\n */\n depth?: number\n /**\n * Advanced - disable Payload's built-in local auth strategy. Only use this property if you have replaced Payload's auth mechanisms with your own.\n */\n disableLocalStrategy?:\n | {\n /**\n * Include auth fields on the collection even though the local strategy is disabled.\n * Useful when you do not want the database or types to vary depending on the auth configuration.\n */\n enableFields?: true\n optionalPassword?: true\n }\n | true\n /**\n * Customize the way that the forgotPassword operation functions.\n * @link https://payloadcms.com/docs/authentication/email#forgot-password\n */\n forgotPassword?: {\n /**\n * The number of milliseconds that the forgot password token should be valid for.\n * @default 3600000 // 1 hour\n */\n expiration?: number\n generateEmailHTML?: GenerateForgotPasswordEmailHTML\n generateEmailSubject?: GenerateForgotPasswordEmailSubject\n }\n /**\n * Set the time (in milliseconds) that a user should be locked out if they fail authentication more times than maxLoginAttempts allows for.\n */\n lockTime?: number\n /**\n * Ability to allow users to login with username/password.\n *\n * @link https://payloadcms.com/docs/authentication/overview#login-with-username\n */\n loginWithUsername?: boolean | LoginWithUsernameOptions\n /**\n * Only allow a user to attempt logging in X amount of times. Automatically locks out a user from authenticating if this limit is passed. Set to 0 to disable.\n */\n maxLoginAttempts?: number\n /***\n * Set to true if you want to remove the token from the returned authentication API responses such as login or refresh.\n */\n removeTokenFromResponses?: true\n /**\n * Advanced - an array of custom authentification strategies to extend this collection's authentication with.\n * @link https://payloadcms.com/docs/authentication/custom-strategies\n */\n strategies?: AuthStrategy[]\n /**\n * Controls how many seconds the token will be valid for. Default is 2 hours.\n * @default 7200\n * @link https://payloadcms.com/docs/authentication/overview#config-options\n */\n tokenExpiration?: number\n /**\n * Payload Authentication provides for API keys to be set on each user within an Authentication-enabled Collection.\n * @default false\n * @link https://payloadcms.com/docs/authentication/api-keys\n */\n useAPIKey?: boolean\n\n /**\n * Use sessions for authentication. Enabled by default.\n * @default true\n */\n useSessions?: boolean\n\n /**\n * Set to true or pass an object with verification options to require users to verify by email before they are allowed to log into your app.\n * @link https://payloadcms.com/docs/authentication/email#email-verification\n */\n verify?:\n | {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n }\n | boolean\n}\n\nexport type VerifyConfig = {\n generateEmailHTML?: GenerateVerifyEmailHTML\n generateEmailSubject?: GenerateVerifyEmailSubject\n}\n\nexport interface Auth\n extends Omit<\n IncomingAuthType,\n | 'cookies'\n | 'forgotPassword'\n | 'lockTime'\n | 'loginWithUsername'\n | 'maxLoginAttempts'\n | 'strategies'\n | 'tokenExpiration'\n | 'useSessions'\n | 'verify'\n >,\n Required<\n Pick<\n IncomingAuthType,\n | 'forgotPassword'\n | 'lockTime'\n | 'maxLoginAttempts'\n | 'strategies'\n | 'tokenExpiration'\n | 'useSessions'\n | 'verify'\n >\n > {\n cookies: Pick<AuthCookies, 'domain'> & Required<Pick<AuthCookies, 'sameSite' | 'secure'>>\n loginWithUsername: false | Required<LoginWithUsernameOptions>\n}\n\nexport function hasWhereAccessResult(result: boolean | Where): result is Where {\n return result && typeof result === 'object'\n}\n"],"names":["hasWhereAccessResult","result"],"mappings":"AA0VA,OAAO,SAASA,qBAAqBC,MAAuB;IAC1D,OAAOA,UAAU,OAAOA,WAAW;AACrC"}
@@ -5,10 +5,14 @@ import type { LivePreviewConfig, ServerOnlyLivePreviewProperties, StaticLabel }
5
5
  import type { ClientField } from '../../fields/config/client.js';
6
6
  import type { ClientHierarchyConfig } from '../../hierarchy/types.js';
7
7
  import type { Payload } from '../../types/index.js';
8
+ import type { SanitizedUploadConfig, UploadInstructionsCapability } from '../../uploads/types.js';
8
9
  import type { SanitizedCollectionConfig } from './types.js';
9
10
  export type ServerOnlyCollectionProperties = keyof Pick<SanitizedCollectionConfig, 'access' | 'custom' | 'endpoints' | 'flattenedFields' | 'hooks' | 'indexes' | 'joins' | 'polymorphicJoins' | 'sanitizedIndexes' | 'select'>;
10
11
  export type ServerOnlyCollectionAdminProperties = keyof Pick<SanitizedCollectionConfig['admin'], 'baseFilter' | 'baseListFilter' | 'components' | 'formatDocURL' | 'hidden'>;
11
- export type ServerOnlyUploadProperties = keyof Pick<SanitizedCollectionConfig['upload'], 'admin' | 'adminThumbnail' | 'externalFileHeaderFilter' | 'handlers' | 'modifyResponseHeaders' | 'withMetadata'>;
12
+ export type ServerOnlyUploadProperties = keyof Pick<SanitizedCollectionConfig['upload'], 'admin' | 'adminThumbnail' | 'externalFileHeaderFilter' | 'handlers' | 'modifyResponseHeaders' | 'uploadInstructions' | 'withMetadata'>;
13
+ type ClientUploadConfig = {
14
+ uploadInstructions: Pick<UploadInstructionsCapability, 'useInAdmin'>;
15
+ } & Omit<SanitizedUploadConfig, 'uploadInstructions'>;
12
16
  export type ClientCollectionConfig = {
13
17
  admin: {
14
18
  description?: StaticDescription;
@@ -24,7 +28,8 @@ export type ClientCollectionConfig = {
24
28
  plural: StaticLabel;
25
29
  singular: StaticLabel;
26
30
  };
27
- } & Omit<SanitizedCollectionConfig, 'admin' | 'auth' | 'fields' | 'hierarchy' | 'labels' | ServerOnlyCollectionProperties>;
31
+ upload: ClientUploadConfig;
32
+ } & Omit<SanitizedCollectionConfig, 'admin' | 'auth' | 'fields' | 'hierarchy' | 'labels' | 'upload' | ServerOnlyCollectionProperties>;
28
33
  export declare const createClientCollectionConfig: ({ collection, defaultIDType, i18n, importMap, }: {
29
34
  collection: SanitizedCollectionConfig;
30
35
  defaultIDType: Payload['config']['db']['defaultIDType'];
@@ -37,4 +42,5 @@ export declare const createClientCollectionConfigs: ({ collections, defaultIDTyp
37
42
  i18n: I18nClient;
38
43
  importMap: ImportMap;
39
44
  }) => ClientCollectionConfig[];
45
+ export {};
40
46
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/collections/config/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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 -17,6 +17,7 @@ const serverOnlyUploadProperties = [
17
17
  'externalFileHeaderFilter',
18
18
  'handlers',
19
19
  'modifyResponseHeaders',
20
+ 'uploadInstructions',
20
21
  'withMetadata'
21
22
  ];
22
23
  const serverOnlyCollectionAdminProperties = [
@@ -148,7 +149,11 @@ export const createClientCollectionConfig = ({ collection, defaultIDType, i18n,
148
149
  if (!collection.upload) {
149
150
  break;
150
151
  }
151
- clientCollection.upload = {};
152
+ clientCollection.upload = {
153
+ uploadInstructions: {
154
+ useInAdmin: collection.upload.uploadInstructions?.useInAdmin ?? false
155
+ }
156
+ };
152
157
  for(const uploadKey in collection.upload){
153
158
  if (serverOnlyUploadProperties.includes(uploadKey)) {
154
159
  continue;