better-auth 1.4.21 → 1.4.22
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/api/index.d.mts +407 -407
- package/dist/api/middlewares/origin-check.d.mts +4 -4
- package/dist/api/routes/account.d.mts +11 -11
- package/dist/api/routes/callback.d.mts +2 -2
- package/dist/api/routes/email-verification.d.mts +4 -4
- package/dist/api/routes/error.d.mts +2 -2
- package/dist/api/routes/ok.d.mts +2 -2
- package/dist/api/routes/password.d.mts +7 -7
- package/dist/api/routes/sign-in.d.mts +4 -4
- package/dist/api/routes/sign-out.d.mts +2 -2
- package/dist/api/routes/sign-up.d.mts +3 -3
- package/dist/api/routes/update-user.d.mts +13 -13
- package/dist/client/lynx/index.d.mts +15 -15
- package/dist/client/react/index.d.mts +15 -15
- package/dist/client/solid/index.d.mts +13 -13
- package/dist/client/svelte/index.d.mts +13 -13
- package/dist/client/vanilla.d.mts +15 -15
- package/dist/client/vue/index.d.mts +15 -15
- package/dist/db/field.d.mts +6 -6
- package/dist/integrations/next-js.d.mts +4 -4
- package/dist/integrations/svelte-kit.d.mts +2 -2
- package/dist/integrations/tanstack-start-solid.d.mts +4 -4
- package/dist/integrations/tanstack-start.d.mts +4 -4
- package/dist/plugins/admin/admin.d.mts +114 -114
- package/dist/plugins/anonymous/index.d.mts +5 -5
- package/dist/plugins/api-key/index.d.mts +79 -79
- package/dist/plugins/bearer/index.d.mts +6 -6
- package/dist/plugins/captcha/index.d.mts +2 -2
- package/dist/plugins/custom-session/index.d.mts +5 -5
- package/dist/plugins/device-authorization/index.d.mts +6 -6
- package/dist/plugins/email-otp/index.d.mts +52 -52
- package/dist/plugins/generic-oauth/index.d.mts +32 -32
- package/dist/plugins/haveibeenpwned/index.d.mts +3 -3
- package/dist/plugins/jwt/client.d.mts +2 -2
- package/dist/plugins/jwt/index.d.mts +7 -7
- package/dist/plugins/last-login-method/index.d.mts +4 -4
- package/dist/plugins/magic-link/index.d.mts +4 -4
- package/dist/plugins/mcp/index.d.mts +10 -10
- package/dist/plugins/multi-session/index.d.mts +9 -9
- package/dist/plugins/oauth-proxy/index.d.mts +8 -8
- package/dist/plugins/oidc-provider/index.d.mts +13 -13
- package/dist/plugins/one-tap/client.d.mts +4 -4
- package/dist/plugins/one-tap/index.d.mts +2 -2
- package/dist/plugins/one-time-token/index.d.mts +5 -5
- package/dist/plugins/open-api/index.d.mts +3 -3
- package/dist/plugins/organization/adapter.d.mts +24 -24
- package/dist/plugins/organization/client.d.mts +8 -8
- package/dist/plugins/organization/organization.d.mts +7 -7
- package/dist/plugins/organization/routes/crud-access-control.d.mts +22 -22
- package/dist/plugins/organization/routes/crud-invites.d.mts +69 -69
- package/dist/plugins/organization/routes/crud-members.d.mts +67 -67
- package/dist/plugins/organization/routes/crud-org.d.mts +59 -59
- package/dist/plugins/organization/routes/crud-team.d.mts +79 -79
- package/dist/plugins/phone-number/index.d.mts +33 -33
- package/dist/plugins/siwe/index.d.mts +3 -3
- package/dist/plugins/two-factor/backup-codes/index.d.mts +5 -5
- package/dist/plugins/two-factor/index.d.mts +16 -16
- package/dist/plugins/two-factor/otp/index.d.mts +3 -3
- package/dist/plugins/two-factor/totp/index.d.mts +5 -5
- package/dist/plugins/username/index.d.mts +9 -9
- package/dist/plugins/username/schema.d.mts +3 -3
- package/dist/test-utils/test-instance.d.mts +1225 -1225
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenericEndpointContext } from "@better-auth/core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as better_call834 from "better-call";
|
|
3
3
|
|
|
4
4
|
//#region src/api/middlewares/origin-check.d.ts
|
|
5
5
|
|
|
@@ -7,13 +7,13 @@ import * as better_call830 from "better-call";
|
|
|
7
7
|
* A middleware to validate callbackURL and origin against trustedOrigins.
|
|
8
8
|
* Also handles CSRF protection using Fetch Metadata for first-login scenarios.
|
|
9
9
|
*/
|
|
10
|
-
declare const originCheckMiddleware: (inputContext:
|
|
11
|
-
declare const originCheck: (getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext:
|
|
10
|
+
declare const originCheckMiddleware: (inputContext: better_call834.MiddlewareInputContext<better_call834.MiddlewareOptions>) => Promise<void>;
|
|
11
|
+
declare const originCheck: (getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_call834.MiddlewareInputContext<better_call834.MiddlewareOptions>) => Promise<void>;
|
|
12
12
|
/**
|
|
13
13
|
* Middleware for CSRF protection using Fetch Metadata headers.
|
|
14
14
|
* This prevents cross-site navigation login attacks while supporting progressive enhancement.
|
|
15
15
|
*/
|
|
16
|
-
declare const formCsrfMiddleware: (inputContext:
|
|
16
|
+
declare const formCsrfMiddleware: (inputContext: better_call834.MiddlewareInputContext<better_call834.MiddlewareOptions>) => Promise<void>;
|
|
17
17
|
//#endregion
|
|
18
18
|
export { formCsrfMiddleware, originCheck, originCheckMiddleware };
|
|
19
19
|
//# sourceMappingURL=origin-check.d.mts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as _better_auth_core_oauth29 from "@better-auth/core/oauth2";
|
|
2
|
-
import * as
|
|
2
|
+
import * as better_call776 from "better-call";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/api/routes/account.d.ts
|
|
6
|
-
declare const listUserAccounts:
|
|
6
|
+
declare const listUserAccounts: better_call776.StrictEndpoint<"/list-accounts", {
|
|
7
7
|
method: "GET";
|
|
8
|
-
use: ((inputContext:
|
|
8
|
+
use: ((inputContext: better_call776.MiddlewareInputContext<better_call776.MiddlewareOptions>) => Promise<{
|
|
9
9
|
session: {
|
|
10
10
|
session: Record<string, any> & {
|
|
11
11
|
id: string;
|
|
@@ -87,7 +87,7 @@ declare const listUserAccounts: better_call755.StrictEndpoint<"/list-accounts",
|
|
|
87
87
|
providerId: string;
|
|
88
88
|
accountId: string;
|
|
89
89
|
}[]>;
|
|
90
|
-
declare const linkSocialAccount:
|
|
90
|
+
declare const linkSocialAccount: better_call776.StrictEndpoint<"/link-social", {
|
|
91
91
|
method: "POST";
|
|
92
92
|
requireHeaders: true;
|
|
93
93
|
body: z.ZodObject<{
|
|
@@ -106,7 +106,7 @@ declare const linkSocialAccount: better_call755.StrictEndpoint<"/link-social", {
|
|
|
106
106
|
disableRedirect: z.ZodOptional<z.ZodBoolean>;
|
|
107
107
|
additionalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
108
108
|
}, z.core.$strip>;
|
|
109
|
-
use: ((inputContext:
|
|
109
|
+
use: ((inputContext: better_call776.MiddlewareInputContext<better_call776.MiddlewareOptions>) => Promise<{
|
|
110
110
|
session: {
|
|
111
111
|
session: Record<string, any> & {
|
|
112
112
|
id: string;
|
|
@@ -165,13 +165,13 @@ declare const linkSocialAccount: better_call755.StrictEndpoint<"/link-social", {
|
|
|
165
165
|
url: string;
|
|
166
166
|
redirect: boolean;
|
|
167
167
|
}>;
|
|
168
|
-
declare const unlinkAccount:
|
|
168
|
+
declare const unlinkAccount: better_call776.StrictEndpoint<"/unlink-account", {
|
|
169
169
|
method: "POST";
|
|
170
170
|
body: z.ZodObject<{
|
|
171
171
|
providerId: z.ZodString;
|
|
172
172
|
accountId: z.ZodOptional<z.ZodString>;
|
|
173
173
|
}, z.core.$strip>;
|
|
174
|
-
use: ((inputContext:
|
|
174
|
+
use: ((inputContext: better_call776.MiddlewareInputContext<better_call776.MiddlewareOptions>) => Promise<{
|
|
175
175
|
session: {
|
|
176
176
|
session: Record<string, any> & {
|
|
177
177
|
id: string;
|
|
@@ -219,7 +219,7 @@ declare const unlinkAccount: better_call755.StrictEndpoint<"/unlink-account", {
|
|
|
219
219
|
}, {
|
|
220
220
|
status: boolean;
|
|
221
221
|
}>;
|
|
222
|
-
declare const getAccessToken:
|
|
222
|
+
declare const getAccessToken: better_call776.StrictEndpoint<"/get-access-token", {
|
|
223
223
|
method: "POST";
|
|
224
224
|
body: z.ZodObject<{
|
|
225
225
|
providerId: z.ZodString;
|
|
@@ -267,7 +267,7 @@ declare const getAccessToken: better_call755.StrictEndpoint<"/get-access-token",
|
|
|
267
267
|
scopes: string[];
|
|
268
268
|
idToken: string | undefined;
|
|
269
269
|
}>;
|
|
270
|
-
declare const refreshToken:
|
|
270
|
+
declare const refreshToken: better_call776.StrictEndpoint<"/refresh-token", {
|
|
271
271
|
method: "POST";
|
|
272
272
|
body: z.ZodObject<{
|
|
273
273
|
providerId: z.ZodString;
|
|
@@ -326,9 +326,9 @@ declare const refreshToken: better_call755.StrictEndpoint<"/refresh-token", {
|
|
|
326
326
|
providerId: string;
|
|
327
327
|
accountId: string;
|
|
328
328
|
}>;
|
|
329
|
-
declare const accountInfo:
|
|
329
|
+
declare const accountInfo: better_call776.StrictEndpoint<"/account-info", {
|
|
330
330
|
method: "GET";
|
|
331
|
-
use: ((inputContext:
|
|
331
|
+
use: ((inputContext: better_call776.MiddlewareInputContext<better_call776.MiddlewareOptions>) => Promise<{
|
|
332
332
|
session: {
|
|
333
333
|
session: Record<string, any> & {
|
|
334
334
|
id: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_call790 from "better-call";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/api/routes/callback.d.ts
|
|
5
|
-
declare const callbackOAuth:
|
|
5
|
+
declare const callbackOAuth: better_call790.StrictEndpoint<"/callback/:id", {
|
|
6
6
|
method: ("GET" | "POST")[];
|
|
7
7
|
operationId: string;
|
|
8
8
|
body: z.ZodOptional<z.ZodObject<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { User } from "../../types/models.mjs";
|
|
2
2
|
import "../../types/index.mjs";
|
|
3
3
|
import { GenericEndpointContext } from "@better-auth/core";
|
|
4
|
-
import * as
|
|
4
|
+
import * as better_call825 from "better-call";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/api/routes/email-verification.d.ts
|
|
@@ -22,7 +22,7 @@ extraPayload?: Record<string, any>): Promise<string>;
|
|
|
22
22
|
* A function to send a verification email to the user
|
|
23
23
|
*/
|
|
24
24
|
declare function sendVerificationEmailFn(ctx: GenericEndpointContext, user: User): Promise<void>;
|
|
25
|
-
declare const sendVerificationEmail:
|
|
25
|
+
declare const sendVerificationEmail: better_call825.StrictEndpoint<"/send-verification-email", {
|
|
26
26
|
method: "POST";
|
|
27
27
|
operationId: string;
|
|
28
28
|
body: z.ZodObject<{
|
|
@@ -97,14 +97,14 @@ declare const sendVerificationEmail: better_call787.StrictEndpoint<"/send-verifi
|
|
|
97
97
|
}, {
|
|
98
98
|
status: boolean;
|
|
99
99
|
}>;
|
|
100
|
-
declare const verifyEmail:
|
|
100
|
+
declare const verifyEmail: better_call825.StrictEndpoint<"/verify-email", {
|
|
101
101
|
method: "GET";
|
|
102
102
|
operationId: string;
|
|
103
103
|
query: z.ZodObject<{
|
|
104
104
|
token: z.ZodString;
|
|
105
105
|
callbackURL: z.ZodOptional<z.ZodString>;
|
|
106
106
|
}, z.core.$strip>;
|
|
107
|
-
use: ((inputContext:
|
|
107
|
+
use: ((inputContext: better_call825.MiddlewareInputContext<better_call825.MiddlewareOptions>) => Promise<void>)[];
|
|
108
108
|
metadata: {
|
|
109
109
|
openapi: {
|
|
110
110
|
description: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_call833 from "better-call";
|
|
2
2
|
|
|
3
3
|
//#region src/api/routes/error.d.ts
|
|
4
|
-
declare const error:
|
|
4
|
+
declare const error: better_call833.StrictEndpoint<"/error", {
|
|
5
5
|
method: "GET";
|
|
6
6
|
metadata: {
|
|
7
7
|
openapi: {
|
package/dist/api/routes/ok.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_call832 from "better-call";
|
|
2
2
|
|
|
3
3
|
//#region src/api/routes/ok.d.ts
|
|
4
|
-
declare const ok:
|
|
4
|
+
declare const ok: better_call832.StrictEndpoint<"/ok", {
|
|
5
5
|
method: "GET";
|
|
6
6
|
metadata: {
|
|
7
7
|
openapi: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_call812 from "better-call";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/api/routes/password.d.ts
|
|
5
|
-
declare const requestPasswordReset:
|
|
5
|
+
declare const requestPasswordReset: better_call812.StrictEndpoint<"/request-password-reset", {
|
|
6
6
|
method: "POST";
|
|
7
7
|
body: z.ZodObject<{
|
|
8
8
|
email: z.ZodEmail;
|
|
@@ -38,13 +38,13 @@ declare const requestPasswordReset: better_call821.StrictEndpoint<"/request-pass
|
|
|
38
38
|
status: boolean;
|
|
39
39
|
message: string;
|
|
40
40
|
}>;
|
|
41
|
-
declare const requestPasswordResetCallback:
|
|
41
|
+
declare const requestPasswordResetCallback: better_call812.StrictEndpoint<"/reset-password/:token", {
|
|
42
42
|
method: "GET";
|
|
43
43
|
operationId: string;
|
|
44
44
|
query: z.ZodObject<{
|
|
45
45
|
callbackURL: z.ZodString;
|
|
46
46
|
}, z.core.$strip>;
|
|
47
|
-
use: ((inputContext:
|
|
47
|
+
use: ((inputContext: better_call812.MiddlewareInputContext<better_call812.MiddlewareOptions>) => Promise<void>)[];
|
|
48
48
|
metadata: {
|
|
49
49
|
openapi: {
|
|
50
50
|
operationId: string;
|
|
@@ -86,7 +86,7 @@ declare const requestPasswordResetCallback: better_call821.StrictEndpoint<"/rese
|
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
}, never>;
|
|
89
|
-
declare const resetPassword:
|
|
89
|
+
declare const resetPassword: better_call812.StrictEndpoint<"/reset-password", {
|
|
90
90
|
method: "POST";
|
|
91
91
|
operationId: string;
|
|
92
92
|
query: z.ZodOptional<z.ZodObject<{
|
|
@@ -122,7 +122,7 @@ declare const resetPassword: better_call821.StrictEndpoint<"/reset-password", {
|
|
|
122
122
|
}, {
|
|
123
123
|
status: boolean;
|
|
124
124
|
}>;
|
|
125
|
-
declare const verifyPassword:
|
|
125
|
+
declare const verifyPassword: better_call812.StrictEndpoint<"/verify-password", {
|
|
126
126
|
method: "POST";
|
|
127
127
|
body: z.ZodObject<{
|
|
128
128
|
password: z.ZodString;
|
|
@@ -151,7 +151,7 @@ declare const verifyPassword: better_call821.StrictEndpoint<"/verify-password",
|
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
};
|
|
154
|
-
use: ((inputContext:
|
|
154
|
+
use: ((inputContext: better_call812.MiddlewareInputContext<better_call812.MiddlewareOptions>) => Promise<{
|
|
155
155
|
session: {
|
|
156
156
|
session: Record<string, any> & {
|
|
157
157
|
id: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InferUser } from "../../types/models.mjs";
|
|
2
2
|
import "../../types/index.mjs";
|
|
3
3
|
import { BetterAuthOptions } from "@better-auth/core";
|
|
4
|
-
import * as
|
|
4
|
+
import * as better_call820 from "better-call";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/api/routes/sign-in.d.ts
|
|
@@ -23,7 +23,7 @@ declare const socialSignInBodySchema: z.ZodObject<{
|
|
|
23
23
|
loginHint: z.ZodOptional<z.ZodString>;
|
|
24
24
|
additionalData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
25
25
|
}, z.core.$strip>;
|
|
26
|
-
declare const signInSocial: <O extends BetterAuthOptions>() =>
|
|
26
|
+
declare const signInSocial: <O extends BetterAuthOptions>() => better_call820.StrictEndpoint<"/sign-in/social", {
|
|
27
27
|
method: "POST";
|
|
28
28
|
operationId: string;
|
|
29
29
|
body: z.ZodObject<{
|
|
@@ -98,10 +98,10 @@ declare const signInSocial: <O extends BetterAuthOptions>() => better_call812.St
|
|
|
98
98
|
url: undefined;
|
|
99
99
|
user: InferUser<O>;
|
|
100
100
|
}>;
|
|
101
|
-
declare const signInEmail: <O extends BetterAuthOptions>() =>
|
|
101
|
+
declare const signInEmail: <O extends BetterAuthOptions>() => better_call820.StrictEndpoint<"/sign-in/email", {
|
|
102
102
|
method: "POST";
|
|
103
103
|
operationId: string;
|
|
104
|
-
use: ((inputContext:
|
|
104
|
+
use: ((inputContext: better_call820.MiddlewareInputContext<better_call820.MiddlewareOptions>) => Promise<void>)[];
|
|
105
105
|
body: z.ZodObject<{
|
|
106
106
|
email: z.ZodString;
|
|
107
107
|
password: z.ZodString;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_call824 from "better-call";
|
|
2
2
|
|
|
3
3
|
//#region src/api/routes/sign-out.d.ts
|
|
4
|
-
declare const signOut:
|
|
4
|
+
declare const signOut: better_call824.StrictEndpoint<"/sign-out", {
|
|
5
5
|
method: "POST";
|
|
6
6
|
operationId: string;
|
|
7
7
|
requireHeaders: true;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { AdditionalUserFieldsInput, InferUser } from "../../types/models.mjs";
|
|
2
2
|
import "../../types/index.mjs";
|
|
3
3
|
import { BetterAuthOptions } from "@better-auth/core";
|
|
4
|
-
import * as
|
|
4
|
+
import * as better_call829 from "better-call";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/api/routes/sign-up.d.ts
|
|
8
|
-
declare const signUpEmail: <O extends BetterAuthOptions>() =>
|
|
8
|
+
declare const signUpEmail: <O extends BetterAuthOptions>() => better_call829.StrictEndpoint<"/sign-up/email", {
|
|
9
9
|
method: "POST";
|
|
10
10
|
operationId: string;
|
|
11
|
-
use: ((inputContext:
|
|
11
|
+
use: ((inputContext: better_call829.MiddlewareInputContext<better_call829.MiddlewareOptions>) => Promise<void>)[];
|
|
12
12
|
body: z.ZodIntersection<z.ZodObject<{
|
|
13
13
|
name: z.ZodString;
|
|
14
14
|
email: z.ZodEmail;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { AdditionalUserFieldsInput } from "../../types/models.mjs";
|
|
2
2
|
import "../../types/index.mjs";
|
|
3
3
|
import { BetterAuthOptions } from "@better-auth/core";
|
|
4
|
-
import * as
|
|
4
|
+
import * as better_call758 from "better-call";
|
|
5
5
|
import * as z from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/api/routes/update-user.d.ts
|
|
8
|
-
declare const updateUser: <O extends BetterAuthOptions>() =>
|
|
8
|
+
declare const updateUser: <O extends BetterAuthOptions>() => better_call758.StrictEndpoint<"/update-user", {
|
|
9
9
|
method: "POST";
|
|
10
10
|
operationId: string;
|
|
11
11
|
body: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
12
|
-
use: ((inputContext:
|
|
12
|
+
use: ((inputContext: better_call758.MiddlewareInputContext<better_call758.MiddlewareOptions>) => Promise<{
|
|
13
13
|
session: {
|
|
14
14
|
session: Record<string, any> & {
|
|
15
15
|
id: string;
|
|
@@ -85,7 +85,7 @@ declare const updateUser: <O extends BetterAuthOptions>() => better_call769.Stri
|
|
|
85
85
|
}, {
|
|
86
86
|
status: boolean;
|
|
87
87
|
}>;
|
|
88
|
-
declare const changePassword:
|
|
88
|
+
declare const changePassword: better_call758.StrictEndpoint<"/change-password", {
|
|
89
89
|
method: "POST";
|
|
90
90
|
operationId: string;
|
|
91
91
|
body: z.ZodObject<{
|
|
@@ -93,7 +93,7 @@ declare const changePassword: better_call769.StrictEndpoint<"/change-password",
|
|
|
93
93
|
currentPassword: z.ZodString;
|
|
94
94
|
revokeOtherSessions: z.ZodOptional<z.ZodBoolean>;
|
|
95
95
|
}, z.core.$strip>;
|
|
96
|
-
use: ((inputContext:
|
|
96
|
+
use: ((inputContext: better_call758.MiddlewareInputContext<better_call758.MiddlewareOptions>) => Promise<{
|
|
97
97
|
session: {
|
|
98
98
|
session: Record<string, any> & {
|
|
99
99
|
id: string;
|
|
@@ -193,12 +193,12 @@ declare const changePassword: better_call769.StrictEndpoint<"/change-password",
|
|
|
193
193
|
image?: string | null | undefined;
|
|
194
194
|
} & Record<string, any>;
|
|
195
195
|
}>;
|
|
196
|
-
declare const setPassword:
|
|
196
|
+
declare const setPassword: better_call758.StrictEndpoint<string, {
|
|
197
197
|
method: "POST";
|
|
198
198
|
body: z.ZodObject<{
|
|
199
199
|
newPassword: z.ZodString;
|
|
200
200
|
}, z.core.$strip>;
|
|
201
|
-
use: ((inputContext:
|
|
201
|
+
use: ((inputContext: better_call758.MiddlewareInputContext<better_call758.MiddlewareOptions>) => Promise<{
|
|
202
202
|
session: {
|
|
203
203
|
session: Record<string, any> & {
|
|
204
204
|
id: string;
|
|
@@ -224,9 +224,9 @@ declare const setPassword: better_call769.StrictEndpoint<string, {
|
|
|
224
224
|
}, {
|
|
225
225
|
status: boolean;
|
|
226
226
|
}>;
|
|
227
|
-
declare const deleteUser:
|
|
227
|
+
declare const deleteUser: better_call758.StrictEndpoint<"/delete-user", {
|
|
228
228
|
method: "POST";
|
|
229
|
-
use: ((inputContext:
|
|
229
|
+
use: ((inputContext: better_call758.MiddlewareInputContext<better_call758.MiddlewareOptions>) => Promise<{
|
|
230
230
|
session: {
|
|
231
231
|
session: Record<string, any> & {
|
|
232
232
|
id: string;
|
|
@@ -311,13 +311,13 @@ declare const deleteUser: better_call769.StrictEndpoint<"/delete-user", {
|
|
|
311
311
|
success: boolean;
|
|
312
312
|
message: string;
|
|
313
313
|
}>;
|
|
314
|
-
declare const deleteUserCallback:
|
|
314
|
+
declare const deleteUserCallback: better_call758.StrictEndpoint<"/delete-user/callback", {
|
|
315
315
|
method: "GET";
|
|
316
316
|
query: z.ZodObject<{
|
|
317
317
|
token: z.ZodString;
|
|
318
318
|
callbackURL: z.ZodOptional<z.ZodString>;
|
|
319
319
|
}, z.core.$strip>;
|
|
320
|
-
use: ((inputContext:
|
|
320
|
+
use: ((inputContext: better_call758.MiddlewareInputContext<better_call758.MiddlewareOptions>) => Promise<void>)[];
|
|
321
321
|
metadata: {
|
|
322
322
|
openapi: {
|
|
323
323
|
description: string;
|
|
@@ -351,13 +351,13 @@ declare const deleteUserCallback: better_call769.StrictEndpoint<"/delete-user/ca
|
|
|
351
351
|
success: boolean;
|
|
352
352
|
message: string;
|
|
353
353
|
}>;
|
|
354
|
-
declare const changeEmail:
|
|
354
|
+
declare const changeEmail: better_call758.StrictEndpoint<"/change-email", {
|
|
355
355
|
method: "POST";
|
|
356
356
|
body: z.ZodObject<{
|
|
357
357
|
newEmail: z.ZodEmail;
|
|
358
358
|
callbackURL: z.ZodOptional<z.ZodString>;
|
|
359
359
|
}, z.core.$strip>;
|
|
360
|
-
use: ((inputContext:
|
|
360
|
+
use: ((inputContext: better_call758.MiddlewareInputContext<better_call758.MiddlewareOptions>) => Promise<{
|
|
361
361
|
session: {
|
|
362
362
|
session: Record<string, any> & {
|
|
363
363
|
id: string;
|
|
@@ -3,8 +3,8 @@ import { InferActions, InferClientAPI, InferErrorCodes, IsSignal, SessionQueryPa
|
|
|
3
3
|
import { useStore } from "./lynx-store.mjs";
|
|
4
4
|
import { BetterAuthClientOptions, BetterAuthClientPlugin } from "@better-auth/core";
|
|
5
5
|
import { BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
6
|
+
import * as nanostores0 from "nanostores";
|
|
7
|
+
import * as _better_fetch_fetch31 from "@better-fetch/fetch";
|
|
8
8
|
import { BetterFetchError } from "@better-fetch/fetch";
|
|
9
9
|
export * from "nanostores";
|
|
10
10
|
export * from "@better-fetch/fetch";
|
|
@@ -49,21 +49,21 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
49
49
|
error: null;
|
|
50
50
|
} ? S : Res : never>;
|
|
51
51
|
};
|
|
52
|
-
$fetch:
|
|
53
|
-
plugins: (
|
|
52
|
+
$fetch: _better_fetch_fetch31.BetterFetch<{
|
|
53
|
+
plugins: (_better_fetch_fetch31.BetterFetchPlugin<Record<string, any>> | {
|
|
54
54
|
id: string;
|
|
55
55
|
name: string;
|
|
56
56
|
hooks: {
|
|
57
|
-
onSuccess(context:
|
|
57
|
+
onSuccess(context: _better_fetch_fetch31.SuccessContext<any>): void;
|
|
58
58
|
};
|
|
59
59
|
} | {
|
|
60
60
|
id: string;
|
|
61
61
|
name: string;
|
|
62
62
|
hooks: {
|
|
63
|
-
onSuccess: ((context:
|
|
64
|
-
onError: ((context:
|
|
65
|
-
onRequest: (<T extends Record<string, any>>(context:
|
|
66
|
-
onResponse: ((context:
|
|
63
|
+
onSuccess: ((context: _better_fetch_fetch31.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
64
|
+
onError: ((context: _better_fetch_fetch31.ErrorContext) => Promise<void> | void) | undefined;
|
|
65
|
+
onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch31.RequestContext<T>) => Promise<_better_fetch_fetch31.RequestContext | void> | _better_fetch_fetch31.RequestContext | void) | undefined;
|
|
66
|
+
onResponse: ((context: _better_fetch_fetch31.ResponseContext) => Promise<Response | void | _better_fetch_fetch31.ResponseContext> | Response | _better_fetch_fetch31.ResponseContext | void) | undefined;
|
|
67
67
|
};
|
|
68
68
|
})[];
|
|
69
69
|
cache?: RequestCache | undefined;
|
|
@@ -83,12 +83,12 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
83
83
|
referrer?: string | undefined;
|
|
84
84
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
85
85
|
signal?: (AbortSignal | null) | undefined;
|
|
86
|
-
onRetry?: ((response:
|
|
86
|
+
onRetry?: ((response: _better_fetch_fetch31.ResponseContext) => Promise<void> | void) | undefined;
|
|
87
87
|
hookOptions?: {
|
|
88
88
|
cloneResponse?: boolean;
|
|
89
89
|
} | undefined;
|
|
90
90
|
timeout?: number | undefined;
|
|
91
|
-
customFetchImpl:
|
|
91
|
+
customFetchImpl: _better_fetch_fetch31.FetchEsque;
|
|
92
92
|
baseURL: string;
|
|
93
93
|
throw?: boolean | undefined;
|
|
94
94
|
auth?: ({
|
|
@@ -108,17 +108,17 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
108
108
|
params?: any;
|
|
109
109
|
duplex?: "full" | "half" | undefined;
|
|
110
110
|
jsonParser: (text: string) => Promise<any> | any;
|
|
111
|
-
retry?:
|
|
111
|
+
retry?: _better_fetch_fetch31.RetryOptions | undefined;
|
|
112
112
|
retryAttempt?: number | undefined;
|
|
113
|
-
output?: (
|
|
114
|
-
errorSchema?:
|
|
113
|
+
output?: (_better_fetch_fetch31.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
114
|
+
errorSchema?: _better_fetch_fetch31.StandardSchemaV1 | undefined;
|
|
115
115
|
disableValidation?: boolean | undefined;
|
|
116
116
|
disableSignal?: boolean | undefined;
|
|
117
117
|
}, unknown, unknown, {}>;
|
|
118
118
|
$store: {
|
|
119
119
|
notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
|
|
120
120
|
listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
|
|
121
|
-
atoms: Record<string,
|
|
121
|
+
atoms: Record<string, nanostores0.WritableAtom<any>>;
|
|
122
122
|
};
|
|
123
123
|
$ERROR_CODES: PrettifyDeep<InferErrorCodes<Option> & typeof BASE_ERROR_CODES>;
|
|
124
124
|
};
|
|
@@ -3,8 +3,8 @@ import { InferActions, InferClientAPI, InferErrorCodes, IsSignal, SessionQueryPa
|
|
|
3
3
|
import { useStore } from "./react-store.mjs";
|
|
4
4
|
import { BetterAuthClientOptions, BetterAuthClientPlugin } from "@better-auth/core";
|
|
5
5
|
import { BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
6
|
-
import * as
|
|
7
|
-
import * as
|
|
6
|
+
import * as nanostores1 from "nanostores";
|
|
7
|
+
import * as _better_fetch_fetch47 from "@better-fetch/fetch";
|
|
8
8
|
import { BetterFetchError } from "@better-fetch/fetch";
|
|
9
9
|
export * from "nanostores";
|
|
10
10
|
export * from "@better-fetch/fetch";
|
|
@@ -50,21 +50,21 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
50
50
|
error: null;
|
|
51
51
|
} ? S : Res : never>;
|
|
52
52
|
};
|
|
53
|
-
$fetch:
|
|
54
|
-
plugins: (
|
|
53
|
+
$fetch: _better_fetch_fetch47.BetterFetch<{
|
|
54
|
+
plugins: (_better_fetch_fetch47.BetterFetchPlugin<Record<string, any>> | {
|
|
55
55
|
id: string;
|
|
56
56
|
name: string;
|
|
57
57
|
hooks: {
|
|
58
|
-
onSuccess(context:
|
|
58
|
+
onSuccess(context: _better_fetch_fetch47.SuccessContext<any>): void;
|
|
59
59
|
};
|
|
60
60
|
} | {
|
|
61
61
|
id: string;
|
|
62
62
|
name: string;
|
|
63
63
|
hooks: {
|
|
64
|
-
onSuccess: ((context:
|
|
65
|
-
onError: ((context:
|
|
66
|
-
onRequest: (<T extends Record<string, any>>(context:
|
|
67
|
-
onResponse: ((context:
|
|
64
|
+
onSuccess: ((context: _better_fetch_fetch47.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
65
|
+
onError: ((context: _better_fetch_fetch47.ErrorContext) => Promise<void> | void) | undefined;
|
|
66
|
+
onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch47.RequestContext<T>) => Promise<_better_fetch_fetch47.RequestContext | void> | _better_fetch_fetch47.RequestContext | void) | undefined;
|
|
67
|
+
onResponse: ((context: _better_fetch_fetch47.ResponseContext) => Promise<Response | void | _better_fetch_fetch47.ResponseContext> | Response | _better_fetch_fetch47.ResponseContext | void) | undefined;
|
|
68
68
|
};
|
|
69
69
|
})[];
|
|
70
70
|
cache?: RequestCache | undefined;
|
|
@@ -84,12 +84,12 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
84
84
|
referrer?: string | undefined;
|
|
85
85
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
86
86
|
signal?: (AbortSignal | null) | undefined;
|
|
87
|
-
onRetry?: ((response:
|
|
87
|
+
onRetry?: ((response: _better_fetch_fetch47.ResponseContext) => Promise<void> | void) | undefined;
|
|
88
88
|
hookOptions?: {
|
|
89
89
|
cloneResponse?: boolean;
|
|
90
90
|
} | undefined;
|
|
91
91
|
timeout?: number | undefined;
|
|
92
|
-
customFetchImpl:
|
|
92
|
+
customFetchImpl: _better_fetch_fetch47.FetchEsque;
|
|
93
93
|
baseURL: string;
|
|
94
94
|
throw?: boolean | undefined;
|
|
95
95
|
auth?: ({
|
|
@@ -109,17 +109,17 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
109
109
|
params?: any;
|
|
110
110
|
duplex?: "full" | "half" | undefined;
|
|
111
111
|
jsonParser: (text: string) => Promise<any> | any;
|
|
112
|
-
retry?:
|
|
112
|
+
retry?: _better_fetch_fetch47.RetryOptions | undefined;
|
|
113
113
|
retryAttempt?: number | undefined;
|
|
114
|
-
output?: (
|
|
115
|
-
errorSchema?:
|
|
114
|
+
output?: (_better_fetch_fetch47.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
115
|
+
errorSchema?: _better_fetch_fetch47.StandardSchemaV1 | undefined;
|
|
116
116
|
disableValidation?: boolean | undefined;
|
|
117
117
|
disableSignal?: boolean | undefined;
|
|
118
118
|
}, unknown, unknown, {}>;
|
|
119
119
|
$store: {
|
|
120
120
|
notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
|
|
121
121
|
listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
|
|
122
|
-
atoms: Record<string,
|
|
122
|
+
atoms: Record<string, nanostores1.WritableAtom<any>>;
|
|
123
123
|
};
|
|
124
124
|
$ERROR_CODES: PrettifyDeep<InferErrorCodes<Option> & typeof BASE_ERROR_CODES>;
|
|
125
125
|
};
|
|
@@ -2,7 +2,7 @@ import { DeepPartial, Expand, HasRequiredKeys, LiteralNumber, LiteralUnion, Omit
|
|
|
2
2
|
import { InferActions, InferClientAPI, InferErrorCodes, IsSignal, SessionQueryParams } from "../types.mjs";
|
|
3
3
|
import { BetterAuthClientOptions, BetterAuthClientPlugin } from "@better-auth/core";
|
|
4
4
|
import { BASE_ERROR_CODES } from "@better-auth/core/error";
|
|
5
|
-
import * as
|
|
5
|
+
import * as _better_fetch_fetch15 from "@better-fetch/fetch";
|
|
6
6
|
import { BetterFetchError } from "@better-fetch/fetch";
|
|
7
7
|
import { Accessor } from "solid-js";
|
|
8
8
|
export * from "nanostores";
|
|
@@ -49,21 +49,21 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
49
49
|
error: null;
|
|
50
50
|
} ? S : Res extends Record<string, any> ? Res : never : never>;
|
|
51
51
|
};
|
|
52
|
-
$fetch:
|
|
53
|
-
plugins: (
|
|
52
|
+
$fetch: _better_fetch_fetch15.BetterFetch<{
|
|
53
|
+
plugins: (_better_fetch_fetch15.BetterFetchPlugin<Record<string, any>> | {
|
|
54
54
|
id: string;
|
|
55
55
|
name: string;
|
|
56
56
|
hooks: {
|
|
57
|
-
onSuccess(context:
|
|
57
|
+
onSuccess(context: _better_fetch_fetch15.SuccessContext<any>): void;
|
|
58
58
|
};
|
|
59
59
|
} | {
|
|
60
60
|
id: string;
|
|
61
61
|
name: string;
|
|
62
62
|
hooks: {
|
|
63
|
-
onSuccess: ((context:
|
|
64
|
-
onError: ((context:
|
|
65
|
-
onRequest: (<T extends Record<string, any>>(context:
|
|
66
|
-
onResponse: ((context:
|
|
63
|
+
onSuccess: ((context: _better_fetch_fetch15.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
64
|
+
onError: ((context: _better_fetch_fetch15.ErrorContext) => Promise<void> | void) | undefined;
|
|
65
|
+
onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch15.RequestContext<T>) => Promise<_better_fetch_fetch15.RequestContext | void> | _better_fetch_fetch15.RequestContext | void) | undefined;
|
|
66
|
+
onResponse: ((context: _better_fetch_fetch15.ResponseContext) => Promise<Response | void | _better_fetch_fetch15.ResponseContext> | Response | _better_fetch_fetch15.ResponseContext | void) | undefined;
|
|
67
67
|
};
|
|
68
68
|
})[];
|
|
69
69
|
cache?: RequestCache | undefined;
|
|
@@ -83,12 +83,12 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
83
83
|
referrer?: string | undefined;
|
|
84
84
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
85
85
|
signal?: (AbortSignal | null) | undefined;
|
|
86
|
-
onRetry?: ((response:
|
|
86
|
+
onRetry?: ((response: _better_fetch_fetch15.ResponseContext) => Promise<void> | void) | undefined;
|
|
87
87
|
hookOptions?: {
|
|
88
88
|
cloneResponse?: boolean;
|
|
89
89
|
} | undefined;
|
|
90
90
|
timeout?: number | undefined;
|
|
91
|
-
customFetchImpl:
|
|
91
|
+
customFetchImpl: _better_fetch_fetch15.FetchEsque;
|
|
92
92
|
baseURL: string;
|
|
93
93
|
throw?: boolean | undefined;
|
|
94
94
|
auth?: ({
|
|
@@ -108,10 +108,10 @@ declare function createAuthClient<Option extends BetterAuthClientOptions>(option
|
|
|
108
108
|
params?: any;
|
|
109
109
|
duplex?: "full" | "half" | undefined;
|
|
110
110
|
jsonParser: (text: string) => Promise<any> | any;
|
|
111
|
-
retry?:
|
|
111
|
+
retry?: _better_fetch_fetch15.RetryOptions | undefined;
|
|
112
112
|
retryAttempt?: number | undefined;
|
|
113
|
-
output?: (
|
|
114
|
-
errorSchema?:
|
|
113
|
+
output?: (_better_fetch_fetch15.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
114
|
+
errorSchema?: _better_fetch_fetch15.StandardSchemaV1 | undefined;
|
|
115
115
|
disableValidation?: boolean | undefined;
|
|
116
116
|
disableSignal?: boolean | undefined;
|
|
117
117
|
}, unknown, unknown, {}>;
|