payload-auth 1.4.1 → 1.5.0

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 (207) hide show
  1. package/dist/better-auth/adapter/transform/index.js +3 -3
  2. package/dist/better-auth/generated-types.d.ts +216 -0
  3. package/dist/better-auth/generated-types.d.ts.map +1 -0
  4. package/dist/better-auth/generated-types.js +4 -0
  5. package/dist/better-auth/plugin/constants.d.ts +145 -3
  6. package/dist/better-auth/plugin/constants.d.ts.map +1 -1
  7. package/dist/better-auth/plugin/constants.js +148 -6
  8. package/dist/better-auth/plugin/helpers/check-plugin-exists.d.ts +13 -0
  9. package/dist/better-auth/plugin/helpers/check-plugin-exists.d.ts.map +1 -0
  10. package/dist/better-auth/plugin/helpers/check-plugin-exists.js +14 -0
  11. package/dist/better-auth/plugin/helpers/get-better-auth-schema.d.ts +22 -0
  12. package/dist/better-auth/plugin/helpers/get-better-auth-schema.d.ts.map +1 -0
  13. package/dist/better-auth/plugin/helpers/get-better-auth-schema.js +50 -0
  14. package/dist/better-auth/plugin/helpers/get-collection-schema-map.d.ts +16 -0
  15. package/dist/better-auth/plugin/helpers/get-collection-schema-map.d.ts.map +1 -0
  16. package/dist/better-auth/plugin/helpers/get-collection-schema-map.js +108 -0
  17. package/dist/better-auth/plugin/helpers/get-collection-slug.d.ts +6 -0
  18. package/dist/better-auth/plugin/helpers/get-collection-slug.d.ts.map +1 -0
  19. package/dist/better-auth/plugin/helpers/get-collection-slug.js +20 -0
  20. package/dist/better-auth/plugin/helpers/get-collection.d.ts +41 -0
  21. package/dist/better-auth/plugin/helpers/get-collection.d.ts.map +1 -0
  22. package/dist/better-auth/plugin/helpers/get-collection.js +62 -0
  23. package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts +8 -16
  24. package/dist/better-auth/plugin/helpers/prepare-session-data.d.ts.map +1 -1
  25. package/dist/better-auth/plugin/helpers/prepare-session-data.js +9 -20
  26. package/dist/better-auth/plugin/index.d.ts +3 -3
  27. package/dist/better-auth/plugin/index.d.ts.map +1 -1
  28. package/dist/better-auth/plugin/index.js +31 -40
  29. package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts +2 -6
  30. package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.d.ts.map +1 -1
  31. package/dist/better-auth/plugin/lib/build-collections/accounts/hooks/sync-password-to-user.js +22 -7
  32. package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts +3 -6
  33. package/dist/better-auth/plugin/lib/build-collections/accounts/index.d.ts.map +1 -1
  34. package/dist/better-auth/plugin/lib/build-collections/accounts/index.js +96 -102
  35. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts +2 -2
  36. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.d.ts.map +1 -1
  37. package/dist/better-auth/plugin/lib/build-collections/admin-invitations/index.js +6 -5
  38. package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts +3 -5
  39. package/dist/better-auth/plugin/lib/build-collections/api-keys.d.ts.map +1 -1
  40. package/dist/better-auth/plugin/lib/build-collections/api-keys.js +97 -113
  41. package/dist/better-auth/plugin/lib/build-collections/index.d.ts +6 -6
  42. package/dist/better-auth/plugin/lib/build-collections/index.d.ts.map +1 -1
  43. package/dist/better-auth/plugin/lib/build-collections/index.js +68 -84
  44. package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts +2 -4
  45. package/dist/better-auth/plugin/lib/build-collections/invitations.d.ts.map +1 -1
  46. package/dist/better-auth/plugin/lib/build-collections/invitations.js +75 -70
  47. package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts +3 -5
  48. package/dist/better-auth/plugin/lib/build-collections/jwks.d.ts.map +1 -1
  49. package/dist/better-auth/plugin/lib/build-collections/jwks.js +46 -28
  50. package/dist/better-auth/plugin/lib/build-collections/members.d.ts +3 -5
  51. package/dist/better-auth/plugin/lib/build-collections/members.d.ts.map +1 -1
  52. package/dist/better-auth/plugin/lib/build-collections/members.js +52 -48
  53. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts +3 -5
  54. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.d.ts.map +1 -1
  55. package/dist/better-auth/plugin/lib/build-collections/oauth-access-tokens.js +74 -64
  56. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts +3 -5
  57. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.d.ts.map +1 -1
  58. package/dist/better-auth/plugin/lib/build-collections/oauth-applications.js +78 -71
  59. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts +3 -5
  60. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.d.ts.map +1 -1
  61. package/dist/better-auth/plugin/lib/build-collections/oauth-consents.js +68 -45
  62. package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts +3 -5
  63. package/dist/better-auth/plugin/lib/build-collections/organizations.d.ts.map +1 -1
  64. package/dist/better-auth/plugin/lib/build-collections/organizations.js +52 -39
  65. package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts +3 -5
  66. package/dist/better-auth/plugin/lib/build-collections/passkeys.d.ts.map +1 -1
  67. package/dist/better-auth/plugin/lib/build-collections/passkeys.js +60 -64
  68. package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts +3 -7
  69. package/dist/better-auth/plugin/lib/build-collections/sessions.d.ts.map +1 -1
  70. package/dist/better-auth/plugin/lib/build-collections/sessions.js +100 -98
  71. package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts +3 -5
  72. package/dist/better-auth/plugin/lib/build-collections/sso-providers.d.ts.map +1 -1
  73. package/dist/better-auth/plugin/lib/build-collections/sso-providers.js +56 -56
  74. package/dist/better-auth/plugin/lib/build-collections/subscriptions.d.ts +4 -0
  75. package/dist/better-auth/plugin/lib/build-collections/subscriptions.d.ts.map +1 -0
  76. package/dist/better-auth/plugin/lib/build-collections/subscriptions.js +113 -0
  77. package/dist/better-auth/plugin/lib/build-collections/teams.d.ts +3 -5
  78. package/dist/better-auth/plugin/lib/build-collections/teams.d.ts.map +1 -1
  79. package/dist/better-auth/plugin/lib/build-collections/teams.js +62 -30
  80. package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts +3 -5
  81. package/dist/better-auth/plugin/lib/build-collections/two-factors.d.ts.map +1 -1
  82. package/dist/better-auth/plugin/lib/build-collections/two-factors.js +50 -37
  83. package/dist/better-auth/plugin/lib/build-collections/users/better-auth-strategy.js +4 -4
  84. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/generate-invite-url.js +3 -3
  85. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.d.ts +6 -0
  86. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.d.ts.map +1 -0
  87. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/index.js +7 -0
  88. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/set-admin-role.js +4 -4
  89. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.d.ts +2 -2
  90. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.d.ts.map +1 -1
  91. package/dist/better-auth/plugin/lib/build-collections/users/endpoints/signup.js +93 -96
  92. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts +1 -6
  93. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.d.ts.map +1 -1
  94. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-login.js +22 -13
  95. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts +1 -5
  96. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.d.ts.map +1 -1
  97. package/dist/better-auth/plugin/lib/build-collections/users/hooks/after-logout.js +16 -8
  98. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts +2 -6
  99. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.d.ts.map +1 -1
  100. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-delete.js +25 -6
  101. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts +2 -1
  102. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.d.ts.map +1 -1
  103. package/dist/better-auth/plugin/lib/build-collections/users/hooks/before-login.js +5 -8
  104. package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.d.ts +7 -0
  105. package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.d.ts.map +1 -0
  106. package/dist/better-auth/plugin/lib/build-collections/users/hooks/index.js +8 -0
  107. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts +1 -1
  108. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.d.ts.map +1 -1
  109. package/dist/better-auth/plugin/lib/build-collections/users/hooks/on-verified-change.js +15 -12
  110. package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts +1 -6
  111. package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.d.ts.map +1 -1
  112. package/dist/better-auth/plugin/lib/build-collections/users/hooks/sync-account.js +21 -10
  113. package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts +3 -7
  114. package/dist/better-auth/plugin/lib/build-collections/users/index.d.ts.map +1 -1
  115. package/dist/better-auth/plugin/lib/build-collections/users/index.js +153 -210
  116. package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.d.ts +16 -0
  117. package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.d.ts.map +1 -0
  118. package/dist/better-auth/plugin/lib/build-collections/utils/collection-schema.js +32 -0
  119. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts +1 -1
  120. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.d.ts.map +1 -1
  121. package/dist/better-auth/plugin/lib/build-collections/utils/get-timestamp-fields.js +1 -1
  122. package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.d.ts +17 -0
  123. package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.d.ts.map +1 -0
  124. package/dist/better-auth/plugin/lib/build-collections/utils/model-field-transformations.js +21 -0
  125. package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts +22 -0
  126. package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.d.ts.map +1 -0
  127. package/dist/better-auth/plugin/lib/build-collections/utils/transform-schema-fields-to-payload.js +95 -0
  128. package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts +3 -6
  129. package/dist/better-auth/plugin/lib/build-collections/verifications.d.ts.map +1 -1
  130. package/dist/better-auth/plugin/lib/build-collections/verifications.js +62 -40
  131. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.d.ts.map +1 -1
  132. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/admin-plugin.js +4 -3
  133. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts +2 -1
  134. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.d.ts.map +1 -1
  135. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/api-key-plugin.js +8 -15
  136. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts +5 -3
  137. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.d.ts.map +1 -1
  138. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/index.js +56 -69
  139. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts +2 -1
  140. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.d.ts.map +1 -1
  141. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/oidc-plugin.js +16 -55
  142. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts +2 -1
  143. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.d.ts.map +1 -1
  144. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/organizations-plugin.js +21 -83
  145. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts +2 -1
  146. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.d.ts.map +1 -1
  147. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/passkey-plugin.js +8 -15
  148. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts +2 -1
  149. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.d.ts.map +1 -1
  150. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/sso-plugin.js +8 -15
  151. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.d.ts +3 -0
  152. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.d.ts.map +1 -0
  153. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/two-factor-plugin.js +10 -0
  154. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts +3 -3
  155. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.d.ts.map +1 -1
  156. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/require-admin-invite-for-sign-up-middleware.js +3 -3
  157. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.d.ts +5 -4
  158. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.d.ts.map +1 -1
  159. package/dist/better-auth/plugin/lib/sanitize-better-auth-options/utils/save-to-jwt-middleware.js +10 -10
  160. package/dist/better-auth/plugin/lib/set-login-methods.d.ts +1 -1
  161. package/dist/better-auth/plugin/lib/set-login-methods.d.ts.map +1 -1
  162. package/dist/better-auth/plugin/lib/set-login-methods.js +5 -6
  163. package/dist/better-auth/plugin/payload/views/admin-login/client.d.ts.map +1 -1
  164. package/dist/better-auth/plugin/payload/views/admin-login/client.js +2 -2
  165. package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts +4 -4
  166. package/dist/better-auth/plugin/payload/views/admin-login/index.d.ts.map +1 -1
  167. package/dist/better-auth/plugin/payload/views/admin-login/index.js +7 -8
  168. package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts +1 -1
  169. package/dist/better-auth/plugin/payload/views/admin-signup/client.d.ts.map +1 -1
  170. package/dist/better-auth/plugin/payload/views/admin-signup/client.js +27 -7
  171. package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts +4 -5
  172. package/dist/better-auth/plugin/payload/views/admin-signup/index.d.ts.map +1 -1
  173. package/dist/better-auth/plugin/payload/views/admin-signup/index.js +6 -6
  174. package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts +1 -5
  175. package/dist/better-auth/plugin/payload/views/forgot-password/index.d.ts.map +1 -1
  176. package/dist/better-auth/plugin/payload/views/forgot-password/index.js +1 -1
  177. package/dist/better-auth/plugin/payload/views/two-factor-verify/index.d.ts +3 -3
  178. package/dist/better-auth/plugin/payload/views/two-factor-verify/index.d.ts.map +1 -1
  179. package/dist/better-auth/plugin/payload/views/two-factor-verify/index.js +10 -7
  180. package/dist/better-auth/plugin/types.d.ts +41 -13
  181. package/dist/better-auth/plugin/types.d.ts.map +1 -1
  182. package/dist/better-auth/plugin/types.js +1 -1
  183. package/dist/better-auth/plugin/utils/set.d.ts +40 -0
  184. package/dist/better-auth/plugin/utils/set.d.ts.map +1 -0
  185. package/dist/better-auth/plugin/utils/set.js +84 -0
  186. package/dist/better-auth/scripts/generate-types.d.ts +2 -0
  187. package/dist/better-auth/scripts/generate-types.d.ts.map +1 -0
  188. package/dist/better-auth/scripts/generate-types.js +219 -0
  189. package/dist/shared/form/validation.d.ts +31 -7
  190. package/dist/shared/form/validation.d.ts.map +1 -1
  191. package/dist/shared/form/validation.js +13 -5
  192. package/package.json +14 -9
  193. package/dist/better-auth/plugin/helpers/check-passkey-plugin.d.ts +0 -3
  194. package/dist/better-auth/plugin/helpers/check-passkey-plugin.d.ts.map +0 -1
  195. package/dist/better-auth/plugin/helpers/check-passkey-plugin.js +0 -6
  196. package/dist/better-auth/plugin/helpers/check-two-factor-plugin.d.ts +0 -3
  197. package/dist/better-auth/plugin/helpers/check-two-factor-plugin.d.ts.map +0 -1
  198. package/dist/better-auth/plugin/helpers/check-two-factor-plugin.js +0 -6
  199. package/dist/better-auth/plugin/helpers/check-username-plugin.d.ts +0 -3
  200. package/dist/better-auth/plugin/helpers/check-username-plugin.d.ts.map +0 -1
  201. package/dist/better-auth/plugin/helpers/check-username-plugin.js +0 -6
  202. package/dist/better-auth/plugin/lib/get-required-collection-slugs.d.ts +0 -10
  203. package/dist/better-auth/plugin/lib/get-required-collection-slugs.d.ts.map +0 -1
  204. package/dist/better-auth/plugin/lib/get-required-collection-slugs.js +0 -35
  205. package/dist/better-auth/plugin/payload/utils/generate-metadata.d.ts +0 -15
  206. package/dist/better-auth/plugin/payload/utils/generate-metadata.d.ts.map +0 -1
  207. package/dist/better-auth/plugin/payload/utils/generate-metadata.js +0 -74
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-two-factor-plugin.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/check-two-factor-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAE1D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,0BAA0B,WAEvE"}
@@ -1,6 +0,0 @@
1
- import { supportedBetterAuthPluginIds } from "../constants";
2
- export function checkTwoFactorPlugin(options) {
3
- return options.plugins?.some((plugin)=>plugin.id === supportedBetterAuthPluginIds.twoFactor) || false;
4
- }
5
-
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9jaGVjay10d28tZmFjdG9yLXBsdWdpbi50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBzdXBwb3J0ZWRCZXR0ZXJBdXRoUGx1Z2luSWRzIH0gZnJvbSAnLi4vY29uc3RhbnRzJ1xuaW1wb3J0IHR5cGUgeyBTYW5pdGl6ZWRCZXR0ZXJBdXRoT3B0aW9ucyB9IGZyb20gJy4uL3R5cGVzJ1xuXG5leHBvcnQgZnVuY3Rpb24gY2hlY2tUd29GYWN0b3JQbHVnaW4ob3B0aW9uczogU2FuaXRpemVkQmV0dGVyQXV0aE9wdGlvbnMpIHtcbiAgcmV0dXJuIG9wdGlvbnMucGx1Z2lucz8uc29tZSgocGx1Z2luKSA9PiBwbHVnaW4uaWQgPT09IHN1cHBvcnRlZEJldHRlckF1dGhQbHVnaW5JZHMudHdvRmFjdG9yKSB8fCBmYWxzZVxufVxuIl0sIm5hbWVzIjpbInN1cHBvcnRlZEJldHRlckF1dGhQbHVnaW5JZHMiLCJjaGVja1R3b0ZhY3RvclBsdWdpbiIsIm9wdGlvbnMiLCJwbHVnaW5zIiwic29tZSIsInBsdWdpbiIsImlkIiwidHdvRmFjdG9yIl0sIm1hcHBpbmdzIjoiQUFBQSxTQUFTQSw0QkFBNEIsUUFBUSxlQUFjO0FBRzNELE9BQU8sU0FBU0MscUJBQXFCQyxPQUFtQztJQUN0RSxPQUFPQSxRQUFRQyxPQUFPLEVBQUVDLEtBQUssQ0FBQ0MsU0FBV0EsT0FBT0MsRUFBRSxLQUFLTiw2QkFBNkJPLFNBQVMsS0FBSztBQUNwRyJ9
@@ -1,3 +0,0 @@
1
- import type { SanitizedBetterAuthOptions } from '../types';
2
- export declare function checkUsernamePlugin(options: SanitizedBetterAuthOptions): boolean;
3
- //# sourceMappingURL=check-username-plugin.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"check-username-plugin.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/helpers/check-username-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAE1D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,WAEtE"}
@@ -1,6 +0,0 @@
1
- import { supportedBetterAuthPluginIds } from "../constants";
2
- export function checkUsernamePlugin(options) {
3
- return options.plugins?.some((plugin)=>plugin.id === supportedBetterAuthPluginIds.username) || false;
4
- }
5
-
6
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vaGVscGVycy9jaGVjay11c2VybmFtZS1wbHVnaW4udHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgYmV0dGVyQXV0aFBsdWdpblNsdWdzLCBzdXBwb3J0ZWRCZXR0ZXJBdXRoUGx1Z2luSWRzIH0gZnJvbSAnLi4vY29uc3RhbnRzJ1xuaW1wb3J0IHR5cGUgeyBTYW5pdGl6ZWRCZXR0ZXJBdXRoT3B0aW9ucyB9IGZyb20gJy4uL3R5cGVzJ1xuXG5leHBvcnQgZnVuY3Rpb24gY2hlY2tVc2VybmFtZVBsdWdpbihvcHRpb25zOiBTYW5pdGl6ZWRCZXR0ZXJBdXRoT3B0aW9ucykge1xuICByZXR1cm4gb3B0aW9ucy5wbHVnaW5zPy5zb21lKChwbHVnaW4pID0+IHBsdWdpbi5pZCA9PT0gc3VwcG9ydGVkQmV0dGVyQXV0aFBsdWdpbklkcy51c2VybmFtZSkgfHwgZmFsc2Vcbn1cbiJdLCJuYW1lcyI6WyJzdXBwb3J0ZWRCZXR0ZXJBdXRoUGx1Z2luSWRzIiwiY2hlY2tVc2VybmFtZVBsdWdpbiIsIm9wdGlvbnMiLCJwbHVnaW5zIiwic29tZSIsInBsdWdpbiIsImlkIiwidXNlcm5hbWUiXSwibWFwcGluZ3MiOiJBQUFBLFNBQWdDQSw0QkFBNEIsUUFBUSxlQUFjO0FBR2xGLE9BQU8sU0FBU0Msb0JBQW9CQyxPQUFtQztJQUNyRSxPQUFPQSxRQUFRQyxPQUFPLEVBQUVDLEtBQUssQ0FBQ0MsU0FBV0EsT0FBT0MsRUFBRSxLQUFLTiw2QkFBNkJPLFFBQVEsS0FBSztBQUNuRyJ9
@@ -1,10 +0,0 @@
1
- import type { BetterAuthPluginOptions, SanitizedBetterAuthOptions } from '../types';
2
- /**
3
- * Determines which collections are required based on the BetterAuth options and plugins
4
- */
5
- export declare function getRequiredCollectionSlugs({ logTables, pluginOptions, betterAuthOptions }: {
6
- logTables: boolean;
7
- pluginOptions: BetterAuthPluginOptions;
8
- betterAuthOptions: SanitizedBetterAuthOptions;
9
- }): Set<string>;
10
- //# sourceMappingURL=get-required-collection-slugs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-required-collection-slugs.d.ts","sourceRoot":"","sources":["../../../../src/better-auth/plugin/lib/get-required-collection-slugs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAEnF;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,SAAS,EACT,aAAa,EACb,iBAAiB,EAClB,EAAE;IACD,SAAS,EAAE,OAAO,CAAA;IAClB,aAAa,EAAE,uBAAuB,CAAA;IACtC,iBAAiB,EAAE,0BAA0B,CAAA;CAC9C,GAAG,GAAG,CAAC,MAAM,CAAC,CAyCd"}
@@ -1,35 +0,0 @@
1
- import { getAuthTables } from "better-auth/db";
2
- import { baseCollectionSlugs } from "../constants";
3
- /**
4
- * Determines which collections are required based on the BetterAuth options and plugins
5
- */ export function getRequiredCollectionSlugs({ logTables, pluginOptions, betterAuthOptions }) {
6
- // Start with base collections
7
- const requiredCollectionSlugs = new Set([
8
- pluginOptions.users?.slug ?? baseCollectionSlugs.users,
9
- pluginOptions.accounts?.slug ?? baseCollectionSlugs.accounts,
10
- pluginOptions.sessions?.slug ?? baseCollectionSlugs.sessions,
11
- pluginOptions.verifications?.slug ?? baseCollectionSlugs.verifications,
12
- pluginOptions.adminInvitations?.slug ?? baseCollectionSlugs.adminInvitations
13
- ]);
14
- // Add additional collections from auth tables if available
15
- try {
16
- const tables = getAuthTables(betterAuthOptions);
17
- if (logTables) {
18
- console.log('Better Auth plugins:', betterAuthOptions.plugins?.map((plugin)=>plugin.id) || []);
19
- console.log('Better Auth tables required:', Object.values(tables).map((table)=>table.modelName));
20
- }
21
- // Add all table model names to required collections
22
- Object.values(tables).filter((table)=>table.modelName).forEach((table)=>requiredCollectionSlugs.add(table.modelName));
23
- } catch (error) {
24
- console.error('Error determining required auth tables:', error);
25
- console.warn('Falling back to base collections only');
26
- // Log problematic plugins if any exist
27
- const plugins = betterAuthOptions.plugins || [];
28
- if (plugins.length > 0) {
29
- console.warn('Plugins that may have caused the error:', plugins.map((plugin)=>typeof plugin === 'object' && plugin !== null && 'name' in plugin ? plugin.name : 'unnamed plugin'));
30
- }
31
- }
32
- return requiredCollectionSlugs;
33
- }
34
-
35
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vbGliL2dldC1yZXF1aXJlZC1jb2xsZWN0aW9uLXNsdWdzLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGdldEF1dGhUYWJsZXMgfSBmcm9tICdiZXR0ZXItYXV0aC9kYidcbmltcG9ydCB7IGJhc2VDb2xsZWN0aW9uU2x1Z3MgfSBmcm9tICcuLi9jb25zdGFudHMnXG5pbXBvcnQgdHlwZSB7IEJldHRlckF1dGhQbHVnaW5PcHRpb25zLCBTYW5pdGl6ZWRCZXR0ZXJBdXRoT3B0aW9ucyB9IGZyb20gJy4uL3R5cGVzJ1xuXG4vKipcbiAqIERldGVybWluZXMgd2hpY2ggY29sbGVjdGlvbnMgYXJlIHJlcXVpcmVkIGJhc2VkIG9uIHRoZSBCZXR0ZXJBdXRoIG9wdGlvbnMgYW5kIHBsdWdpbnNcbiAqL1xuZXhwb3J0IGZ1bmN0aW9uIGdldFJlcXVpcmVkQ29sbGVjdGlvblNsd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SxTQUFTQSxPQUFPWSxJQUFJLEdBQUc7UUFFL0c7SUFDRjtJQUVBLE9BQU96QjtBQUNUIn0=
@@ -1,15 +0,0 @@
1
- import type { Metadata } from 'next';
2
- import type { MetaConfig, SanitizedConfig } from 'payload';
3
- import type { I18nClient } from '@payloadcms/translations';
4
- export declare const generateMetadata: (args: {
5
- serverURL: string;
6
- } & MetaConfig) => Promise<Metadata>;
7
- export type GenerateViewMetadata = (args: {
8
- config: SanitizedConfig;
9
- i18n: I18nClient;
10
- isEditing?: boolean;
11
- params?: {
12
- [key: string]: string | string[];
13
- };
14
- }) => Promise<Metadata>;
15
- //# sourceMappingURL=generate-metadata.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generate-metadata.d.ts","sourceRoot":"","sources":["../../../../../src/better-auth/plugin/payload/utils/generate-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAA;AAEpC,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC1D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAW1D,eAAO,MAAM,gBAAgB,GAAU,MAAM;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG,UAAU,KAAG,OAAO,CAAC,QAAQ,CA6EjG,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,CAAC,IAAI,EAAE;IACxC,MAAM,EAAE,eAAe,CAAA;IACvB,IAAI,EAAE,UAAU,CAAA;IAChB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,MAAM,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAA;CAC9C,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA"}
@@ -1,74 +0,0 @@
1
- import { payloadFaviconDark, payloadFaviconLight, staticOGImage } from "@payloadcms/ui/assets";
2
- import * as qs from "qs-esm";
3
- const defaultOpenGraph = {
4
- description: 'Payload is a headless CMS and application framework built with TypeScript, Node.js, and React.',
5
- siteName: 'Payload App',
6
- title: 'Payload App'
7
- };
8
- export const generateMetadata = async (args)=>{
9
- const { defaultOGImageType, serverURL, titleSuffix, ...rest } = args;
10
- /**
11
- * @todo find a way to remove the type assertion here.
12
- * It is a result of needing to `DeepCopy` the `MetaConfig` type from Payload.
13
- * This is required for the `DeepRequired` from `Config` to `SanitizedConfig`.
14
- */ const incomingMetadata = rest;
15
- const icons = incomingMetadata.icons || [
16
- {
17
- type: 'image/png',
18
- rel: 'icon',
19
- sizes: '32x32',
20
- url: typeof payloadFaviconDark === 'object' ? payloadFaviconDark?.src : payloadFaviconDark
21
- },
22
- {
23
- type: 'image/png',
24
- media: '(prefers-color-scheme: dark)',
25
- rel: 'icon',
26
- sizes: '32x32',
27
- url: typeof payloadFaviconLight === 'object' ? payloadFaviconLight?.src : payloadFaviconLight
28
- }
29
- ];
30
- const metaTitle = [
31
- incomingMetadata.title,
32
- titleSuffix
33
- ].filter(Boolean).join(' ');
34
- const ogTitle = `${typeof incomingMetadata.openGraph?.title === 'string' ? incomingMetadata.openGraph.title : incomingMetadata.title} ${titleSuffix}`;
35
- const mergedOpenGraph = {
36
- ...defaultOpenGraph || {},
37
- ...defaultOGImageType === 'dynamic' ? {
38
- images: [
39
- {
40
- alt: ogTitle,
41
- height: 630,
42
- url: `/api/og${qs.stringify({
43
- description: incomingMetadata.openGraph?.description || defaultOpenGraph.description,
44
- title: ogTitle
45
- }, {
46
- addQueryPrefix: true
47
- })}`,
48
- width: 1200
49
- }
50
- ]
51
- } : {},
52
- ...defaultOGImageType === 'static' ? {
53
- images: [
54
- {
55
- alt: ogTitle,
56
- height: 480,
57
- url: typeof staticOGImage === 'object' ? staticOGImage?.src : staticOGImage,
58
- width: 640
59
- }
60
- ]
61
- } : {},
62
- title: ogTitle,
63
- ...incomingMetadata.openGraph || {}
64
- };
65
- return Promise.resolve({
66
- ...incomingMetadata,
67
- icons,
68
- metadataBase: new URL(serverURL || process.env.PAYLOAD_PUBLIC_SERVER_URL || `http://localhost:${process.env.PORT || 3000}`),
69
- openGraph: mergedOpenGraph,
70
- title: metaTitle
71
- });
72
- };
73
-
74
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9iZXR0ZXItYXV0aC9wbHVnaW4vcGF5bG9hZC91dGlscy9nZW5lcmF0ZS1tZXRhZGF0YS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IE1ldGFkYXRhIH0gZnJvbSAnbmV4dCdcbmltcG9ydCB0eXBlIHsgSWNvbiB9IGZyb20gJ25leHQvZGlzdC9saWIvbWV0YWRhdGEvdHlwZXMvbWV0YWRhdGEtdHlwZXMuanMnXG5pbXBvcnQgdHlwZSB7IE1ldGFDb25maWcsIFNhbml0aXplZENvbmZpZyB9IGZyb20gJ3BheWxvYWQnXG5pbXBvcnQgdHlwZSB7IEkxOG5DbGllbnQgfSBmcm9tICdAcGF5bG9hZGNtcy90cmFuc2xhdGlvbnMnXG5cbmltcG9ydCB7IHBheWxvYWRGYXZpY29uRGFyaywgcGF5bG9hZEZhdmljb25MaWdodCwgc3RhdGljT0dJbWFnZSB9IGZyb20gJ0BwYXlsb2FkY21zL3VpL2Fzc2V0cydcbmltcG9ydCAqIGFzIHFzIGZyb20gJ3FzLWVzbSdcblxuY29uc3QgZGVmYXVsdE9wZW5HcmFwaDogTWV0YWRhdGFbJ29wZW5HcmFwaCddID0ge1xuICBkZXNjcmlwdGlvbjogJ1BheWxvYWQgaXMgYSBoZWFkbGVzcyBDTVMgYW5kIGFwcGxpY2F0aW9uIGZyYW1ld29yayBidWlsdCB3aXRoIFR5cGVTY3JpcHQsIE5vZGUuanMsIGFuZCBSZWFjdC4nLFxuICBzaXRlTmFtZTogJ1BheWxvYWQgQXBwJyxcbiAgdGl0bGU6ICdQYX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wgZGVmYXVsdE9wZW5HcmFwaC5kZXNjcmlwdGlvbixcbiAgICAgICAgICAgICAgICAgIHRpdGxlOiBvZ1RpdGxlXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICBhZGRRdWVyeVByZWZpeDogdHJ1ZVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgKX1gLFxuICAgICAgICAgICAgICB3aWR0aDogMTIwMFxuICAgICAgICAgICAgfVxuICAgICAgICAgIF1cbiAgICAgICAgfVxuICAgICAgOiB7fSksXG4gICAgLi4uKGRlZmF1bHRPR0ltYWdlVHlwZSA9PT0gJ3N0YXRpYydcbiAgICAgID8ge1xuICAgICAgICAgIGltYWdlczogW1xuICAgICAgICAgICAge1xuICAgICAgICAgICAgICBhbHQ6IG9nVGl0bGUsXG4gICAgICAgICAgICAgIGhlaWdodDogNDgwLFxuICAgICAgICAgICAgICB1cmw6IHR5cGVvZiBzdGF0aWNPR0ltYWdlID09PSAnb2JqZWN0JyA/IHN0YXRpY09HSW1hZ2U/LnNyYyA6IHN0YXRpY09HSW1hZ2UsXG4gICAgICAgICAgICAgIHdpZHRoOiA2NDBcbiAgICAgICAgICAgIH1cbiAgICAgICAgICBdXG4gICAgICAgIH1cbiAgICAgIDoge30pLFxuICAgIHRpdGxlOiBvZ1RpdGxlLFxuICAgIC4uLihpbmNvbWluZ01ldGFkYXRhLm9wZW5HcmFwaCB8fCB7fSlcbiAgfVxuXG4gIHJldHVybiBQcm9taXNlLnJlc29sdmUoe1xuICAgIC4uLmluY29taW5nTWV0YWRhdGEsXG4gICAgaWNvbnMsXG4gICAgbWV0YWRhdGFCYXNlOiBuZXcgVVJMKHNlcnZlclVSTCB8fCBwcm9jZXNzLmVudi5QQVlMT0FEX1BVQkxJQ19TRVJWRVJfVVJMIHx8IGBodHRwOi8vbG9jYWxob3N0OiR7cHJvY2Vzcy5lbnYuUE9SVCB8fCAzMDAwfWApLFxuICAgIG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