better-auth 1.3.27 → 1.3.28
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/dist/adapters/drizzle-adapter/index.cjs +14 -15
- package/dist/adapters/drizzle-adapter/index.d.cts +3 -16
- package/dist/adapters/drizzle-adapter/index.d.mts +3 -16
- package/dist/adapters/drizzle-adapter/index.d.ts +3 -16
- package/dist/adapters/drizzle-adapter/index.mjs +4 -5
- package/dist/adapters/index.cjs +4 -4
- package/dist/adapters/index.d.cts +116 -18
- package/dist/adapters/index.d.mts +116 -18
- package/dist/adapters/index.d.ts +116 -18
- package/dist/adapters/index.mjs +4 -4
- package/dist/adapters/kysely-adapter/index.cjs +5 -5
- package/dist/adapters/kysely-adapter/index.d.cts +5 -16
- package/dist/adapters/kysely-adapter/index.d.mts +5 -16
- package/dist/adapters/kysely-adapter/index.d.ts +5 -16
- package/dist/adapters/kysely-adapter/index.mjs +5 -5
- package/dist/adapters/memory-adapter/index.cjs +7 -7
- package/dist/adapters/memory-adapter/index.d.cts +3 -15
- package/dist/adapters/memory-adapter/index.d.mts +3 -15
- package/dist/adapters/memory-adapter/index.d.ts +3 -15
- package/dist/adapters/memory-adapter/index.mjs +7 -7
- package/dist/adapters/mongodb-adapter/index.cjs +5 -5
- package/dist/adapters/mongodb-adapter/index.d.cts +3 -16
- package/dist/adapters/mongodb-adapter/index.d.mts +3 -16
- package/dist/adapters/mongodb-adapter/index.d.ts +3 -16
- package/dist/adapters/mongodb-adapter/index.mjs +5 -5
- package/dist/adapters/prisma-adapter/index.cjs +9 -10
- package/dist/adapters/prisma-adapter/index.d.cts +3 -16
- package/dist/adapters/prisma-adapter/index.d.mts +3 -16
- package/dist/adapters/prisma-adapter/index.d.ts +3 -16
- package/dist/adapters/prisma-adapter/index.mjs +4 -5
- package/dist/adapters/test.cjs +1 -2
- package/dist/adapters/test.d.cts +4 -17
- package/dist/adapters/test.d.mts +4 -17
- package/dist/adapters/test.d.ts +4 -17
- package/dist/adapters/test.mjs +1 -2
- package/dist/api/index.cjs +89 -89
- package/dist/api/index.d.cts +10 -11
- package/dist/api/index.d.mts +10 -11
- package/dist/api/index.d.ts +10 -11
- package/dist/api/index.mjs +18 -17
- package/dist/client/index.cjs +5 -5
- package/dist/client/index.d.cts +26 -26
- package/dist/client/index.d.mts +26 -26
- package/dist/client/index.d.ts +26 -26
- package/dist/client/index.mjs +5 -5
- package/dist/client/lynx/index.cjs +4 -4
- package/dist/client/lynx/index.d.cts +14 -15
- package/dist/client/lynx/index.d.mts +14 -15
- package/dist/client/lynx/index.d.ts +14 -15
- package/dist/client/lynx/index.mjs +4 -4
- package/dist/client/plugins/index.cjs +33 -21
- package/dist/client/plugins/index.d.cts +27 -22
- package/dist/client/plugins/index.d.mts +27 -22
- package/dist/client/plugins/index.d.ts +27 -22
- package/dist/client/plugins/index.mjs +27 -15
- package/dist/client/react/index.cjs +4 -4
- package/dist/client/react/index.d.cts +15 -15
- package/dist/client/react/index.d.mts +15 -15
- package/dist/client/react/index.d.ts +15 -15
- package/dist/client/react/index.mjs +4 -4
- package/dist/client/solid/index.cjs +4 -4
- package/dist/client/solid/index.d.cts +20 -21
- package/dist/client/solid/index.d.mts +20 -21
- package/dist/client/solid/index.d.ts +20 -21
- package/dist/client/solid/index.mjs +4 -4
- package/dist/client/svelte/index.cjs +4 -4
- package/dist/client/svelte/index.d.cts +14 -15
- package/dist/client/svelte/index.d.mts +14 -15
- package/dist/client/svelte/index.d.ts +14 -15
- package/dist/client/svelte/index.mjs +4 -4
- package/dist/client/vue/index.cjs +4 -4
- package/dist/client/vue/index.d.cts +23 -24
- package/dist/client/vue/index.d.mts +23 -24
- package/dist/client/vue/index.d.ts +23 -24
- package/dist/client/vue/index.mjs +4 -4
- package/dist/cookies/index.cjs +8 -8
- package/dist/cookies/index.d.cts +55 -15
- package/dist/cookies/index.d.mts +55 -15
- package/dist/cookies/index.d.ts +55 -15
- package/dist/cookies/index.mjs +6 -6
- package/dist/crypto/index.cjs +2 -2
- package/dist/crypto/index.mjs +1 -1
- package/dist/db/index.cjs +9 -10
- package/dist/db/index.d.cts +16 -17
- package/dist/db/index.d.mts +16 -17
- package/dist/db/index.d.ts +16 -17
- package/dist/db/index.mjs +9 -10
- package/dist/index.cjs +93 -29
- package/dist/index.d.cts +24 -228
- package/dist/index.d.mts +24 -228
- package/dist/index.d.ts +24 -228
- package/dist/index.mjs +40 -17
- package/dist/integrations/next-js.cjs +6 -42
- package/dist/integrations/next-js.d.cts +8 -15
- package/dist/integrations/next-js.d.mts +8 -15
- package/dist/integrations/next-js.d.ts +8 -15
- package/dist/integrations/next-js.mjs +4 -40
- package/dist/integrations/node.d.cts +11 -12
- package/dist/integrations/node.d.mts +11 -12
- package/dist/integrations/node.d.ts +11 -12
- package/dist/integrations/react-start.cjs +6 -42
- package/dist/integrations/react-start.d.cts +8 -15
- package/dist/integrations/react-start.d.mts +8 -15
- package/dist/integrations/react-start.d.ts +8 -15
- package/dist/integrations/react-start.mjs +4 -40
- package/dist/integrations/svelte-kit.cjs +6 -30
- package/dist/integrations/svelte-kit.d.cts +1 -14
- package/dist/integrations/svelte-kit.d.mts +1 -14
- package/dist/integrations/svelte-kit.d.ts +1 -14
- package/dist/integrations/svelte-kit.mjs +4 -28
- package/dist/oauth2/index.cjs +31 -29
- package/dist/oauth2/index.d.cts +4 -90
- package/dist/oauth2/index.d.mts +4 -90
- package/dist/oauth2/index.d.ts +4 -90
- package/dist/oauth2/index.mjs +16 -15
- package/dist/plugins/access/index.cjs +5 -68
- package/dist/plugins/access/index.d.cts +1 -1
- package/dist/plugins/access/index.d.mts +1 -1
- package/dist/plugins/access/index.d.ts +1 -1
- package/dist/plugins/access/index.mjs +2 -69
- package/dist/plugins/admin/access/index.cjs +9 -44
- package/dist/plugins/admin/access/index.d.cts +1 -1
- package/dist/plugins/admin/access/index.d.mts +1 -1
- package/dist/plugins/admin/access/index.d.ts +1 -1
- package/dist/plugins/admin/access/index.mjs +3 -42
- package/dist/plugins/admin/index.cjs +21 -19
- package/dist/plugins/admin/index.d.cts +16 -19
- package/dist/plugins/admin/index.d.mts +16 -19
- package/dist/plugins/admin/index.d.ts +16 -19
- package/dist/plugins/admin/index.mjs +21 -19
- package/dist/plugins/anonymous/index.cjs +17 -17
- package/dist/plugins/anonymous/index.d.cts +10 -14
- package/dist/plugins/anonymous/index.d.mts +10 -14
- package/dist/plugins/anonymous/index.d.ts +10 -14
- package/dist/plugins/anonymous/index.mjs +14 -14
- package/dist/plugins/bearer/index.cjs +7 -30
- package/dist/plugins/bearer/index.d.cts +15 -16
- package/dist/plugins/bearer/index.d.mts +15 -16
- package/dist/plugins/bearer/index.d.ts +15 -16
- package/dist/plugins/bearer/index.mjs +4 -27
- package/dist/plugins/captcha/index.cjs +13 -22
- package/dist/plugins/captcha/index.d.cts +2 -16
- package/dist/plugins/captcha/index.d.mts +2 -16
- package/dist/plugins/captcha/index.d.ts +2 -16
- package/dist/plugins/captcha/index.mjs +2 -11
- package/dist/plugins/custom-session/index.cjs +14 -14
- package/dist/plugins/custom-session/index.d.cts +18 -12
- package/dist/plugins/custom-session/index.d.mts +18 -12
- package/dist/plugins/custom-session/index.d.ts +18 -12
- package/dist/plugins/custom-session/index.mjs +12 -12
- package/dist/plugins/device-authorization/index.cjs +14 -14
- package/dist/plugins/device-authorization/index.d.cts +14 -23
- package/dist/plugins/device-authorization/index.d.mts +14 -23
- package/dist/plugins/device-authorization/index.d.ts +14 -23
- package/dist/plugins/device-authorization/index.mjs +9 -9
- package/dist/plugins/email-otp/index.cjs +22 -22
- package/dist/plugins/email-otp/index.d.cts +10 -16
- package/dist/plugins/email-otp/index.d.mts +10 -16
- package/dist/plugins/email-otp/index.d.ts +10 -16
- package/dist/plugins/email-otp/index.mjs +13 -13
- package/dist/plugins/generic-oauth/index.cjs +36 -32
- package/dist/plugins/generic-oauth/index.d.cts +7 -15
- package/dist/plugins/generic-oauth/index.d.mts +7 -15
- package/dist/plugins/generic-oauth/index.d.ts +7 -15
- package/dist/plugins/generic-oauth/index.mjs +19 -15
- package/dist/plugins/haveibeenpwned/index.cjs +12 -11
- package/dist/plugins/haveibeenpwned/index.d.cts +3 -17
- package/dist/plugins/haveibeenpwned/index.d.mts +3 -17
- package/dist/plugins/haveibeenpwned/index.d.ts +3 -17
- package/dist/plugins/haveibeenpwned/index.mjs +12 -11
- package/dist/plugins/index.cjs +49 -43
- package/dist/plugins/index.d.cts +23 -23
- package/dist/plugins/index.d.mts +23 -23
- package/dist/plugins/index.d.ts +23 -23
- package/dist/plugins/index.mjs +37 -31
- package/dist/plugins/jwt/index.cjs +19 -19
- package/dist/plugins/jwt/index.d.cts +12 -14
- package/dist/plugins/jwt/index.d.mts +12 -14
- package/dist/plugins/jwt/index.d.ts +12 -14
- package/dist/plugins/jwt/index.mjs +14 -14
- package/dist/plugins/magic-link/index.cjs +18 -18
- package/dist/plugins/magic-link/index.mjs +12 -12
- package/dist/plugins/multi-session/index.cjs +18 -18
- package/dist/plugins/multi-session/index.d.cts +9 -15
- package/dist/plugins/multi-session/index.d.mts +9 -15
- package/dist/plugins/multi-session/index.d.ts +9 -15
- package/dist/plugins/multi-session/index.mjs +12 -12
- package/dist/plugins/oauth-proxy/index.cjs +18 -18
- package/dist/plugins/oauth-proxy/index.d.cts +17 -16
- package/dist/plugins/oauth-proxy/index.d.mts +17 -16
- package/dist/plugins/oauth-proxy/index.d.ts +17 -16
- package/dist/plugins/oauth-proxy/index.mjs +13 -13
- package/dist/plugins/oidc-provider/index.cjs +15 -15
- package/dist/plugins/oidc-provider/index.d.cts +7 -16
- package/dist/plugins/oidc-provider/index.d.mts +7 -16
- package/dist/plugins/oidc-provider/index.d.ts +7 -16
- package/dist/plugins/oidc-provider/index.mjs +15 -15
- package/dist/plugins/one-tap/index.cjs +13 -13
- package/dist/plugins/one-tap/index.d.cts +14 -14
- package/dist/plugins/one-tap/index.d.mts +14 -14
- package/dist/plugins/one-tap/index.d.ts +14 -14
- package/dist/plugins/one-tap/index.mjs +12 -12
- package/dist/plugins/one-time-token/index.cjs +24 -18
- package/dist/plugins/one-time-token/index.d.cts +1 -12
- package/dist/plugins/one-time-token/index.d.mts +1 -12
- package/dist/plugins/one-time-token/index.d.ts +1 -12
- package/dist/plugins/one-time-token/index.mjs +24 -18
- package/dist/plugins/open-api/index.cjs +16 -16
- package/dist/plugins/open-api/index.d.cts +2 -13
- package/dist/plugins/open-api/index.d.mts +2 -13
- package/dist/plugins/open-api/index.d.ts +2 -13
- package/dist/plugins/open-api/index.mjs +14 -14
- package/dist/plugins/organization/access/index.cjs +10 -43
- package/dist/plugins/organization/access/index.d.cts +1 -1
- package/dist/plugins/organization/access/index.d.mts +1 -1
- package/dist/plugins/organization/access/index.d.ts +1 -1
- package/dist/plugins/organization/access/index.mjs +3 -40
- package/dist/plugins/organization/index.cjs +19 -18
- package/dist/plugins/organization/index.d.cts +176 -183
- package/dist/plugins/organization/index.d.mts +176 -183
- package/dist/plugins/organization/index.d.ts +176 -183
- package/dist/plugins/organization/index.mjs +19 -18
- package/dist/plugins/passkey/index.cjs +19 -19
- package/dist/plugins/passkey/index.d.cts +2 -11
- package/dist/plugins/passkey/index.d.mts +2 -11
- package/dist/plugins/passkey/index.d.ts +2 -11
- package/dist/plugins/passkey/index.mjs +12 -12
- package/dist/plugins/phone-number/index.cjs +32 -32
- package/dist/plugins/phone-number/index.d.cts +2 -11
- package/dist/plugins/phone-number/index.d.mts +2 -11
- package/dist/plugins/phone-number/index.d.ts +2 -11
- package/dist/plugins/phone-number/index.mjs +13 -13
- package/dist/plugins/siwe/index.cjs +15 -15
- package/dist/plugins/siwe/index.d.cts +2 -11
- package/dist/plugins/siwe/index.d.mts +2 -11
- package/dist/plugins/siwe/index.d.ts +2 -11
- package/dist/plugins/siwe/index.mjs +13 -13
- package/dist/plugins/sso/index.cjs +26 -24
- package/dist/plugins/sso/index.d.cts +3 -4
- package/dist/plugins/sso/index.d.mts +3 -4
- package/dist/plugins/sso/index.d.ts +3 -4
- package/dist/plugins/sso/index.mjs +15 -13
- package/dist/plugins/two-factor/index.cjs +87 -106
- package/dist/plugins/two-factor/index.d.cts +42 -44
- package/dist/plugins/two-factor/index.d.mts +42 -44
- package/dist/plugins/two-factor/index.d.ts +42 -44
- package/dist/plugins/two-factor/index.mjs +61 -80
- package/dist/plugins/username/index.cjs +46 -55
- package/dist/plugins/username/index.d.cts +15 -18
- package/dist/plugins/username/index.d.mts +15 -18
- package/dist/plugins/username/index.d.ts +15 -18
- package/dist/plugins/username/index.mjs +15 -24
- package/dist/shared/{better-auth.QSZgH9k6.mjs → better-auth.15w1BFER.mjs} +2 -14
- package/dist/shared/better-auth.5wJlMsTX.d.mts +17 -0
- package/dist/shared/{better-auth.BLnvK9hk.mjs → better-auth.B5mlN66S.mjs} +2 -2
- package/dist/shared/{better-auth.BqRh2LMv.cjs → better-auth.BC7PCf8Q.cjs} +17 -16
- package/dist/shared/better-auth.BK-qOyll.cjs +171 -0
- package/dist/shared/{better-auth.BTrSrKsi.mjs → better-auth.BKEtEpt0.mjs} +1 -1
- package/dist/shared/better-auth.BLRq-uZX.mjs +264 -0
- package/dist/shared/better-auth.BLxPPg5G.mjs +69 -0
- package/dist/shared/better-auth.BM1EYiYB.cjs +16 -0
- package/dist/shared/{better-auth.C3-_8m-g.mjs → better-auth.BOULxa5h.mjs} +16 -3021
- package/dist/shared/{better-auth.BQOp-6ij.mjs → better-auth.BXHrfawo.mjs} +1 -1
- package/dist/shared/better-auth.BcaKUc4P.mjs +24 -0
- package/dist/shared/better-auth.BgW7o7g9.d.cts +17 -0
- package/dist/shared/better-auth.BgW7o7g9.d.mts +17 -0
- package/dist/shared/better-auth.BgW7o7g9.d.ts +17 -0
- package/dist/shared/{better-auth.bkwPl2G4.mjs → better-auth.BjOWrlEY.mjs} +1 -1
- package/dist/shared/better-auth.Bn2XUCG7.d.cts +22 -0
- package/dist/shared/better-auth.Bn2XUCG7.d.mts +22 -0
- package/dist/shared/better-auth.Bn2XUCG7.d.ts +22 -0
- package/dist/shared/better-auth.BnBM8gPy.d.cts +3 -0
- package/dist/shared/better-auth.BnBM8gPy.d.mts +3 -0
- package/dist/shared/better-auth.BnBM8gPy.d.ts +3 -0
- package/dist/shared/{better-auth.BTbJyJY8.cjs → better-auth.Bt42JLkX.cjs} +27 -22
- package/dist/shared/better-auth.Buokdd_y.d.cts +106 -0
- package/dist/shared/{better-auth.CMNsGyrW.cjs → better-auth.BwsNBdWY.cjs} +1 -1
- package/dist/shared/better-auth.Bx5mWHak.cjs +16 -0
- package/dist/shared/{better-auth.Dk1np_aj.mjs → better-auth.C20TDaBo.mjs} +16 -11
- package/dist/shared/{better-auth.DNep33Pk.d.mts → better-auth.C72lhegY.d.mts} +11 -3
- package/dist/shared/{better-auth.Jlhc86WK.cjs → better-auth.C7Ar55gj.cjs} +2 -2
- package/dist/shared/{better-auth.DRQ4nVPW.cjs → better-auth.CEiSk3dW.cjs} +3 -15
- package/dist/shared/{better-auth.BDO3prN3.mjs → better-auth.CFBL8ZAm.mjs} +8 -7
- package/dist/shared/{better-auth.jQtahd9L.d.ts → better-auth.CKP88w2n.d.ts} +11 -3
- package/dist/shared/{better-auth.CMwM5enp.cjs → better-auth.COF45WkB.cjs} +3 -3
- package/dist/shared/better-auth.CP-SWMbr.mjs +41 -0
- package/dist/shared/better-auth.CP1SBr-a.mjs +14 -0
- package/dist/shared/better-auth.C_33rQxs.d.mts +106 -0
- package/dist/shared/{better-auth.B4NXoE-M.mjs → better-auth.CcYw7b-A.mjs} +9 -29
- package/dist/shared/{better-auth.D-L3RQ6y.mjs → better-auth.CcjWq_Ob.mjs} +7 -8
- package/dist/shared/{better-auth.C8KgRdGp.cjs → better-auth.Ch1EQ-Yl.cjs} +50 -70
- package/dist/shared/{better-auth.DiMXeqeq.mjs → better-auth.CjNhg7P4.mjs} +6 -78
- package/dist/shared/{better-auth.CbalUxhb.d.ts → better-auth.ComctQAf.d.cts} +1 -1
- package/dist/shared/{better-auth.CKxGlpAq.d.cts → better-auth.ComctQAf.d.mts} +1 -1
- package/dist/shared/{better-auth.DDN3xvzB.d.mts → better-auth.ComctQAf.d.ts} +1 -1
- package/dist/shared/better-auth.CqgkAe9n.cjs +77 -0
- package/dist/shared/{better-auth.Dy_SfH0Z.mjs → better-auth.CrugyrXH.mjs} +1 -1
- package/dist/shared/better-auth.Csa49Ynv.d.ts +106 -0
- package/dist/shared/better-auth.CtDEK5dv.d.cts +17 -0
- package/dist/shared/{better-auth.BW8BpneG.cjs → better-auth.D1q5UHpO.cjs} +2 -2
- package/dist/shared/better-auth.D75hcbd3.mjs +152 -0
- package/dist/shared/{better-auth.JuL5CDpT.cjs → better-auth.DBTqCDAW.cjs} +5 -5
- package/dist/shared/{better-auth.BvvYEWCP.mjs → better-auth.DCO8QZ1H.mjs} +10 -6
- package/dist/shared/{better-auth.H1XoMMKD.cjs → better-auth.DHYnDXUq.cjs} +16 -65
- package/dist/shared/{better-auth.B955zZIT.d.ts → better-auth.DIwF0vtL.d.ts} +70 -2168
- package/dist/shared/{better-auth.DTtXpZYr.d.cts → better-auth.DNnBkMGu.d.cts} +1 -1
- package/dist/shared/{better-auth.DTtXpZYr.d.ts → better-auth.DNnBkMGu.d.mts} +1 -1
- package/dist/shared/{better-auth.DTtXpZYr.d.mts → better-auth.DNnBkMGu.d.ts} +1 -1
- package/dist/shared/{better-auth.C5vDERgF.mjs → better-auth.DP-TUMaw.mjs} +6 -51
- package/dist/shared/{better-auth.C8pprhH9.cjs → better-auth.DXPBskCs.cjs} +7 -81
- package/dist/shared/{better-auth.wna9p9JG.mjs → better-auth.D_XdSlf1.mjs} +8 -67
- package/dist/shared/{better-auth.9o1iKU2q.cjs → better-auth.D_Z5w0Ho.cjs} +16 -12
- package/dist/shared/{better-auth.BAk2ZmIN.mjs → better-auth.D_t_N9Yo.mjs} +1 -1
- package/dist/shared/better-auth.DevHHPLH.mjs +39 -0
- package/dist/shared/{better-auth.BNK_KF5E.cjs → better-auth.DhDRLI4w.cjs} +2 -2
- package/dist/shared/{better-auth.BO2ijETW.cjs → better-auth.DjmHNq_0.cjs} +13 -14
- package/dist/shared/{better-auth.DTWovzBk.mjs → better-auth.DlxfhVBi.mjs} +1 -1
- package/dist/shared/{better-auth.D1rR7ww4.cjs → better-auth.DqMG57f7.cjs} +1 -1
- package/dist/shared/{better-auth.BhYGuioe.cjs → better-auth.DrhZ3jDS.cjs} +12 -9
- package/dist/shared/{better-auth.3yVESL3y.d.cts → better-auth.DsKEgB8I.d.cts} +11 -3
- package/dist/shared/better-auth.DtX8_eyE.cjs +47 -0
- package/dist/shared/better-auth.DyhDNJOb.d.ts +17 -0
- package/dist/shared/{better-auth.CJOt0JsS.cjs → better-auth.FYyZpvCP.cjs} +1 -1
- package/dist/shared/{better-auth.DfzGrFqx.cjs → better-auth.GM3xRXA6.cjs} +1 -1
- package/dist/shared/better-auth.HiXxvark.cjs +72 -0
- package/dist/shared/better-auth.Ih8C76Vo.mjs +74 -0
- package/dist/shared/{better-auth.BP9j4LJZ.cjs → better-auth.Mn0eQ647.cjs} +313 -3362
- package/dist/shared/{better-auth.BRFtaovt.mjs → better-auth.NIVvsrVf.mjs} +2 -2
- package/dist/shared/{better-auth.CupPPBXF.d.mts → better-auth.SqoB1_Dr.d.cts} +70 -2168
- package/dist/shared/better-auth.UmNFRfyp.cjs +26 -0
- package/dist/shared/better-auth.YG3thOpY.cjs +266 -0
- package/dist/shared/better-auth.cK9aJBRe.mjs +13 -0
- package/dist/shared/{better-auth.DDuRjwGK.mjs → better-auth.iy-Q9EM9.mjs} +2 -2
- package/dist/shared/better-auth.kD29xbrE.d.cts +102 -0
- package/dist/shared/better-auth.kD29xbrE.d.mts +102 -0
- package/dist/shared/better-auth.kD29xbrE.d.ts +102 -0
- package/dist/shared/better-auth.kVDH3hoR.cjs +46 -0
- package/dist/shared/{better-auth.WlYTsJnh.d.cts → better-auth.oVGQuDg-.d.mts} +70 -2168
- package/dist/shared/{better-auth.DLt6eN7D.mjs → better-auth.w0_JTMV9.mjs} +12 -9
- package/dist/shared/{better-auth.BZNpjLHI.cjs → better-auth.zWZIGkur.cjs} +192 -251
- package/dist/social-providers/index.cjs +11 -66
- package/dist/social-providers/index.d.cts +1 -3904
- package/dist/social-providers/index.d.mts +1 -3904
- package/dist/social-providers/index.d.ts +1 -3904
- package/dist/social-providers/index.mjs +1 -31
- package/dist/test-utils/index.cjs +36 -29
- package/dist/test-utils/index.d.cts +131 -128
- package/dist/test-utils/index.d.mts +131 -128
- package/dist/test-utils/index.d.ts +131 -128
- package/dist/test-utils/index.mjs +32 -25
- package/dist/types/index.d.cts +29 -15
- package/dist/types/index.d.mts +29 -15
- package/dist/types/index.d.ts +29 -15
- package/package.json +3 -2
- package/dist/shared/better-auth.2y6wvIMH.d.cts +0 -146
- package/dist/shared/better-auth.ANpbi45u.cjs +0 -22
- package/dist/shared/better-auth.B6fIklBU.cjs +0 -73
- package/dist/shared/better-auth.BIXUmcJZ.d.ts +0 -146
- package/dist/shared/better-auth.BToNb2fI.cjs +0 -210
- package/dist/shared/better-auth.Bo4kHJI7.d.cts +0 -181
- package/dist/shared/better-auth.Bon6lnRk.cjs +0 -819
- package/dist/shared/better-auth.BvSdjdDG.d.ts +0 -181
- package/dist/shared/better-auth.CJoIWSTC.mjs +0 -92
- package/dist/shared/better-auth.CiuwFiHM.mjs +0 -65
- package/dist/shared/better-auth.D2xndZ2p.mjs +0 -5
- package/dist/shared/better-auth.D4Gj1L5q.d.mts +0 -181
- package/dist/shared/better-auth.DdzSJf-n.mjs +0 -19
- package/dist/shared/better-auth.DgGir396.mjs +0 -204
- package/dist/shared/better-auth.DhbdrBWE.d.mts +0 -146
- package/dist/shared/better-auth.mPTDVpKF.mjs +0 -815
- package/dist/shared/better-auth.pbuTnS5V.cjs +0 -110
- package/dist/shared/better-auth.uykCWCYS.cjs +0 -7
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const drizzleOrm = require('drizzle-orm');
|
|
4
|
-
const
|
|
5
|
-
const index = require('../../shared/better-auth.
|
|
6
|
-
require('../../shared/better-auth.
|
|
7
|
-
require('
|
|
8
|
-
require('../../shared/better-auth.B6fIklBU.cjs');
|
|
4
|
+
const error = require('@better-auth/core/error');
|
|
5
|
+
const index = require('../../shared/better-auth.D_Z5w0Ho.cjs');
|
|
6
|
+
require('../../shared/better-auth.C7Ar55gj.cjs');
|
|
7
|
+
require('@better-auth/core/env');
|
|
9
8
|
require('../../shared/better-auth.S3hDEI-1.cjs');
|
|
10
9
|
require('../../shared/better-auth.Bg6iw3ig.cjs');
|
|
11
10
|
require('@better-auth/utils/random');
|
|
@@ -27,13 +26,13 @@ const drizzleAdapter = (db, config) => {
|
|
|
27
26
|
function getSchema(model) {
|
|
28
27
|
const schema = config.schema || db2._.fullSchema;
|
|
29
28
|
if (!schema) {
|
|
30
|
-
throw new
|
|
29
|
+
throw new error.BetterAuthError(
|
|
31
30
|
"Drizzle adapter failed to initialize. Schema not found. Please provide a schema object in the adapter options object."
|
|
32
31
|
);
|
|
33
32
|
}
|
|
34
33
|
const schemaModel = schema[model];
|
|
35
34
|
if (!schemaModel) {
|
|
36
|
-
throw new
|
|
35
|
+
throw new error.BetterAuthError(
|
|
37
36
|
`[# Drizzle Adapter]: The model "${model}" was not found in the schema object. Please pass the schema directly to the adapter options.`
|
|
38
37
|
);
|
|
39
38
|
}
|
|
@@ -70,7 +69,7 @@ const drizzleAdapter = (db, config) => {
|
|
|
70
69
|
return res[0];
|
|
71
70
|
} else {
|
|
72
71
|
if (!("id" in schemaModel)) {
|
|
73
|
-
throw new
|
|
72
|
+
throw new error.BetterAuthError(
|
|
74
73
|
`The model "${model}" does not have an "id" field. Please use the "id" field as your primary key.`
|
|
75
74
|
);
|
|
76
75
|
}
|
|
@@ -88,13 +87,13 @@ const drizzleAdapter = (db, config) => {
|
|
|
88
87
|
}
|
|
89
88
|
const field = getFieldName({ model, field: w.field });
|
|
90
89
|
if (!schemaModel[field]) {
|
|
91
|
-
throw new
|
|
90
|
+
throw new error.BetterAuthError(
|
|
92
91
|
`The field "${w.field}" does not exist in the schema for the model "${model}". Please update your schema.`
|
|
93
92
|
);
|
|
94
93
|
}
|
|
95
94
|
if (w.operator === "in") {
|
|
96
95
|
if (!Array.isArray(w.value)) {
|
|
97
|
-
throw new
|
|
96
|
+
throw new error.BetterAuthError(
|
|
98
97
|
`The value for the field "${w.field}" must be an array when using the "in" operator.`
|
|
99
98
|
);
|
|
100
99
|
}
|
|
@@ -102,7 +101,7 @@ const drizzleAdapter = (db, config) => {
|
|
|
102
101
|
}
|
|
103
102
|
if (w.operator === "not_in") {
|
|
104
103
|
if (!Array.isArray(w.value)) {
|
|
105
|
-
throw new
|
|
104
|
+
throw new error.BetterAuthError(
|
|
106
105
|
`The value for the field "${w.field}" must be an array when using the "not_in" operator.`
|
|
107
106
|
);
|
|
108
107
|
}
|
|
@@ -143,7 +142,7 @@ const drizzleAdapter = (db, config) => {
|
|
|
143
142
|
const field = getFieldName({ model, field: w.field });
|
|
144
143
|
if (w.operator === "in") {
|
|
145
144
|
if (!Array.isArray(w.value)) {
|
|
146
|
-
throw new
|
|
145
|
+
throw new error.BetterAuthError(
|
|
147
146
|
`The value for the field "${w.field}" must be an array when using the "in" operator.`
|
|
148
147
|
);
|
|
149
148
|
}
|
|
@@ -151,7 +150,7 @@ const drizzleAdapter = (db, config) => {
|
|
|
151
150
|
}
|
|
152
151
|
if (w.operator === "not_in") {
|
|
153
152
|
if (!Array.isArray(w.value)) {
|
|
154
|
-
throw new
|
|
153
|
+
throw new error.BetterAuthError(
|
|
155
154
|
`The value for the field "${w.field}" must be an array when using the "not_in" operator.`
|
|
156
155
|
);
|
|
157
156
|
}
|
|
@@ -173,13 +172,13 @@ const drizzleAdapter = (db, config) => {
|
|
|
173
172
|
}
|
|
174
173
|
function checkMissingFields(schema, model, values) {
|
|
175
174
|
if (!schema) {
|
|
176
|
-
throw new
|
|
175
|
+
throw new error.BetterAuthError(
|
|
177
176
|
"Drizzle adapter failed to initialize. Schema not found. Please provide a schema object in the adapter options object."
|
|
178
177
|
);
|
|
179
178
|
}
|
|
180
179
|
for (const key in values) {
|
|
181
180
|
if (!schema[key]) {
|
|
182
|
-
throw new
|
|
181
|
+
throw new error.BetterAuthError(
|
|
183
182
|
`The field "${key}" does not exist in the "${model}" schema. Please update your drizzle schema or re-generate using "npx @better-auth/cli generate".`
|
|
184
183
|
);
|
|
185
184
|
}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DBAdapterDebugLogOption } from '@better-auth/core/db/adapter';
|
|
3
|
-
import '../../shared/better-auth.Bo4kHJI7.cjs';
|
|
4
|
-
import '../../shared/better-auth.DTtXpZYr.cjs';
|
|
5
|
-
import 'kysely';
|
|
6
|
-
import 'better-call';
|
|
7
|
-
import '@better-auth/core/db';
|
|
8
|
-
import 'zod';
|
|
9
|
-
import '../../social-providers/index.cjs';
|
|
10
|
-
import '@better-auth/core';
|
|
11
|
-
import 'better-sqlite3';
|
|
12
|
-
import 'bun:sqlite';
|
|
13
|
-
import 'node:sqlite';
|
|
14
|
-
import 'packages/core/dist/db/adapter';
|
|
15
|
-
import 'zod/v4/core';
|
|
1
|
+
import { BetterAuthOptions } from '@better-auth/core';
|
|
2
|
+
import { DBAdapterDebugLogOption, DBAdapter } from '@better-auth/core/db/adapter';
|
|
16
3
|
|
|
17
4
|
interface DB {
|
|
18
5
|
[key: string]: any;
|
|
@@ -54,7 +41,7 @@ interface DrizzleAdapterConfig {
|
|
|
54
41
|
*/
|
|
55
42
|
transaction?: boolean;
|
|
56
43
|
}
|
|
57
|
-
declare const drizzleAdapter: (db: DB, config: DrizzleAdapterConfig) => (options: BetterAuthOptions) =>
|
|
44
|
+
declare const drizzleAdapter: (db: DB, config: DrizzleAdapterConfig) => (options: BetterAuthOptions) => DBAdapter<BetterAuthOptions>;
|
|
58
45
|
|
|
59
46
|
export { drizzleAdapter };
|
|
60
47
|
export type { DB, DrizzleAdapterConfig };
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DBAdapterDebugLogOption } from '@better-auth/core/db/adapter';
|
|
3
|
-
import '../../shared/better-auth.D4Gj1L5q.mjs';
|
|
4
|
-
import '../../shared/better-auth.DTtXpZYr.mjs';
|
|
5
|
-
import 'kysely';
|
|
6
|
-
import 'better-call';
|
|
7
|
-
import '@better-auth/core/db';
|
|
8
|
-
import 'zod';
|
|
9
|
-
import '../../social-providers/index.mjs';
|
|
10
|
-
import '@better-auth/core';
|
|
11
|
-
import 'better-sqlite3';
|
|
12
|
-
import 'bun:sqlite';
|
|
13
|
-
import 'node:sqlite';
|
|
14
|
-
import 'packages/core/dist/db/adapter';
|
|
15
|
-
import 'zod/v4/core';
|
|
1
|
+
import { BetterAuthOptions } from '@better-auth/core';
|
|
2
|
+
import { DBAdapterDebugLogOption, DBAdapter } from '@better-auth/core/db/adapter';
|
|
16
3
|
|
|
17
4
|
interface DB {
|
|
18
5
|
[key: string]: any;
|
|
@@ -54,7 +41,7 @@ interface DrizzleAdapterConfig {
|
|
|
54
41
|
*/
|
|
55
42
|
transaction?: boolean;
|
|
56
43
|
}
|
|
57
|
-
declare const drizzleAdapter: (db: DB, config: DrizzleAdapterConfig) => (options: BetterAuthOptions) =>
|
|
44
|
+
declare const drizzleAdapter: (db: DB, config: DrizzleAdapterConfig) => (options: BetterAuthOptions) => DBAdapter<BetterAuthOptions>;
|
|
58
45
|
|
|
59
46
|
export { drizzleAdapter };
|
|
60
47
|
export type { DB, DrizzleAdapterConfig };
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DBAdapterDebugLogOption } from '@better-auth/core/db/adapter';
|
|
3
|
-
import '../../shared/better-auth.BvSdjdDG.js';
|
|
4
|
-
import '../../shared/better-auth.DTtXpZYr.js';
|
|
5
|
-
import 'kysely';
|
|
6
|
-
import 'better-call';
|
|
7
|
-
import '@better-auth/core/db';
|
|
8
|
-
import 'zod';
|
|
9
|
-
import '../../social-providers/index.js';
|
|
10
|
-
import '@better-auth/core';
|
|
11
|
-
import 'better-sqlite3';
|
|
12
|
-
import 'bun:sqlite';
|
|
13
|
-
import 'node:sqlite';
|
|
14
|
-
import 'packages/core/dist/db/adapter';
|
|
15
|
-
import 'zod/v4/core';
|
|
1
|
+
import { BetterAuthOptions } from '@better-auth/core';
|
|
2
|
+
import { DBAdapterDebugLogOption, DBAdapter } from '@better-auth/core/db/adapter';
|
|
16
3
|
|
|
17
4
|
interface DB {
|
|
18
5
|
[key: string]: any;
|
|
@@ -54,7 +41,7 @@ interface DrizzleAdapterConfig {
|
|
|
54
41
|
*/
|
|
55
42
|
transaction?: boolean;
|
|
56
43
|
}
|
|
57
|
-
declare const drizzleAdapter: (db: DB, config: DrizzleAdapterConfig) => (options: BetterAuthOptions) =>
|
|
44
|
+
declare const drizzleAdapter: (db: DB, config: DrizzleAdapterConfig) => (options: BetterAuthOptions) => DBAdapter<BetterAuthOptions>;
|
|
58
45
|
|
|
59
46
|
export { drizzleAdapter };
|
|
60
47
|
export type { DB, DrizzleAdapterConfig };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { count, desc, asc, inArray, notInArray, like, lt, lte, ne, gt, gte, eq, and, or, sql } from 'drizzle-orm';
|
|
2
|
-
import {
|
|
3
|
-
import { c as createAdapterFactory } from '../../shared/better-auth.
|
|
4
|
-
import '../../shared/better-auth.
|
|
5
|
-
import '
|
|
6
|
-
import '../../shared/better-auth.CiuwFiHM.mjs';
|
|
2
|
+
import { BetterAuthError } from '@better-auth/core/error';
|
|
3
|
+
import { c as createAdapterFactory } from '../../shared/better-auth.DCO8QZ1H.mjs';
|
|
4
|
+
import '../../shared/better-auth.BKEtEpt0.mjs';
|
|
5
|
+
import '@better-auth/core/env';
|
|
7
6
|
import '../../shared/better-auth.DhziC0ap.mjs';
|
|
8
7
|
import '../../shared/better-auth.BUPPRXfK.mjs';
|
|
9
8
|
import '@better-auth/utils/random';
|
package/dist/adapters/index.cjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('../shared/better-auth.
|
|
3
|
+
const index = require('../shared/better-auth.D_Z5w0Ho.cjs');
|
|
4
4
|
const adapter = require('@better-auth/core/db/adapter');
|
|
5
|
-
require('../shared/better-auth.
|
|
6
|
-
require('
|
|
7
|
-
require('../shared/better-auth.B6fIklBU.cjs');
|
|
5
|
+
require('../shared/better-auth.C7Ar55gj.cjs');
|
|
6
|
+
require('@better-auth/core/env');
|
|
8
7
|
require('../shared/better-auth.S3hDEI-1.cjs');
|
|
9
8
|
require('../shared/better-auth.Bg6iw3ig.cjs');
|
|
10
9
|
require('@better-auth/utils/random');
|
|
@@ -18,6 +17,7 @@ require('jose');
|
|
|
18
17
|
require('@noble/hashes/scrypt.js');
|
|
19
18
|
require('@better-auth/utils/hex');
|
|
20
19
|
require('@noble/hashes/utils.js');
|
|
20
|
+
require('@better-auth/core/error');
|
|
21
21
|
require('../shared/better-auth.CYeOI8C-.cjs');
|
|
22
22
|
|
|
23
23
|
const createAdapter = index.createAdapterFactory;
|
|
@@ -1,21 +1,119 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BetterAuthOptions } from '@better-auth/core';
|
|
2
|
+
import { BetterAuthDBSchema, DBFieldAttribute } from '@better-auth/core/db';
|
|
3
|
+
import { DBAdapterFactoryConfig, Where, CustomAdapter as CustomAdapter$1, DBAdapter } from '@better-auth/core/db/adapter';
|
|
3
4
|
export * from '@better-auth/core/db/adapter';
|
|
4
|
-
import '../shared/better-auth.
|
|
5
|
-
import '../shared/better-auth.
|
|
6
|
-
import 'kysely';
|
|
7
|
-
import 'better-call';
|
|
8
|
-
import '@better-auth/core/db';
|
|
9
|
-
import 'zod';
|
|
10
|
-
import '../social-providers/index.cjs';
|
|
11
|
-
import '@better-auth/core';
|
|
12
|
-
import 'better-sqlite3';
|
|
13
|
-
import 'bun:sqlite';
|
|
14
|
-
import 'node:sqlite';
|
|
15
|
-
import 'packages/core/dist/db/adapter';
|
|
16
|
-
import 'zod/v4/core';
|
|
5
|
+
import { a as Prettify } from '../shared/better-auth.DNnBkMGu.cjs';
|
|
6
|
+
import { T as TransactionAdapter, a as AdapterSchemaCreation } from '../shared/better-auth.Bn2XUCG7.cjs';
|
|
17
7
|
|
|
18
|
-
type
|
|
8
|
+
type AdapterFactoryOptions = {
|
|
9
|
+
config: AdapterFactoryConfig;
|
|
10
|
+
adapter: AdapterFactoryCustomizeAdapterCreator;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `DBAdapterFactoryConfig` from `@better-auth/core/db/adapter` instead.
|
|
14
|
+
*/
|
|
15
|
+
interface AdapterFactoryConfig extends Omit<DBAdapterFactoryConfig<BetterAuthOptions>, "transaction"> {
|
|
16
|
+
/**
|
|
17
|
+
* Execute multiple operations in a transaction.
|
|
18
|
+
*
|
|
19
|
+
* If the database doesn't support transactions, set this to `false` and operations will be executed sequentially.
|
|
20
|
+
*
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
transaction?: false | (<R>(callback: (trx: TransactionAdapter) => Promise<R>) => Promise<R>);
|
|
24
|
+
}
|
|
25
|
+
type AdapterFactoryCustomizeAdapterCreator = (config: {
|
|
26
|
+
options: BetterAuthOptions;
|
|
27
|
+
/**
|
|
28
|
+
* The schema of the user's Better-Auth instance.
|
|
29
|
+
*/
|
|
30
|
+
schema: BetterAuthDBSchema;
|
|
31
|
+
/**
|
|
32
|
+
* The debug log function.
|
|
33
|
+
*
|
|
34
|
+
* If the config has defined `debugLogs` as `false`, no logs will be shown.
|
|
35
|
+
*/
|
|
36
|
+
debugLog: (...args: any[]) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Get the model name which is expected to be saved in the database based on the user's schema.
|
|
39
|
+
*/
|
|
40
|
+
getModelName: (model: string) => string;
|
|
41
|
+
/**
|
|
42
|
+
* Get the field name which is expected to be saved in the database based on the user's schema.
|
|
43
|
+
*/
|
|
44
|
+
getFieldName: ({ model, field }: {
|
|
45
|
+
model: string;
|
|
46
|
+
field: string;
|
|
47
|
+
}) => string;
|
|
48
|
+
/**
|
|
49
|
+
* This function helps us get the default model name from the schema defined by devs.
|
|
50
|
+
* Often times, the user will be using the `modelName` which could had been customized by the users.
|
|
51
|
+
* This function helps us get the actual model name useful to match against the schema. (eg: schema[model])
|
|
52
|
+
*
|
|
53
|
+
* If it's still unclear what this does:
|
|
54
|
+
*
|
|
55
|
+
* 1. User can define a custom modelName.
|
|
56
|
+
* 2. When using a custom modelName, doing something like `schema[model]` will not work.
|
|
57
|
+
* 3. Using this function helps us get the actual model name based on the user's defined custom modelName.
|
|
58
|
+
* 4. Thus allowing us to use `schema[model]`.
|
|
59
|
+
*/
|
|
60
|
+
getDefaultModelName: (model: string) => string;
|
|
61
|
+
/**
|
|
62
|
+
* This function helps us get the default field name from the schema defined by devs.
|
|
63
|
+
* Often times, the user will be using the `fieldName` which could had been customized by the users.
|
|
64
|
+
* This function helps us get the actual field name useful to match against the schema. (eg: schema[model].fields[field])
|
|
65
|
+
*
|
|
66
|
+
* If it's still unclear what this does:
|
|
67
|
+
*
|
|
68
|
+
* 1. User can define a custom fieldName.
|
|
69
|
+
* 2. When using a custom fieldName, doing something like `schema[model].fields[field]` will not work.
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
getDefaultFieldName: ({ model, field, }: {
|
|
73
|
+
model: string;
|
|
74
|
+
field: string;
|
|
75
|
+
}) => string;
|
|
76
|
+
/**
|
|
77
|
+
* Get the field attributes for a given model and field.
|
|
78
|
+
*
|
|
79
|
+
* Note: any model name or field name is allowed, whether default to schema or not.
|
|
80
|
+
*/
|
|
81
|
+
getFieldAttributes: ({ model, field, }: {
|
|
82
|
+
model: string;
|
|
83
|
+
field: string;
|
|
84
|
+
}) => DBFieldAttribute;
|
|
85
|
+
transformInput: (data: Record<string, any>, defaultModelName: string, action: "create" | "update", forceAllowId?: boolean) => Promise<Record<string, any>>;
|
|
86
|
+
transformOutput: (data: Record<string, any>, defaultModelName: string, select?: string[]) => Promise<Record<string, any>>;
|
|
87
|
+
transformWhereClause: <W extends Where[] | undefined>({ model, where, }: {
|
|
88
|
+
where: W;
|
|
89
|
+
model: string;
|
|
90
|
+
}) => W extends undefined ? undefined : CleanedWhere[];
|
|
91
|
+
}) => CustomAdapter;
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated Use `CustomAdapter` from `@better-auth/core/db/adapter` instead.
|
|
94
|
+
*/
|
|
95
|
+
interface CustomAdapter extends Omit<CustomAdapter$1, "createSchema"> {
|
|
96
|
+
createSchema?: (props: {
|
|
97
|
+
/**
|
|
98
|
+
* The file the user may have passed in to the `generate` command as the expected schema file output path.
|
|
99
|
+
*/
|
|
100
|
+
file?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The tables from the user's Better-Auth instance schema.
|
|
103
|
+
*/
|
|
104
|
+
tables: BetterAuthDBSchema;
|
|
105
|
+
}) => Promise<AdapterSchemaCreation>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated Use `CleanedWhere` from `@better-auth/core/db/adapter` instead.
|
|
109
|
+
*/
|
|
110
|
+
type CleanedWhere = Prettify<Required<Where>>;
|
|
111
|
+
type AdapterTestDebugLogs = {
|
|
112
|
+
resetDebugLogs: () => void;
|
|
113
|
+
printDebugLogs: () => void;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
type AdapterFactory = (options: BetterAuthOptions) => DBAdapter<BetterAuthOptions>;
|
|
19
117
|
declare const createAdapterFactory: ({ adapter: customAdapter, config: cfg, }: AdapterFactoryOptions) => AdapterFactory;
|
|
20
118
|
|
|
21
119
|
/**
|
|
@@ -35,5 +133,5 @@ type AdapterConfig = AdapterFactoryConfig;
|
|
|
35
133
|
*/
|
|
36
134
|
type CreateCustomAdapter = AdapterFactoryCustomizeAdapterCreator;
|
|
37
135
|
|
|
38
|
-
export {
|
|
39
|
-
export type { AdapterConfig, AdapterFactory, CreateAdapterOptions, CreateCustomAdapter };
|
|
136
|
+
export { createAdapter, createAdapterFactory };
|
|
137
|
+
export type { AdapterConfig, AdapterFactory, AdapterFactoryConfig, AdapterFactoryCustomizeAdapterCreator, AdapterFactoryOptions, AdapterTestDebugLogs, CreateAdapterOptions, CreateCustomAdapter, CustomAdapter };
|
|
@@ -1,21 +1,119 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BetterAuthOptions } from '@better-auth/core';
|
|
2
|
+
import { BetterAuthDBSchema, DBFieldAttribute } from '@better-auth/core/db';
|
|
3
|
+
import { DBAdapterFactoryConfig, Where, CustomAdapter as CustomAdapter$1, DBAdapter } from '@better-auth/core/db/adapter';
|
|
3
4
|
export * from '@better-auth/core/db/adapter';
|
|
4
|
-
import '../shared/better-auth.
|
|
5
|
-
import '../shared/better-auth.
|
|
6
|
-
import 'kysely';
|
|
7
|
-
import 'better-call';
|
|
8
|
-
import '@better-auth/core/db';
|
|
9
|
-
import 'zod';
|
|
10
|
-
import '../social-providers/index.mjs';
|
|
11
|
-
import '@better-auth/core';
|
|
12
|
-
import 'better-sqlite3';
|
|
13
|
-
import 'bun:sqlite';
|
|
14
|
-
import 'node:sqlite';
|
|
15
|
-
import 'packages/core/dist/db/adapter';
|
|
16
|
-
import 'zod/v4/core';
|
|
5
|
+
import { a as Prettify } from '../shared/better-auth.DNnBkMGu.mjs';
|
|
6
|
+
import { T as TransactionAdapter, a as AdapterSchemaCreation } from '../shared/better-auth.Bn2XUCG7.mjs';
|
|
17
7
|
|
|
18
|
-
type
|
|
8
|
+
type AdapterFactoryOptions = {
|
|
9
|
+
config: AdapterFactoryConfig;
|
|
10
|
+
adapter: AdapterFactoryCustomizeAdapterCreator;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `DBAdapterFactoryConfig` from `@better-auth/core/db/adapter` instead.
|
|
14
|
+
*/
|
|
15
|
+
interface AdapterFactoryConfig extends Omit<DBAdapterFactoryConfig<BetterAuthOptions>, "transaction"> {
|
|
16
|
+
/**
|
|
17
|
+
* Execute multiple operations in a transaction.
|
|
18
|
+
*
|
|
19
|
+
* If the database doesn't support transactions, set this to `false` and operations will be executed sequentially.
|
|
20
|
+
*
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
transaction?: false | (<R>(callback: (trx: TransactionAdapter) => Promise<R>) => Promise<R>);
|
|
24
|
+
}
|
|
25
|
+
type AdapterFactoryCustomizeAdapterCreator = (config: {
|
|
26
|
+
options: BetterAuthOptions;
|
|
27
|
+
/**
|
|
28
|
+
* The schema of the user's Better-Auth instance.
|
|
29
|
+
*/
|
|
30
|
+
schema: BetterAuthDBSchema;
|
|
31
|
+
/**
|
|
32
|
+
* The debug log function.
|
|
33
|
+
*
|
|
34
|
+
* If the config has defined `debugLogs` as `false`, no logs will be shown.
|
|
35
|
+
*/
|
|
36
|
+
debugLog: (...args: any[]) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Get the model name which is expected to be saved in the database based on the user's schema.
|
|
39
|
+
*/
|
|
40
|
+
getModelName: (model: string) => string;
|
|
41
|
+
/**
|
|
42
|
+
* Get the field name which is expected to be saved in the database based on the user's schema.
|
|
43
|
+
*/
|
|
44
|
+
getFieldName: ({ model, field }: {
|
|
45
|
+
model: string;
|
|
46
|
+
field: string;
|
|
47
|
+
}) => string;
|
|
48
|
+
/**
|
|
49
|
+
* This function helps us get the default model name from the schema defined by devs.
|
|
50
|
+
* Often times, the user will be using the `modelName` which could had been customized by the users.
|
|
51
|
+
* This function helps us get the actual model name useful to match against the schema. (eg: schema[model])
|
|
52
|
+
*
|
|
53
|
+
* If it's still unclear what this does:
|
|
54
|
+
*
|
|
55
|
+
* 1. User can define a custom modelName.
|
|
56
|
+
* 2. When using a custom modelName, doing something like `schema[model]` will not work.
|
|
57
|
+
* 3. Using this function helps us get the actual model name based on the user's defined custom modelName.
|
|
58
|
+
* 4. Thus allowing us to use `schema[model]`.
|
|
59
|
+
*/
|
|
60
|
+
getDefaultModelName: (model: string) => string;
|
|
61
|
+
/**
|
|
62
|
+
* This function helps us get the default field name from the schema defined by devs.
|
|
63
|
+
* Often times, the user will be using the `fieldName` which could had been customized by the users.
|
|
64
|
+
* This function helps us get the actual field name useful to match against the schema. (eg: schema[model].fields[field])
|
|
65
|
+
*
|
|
66
|
+
* If it's still unclear what this does:
|
|
67
|
+
*
|
|
68
|
+
* 1. User can define a custom fieldName.
|
|
69
|
+
* 2. When using a custom fieldName, doing something like `schema[model].fields[field]` will not work.
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
getDefaultFieldName: ({ model, field, }: {
|
|
73
|
+
model: string;
|
|
74
|
+
field: string;
|
|
75
|
+
}) => string;
|
|
76
|
+
/**
|
|
77
|
+
* Get the field attributes for a given model and field.
|
|
78
|
+
*
|
|
79
|
+
* Note: any model name or field name is allowed, whether default to schema or not.
|
|
80
|
+
*/
|
|
81
|
+
getFieldAttributes: ({ model, field, }: {
|
|
82
|
+
model: string;
|
|
83
|
+
field: string;
|
|
84
|
+
}) => DBFieldAttribute;
|
|
85
|
+
transformInput: (data: Record<string, any>, defaultModelName: string, action: "create" | "update", forceAllowId?: boolean) => Promise<Record<string, any>>;
|
|
86
|
+
transformOutput: (data: Record<string, any>, defaultModelName: string, select?: string[]) => Promise<Record<string, any>>;
|
|
87
|
+
transformWhereClause: <W extends Where[] | undefined>({ model, where, }: {
|
|
88
|
+
where: W;
|
|
89
|
+
model: string;
|
|
90
|
+
}) => W extends undefined ? undefined : CleanedWhere[];
|
|
91
|
+
}) => CustomAdapter;
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated Use `CustomAdapter` from `@better-auth/core/db/adapter` instead.
|
|
94
|
+
*/
|
|
95
|
+
interface CustomAdapter extends Omit<CustomAdapter$1, "createSchema"> {
|
|
96
|
+
createSchema?: (props: {
|
|
97
|
+
/**
|
|
98
|
+
* The file the user may have passed in to the `generate` command as the expected schema file output path.
|
|
99
|
+
*/
|
|
100
|
+
file?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The tables from the user's Better-Auth instance schema.
|
|
103
|
+
*/
|
|
104
|
+
tables: BetterAuthDBSchema;
|
|
105
|
+
}) => Promise<AdapterSchemaCreation>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated Use `CleanedWhere` from `@better-auth/core/db/adapter` instead.
|
|
109
|
+
*/
|
|
110
|
+
type CleanedWhere = Prettify<Required<Where>>;
|
|
111
|
+
type AdapterTestDebugLogs = {
|
|
112
|
+
resetDebugLogs: () => void;
|
|
113
|
+
printDebugLogs: () => void;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
type AdapterFactory = (options: BetterAuthOptions) => DBAdapter<BetterAuthOptions>;
|
|
19
117
|
declare const createAdapterFactory: ({ adapter: customAdapter, config: cfg, }: AdapterFactoryOptions) => AdapterFactory;
|
|
20
118
|
|
|
21
119
|
/**
|
|
@@ -35,5 +133,5 @@ type AdapterConfig = AdapterFactoryConfig;
|
|
|
35
133
|
*/
|
|
36
134
|
type CreateCustomAdapter = AdapterFactoryCustomizeAdapterCreator;
|
|
37
135
|
|
|
38
|
-
export {
|
|
39
|
-
export type { AdapterConfig, AdapterFactory, CreateAdapterOptions, CreateCustomAdapter };
|
|
136
|
+
export { createAdapter, createAdapterFactory };
|
|
137
|
+
export type { AdapterConfig, AdapterFactory, AdapterFactoryConfig, AdapterFactoryCustomizeAdapterCreator, AdapterFactoryOptions, AdapterTestDebugLogs, CreateAdapterOptions, CreateCustomAdapter, CustomAdapter };
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,21 +1,119 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BetterAuthOptions } from '@better-auth/core';
|
|
2
|
+
import { BetterAuthDBSchema, DBFieldAttribute } from '@better-auth/core/db';
|
|
3
|
+
import { DBAdapterFactoryConfig, Where, CustomAdapter as CustomAdapter$1, DBAdapter } from '@better-auth/core/db/adapter';
|
|
3
4
|
export * from '@better-auth/core/db/adapter';
|
|
4
|
-
import '../shared/better-auth.
|
|
5
|
-
import '../shared/better-auth.
|
|
6
|
-
import 'kysely';
|
|
7
|
-
import 'better-call';
|
|
8
|
-
import '@better-auth/core/db';
|
|
9
|
-
import 'zod';
|
|
10
|
-
import '../social-providers/index.js';
|
|
11
|
-
import '@better-auth/core';
|
|
12
|
-
import 'better-sqlite3';
|
|
13
|
-
import 'bun:sqlite';
|
|
14
|
-
import 'node:sqlite';
|
|
15
|
-
import 'packages/core/dist/db/adapter';
|
|
16
|
-
import 'zod/v4/core';
|
|
5
|
+
import { a as Prettify } from '../shared/better-auth.DNnBkMGu.js';
|
|
6
|
+
import { T as TransactionAdapter, a as AdapterSchemaCreation } from '../shared/better-auth.Bn2XUCG7.js';
|
|
17
7
|
|
|
18
|
-
type
|
|
8
|
+
type AdapterFactoryOptions = {
|
|
9
|
+
config: AdapterFactoryConfig;
|
|
10
|
+
adapter: AdapterFactoryCustomizeAdapterCreator;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `DBAdapterFactoryConfig` from `@better-auth/core/db/adapter` instead.
|
|
14
|
+
*/
|
|
15
|
+
interface AdapterFactoryConfig extends Omit<DBAdapterFactoryConfig<BetterAuthOptions>, "transaction"> {
|
|
16
|
+
/**
|
|
17
|
+
* Execute multiple operations in a transaction.
|
|
18
|
+
*
|
|
19
|
+
* If the database doesn't support transactions, set this to `false` and operations will be executed sequentially.
|
|
20
|
+
*
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
transaction?: false | (<R>(callback: (trx: TransactionAdapter) => Promise<R>) => Promise<R>);
|
|
24
|
+
}
|
|
25
|
+
type AdapterFactoryCustomizeAdapterCreator = (config: {
|
|
26
|
+
options: BetterAuthOptions;
|
|
27
|
+
/**
|
|
28
|
+
* The schema of the user's Better-Auth instance.
|
|
29
|
+
*/
|
|
30
|
+
schema: BetterAuthDBSchema;
|
|
31
|
+
/**
|
|
32
|
+
* The debug log function.
|
|
33
|
+
*
|
|
34
|
+
* If the config has defined `debugLogs` as `false`, no logs will be shown.
|
|
35
|
+
*/
|
|
36
|
+
debugLog: (...args: any[]) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Get the model name which is expected to be saved in the database based on the user's schema.
|
|
39
|
+
*/
|
|
40
|
+
getModelName: (model: string) => string;
|
|
41
|
+
/**
|
|
42
|
+
* Get the field name which is expected to be saved in the database based on the user's schema.
|
|
43
|
+
*/
|
|
44
|
+
getFieldName: ({ model, field }: {
|
|
45
|
+
model: string;
|
|
46
|
+
field: string;
|
|
47
|
+
}) => string;
|
|
48
|
+
/**
|
|
49
|
+
* This function helps us get the default model name from the schema defined by devs.
|
|
50
|
+
* Often times, the user will be using the `modelName` which could had been customized by the users.
|
|
51
|
+
* This function helps us get the actual model name useful to match against the schema. (eg: schema[model])
|
|
52
|
+
*
|
|
53
|
+
* If it's still unclear what this does:
|
|
54
|
+
*
|
|
55
|
+
* 1. User can define a custom modelName.
|
|
56
|
+
* 2. When using a custom modelName, doing something like `schema[model]` will not work.
|
|
57
|
+
* 3. Using this function helps us get the actual model name based on the user's defined custom modelName.
|
|
58
|
+
* 4. Thus allowing us to use `schema[model]`.
|
|
59
|
+
*/
|
|
60
|
+
getDefaultModelName: (model: string) => string;
|
|
61
|
+
/**
|
|
62
|
+
* This function helps us get the default field name from the schema defined by devs.
|
|
63
|
+
* Often times, the user will be using the `fieldName` which could had been customized by the users.
|
|
64
|
+
* This function helps us get the actual field name useful to match against the schema. (eg: schema[model].fields[field])
|
|
65
|
+
*
|
|
66
|
+
* If it's still unclear what this does:
|
|
67
|
+
*
|
|
68
|
+
* 1. User can define a custom fieldName.
|
|
69
|
+
* 2. When using a custom fieldName, doing something like `schema[model].fields[field]` will not work.
|
|
70
|
+
*
|
|
71
|
+
*/
|
|
72
|
+
getDefaultFieldName: ({ model, field, }: {
|
|
73
|
+
model: string;
|
|
74
|
+
field: string;
|
|
75
|
+
}) => string;
|
|
76
|
+
/**
|
|
77
|
+
* Get the field attributes for a given model and field.
|
|
78
|
+
*
|
|
79
|
+
* Note: any model name or field name is allowed, whether default to schema or not.
|
|
80
|
+
*/
|
|
81
|
+
getFieldAttributes: ({ model, field, }: {
|
|
82
|
+
model: string;
|
|
83
|
+
field: string;
|
|
84
|
+
}) => DBFieldAttribute;
|
|
85
|
+
transformInput: (data: Record<string, any>, defaultModelName: string, action: "create" | "update", forceAllowId?: boolean) => Promise<Record<string, any>>;
|
|
86
|
+
transformOutput: (data: Record<string, any>, defaultModelName: string, select?: string[]) => Promise<Record<string, any>>;
|
|
87
|
+
transformWhereClause: <W extends Where[] | undefined>({ model, where, }: {
|
|
88
|
+
where: W;
|
|
89
|
+
model: string;
|
|
90
|
+
}) => W extends undefined ? undefined : CleanedWhere[];
|
|
91
|
+
}) => CustomAdapter;
|
|
92
|
+
/**
|
|
93
|
+
* @deprecated Use `CustomAdapter` from `@better-auth/core/db/adapter` instead.
|
|
94
|
+
*/
|
|
95
|
+
interface CustomAdapter extends Omit<CustomAdapter$1, "createSchema"> {
|
|
96
|
+
createSchema?: (props: {
|
|
97
|
+
/**
|
|
98
|
+
* The file the user may have passed in to the `generate` command as the expected schema file output path.
|
|
99
|
+
*/
|
|
100
|
+
file?: string;
|
|
101
|
+
/**
|
|
102
|
+
* The tables from the user's Better-Auth instance schema.
|
|
103
|
+
*/
|
|
104
|
+
tables: BetterAuthDBSchema;
|
|
105
|
+
}) => Promise<AdapterSchemaCreation>;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* @deprecated Use `CleanedWhere` from `@better-auth/core/db/adapter` instead.
|
|
109
|
+
*/
|
|
110
|
+
type CleanedWhere = Prettify<Required<Where>>;
|
|
111
|
+
type AdapterTestDebugLogs = {
|
|
112
|
+
resetDebugLogs: () => void;
|
|
113
|
+
printDebugLogs: () => void;
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
type AdapterFactory = (options: BetterAuthOptions) => DBAdapter<BetterAuthOptions>;
|
|
19
117
|
declare const createAdapterFactory: ({ adapter: customAdapter, config: cfg, }: AdapterFactoryOptions) => AdapterFactory;
|
|
20
118
|
|
|
21
119
|
/**
|
|
@@ -35,5 +133,5 @@ type AdapterConfig = AdapterFactoryConfig;
|
|
|
35
133
|
*/
|
|
36
134
|
type CreateCustomAdapter = AdapterFactoryCustomizeAdapterCreator;
|
|
37
135
|
|
|
38
|
-
export {
|
|
39
|
-
export type { AdapterConfig, AdapterFactory, CreateAdapterOptions, CreateCustomAdapter };
|
|
136
|
+
export { createAdapter, createAdapterFactory };
|
|
137
|
+
export type { AdapterConfig, AdapterFactory, AdapterFactoryConfig, AdapterFactoryCustomizeAdapterCreator, AdapterFactoryOptions, AdapterTestDebugLogs, CreateAdapterOptions, CreateCustomAdapter, CustomAdapter };
|