better-auth 1.2.12 → 1.3.0-beta.4
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 +2 -3
- package/dist/adapters/drizzle-adapter/index.d.cts +3 -3
- package/dist/adapters/drizzle-adapter/index.d.mts +3 -3
- package/dist/adapters/drizzle-adapter/index.d.ts +3 -3
- package/dist/adapters/drizzle-adapter/index.mjs +2 -3
- package/dist/adapters/index.cjs +2 -3
- package/dist/adapters/index.d.cts +4 -4
- package/dist/adapters/index.d.mts +4 -4
- package/dist/adapters/index.d.ts +4 -4
- package/dist/adapters/index.mjs +2 -3
- package/dist/adapters/kysely-adapter/index.cjs +3 -4
- package/dist/adapters/kysely-adapter/index.d.cts +3 -3
- package/dist/adapters/kysely-adapter/index.d.mts +3 -3
- package/dist/adapters/kysely-adapter/index.d.ts +3 -3
- package/dist/adapters/kysely-adapter/index.mjs +3 -4
- package/dist/adapters/memory-adapter/index.cjs +3 -4
- package/dist/adapters/memory-adapter/index.d.cts +3 -3
- package/dist/adapters/memory-adapter/index.d.mts +3 -3
- package/dist/adapters/memory-adapter/index.d.ts +3 -3
- package/dist/adapters/memory-adapter/index.mjs +3 -4
- package/dist/adapters/mongodb-adapter/index.cjs +6 -238
- package/dist/adapters/mongodb-adapter/index.d.cts +3 -3
- package/dist/adapters/mongodb-adapter/index.d.mts +3 -3
- package/dist/adapters/mongodb-adapter/index.d.ts +3 -3
- package/dist/adapters/mongodb-adapter/index.mjs +4 -240
- package/dist/adapters/prisma-adapter/index.cjs +2 -3
- package/dist/adapters/prisma-adapter/index.d.cts +3 -3
- package/dist/adapters/prisma-adapter/index.d.mts +3 -3
- package/dist/adapters/prisma-adapter/index.d.ts +3 -3
- package/dist/adapters/prisma-adapter/index.mjs +2 -3
- package/dist/adapters/test.cjs +2 -3
- package/dist/adapters/test.d.cts +3 -3
- package/dist/adapters/test.d.mts +3 -3
- package/dist/adapters/test.d.ts +3 -3
- package/dist/adapters/test.mjs +1 -2
- package/dist/api/index.cjs +91 -95
- package/dist/api/index.d.cts +3 -3
- package/dist/api/index.d.mts +3 -3
- package/dist/api/index.d.ts +3 -3
- package/dist/api/index.mjs +9 -13
- package/dist/client/index.cjs +4 -32
- package/dist/client/index.d.cts +5 -5
- package/dist/client/index.d.mts +5 -5
- package/dist/client/index.d.ts +5 -5
- package/dist/client/index.mjs +4 -32
- package/dist/client/plugins/index.d.cts +5 -5
- package/dist/client/plugins/index.d.mts +5 -5
- package/dist/client/plugins/index.d.ts +5 -5
- package/dist/client/react/index.d.cts +10 -10
- package/dist/client/react/index.d.mts +10 -10
- package/dist/client/react/index.d.ts +10 -10
- package/dist/client/solid/index.d.cts +4 -4
- package/dist/client/solid/index.d.mts +4 -4
- package/dist/client/solid/index.d.ts +4 -4
- package/dist/client/svelte/index.d.cts +10 -10
- package/dist/client/svelte/index.d.mts +10 -10
- package/dist/client/svelte/index.d.ts +10 -10
- package/dist/client/vue/index.d.cts +4 -4
- package/dist/client/vue/index.d.mts +4 -4
- package/dist/client/vue/index.d.ts +4 -4
- package/dist/cookies/index.d.cts +3 -3
- package/dist/cookies/index.d.mts +3 -3
- package/dist/cookies/index.d.ts +3 -3
- package/dist/db/index.cjs +5 -6
- package/dist/db/index.d.cts +4 -4
- package/dist/db/index.d.mts +4 -4
- package/dist/db/index.d.ts +4 -4
- package/dist/db/index.mjs +5 -6
- package/dist/index.cjs +36 -251
- package/dist/index.d.cts +5 -5
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.mjs +28 -250
- package/dist/integrations/next-js.cjs +4 -8
- package/dist/integrations/next-js.d.cts +3 -3
- package/dist/integrations/next-js.d.mts +3 -3
- package/dist/integrations/next-js.d.ts +3 -3
- package/dist/integrations/next-js.mjs +3 -7
- package/dist/integrations/node.d.cts +3 -3
- package/dist/integrations/node.d.mts +3 -3
- package/dist/integrations/node.d.ts +3 -3
- package/dist/integrations/react-start.cjs +4 -8
- package/dist/integrations/react-start.d.cts +3 -3
- package/dist/integrations/react-start.d.mts +3 -3
- package/dist/integrations/react-start.d.ts +3 -3
- package/dist/integrations/react-start.mjs +3 -7
- package/dist/integrations/svelte-kit.cjs +70 -0
- package/dist/integrations/svelte-kit.d.cts +14 -5
- package/dist/integrations/svelte-kit.d.mts +14 -5
- package/dist/integrations/svelte-kit.d.ts +14 -5
- package/dist/integrations/svelte-kit.mjs +70 -1
- package/dist/oauth2/index.cjs +27 -15
- package/dist/oauth2/index.d.cts +46 -6
- package/dist/oauth2/index.d.mts +46 -6
- package/dist/oauth2/index.d.ts +46 -6
- package/dist/oauth2/index.mjs +17 -6
- 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/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/index.cjs +17 -21
- package/dist/plugins/admin/index.d.cts +15 -15
- package/dist/plugins/admin/index.d.mts +15 -15
- package/dist/plugins/admin/index.d.ts +15 -15
- package/dist/plugins/admin/index.mjs +17 -21
- package/dist/plugins/anonymous/index.cjs +11 -15
- package/dist/plugins/anonymous/index.d.cts +4 -4
- package/dist/plugins/anonymous/index.d.mts +4 -4
- package/dist/plugins/anonymous/index.d.ts +4 -4
- package/dist/plugins/anonymous/index.mjs +8 -12
- package/dist/plugins/bearer/index.cjs +7 -11
- package/dist/plugins/bearer/index.d.cts +3 -3
- package/dist/plugins/bearer/index.d.mts +3 -3
- package/dist/plugins/bearer/index.d.ts +3 -3
- package/dist/plugins/bearer/index.mjs +5 -9
- package/dist/plugins/captcha/index.d.cts +3 -3
- package/dist/plugins/captcha/index.d.mts +3 -3
- package/dist/plugins/captcha/index.d.ts +3 -3
- package/dist/plugins/custom-session/index.cjs +12 -16
- package/dist/plugins/custom-session/index.d.cts +3 -3
- package/dist/plugins/custom-session/index.d.mts +3 -3
- package/dist/plugins/custom-session/index.d.ts +3 -3
- package/dist/plugins/custom-session/index.mjs +10 -14
- package/dist/plugins/email-otp/index.cjs +20 -17
- package/dist/plugins/email-otp/index.d.cts +12 -12
- package/dist/plugins/email-otp/index.d.mts +12 -12
- package/dist/plugins/email-otp/index.d.ts +12 -12
- package/dist/plugins/email-otp/index.mjs +12 -9
- package/dist/plugins/generic-oauth/index.cjs +23 -27
- package/dist/plugins/generic-oauth/index.d.cts +13 -13
- package/dist/plugins/generic-oauth/index.d.mts +13 -13
- package/dist/plugins/generic-oauth/index.d.ts +13 -13
- package/dist/plugins/generic-oauth/index.mjs +5 -9
- package/dist/plugins/haveibeenpwned/index.cjs +9 -13
- package/dist/plugins/haveibeenpwned/index.d.cts +3 -3
- package/dist/plugins/haveibeenpwned/index.d.mts +3 -3
- package/dist/plugins/haveibeenpwned/index.d.ts +3 -3
- package/dist/plugins/haveibeenpwned/index.mjs +9 -13
- package/dist/plugins/index.cjs +32 -36
- package/dist/plugins/index.d.cts +5 -5
- package/dist/plugins/index.d.mts +5 -5
- package/dist/plugins/index.d.ts +5 -5
- package/dist/plugins/index.mjs +9 -13
- package/dist/plugins/jwt/index.cjs +12 -16
- package/dist/plugins/jwt/index.d.cts +7 -7
- package/dist/plugins/jwt/index.d.mts +7 -7
- package/dist/plugins/jwt/index.d.ts +7 -7
- package/dist/plugins/jwt/index.mjs +8 -12
- package/dist/plugins/magic-link/index.cjs +9 -13
- package/dist/plugins/magic-link/index.d.cts +3 -3
- package/dist/plugins/magic-link/index.d.mts +3 -3
- package/dist/plugins/magic-link/index.d.ts +3 -3
- package/dist/plugins/magic-link/index.mjs +5 -9
- package/dist/plugins/multi-session/index.cjs +15 -19
- package/dist/plugins/multi-session/index.d.cts +11 -11
- package/dist/plugins/multi-session/index.d.mts +11 -11
- package/dist/plugins/multi-session/index.d.ts +11 -11
- package/dist/plugins/multi-session/index.mjs +8 -12
- package/dist/plugins/oauth-proxy/index.cjs +13 -17
- package/dist/plugins/oauth-proxy/index.d.cts +3 -3
- package/dist/plugins/oauth-proxy/index.d.mts +3 -3
- package/dist/plugins/oauth-proxy/index.d.ts +3 -3
- package/dist/plugins/oauth-proxy/index.mjs +9 -13
- package/dist/plugins/oidc-provider/index.cjs +6 -10
- package/dist/plugins/oidc-provider/index.d.cts +14 -14
- package/dist/plugins/oidc-provider/index.d.mts +14 -14
- package/dist/plugins/oidc-provider/index.d.ts +14 -14
- package/dist/plugins/oidc-provider/index.mjs +6 -10
- package/dist/plugins/one-tap/index.cjs +8 -12
- package/dist/plugins/one-tap/index.mjs +7 -11
- package/dist/plugins/one-time-token/index.cjs +8 -12
- package/dist/plugins/one-time-token/index.d.cts +7 -7
- package/dist/plugins/one-time-token/index.d.mts +7 -7
- package/dist/plugins/one-time-token/index.d.ts +7 -7
- package/dist/plugins/one-time-token/index.mjs +5 -9
- package/dist/plugins/open-api/index.cjs +4 -8
- package/dist/plugins/open-api/index.d.cts +3 -3
- package/dist/plugins/open-api/index.d.mts +3 -3
- package/dist/plugins/open-api/index.d.ts +3 -3
- package/dist/plugins/open-api/index.mjs +2 -6
- 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/index.cjs +17 -21
- package/dist/plugins/organization/index.d.cts +17 -5
- package/dist/plugins/organization/index.d.mts +17 -5
- package/dist/plugins/organization/index.d.ts +17 -5
- package/dist/plugins/organization/index.mjs +17 -21
- package/dist/plugins/passkey/index.cjs +23 -27
- package/dist/plugins/passkey/index.d.cts +30 -30
- package/dist/plugins/passkey/index.d.mts +30 -30
- package/dist/plugins/passkey/index.d.ts +30 -30
- package/dist/plugins/passkey/index.mjs +4 -8
- package/dist/plugins/phone-number/index.cjs +22 -23
- package/dist/plugins/phone-number/index.d.cts +6 -6
- package/dist/plugins/phone-number/index.d.mts +6 -6
- package/dist/plugins/phone-number/index.d.ts +6 -6
- package/dist/plugins/phone-number/index.mjs +10 -11
- package/dist/plugins/sso/index.cjs +18 -22
- package/dist/plugins/sso/index.d.cts +39 -39
- package/dist/plugins/sso/index.d.mts +39 -39
- package/dist/plugins/sso/index.d.ts +39 -39
- package/dist/plugins/sso/index.mjs +5 -9
- package/dist/plugins/two-factor/index.cjs +24 -28
- package/dist/plugins/two-factor/index.d.cts +19 -19
- package/dist/plugins/two-factor/index.d.mts +19 -19
- package/dist/plugins/two-factor/index.d.ts +19 -19
- package/dist/plugins/two-factor/index.mjs +5 -9
- package/dist/plugins/username/index.cjs +52 -20
- package/dist/plugins/username/index.d.cts +49 -4
- package/dist/plugins/username/index.d.mts +49 -4
- package/dist/plugins/username/index.d.ts +49 -4
- package/dist/plugins/username/index.mjs +44 -12
- package/dist/shared/{better-auth.Bi8FQwDD.d.cts → better-auth.9XhOL8gb.d.cts} +1 -1
- package/dist/shared/{better-auth.Bi8FQwDD.d.mts → better-auth.9XhOL8gb.d.mts} +1 -1
- package/dist/shared/{better-auth.Bi8FQwDD.d.ts → better-auth.9XhOL8gb.d.ts} +1 -1
- package/dist/shared/{better-auth.C4F0dkzb.mjs → better-auth.B1UvcDzZ.mjs} +1 -1
- package/dist/shared/{better-auth.DR_PtKzV.cjs → better-auth.B7Dt9CoJ.cjs} +21 -21
- package/dist/shared/better-auth.BADPR_mT.mjs +33 -0
- package/dist/shared/{better-auth._1abrCm_.d.cts → better-auth.BEKm37Eq.d.mts} +99 -4
- package/dist/shared/better-auth.BK4bljal.cjs +240 -0
- package/dist/shared/{better-auth.BDi4weGR.d.cts → better-auth.BxzpFmqs.d.mts} +41 -41
- package/dist/shared/{better-auth.Dtt7bfEz.d.mts → better-auth.BzQpV2kN.d.cts} +1 -1
- package/dist/shared/{better-auth.DFIAchwv.mjs → better-auth.C3eCZf9N.mjs} +1 -2
- package/dist/shared/{better-auth.xcRi-2W1.mjs → better-auth.CBQcGOAy.mjs} +2 -3
- package/dist/shared/{better-auth.Da_FnxgM.d.ts → better-auth.CC9Ms4aB.d.cts} +99 -4
- package/dist/shared/{better-auth.DtA2vm5a.cjs → better-auth.CGOCIshw.cjs} +2 -3
- package/dist/shared/{better-auth.CgpCaX93.d.mts → better-auth.CJByo5vt.d.ts} +99 -4
- package/dist/shared/{better-auth.s42pDYq8.mjs → better-auth.CRISE-Is.mjs} +2 -2
- package/dist/shared/{better-auth.sSsaCPh_.cjs → better-auth.CTYN90cw.cjs} +10 -9
- package/dist/shared/{better-auth.GpOOav9x.cjs → better-auth.CXhVNgXP.cjs} +7 -0
- package/dist/shared/{better-auth.DYZIqEOq.cjs → better-auth.CkL-IpXS.cjs} +1 -1
- package/dist/shared/{better-auth.cM0Fc3LZ.mjs → better-auth.ClyLnOjY.mjs} +2010 -17
- package/dist/shared/better-auth.Cr25WPaS.cjs +35 -0
- package/dist/shared/{better-auth.DzXKowfw.d.mts → better-auth.D-rDifxj.d.ts} +2 -2
- package/dist/shared/{better-auth.D1AOCQXJ.cjs → better-auth.D0zUlh1z.cjs} +42 -43
- package/dist/shared/{better-auth.CdTbMvS8.d.mts → better-auth.D3SwPO56.d.cts} +41 -41
- package/dist/shared/{better-auth.Cqykj82J.mjs → better-auth.DBGfIDnh.mjs} +7 -1
- package/dist/shared/{better-auth.B30VphQV.mjs → better-auth.DBODKok7.mjs} +2 -2
- package/dist/shared/better-auth.DEj39-fy.mjs +252 -0
- package/dist/shared/{better-auth.VZajia71.d.cts → better-auth.DVPJntsB.d.mts} +1 -1
- package/dist/shared/{better-auth.p6Acef0D.d.ts → better-auth.DZKkrxpr.d.ts} +3 -3
- package/dist/shared/{better-auth.-5OPYG5K.d.ts → better-auth.DjkhD5zP.d.ts} +1 -1
- package/dist/shared/{better-auth.BzwQYq5t.cjs → better-auth.Ds-w2spb.cjs} +2055 -28
- package/dist/shared/{better-auth.MQKGNeOa.d.cts → better-auth.EtzduzaF.d.cts} +3 -3
- package/dist/shared/{better-auth.BGG5f0S_.mjs → better-auth.J-FkYMpb.mjs} +9 -8
- package/dist/shared/better-auth.KCmQsDm-.cjs +254 -0
- package/dist/shared/{better-auth.BCaUEQgP.mjs → better-auth.Lq361xtr.mjs} +1 -1
- package/dist/shared/{better-auth.DB7CAtwD.cjs → better-auth.RTMLk2Ya.cjs} +14 -14
- package/dist/shared/{better-auth.DdmVKCUf.d.ts → better-auth.UFMnMTeX.d.ts} +41 -41
- package/dist/shared/{better-auth.Ay7JnuoB.d.cts → better-auth.UKdFtWX0.d.mts} +2 -2
- package/dist/shared/{better-auth.Aoa2V3YJ.d.mts → better-auth.WBEBOTsK.d.mts} +3 -3
- package/dist/shared/better-auth.ZAqiQx_W.mjs +238 -0
- package/dist/shared/{better-auth.DJddnb96.cjs → better-auth._dAJf_oa.cjs} +1 -1
- package/dist/shared/{better-auth.BxeO9LMD.d.ts → better-auth.gttVRrLD.d.cts} +2 -2
- package/dist/social-providers/index.cjs +46 -1659
- package/dist/social-providers/index.d.cts +2 -2
- package/dist/social-providers/index.d.mts +2 -2
- package/dist/social-providers/index.d.ts +2 -2
- package/dist/social-providers/index.mjs +18 -1636
- package/dist/test-utils/index.cjs +39608 -0
- package/dist/test-utils/index.d.cts +52127 -0
- package/dist/test-utils/index.d.mts +52127 -0
- package/dist/test-utils/index.d.ts +52127 -0
- package/dist/test-utils/index.mjs +39588 -0
- package/dist/types/index.d.cts +4 -4
- package/dist/types/index.d.mts +4 -4
- package/dist/types/index.d.ts +4 -4
- package/package.json +24 -1
- package/dist/shared/better-auth.6XyKj7DG.cjs +0 -211
- package/dist/shared/better-auth.BUPPRXfK.mjs +0 -7
- package/dist/shared/better-auth.Bg6iw3ig.cjs +0 -9
- package/dist/shared/better-auth.DMLYdcsC.cjs +0 -96
- package/dist/shared/better-auth.DPBqdYQ3.mjs +0 -93
- package/dist/shared/better-auth.DufyW0qf.mjs +0 -203
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
const drizzleOrm = require('drizzle-orm');
|
|
4
4
|
const index$1 = require('../../shared/better-auth.ANpbi45u.cjs');
|
|
5
|
-
const index = require('../../shared/better-auth.
|
|
5
|
+
const index = require('../../shared/better-auth.CGOCIshw.cjs');
|
|
6
6
|
require('../../shared/better-auth.D3mtHEZg.cjs');
|
|
7
7
|
require('../../shared/better-auth.BEphVDyL.cjs');
|
|
8
|
-
require('../../shared/better-auth.
|
|
8
|
+
require('../../shared/better-auth.CXhVNgXP.cjs');
|
|
9
9
|
require('@better-auth/utils/random');
|
|
10
10
|
require('zod');
|
|
11
11
|
require('better-call');
|
|
@@ -20,7 +20,6 @@ require('@better-auth/utils');
|
|
|
20
20
|
require('@better-auth/utils/hex');
|
|
21
21
|
require('@noble/hashes/utils');
|
|
22
22
|
require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
23
|
-
require('../../shared/better-auth.GpOOav9x.cjs');
|
|
24
23
|
|
|
25
24
|
const drizzleAdapter = (db, config) => index.createAdapter({
|
|
26
25
|
config: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.
|
|
2
|
-
import '../../shared/better-auth.
|
|
1
|
+
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.D3SwPO56.cjs';
|
|
2
|
+
import '../../shared/better-auth.9XhOL8gb.cjs';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import '../../shared/better-auth.
|
|
4
|
+
import '../../shared/better-auth.CC9Ms4aB.cjs';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import 'better-call';
|
|
7
7
|
import 'better-sqlite3';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.
|
|
2
|
-
import '../../shared/better-auth.
|
|
1
|
+
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.BxzpFmqs.mjs';
|
|
2
|
+
import '../../shared/better-auth.9XhOL8gb.mjs';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import '../../shared/better-auth.
|
|
4
|
+
import '../../shared/better-auth.BEKm37Eq.mjs';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import 'better-call';
|
|
7
7
|
import 'better-sqlite3';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.
|
|
2
|
-
import '../../shared/better-auth.
|
|
1
|
+
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.UFMnMTeX.js';
|
|
2
|
+
import '../../shared/better-auth.9XhOL8gb.js';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import '../../shared/better-auth.
|
|
4
|
+
import '../../shared/better-auth.CJByo5vt.js';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import 'better-call';
|
|
7
7
|
import 'better-sqlite3';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { count, desc, asc, sql, eq, inArray, like, lt, lte, ne, gt, gte, and, or } from 'drizzle-orm';
|
|
2
2
|
import { B as BetterAuthError } from '../../shared/better-auth.DdzSJf-n.mjs';
|
|
3
|
-
import { c as createAdapter } from '../../shared/better-auth.
|
|
3
|
+
import { c as createAdapter } from '../../shared/better-auth.C3eCZf9N.mjs';
|
|
4
4
|
import '../../shared/better-auth.tB5eU6EY.mjs';
|
|
5
5
|
import '../../shared/better-auth.DORkW_Ge.mjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.DBGfIDnh.mjs';
|
|
7
7
|
import '@better-auth/utils/random';
|
|
8
8
|
import 'zod';
|
|
9
9
|
import 'better-call';
|
|
@@ -18,7 +18,6 @@ import '@better-auth/utils';
|
|
|
18
18
|
import '@better-auth/utils/hex';
|
|
19
19
|
import '@noble/hashes/utils';
|
|
20
20
|
import '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
21
|
-
import '../../shared/better-auth.Cqykj82J.mjs';
|
|
22
21
|
|
|
23
22
|
const drizzleAdapter = (db, config) => createAdapter({
|
|
24
23
|
config: {
|
package/dist/adapters/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('../shared/better-auth.
|
|
3
|
+
const index = require('../shared/better-auth.CGOCIshw.cjs');
|
|
4
4
|
require('../shared/better-auth.D3mtHEZg.cjs');
|
|
5
5
|
require('../shared/better-auth.BEphVDyL.cjs');
|
|
6
|
-
require('../shared/better-auth.
|
|
6
|
+
require('../shared/better-auth.CXhVNgXP.cjs');
|
|
7
7
|
require('@better-auth/utils/random');
|
|
8
8
|
require('zod');
|
|
9
9
|
require('better-call');
|
|
@@ -18,7 +18,6 @@ require('@better-auth/utils');
|
|
|
18
18
|
require('@better-auth/utils/hex');
|
|
19
19
|
require('@noble/hashes/utils');
|
|
20
20
|
require('../shared/better-auth.CYeOI8C-.cjs');
|
|
21
|
-
require('../shared/better-auth.GpOOav9x.cjs');
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { b as AdapterConfig, C as CreateCustomAdapter, B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.
|
|
2
|
-
export { A as AdapterDebugLogs, e as AdapterTestDebugLogs, d as CleanedWhere, c as CustomAdapter } from '../shared/better-auth.
|
|
3
|
-
import '../shared/better-auth.
|
|
1
|
+
import { b as AdapterConfig, C as CreateCustomAdapter, B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.D3SwPO56.cjs';
|
|
2
|
+
export { A as AdapterDebugLogs, e as AdapterTestDebugLogs, d as CleanedWhere, c as CustomAdapter } from '../shared/better-auth.D3SwPO56.cjs';
|
|
3
|
+
import '../shared/better-auth.9XhOL8gb.cjs';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../shared/better-auth.
|
|
5
|
+
import '../shared/better-auth.CC9Ms4aB.cjs';
|
|
6
6
|
import 'kysely';
|
|
7
7
|
import 'better-call';
|
|
8
8
|
import 'better-sqlite3';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { b as AdapterConfig, C as CreateCustomAdapter, B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.
|
|
2
|
-
export { A as AdapterDebugLogs, e as AdapterTestDebugLogs, d as CleanedWhere, c as CustomAdapter } from '../shared/better-auth.
|
|
3
|
-
import '../shared/better-auth.
|
|
1
|
+
import { b as AdapterConfig, C as CreateCustomAdapter, B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.BxzpFmqs.mjs';
|
|
2
|
+
export { A as AdapterDebugLogs, e as AdapterTestDebugLogs, d as CleanedWhere, c as CustomAdapter } from '../shared/better-auth.BxzpFmqs.mjs';
|
|
3
|
+
import '../shared/better-auth.9XhOL8gb.mjs';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../shared/better-auth.
|
|
5
|
+
import '../shared/better-auth.BEKm37Eq.mjs';
|
|
6
6
|
import 'kysely';
|
|
7
7
|
import 'better-call';
|
|
8
8
|
import 'better-sqlite3';
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { b as AdapterConfig, C as CreateCustomAdapter, B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.
|
|
2
|
-
export { A as AdapterDebugLogs, e as AdapterTestDebugLogs, d as CleanedWhere, c as CustomAdapter } from '../shared/better-auth.
|
|
3
|
-
import '../shared/better-auth.
|
|
1
|
+
import { b as AdapterConfig, C as CreateCustomAdapter, B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.UFMnMTeX.js';
|
|
2
|
+
export { A as AdapterDebugLogs, e as AdapterTestDebugLogs, d as CleanedWhere, c as CustomAdapter } from '../shared/better-auth.UFMnMTeX.js';
|
|
3
|
+
import '../shared/better-auth.9XhOL8gb.js';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../shared/better-auth.
|
|
5
|
+
import '../shared/better-auth.CJByo5vt.js';
|
|
6
6
|
import 'kysely';
|
|
7
7
|
import 'better-call';
|
|
8
8
|
import 'better-sqlite3';
|
package/dist/adapters/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { c as createAdapter } from '../shared/better-auth.
|
|
1
|
+
export { c as createAdapter } from '../shared/better-auth.C3eCZf9N.mjs';
|
|
2
2
|
import '../shared/better-auth.tB5eU6EY.mjs';
|
|
3
3
|
import '../shared/better-auth.DORkW_Ge.mjs';
|
|
4
|
-
import '../shared/better-auth.
|
|
4
|
+
import '../shared/better-auth.DBGfIDnh.mjs';
|
|
5
5
|
import '@better-auth/utils/random';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'better-call';
|
|
@@ -16,4 +16,3 @@ import '@better-auth/utils';
|
|
|
16
16
|
import '@better-auth/utils/hex';
|
|
17
17
|
import '@noble/hashes/utils';
|
|
18
18
|
import '../shared/better-auth.B4Qoxdgc.mjs';
|
|
19
|
-
import '../shared/better-auth.Cqykj82J.mjs';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const kyselyAdapter = require('../../shared/better-auth.
|
|
3
|
+
const kyselyAdapter = require('../../shared/better-auth._dAJf_oa.cjs');
|
|
4
4
|
require('kysely');
|
|
5
|
-
require('../../shared/better-auth.
|
|
5
|
+
require('../../shared/better-auth.CGOCIshw.cjs');
|
|
6
6
|
require('../../shared/better-auth.D3mtHEZg.cjs');
|
|
7
7
|
require('../../shared/better-auth.BEphVDyL.cjs');
|
|
8
|
-
require('../../shared/better-auth.
|
|
8
|
+
require('../../shared/better-auth.CXhVNgXP.cjs');
|
|
9
9
|
require('@better-auth/utils/random');
|
|
10
10
|
require('zod');
|
|
11
11
|
require('better-call');
|
|
@@ -20,7 +20,6 @@ require('@better-auth/utils');
|
|
|
20
20
|
require('@better-auth/utils/hex');
|
|
21
21
|
require('@noble/hashes/utils');
|
|
22
22
|
require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
23
|
-
require('../../shared/better-auth.GpOOav9x.cjs');
|
|
24
23
|
|
|
25
24
|
|
|
26
25
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Kysely } from 'kysely';
|
|
2
|
-
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.
|
|
3
|
-
import '../../shared/better-auth.
|
|
2
|
+
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.D3SwPO56.cjs';
|
|
3
|
+
import '../../shared/better-auth.9XhOL8gb.cjs';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../shared/better-auth.
|
|
5
|
+
import '../../shared/better-auth.CC9Ms4aB.cjs';
|
|
6
6
|
import 'better-call';
|
|
7
7
|
import 'better-sqlite3';
|
|
8
8
|
import 'bun:sqlite';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Kysely } from 'kysely';
|
|
2
|
-
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.
|
|
3
|
-
import '../../shared/better-auth.
|
|
2
|
+
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.BxzpFmqs.mjs';
|
|
3
|
+
import '../../shared/better-auth.9XhOL8gb.mjs';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../shared/better-auth.
|
|
5
|
+
import '../../shared/better-auth.BEKm37Eq.mjs';
|
|
6
6
|
import 'better-call';
|
|
7
7
|
import 'better-sqlite3';
|
|
8
8
|
import 'bun:sqlite';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Kysely } from 'kysely';
|
|
2
|
-
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.
|
|
3
|
-
import '../../shared/better-auth.
|
|
2
|
+
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.UFMnMTeX.js';
|
|
3
|
+
import '../../shared/better-auth.9XhOL8gb.js';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../shared/better-auth.
|
|
5
|
+
import '../../shared/better-auth.CJByo5vt.js';
|
|
6
6
|
import 'better-call';
|
|
7
7
|
import 'better-sqlite3';
|
|
8
8
|
import 'bun:sqlite';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { c as createKyselyAdapter, k as kyselyAdapter } from '../../shared/better-auth.
|
|
1
|
+
export { c as createKyselyAdapter, k as kyselyAdapter } from '../../shared/better-auth.B1UvcDzZ.mjs';
|
|
2
2
|
import 'kysely';
|
|
3
|
-
import '../../shared/better-auth.
|
|
3
|
+
import '../../shared/better-auth.C3eCZf9N.mjs';
|
|
4
4
|
import '../../shared/better-auth.tB5eU6EY.mjs';
|
|
5
5
|
import '../../shared/better-auth.DORkW_Ge.mjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.DBGfIDnh.mjs';
|
|
7
7
|
import '@better-auth/utils/random';
|
|
8
8
|
import 'zod';
|
|
9
9
|
import 'better-call';
|
|
@@ -18,4 +18,3 @@ import '@better-auth/utils';
|
|
|
18
18
|
import '@better-auth/utils/hex';
|
|
19
19
|
import '@noble/hashes/utils';
|
|
20
20
|
import '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
21
|
-
import '../../shared/better-auth.Cqykj82J.mjs';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const memoryAdapter = require('../../shared/better-auth.
|
|
4
|
-
require('../../shared/better-auth.
|
|
3
|
+
const memoryAdapter = require('../../shared/better-auth.CkL-IpXS.cjs');
|
|
4
|
+
require('../../shared/better-auth.CGOCIshw.cjs');
|
|
5
5
|
require('../../shared/better-auth.D3mtHEZg.cjs');
|
|
6
6
|
require('../../shared/better-auth.BEphVDyL.cjs');
|
|
7
|
-
require('../../shared/better-auth.
|
|
7
|
+
require('../../shared/better-auth.CXhVNgXP.cjs');
|
|
8
8
|
require('@better-auth/utils/random');
|
|
9
9
|
require('zod');
|
|
10
10
|
require('better-call');
|
|
@@ -19,7 +19,6 @@ require('@better-auth/utils');
|
|
|
19
19
|
require('@better-auth/utils/hex');
|
|
20
20
|
require('@noble/hashes/utils');
|
|
21
21
|
require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
22
|
-
require('../../shared/better-auth.GpOOav9x.cjs');
|
|
23
22
|
|
|
24
23
|
|
|
25
24
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.
|
|
2
|
-
import '../../shared/better-auth.
|
|
1
|
+
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.D3SwPO56.cjs';
|
|
2
|
+
import '../../shared/better-auth.9XhOL8gb.cjs';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import '../../shared/better-auth.
|
|
4
|
+
import '../../shared/better-auth.CC9Ms4aB.cjs';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import 'better-call';
|
|
7
7
|
import 'better-sqlite3';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.
|
|
2
|
-
import '../../shared/better-auth.
|
|
1
|
+
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.BxzpFmqs.mjs';
|
|
2
|
+
import '../../shared/better-auth.9XhOL8gb.mjs';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import '../../shared/better-auth.
|
|
4
|
+
import '../../shared/better-auth.BEKm37Eq.mjs';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import 'better-call';
|
|
7
7
|
import 'better-sqlite3';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.
|
|
2
|
-
import '../../shared/better-auth.
|
|
1
|
+
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.UFMnMTeX.js';
|
|
2
|
+
import '../../shared/better-auth.9XhOL8gb.js';
|
|
3
3
|
import 'zod';
|
|
4
|
-
import '../../shared/better-auth.
|
|
4
|
+
import '../../shared/better-auth.CJByo5vt.js';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import 'better-call';
|
|
7
7
|
import 'better-sqlite3';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { m as memoryAdapter } from '../../shared/better-auth.
|
|
2
|
-
import '../../shared/better-auth.
|
|
1
|
+
export { m as memoryAdapter } from '../../shared/better-auth.Lq361xtr.mjs';
|
|
2
|
+
import '../../shared/better-auth.C3eCZf9N.mjs';
|
|
3
3
|
import '../../shared/better-auth.tB5eU6EY.mjs';
|
|
4
4
|
import '../../shared/better-auth.DORkW_Ge.mjs';
|
|
5
|
-
import '../../shared/better-auth.
|
|
5
|
+
import '../../shared/better-auth.DBGfIDnh.mjs';
|
|
6
6
|
import '@better-auth/utils/random';
|
|
7
7
|
import 'zod';
|
|
8
8
|
import 'better-call';
|
|
@@ -17,4 +17,3 @@ import '@better-auth/utils';
|
|
|
17
17
|
import '@better-auth/utils/hex';
|
|
18
18
|
import '@noble/hashes/utils';
|
|
19
19
|
import '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
20
|
-
import '../../shared/better-auth.Cqykj82J.mjs';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const mongodbAdapter = require('../../shared/better-auth.KCmQsDm-.cjs');
|
|
4
|
+
require('mongodb');
|
|
5
|
+
require('../../shared/better-auth.CGOCIshw.cjs');
|
|
5
6
|
require('../../shared/better-auth.D3mtHEZg.cjs');
|
|
6
7
|
require('../../shared/better-auth.BEphVDyL.cjs');
|
|
7
|
-
require('../../shared/better-auth.
|
|
8
|
+
require('../../shared/better-auth.CXhVNgXP.cjs');
|
|
8
9
|
require('@better-auth/utils/random');
|
|
9
10
|
require('zod');
|
|
10
11
|
require('better-call');
|
|
@@ -19,240 +20,7 @@ require('@better-auth/utils');
|
|
|
19
20
|
require('@better-auth/utils/hex');
|
|
20
21
|
require('@noble/hashes/utils');
|
|
21
22
|
require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
22
|
-
require('../../shared/better-auth.GpOOav9x.cjs');
|
|
23
23
|
|
|
24
|
-
const mongodbAdapter = (db, config) => index.createAdapter({
|
|
25
|
-
config: {
|
|
26
|
-
adapterId: "mongodb-adapter",
|
|
27
|
-
adapterName: "MongoDB Adapter",
|
|
28
|
-
usePlural: config?.usePlural ?? false,
|
|
29
|
-
debugLogs: config?.debugLogs ?? false,
|
|
30
|
-
mapKeysTransformInput: {
|
|
31
|
-
id: "_id"
|
|
32
|
-
},
|
|
33
|
-
mapKeysTransformOutput: {
|
|
34
|
-
_id: "id"
|
|
35
|
-
},
|
|
36
|
-
supportsNumericIds: false,
|
|
37
|
-
customTransformInput({
|
|
38
|
-
action,
|
|
39
|
-
data,
|
|
40
|
-
field,
|
|
41
|
-
fieldAttributes,
|
|
42
|
-
schema,
|
|
43
|
-
model
|
|
44
|
-
}) {
|
|
45
|
-
if (field === "_id" || fieldAttributes.references?.field === "id") {
|
|
46
|
-
if (action === "update") {
|
|
47
|
-
return data;
|
|
48
|
-
}
|
|
49
|
-
if (Array.isArray(data)) {
|
|
50
|
-
return data.map((v) => new mongodb.ObjectId());
|
|
51
|
-
}
|
|
52
|
-
if (typeof data === "string") {
|
|
53
|
-
try {
|
|
54
|
-
return new mongodb.ObjectId(data);
|
|
55
|
-
} catch (error) {
|
|
56
|
-
return new mongodb.ObjectId();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
return new mongodb.ObjectId();
|
|
60
|
-
}
|
|
61
|
-
return data;
|
|
62
|
-
},
|
|
63
|
-
customTransformOutput({ data, field, fieldAttributes }) {
|
|
64
|
-
if (field === "id" || fieldAttributes.references?.field === "id") {
|
|
65
|
-
if (data instanceof mongodb.ObjectId) {
|
|
66
|
-
return data.toHexString();
|
|
67
|
-
}
|
|
68
|
-
if (Array.isArray(data)) {
|
|
69
|
-
return data.map((v) => {
|
|
70
|
-
if (v instanceof mongodb.ObjectId) {
|
|
71
|
-
return v.toHexString();
|
|
72
|
-
}
|
|
73
|
-
return v;
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
return data;
|
|
77
|
-
}
|
|
78
|
-
return data;
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
adapter: ({ options, getFieldName, schema, getDefaultModelName }) => {
|
|
82
|
-
const customIdGen = options.advanced?.database?.generateId;
|
|
83
|
-
function serializeID({
|
|
84
|
-
field,
|
|
85
|
-
value,
|
|
86
|
-
model
|
|
87
|
-
}) {
|
|
88
|
-
if (customIdGen) {
|
|
89
|
-
return value;
|
|
90
|
-
}
|
|
91
|
-
model = getDefaultModelName(model);
|
|
92
|
-
if (field === "id" || field === "_id" || schema[model].fields[field]?.references?.field === "id") {
|
|
93
|
-
if (typeof value !== "string") {
|
|
94
|
-
if (value instanceof mongodb.ObjectId) {
|
|
95
|
-
return value;
|
|
96
|
-
}
|
|
97
|
-
if (Array.isArray(value)) {
|
|
98
|
-
return value.map((v) => {
|
|
99
|
-
if (typeof v === "string") {
|
|
100
|
-
try {
|
|
101
|
-
return new mongodb.ObjectId(v);
|
|
102
|
-
} catch (e) {
|
|
103
|
-
return v;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
if (v instanceof mongodb.ObjectId) {
|
|
107
|
-
return v;
|
|
108
|
-
}
|
|
109
|
-
throw new Error("Invalid id value");
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
throw new Error("Invalid id value");
|
|
113
|
-
}
|
|
114
|
-
try {
|
|
115
|
-
return new mongodb.ObjectId(value);
|
|
116
|
-
} catch (e) {
|
|
117
|
-
return value;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return value;
|
|
121
|
-
}
|
|
122
|
-
function convertWhereClause({
|
|
123
|
-
where,
|
|
124
|
-
model
|
|
125
|
-
}) {
|
|
126
|
-
if (!where.length) return {};
|
|
127
|
-
const conditions = where.map((w) => {
|
|
128
|
-
const {
|
|
129
|
-
field: field_,
|
|
130
|
-
value,
|
|
131
|
-
operator = "eq",
|
|
132
|
-
connector = "AND"
|
|
133
|
-
} = w;
|
|
134
|
-
let condition;
|
|
135
|
-
let field = getFieldName({ model, field: field_ });
|
|
136
|
-
if (field === "id") field = "_id";
|
|
137
|
-
switch (operator.toLowerCase()) {
|
|
138
|
-
case "eq":
|
|
139
|
-
condition = {
|
|
140
|
-
[field]: serializeID({
|
|
141
|
-
field,
|
|
142
|
-
value,
|
|
143
|
-
model
|
|
144
|
-
})
|
|
145
|
-
};
|
|
146
|
-
break;
|
|
147
|
-
case "in":
|
|
148
|
-
condition = {
|
|
149
|
-
[field]: {
|
|
150
|
-
$in: Array.isArray(value) ? value.map((v) => serializeID({ field, value: v, model })) : [serializeID({ field, value, model })]
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
break;
|
|
154
|
-
case "gt":
|
|
155
|
-
condition = { [field]: { $gt: value } };
|
|
156
|
-
break;
|
|
157
|
-
case "gte":
|
|
158
|
-
condition = { [field]: { $gte: value } };
|
|
159
|
-
break;
|
|
160
|
-
case "lt":
|
|
161
|
-
condition = { [field]: { $lt: value } };
|
|
162
|
-
break;
|
|
163
|
-
case "lte":
|
|
164
|
-
condition = { [field]: { $lte: value } };
|
|
165
|
-
break;
|
|
166
|
-
case "ne":
|
|
167
|
-
condition = { [field]: { $ne: value } };
|
|
168
|
-
break;
|
|
169
|
-
case "contains":
|
|
170
|
-
condition = { [field]: { $regex: `.*${value}.*` } };
|
|
171
|
-
break;
|
|
172
|
-
case "starts_with":
|
|
173
|
-
condition = { [field]: { $regex: `${value}.*` } };
|
|
174
|
-
break;
|
|
175
|
-
case "ends_with":
|
|
176
|
-
condition = { [field]: { $regex: `.*${value}` } };
|
|
177
|
-
break;
|
|
178
|
-
default:
|
|
179
|
-
throw new Error(`Unsupported operator: ${operator}`);
|
|
180
|
-
}
|
|
181
|
-
return { condition, connector };
|
|
182
|
-
});
|
|
183
|
-
if (conditions.length === 1) {
|
|
184
|
-
return conditions[0].condition;
|
|
185
|
-
}
|
|
186
|
-
const andConditions = conditions.filter((c) => c.connector === "AND").map((c) => c.condition);
|
|
187
|
-
const orConditions = conditions.filter((c) => c.connector === "OR").map((c) => c.condition);
|
|
188
|
-
let clause = {};
|
|
189
|
-
if (andConditions.length) {
|
|
190
|
-
clause = { ...clause, $and: andConditions };
|
|
191
|
-
}
|
|
192
|
-
if (orConditions.length) {
|
|
193
|
-
clause = { ...clause, $or: orConditions };
|
|
194
|
-
}
|
|
195
|
-
return clause;
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
async create({ model, data: values }) {
|
|
199
|
-
const res = await db.collection(model).insertOne(values);
|
|
200
|
-
const insertedData = { _id: res.insertedId.toString(), ...values };
|
|
201
|
-
return insertedData;
|
|
202
|
-
},
|
|
203
|
-
async findOne({ model, where, select }) {
|
|
204
|
-
const clause = convertWhereClause({ where, model });
|
|
205
|
-
const res = await db.collection(model).findOne(clause);
|
|
206
|
-
if (!res) return null;
|
|
207
|
-
return res;
|
|
208
|
-
},
|
|
209
|
-
async findMany({ model, where, limit, offset, sortBy }) {
|
|
210
|
-
const clause = where ? convertWhereClause({ where, model }) : {};
|
|
211
|
-
const cursor = db.collection(model).find(clause);
|
|
212
|
-
if (limit) cursor.limit(limit);
|
|
213
|
-
if (offset) cursor.skip(offset);
|
|
214
|
-
if (sortBy)
|
|
215
|
-
cursor.sort(
|
|
216
|
-
getFieldName({ field: sortBy.field, model }),
|
|
217
|
-
sortBy.direction === "desc" ? -1 : 1
|
|
218
|
-
);
|
|
219
|
-
const res = await cursor.toArray();
|
|
220
|
-
return res;
|
|
221
|
-
},
|
|
222
|
-
async count({ model }) {
|
|
223
|
-
const res = await db.collection(model).countDocuments();
|
|
224
|
-
return res;
|
|
225
|
-
},
|
|
226
|
-
async update({ model, where, update: values }) {
|
|
227
|
-
const clause = convertWhereClause({ where, model });
|
|
228
|
-
const res = await db.collection(model).findOneAndUpdate(
|
|
229
|
-
clause,
|
|
230
|
-
{ $set: values },
|
|
231
|
-
{
|
|
232
|
-
returnDocument: "after"
|
|
233
|
-
}
|
|
234
|
-
);
|
|
235
|
-
if (!res) return null;
|
|
236
|
-
return res;
|
|
237
|
-
},
|
|
238
|
-
async updateMany({ model, where, update: values }) {
|
|
239
|
-
const clause = convertWhereClause({ where, model });
|
|
240
|
-
const res = await db.collection(model).updateMany(clause, {
|
|
241
|
-
$set: values
|
|
242
|
-
});
|
|
243
|
-
return res.modifiedCount;
|
|
244
|
-
},
|
|
245
|
-
async delete({ model, where }) {
|
|
246
|
-
const clause = convertWhereClause({ where, model });
|
|
247
|
-
await db.collection(model).deleteOne(clause);
|
|
248
|
-
},
|
|
249
|
-
async deleteMany({ model, where }) {
|
|
250
|
-
const clause = convertWhereClause({ where, model });
|
|
251
|
-
const res = await db.collection(model).deleteMany(clause);
|
|
252
|
-
return res.deletedCount;
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
24
|
|
|
258
|
-
|
|
25
|
+
|
|
26
|
+
exports.mongodbAdapter = mongodbAdapter.mongodbAdapter;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.
|
|
1
|
+
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.D3SwPO56.cjs';
|
|
2
2
|
import { Db } from 'mongodb';
|
|
3
|
-
import '../../shared/better-auth.
|
|
3
|
+
import '../../shared/better-auth.9XhOL8gb.cjs';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../shared/better-auth.
|
|
5
|
+
import '../../shared/better-auth.CC9Ms4aB.cjs';
|
|
6
6
|
import 'kysely';
|
|
7
7
|
import 'better-call';
|
|
8
8
|
import 'better-sqlite3';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.
|
|
1
|
+
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.BxzpFmqs.mjs';
|
|
2
2
|
import { Db } from 'mongodb';
|
|
3
|
-
import '../../shared/better-auth.
|
|
3
|
+
import '../../shared/better-auth.9XhOL8gb.mjs';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../shared/better-auth.
|
|
5
|
+
import '../../shared/better-auth.BEKm37Eq.mjs';
|
|
6
6
|
import 'kysely';
|
|
7
7
|
import 'better-call';
|
|
8
8
|
import 'better-sqlite3';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.
|
|
1
|
+
import { A as AdapterDebugLogs, B as BetterAuthOptions, a as Adapter } from '../../shared/better-auth.UFMnMTeX.js';
|
|
2
2
|
import { Db } from 'mongodb';
|
|
3
|
-
import '../../shared/better-auth.
|
|
3
|
+
import '../../shared/better-auth.9XhOL8gb.js';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import '../../shared/better-auth.
|
|
5
|
+
import '../../shared/better-auth.CJByo5vt.js';
|
|
6
6
|
import 'kysely';
|
|
7
7
|
import 'better-call';
|
|
8
8
|
import 'better-sqlite3';
|