better-auth 1.3.5-beta.7 → 1.3.5
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.d.cts +2 -2
- package/dist/adapters/drizzle-adapter/index.d.mts +2 -2
- package/dist/adapters/drizzle-adapter/index.d.ts +2 -2
- package/dist/adapters/index.d.cts +3 -3
- package/dist/adapters/index.d.mts +3 -3
- package/dist/adapters/index.d.ts +3 -3
- package/dist/adapters/kysely-adapter/index.d.cts +2 -2
- package/dist/adapters/kysely-adapter/index.d.mts +2 -2
- package/dist/adapters/kysely-adapter/index.d.ts +2 -2
- package/dist/adapters/memory-adapter/index.d.cts +2 -2
- package/dist/adapters/memory-adapter/index.d.mts +2 -2
- package/dist/adapters/memory-adapter/index.d.ts +2 -2
- package/dist/adapters/mongodb-adapter/index.d.cts +2 -2
- package/dist/adapters/mongodb-adapter/index.d.mts +2 -2
- package/dist/adapters/mongodb-adapter/index.d.ts +2 -2
- package/dist/adapters/prisma-adapter/index.d.cts +2 -2
- package/dist/adapters/prisma-adapter/index.d.mts +2 -2
- package/dist/adapters/prisma-adapter/index.d.ts +2 -2
- package/dist/adapters/test.d.cts +2 -2
- package/dist/adapters/test.d.mts +2 -2
- package/dist/adapters/test.d.ts +2 -2
- package/dist/api/index.d.cts +2 -2
- package/dist/api/index.d.mts +2 -2
- package/dist/api/index.d.ts +2 -2
- package/dist/chunks/index.cjs +9 -121
- package/dist/chunks/index.mjs +9 -121
- package/dist/client/index.d.cts +4 -4
- package/dist/client/index.d.mts +4 -4
- package/dist/client/index.d.ts +4 -4
- package/dist/client/plugins/index.d.cts +4 -4
- package/dist/client/plugins/index.d.mts +4 -4
- package/dist/client/plugins/index.d.ts +4 -4
- 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 +2 -2
- package/dist/cookies/index.d.mts +2 -2
- package/dist/cookies/index.d.ts +2 -2
- package/dist/db/index.d.cts +3 -3
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.d.ts +3 -3
- package/dist/index.cjs +1 -4
- 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 +1 -4
- package/dist/integrations/next-js.d.cts +2 -2
- package/dist/integrations/next-js.d.mts +2 -2
- package/dist/integrations/next-js.d.ts +2 -2
- package/dist/integrations/node.d.cts +2 -2
- package/dist/integrations/node.d.mts +2 -2
- package/dist/integrations/node.d.ts +2 -2
- package/dist/integrations/react-start.d.cts +2 -2
- package/dist/integrations/react-start.d.mts +2 -2
- package/dist/integrations/react-start.d.ts +2 -2
- package/dist/integrations/svelte-kit.d.cts +2 -2
- package/dist/integrations/svelte-kit.d.mts +2 -2
- package/dist/integrations/svelte-kit.d.ts +2 -2
- package/dist/oauth2/index.d.cts +4 -4
- package/dist/oauth2/index.d.mts +4 -4
- package/dist/oauth2/index.d.ts +4 -4
- package/dist/plugins/admin/index.d.cts +2 -2
- package/dist/plugins/admin/index.d.mts +2 -2
- package/dist/plugins/admin/index.d.ts +2 -2
- package/dist/plugins/anonymous/index.d.cts +2 -2
- package/dist/plugins/anonymous/index.d.mts +2 -2
- package/dist/plugins/anonymous/index.d.ts +2 -2
- package/dist/plugins/bearer/index.d.cts +2 -2
- package/dist/plugins/bearer/index.d.mts +2 -2
- package/dist/plugins/bearer/index.d.ts +2 -2
- package/dist/plugins/captcha/index.d.cts +2 -2
- package/dist/plugins/captcha/index.d.mts +2 -2
- package/dist/plugins/captcha/index.d.ts +2 -2
- package/dist/plugins/custom-session/index.d.cts +2 -2
- package/dist/plugins/custom-session/index.d.mts +2 -2
- package/dist/plugins/custom-session/index.d.ts +2 -2
- package/dist/plugins/email-otp/index.d.cts +2 -2
- package/dist/plugins/email-otp/index.d.mts +2 -2
- package/dist/plugins/email-otp/index.d.ts +2 -2
- package/dist/plugins/generic-oauth/index.d.cts +2 -2
- package/dist/plugins/generic-oauth/index.d.mts +2 -2
- package/dist/plugins/generic-oauth/index.d.ts +2 -2
- package/dist/plugins/haveibeenpwned/index.d.cts +2 -2
- package/dist/plugins/haveibeenpwned/index.d.mts +2 -2
- package/dist/plugins/haveibeenpwned/index.d.ts +2 -2
- package/dist/plugins/index.cjs +1 -1
- package/dist/plugins/index.d.cts +4 -4
- package/dist/plugins/index.d.mts +4 -4
- package/dist/plugins/index.d.ts +4 -4
- package/dist/plugins/index.mjs +1 -1
- package/dist/plugins/jwt/index.d.cts +2 -2
- package/dist/plugins/jwt/index.d.mts +2 -2
- package/dist/plugins/jwt/index.d.ts +2 -2
- package/dist/plugins/multi-session/index.d.cts +2 -2
- package/dist/plugins/multi-session/index.d.mts +2 -2
- package/dist/plugins/multi-session/index.d.ts +2 -2
- package/dist/plugins/oauth-proxy/index.d.cts +2 -2
- package/dist/plugins/oauth-proxy/index.d.mts +2 -2
- package/dist/plugins/oauth-proxy/index.d.ts +2 -2
- package/dist/plugins/oidc-provider/index.d.cts +6 -6
- package/dist/plugins/oidc-provider/index.d.mts +6 -6
- package/dist/plugins/oidc-provider/index.d.ts +6 -6
- package/dist/plugins/one-time-token/index.d.cts +2 -2
- package/dist/plugins/one-time-token/index.d.mts +2 -2
- package/dist/plugins/one-time-token/index.d.ts +2 -2
- package/dist/plugins/open-api/index.d.cts +2 -2
- package/dist/plugins/open-api/index.d.mts +2 -2
- package/dist/plugins/open-api/index.d.ts +2 -2
- package/dist/plugins/organization/index.cjs +1 -1
- package/dist/plugins/organization/index.d.cts +6 -6
- package/dist/plugins/organization/index.d.mts +6 -6
- package/dist/plugins/organization/index.d.ts +6 -6
- package/dist/plugins/organization/index.mjs +1 -1
- package/dist/plugins/passkey/index.d.cts +2 -2
- package/dist/plugins/passkey/index.d.mts +2 -2
- package/dist/plugins/passkey/index.d.ts +2 -2
- package/dist/plugins/phone-number/index.cjs +3 -6
- package/dist/plugins/phone-number/index.d.cts +4 -4
- package/dist/plugins/phone-number/index.d.mts +4 -4
- package/dist/plugins/phone-number/index.d.ts +4 -4
- package/dist/plugins/phone-number/index.mjs +3 -6
- package/dist/plugins/sso/index.d.cts +4 -4
- package/dist/plugins/sso/index.d.mts +4 -4
- package/dist/plugins/sso/index.d.ts +4 -4
- package/dist/plugins/two-factor/index.d.cts +2 -2
- package/dist/plugins/two-factor/index.d.mts +2 -2
- package/dist/plugins/two-factor/index.d.ts +2 -2
- package/dist/plugins/username/index.d.cts +2 -2
- package/dist/plugins/username/index.d.mts +2 -2
- package/dist/plugins/username/index.d.ts +2 -2
- package/dist/shared/{better-auth.DbvnSV1O.d.ts → better-auth.B-pjewPT.d.ts} +1 -1
- package/dist/shared/{better-auth.DzDvzl7B.d.ts → better-auth.B96vZfh2.d.ts} +1 -1
- package/dist/shared/{better-auth.BVcoPcvi.cjs → better-auth.BCz4-QUh.cjs} +107 -41
- package/dist/shared/{better-auth.ACwZgLRi.d.mts → better-auth.BFod4hxi.d.mts} +1 -1
- package/dist/shared/{better-auth.C2HPdDQV.d.cts → better-auth.BTsdIaVL.d.cts} +1 -1
- package/dist/shared/{better-auth.GvhaR2d8.d.mts → better-auth.Bl8InMw5.d.mts} +1 -1
- package/dist/shared/{better-auth.CyHLgDdW.d.mts → better-auth.BoBKsnVd.d.mts} +1 -1
- package/dist/shared/{better-auth.CQ30COqy.mjs → better-auth.CCMYns0n.mjs} +107 -38
- package/dist/shared/{better-auth.BCAGSl6b.d.cts → better-auth.CEtc1oG5.d.cts} +1 -1
- package/dist/shared/{better-auth.BzaSjc2s.d.ts → better-auth.CpTWU-gb.d.ts} +5 -5
- package/dist/shared/{better-auth.BsCu_G2q.mjs → better-auth.Cz37zEtO.mjs} +7 -1
- package/dist/shared/{better-auth.BWZSEBa1.d.mts → better-auth.DPF-nTOv.d.mts} +1 -1
- package/dist/shared/{better-auth.Djzk_UI4.d.cts → better-auth.DSYK4jT-.d.cts} +5 -5
- package/dist/shared/{better-auth.DeahYwp5.d.cts → better-auth.DSvLrleU.d.cts} +1 -1
- package/dist/shared/{better-auth.C59ZAG6v.d.ts → better-auth.DWkfnOhB.d.ts} +1 -1
- package/dist/shared/{better-auth.dkxtDgoQ.d.cts → better-auth.DXpowKDk.d.cts} +1 -1
- package/dist/shared/{better-auth.DQp2NRpN.d.ts → better-auth.DkcNzUEl.d.ts} +1 -1
- package/dist/shared/{better-auth.5I0dLp4K.d.mts → better-auth.jL_zqxTz.d.mts} +5 -5
- package/dist/shared/{better-auth.Cd_RFcYz.cjs → better-auth.kvWPdS5e.cjs} +7 -1
- package/dist/social-providers/index.d.cts +1 -1
- package/dist/social-providers/index.d.mts +1 -1
- package/dist/social-providers/index.d.ts +1 -1
- package/dist/test-utils/index.cjs +142 -259
- package/dist/test-utils/index.d.cts +3 -3
- package/dist/test-utils/index.d.mts +3 -3
- package/dist/test-utils/index.d.ts +3 -3
- package/dist/test-utils/index.mjs +139 -256
- package/dist/types/index.d.cts +3 -3
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/package.json +27 -26
|
@@ -1,9 +1,9 @@
|
|
|
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.DSYK4jT-.cjs';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.cjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.DSvLrleU.cjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
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.jL_zqxTz.mjs';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.mjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.BFod4hxi.mjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
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.CpTWU-gb.js';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.js';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.B-pjewPT.js';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,10 +1,10 @@
|
|
|
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.
|
|
1
|
+
import { b as AdapterConfig, C as CreateCustomAdapter, B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.DSYK4jT-.cjs';
|
|
2
|
+
export { A as AdapterDebugLogs, e as AdapterTestDebugLogs, d as CleanedWhere, c as CustomAdapter } from '../shared/better-auth.DSYK4jT-.cjs';
|
|
3
3
|
import 'kysely';
|
|
4
4
|
import 'better-call';
|
|
5
5
|
import 'zod/v4';
|
|
6
6
|
import '../shared/better-auth.BDR52Rf2.cjs';
|
|
7
|
-
import '../shared/better-auth.
|
|
7
|
+
import '../shared/better-auth.DSvLrleU.cjs';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
|
@@ -1,10 +1,10 @@
|
|
|
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.
|
|
1
|
+
import { b as AdapterConfig, C as CreateCustomAdapter, B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.jL_zqxTz.mjs';
|
|
2
|
+
export { A as AdapterDebugLogs, e as AdapterTestDebugLogs, d as CleanedWhere, c as CustomAdapter } from '../shared/better-auth.jL_zqxTz.mjs';
|
|
3
3
|
import 'kysely';
|
|
4
4
|
import 'better-call';
|
|
5
5
|
import 'zod/v4';
|
|
6
6
|
import '../shared/better-auth.BDR52Rf2.mjs';
|
|
7
|
-
import '../shared/better-auth.
|
|
7
|
+
import '../shared/better-auth.BFod4hxi.mjs';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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.
|
|
1
|
+
import { b as AdapterConfig, C as CreateCustomAdapter, B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.CpTWU-gb.js';
|
|
2
|
+
export { A as AdapterDebugLogs, e as AdapterTestDebugLogs, d as CleanedWhere, c as CustomAdapter } from '../shared/better-auth.CpTWU-gb.js';
|
|
3
3
|
import 'kysely';
|
|
4
4
|
import 'better-call';
|
|
5
5
|
import 'zod/v4';
|
|
6
6
|
import '../shared/better-auth.BDR52Rf2.js';
|
|
7
|
-
import '../shared/better-auth.
|
|
7
|
+
import '../shared/better-auth.B-pjewPT.js';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Kysely } from 'kysely';
|
|
2
|
-
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.
|
|
2
|
+
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.DSYK4jT-.cjs';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.cjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.DSvLrleU.cjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Kysely } from 'kysely';
|
|
2
|
-
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.
|
|
2
|
+
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.jL_zqxTz.mjs';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.mjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.BFod4hxi.mjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Kysely } from 'kysely';
|
|
2
|
-
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.
|
|
2
|
+
import { B as BetterAuthOptions, K as KyselyDatabaseType, A as AdapterDebugLogs, a as Adapter } from '../../shared/better-auth.CpTWU-gb.js';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.js';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.B-pjewPT.js';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
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.DSYK4jT-.cjs';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.cjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.DSvLrleU.cjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
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.jL_zqxTz.mjs';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.mjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.BFod4hxi.mjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
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.CpTWU-gb.js';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.js';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.B-pjewPT.js';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,10 +1,10 @@
|
|
|
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.DSYK4jT-.cjs';
|
|
2
2
|
import { Db } from 'mongodb';
|
|
3
3
|
import 'kysely';
|
|
4
4
|
import 'better-call';
|
|
5
5
|
import 'zod/v4';
|
|
6
6
|
import '../../shared/better-auth.BDR52Rf2.cjs';
|
|
7
|
-
import '../../shared/better-auth.
|
|
7
|
+
import '../../shared/better-auth.DSvLrleU.cjs';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
|
@@ -1,10 +1,10 @@
|
|
|
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.jL_zqxTz.mjs';
|
|
2
2
|
import { Db } from 'mongodb';
|
|
3
3
|
import 'kysely';
|
|
4
4
|
import 'better-call';
|
|
5
5
|
import 'zod/v4';
|
|
6
6
|
import '../../shared/better-auth.BDR52Rf2.mjs';
|
|
7
|
-
import '../../shared/better-auth.
|
|
7
|
+
import '../../shared/better-auth.BFod4hxi.mjs';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
|
@@ -1,10 +1,10 @@
|
|
|
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.CpTWU-gb.js';
|
|
2
2
|
import { Db } from 'mongodb';
|
|
3
3
|
import 'kysely';
|
|
4
4
|
import 'better-call';
|
|
5
5
|
import 'zod/v4';
|
|
6
6
|
import '../../shared/better-auth.BDR52Rf2.js';
|
|
7
|
-
import '../../shared/better-auth.
|
|
7
|
+
import '../../shared/better-auth.B-pjewPT.js';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
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.DSYK4jT-.cjs';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.cjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.DSvLrleU.cjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
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.jL_zqxTz.mjs';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.mjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.BFod4hxi.mjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
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.CpTWU-gb.js';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.BDR52Rf2.js';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.B-pjewPT.js';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
package/dist/adapters/test.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.
|
|
1
|
+
import { B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.DSYK4jT-.cjs';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../shared/better-auth.BDR52Rf2.cjs';
|
|
6
|
-
import '../shared/better-auth.
|
|
6
|
+
import '../shared/better-auth.DSvLrleU.cjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
package/dist/adapters/test.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.
|
|
1
|
+
import { B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.jL_zqxTz.mjs';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../shared/better-auth.BDR52Rf2.mjs';
|
|
6
|
-
import '../shared/better-auth.
|
|
6
|
+
import '../shared/better-auth.BFod4hxi.mjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
package/dist/adapters/test.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.
|
|
1
|
+
import { B as BetterAuthOptions, a as Adapter } from '../shared/better-auth.CpTWU-gb.js';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../shared/better-auth.BDR52Rf2.js';
|
|
6
|
-
import '../shared/better-auth.
|
|
6
|
+
import '../shared/better-auth.B-pjewPT.js';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
package/dist/api/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '../shared/better-auth.
|
|
2
|
-
export { l as AuthEndpoint, m as AuthMiddleware, bm as accountInfo, aQ as callbackOAuth, bd as changeEmail, b9 as changePassword, k as createAuthEndpoint, j as createAuthMiddleware, b4 as createEmailVerificationToken, bb as deleteUser, bc as deleteUserCallback, be as error, b0 as forgetPassword, b2 as forgetPasswordCallback, aV as freshSessionMiddleware, bk as getAccessToken, aM as getEndpoints, aR as getSession, aS as getSessionFromCtx, bi as linkSocialAccount, aW as listSessions, bh as listUserAccounts, bf as ok, o as optionsMiddleware, bo as originCheck, bn as originCheckMiddleware, bl as refreshToken, aU as requestOnlySessionMiddleware, a$ as requestPasswordReset, b1 as requestPasswordResetCallback, b3 as resetPassword, aZ as revokeOtherSessions, aX as revokeSession, aY as revokeSessions, aN as router, b6 as sendVerificationEmail, b5 as sendVerificationEmailFn, aT as sessionMiddleware, ba as setPassword, aP as signInEmail, aO as signInSocial, a_ as signOut, bg as signUpEmail, bj as unlinkAccount, b8 as updateUser, b7 as verifyEmail } from '../shared/better-auth.
|
|
1
|
+
import '../shared/better-auth.DSvLrleU.cjs';
|
|
2
|
+
export { l as AuthEndpoint, m as AuthMiddleware, bm as accountInfo, aQ as callbackOAuth, bd as changeEmail, b9 as changePassword, k as createAuthEndpoint, j as createAuthMiddleware, b4 as createEmailVerificationToken, bb as deleteUser, bc as deleteUserCallback, be as error, b0 as forgetPassword, b2 as forgetPasswordCallback, aV as freshSessionMiddleware, bk as getAccessToken, aM as getEndpoints, aR as getSession, aS as getSessionFromCtx, bi as linkSocialAccount, aW as listSessions, bh as listUserAccounts, bf as ok, o as optionsMiddleware, bo as originCheck, bn as originCheckMiddleware, bl as refreshToken, aU as requestOnlySessionMiddleware, a$ as requestPasswordReset, b1 as requestPasswordResetCallback, b3 as resetPassword, aZ as revokeOtherSessions, aX as revokeSession, aY as revokeSessions, aN as router, b6 as sendVerificationEmail, b5 as sendVerificationEmailFn, aT as sessionMiddleware, ba as setPassword, aP as signInEmail, aO as signInSocial, a_ as signOut, bg as signUpEmail, bj as unlinkAccount, b8 as updateUser, b7 as verifyEmail } from '../shared/better-auth.DSYK4jT-.cjs';
|
|
3
3
|
export { APIError } from 'better-call';
|
|
4
4
|
import '../shared/better-auth.BDR52Rf2.cjs';
|
|
5
5
|
import 'zod/v4/core';
|
package/dist/api/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '../shared/better-auth.
|
|
2
|
-
export { l as AuthEndpoint, m as AuthMiddleware, bm as accountInfo, aQ as callbackOAuth, bd as changeEmail, b9 as changePassword, k as createAuthEndpoint, j as createAuthMiddleware, b4 as createEmailVerificationToken, bb as deleteUser, bc as deleteUserCallback, be as error, b0 as forgetPassword, b2 as forgetPasswordCallback, aV as freshSessionMiddleware, bk as getAccessToken, aM as getEndpoints, aR as getSession, aS as getSessionFromCtx, bi as linkSocialAccount, aW as listSessions, bh as listUserAccounts, bf as ok, o as optionsMiddleware, bo as originCheck, bn as originCheckMiddleware, bl as refreshToken, aU as requestOnlySessionMiddleware, a$ as requestPasswordReset, b1 as requestPasswordResetCallback, b3 as resetPassword, aZ as revokeOtherSessions, aX as revokeSession, aY as revokeSessions, aN as router, b6 as sendVerificationEmail, b5 as sendVerificationEmailFn, aT as sessionMiddleware, ba as setPassword, aP as signInEmail, aO as signInSocial, a_ as signOut, bg as signUpEmail, bj as unlinkAccount, b8 as updateUser, b7 as verifyEmail } from '../shared/better-auth.
|
|
1
|
+
import '../shared/better-auth.BFod4hxi.mjs';
|
|
2
|
+
export { l as AuthEndpoint, m as AuthMiddleware, bm as accountInfo, aQ as callbackOAuth, bd as changeEmail, b9 as changePassword, k as createAuthEndpoint, j as createAuthMiddleware, b4 as createEmailVerificationToken, bb as deleteUser, bc as deleteUserCallback, be as error, b0 as forgetPassword, b2 as forgetPasswordCallback, aV as freshSessionMiddleware, bk as getAccessToken, aM as getEndpoints, aR as getSession, aS as getSessionFromCtx, bi as linkSocialAccount, aW as listSessions, bh as listUserAccounts, bf as ok, o as optionsMiddleware, bo as originCheck, bn as originCheckMiddleware, bl as refreshToken, aU as requestOnlySessionMiddleware, a$ as requestPasswordReset, b1 as requestPasswordResetCallback, b3 as resetPassword, aZ as revokeOtherSessions, aX as revokeSession, aY as revokeSessions, aN as router, b6 as sendVerificationEmail, b5 as sendVerificationEmailFn, aT as sessionMiddleware, ba as setPassword, aP as signInEmail, aO as signInSocial, a_ as signOut, bg as signUpEmail, bj as unlinkAccount, b8 as updateUser, b7 as verifyEmail } from '../shared/better-auth.jL_zqxTz.mjs';
|
|
3
3
|
export { APIError } from 'better-call';
|
|
4
4
|
import '../shared/better-auth.BDR52Rf2.mjs';
|
|
5
5
|
import 'zod/v4/core';
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import '../shared/better-auth.
|
|
2
|
-
export { l as AuthEndpoint, m as AuthMiddleware, bm as accountInfo, aQ as callbackOAuth, bd as changeEmail, b9 as changePassword, k as createAuthEndpoint, j as createAuthMiddleware, b4 as createEmailVerificationToken, bb as deleteUser, bc as deleteUserCallback, be as error, b0 as forgetPassword, b2 as forgetPasswordCallback, aV as freshSessionMiddleware, bk as getAccessToken, aM as getEndpoints, aR as getSession, aS as getSessionFromCtx, bi as linkSocialAccount, aW as listSessions, bh as listUserAccounts, bf as ok, o as optionsMiddleware, bo as originCheck, bn as originCheckMiddleware, bl as refreshToken, aU as requestOnlySessionMiddleware, a$ as requestPasswordReset, b1 as requestPasswordResetCallback, b3 as resetPassword, aZ as revokeOtherSessions, aX as revokeSession, aY as revokeSessions, aN as router, b6 as sendVerificationEmail, b5 as sendVerificationEmailFn, aT as sessionMiddleware, ba as setPassword, aP as signInEmail, aO as signInSocial, a_ as signOut, bg as signUpEmail, bj as unlinkAccount, b8 as updateUser, b7 as verifyEmail } from '../shared/better-auth.
|
|
1
|
+
import '../shared/better-auth.B-pjewPT.js';
|
|
2
|
+
export { l as AuthEndpoint, m as AuthMiddleware, bm as accountInfo, aQ as callbackOAuth, bd as changeEmail, b9 as changePassword, k as createAuthEndpoint, j as createAuthMiddleware, b4 as createEmailVerificationToken, bb as deleteUser, bc as deleteUserCallback, be as error, b0 as forgetPassword, b2 as forgetPasswordCallback, aV as freshSessionMiddleware, bk as getAccessToken, aM as getEndpoints, aR as getSession, aS as getSessionFromCtx, bi as linkSocialAccount, aW as listSessions, bh as listUserAccounts, bf as ok, o as optionsMiddleware, bo as originCheck, bn as originCheckMiddleware, bl as refreshToken, aU as requestOnlySessionMiddleware, a$ as requestPasswordReset, b1 as requestPasswordResetCallback, b3 as resetPassword, aZ as revokeOtherSessions, aX as revokeSession, aY as revokeSessions, aN as router, b6 as sendVerificationEmail, b5 as sendVerificationEmailFn, aT as sessionMiddleware, ba as setPassword, aP as signInEmail, aO as signInSocial, a_ as signOut, bg as signUpEmail, bj as unlinkAccount, b8 as updateUser, b7 as verifyEmail } from '../shared/better-auth.CpTWU-gb.js';
|
|
3
3
|
export { APIError } from 'better-call';
|
|
4
4
|
import '../shared/better-auth.BDR52Rf2.js';
|
|
5
5
|
import 'zod/v4/core';
|
package/dist/chunks/index.cjs
CHANGED
|
@@ -755,104 +755,15 @@ function _normalizeNodeHeaders(nodeHeaders) {
|
|
|
755
755
|
return headers;
|
|
756
756
|
}
|
|
757
757
|
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
};
|
|
766
|
-
let als;
|
|
767
|
-
if (opts.asyncContext) {
|
|
768
|
-
const _AsyncLocalStorage = opts.AsyncLocalStorage || globalThis.AsyncLocalStorage;
|
|
769
|
-
if (_AsyncLocalStorage) {
|
|
770
|
-
als = new _AsyncLocalStorage();
|
|
771
|
-
} else {
|
|
772
|
-
console.warn("[unctx] `AsyncLocalStorage` is not provided.");
|
|
773
|
-
}
|
|
758
|
+
const eventStorage = new node_async_hooks.AsyncLocalStorage();
|
|
759
|
+
function getEvent() {
|
|
760
|
+
const event = eventStorage.getStore();
|
|
761
|
+
if (!event) {
|
|
762
|
+
throw new Error(
|
|
763
|
+
`No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`
|
|
764
|
+
);
|
|
774
765
|
}
|
|
775
|
-
|
|
776
|
-
if (als) {
|
|
777
|
-
const instance = als.getStore();
|
|
778
|
-
if (instance !== void 0) {
|
|
779
|
-
return instance;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
return currentInstance;
|
|
783
|
-
};
|
|
784
|
-
return {
|
|
785
|
-
use: () => {
|
|
786
|
-
const _instance = _getCurrentInstance();
|
|
787
|
-
if (_instance === void 0) {
|
|
788
|
-
throw new Error("Context is not available");
|
|
789
|
-
}
|
|
790
|
-
return _instance;
|
|
791
|
-
},
|
|
792
|
-
tryUse: () => {
|
|
793
|
-
return _getCurrentInstance();
|
|
794
|
-
},
|
|
795
|
-
set: (instance, replace) => {
|
|
796
|
-
if (!replace) {
|
|
797
|
-
checkConflict(instance);
|
|
798
|
-
}
|
|
799
|
-
currentInstance = instance;
|
|
800
|
-
isSingleton = true;
|
|
801
|
-
},
|
|
802
|
-
unset: () => {
|
|
803
|
-
currentInstance = void 0;
|
|
804
|
-
isSingleton = false;
|
|
805
|
-
},
|
|
806
|
-
call: (instance, callback) => {
|
|
807
|
-
checkConflict(instance);
|
|
808
|
-
currentInstance = instance;
|
|
809
|
-
try {
|
|
810
|
-
return als ? als.run(instance, callback) : callback();
|
|
811
|
-
} finally {
|
|
812
|
-
if (!isSingleton) {
|
|
813
|
-
currentInstance = void 0;
|
|
814
|
-
}
|
|
815
|
-
}
|
|
816
|
-
},
|
|
817
|
-
async callAsync(instance, callback) {
|
|
818
|
-
currentInstance = instance;
|
|
819
|
-
const onRestore = () => {
|
|
820
|
-
currentInstance = instance;
|
|
821
|
-
};
|
|
822
|
-
const onLeave = () => currentInstance === instance ? onRestore : void 0;
|
|
823
|
-
asyncHandlers.add(onLeave);
|
|
824
|
-
try {
|
|
825
|
-
const r = als ? als.run(instance, callback) : callback();
|
|
826
|
-
if (!isSingleton) {
|
|
827
|
-
currentInstance = void 0;
|
|
828
|
-
}
|
|
829
|
-
return await r;
|
|
830
|
-
} finally {
|
|
831
|
-
asyncHandlers.delete(onLeave);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
};
|
|
835
|
-
}
|
|
836
|
-
function createNamespace(defaultOpts = {}) {
|
|
837
|
-
const contexts = {};
|
|
838
|
-
return {
|
|
839
|
-
get(key, opts = {}) {
|
|
840
|
-
if (!contexts[key]) {
|
|
841
|
-
contexts[key] = createContext({ ...defaultOpts, ...opts });
|
|
842
|
-
}
|
|
843
|
-
return contexts[key];
|
|
844
|
-
}
|
|
845
|
-
};
|
|
846
|
-
}
|
|
847
|
-
const _globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : {};
|
|
848
|
-
const globalKey = "__unctx__";
|
|
849
|
-
const defaultNamespace = _globalThis[globalKey] || (_globalThis[globalKey] = createNamespace());
|
|
850
|
-
const getContext = (key, opts = {}) => defaultNamespace.get(key, opts);
|
|
851
|
-
const asyncHandlersKey = "__unctx_async_handlers__";
|
|
852
|
-
const asyncHandlers = _globalThis[asyncHandlersKey] || (_globalThis[asyncHandlersKey] = /* @__PURE__ */ new Set());
|
|
853
|
-
|
|
854
|
-
function getHTTPEvent() {
|
|
855
|
-
return getEvent();
|
|
766
|
+
return event;
|
|
856
767
|
}
|
|
857
768
|
const HTTPEventSymbol = Symbol("$HTTPEvent");
|
|
858
769
|
function isEvent(obj) {
|
|
@@ -860,15 +771,9 @@ function isEvent(obj) {
|
|
|
860
771
|
}
|
|
861
772
|
function createWrapperFunction(h3Function) {
|
|
862
773
|
return function(...args) {
|
|
863
|
-
var _a;
|
|
864
774
|
const event = args[0];
|
|
865
775
|
if (!isEvent(event)) {
|
|
866
|
-
|
|
867
|
-
throw new Error(
|
|
868
|
-
"AsyncLocalStorage was not enabled. Use the `server.experimental.asyncContext: true` option in your app configuration to enable it. Or, pass the instance of HTTPEvent that you have as the first argument to the function."
|
|
869
|
-
);
|
|
870
|
-
}
|
|
871
|
-
args.unshift(getHTTPEvent());
|
|
776
|
+
args.unshift(getEvent());
|
|
872
777
|
} else {
|
|
873
778
|
args[0] = event instanceof H3Event || event.__is_event__ ? event : event[HTTPEventSymbol];
|
|
874
779
|
}
|
|
@@ -876,23 +781,6 @@ function createWrapperFunction(h3Function) {
|
|
|
876
781
|
};
|
|
877
782
|
}
|
|
878
783
|
const setCookie = createWrapperFunction(setCookie$1);
|
|
879
|
-
function getNitroAsyncContext() {
|
|
880
|
-
var _a;
|
|
881
|
-
const nitroAsyncContext = getContext("nitro-app", {
|
|
882
|
-
asyncContext: ((_a = globalThis.app.config.server.experimental) == null ? void 0 : _a.asyncContext) ? true : false,
|
|
883
|
-
AsyncLocalStorage: node_async_hooks.AsyncLocalStorage
|
|
884
|
-
});
|
|
885
|
-
return nitroAsyncContext;
|
|
886
|
-
}
|
|
887
|
-
function getEvent() {
|
|
888
|
-
const event = getNitroAsyncContext().use().event;
|
|
889
|
-
if (!event) {
|
|
890
|
-
throw new Error(
|
|
891
|
-
`No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`
|
|
892
|
-
);
|
|
893
|
-
}
|
|
894
|
-
return event;
|
|
895
|
-
}
|
|
896
784
|
|
|
897
785
|
exports.H3Error = H3Error;
|
|
898
786
|
exports.H3Event = H3Event;
|
package/dist/chunks/index.mjs
CHANGED
|
@@ -753,104 +753,15 @@ function _normalizeNodeHeaders(nodeHeaders) {
|
|
|
753
753
|
return headers;
|
|
754
754
|
}
|
|
755
755
|
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
};
|
|
764
|
-
let als;
|
|
765
|
-
if (opts.asyncContext) {
|
|
766
|
-
const _AsyncLocalStorage = opts.AsyncLocalStorage || globalThis.AsyncLocalStorage;
|
|
767
|
-
if (_AsyncLocalStorage) {
|
|
768
|
-
als = new _AsyncLocalStorage();
|
|
769
|
-
} else {
|
|
770
|
-
console.warn("[unctx] `AsyncLocalStorage` is not provided.");
|
|
771
|
-
}
|
|
756
|
+
const eventStorage = new AsyncLocalStorage();
|
|
757
|
+
function getEvent() {
|
|
758
|
+
const event = eventStorage.getStore();
|
|
759
|
+
if (!event) {
|
|
760
|
+
throw new Error(
|
|
761
|
+
`No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`
|
|
762
|
+
);
|
|
772
763
|
}
|
|
773
|
-
|
|
774
|
-
if (als) {
|
|
775
|
-
const instance = als.getStore();
|
|
776
|
-
if (instance !== void 0) {
|
|
777
|
-
return instance;
|
|
778
|
-
}
|
|
779
|
-
}
|
|
780
|
-
return currentInstance;
|
|
781
|
-
};
|
|
782
|
-
return {
|
|
783
|
-
use: () => {
|
|
784
|
-
const _instance = _getCurrentInstance();
|
|
785
|
-
if (_instance === void 0) {
|
|
786
|
-
throw new Error("Context is not available");
|
|
787
|
-
}
|
|
788
|
-
return _instance;
|
|
789
|
-
},
|
|
790
|
-
tryUse: () => {
|
|
791
|
-
return _getCurrentInstance();
|
|
792
|
-
},
|
|
793
|
-
set: (instance, replace) => {
|
|
794
|
-
if (!replace) {
|
|
795
|
-
checkConflict(instance);
|
|
796
|
-
}
|
|
797
|
-
currentInstance = instance;
|
|
798
|
-
isSingleton = true;
|
|
799
|
-
},
|
|
800
|
-
unset: () => {
|
|
801
|
-
currentInstance = void 0;
|
|
802
|
-
isSingleton = false;
|
|
803
|
-
},
|
|
804
|
-
call: (instance, callback) => {
|
|
805
|
-
checkConflict(instance);
|
|
806
|
-
currentInstance = instance;
|
|
807
|
-
try {
|
|
808
|
-
return als ? als.run(instance, callback) : callback();
|
|
809
|
-
} finally {
|
|
810
|
-
if (!isSingleton) {
|
|
811
|
-
currentInstance = void 0;
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
},
|
|
815
|
-
async callAsync(instance, callback) {
|
|
816
|
-
currentInstance = instance;
|
|
817
|
-
const onRestore = () => {
|
|
818
|
-
currentInstance = instance;
|
|
819
|
-
};
|
|
820
|
-
const onLeave = () => currentInstance === instance ? onRestore : void 0;
|
|
821
|
-
asyncHandlers.add(onLeave);
|
|
822
|
-
try {
|
|
823
|
-
const r = als ? als.run(instance, callback) : callback();
|
|
824
|
-
if (!isSingleton) {
|
|
825
|
-
currentInstance = void 0;
|
|
826
|
-
}
|
|
827
|
-
return await r;
|
|
828
|
-
} finally {
|
|
829
|
-
asyncHandlers.delete(onLeave);
|
|
830
|
-
}
|
|
831
|
-
}
|
|
832
|
-
};
|
|
833
|
-
}
|
|
834
|
-
function createNamespace(defaultOpts = {}) {
|
|
835
|
-
const contexts = {};
|
|
836
|
-
return {
|
|
837
|
-
get(key, opts = {}) {
|
|
838
|
-
if (!contexts[key]) {
|
|
839
|
-
contexts[key] = createContext({ ...defaultOpts, ...opts });
|
|
840
|
-
}
|
|
841
|
-
return contexts[key];
|
|
842
|
-
}
|
|
843
|
-
};
|
|
844
|
-
}
|
|
845
|
-
const _globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof global !== "undefined" ? global : typeof window !== "undefined" ? window : {};
|
|
846
|
-
const globalKey = "__unctx__";
|
|
847
|
-
const defaultNamespace = _globalThis[globalKey] || (_globalThis[globalKey] = createNamespace());
|
|
848
|
-
const getContext = (key, opts = {}) => defaultNamespace.get(key, opts);
|
|
849
|
-
const asyncHandlersKey = "__unctx_async_handlers__";
|
|
850
|
-
const asyncHandlers = _globalThis[asyncHandlersKey] || (_globalThis[asyncHandlersKey] = /* @__PURE__ */ new Set());
|
|
851
|
-
|
|
852
|
-
function getHTTPEvent() {
|
|
853
|
-
return getEvent();
|
|
764
|
+
return event;
|
|
854
765
|
}
|
|
855
766
|
const HTTPEventSymbol = Symbol("$HTTPEvent");
|
|
856
767
|
function isEvent(obj) {
|
|
@@ -858,15 +769,9 @@ function isEvent(obj) {
|
|
|
858
769
|
}
|
|
859
770
|
function createWrapperFunction(h3Function) {
|
|
860
771
|
return function(...args) {
|
|
861
|
-
var _a;
|
|
862
772
|
const event = args[0];
|
|
863
773
|
if (!isEvent(event)) {
|
|
864
|
-
|
|
865
|
-
throw new Error(
|
|
866
|
-
"AsyncLocalStorage was not enabled. Use the `server.experimental.asyncContext: true` option in your app configuration to enable it. Or, pass the instance of HTTPEvent that you have as the first argument to the function."
|
|
867
|
-
);
|
|
868
|
-
}
|
|
869
|
-
args.unshift(getHTTPEvent());
|
|
774
|
+
args.unshift(getEvent());
|
|
870
775
|
} else {
|
|
871
776
|
args[0] = event instanceof H3Event || event.__is_event__ ? event : event[HTTPEventSymbol];
|
|
872
777
|
}
|
|
@@ -874,22 +779,5 @@ function createWrapperFunction(h3Function) {
|
|
|
874
779
|
};
|
|
875
780
|
}
|
|
876
781
|
const setCookie = createWrapperFunction(setCookie$1);
|
|
877
|
-
function getNitroAsyncContext() {
|
|
878
|
-
var _a;
|
|
879
|
-
const nitroAsyncContext = getContext("nitro-app", {
|
|
880
|
-
asyncContext: ((_a = globalThis.app.config.server.experimental) == null ? void 0 : _a.asyncContext) ? true : false,
|
|
881
|
-
AsyncLocalStorage
|
|
882
|
-
});
|
|
883
|
-
return nitroAsyncContext;
|
|
884
|
-
}
|
|
885
|
-
function getEvent() {
|
|
886
|
-
const event = getNitroAsyncContext().use().event;
|
|
887
|
-
if (!event) {
|
|
888
|
-
throw new Error(
|
|
889
|
-
`No HTTPEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.`
|
|
890
|
-
);
|
|
891
|
-
}
|
|
892
|
-
return event;
|
|
893
|
-
}
|
|
894
782
|
|
|
895
783
|
export { H3Error, H3Event, HTTPEventSymbol, getEvent, isEvent, sanitizeStatusCode, sanitizeStatusMessage, setCookie, splitCookiesString };
|