better-auth 1.4.4-beta.1 → 1.4.4-beta.2
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/index.d.mts +9 -8
- package/dist/adapters/kysely-adapter/index.d.mts +1 -1
- package/dist/adapters/kysely-adapter/index.mjs +1 -1
- package/dist/{admin-DOf4RlqU.mjs → admin-C0d5dk6O.mjs} +1 -1
- package/dist/{anonymous-NbEz-M9T.mjs → anonymous-B5kAEMza.mjs} +1 -1
- package/dist/api/index.d.mts +5 -4
- package/dist/api/index.mjs +3 -3
- package/dist/{api-EbGN0arI.mjs → api-q2sbQ7PT.mjs} +3 -3
- package/dist/auth/minimal.d.mts +5 -4
- package/dist/auth/minimal.mjs +4 -4
- package/dist/{auth-DtuX7axC.mjs → auth-DtQf_JUg.mjs} +3 -3
- package/dist/{base-DNnxU0Gh.mjs → base-CPOjsixh.mjs} +2 -2
- package/dist/{chunk-DbI2OXuS.mjs → chunk-09eW3CcW.mjs} +12 -27
- package/dist/client/index.d.mts +5 -6
- package/dist/client/lynx/index.d.mts +22 -21
- package/dist/client/plugins/index.d.mts +84 -54
- package/dist/client/react/index.d.mts +20 -19
- package/dist/client/solid/index.d.mts +20 -19
- package/dist/client/svelte/index.d.mts +6 -5
- package/dist/client/vue/index.d.mts +22 -21
- package/dist/cookies/index.d.mts +6 -5
- package/dist/db/index.d.mts +5 -4
- package/dist/db/index.mjs +2 -2
- package/dist/{dialect-BvcuosDD.mjs → dialect-D9ZUZA4J.mjs} +2 -2
- package/dist/{email-otp-wH0n3Ta5.mjs → email-otp-wYPJyq8c.mjs} +1 -1
- package/dist/{esm-DkLFGBDk.mjs → esm-DPWELC5I.mjs} +1 -1
- package/dist/{generic-oauth-DbGqw_dO.mjs → generic-oauth-BlH-OSQN.mjs} +3 -3
- package/dist/{get-migration-BHJiEhv-.mjs → get-migration-wMpq_Lmw.mjs} +4 -4
- package/dist/{haveibeenpwned-BLpq2gIE.mjs → haveibeenpwned-v0bNR9PL.mjs} +1 -1
- package/dist/index-5t2DAD0k.d.mts +556 -0
- package/dist/index-B52PH6jU.d.mts +488 -0
- package/dist/{index-BJBZojsr.d.mts → index-BDwnO3gz.d.mts} +1 -1
- package/dist/index-BTk-wfTL.d.mts +6520 -0
- package/dist/{index-C_7_0n5I.d.mts → index-BbsJ-RVs.d.mts} +47 -6
- package/dist/{index-B5V55AT0.d.mts → index-Bn1R6aVZ.d.mts} +2 -2
- package/dist/{index-DGVCxXgt.d.mts → index-C-qjuMK3.d.mts} +52 -3
- package/dist/{index-DitoYNDA.d.mts → index-C40qLrfj.d.mts} +35 -3
- package/dist/index-C8eCoB52.d.mts +9444 -0
- package/dist/index-CBe2rvyJ.d.mts +197 -0
- package/dist/{index-BlFbMHpg.d.mts → index-CfCxrifw.d.mts} +149 -5
- package/dist/{index-C12miRzk.d.mts → index-CrYIJeWc.d.mts} +3 -3
- package/dist/{index-Ck6mqAGv.d.mts → index-D8MBzSjs.d.mts} +1 -1
- package/dist/{index-BH0dV2Ob.d.mts → index-DJFTvRYn.d.mts} +91 -14
- package/dist/index-DaaVQEvX.d.mts +76 -0
- package/dist/index-DcYTqy8J.d.mts +182 -0
- package/dist/index-DiT4DbMC.d.mts +393 -0
- package/dist/{index-DHAy8_Lx.d.mts → index-DljejjCu.d.mts} +45 -4
- package/dist/index-DmC6Ctb-.d.mts +76 -0
- package/dist/{index-BR5yXcTF.d.mts → index-J1rkw6JT.d.mts} +189 -11
- package/dist/index-UXC1tbRT.d.mts +909 -0
- package/dist/index-_MGUkN9y.d.mts +36 -0
- package/dist/index-d52kDVAg.d.mts +65 -0
- package/dist/index.d.mts +6 -7
- package/dist/index.mjs +5 -5
- package/dist/integrations/next-js.d.mts +5 -2
- package/dist/integrations/node.d.mts +7 -5
- package/dist/integrations/svelte-kit.d.mts +7 -5
- package/dist/integrations/tanstack-start.d.mts +5 -2
- package/dist/integrations/tanstack-start.mjs +1 -1
- package/dist/{jwt-CDYeUkGP.mjs → jwt-BcNc-TEx.mjs} +1 -1
- package/dist/{magic-link-Dqmi-o1j.mjs → magic-link-B1zZrjdu.mjs} +1 -1
- package/dist/{multi-session-BMU39Jg-.mjs → multi-session-C855V4lg.mjs} +4 -4
- package/dist/{oauth-proxy-C4DAoruM.mjs → oauth-proxy-CSxVQ45y.mjs} +1 -1
- package/dist/oauth2/index.d.mts +25 -8
- package/dist/oauth2/index.mjs +3 -3
- package/dist/{oidc-provider-Bj_V8yIY.mjs → oidc-provider-Dx4WDdQk.mjs} +6 -3
- package/dist/{one-tap-RrSKTQfM.mjs → one-tap-CPlglews.mjs} +1 -1
- package/dist/{open-api-sdGaJ0Cz.mjs → open-api-C33sH63J.mjs} +1 -1
- package/dist/{organization-BL87gz3V.mjs → organization-BsVZQpxC.mjs} +3 -22
- package/dist/plugins/access/index.d.mts +2 -2
- package/dist/plugins/admin/access/index.d.mts +42 -45
- package/dist/plugins/admin/index.d.mts +25 -6
- package/dist/plugins/admin/index.mjs +4 -4
- package/dist/plugins/anonymous/index.d.mts +6 -5
- package/dist/plugins/anonymous/index.mjs +4 -4
- package/dist/plugins/bearer/index.d.mts +1 -1
- package/dist/plugins/captcha/index.d.mts +1 -1
- package/dist/plugins/custom-session/index.d.mts +6 -5
- package/dist/plugins/custom-session/index.mjs +3 -3
- package/dist/plugins/device-authorization/index.d.mts +1 -1
- package/dist/plugins/device-authorization/index.mjs +2 -2
- package/dist/plugins/email-otp/index.d.mts +1 -1
- package/dist/plugins/email-otp/index.mjs +4 -4
- package/dist/plugins/generic-oauth/index.d.mts +7 -6
- package/dist/plugins/generic-oauth/index.mjs +4 -4
- package/dist/plugins/haveibeenpwned/index.d.mts +1 -1
- package/dist/plugins/haveibeenpwned/index.mjs +4 -4
- package/dist/plugins/index.d.mts +26 -29
- package/dist/plugins/index.mjs +19 -19
- package/dist/plugins/jwt/index.d.mts +6 -7
- package/dist/plugins/jwt/index.mjs +4 -4
- package/dist/plugins/magic-link/index.d.mts +1 -1
- package/dist/plugins/magic-link/index.mjs +4 -4
- package/dist/plugins/multi-session/index.d.mts +2 -2
- package/dist/plugins/multi-session/index.mjs +4 -4
- package/dist/plugins/oauth-proxy/index.d.mts +1 -1
- package/dist/plugins/oauth-proxy/index.mjs +4 -4
- package/dist/plugins/oidc-provider/index.d.mts +25 -28
- package/dist/plugins/oidc-provider/index.mjs +5 -5
- package/dist/plugins/one-tap/index.d.mts +1 -1
- package/dist/plugins/one-tap/index.mjs +4 -4
- package/dist/plugins/one-time-token/index.d.mts +7 -6
- package/dist/plugins/one-time-token/index.mjs +19 -19
- package/dist/plugins/open-api/index.d.mts +2 -2
- package/dist/plugins/open-api/index.mjs +4 -4
- package/dist/plugins/organization/access/index.d.mts +25 -28
- package/dist/plugins/organization/index.d.mts +25 -28
- package/dist/plugins/organization/index.mjs +4 -4
- package/dist/plugins/phone-number/index.d.mts +6 -5
- package/dist/plugins/phone-number/index.mjs +3 -3
- package/dist/plugins/siwe/index.d.mts +6 -5
- package/dist/plugins/siwe/index.mjs +4 -4
- package/dist/plugins/two-factor/index.d.mts +7 -6
- package/dist/plugins/two-factor/index.mjs +3 -3
- package/dist/plugins/username/index.d.mts +3 -3
- package/dist/plugins/username/index.mjs +4 -4
- package/dist/{plugins-KJX8_wM4.mjs → plugins-Bgc_0YsW.mjs} +12 -8
- package/dist/{plugins-ClXJF1tD.d.mts → plugins-SfZpwDiz.d.mts} +1 -1
- package/dist/{promise-B9Mgup-x.mjs → promise-C9ABpfHK.mjs} +1 -2
- package/dist/{siwe-Z-Dh181B.mjs → siwe-D4lyacqA.mjs} +1 -1
- package/dist/test-utils/index.d.mts +11639 -34
- package/dist/test-utils/index.mjs +24 -24
- package/dist/types/index.d.mts +5 -4
- package/dist/{username-CdqIK2bY.mjs → username-CxPDW9ty.mjs} +1 -1
- package/package.json +49 -47
- package/dist/index-5_YIhDIp.d.mts +0 -226
- package/dist/index-BEGcCYiE.d.mts +0 -37
- package/dist/index-BE_eABaa.d.mts +0 -31
- package/dist/index-B_kk6DT-.d.mts +0 -238
- package/dist/index-CyyfSaZ_.d.mts +0 -115
- package/dist/index-D-Mj2ulL.d.mts +0 -602
- package/dist/index-D-TY1MQ6.d.mts +0 -94
- package/dist/index-DKwYzmM8.d.mts +0 -206
- package/dist/index-DN-gBurh.d.mts +0 -42
- package/dist/index-G6KSgyww.d.mts +0 -500
- package/dist/index-JvBDcp_w.d.mts +0 -24
- package/dist/index-f88KMXPN.d.mts +0 -29
- package/dist/index-fj43kZq3.d.mts +0 -441
- package/dist/index-gmDk7lt-.d.mts +0 -73
- package/dist/index-zDc06B1e.d.mts +0 -3662
- package/dist/server-xLuaTNNF.mjs +0 -20940
- package/dist/state-M2NfiHag.d.mts +0 -25
- /package/dist/{bun-sqlite-dialect-2R9nCsVF.mjs → bun-sqlite-dialect-C3P_ISb5.mjs} +0 -0
- /package/dist/{helper-DU33OcfW.d.mts → helper-DFzV6jvx.d.mts} +0 -0
- /package/dist/{node-sqlite-dialect-CdC7L-ji.mjs → node-sqlite-dialect-D6w8Ekdz.mjs} +0 -0
- /package/dist/{types-CRiHq5rJ.d.mts → types-CEepZ-RG.d.mts} +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../types-
|
|
3
|
-
import { a as LiteralNumber, c as OmitId, d as PrettifyDeep, f as Primitive, g as WithoutEmpty, h as UnionToIntersection, i as HasRequiredKeys, l as PreserveJSDoc, m as StripEmptyObjects, n as DeepPartial, o as LiteralString, p as RequiredKeysOf, r as Expand, s as LiteralUnion, t as Awaitable, u as Prettify } from "../../helper-
|
|
4
|
-
import "../../
|
|
1
|
+
import { bn as SessionQueryParams, fn as InferActions, hn as InferErrorCodes, mn as InferClientAPI, yn as IsSignal } from "../../index-BTk-wfTL.mjs";
|
|
2
|
+
import "../../types-CEepZ-RG.mjs";
|
|
3
|
+
import { a as LiteralNumber, c as OmitId, d as PrettifyDeep, f as Primitive, g as WithoutEmpty, h as UnionToIntersection, i as HasRequiredKeys, l as PreserveJSDoc, m as StripEmptyObjects, n as DeepPartial, o as LiteralString, p as RequiredKeysOf, r as Expand, s as LiteralUnion, t as Awaitable, u as Prettify } from "../../helper-DFzV6jvx.mjs";
|
|
4
|
+
import "../../index-D8MBzSjs.mjs";
|
|
5
|
+
import "../../plugins-SfZpwDiz.mjs";
|
|
5
6
|
import { BetterAuthClientOptions, BetterAuthClientPlugin } from "@better-auth/core";
|
|
6
7
|
import { BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
7
8
|
import * as nanostores1 from "nanostores";
|
|
8
9
|
import { Store, StoreValue } from "nanostores";
|
|
9
|
-
import * as
|
|
10
|
+
import * as _better_fetch_fetch33 from "@better-fetch/fetch";
|
|
10
11
|
import { BetterFetchError } from "@better-fetch/fetch";
|
|
11
12
|
import { DependencyList } from "react";
|
|
12
13
|
export * from "nanostores";
|
|
@@ -96,27 +97,27 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
96
97
|
error: null;
|
|
97
98
|
} ? S : Res : never>;
|
|
98
99
|
};
|
|
99
|
-
$fetch:
|
|
100
|
-
plugins: (
|
|
100
|
+
$fetch: _better_fetch_fetch33.BetterFetch<{
|
|
101
|
+
plugins: (_better_fetch_fetch33.BetterFetchPlugin | {
|
|
101
102
|
id: string;
|
|
102
103
|
name: string;
|
|
103
104
|
hooks: {
|
|
104
|
-
onSuccess(context:
|
|
105
|
+
onSuccess(context: _better_fetch_fetch33.SuccessContext<any>): void;
|
|
105
106
|
};
|
|
106
107
|
} | {
|
|
107
108
|
id: string;
|
|
108
109
|
name: string;
|
|
109
110
|
hooks: {
|
|
110
|
-
onRequest<T extends Record<string, any>>(context:
|
|
111
|
+
onRequest<T extends Record<string, any>>(context: _better_fetch_fetch33.RequestContext<T>): void;
|
|
111
112
|
};
|
|
112
113
|
} | {
|
|
113
114
|
id: string;
|
|
114
115
|
name: string;
|
|
115
116
|
hooks: {
|
|
116
|
-
onSuccess: ((context:
|
|
117
|
-
onError: ((context:
|
|
118
|
-
onRequest: (<T extends Record<string, any>>(context:
|
|
119
|
-
onResponse: ((context:
|
|
117
|
+
onSuccess: ((context: _better_fetch_fetch33.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
118
|
+
onError: ((context: _better_fetch_fetch33.ErrorContext) => Promise<void> | void) | undefined;
|
|
119
|
+
onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch33.RequestContext<T>) => Promise<_better_fetch_fetch33.RequestContext | void> | _better_fetch_fetch33.RequestContext | void) | undefined;
|
|
120
|
+
onResponse: ((context: _better_fetch_fetch33.ResponseContext) => Promise<Response | void | _better_fetch_fetch33.ResponseContext> | Response | _better_fetch_fetch33.ResponseContext | void) | undefined;
|
|
120
121
|
};
|
|
121
122
|
})[];
|
|
122
123
|
cache?: RequestCache | undefined;
|
|
@@ -126,22 +127,22 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
126
127
|
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
|
|
127
128
|
authorization: "Bearer" | "Basic";
|
|
128
129
|
})) | undefined;
|
|
130
|
+
redirect?: RequestRedirect | undefined;
|
|
129
131
|
credentials?: RequestCredentials;
|
|
130
132
|
integrity?: string | undefined;
|
|
131
133
|
keepalive?: boolean | undefined;
|
|
132
134
|
mode?: RequestMode | undefined;
|
|
133
135
|
priority?: RequestPriority | undefined;
|
|
134
|
-
redirect?: RequestRedirect | undefined;
|
|
135
136
|
referrer?: string | undefined;
|
|
136
137
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
137
138
|
signal?: (AbortSignal | null) | undefined;
|
|
138
139
|
window?: null | undefined;
|
|
139
|
-
onRetry?: ((response:
|
|
140
|
+
onRetry?: ((response: _better_fetch_fetch33.ResponseContext) => Promise<void> | void) | undefined;
|
|
140
141
|
hookOptions?: {
|
|
141
142
|
cloneResponse?: boolean;
|
|
142
143
|
} | undefined;
|
|
143
144
|
timeout?: number | undefined;
|
|
144
|
-
customFetchImpl:
|
|
145
|
+
customFetchImpl: _better_fetch_fetch33.FetchEsque;
|
|
145
146
|
baseURL: string;
|
|
146
147
|
throw?: boolean | undefined;
|
|
147
148
|
auth?: ({
|
|
@@ -161,10 +162,10 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
161
162
|
params?: any;
|
|
162
163
|
duplex?: "full" | "half" | undefined;
|
|
163
164
|
jsonParser: (text: string) => Promise<any> | any;
|
|
164
|
-
retry?:
|
|
165
|
+
retry?: _better_fetch_fetch33.RetryOptions | undefined;
|
|
165
166
|
retryAttempt?: number | undefined;
|
|
166
|
-
output?: (
|
|
167
|
-
errorSchema?:
|
|
167
|
+
output?: (_better_fetch_fetch33.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
168
|
+
errorSchema?: _better_fetch_fetch33.StandardSchemaV1 | undefined;
|
|
168
169
|
disableValidation?: boolean | undefined;
|
|
169
170
|
disableSignal?: boolean | undefined;
|
|
170
171
|
}, unknown, unknown, {}>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../types-
|
|
3
|
-
import { a as LiteralNumber, c as OmitId, d as PrettifyDeep, f as Primitive, g as WithoutEmpty, h as UnionToIntersection, i as HasRequiredKeys, l as PreserveJSDoc, m as StripEmptyObjects, n as DeepPartial, o as LiteralString, p as RequiredKeysOf, r as Expand, s as LiteralUnion, t as Awaitable, u as Prettify } from "../../helper-
|
|
4
|
-
import "../../
|
|
1
|
+
import { fn as InferActions, hn as InferErrorCodes, mn as InferClientAPI, yn as IsSignal } from "../../index-BTk-wfTL.mjs";
|
|
2
|
+
import "../../types-CEepZ-RG.mjs";
|
|
3
|
+
import { a as LiteralNumber, c as OmitId, d as PrettifyDeep, f as Primitive, g as WithoutEmpty, h as UnionToIntersection, i as HasRequiredKeys, l as PreserveJSDoc, m as StripEmptyObjects, n as DeepPartial, o as LiteralString, p as RequiredKeysOf, r as Expand, s as LiteralUnion, t as Awaitable, u as Prettify } from "../../helper-DFzV6jvx.mjs";
|
|
4
|
+
import "../../index-D8MBzSjs.mjs";
|
|
5
|
+
import "../../plugins-SfZpwDiz.mjs";
|
|
5
6
|
import { BetterAuthClientOptions, BetterAuthClientPlugin } from "@better-auth/core";
|
|
6
7
|
import { BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
7
|
-
import * as
|
|
8
|
+
import * as _better_fetch_fetch50 from "@better-fetch/fetch";
|
|
8
9
|
import { BetterFetchError } from "@better-fetch/fetch";
|
|
9
10
|
import { Accessor } from "solid-js";
|
|
10
11
|
export * from "nanostores";
|
|
@@ -48,27 +49,27 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
48
49
|
error: null;
|
|
49
50
|
} ? S : Res extends Record<string, any> ? Res : never : never>;
|
|
50
51
|
};
|
|
51
|
-
$fetch:
|
|
52
|
-
plugins: (
|
|
52
|
+
$fetch: _better_fetch_fetch50.BetterFetch<{
|
|
53
|
+
plugins: (_better_fetch_fetch50.BetterFetchPlugin | {
|
|
53
54
|
id: string;
|
|
54
55
|
name: string;
|
|
55
56
|
hooks: {
|
|
56
|
-
onSuccess(context:
|
|
57
|
+
onSuccess(context: _better_fetch_fetch50.SuccessContext<any>): void;
|
|
57
58
|
};
|
|
58
59
|
} | {
|
|
59
60
|
id: string;
|
|
60
61
|
name: string;
|
|
61
62
|
hooks: {
|
|
62
|
-
onRequest<T extends Record<string, any>>(context:
|
|
63
|
+
onRequest<T extends Record<string, any>>(context: _better_fetch_fetch50.RequestContext<T>): void;
|
|
63
64
|
};
|
|
64
65
|
} | {
|
|
65
66
|
id: string;
|
|
66
67
|
name: string;
|
|
67
68
|
hooks: {
|
|
68
|
-
onSuccess: ((context:
|
|
69
|
-
onError: ((context:
|
|
70
|
-
onRequest: (<T extends Record<string, any>>(context:
|
|
71
|
-
onResponse: ((context:
|
|
69
|
+
onSuccess: ((context: _better_fetch_fetch50.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
70
|
+
onError: ((context: _better_fetch_fetch50.ErrorContext) => Promise<void> | void) | undefined;
|
|
71
|
+
onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch50.RequestContext<T>) => Promise<_better_fetch_fetch50.RequestContext | void> | _better_fetch_fetch50.RequestContext | void) | undefined;
|
|
72
|
+
onResponse: ((context: _better_fetch_fetch50.ResponseContext) => Promise<Response | void | _better_fetch_fetch50.ResponseContext> | Response | _better_fetch_fetch50.ResponseContext | void) | undefined;
|
|
72
73
|
};
|
|
73
74
|
})[];
|
|
74
75
|
cache?: RequestCache | undefined;
|
|
@@ -78,22 +79,22 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
78
79
|
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
|
|
79
80
|
authorization: "Bearer" | "Basic";
|
|
80
81
|
})) | undefined;
|
|
82
|
+
redirect?: RequestRedirect | undefined;
|
|
81
83
|
credentials?: RequestCredentials;
|
|
82
84
|
integrity?: string | undefined;
|
|
83
85
|
keepalive?: boolean | undefined;
|
|
84
86
|
mode?: RequestMode | undefined;
|
|
85
87
|
priority?: RequestPriority | undefined;
|
|
86
|
-
redirect?: RequestRedirect | undefined;
|
|
87
88
|
referrer?: string | undefined;
|
|
88
89
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
89
90
|
signal?: (AbortSignal | null) | undefined;
|
|
90
91
|
window?: null | undefined;
|
|
91
|
-
onRetry?: ((response:
|
|
92
|
+
onRetry?: ((response: _better_fetch_fetch50.ResponseContext) => Promise<void> | void) | undefined;
|
|
92
93
|
hookOptions?: {
|
|
93
94
|
cloneResponse?: boolean;
|
|
94
95
|
} | undefined;
|
|
95
96
|
timeout?: number | undefined;
|
|
96
|
-
customFetchImpl:
|
|
97
|
+
customFetchImpl: _better_fetch_fetch50.FetchEsque;
|
|
97
98
|
baseURL: string;
|
|
98
99
|
throw?: boolean | undefined;
|
|
99
100
|
auth?: ({
|
|
@@ -113,10 +114,10 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
113
114
|
params?: any;
|
|
114
115
|
duplex?: "full" | "half" | undefined;
|
|
115
116
|
jsonParser: (text: string) => Promise<any> | any;
|
|
116
|
-
retry?:
|
|
117
|
+
retry?: _better_fetch_fetch50.RetryOptions | undefined;
|
|
117
118
|
retryAttempt?: number | undefined;
|
|
118
|
-
output?: (
|
|
119
|
-
errorSchema?:
|
|
119
|
+
output?: (_better_fetch_fetch50.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
120
|
+
errorSchema?: _better_fetch_fetch50.StandardSchemaV1 | undefined;
|
|
120
121
|
disableValidation?: boolean | undefined;
|
|
121
122
|
disableSignal?: boolean | undefined;
|
|
122
123
|
}, unknown, unknown, {}>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../types-
|
|
3
|
-
import { a as LiteralNumber, c as OmitId, d as PrettifyDeep, f as Primitive, g as WithoutEmpty, h as UnionToIntersection, i as HasRequiredKeys, l as PreserveJSDoc, m as StripEmptyObjects, n as DeepPartial, o as LiteralString, p as RequiredKeysOf, r as Expand, s as LiteralUnion, t as Awaitable, u as Prettify } from "../../helper-
|
|
4
|
-
import "../../
|
|
1
|
+
import { fn as InferActions, hn as InferErrorCodes, mn as InferClientAPI, yn as IsSignal } from "../../index-BTk-wfTL.mjs";
|
|
2
|
+
import "../../types-CEepZ-RG.mjs";
|
|
3
|
+
import { a as LiteralNumber, c as OmitId, d as PrettifyDeep, f as Primitive, g as WithoutEmpty, h as UnionToIntersection, i as HasRequiredKeys, l as PreserveJSDoc, m as StripEmptyObjects, n as DeepPartial, o as LiteralString, p as RequiredKeysOf, r as Expand, s as LiteralUnion, t as Awaitable, u as Prettify } from "../../helper-DFzV6jvx.mjs";
|
|
4
|
+
import "../../index-D8MBzSjs.mjs";
|
|
5
|
+
import "../../plugins-SfZpwDiz.mjs";
|
|
5
6
|
import { BetterAuthClientOptions, BetterAuthClientPlugin } from "@better-auth/core";
|
|
6
7
|
import { BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
7
8
|
import * as nanostores0 from "nanostores";
|
|
@@ -64,12 +65,12 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
64
65
|
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
|
|
65
66
|
authorization: "Bearer" | "Basic";
|
|
66
67
|
})) | undefined;
|
|
68
|
+
redirect?: RequestRedirect | undefined;
|
|
67
69
|
credentials?: RequestCredentials;
|
|
68
70
|
integrity?: string | undefined;
|
|
69
71
|
keepalive?: boolean | undefined;
|
|
70
72
|
mode?: RequestMode | undefined;
|
|
71
73
|
priority?: RequestPriority | undefined;
|
|
72
|
-
redirect?: RequestRedirect | undefined;
|
|
73
74
|
referrer?: string | undefined;
|
|
74
75
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
75
76
|
signal?: (AbortSignal | null) | undefined;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "../../types-
|
|
3
|
-
import { a as LiteralNumber, c as OmitId, d as PrettifyDeep, f as Primitive, g as WithoutEmpty, h as UnionToIntersection, i as HasRequiredKeys, l as PreserveJSDoc, m as StripEmptyObjects, n as DeepPartial, o as LiteralString, p as RequiredKeysOf, r as Expand, s as LiteralUnion, t as Awaitable, u as Prettify } from "../../helper-
|
|
4
|
-
import "../../
|
|
1
|
+
import { fn as InferActions, hn as InferErrorCodes, mn as InferClientAPI, yn as IsSignal } from "../../index-BTk-wfTL.mjs";
|
|
2
|
+
import "../../types-CEepZ-RG.mjs";
|
|
3
|
+
import { a as LiteralNumber, c as OmitId, d as PrettifyDeep, f as Primitive, g as WithoutEmpty, h as UnionToIntersection, i as HasRequiredKeys, l as PreserveJSDoc, m as StripEmptyObjects, n as DeepPartial, o as LiteralString, p as RequiredKeysOf, r as Expand, s as LiteralUnion, t as Awaitable, u as Prettify } from "../../helper-DFzV6jvx.mjs";
|
|
4
|
+
import "../../index-D8MBzSjs.mjs";
|
|
5
|
+
import "../../plugins-SfZpwDiz.mjs";
|
|
5
6
|
import { BetterAuthClientOptions, BetterAuthClientPlugin } from "@better-auth/core";
|
|
6
7
|
import { BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
8
|
+
import * as nanostores0 from "nanostores";
|
|
9
|
+
import * as _better_fetch_fetch16 from "@better-fetch/fetch";
|
|
9
10
|
import { BetterFetchError } from "@better-fetch/fetch";
|
|
10
11
|
import { DeepReadonly, Ref } from "vue";
|
|
11
12
|
export * from "nanostores";
|
|
@@ -72,27 +73,27 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
72
73
|
error: null;
|
|
73
74
|
} ? S : Res extends Record<string, any> ? Res : never : never>;
|
|
74
75
|
};
|
|
75
|
-
$fetch:
|
|
76
|
-
plugins: (
|
|
76
|
+
$fetch: _better_fetch_fetch16.BetterFetch<{
|
|
77
|
+
plugins: (_better_fetch_fetch16.BetterFetchPlugin | {
|
|
77
78
|
id: string;
|
|
78
79
|
name: string;
|
|
79
80
|
hooks: {
|
|
80
|
-
onSuccess(context:
|
|
81
|
+
onSuccess(context: _better_fetch_fetch16.SuccessContext<any>): void;
|
|
81
82
|
};
|
|
82
83
|
} | {
|
|
83
84
|
id: string;
|
|
84
85
|
name: string;
|
|
85
86
|
hooks: {
|
|
86
|
-
onRequest<T extends Record<string, any>>(context:
|
|
87
|
+
onRequest<T extends Record<string, any>>(context: _better_fetch_fetch16.RequestContext<T>): void;
|
|
87
88
|
};
|
|
88
89
|
} | {
|
|
89
90
|
id: string;
|
|
90
91
|
name: string;
|
|
91
92
|
hooks: {
|
|
92
|
-
onSuccess: ((context:
|
|
93
|
-
onError: ((context:
|
|
94
|
-
onRequest: (<T extends Record<string, any>>(context:
|
|
95
|
-
onResponse: ((context:
|
|
93
|
+
onSuccess: ((context: _better_fetch_fetch16.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
94
|
+
onError: ((context: _better_fetch_fetch16.ErrorContext) => Promise<void> | void) | undefined;
|
|
95
|
+
onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch16.RequestContext<T>) => Promise<_better_fetch_fetch16.RequestContext | void> | _better_fetch_fetch16.RequestContext | void) | undefined;
|
|
96
|
+
onResponse: ((context: _better_fetch_fetch16.ResponseContext) => Promise<Response | void | _better_fetch_fetch16.ResponseContext> | Response | _better_fetch_fetch16.ResponseContext | void) | undefined;
|
|
96
97
|
};
|
|
97
98
|
})[];
|
|
98
99
|
cache?: RequestCache | undefined;
|
|
@@ -102,22 +103,22 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
102
103
|
"content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
|
|
103
104
|
authorization: "Bearer" | "Basic";
|
|
104
105
|
})) | undefined;
|
|
106
|
+
redirect?: RequestRedirect | undefined;
|
|
105
107
|
credentials?: RequestCredentials;
|
|
106
108
|
integrity?: string | undefined;
|
|
107
109
|
keepalive?: boolean | undefined;
|
|
108
110
|
mode?: RequestMode | undefined;
|
|
109
111
|
priority?: RequestPriority | undefined;
|
|
110
|
-
redirect?: RequestRedirect | undefined;
|
|
111
112
|
referrer?: string | undefined;
|
|
112
113
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
113
114
|
signal?: (AbortSignal | null) | undefined;
|
|
114
115
|
window?: null | undefined;
|
|
115
|
-
onRetry?: ((response:
|
|
116
|
+
onRetry?: ((response: _better_fetch_fetch16.ResponseContext) => Promise<void> | void) | undefined;
|
|
116
117
|
hookOptions?: {
|
|
117
118
|
cloneResponse?: boolean;
|
|
118
119
|
} | undefined;
|
|
119
120
|
timeout?: number | undefined;
|
|
120
|
-
customFetchImpl:
|
|
121
|
+
customFetchImpl: _better_fetch_fetch16.FetchEsque;
|
|
121
122
|
baseURL: string;
|
|
122
123
|
throw?: boolean | undefined;
|
|
123
124
|
auth?: ({
|
|
@@ -137,17 +138,17 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
137
138
|
params?: any;
|
|
138
139
|
duplex?: "full" | "half" | undefined;
|
|
139
140
|
jsonParser: (text: string) => Promise<any> | any;
|
|
140
|
-
retry?:
|
|
141
|
+
retry?: _better_fetch_fetch16.RetryOptions | undefined;
|
|
141
142
|
retryAttempt?: number | undefined;
|
|
142
|
-
output?: (
|
|
143
|
-
errorSchema?:
|
|
143
|
+
output?: (_better_fetch_fetch16.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
144
|
+
errorSchema?: _better_fetch_fetch16.StandardSchemaV1 | undefined;
|
|
144
145
|
disableValidation?: boolean | undefined;
|
|
145
146
|
disableSignal?: boolean | undefined;
|
|
146
147
|
}, unknown, unknown, {}>;
|
|
147
148
|
$store: {
|
|
148
149
|
notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
|
|
149
150
|
listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
|
|
150
|
-
atoms: Record<string,
|
|
151
|
+
atoms: Record<string, nanostores0.WritableAtom<any>>;
|
|
151
152
|
};
|
|
152
153
|
$ERROR_CODES: PrettifyDeep<InferErrorCodes<Option> & typeof BASE_ERROR_CODES>;
|
|
153
154
|
};
|
package/dist/cookies/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import "../index-
|
|
2
|
-
import "../types-
|
|
3
|
-
import "../helper-
|
|
4
|
-
import "../
|
|
5
|
-
import
|
|
1
|
+
import "../index-BTk-wfTL.mjs";
|
|
2
|
+
import "../types-CEepZ-RG.mjs";
|
|
3
|
+
import "../helper-DFzV6jvx.mjs";
|
|
4
|
+
import "../index-D8MBzSjs.mjs";
|
|
5
|
+
import "../plugins-SfZpwDiz.mjs";
|
|
6
|
+
import { a as getCookies, c as setCookieCache, d as getChunkedCookie, f as parseSetCookieHeader, i as getCookieCache, l as setSessionCookie, n as createCookieGetter, o as getSessionCookie, p as setCookieToHeader, r as deleteSessionCookie, s as parseCookies, t as EligibleCookies, u as createSessionStore } from "../index-BDwnO3gz.mjs";
|
|
6
7
|
export { EligibleCookies, createCookieGetter, createSessionStore, deleteSessionCookie, getChunkedCookie, getCookieCache, getCookies, getSessionCookie, parseCookies, parseSetCookieHeader, setCookieCache, setCookieToHeader, setSessionCookie };
|
package/dist/db/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { $
|
|
2
|
-
import "../types-
|
|
3
|
-
import "../helper-
|
|
4
|
-
import "../
|
|
1
|
+
import { $n as getBaseAdapter, An as parseInputData, Bn as convertFromDB, Cn as getWithHooks, Dn as parseAccountInput, En as mergeSchema, Fn as createInternalAdapter, Gn as InferFieldsFromPlugins, Hn as FieldAttributeToObject, In as getAuthTables, Jn as InferFieldsOutput, Kn as InferFieldsInput, Ln as getSchema, Mn as parseSessionOutput, Nn as parseUserInput, On as parseAccountOutput, Pn as parseUserOutput, Qn as getAdapter, Rn as getMigrations, Tn as toZodSchema, Un as InferAdditionalFieldsFromPluginOptions, Vn as convertToDB, Wn as InferFieldsFromOptions, Xn as PluginFieldAttribute, Yn as InferValueType, Zn as createFieldAttribute, jn as parseSessionInput, kn as parseAdditionalUserInput, qn as InferFieldsInputClient, wn as FieldAttributeToSchema, zn as matchType } from "../index-BTk-wfTL.mjs";
|
|
2
|
+
import "../types-CEepZ-RG.mjs";
|
|
3
|
+
import "../helper-DFzV6jvx.mjs";
|
|
4
|
+
import "../index-D8MBzSjs.mjs";
|
|
5
|
+
import "../plugins-SfZpwDiz.mjs";
|
|
5
6
|
export * from "@better-auth/core/db";
|
|
6
7
|
export { FieldAttributeToObject, FieldAttributeToSchema, InferAdditionalFieldsFromPluginOptions, InferFieldsFromOptions, InferFieldsFromPlugins, InferFieldsInput, InferFieldsInputClient, InferFieldsOutput, InferValueType, PluginFieldAttribute, convertFromDB, convertToDB, createFieldAttribute, createInternalAdapter, getAdapter, getAuthTables, getBaseAdapter, getMigrations, getSchema, getWithHooks, matchType, mergeSchema, parseAccountInput, parseAccountOutput, parseAdditionalUserInput, parseInputData, parseSessionInput, parseSessionOutput, parseUserInput, parseUserOutput, toZodSchema };
|
package/dist/db/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../dialect-
|
|
1
|
+
import "../dialect-D9ZUZA4J.mjs";
|
|
2
2
|
import { a as getAuthTables } from "../get-model-name-D4DUV7S2.mjs";
|
|
3
|
-
import { a as createInternalAdapter, c as convertToDB, d as getBaseAdapter, i as toZodSchema, l as createFieldAttribute, n as matchType, o as getWithHooks, r as getSchema, s as convertFromDB, t as getMigrations, u as getAdapter } from "../get-migration-
|
|
3
|
+
import { a as createInternalAdapter, c as convertToDB, d as getBaseAdapter, i as toZodSchema, l as createFieldAttribute, n as matchType, o as getWithHooks, r as getSchema, s as convertFromDB, t as getMigrations, u as getAdapter } from "../get-migration-wMpq_Lmw.mjs";
|
|
4
4
|
import "../utils-DBbaShi0.mjs";
|
|
5
5
|
import "../crypto-BQxYXGGX.mjs";
|
|
6
6
|
import "../jwt-DzuIBp7t.mjs";
|
|
@@ -41,7 +41,7 @@ const createKyselyAdapter = async (config) => {
|
|
|
41
41
|
if ("getConnection" in db) dialect = new MysqlDialect(db);
|
|
42
42
|
if ("connect" in db) dialect = new PostgresDialect({ pool: db });
|
|
43
43
|
if ("fileControl" in db) {
|
|
44
|
-
const { BunSqliteDialect } = await import("./bun-sqlite-dialect-
|
|
44
|
+
const { BunSqliteDialect } = await import("./bun-sqlite-dialect-C3P_ISb5.mjs");
|
|
45
45
|
dialect = new BunSqliteDialect({ database: db });
|
|
46
46
|
}
|
|
47
47
|
if ("createSession" in db && typeof window === "undefined") {
|
|
@@ -57,7 +57,7 @@ const createKyselyAdapter = async (config) => {
|
|
|
57
57
|
if (error !== null && typeof error === "object" && "code" in error && error.code !== "ERR_UNKNOWN_BUILTIN_MODULE") throw error;
|
|
58
58
|
}
|
|
59
59
|
if (DatabaseSync && db instanceof DatabaseSync) {
|
|
60
|
-
const { NodeSqliteDialect } = await import("./node-sqlite-dialect-
|
|
60
|
+
const { NodeSqliteDialect } = await import("./node-sqlite-dialect-D6w8Ekdz.mjs");
|
|
61
61
|
dialect = new NodeSqliteDialect({ database: db });
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as symmetricEncrypt, o as constantTimeEqual, r as generateRandomString, t as symmetricDecrypt } from "./crypto-BQxYXGGX.mjs";
|
|
2
2
|
import { u as getDate } from "./schema-CSB7dlK0.mjs";
|
|
3
|
-
import { t as APIError } from "./api-
|
|
3
|
+
import { t as APIError } from "./api-q2sbQ7PT.mjs";
|
|
4
4
|
import { c as setSessionCookie, s as setCookieCache } from "./cookies-D_dksn7B.mjs";
|
|
5
5
|
import { r as getSessionFromCtx } from "./session-CgfX4vv1.mjs";
|
|
6
6
|
import { t as getEndpointResponse } from "./plugin-helper-CA_Vvnl9.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as __require, o as __toESM, t as __commonJS } from "./chunk-
|
|
1
|
+
import { i as __require, o as __toESM, t as __commonJS } from "./chunk-09eW3CcW.mjs";
|
|
2
2
|
|
|
3
3
|
//#region ../../node_modules/.pnpm/postgres-array@2.0.0/node_modules/postgres-array/index.js
|
|
4
4
|
var require_postgres_array = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/postgres-array@2.0.0/node_modules/postgres-array/index.js": ((exports) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as parseState,
|
|
2
|
-
import { O as handleOAuthUserInfo } from "./api-
|
|
1
|
+
import { i as parseState, r as generateState } from "./utils-DBbaShi0.mjs";
|
|
2
|
+
import { O as handleOAuthUserInfo } from "./api-q2sbQ7PT.mjs";
|
|
3
3
|
import { c as setSessionCookie } from "./cookies-D_dksn7B.mjs";
|
|
4
4
|
import { u as sessionMiddleware } from "./session-CgfX4vv1.mjs";
|
|
5
5
|
import { BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
@@ -677,7 +677,7 @@ const genericOAuth = (options) => {
|
|
|
677
677
|
state: z.string().meta({ description: "The state parameter from the OAuth2 request" }).optional()
|
|
678
678
|
}),
|
|
679
679
|
metadata: {
|
|
680
|
-
|
|
680
|
+
client: false,
|
|
681
681
|
allowedMediaTypes: ["application/x-www-form-urlencoded", "application/json"],
|
|
682
682
|
openapi: {
|
|
683
683
|
description: "OAuth2 callback",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createKyselyAdapter } from "./dialect-
|
|
1
|
+
import { t as createKyselyAdapter } from "./dialect-D9ZUZA4J.mjs";
|
|
2
2
|
import { a as getAuthTables, n as initGetFieldName, t as initGetModelName } from "./get-model-name-D4DUV7S2.mjs";
|
|
3
3
|
import { t as generateId } from "./utils-DBbaShi0.mjs";
|
|
4
4
|
import { l as parseUserOutput, s as parseSessionOutput, u as getDate } from "./schema-CSB7dlK0.mjs";
|
|
@@ -343,11 +343,11 @@ const createInternalAdapter = (adapter, ctx) => {
|
|
|
343
343
|
}], "user", void 0);
|
|
344
344
|
},
|
|
345
345
|
createSession: async (userId, dontRememberMe, override, overrideAll) => {
|
|
346
|
-
const ctx$1 = await getCurrentAuthContext()
|
|
347
|
-
const headers = ctx$1
|
|
346
|
+
const ctx$1 = await getCurrentAuthContext();
|
|
347
|
+
const headers = ctx$1.headers || ctx$1.request?.headers;
|
|
348
348
|
const { id: _, ...rest } = override || {};
|
|
349
349
|
const data = {
|
|
350
|
-
ipAddress: ctx$1
|
|
350
|
+
ipAddress: ctx$1.request || ctx$1.headers ? getIp(ctx$1.request || ctx$1.headers, ctx$1.context.options) || "" : "",
|
|
351
351
|
userAgent: headers?.get("user-agent") || "",
|
|
352
352
|
...rest,
|
|
353
353
|
expiresAt: dontRememberMe ? getDate(3600 * 24, "sec") : getDate(sessionExpiration, "sec"),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as APIError } from "./api-
|
|
1
|
+
import { t as APIError } from "./api-q2sbQ7PT.mjs";
|
|
2
2
|
import { getCurrentAuthContext } from "@better-auth/core/context";
|
|
3
3
|
import { defineErrorCodes } from "@better-auth/core/utils";
|
|
4
4
|
import { createHash } from "@better-auth/utils/hash";
|