better-auth 1.4.0-beta.13 → 1.4.0-beta.14
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.
- package/README.md +1 -1
- package/dist/{access-CMKBGgPM.cjs → access-BEhlHupZ.cjs} +1 -1
- package/dist/{access-C85goQpj.cjs → access-C7E6cTL4.cjs} +1 -1
- package/dist/{access-CiYP7qc2.js → access-CgamBNNQ.js} +1 -1
- package/dist/{access-DzjK1clY.js → access-DLZwpgWe.js} +1 -1
- package/dist/{adapter-factory-KQnbXzIu.js → adapter-factory-DhMmHmcC.js} +4 -3
- package/dist/{adapter-factory-CaEezC7-.cjs → adapter-factory-cwC_YJVZ.cjs} +4 -3
- package/dist/adapters/drizzle-adapter/index.cjs +6 -5
- package/dist/adapters/drizzle-adapter/index.js +6 -5
- package/dist/adapters/index.cjs +6 -5
- package/dist/adapters/index.d.cts +2 -2
- package/dist/adapters/index.d.ts +4 -4
- package/dist/adapters/index.js +6 -5
- package/dist/adapters/kysely-adapter/index.cjs +7 -6
- package/dist/adapters/kysely-adapter/index.d.ts +1 -1
- package/dist/adapters/kysely-adapter/index.js +7 -6
- package/dist/adapters/memory-adapter/index.cjs +7 -6
- package/dist/adapters/memory-adapter/index.d.cts +2 -2
- package/dist/adapters/memory-adapter/index.d.ts +2 -2
- package/dist/adapters/memory-adapter/index.js +7 -6
- package/dist/adapters/mongodb-adapter/index.cjs +7 -6
- package/dist/adapters/mongodb-adapter/index.js +7 -6
- package/dist/adapters/prisma-adapter/index.cjs +6 -5
- package/dist/adapters/prisma-adapter/index.js +6 -5
- package/dist/adapters/test.cjs +4 -3
- package/dist/adapters/test.js +4 -3
- package/dist/{admin-Bv_87xle.js → admin-B8VcKDeQ.js} +10 -8
- package/dist/{admin-DUGV_VcG.d.cts → admin-BDcGwVXf.d.cts} +54 -54
- package/dist/{admin-CZqCaWVS.d.ts → admin-BlNxtrdE.d.ts} +54 -54
- package/dist/{admin-Bm4YWSyK.cjs → admin-avGCF978.cjs} +13 -11
- package/dist/{anonymous-CZt2hIgy.cjs → anonymous-3dIERI_Q.cjs} +6 -6
- package/dist/{anonymous-GeIs8dX-.js → anonymous-BQJVmtl9.js} +6 -6
- package/dist/api/index.cjs +15 -14
- package/dist/api/index.d.cts +2 -2
- package/dist/api/index.d.ts +4 -4
- package/dist/api/index.js +15 -14
- package/dist/{api-D47Fl7g_.cjs → api-BwtxqMiI.cjs} +1647 -1637
- package/dist/{api-DxoCILgu.js → api-CK1FkqPY.js} +1645 -1635
- package/dist/{auth-DOcOyyAO.cjs → auth-C3wA_ue8.cjs} +18 -12
- package/dist/{auth-nfiyF_s0.js → auth-DuMX1ebp.js} +17 -11
- package/dist/{bearer-yOkphqTA.js → bearer-CI1mAUpJ.js} +1 -1
- package/dist/{bearer-Dbv3s-Ey.cjs → bearer-dJhhsLK-.cjs} +1 -1
- package/dist/{captcha-Cu5L5AI9.cjs → captcha-B6SAesoe.cjs} +31 -31
- package/dist/{captcha-DMvJpJ_i.js → captcha-Bi_qvqJM.js} +31 -31
- package/dist/client/index.cjs +6 -6
- package/dist/client/index.d.cts +17 -17
- package/dist/client/index.d.ts +35 -35
- package/dist/client/index.js +6 -6
- package/dist/client/lynx/index.cjs +3 -3
- package/dist/client/lynx/index.d.cts +19 -19
- package/dist/client/lynx/index.d.ts +21 -21
- package/dist/client/lynx/index.js +3 -3
- package/dist/client/plugins/index.cjs +351 -363
- package/dist/client/plugins/index.d.cts +1179 -1199
- package/dist/client/plugins/index.d.ts +454 -457
- package/dist/client/plugins/index.js +346 -358
- package/dist/client/react/index.cjs +3 -3
- package/dist/client/react/index.d.cts +19 -19
- package/dist/client/react/index.d.ts +21 -21
- package/dist/client/react/index.js +3 -3
- package/dist/client/solid/index.cjs +6 -6
- package/dist/client/solid/index.d.cts +16 -16
- package/dist/client/solid/index.d.ts +4 -4
- package/dist/client/solid/index.js +5 -5
- package/dist/client/svelte/index.cjs +4 -4
- package/dist/client/svelte/index.d.cts +18 -18
- package/dist/client/svelte/index.d.ts +4 -4
- package/dist/client/svelte/index.js +4 -4
- package/dist/client/vue/index.cjs +4 -4
- package/dist/client/vue/index.d.cts +18 -18
- package/dist/client/vue/index.d.ts +4 -4
- package/dist/client/vue/index.js +4 -4
- package/dist/{client-CHNR12_D.d.cts → client-BwIQtbHR.d.cts} +47 -47
- package/dist/{client-tn91AMhb.d.ts → client-CaMctHeg.d.ts} +8 -8
- package/dist/{client-BuCPepf7.d.cts → client-hXVC15N3.d.cts} +8 -8
- package/dist/{client-CmCcVw0X.d.ts → client-wmzghB26.d.ts} +50 -50
- package/dist/cookies/index.cjs +5 -4
- package/dist/cookies/index.d.cts +3 -3
- package/dist/cookies/index.d.ts +5 -5
- package/dist/cookies/index.js +5 -4
- package/dist/{cookies-YIhGFT3t.js → cookies-CDCTQ4zM.js} +24 -13
- package/dist/{cookies-C0ukzamv.cjs → cookies-DUsbxYZ4.cjs} +26 -15
- package/dist/crypto/index.cjs +6 -2
- package/dist/crypto/index.d.cts +4 -1
- package/dist/crypto/index.d.ts +4 -1
- package/dist/crypto/index.js +3 -2
- package/dist/{crypto-Cm1LKxZK.js → crypto-CGcj9N1E.js} +4 -11
- package/dist/{crypto-GB8E2Sqo.cjs → crypto-DgMl-YEg.cjs} +6 -20
- package/dist/{custom-session-Dq7kJpay.cjs → custom-session-DOvCTbRD.cjs} +2 -2
- package/dist/{custom-session-mzjgl4I0.js → custom-session-Dm7ILOkQ.js} +2 -2
- package/dist/{schema-DVD_DMGr.js → date-BPjINFle.js} +13 -11
- package/dist/{schema-CZyco4Bb.cjs → date-utEdG8L8.cjs} +12 -10
- package/dist/db/index.cjs +20 -19
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.ts +4 -4
- package/dist/db/index.js +11 -10
- package/dist/{db-BvFyxQ2U.js → db-B60SmhRx.js} +1066 -1069
- package/dist/{db-Dn17omQ4.cjs → db-DhYeqOw8.cjs} +1067 -1070
- package/dist/{device-authorization-Cn96X1mD.js → device-authorization-BsWJk5r6.js} +4 -4
- package/dist/{device-authorization-EOq-p6gT.cjs → device-authorization-CIKZ83k6.cjs} +5 -5
- package/dist/{email-otp-BJc23Pox.js → email-otp-BYRWOFMX.js} +28 -30
- package/dist/{email-otp-Duy-8LZZ.cjs → email-otp-DJV0o-_W.cjs} +34 -35
- package/dist/{generic-oauth-B3I2Gf44.js → generic-oauth-0h1JCbYl.js} +5 -5
- package/dist/{generic-oauth-DFnrwFvM.cjs → generic-oauth-B6mojk-i.cjs} +6 -6
- package/dist/{has-permission-CAhU7MOW.cjs → has-permission-BXnfxm8t.cjs} +1 -1
- package/dist/{has-permission-CFehLg5L.js → has-permission-D4Cw2FMS.js} +1 -1
- package/dist/{haveibeenpwned-BIwNylxL.js → haveibeenpwned-CWKPQR69.js} +1 -1
- package/dist/{index-Bkyb84Ii.d.ts → index-09-11Sr4.d.ts} +1 -1
- package/dist/{index-BPfW0EE8.d.cts → index-2i_U4trt.d.cts} +36 -36
- package/dist/{index-B54rcdu6.d.ts → index-5nx1bQNE.d.ts} +14 -14
- package/dist/{index-7IFEqRAp.d.ts → index-B9VrcD86.d.ts} +8 -8
- package/dist/{index-Ch8HkJZj.d.cts → index-BDZ2FsZX.d.cts} +14 -14
- package/dist/{index-Cpy42W_d.d.cts → index-BMBboY19.d.cts} +14 -15
- package/dist/{index-DT_dYqYt.d.ts → index-BOxYcBjy.d.ts} +5 -5
- package/dist/{index-DDaNGXa2.d.cts → index-BRA1Z7WV.d.cts} +5 -5
- package/dist/{index-D47evZgv.d.cts → index-BUnXR36Q.d.cts} +15 -15
- package/dist/{index-CKpTDvcE.d.cts → index-Bek2Doqv.d.cts} +6 -6
- package/dist/{index-Cg1CVzvT.d.ts → index-BmsFcyxv.d.ts} +13 -13
- package/dist/{index--btdjysb.d.cts → index-BrnwP1XP.d.cts} +7 -7
- package/dist/{index-B6kMPMVt.d.ts → index-Bw8wedDq.d.ts} +10 -10
- package/dist/{index-CwUQdVct.d.ts → index-C6skfuJu.d.ts} +2 -2
- package/dist/{index-D6BVJs-h.d.ts → index-C7K33cmK.d.ts} +2 -2
- package/dist/{index-A2P42rxH.d.ts → index-CBKgXcp1.d.cts} +6 -6
- package/dist/{index-RWNGvtOw.d.cts → index-CJ_59FgW.d.ts} +2 -2
- package/dist/{index-CntsO_8k.d.cts → index-COHu2h4h.d.cts} +22 -23
- package/dist/{index-e0STHISZ.d.ts → index-COPDLmvw.d.ts} +4 -4
- package/dist/{index-DRiG_er6.d.cts → index-CUzPNXKr.d.ts} +3 -1
- package/dist/index-C_si6-1Y.d.ts +36 -0
- package/dist/{index-Cqz6miMA.d.ts → index-CbmzHokl.d.ts} +11 -11
- package/dist/{index-B7uT04qq.d.ts → index-CcKCA_bu.d.cts} +2 -2
- package/dist/{index-Cgi7uXuu.d.ts → index-CiNtnu3_.d.ts} +17 -19
- package/dist/{index-BKs8lAg_.d.cts → index-CmZhkzyD.d.cts} +3 -3
- package/dist/{index-DjXaaott.d.ts → index-CyHbNt2r.d.ts} +14 -15
- package/dist/{index-D4Dckjj-.d.ts → index-CyuC56iJ.d.ts} +3 -3
- package/dist/{index-G-ankSM7.d.cts → index-D5H-c4_U.d.cts} +8 -8
- package/dist/{index-CpXg4Juh.d.ts → index-DAOgGjJm.d.ts} +10 -10
- package/dist/{index-AFECof_v.d.cts → index-DDDVJuUQ.d.cts} +17 -19
- package/dist/{index-BBtdzPzk.d.ts → index-DDnRSsbC.d.ts} +1491 -1674
- package/dist/{index-j5Hnm9IK.d.cts → index-DKDahEnN.d.cts} +3 -3
- package/dist/{index-DHZ4drLn.d.ts → index-DQVN3HyJ.d.ts} +15 -15
- package/dist/{index-C-z9Otzw.d.ts → index-DRwgwfU2.d.ts} +6 -6
- package/dist/{index-DgpmIAjL.d.cts → index-DWYNUC65.d.cts} +1 -1
- package/dist/{index-DgP_W74p.d.cts → index-DWeKLUtZ.d.cts} +4 -4
- package/dist/{index-H0wZ8DLw.d.cts → index-D_NgpCYl.d.cts} +2 -2
- package/dist/{index-D_CyR6xm.d.cts → index-DhZ1HRGx.d.cts} +10 -10
- package/dist/{index-BqfmtmEV.d.cts → index-DoqBHDfl.d.cts} +13 -13
- package/dist/{index-DAM-D9Cw.d.ts → index-DpJNA3eO.d.cts} +3 -1
- package/dist/{index-yic5OK6z.d.cts → index-DqS7uebC.d.cts} +10 -10
- package/dist/{index-B9S3H-6J.d.ts → index-DwdOquui.d.ts} +57 -58
- package/dist/{index-DUS1-CMU.d.cts → index-Kn7eCDZV.d.cts} +10 -10
- package/dist/{index-Dd1ffzzA.d.ts → index-LMjNUjE8.d.ts} +4 -4
- package/dist/{index-BGjDkvdo.d.cts → index-QNRysS6_.d.cts} +1489 -1672
- package/dist/{index-C0pFvDmG.d.cts → index-W2n9KTbf.d.ts} +1948 -2227
- package/dist/{index-CvRBCe6q.d.ts → index-XiwsMOUd.d.ts} +36 -36
- package/dist/{index-CMe7EykX.d.ts → index-Z1_iBLE4.d.ts} +7 -7
- package/dist/{index-gFOnZNib.d.ts → index-gcoxJpDo.d.cts} +1855 -2134
- package/dist/{index-Bk5OXyUg.d.cts → index-sxpLmssb.d.cts} +1 -1
- package/dist/index.cjs +28 -27
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +6 -6
- package/dist/index.js +20 -19
- package/dist/integrations/next-js.cjs +5 -4
- package/dist/integrations/next-js.js +5 -4
- package/dist/integrations/node.d.cts +2 -2
- package/dist/integrations/node.d.ts +4 -4
- package/dist/integrations/react-start.cjs +5 -4
- package/dist/integrations/react-start.js +5 -4
- package/dist/integrations/svelte-kit.cjs +5 -4
- package/dist/integrations/svelte-kit.d.cts +2 -2
- package/dist/integrations/svelte-kit.d.ts +4 -4
- package/dist/integrations/svelte-kit.js +5 -4
- package/dist/jwt-C3JWvMfo.js +94 -0
- package/dist/jwt-DgRU65bf.cjs +121 -0
- package/dist/{jwt-DvuL40-q.cjs → jwt-DqdEtw92.cjs} +4 -4
- package/dist/{jwt-2W7QW_0l.js → jwt-G7WltW3o.js} +4 -4
- package/dist/{kysely-adapter-CRd7C98k.cjs → kysely-adapter-BE-zs6Gh.cjs} +3 -3
- package/dist/{kysely-adapter-Raw4YS5F.js → kysely-adapter-DQY6NIKH.js} +3 -3
- package/dist/{magic-link-sK6PyR1P.cjs → magic-link-BZLAQOx-.cjs} +5 -5
- package/dist/{magic-link-DapoBSZo.js → magic-link-CyPvFzf0.js} +4 -4
- package/dist/{memory-adapter-Cd7XB1KM.cjs → memory-adapter-DO_caohB.cjs} +1 -1
- package/dist/{memory-adapter-DUlbdoJe.js → memory-adapter-tLMRY7TW.js} +1 -1
- package/dist/{mongodb-adapter-Cplt9kk7.cjs → mongodb-adapter-ChuDGRs7.cjs} +1 -1
- package/dist/{mongodb-adapter-BuGGSrtp.js → mongodb-adapter-Clt3oWq7.js} +1 -1
- package/dist/{multi-session-BNddUjFx.js → multi-session-B317g8nV.js} +3 -3
- package/dist/{multi-session-Bttq6Dk8.cjs → multi-session-Bi1k2K_X.cjs} +2 -2
- package/dist/{oauth-proxy-B5aRoZkb.js → oauth-proxy-CV3g5XLc.js} +3 -3
- package/dist/{oauth-proxy-CYovlEOY.cjs → oauth-proxy-gFSXFBFl.cjs} +3 -3
- package/dist/oauth2/index.cjs +15 -14
- package/dist/oauth2/index.d.cts +6 -6
- package/dist/oauth2/index.d.ts +8 -8
- package/dist/oauth2/index.js +15 -14
- package/dist/{oidc-provider-DG6mR-lu.js → oidc-provider-CLCJRq4n.js} +114 -114
- package/dist/{oidc-provider-5sES_06H.cjs → oidc-provider-DitWgVUb.cjs} +115 -115
- package/dist/{one-tap-C1q5Xvxq.js → one-tap-CCvXDEdf.js} +2 -2
- package/dist/{one-tap-BIV-N3rL.cjs → one-tap-CUw4929K.cjs} +1 -1
- package/dist/{open-api-DzIRvxPd.js → open-api-AR1ONhyG.js} +2 -2
- package/dist/{open-api-CWzVb29I.cjs → open-api-C_PgZdLL.cjs} +2 -2
- package/dist/{organization-Cz6DO2Gm.js → organization-4iUlQbV0.js} +2438 -2448
- package/dist/{organization-Dd25_EH3.cjs → organization-CSylXbyc.cjs} +2476 -2492
- package/dist/permission-BErHURBU.js +15 -0
- package/dist/permission-CoOqrICL.cjs +27 -0
- package/dist/{phone-number-5snPnXW1.cjs → phone-number-47T7eZcV.cjs} +8 -8
- package/dist/{phone-number-BuORpYMF.js → phone-number-Djb7i5kX.js} +4 -4
- package/dist/plugins/access/index.cjs +1 -1
- package/dist/plugins/access/index.d.cts +1 -1
- package/dist/plugins/access/index.d.ts +2 -2
- package/dist/plugins/access/index.js +1 -1
- package/dist/plugins/admin/access/index.cjs +2 -2
- package/dist/plugins/admin/access/index.d.cts +1 -1
- package/dist/plugins/admin/access/index.d.ts +2 -2
- package/dist/plugins/admin/access/index.js +2 -2
- package/dist/plugins/admin/index.cjs +20 -19
- package/dist/plugins/admin/index.d.cts +5 -6
- package/dist/plugins/admin/index.d.ts +7 -8
- package/dist/plugins/admin/index.js +20 -19
- package/dist/plugins/anonymous/index.cjs +16 -15
- package/dist/plugins/anonymous/index.d.cts +3 -3
- package/dist/plugins/anonymous/index.d.ts +5 -5
- package/dist/plugins/anonymous/index.js +16 -15
- package/dist/plugins/bearer/index.cjs +6 -5
- package/dist/plugins/bearer/index.d.cts +1 -1
- package/dist/plugins/bearer/index.d.ts +1 -1
- package/dist/plugins/bearer/index.js +6 -5
- package/dist/plugins/captcha/index.cjs +1 -1
- package/dist/plugins/captcha/index.d.cts +1 -1
- package/dist/plugins/captcha/index.d.ts +1 -1
- package/dist/plugins/captcha/index.js +1 -1
- package/dist/plugins/custom-session/index.cjs +17 -16
- package/dist/plugins/custom-session/index.d.cts +3 -3
- package/dist/plugins/custom-session/index.d.ts +5 -5
- package/dist/plugins/custom-session/index.js +17 -16
- package/dist/plugins/device-authorization/index.cjs +16 -15
- package/dist/plugins/device-authorization/index.d.cts +2 -2
- package/dist/plugins/device-authorization/index.d.ts +3 -3
- package/dist/plugins/device-authorization/index.js +16 -15
- package/dist/plugins/email-otp/index.cjs +17 -16
- package/dist/plugins/email-otp/index.d.cts +1 -2
- package/dist/plugins/email-otp/index.d.ts +1 -2
- package/dist/plugins/email-otp/index.js +17 -16
- package/dist/plugins/generic-oauth/index.cjs +16 -15
- package/dist/plugins/generic-oauth/index.d.cts +3 -3
- package/dist/plugins/generic-oauth/index.d.ts +5 -5
- package/dist/plugins/generic-oauth/index.js +16 -15
- package/dist/plugins/haveibeenpwned/index.cjs +16 -15
- package/dist/plugins/haveibeenpwned/index.d.cts +1 -1
- package/dist/plugins/haveibeenpwned/index.d.ts +1 -1
- package/dist/plugins/haveibeenpwned/index.js +16 -15
- package/dist/plugins/index.cjs +51 -50
- package/dist/plugins/index.d.cts +143 -146
- package/dist/plugins/index.d.ts +145 -148
- package/dist/plugins/index.js +48 -47
- package/dist/plugins/jwt/index.cjs +18 -17
- package/dist/plugins/jwt/index.d.cts +3 -3
- package/dist/plugins/jwt/index.d.ts +5 -5
- package/dist/plugins/jwt/index.js +17 -16
- package/dist/plugins/magic-link/index.cjs +16 -15
- package/dist/plugins/magic-link/index.d.cts +1 -1
- package/dist/plugins/magic-link/index.d.ts +1 -1
- package/dist/plugins/magic-link/index.js +16 -15
- package/dist/plugins/multi-session/index.cjs +16 -15
- package/dist/plugins/multi-session/index.d.cts +1 -3
- package/dist/plugins/multi-session/index.d.ts +1 -3
- package/dist/plugins/multi-session/index.js +16 -15
- package/dist/plugins/oauth-proxy/index.cjs +16 -15
- package/dist/plugins/oauth-proxy/index.d.cts +1 -1
- package/dist/plugins/oauth-proxy/index.d.ts +1 -1
- package/dist/plugins/oauth-proxy/index.js +16 -15
- package/dist/plugins/oidc-provider/index.cjs +17 -16
- package/dist/plugins/oidc-provider/index.d.cts +3 -3
- package/dist/plugins/oidc-provider/index.d.ts +5 -5
- package/dist/plugins/oidc-provider/index.js +17 -16
- package/dist/plugins/one-tap/index.cjs +16 -15
- package/dist/plugins/one-tap/index.d.cts +1 -1
- package/dist/plugins/one-tap/index.d.ts +1 -1
- package/dist/plugins/one-tap/index.js +16 -15
- package/dist/plugins/one-time-token/index.cjs +48 -47
- package/dist/plugins/one-time-token/index.d.cts +3 -3
- package/dist/plugins/one-time-token/index.d.ts +5 -5
- package/dist/plugins/one-time-token/index.js +48 -47
- package/dist/plugins/open-api/index.cjs +16 -15
- package/dist/plugins/open-api/index.d.cts +1 -1
- package/dist/plugins/open-api/index.d.ts +2 -2
- package/dist/plugins/open-api/index.js +16 -15
- package/dist/plugins/organization/access/index.cjs +2 -2
- package/dist/plugins/organization/access/index.d.cts +2 -2
- package/dist/plugins/organization/access/index.d.ts +3 -3
- package/dist/plugins/organization/access/index.js +2 -2
- package/dist/plugins/organization/index.cjs +20 -19
- package/dist/plugins/organization/index.d.cts +5 -8
- package/dist/plugins/organization/index.d.ts +7 -10
- package/dist/plugins/organization/index.js +20 -19
- package/dist/plugins/passkey/index.cjs +16 -15
- package/dist/plugins/passkey/index.d.cts +2 -2
- package/dist/plugins/passkey/index.d.ts +3 -3
- package/dist/plugins/passkey/index.js +15 -14
- package/dist/plugins/phone-number/index.cjs +16 -15
- package/dist/plugins/phone-number/index.d.cts +3 -3
- package/dist/plugins/phone-number/index.d.ts +5 -5
- package/dist/plugins/phone-number/index.js +16 -15
- package/dist/plugins/siwe/index.cjs +16 -15
- package/dist/plugins/siwe/index.d.cts +3 -3
- package/dist/plugins/siwe/index.d.ts +5 -5
- package/dist/plugins/siwe/index.js +16 -15
- package/dist/plugins/two-factor/index.cjs +18 -17
- package/dist/plugins/two-factor/index.d.cts +3 -3
- package/dist/plugins/two-factor/index.d.ts +5 -5
- package/dist/plugins/two-factor/index.js +18 -17
- package/dist/plugins/username/index.cjs +16 -15
- package/dist/plugins/username/index.d.cts +2 -2
- package/dist/plugins/username/index.d.ts +3 -3
- package/dist/plugins/username/index.js +16 -15
- package/dist/{plugins-BbSF_Pek.d.ts → plugins-CNbINopZ.d.ts} +1 -1
- package/dist/{plugins-BvfmdVWp.cjs → plugins-DENcQRq4.cjs} +308 -308
- package/dist/{plugins-C57Wvgvy.js → plugins-tQjHXAEN.js} +305 -305
- package/dist/{proxy-D4B6B6z4.js → proxy-CmkyvsnU.js} +25 -25
- package/dist/{proxy-Bur4Ci41.cjs → proxy-gIDmLZ23.cjs} +25 -25
- package/dist/{session-D5q1XDfx.cjs → session-EGLsa9Cq.cjs} +56 -17
- package/dist/{session-BqpHJ0z-.js → session-KVBx5OXb.js} +54 -15
- package/dist/{sign-0t1-RJB5.js → sign-BIyc0J4i.js} +1 -1
- package/dist/{sign-KfLOKIQS.cjs → sign-C89ROO81.cjs} +1 -1
- package/dist/{siwe-BbVRRyiy.cjs → siwe-3ynf9Hk_.cjs} +20 -20
- package/dist/{siwe-CspaUlkq.js → siwe-gspY_c_7.js} +20 -20
- package/dist/test-utils/index.cjs +8987 -8986
- package/dist/test-utils/index.d.cts +36 -37
- package/dist/test-utils/index.d.ts +34 -35
- package/dist/test-utils/index.js +8987 -8986
- package/dist/{two-factor-1UxFwVuo.cjs → two-factor-BUkoJUwH.cjs} +41 -41
- package/dist/{two-factor-BiVGRW-E.js → two-factor-DnUCUeLb.js} +39 -39
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +4 -4
- package/dist/types/index.js +1 -1
- package/dist/{url-GPfV0MFh.cjs → url-CADm8geO.cjs} +1 -1
- package/dist/{url-B43v92M_.js → url-DqQShdt9.js} +1 -1
- package/dist/{username-QS3MZXwm.js → username-6N3y2cwf.js} +16 -16
- package/dist/{username-DW7xzEDM.cjs → username-lM70aTDS.cjs} +17 -17
- package/dist/{utils-CyWxqQlM.cjs → utils-BWorSjpq.cjs} +12 -12
- package/dist/{utils-C86NQnwF.js → utils-CrGREH-c.js} +13 -13
- package/dist/{vanilla-CjDGO-xN.cjs → vanilla-CId-xDns.cjs} +2 -2
- package/dist/{vanilla-io0ilbFf.js → vanilla-oRn8zblc.js} +2 -2
- package/package.json +6 -5
- package/dist/index-DlDw_Wj7.d.cts +0 -36
- package/dist/init-options-VvQwsOfO.d.cts +0 -4881
- package/dist/init-options-bKXqGECK.d.ts +0 -4882
- package/dist/session-C4KIPzRe.d.ts +0 -21
- package/dist/session-FTqk_ucC.d.cts +0 -21
- package/dist/types-9O9RA1so.cjs +0 -0
- package/dist/types-Bkw-9vBe.js +0 -1
- package/dist/user-BckRO-VN.d.ts +0 -20
- package/dist/user-DcGEK64L.d.cts +0 -20
- /package/dist/{access-CvCBdssC.js → access-BEuU6R79.js} +0 -0
- /package/dist/{access-KlwyAJUG.cjs → access-BLwdGGDJ.cjs} +0 -0
- /package/dist/{bun-sqlite-dialect-Di0S2xW4.js → bun-sqlite-dialect-19FWyoCu.js} +0 -0
- /package/dist/{bun-sqlite-dialect-DWe97FcN.cjs → bun-sqlite-dialect-CDy1mm9D.cjs} +0 -0
- /package/dist/{client-BgeEbVdf.js → client-BDyugzk9.js} +0 -0
- /package/dist/{client-D9BvKRI6.cjs → client-BuXfVfp7.cjs} +0 -0
- /package/dist/{client-BgV-MZs1.cjs → client-CdgpGQaK.cjs} +0 -0
- /package/dist/{client-CPRUKMwz.js → client-D-TSCG4M.js} +0 -0
- /package/dist/{client-Cp9AJdg5.js → client-DvRBxKYL.js} +0 -0
- /package/dist/{client-Nf2zsTdY.cjs → client-PGwhle1j.cjs} +0 -0
- /package/dist/{haveibeenpwned-g1qbSmgu.cjs → haveibeenpwned-n7QeG9ZS.cjs} +0 -0
- /package/dist/{helper-DciwSp4h.d.ts → helper-DHVUEBjl.d.ts} +0 -0
- /package/dist/{index-CCggO_hw.d.ts → index-9e6p7TFv.d.ts} +0 -0
- /package/dist/{index-D2HUTZ-d.d.cts → index-_1bfRgi2.d.cts} +0 -0
- /package/dist/{json-Cao-wnuS.cjs → json-CSNVAYvC.cjs} +0 -0
- /package/dist/{json-C3L9IMZ_.js → json-rUsZ9vGt.js} +0 -0
- /package/dist/{misc-Qf_w3crA.cjs → misc-BRSAgnve.cjs} +0 -0
- /package/dist/{misc-iq1wY9b6.js → misc-C0Kg4w6i.js} +0 -0
- /package/dist/{node-sqlite-dialect-qAUNq0lI.js → node-sqlite-dialect-CmwmRgW4.js} +0 -0
- /package/dist/{node-sqlite-dialect-Bfd3-YTX.cjs → node-sqlite-dialect-Uo19ydNx.cjs} +0 -0
- /package/dist/{parser-B3VysIjg.cjs → parser-Cv8gMvb_.cjs} +0 -0
- /package/dist/{parser-CtHEE8Bt.js → parser-LnIuhyfR.js} +0 -0
- /package/dist/{password-yMNRDQKB.js → password-B8hrwTWa.js} +0 -0
- /package/dist/{password-C3iUi9QC.cjs → password-bcNraGUR.cjs} +0 -0
- /package/dist/{plugin-helper-Ew7TUVuj.cjs → plugin-helper-BTYwL00A.cjs} +0 -0
- /package/dist/{plugin-helper-CaHV6HPJ.js → plugin-helper-CGhaPhDN.js} +0 -0
- /package/dist/{plugins-Bda65QeL.d.cts → plugins-SWFijFQL.d.cts} +0 -0
- /package/dist/{types-DMBaPPuG.d.ts → types-4dCicFIY.d.ts} +0 -0
- /package/dist/{organization-DRrjcP8j.js → types-D97IFTaH.js} +0 -0
- /package/dist/{organization-CLBgwBBZ.cjs → types-DDfu9blO.cjs} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
1
|
+
import { g as User$1, h as Session$1 } from "./index-QNRysS6_.cjs";
|
|
2
|
+
import { t as InferOptionSchema } from "./plugins-SWFijFQL.cjs";
|
|
3
|
+
import { a as Role, i as AccessControl, o as Statements } from "./index-sxpLmssb.cjs";
|
|
4
|
+
import * as _better_auth_core30 from "@better-auth/core";
|
|
5
|
+
import * as _better_auth_core_db21 from "@better-auth/core/db";
|
|
6
|
+
import * as better_call656 from "better-call";
|
|
7
7
|
import * as z from "zod";
|
|
8
8
|
|
|
9
9
|
//#region src/plugins/admin/schema.d.ts
|
|
@@ -45,13 +45,13 @@ declare const schema: {
|
|
|
45
45
|
type AdminSchema = typeof schema;
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/plugins/admin/types.d.ts
|
|
48
|
-
interface UserWithRole extends User {
|
|
48
|
+
interface UserWithRole extends User$1 {
|
|
49
49
|
role?: string;
|
|
50
50
|
banned?: boolean | null;
|
|
51
51
|
banReason?: string | null;
|
|
52
52
|
banExpires?: Date | null;
|
|
53
53
|
}
|
|
54
|
-
interface SessionWithImpersonatedBy extends Session {
|
|
54
|
+
interface SessionWithImpersonatedBy extends Session$1 {
|
|
55
55
|
impersonatedBy?: string;
|
|
56
56
|
}
|
|
57
57
|
interface AdminOptions {
|
|
@@ -114,9 +114,9 @@ interface AdminOptions {
|
|
|
114
114
|
*/
|
|
115
115
|
bannedUserMessage?: string;
|
|
116
116
|
}
|
|
117
|
-
type InferAdminRolesFromOption<O
|
|
117
|
+
type InferAdminRolesFromOption<O extends AdminOptions | undefined> = O extends {
|
|
118
118
|
roles: Record<string, unknown>;
|
|
119
|
-
} ? keyof O
|
|
119
|
+
} ? keyof O["roles"] : "user" | "admin";
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/plugins/admin/admin.d.ts
|
|
122
122
|
declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
@@ -159,7 +159,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
159
159
|
token: string;
|
|
160
160
|
ipAddress?: string | null | undefined;
|
|
161
161
|
userAgent?: string | null | undefined;
|
|
162
|
-
} & Record<string, unknown>, ctx:
|
|
162
|
+
} & Record<string, unknown>, ctx: _better_auth_core30.GenericEndpointContext | undefined): Promise<void>;
|
|
163
163
|
};
|
|
164
164
|
};
|
|
165
165
|
};
|
|
@@ -167,8 +167,8 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
167
167
|
};
|
|
168
168
|
hooks: {
|
|
169
169
|
after: {
|
|
170
|
-
matcher(context:
|
|
171
|
-
handler: (inputContext:
|
|
170
|
+
matcher(context: _better_auth_core30.HookEndpointContext): boolean;
|
|
171
|
+
handler: (inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<SessionWithImpersonatedBy[] | undefined>;
|
|
172
172
|
}[];
|
|
173
173
|
};
|
|
174
174
|
endpoints: {
|
|
@@ -187,17 +187,17 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
187
187
|
*
|
|
188
188
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-set-role)
|
|
189
189
|
*/
|
|
190
|
-
setRole:
|
|
190
|
+
setRole: better_call656.StrictEndpoint<"/admin/set-role", {
|
|
191
191
|
method: "POST";
|
|
192
192
|
body: z.ZodObject<{
|
|
193
193
|
userId: z.ZodCoercedString<unknown>;
|
|
194
194
|
role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
|
|
195
195
|
}, z.core.$strip>;
|
|
196
196
|
requireHeaders: true;
|
|
197
|
-
use: ((inputContext:
|
|
197
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
198
198
|
session: {
|
|
199
199
|
user: UserWithRole;
|
|
200
|
-
session: Session;
|
|
200
|
+
session: Session$1;
|
|
201
201
|
};
|
|
202
202
|
}>)[];
|
|
203
203
|
metadata: {
|
|
@@ -235,15 +235,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
235
235
|
}, {
|
|
236
236
|
user: UserWithRole;
|
|
237
237
|
}>;
|
|
238
|
-
getUser:
|
|
238
|
+
getUser: better_call656.StrictEndpoint<"/admin/get-user", {
|
|
239
239
|
method: "GET";
|
|
240
240
|
query: z.ZodObject<{
|
|
241
241
|
id: z.ZodString;
|
|
242
242
|
}, z.core.$strip>;
|
|
243
|
-
use: ((inputContext:
|
|
243
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
244
244
|
session: {
|
|
245
245
|
user: UserWithRole;
|
|
246
|
-
session: Session;
|
|
246
|
+
session: Session$1;
|
|
247
247
|
};
|
|
248
248
|
}>)[];
|
|
249
249
|
metadata: {
|
|
@@ -296,7 +296,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
296
296
|
*
|
|
297
297
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-create-user)
|
|
298
298
|
*/
|
|
299
|
-
createUser:
|
|
299
|
+
createUser: better_call656.StrictEndpoint<"/admin/create-user", {
|
|
300
300
|
method: "POST";
|
|
301
301
|
body: z.ZodObject<{
|
|
302
302
|
email: z.ZodString;
|
|
@@ -358,16 +358,16 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
358
358
|
*
|
|
359
359
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-update-user)
|
|
360
360
|
*/
|
|
361
|
-
adminUpdateUser:
|
|
361
|
+
adminUpdateUser: better_call656.StrictEndpoint<"/admin/update-user", {
|
|
362
362
|
method: "POST";
|
|
363
363
|
body: z.ZodObject<{
|
|
364
364
|
userId: z.ZodCoercedString<unknown>;
|
|
365
365
|
data: z.ZodRecord<z.ZodAny, z.ZodAny>;
|
|
366
366
|
}, z.core.$strip>;
|
|
367
|
-
use: ((inputContext:
|
|
367
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
368
368
|
session: {
|
|
369
369
|
user: UserWithRole;
|
|
370
|
-
session: Session;
|
|
370
|
+
session: Session$1;
|
|
371
371
|
};
|
|
372
372
|
}>)[];
|
|
373
373
|
metadata: {
|
|
@@ -397,12 +397,12 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
397
397
|
} & {
|
|
398
398
|
use: any[];
|
|
399
399
|
}, UserWithRole>;
|
|
400
|
-
listUsers:
|
|
400
|
+
listUsers: better_call656.StrictEndpoint<"/admin/list-users", {
|
|
401
401
|
method: "GET";
|
|
402
|
-
use: ((inputContext:
|
|
402
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
403
403
|
session: {
|
|
404
404
|
user: UserWithRole;
|
|
405
|
-
session: Session;
|
|
405
|
+
session: Session$1;
|
|
406
406
|
};
|
|
407
407
|
}>)[];
|
|
408
408
|
query: z.ZodObject<{
|
|
@@ -498,12 +498,12 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
498
498
|
*
|
|
499
499
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-list-user-sessions)
|
|
500
500
|
*/
|
|
501
|
-
listUserSessions:
|
|
501
|
+
listUserSessions: better_call656.StrictEndpoint<"/admin/list-user-sessions", {
|
|
502
502
|
method: "POST";
|
|
503
|
-
use: ((inputContext:
|
|
503
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
504
504
|
session: {
|
|
505
505
|
user: UserWithRole;
|
|
506
|
-
session: Session;
|
|
506
|
+
session: Session$1;
|
|
507
507
|
};
|
|
508
508
|
}>)[];
|
|
509
509
|
body: z.ZodObject<{
|
|
@@ -556,15 +556,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
556
556
|
*
|
|
557
557
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-unban-user)
|
|
558
558
|
*/
|
|
559
|
-
unbanUser:
|
|
559
|
+
unbanUser: better_call656.StrictEndpoint<"/admin/unban-user", {
|
|
560
560
|
method: "POST";
|
|
561
561
|
body: z.ZodObject<{
|
|
562
562
|
userId: z.ZodCoercedString<unknown>;
|
|
563
563
|
}, z.core.$strip>;
|
|
564
|
-
use: ((inputContext:
|
|
564
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
565
565
|
session: {
|
|
566
566
|
user: UserWithRole;
|
|
567
|
-
session: Session;
|
|
567
|
+
session: Session$1;
|
|
568
568
|
};
|
|
569
569
|
}>)[];
|
|
570
570
|
metadata: {
|
|
@@ -611,17 +611,17 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
611
611
|
*
|
|
612
612
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-ban-user)
|
|
613
613
|
*/
|
|
614
|
-
banUser:
|
|
614
|
+
banUser: better_call656.StrictEndpoint<"/admin/ban-user", {
|
|
615
615
|
method: "POST";
|
|
616
616
|
body: z.ZodObject<{
|
|
617
617
|
userId: z.ZodCoercedString<unknown>;
|
|
618
618
|
banReason: z.ZodOptional<z.ZodString>;
|
|
619
619
|
banExpiresIn: z.ZodOptional<z.ZodNumber>;
|
|
620
620
|
}, z.core.$strip>;
|
|
621
|
-
use: ((inputContext:
|
|
621
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
622
622
|
session: {
|
|
623
623
|
user: UserWithRole;
|
|
624
|
-
session: Session;
|
|
624
|
+
session: Session$1;
|
|
625
625
|
};
|
|
626
626
|
}>)[];
|
|
627
627
|
metadata: {
|
|
@@ -668,15 +668,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
668
668
|
*
|
|
669
669
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-impersonate-user)
|
|
670
670
|
*/
|
|
671
|
-
impersonateUser:
|
|
671
|
+
impersonateUser: better_call656.StrictEndpoint<"/admin/impersonate-user", {
|
|
672
672
|
method: "POST";
|
|
673
673
|
body: z.ZodObject<{
|
|
674
674
|
userId: z.ZodCoercedString<unknown>;
|
|
675
675
|
}, z.core.$strip>;
|
|
676
|
-
use: ((inputContext:
|
|
676
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
677
677
|
session: {
|
|
678
678
|
user: UserWithRole;
|
|
679
|
-
session: Session;
|
|
679
|
+
session: Session$1;
|
|
680
680
|
};
|
|
681
681
|
}>)[];
|
|
682
682
|
metadata: {
|
|
@@ -744,14 +744,14 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
744
744
|
*
|
|
745
745
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-stop-impersonating)
|
|
746
746
|
*/
|
|
747
|
-
stopImpersonating:
|
|
747
|
+
stopImpersonating: better_call656.StrictEndpoint<"/admin/stop-impersonating", {
|
|
748
748
|
method: "POST";
|
|
749
749
|
requireHeaders: true;
|
|
750
750
|
} & {
|
|
751
751
|
use: any[];
|
|
752
752
|
}, {
|
|
753
|
-
session: Session & Record<string, any>;
|
|
754
|
-
user: User
|
|
753
|
+
session: Session$1 & Record<string, any>;
|
|
754
|
+
user: _better_auth_core_db21.User & Record<string, any>;
|
|
755
755
|
}>;
|
|
756
756
|
/**
|
|
757
757
|
* ### Endpoint
|
|
@@ -768,15 +768,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
768
768
|
*
|
|
769
769
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-revoke-user-session)
|
|
770
770
|
*/
|
|
771
|
-
revokeUserSession:
|
|
771
|
+
revokeUserSession: better_call656.StrictEndpoint<"/admin/revoke-user-session", {
|
|
772
772
|
method: "POST";
|
|
773
773
|
body: z.ZodObject<{
|
|
774
774
|
sessionToken: z.ZodString;
|
|
775
775
|
}, z.core.$strip>;
|
|
776
|
-
use: ((inputContext:
|
|
776
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
777
777
|
session: {
|
|
778
778
|
user: UserWithRole;
|
|
779
|
-
session: Session;
|
|
779
|
+
session: Session$1;
|
|
780
780
|
};
|
|
781
781
|
}>)[];
|
|
782
782
|
metadata: {
|
|
@@ -823,15 +823,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
823
823
|
*
|
|
824
824
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-revoke-user-sessions)
|
|
825
825
|
*/
|
|
826
|
-
revokeUserSessions:
|
|
826
|
+
revokeUserSessions: better_call656.StrictEndpoint<"/admin/revoke-user-sessions", {
|
|
827
827
|
method: "POST";
|
|
828
828
|
body: z.ZodObject<{
|
|
829
829
|
userId: z.ZodCoercedString<unknown>;
|
|
830
830
|
}, z.core.$strip>;
|
|
831
|
-
use: ((inputContext:
|
|
831
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
832
832
|
session: {
|
|
833
833
|
user: UserWithRole;
|
|
834
|
-
session: Session;
|
|
834
|
+
session: Session$1;
|
|
835
835
|
};
|
|
836
836
|
}>)[];
|
|
837
837
|
metadata: {
|
|
@@ -878,15 +878,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
878
878
|
*
|
|
879
879
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-remove-user)
|
|
880
880
|
*/
|
|
881
|
-
removeUser:
|
|
881
|
+
removeUser: better_call656.StrictEndpoint<"/admin/remove-user", {
|
|
882
882
|
method: "POST";
|
|
883
883
|
body: z.ZodObject<{
|
|
884
884
|
userId: z.ZodCoercedString<unknown>;
|
|
885
885
|
}, z.core.$strip>;
|
|
886
|
-
use: ((inputContext:
|
|
886
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
887
887
|
session: {
|
|
888
888
|
user: UserWithRole;
|
|
889
|
-
session: Session;
|
|
889
|
+
session: Session$1;
|
|
890
890
|
};
|
|
891
891
|
}>)[];
|
|
892
892
|
metadata: {
|
|
@@ -933,16 +933,16 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
933
933
|
*
|
|
934
934
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-set-user-password)
|
|
935
935
|
*/
|
|
936
|
-
setUserPassword:
|
|
936
|
+
setUserPassword: better_call656.StrictEndpoint<"/admin/set-user-password", {
|
|
937
937
|
method: "POST";
|
|
938
938
|
body: z.ZodObject<{
|
|
939
939
|
newPassword: z.ZodString;
|
|
940
940
|
userId: z.ZodCoercedString<unknown>;
|
|
941
941
|
}, z.core.$strip>;
|
|
942
|
-
use: ((inputContext:
|
|
942
|
+
use: ((inputContext: better_call656.MiddlewareInputContext<better_call656.MiddlewareOptions>) => Promise<{
|
|
943
943
|
session: {
|
|
944
944
|
user: UserWithRole;
|
|
945
|
-
session: Session;
|
|
945
|
+
session: Session$1;
|
|
946
946
|
};
|
|
947
947
|
}>)[];
|
|
948
948
|
metadata: {
|
|
@@ -989,7 +989,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
989
989
|
*
|
|
990
990
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-has-permission)
|
|
991
991
|
*/
|
|
992
|
-
userHasPermission:
|
|
992
|
+
userHasPermission: better_call656.StrictEndpoint<"/admin/has-permission", {
|
|
993
993
|
method: "POST";
|
|
994
994
|
body: z.ZodIntersection<z.ZodObject<{
|
|
995
995
|
userId: z.ZodOptional<z.ZodCoercedString<unknown>>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
import * as better_call656 from "better-call";
|
|
1
|
+
import { g as User$1, h as Session$1 } from "./index-DDnRSsbC.js";
|
|
2
|
+
import { t as InferOptionSchema } from "./plugins-CNbINopZ.js";
|
|
3
|
+
import { a as Role, i as AccessControl, o as Statements } from "./index-C6skfuJu.js";
|
|
4
|
+
import * as _better_auth_core27 from "@better-auth/core";
|
|
5
|
+
import * as better_call626 from "better-call";
|
|
7
6
|
import * as z$1 from "zod";
|
|
7
|
+
import * as _better_auth_core_db10 from "@better-auth/core/db";
|
|
8
8
|
|
|
9
9
|
//#region src/plugins/admin/schema.d.ts
|
|
10
10
|
declare const schema: {
|
|
@@ -45,13 +45,13 @@ declare const schema: {
|
|
|
45
45
|
type AdminSchema = typeof schema;
|
|
46
46
|
//#endregion
|
|
47
47
|
//#region src/plugins/admin/types.d.ts
|
|
48
|
-
interface UserWithRole extends User {
|
|
48
|
+
interface UserWithRole extends User$1 {
|
|
49
49
|
role?: string;
|
|
50
50
|
banned?: boolean | null;
|
|
51
51
|
banReason?: string | null;
|
|
52
52
|
banExpires?: Date | null;
|
|
53
53
|
}
|
|
54
|
-
interface SessionWithImpersonatedBy extends Session {
|
|
54
|
+
interface SessionWithImpersonatedBy extends Session$1 {
|
|
55
55
|
impersonatedBy?: string;
|
|
56
56
|
}
|
|
57
57
|
interface AdminOptions {
|
|
@@ -114,9 +114,9 @@ interface AdminOptions {
|
|
|
114
114
|
*/
|
|
115
115
|
bannedUserMessage?: string;
|
|
116
116
|
}
|
|
117
|
-
type InferAdminRolesFromOption<O
|
|
117
|
+
type InferAdminRolesFromOption<O extends AdminOptions | undefined> = O extends {
|
|
118
118
|
roles: Record<string, unknown>;
|
|
119
|
-
} ? keyof O
|
|
119
|
+
} ? keyof O["roles"] : "user" | "admin";
|
|
120
120
|
//#endregion
|
|
121
121
|
//#region src/plugins/admin/admin.d.ts
|
|
122
122
|
declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
@@ -159,7 +159,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
159
159
|
token: string;
|
|
160
160
|
ipAddress?: string | null | undefined;
|
|
161
161
|
userAgent?: string | null | undefined;
|
|
162
|
-
} & Record<string, unknown>, ctx:
|
|
162
|
+
} & Record<string, unknown>, ctx: _better_auth_core27.GenericEndpointContext | undefined): Promise<void>;
|
|
163
163
|
};
|
|
164
164
|
};
|
|
165
165
|
};
|
|
@@ -167,8 +167,8 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
167
167
|
};
|
|
168
168
|
hooks: {
|
|
169
169
|
after: {
|
|
170
|
-
matcher(context:
|
|
171
|
-
handler: (inputContext:
|
|
170
|
+
matcher(context: _better_auth_core27.HookEndpointContext): boolean;
|
|
171
|
+
handler: (inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<SessionWithImpersonatedBy[] | undefined>;
|
|
172
172
|
}[];
|
|
173
173
|
};
|
|
174
174
|
endpoints: {
|
|
@@ -187,17 +187,17 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
187
187
|
*
|
|
188
188
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-set-role)
|
|
189
189
|
*/
|
|
190
|
-
setRole:
|
|
190
|
+
setRole: better_call626.StrictEndpoint<"/admin/set-role", {
|
|
191
191
|
method: "POST";
|
|
192
192
|
body: z$1.ZodObject<{
|
|
193
193
|
userId: z$1.ZodCoercedString<unknown>;
|
|
194
194
|
role: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodArray<z$1.ZodString>]>;
|
|
195
195
|
}, z$1.core.$strip>;
|
|
196
196
|
requireHeaders: true;
|
|
197
|
-
use: ((inputContext:
|
|
197
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
198
198
|
session: {
|
|
199
199
|
user: UserWithRole;
|
|
200
|
-
session: Session;
|
|
200
|
+
session: Session$1;
|
|
201
201
|
};
|
|
202
202
|
}>)[];
|
|
203
203
|
metadata: {
|
|
@@ -235,15 +235,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
235
235
|
}, {
|
|
236
236
|
user: UserWithRole;
|
|
237
237
|
}>;
|
|
238
|
-
getUser:
|
|
238
|
+
getUser: better_call626.StrictEndpoint<"/admin/get-user", {
|
|
239
239
|
method: "GET";
|
|
240
240
|
query: z$1.ZodObject<{
|
|
241
241
|
id: z$1.ZodString;
|
|
242
242
|
}, z$1.core.$strip>;
|
|
243
|
-
use: ((inputContext:
|
|
243
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
244
244
|
session: {
|
|
245
245
|
user: UserWithRole;
|
|
246
|
-
session: Session;
|
|
246
|
+
session: Session$1;
|
|
247
247
|
};
|
|
248
248
|
}>)[];
|
|
249
249
|
metadata: {
|
|
@@ -296,7 +296,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
296
296
|
*
|
|
297
297
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-create-user)
|
|
298
298
|
*/
|
|
299
|
-
createUser:
|
|
299
|
+
createUser: better_call626.StrictEndpoint<"/admin/create-user", {
|
|
300
300
|
method: "POST";
|
|
301
301
|
body: z$1.ZodObject<{
|
|
302
302
|
email: z$1.ZodString;
|
|
@@ -358,16 +358,16 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
358
358
|
*
|
|
359
359
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-update-user)
|
|
360
360
|
*/
|
|
361
|
-
adminUpdateUser:
|
|
361
|
+
adminUpdateUser: better_call626.StrictEndpoint<"/admin/update-user", {
|
|
362
362
|
method: "POST";
|
|
363
363
|
body: z$1.ZodObject<{
|
|
364
364
|
userId: z$1.ZodCoercedString<unknown>;
|
|
365
365
|
data: z$1.ZodRecord<z$1.ZodAny, z$1.ZodAny>;
|
|
366
366
|
}, z$1.core.$strip>;
|
|
367
|
-
use: ((inputContext:
|
|
367
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
368
368
|
session: {
|
|
369
369
|
user: UserWithRole;
|
|
370
|
-
session: Session;
|
|
370
|
+
session: Session$1;
|
|
371
371
|
};
|
|
372
372
|
}>)[];
|
|
373
373
|
metadata: {
|
|
@@ -397,12 +397,12 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
397
397
|
} & {
|
|
398
398
|
use: any[];
|
|
399
399
|
}, UserWithRole>;
|
|
400
|
-
listUsers:
|
|
400
|
+
listUsers: better_call626.StrictEndpoint<"/admin/list-users", {
|
|
401
401
|
method: "GET";
|
|
402
|
-
use: ((inputContext:
|
|
402
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
403
403
|
session: {
|
|
404
404
|
user: UserWithRole;
|
|
405
|
-
session: Session;
|
|
405
|
+
session: Session$1;
|
|
406
406
|
};
|
|
407
407
|
}>)[];
|
|
408
408
|
query: z$1.ZodObject<{
|
|
@@ -498,12 +498,12 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
498
498
|
*
|
|
499
499
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-list-user-sessions)
|
|
500
500
|
*/
|
|
501
|
-
listUserSessions:
|
|
501
|
+
listUserSessions: better_call626.StrictEndpoint<"/admin/list-user-sessions", {
|
|
502
502
|
method: "POST";
|
|
503
|
-
use: ((inputContext:
|
|
503
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
504
504
|
session: {
|
|
505
505
|
user: UserWithRole;
|
|
506
|
-
session: Session;
|
|
506
|
+
session: Session$1;
|
|
507
507
|
};
|
|
508
508
|
}>)[];
|
|
509
509
|
body: z$1.ZodObject<{
|
|
@@ -556,15 +556,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
556
556
|
*
|
|
557
557
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-unban-user)
|
|
558
558
|
*/
|
|
559
|
-
unbanUser:
|
|
559
|
+
unbanUser: better_call626.StrictEndpoint<"/admin/unban-user", {
|
|
560
560
|
method: "POST";
|
|
561
561
|
body: z$1.ZodObject<{
|
|
562
562
|
userId: z$1.ZodCoercedString<unknown>;
|
|
563
563
|
}, z$1.core.$strip>;
|
|
564
|
-
use: ((inputContext:
|
|
564
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
565
565
|
session: {
|
|
566
566
|
user: UserWithRole;
|
|
567
|
-
session: Session;
|
|
567
|
+
session: Session$1;
|
|
568
568
|
};
|
|
569
569
|
}>)[];
|
|
570
570
|
metadata: {
|
|
@@ -611,17 +611,17 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
611
611
|
*
|
|
612
612
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-ban-user)
|
|
613
613
|
*/
|
|
614
|
-
banUser:
|
|
614
|
+
banUser: better_call626.StrictEndpoint<"/admin/ban-user", {
|
|
615
615
|
method: "POST";
|
|
616
616
|
body: z$1.ZodObject<{
|
|
617
617
|
userId: z$1.ZodCoercedString<unknown>;
|
|
618
618
|
banReason: z$1.ZodOptional<z$1.ZodString>;
|
|
619
619
|
banExpiresIn: z$1.ZodOptional<z$1.ZodNumber>;
|
|
620
620
|
}, z$1.core.$strip>;
|
|
621
|
-
use: ((inputContext:
|
|
621
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
622
622
|
session: {
|
|
623
623
|
user: UserWithRole;
|
|
624
|
-
session: Session;
|
|
624
|
+
session: Session$1;
|
|
625
625
|
};
|
|
626
626
|
}>)[];
|
|
627
627
|
metadata: {
|
|
@@ -668,15 +668,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
668
668
|
*
|
|
669
669
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-impersonate-user)
|
|
670
670
|
*/
|
|
671
|
-
impersonateUser:
|
|
671
|
+
impersonateUser: better_call626.StrictEndpoint<"/admin/impersonate-user", {
|
|
672
672
|
method: "POST";
|
|
673
673
|
body: z$1.ZodObject<{
|
|
674
674
|
userId: z$1.ZodCoercedString<unknown>;
|
|
675
675
|
}, z$1.core.$strip>;
|
|
676
|
-
use: ((inputContext:
|
|
676
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
677
677
|
session: {
|
|
678
678
|
user: UserWithRole;
|
|
679
|
-
session: Session;
|
|
679
|
+
session: Session$1;
|
|
680
680
|
};
|
|
681
681
|
}>)[];
|
|
682
682
|
metadata: {
|
|
@@ -744,14 +744,14 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
744
744
|
*
|
|
745
745
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-stop-impersonating)
|
|
746
746
|
*/
|
|
747
|
-
stopImpersonating:
|
|
747
|
+
stopImpersonating: better_call626.StrictEndpoint<"/admin/stop-impersonating", {
|
|
748
748
|
method: "POST";
|
|
749
749
|
requireHeaders: true;
|
|
750
750
|
} & {
|
|
751
751
|
use: any[];
|
|
752
752
|
}, {
|
|
753
|
-
session: Session & Record<string, any>;
|
|
754
|
-
user: User
|
|
753
|
+
session: Session$1 & Record<string, any>;
|
|
754
|
+
user: _better_auth_core_db10.User & Record<string, any>;
|
|
755
755
|
}>;
|
|
756
756
|
/**
|
|
757
757
|
* ### Endpoint
|
|
@@ -768,15 +768,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
768
768
|
*
|
|
769
769
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-revoke-user-session)
|
|
770
770
|
*/
|
|
771
|
-
revokeUserSession:
|
|
771
|
+
revokeUserSession: better_call626.StrictEndpoint<"/admin/revoke-user-session", {
|
|
772
772
|
method: "POST";
|
|
773
773
|
body: z$1.ZodObject<{
|
|
774
774
|
sessionToken: z$1.ZodString;
|
|
775
775
|
}, z$1.core.$strip>;
|
|
776
|
-
use: ((inputContext:
|
|
776
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
777
777
|
session: {
|
|
778
778
|
user: UserWithRole;
|
|
779
|
-
session: Session;
|
|
779
|
+
session: Session$1;
|
|
780
780
|
};
|
|
781
781
|
}>)[];
|
|
782
782
|
metadata: {
|
|
@@ -823,15 +823,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
823
823
|
*
|
|
824
824
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-revoke-user-sessions)
|
|
825
825
|
*/
|
|
826
|
-
revokeUserSessions:
|
|
826
|
+
revokeUserSessions: better_call626.StrictEndpoint<"/admin/revoke-user-sessions", {
|
|
827
827
|
method: "POST";
|
|
828
828
|
body: z$1.ZodObject<{
|
|
829
829
|
userId: z$1.ZodCoercedString<unknown>;
|
|
830
830
|
}, z$1.core.$strip>;
|
|
831
|
-
use: ((inputContext:
|
|
831
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
832
832
|
session: {
|
|
833
833
|
user: UserWithRole;
|
|
834
|
-
session: Session;
|
|
834
|
+
session: Session$1;
|
|
835
835
|
};
|
|
836
836
|
}>)[];
|
|
837
837
|
metadata: {
|
|
@@ -878,15 +878,15 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
878
878
|
*
|
|
879
879
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-remove-user)
|
|
880
880
|
*/
|
|
881
|
-
removeUser:
|
|
881
|
+
removeUser: better_call626.StrictEndpoint<"/admin/remove-user", {
|
|
882
882
|
method: "POST";
|
|
883
883
|
body: z$1.ZodObject<{
|
|
884
884
|
userId: z$1.ZodCoercedString<unknown>;
|
|
885
885
|
}, z$1.core.$strip>;
|
|
886
|
-
use: ((inputContext:
|
|
886
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
887
887
|
session: {
|
|
888
888
|
user: UserWithRole;
|
|
889
|
-
session: Session;
|
|
889
|
+
session: Session$1;
|
|
890
890
|
};
|
|
891
891
|
}>)[];
|
|
892
892
|
metadata: {
|
|
@@ -933,16 +933,16 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
933
933
|
*
|
|
934
934
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-set-user-password)
|
|
935
935
|
*/
|
|
936
|
-
setUserPassword:
|
|
936
|
+
setUserPassword: better_call626.StrictEndpoint<"/admin/set-user-password", {
|
|
937
937
|
method: "POST";
|
|
938
938
|
body: z$1.ZodObject<{
|
|
939
939
|
newPassword: z$1.ZodString;
|
|
940
940
|
userId: z$1.ZodCoercedString<unknown>;
|
|
941
941
|
}, z$1.core.$strip>;
|
|
942
|
-
use: ((inputContext:
|
|
942
|
+
use: ((inputContext: better_call626.MiddlewareInputContext<better_call626.MiddlewareOptions>) => Promise<{
|
|
943
943
|
session: {
|
|
944
944
|
user: UserWithRole;
|
|
945
|
-
session: Session;
|
|
945
|
+
session: Session$1;
|
|
946
946
|
};
|
|
947
947
|
}>)[];
|
|
948
948
|
metadata: {
|
|
@@ -989,7 +989,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
989
989
|
*
|
|
990
990
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/admin#api-method-admin-has-permission)
|
|
991
991
|
*/
|
|
992
|
-
userHasPermission:
|
|
992
|
+
userHasPermission: better_call626.StrictEndpoint<"/admin/has-permission", {
|
|
993
993
|
method: "POST";
|
|
994
994
|
body: z$1.ZodIntersection<z$1.ZodObject<{
|
|
995
995
|
userId: z$1.ZodOptional<z$1.ZodCoercedString<unknown>>;
|