better-auth 1.4.12-beta.2 → 1.4.12
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 +99 -99
- 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/session.d.mts +14 -14
- 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 +13 -13
- package/dist/client/solid/index.d.mts +13 -13
- package/dist/client/svelte/index.d.mts +15 -15
- package/dist/client/vanilla.d.mts +15 -15
- package/dist/client/vue/index.d.mts +15 -15
- package/dist/context/create-context.mjs +2 -2
- package/dist/context/create-context.mjs.map +1 -1
- package/dist/context/helpers.mjs +2 -2
- package/dist/context/helpers.mjs.map +1 -1
- 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.d.mts +4 -4
- package/dist/plugins/admin/admin.d.mts +116 -116
- package/dist/plugins/anonymous/index.d.mts +7 -7
- package/dist/plugins/api-key/index.d.mts +80 -80
- package/dist/plugins/bearer/index.d.mts +6 -6
- package/dist/plugins/captcha/index.d.mts +2 -2
- package/dist/plugins/device-authorization/index.d.mts +6 -6
- package/dist/plugins/email-otp/index.d.mts +50 -50
- package/dist/plugins/generic-oauth/index.d.mts +29 -29
- 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 +9 -9
- 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 +5 -5
- package/dist/plugins/oidc-provider/index.d.mts +15 -15
- package/dist/plugins/one-tap/client.d.mts +5 -5
- 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/client.d.mts +2 -2
- package/dist/plugins/organization/organization.d.mts +7 -7
- package/dist/plugins/organization/routes/crud-members.d.mts +62 -62
- package/dist/plugins/organization/routes/crud-org.d.mts +51 -51
- package/dist/plugins/phone-number/index.d.mts +9 -9
- 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/client.d.mts +2 -2
- package/dist/plugins/two-factor/index.d.mts +18 -18
- 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 +1242 -1242
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GenericEndpointContext } from "@better-auth/core";
|
|
2
|
-
import * as
|
|
2
|
+
import * as better_call756 from "better-call";
|
|
3
3
|
|
|
4
4
|
//#region src/api/middlewares/origin-check.d.ts
|
|
5
5
|
|
|
@@ -7,13 +7,13 @@ import * as better_call744 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_call756.MiddlewareInputContext<better_call756.MiddlewareOptions>) => Promise<void>;
|
|
11
|
+
declare const originCheck: (getValue: (ctx: GenericEndpointContext) => string | string[]) => (inputContext: better_call756.MiddlewareInputContext<better_call756.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_call756.MiddlewareInputContext<better_call756.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
2
|
import * as z from "zod";
|
|
3
|
-
import * as
|
|
3
|
+
import * as better_call766 from "better-call";
|
|
4
4
|
|
|
5
5
|
//#region src/api/routes/account.d.ts
|
|
6
|
-
declare const listUserAccounts:
|
|
6
|
+
declare const listUserAccounts: better_call766.StrictEndpoint<"/list-accounts", {
|
|
7
7
|
method: "GET";
|
|
8
|
-
use: ((inputContext:
|
|
8
|
+
use: ((inputContext: better_call766.MiddlewareInputContext<better_call766.MiddlewareOptions>) => Promise<{
|
|
9
9
|
session: {
|
|
10
10
|
session: Record<string, any> & {
|
|
11
11
|
id: string;
|
|
@@ -87,7 +87,7 @@ declare const listUserAccounts: better_call754.StrictEndpoint<"/list-accounts",
|
|
|
87
87
|
userId: string;
|
|
88
88
|
scopes: string[];
|
|
89
89
|
}[]>;
|
|
90
|
-
declare const linkSocialAccount:
|
|
90
|
+
declare const linkSocialAccount: better_call766.StrictEndpoint<"/link-social", {
|
|
91
91
|
method: "POST";
|
|
92
92
|
requireHeaders: true;
|
|
93
93
|
body: z.ZodObject<{
|
|
@@ -106,7 +106,7 @@ declare const linkSocialAccount: better_call754.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_call766.MiddlewareInputContext<better_call766.MiddlewareOptions>) => Promise<{
|
|
110
110
|
session: {
|
|
111
111
|
session: Record<string, any> & {
|
|
112
112
|
id: string;
|
|
@@ -165,13 +165,13 @@ declare const linkSocialAccount: better_call754.StrictEndpoint<"/link-social", {
|
|
|
165
165
|
url: string;
|
|
166
166
|
redirect: boolean;
|
|
167
167
|
}>;
|
|
168
|
-
declare const unlinkAccount:
|
|
168
|
+
declare const unlinkAccount: better_call766.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_call766.MiddlewareInputContext<better_call766.MiddlewareOptions>) => Promise<{
|
|
175
175
|
session: {
|
|
176
176
|
session: Record<string, any> & {
|
|
177
177
|
id: string;
|
|
@@ -219,7 +219,7 @@ declare const unlinkAccount: better_call754.StrictEndpoint<"/unlink-account", {
|
|
|
219
219
|
}, {
|
|
220
220
|
status: boolean;
|
|
221
221
|
}>;
|
|
222
|
-
declare const getAccessToken:
|
|
222
|
+
declare const getAccessToken: better_call766.StrictEndpoint<"/get-access-token", {
|
|
223
223
|
method: "POST";
|
|
224
224
|
body: z.ZodObject<{
|
|
225
225
|
providerId: z.ZodString;
|
|
@@ -274,7 +274,7 @@ declare const getAccessToken: better_call754.StrictEndpoint<"/get-access-token",
|
|
|
274
274
|
scopes: string[];
|
|
275
275
|
idToken: string | undefined;
|
|
276
276
|
}>;
|
|
277
|
-
declare const refreshToken:
|
|
277
|
+
declare const refreshToken: better_call766.StrictEndpoint<"/refresh-token", {
|
|
278
278
|
method: "POST";
|
|
279
279
|
body: z.ZodObject<{
|
|
280
280
|
providerId: z.ZodString;
|
|
@@ -333,9 +333,9 @@ declare const refreshToken: better_call754.StrictEndpoint<"/refresh-token", {
|
|
|
333
333
|
providerId: string;
|
|
334
334
|
accountId: string;
|
|
335
335
|
}>;
|
|
336
|
-
declare const accountInfo:
|
|
336
|
+
declare const accountInfo: better_call766.StrictEndpoint<"/account-info", {
|
|
337
337
|
method: "GET";
|
|
338
|
-
use: ((inputContext:
|
|
338
|
+
use: ((inputContext: better_call766.MiddlewareInputContext<better_call766.MiddlewareOptions>) => Promise<{
|
|
339
339
|
session: {
|
|
340
340
|
session: Record<string, any> & {
|
|
341
341
|
id: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import * as
|
|
2
|
+
import * as better_call781 from "better-call";
|
|
3
3
|
|
|
4
4
|
//#region src/api/routes/callback.d.ts
|
|
5
|
-
declare const callbackOAuth:
|
|
5
|
+
declare const callbackOAuth: better_call781.StrictEndpoint<"/callback/:id", {
|
|
6
6
|
method: ("GET" | "POST")[];
|
|
7
7
|
operationId: string;
|
|
8
8
|
body: z.ZodOptional<z.ZodObject<{
|
|
@@ -2,7 +2,7 @@ import { User } from "../../types/models.mjs";
|
|
|
2
2
|
import "../../types/index.mjs";
|
|
3
3
|
import { GenericEndpointContext } from "@better-auth/core";
|
|
4
4
|
import * as z from "zod";
|
|
5
|
-
import * as
|
|
5
|
+
import * as better_call762 from "better-call";
|
|
6
6
|
|
|
7
7
|
//#region src/api/routes/email-verification.d.ts
|
|
8
8
|
declare function createEmailVerificationToken(secret: string, email: string,
|
|
@@ -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_call762.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_call750.StrictEndpoint<"/send-verifi
|
|
|
97
97
|
}, {
|
|
98
98
|
status: boolean;
|
|
99
99
|
}>;
|
|
100
|
-
declare const verifyEmail:
|
|
100
|
+
declare const verifyEmail: better_call762.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_call762.MiddlewareInputContext<better_call762.MiddlewareOptions>) => Promise<void>)[];
|
|
108
108
|
metadata: {
|
|
109
109
|
openapi: {
|
|
110
110
|
description: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as better_call780 from "better-call";
|
|
2
2
|
|
|
3
3
|
//#region src/api/routes/error.d.ts
|
|
4
|
-
declare const error:
|
|
4
|
+
declare const error: better_call780.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_call782 from "better-call";
|
|
2
2
|
|
|
3
3
|
//#region src/api/routes/ok.d.ts
|
|
4
|
-
declare const ok:
|
|
4
|
+
declare const ok: better_call782.StrictEndpoint<"/ok", {
|
|
5
5
|
method: "GET";
|
|
6
6
|
metadata: {
|
|
7
7
|
openapi: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
-
import * as
|
|
2
|
+
import * as better_call783 from "better-call";
|
|
3
3
|
|
|
4
4
|
//#region src/api/routes/password.d.ts
|
|
5
|
-
declare const requestPasswordReset:
|
|
5
|
+
declare const requestPasswordReset: better_call783.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_call817.StrictEndpoint<"/request-pass
|
|
|
38
38
|
status: boolean;
|
|
39
39
|
message: string;
|
|
40
40
|
}>;
|
|
41
|
-
declare const requestPasswordResetCallback:
|
|
41
|
+
declare const requestPasswordResetCallback: better_call783.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_call783.MiddlewareInputContext<better_call783.MiddlewareOptions>) => Promise<void>)[];
|
|
48
48
|
metadata: {
|
|
49
49
|
openapi: {
|
|
50
50
|
operationId: string;
|
|
@@ -86,7 +86,7 @@ declare const requestPasswordResetCallback: better_call817.StrictEndpoint<"/rese
|
|
|
86
86
|
};
|
|
87
87
|
};
|
|
88
88
|
}, never>;
|
|
89
|
-
declare const resetPassword:
|
|
89
|
+
declare const resetPassword: better_call783.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_call817.StrictEndpoint<"/reset-password", {
|
|
|
122
122
|
}, {
|
|
123
123
|
status: boolean;
|
|
124
124
|
}>;
|
|
125
|
-
declare const verifyPassword:
|
|
125
|
+
declare const verifyPassword: better_call783.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_call817.StrictEndpoint<"/verify-password",
|
|
|
151
151
|
};
|
|
152
152
|
};
|
|
153
153
|
};
|
|
154
|
-
use: ((inputContext:
|
|
154
|
+
use: ((inputContext: better_call783.MiddlewareInputContext<better_call783.MiddlewareOptions>) => Promise<{
|
|
155
155
|
session: {
|
|
156
156
|
session: Record<string, any> & {
|
|
157
157
|
id: string;
|
|
@@ -3,10 +3,10 @@ import { InferSession, InferUser, Session, User } from "../../types/models.mjs";
|
|
|
3
3
|
import "../../types/index.mjs";
|
|
4
4
|
import { BetterAuthOptions, GenericEndpointContext } from "@better-auth/core";
|
|
5
5
|
import * as z from "zod";
|
|
6
|
-
import * as
|
|
6
|
+
import * as better_call791 from "better-call";
|
|
7
7
|
|
|
8
8
|
//#region src/api/routes/session.d.ts
|
|
9
|
-
declare const getSession: <Option extends BetterAuthOptions>() =>
|
|
9
|
+
declare const getSession: <Option extends BetterAuthOptions>() => better_call791.StrictEndpoint<"/get-session", {
|
|
10
10
|
method: "GET";
|
|
11
11
|
operationId: string;
|
|
12
12
|
query: z.ZodOptional<z.ZodObject<{
|
|
@@ -56,7 +56,7 @@ declare const getSessionFromCtx: <U extends Record<string, any> = Record<string,
|
|
|
56
56
|
/**
|
|
57
57
|
* The middleware forces the endpoint to require a valid session.
|
|
58
58
|
*/
|
|
59
|
-
declare const sessionMiddleware: (inputContext:
|
|
59
|
+
declare const sessionMiddleware: (inputContext: better_call791.MiddlewareInputContext<better_call791.MiddlewareOptions>) => Promise<{
|
|
60
60
|
session: {
|
|
61
61
|
session: Record<string, any> & {
|
|
62
62
|
id: string;
|
|
@@ -84,7 +84,7 @@ declare const sessionMiddleware: (inputContext: better_call792.MiddlewareInputCo
|
|
|
84
84
|
* This should be used for sensitive operations like password changes, account deletion, etc.
|
|
85
85
|
* to ensure that revoked sessions cannot be used even if they're still cached in cookies.
|
|
86
86
|
*/
|
|
87
|
-
declare const sensitiveSessionMiddleware: (inputContext:
|
|
87
|
+
declare const sensitiveSessionMiddleware: (inputContext: better_call791.MiddlewareInputContext<better_call791.MiddlewareOptions>) => Promise<{
|
|
88
88
|
session: {
|
|
89
89
|
session: Record<string, any> & {
|
|
90
90
|
id: string;
|
|
@@ -111,7 +111,7 @@ declare const sensitiveSessionMiddleware: (inputContext: better_call792.Middlewa
|
|
|
111
111
|
* This middleware allows you to call the endpoint on the client if session is valid.
|
|
112
112
|
* However, if called on the server, no session is required.
|
|
113
113
|
*/
|
|
114
|
-
declare const requestOnlySessionMiddleware: (inputContext:
|
|
114
|
+
declare const requestOnlySessionMiddleware: (inputContext: better_call791.MiddlewareInputContext<better_call791.MiddlewareOptions>) => Promise<{
|
|
115
115
|
session: {
|
|
116
116
|
session: Record<string, any> & {
|
|
117
117
|
id: string;
|
|
@@ -141,7 +141,7 @@ declare const requestOnlySessionMiddleware: (inputContext: better_call792.Middle
|
|
|
141
141
|
* Session freshness check will be skipped if the session config's freshAge
|
|
142
142
|
* is set to 0
|
|
143
143
|
*/
|
|
144
|
-
declare const freshSessionMiddleware: (inputContext:
|
|
144
|
+
declare const freshSessionMiddleware: (inputContext: better_call791.MiddlewareInputContext<better_call791.MiddlewareOptions>) => Promise<{
|
|
145
145
|
session: {
|
|
146
146
|
session: Record<string, any> & {
|
|
147
147
|
id: string;
|
|
@@ -167,10 +167,10 @@ declare const freshSessionMiddleware: (inputContext: better_call792.MiddlewareIn
|
|
|
167
167
|
/**
|
|
168
168
|
* user active sessions list
|
|
169
169
|
*/
|
|
170
|
-
declare const listSessions: <Option extends BetterAuthOptions>() =>
|
|
170
|
+
declare const listSessions: <Option extends BetterAuthOptions>() => better_call791.StrictEndpoint<"/list-sessions", {
|
|
171
171
|
method: "GET";
|
|
172
172
|
operationId: string;
|
|
173
|
-
use: ((inputContext:
|
|
173
|
+
use: ((inputContext: better_call791.MiddlewareInputContext<better_call791.MiddlewareOptions>) => Promise<{
|
|
174
174
|
session: {
|
|
175
175
|
session: Record<string, any> & {
|
|
176
176
|
id: string;
|
|
@@ -219,12 +219,12 @@ declare const listSessions: <Option extends BetterAuthOptions>() => better_call7
|
|
|
219
219
|
/**
|
|
220
220
|
* revoke a single session
|
|
221
221
|
*/
|
|
222
|
-
declare const revokeSession:
|
|
222
|
+
declare const revokeSession: better_call791.StrictEndpoint<"/revoke-session", {
|
|
223
223
|
method: "POST";
|
|
224
224
|
body: z.ZodObject<{
|
|
225
225
|
token: z.ZodString;
|
|
226
226
|
}, z.core.$strip>;
|
|
227
|
-
use: ((inputContext:
|
|
227
|
+
use: ((inputContext: better_call791.MiddlewareInputContext<better_call791.MiddlewareOptions>) => Promise<{
|
|
228
228
|
session: {
|
|
229
229
|
session: Record<string, any> & {
|
|
230
230
|
id: string;
|
|
@@ -294,9 +294,9 @@ declare const revokeSession: better_call792.StrictEndpoint<"/revoke-session", {
|
|
|
294
294
|
/**
|
|
295
295
|
* revoke all user sessions
|
|
296
296
|
*/
|
|
297
|
-
declare const revokeSessions:
|
|
297
|
+
declare const revokeSessions: better_call791.StrictEndpoint<"/revoke-sessions", {
|
|
298
298
|
method: "POST";
|
|
299
|
-
use: ((inputContext:
|
|
299
|
+
use: ((inputContext: better_call791.MiddlewareInputContext<better_call791.MiddlewareOptions>) => Promise<{
|
|
300
300
|
session: {
|
|
301
301
|
session: Record<string, any> & {
|
|
302
302
|
id: string;
|
|
@@ -347,10 +347,10 @@ declare const revokeSessions: better_call792.StrictEndpoint<"/revoke-sessions",
|
|
|
347
347
|
}, {
|
|
348
348
|
status: boolean;
|
|
349
349
|
}>;
|
|
350
|
-
declare const revokeOtherSessions:
|
|
350
|
+
declare const revokeOtherSessions: better_call791.StrictEndpoint<"/revoke-other-sessions", {
|
|
351
351
|
method: "POST";
|
|
352
352
|
requireHeaders: true;
|
|
353
|
-
use: ((inputContext:
|
|
353
|
+
use: ((inputContext: better_call791.MiddlewareInputContext<better_call791.MiddlewareOptions>) => Promise<{
|
|
354
354
|
session: {
|
|
355
355
|
session: Record<string, any> & {
|
|
356
356
|
id: string;
|
|
@@ -2,7 +2,7 @@ import { InferUser } from "../../types/models.mjs";
|
|
|
2
2
|
import "../../types/index.mjs";
|
|
3
3
|
import { BetterAuthOptions } from "@better-auth/core";
|
|
4
4
|
import * as z from "zod";
|
|
5
|
-
import * as
|
|
5
|
+
import * as better_call830 from "better-call";
|
|
6
6
|
|
|
7
7
|
//#region src/api/routes/sign-in.d.ts
|
|
8
8
|
declare const socialSignInBodySchema: z.ZodObject<{
|
|
@@ -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_call830.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_call788.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_call830.StrictEndpoint<"/sign-in/email", {
|
|
102
102
|
method: "POST";
|
|
103
103
|
operationId: string;
|
|
104
|
-
use: ((inputContext:
|
|
104
|
+
use: ((inputContext: better_call830.MiddlewareInputContext<better_call830.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_call837 from "better-call";
|
|
2
2
|
|
|
3
3
|
//#region src/api/routes/sign-out.d.ts
|
|
4
|
-
declare const signOut:
|
|
4
|
+
declare const signOut: better_call837.StrictEndpoint<"/sign-out", {
|
|
5
5
|
method: "POST";
|
|
6
6
|
operationId: string;
|
|
7
7
|
requireHeaders: true;
|
|
@@ -2,13 +2,13 @@ import { AdditionalUserFieldsInput, InferUser } from "../../types/models.mjs";
|
|
|
2
2
|
import "../../types/index.mjs";
|
|
3
3
|
import { BetterAuthOptions } from "@better-auth/core";
|
|
4
4
|
import * as z from "zod";
|
|
5
|
-
import * as
|
|
5
|
+
import * as better_call834 from "better-call";
|
|
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_call834.StrictEndpoint<"/sign-up/email", {
|
|
9
9
|
method: "POST";
|
|
10
10
|
operationId: string;
|
|
11
|
-
use: ((inputContext:
|
|
11
|
+
use: ((inputContext: better_call834.MiddlewareInputContext<better_call834.MiddlewareOptions>) => Promise<void>)[];
|
|
12
12
|
body: z.ZodIntersection<z.ZodObject<{
|
|
13
13
|
name: z.ZodString;
|
|
14
14
|
email: z.ZodEmail;
|
|
@@ -2,14 +2,14 @@ import { AdditionalUserFieldsInput } from "../../types/models.mjs";
|
|
|
2
2
|
import "../../types/index.mjs";
|
|
3
3
|
import { BetterAuthOptions } from "@better-auth/core";
|
|
4
4
|
import * as z from "zod";
|
|
5
|
-
import * as
|
|
5
|
+
import * as better_call812 from "better-call";
|
|
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_call812.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_call812.MiddlewareInputContext<better_call812.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_call768.Stri
|
|
|
85
85
|
}, {
|
|
86
86
|
status: boolean;
|
|
87
87
|
}>;
|
|
88
|
-
declare const changePassword:
|
|
88
|
+
declare const changePassword: better_call812.StrictEndpoint<"/change-password", {
|
|
89
89
|
method: "POST";
|
|
90
90
|
operationId: string;
|
|
91
91
|
body: z.ZodObject<{
|
|
@@ -93,7 +93,7 @@ declare const changePassword: better_call768.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_call812.MiddlewareInputContext<better_call812.MiddlewareOptions>) => Promise<{
|
|
97
97
|
session: {
|
|
98
98
|
session: Record<string, any> & {
|
|
99
99
|
id: string;
|
|
@@ -193,12 +193,12 @@ declare const changePassword: better_call768.StrictEndpoint<"/change-password",
|
|
|
193
193
|
updatedAt: Date;
|
|
194
194
|
};
|
|
195
195
|
}>;
|
|
196
|
-
declare const setPassword:
|
|
196
|
+
declare const setPassword: better_call812.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_call812.MiddlewareInputContext<better_call812.MiddlewareOptions>) => Promise<{
|
|
202
202
|
session: {
|
|
203
203
|
session: Record<string, any> & {
|
|
204
204
|
id: string;
|
|
@@ -224,9 +224,9 @@ declare const setPassword: better_call768.StrictEndpoint<string, {
|
|
|
224
224
|
}, {
|
|
225
225
|
status: boolean;
|
|
226
226
|
}>;
|
|
227
|
-
declare const deleteUser:
|
|
227
|
+
declare const deleteUser: better_call812.StrictEndpoint<"/delete-user", {
|
|
228
228
|
method: "POST";
|
|
229
|
-
use: ((inputContext:
|
|
229
|
+
use: ((inputContext: better_call812.MiddlewareInputContext<better_call812.MiddlewareOptions>) => Promise<{
|
|
230
230
|
session: {
|
|
231
231
|
session: Record<string, any> & {
|
|
232
232
|
id: string;
|
|
@@ -311,13 +311,13 @@ declare const deleteUser: better_call768.StrictEndpoint<"/delete-user", {
|
|
|
311
311
|
success: boolean;
|
|
312
312
|
message: string;
|
|
313
313
|
}>;
|
|
314
|
-
declare const deleteUserCallback:
|
|
314
|
+
declare const deleteUserCallback: better_call812.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_call812.MiddlewareInputContext<better_call812.MiddlewareOptions>) => Promise<void>)[];
|
|
321
321
|
metadata: {
|
|
322
322
|
openapi: {
|
|
323
323
|
description: string;
|
|
@@ -351,13 +351,13 @@ declare const deleteUserCallback: better_call768.StrictEndpoint<"/delete-user/ca
|
|
|
351
351
|
success: boolean;
|
|
352
352
|
message: string;
|
|
353
353
|
}>;
|
|
354
|
-
declare const changeEmail:
|
|
354
|
+
declare const changeEmail: better_call812.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_call812.MiddlewareInputContext<better_call812.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_fetch15 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_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
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
84
84
|
signal?: (AbortSignal | null) | undefined;
|
|
85
85
|
window?: 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,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_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, {}>;
|
|
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
|
};
|
|
@@ -4,7 +4,7 @@ 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
6
|
import * as nanostores0 from "nanostores";
|
|
7
|
-
import * as
|
|
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";
|
|
@@ -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_fetch31.BetterFetch<{
|
|
54
|
+
plugins: (_better_fetch_fetch31.BetterFetchPlugin<Record<string, any>> | {
|
|
55
55
|
id: string;
|
|
56
56
|
name: string;
|
|
57
57
|
hooks: {
|
|
58
|
-
onSuccess(context:
|
|
58
|
+
onSuccess(context: _better_fetch_fetch31.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_fetch31.SuccessContext<any>) => Promise<void> | void) | undefined;
|
|
65
|
+
onError: ((context: _better_fetch_fetch31.ErrorContext) => Promise<void> | void) | undefined;
|
|
66
|
+
onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch31.RequestContext<T>) => Promise<_better_fetch_fetch31.RequestContext | void> | _better_fetch_fetch31.RequestContext | void) | undefined;
|
|
67
|
+
onResponse: ((context: _better_fetch_fetch31.ResponseContext) => Promise<Response | void | _better_fetch_fetch31.ResponseContext> | Response | _better_fetch_fetch31.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
|
referrerPolicy?: ReferrerPolicy | undefined;
|
|
85
85
|
signal?: (AbortSignal | null) | undefined;
|
|
86
86
|
window?: null | undefined;
|
|
87
|
-
onRetry?: ((response:
|
|
87
|
+
onRetry?: ((response: _better_fetch_fetch31.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_fetch31.FetchEsque;
|
|
93
93
|
baseURL: string;
|
|
94
94
|
throw?: boolean | undefined;
|
|
95
95
|
auth?: ({
|
|
@@ -109,10 +109,10 @@ 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_fetch31.RetryOptions | undefined;
|
|
113
113
|
retryAttempt?: number | undefined;
|
|
114
|
-
output?: (
|
|
115
|
-
errorSchema?:
|
|
114
|
+
output?: (_better_fetch_fetch31.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
|
|
115
|
+
errorSchema?: _better_fetch_fetch31.StandardSchemaV1 | undefined;
|
|
116
116
|
disableValidation?: boolean | undefined;
|
|
117
117
|
disableSignal?: boolean | undefined;
|
|
118
118
|
}, unknown, unknown, {}>;
|