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
|
@@ -5,7 +5,7 @@ import { TwoFactorOptions, TwoFactorProvider, TwoFactorTable, UserWithTwoFactor
|
|
|
5
5
|
import { TWO_FACTOR_ERROR_CODES } from "./error-code.mjs";
|
|
6
6
|
import { twoFactorClient } from "./client.mjs";
|
|
7
7
|
import * as _better_auth_core11 from "@better-auth/core";
|
|
8
|
-
import * as
|
|
8
|
+
import * as better_call86 from "better-call";
|
|
9
9
|
import * as z from "zod";
|
|
10
10
|
|
|
11
11
|
//#region src/plugins/two-factor/index.d.ts
|
|
@@ -27,13 +27,13 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
27
27
|
*
|
|
28
28
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/2fa#api-method-two-factor-enable)
|
|
29
29
|
*/
|
|
30
|
-
enableTwoFactor:
|
|
30
|
+
enableTwoFactor: better_call86.StrictEndpoint<"/two-factor/enable", {
|
|
31
31
|
method: "POST";
|
|
32
32
|
body: z.ZodObject<{
|
|
33
33
|
password: z.ZodString;
|
|
34
34
|
issuer: z.ZodOptional<z.ZodString>;
|
|
35
35
|
}, z.core.$strip>;
|
|
36
|
-
use: ((inputContext:
|
|
36
|
+
use: ((inputContext: better_call86.MiddlewareInputContext<better_call86.MiddlewareOptions>) => Promise<{
|
|
37
37
|
session: {
|
|
38
38
|
session: Record<string, any> & {
|
|
39
39
|
id: string;
|
|
@@ -106,12 +106,12 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
106
106
|
*
|
|
107
107
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/2fa#api-method-two-factor-disable)
|
|
108
108
|
*/
|
|
109
|
-
disableTwoFactor:
|
|
109
|
+
disableTwoFactor: better_call86.StrictEndpoint<"/two-factor/disable", {
|
|
110
110
|
method: "POST";
|
|
111
111
|
body: z.ZodObject<{
|
|
112
112
|
password: z.ZodString;
|
|
113
113
|
}, z.core.$strip>;
|
|
114
|
-
use: ((inputContext:
|
|
114
|
+
use: ((inputContext: better_call86.MiddlewareInputContext<better_call86.MiddlewareOptions>) => Promise<{
|
|
115
115
|
session: {
|
|
116
116
|
session: Record<string, any> & {
|
|
117
117
|
id: string;
|
|
@@ -160,7 +160,7 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
160
160
|
}, {
|
|
161
161
|
status: boolean;
|
|
162
162
|
}>;
|
|
163
|
-
verifyBackupCode:
|
|
163
|
+
verifyBackupCode: better_call86.StrictEndpoint<"/two-factor/verify-backup-code", {
|
|
164
164
|
method: "POST";
|
|
165
165
|
body: z.ZodObject<{
|
|
166
166
|
code: z.ZodString;
|
|
@@ -271,12 +271,12 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
271
271
|
image?: string | null | undefined;
|
|
272
272
|
}) | UserWithTwoFactor;
|
|
273
273
|
}>;
|
|
274
|
-
generateBackupCodes:
|
|
274
|
+
generateBackupCodes: better_call86.StrictEndpoint<"/two-factor/generate-backup-codes", {
|
|
275
275
|
method: "POST";
|
|
276
276
|
body: z.ZodObject<{
|
|
277
277
|
password: z.ZodString;
|
|
278
278
|
}, z.core.$strip>;
|
|
279
|
-
use: ((inputContext:
|
|
279
|
+
use: ((inputContext: better_call86.MiddlewareInputContext<better_call86.MiddlewareOptions>) => Promise<{
|
|
280
280
|
session: {
|
|
281
281
|
session: Record<string, any> & {
|
|
282
282
|
id: string;
|
|
@@ -335,7 +335,7 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
335
335
|
status: boolean;
|
|
336
336
|
backupCodes: string[];
|
|
337
337
|
}>;
|
|
338
|
-
viewBackupCodes:
|
|
338
|
+
viewBackupCodes: better_call86.StrictEndpoint<string, {
|
|
339
339
|
method: "POST";
|
|
340
340
|
body: z.ZodObject<{
|
|
341
341
|
userId: z.ZodCoercedString<unknown>;
|
|
@@ -344,7 +344,7 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
344
344
|
status: boolean;
|
|
345
345
|
backupCodes: string[];
|
|
346
346
|
}>;
|
|
347
|
-
sendTwoFactorOTP:
|
|
347
|
+
sendTwoFactorOTP: better_call86.StrictEndpoint<"/two-factor/send-otp", {
|
|
348
348
|
method: "POST";
|
|
349
349
|
body: z.ZodOptional<z.ZodObject<{
|
|
350
350
|
trustDevice: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -375,7 +375,7 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
375
375
|
}, {
|
|
376
376
|
status: boolean;
|
|
377
377
|
}>;
|
|
378
|
-
verifyTwoFactorOTP:
|
|
378
|
+
verifyTwoFactorOTP: better_call86.StrictEndpoint<"/two-factor/verify-otp", {
|
|
379
379
|
method: "POST";
|
|
380
380
|
body: z.ZodObject<{
|
|
381
381
|
code: z.ZodString;
|
|
@@ -464,7 +464,7 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
464
464
|
image?: string | null | undefined;
|
|
465
465
|
};
|
|
466
466
|
}>;
|
|
467
|
-
generateTOTP:
|
|
467
|
+
generateTOTP: better_call86.StrictEndpoint<string, {
|
|
468
468
|
method: "POST";
|
|
469
469
|
body: z.ZodObject<{
|
|
470
470
|
secret: z.ZodString;
|
|
@@ -495,9 +495,9 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
495
495
|
}, {
|
|
496
496
|
code: string;
|
|
497
497
|
}>;
|
|
498
|
-
getTOTPURI:
|
|
498
|
+
getTOTPURI: better_call86.StrictEndpoint<"/two-factor/get-totp-uri", {
|
|
499
499
|
method: "POST";
|
|
500
|
-
use: ((inputContext:
|
|
500
|
+
use: ((inputContext: better_call86.MiddlewareInputContext<better_call86.MiddlewareOptions>) => Promise<{
|
|
501
501
|
session: {
|
|
502
502
|
session: Record<string, any> & {
|
|
503
503
|
id: string;
|
|
@@ -549,7 +549,7 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
549
549
|
}, {
|
|
550
550
|
totpURI: string;
|
|
551
551
|
}>;
|
|
552
|
-
verifyTOTP:
|
|
552
|
+
verifyTOTP: better_call86.StrictEndpoint<"/two-factor/verify-totp", {
|
|
553
553
|
method: "POST";
|
|
554
554
|
body: z.ZodObject<{
|
|
555
555
|
code: z.ZodString;
|
|
@@ -598,7 +598,7 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
598
598
|
hooks: {
|
|
599
599
|
after: {
|
|
600
600
|
matcher(context: _better_auth_core11.HookEndpointContext): boolean;
|
|
601
|
-
handler: (inputContext:
|
|
601
|
+
handler: (inputContext: better_call86.MiddlewareInputContext<better_call86.MiddlewareOptions>) => Promise<{
|
|
602
602
|
twoFactorRedirect: boolean;
|
|
603
603
|
} | undefined>;
|
|
604
604
|
}[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UserWithTwoFactor } from "../types.mjs";
|
|
2
2
|
import { Awaitable, GenericEndpointContext } from "@better-auth/core";
|
|
3
|
-
import * as
|
|
3
|
+
import * as better_call751 from "better-call";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/two-factor/otp/index.d.ts
|
|
@@ -74,7 +74,7 @@ declare const otp2fa: (options?: OTPOptions | undefined) => {
|
|
|
74
74
|
*
|
|
75
75
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/2fa#api-method-two-factor-send-otp)
|
|
76
76
|
*/
|
|
77
|
-
sendTwoFactorOTP:
|
|
77
|
+
sendTwoFactorOTP: better_call751.StrictEndpoint<"/two-factor/send-otp", {
|
|
78
78
|
method: "POST";
|
|
79
79
|
body: z.ZodOptional<z.ZodObject<{
|
|
80
80
|
trustDevice: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -120,7 +120,7 @@ declare const otp2fa: (options?: OTPOptions | undefined) => {
|
|
|
120
120
|
*
|
|
121
121
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/2fa#api-method-two-factor-verify-otp)
|
|
122
122
|
*/
|
|
123
|
-
verifyTwoFactorOTP:
|
|
123
|
+
verifyTwoFactorOTP: better_call751.StrictEndpoint<"/two-factor/verify-otp", {
|
|
124
124
|
method: "POST";
|
|
125
125
|
body: z.ZodObject<{
|
|
126
126
|
code: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BackupCodeOptions } from "../backup-codes/index.mjs";
|
|
2
2
|
import { UserWithTwoFactor } from "../types.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as better_call746 from "better-call";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/plugins/two-factor/totp/index.d.ts
|
|
@@ -44,7 +44,7 @@ declare const totp2fa: (options?: TOTPOptions | undefined) => {
|
|
|
44
44
|
*
|
|
45
45
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/2fa#totp)
|
|
46
46
|
*/
|
|
47
|
-
generateTOTP:
|
|
47
|
+
generateTOTP: better_call746.StrictEndpoint<string, {
|
|
48
48
|
method: "POST";
|
|
49
49
|
body: z.ZodObject<{
|
|
50
50
|
secret: z.ZodString;
|
|
@@ -90,9 +90,9 @@ declare const totp2fa: (options?: TOTPOptions | undefined) => {
|
|
|
90
90
|
*
|
|
91
91
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/2fa#getting-totp-uri)
|
|
92
92
|
*/
|
|
93
|
-
getTOTPURI:
|
|
93
|
+
getTOTPURI: better_call746.StrictEndpoint<"/two-factor/get-totp-uri", {
|
|
94
94
|
method: "POST";
|
|
95
|
-
use: ((inputContext:
|
|
95
|
+
use: ((inputContext: better_call746.MiddlewareInputContext<better_call746.MiddlewareOptions>) => Promise<{
|
|
96
96
|
session: {
|
|
97
97
|
session: Record<string, any> & {
|
|
98
98
|
id: string;
|
|
@@ -159,7 +159,7 @@ declare const totp2fa: (options?: TOTPOptions | undefined) => {
|
|
|
159
159
|
*
|
|
160
160
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/2fa#verifying-totp)
|
|
161
161
|
*/
|
|
162
|
-
verifyTOTP:
|
|
162
|
+
verifyTOTP: better_call746.StrictEndpoint<"/two-factor/verify-totp", {
|
|
163
163
|
method: "POST";
|
|
164
164
|
body: z.ZodObject<{
|
|
165
165
|
code: z.ZodString;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { InferOptionSchema } from "../../types/plugins.mjs";
|
|
2
2
|
import { UsernameSchema } from "./schema.mjs";
|
|
3
3
|
import { USERNAME_ERROR_CODES } from "./error-codes.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as _better_auth_core12 from "@better-auth/core";
|
|
5
5
|
import * as _better_auth_core_db1 from "@better-auth/core/db";
|
|
6
|
-
import * as
|
|
6
|
+
import * as better_call106 from "better-call";
|
|
7
7
|
import * as z from "zod";
|
|
8
8
|
|
|
9
9
|
//#region src/plugins/username/index.d.ts
|
|
@@ -67,7 +67,7 @@ type UsernameOptions = {
|
|
|
67
67
|
};
|
|
68
68
|
declare const username: (options?: UsernameOptions | undefined) => {
|
|
69
69
|
id: "username";
|
|
70
|
-
init(ctx:
|
|
70
|
+
init(ctx: _better_auth_core12.AuthContext): {
|
|
71
71
|
options: {
|
|
72
72
|
databaseHooks: {
|
|
73
73
|
user: {
|
|
@@ -80,7 +80,7 @@ declare const username: (options?: UsernameOptions | undefined) => {
|
|
|
80
80
|
emailVerified: boolean;
|
|
81
81
|
name: string;
|
|
82
82
|
image?: string | null | undefined;
|
|
83
|
-
} & Record<string, unknown>, context:
|
|
83
|
+
} & Record<string, unknown>, context: _better_auth_core12.GenericEndpointContext | null): Promise<{
|
|
84
84
|
data: {
|
|
85
85
|
displayUsername?: string | undefined;
|
|
86
86
|
username?: string | undefined;
|
|
@@ -103,7 +103,7 @@ declare const username: (options?: UsernameOptions | undefined) => {
|
|
|
103
103
|
emailVerified: boolean;
|
|
104
104
|
name: string;
|
|
105
105
|
image?: string | null | undefined;
|
|
106
|
-
}> & Record<string, unknown>, context:
|
|
106
|
+
}> & Record<string, unknown>, context: _better_auth_core12.GenericEndpointContext | null): Promise<{
|
|
107
107
|
data: {
|
|
108
108
|
displayUsername?: string | undefined;
|
|
109
109
|
username?: string | undefined;
|
|
@@ -122,7 +122,7 @@ declare const username: (options?: UsernameOptions | undefined) => {
|
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
124
|
endpoints: {
|
|
125
|
-
signInUsername:
|
|
125
|
+
signInUsername: better_call106.StrictEndpoint<"/sign-in/username", {
|
|
126
126
|
method: "POST";
|
|
127
127
|
body: z.ZodObject<{
|
|
128
128
|
username: z.ZodString;
|
|
@@ -188,7 +188,7 @@ declare const username: (options?: UsernameOptions | undefined) => {
|
|
|
188
188
|
displayUsername: string;
|
|
189
189
|
};
|
|
190
190
|
} | null>;
|
|
191
|
-
isUsernameAvailable:
|
|
191
|
+
isUsernameAvailable: better_call106.StrictEndpoint<"/is-username-available", {
|
|
192
192
|
method: "POST";
|
|
193
193
|
body: z.ZodObject<{
|
|
194
194
|
username: z.ZodString;
|
|
@@ -222,8 +222,8 @@ declare const username: (options?: UsernameOptions | undefined) => {
|
|
|
222
222
|
};
|
|
223
223
|
hooks: {
|
|
224
224
|
before: {
|
|
225
|
-
matcher(context:
|
|
226
|
-
handler: (inputContext:
|
|
225
|
+
matcher(context: _better_auth_core12.HookEndpointContext): boolean;
|
|
226
|
+
handler: (inputContext: better_call106.MiddlewareInputContext<better_call106.MiddlewareOptions>) => Promise<void>;
|
|
227
227
|
}[];
|
|
228
228
|
};
|
|
229
229
|
options: UsernameOptions | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _better_auth_core_db14 from "@better-auth/core/db";
|
|
2
2
|
|
|
3
3
|
//#region src/plugins/username/schema.d.ts
|
|
4
4
|
declare const getSchema: (normalizer: {
|
|
@@ -14,14 +14,14 @@ declare const getSchema: (normalizer: {
|
|
|
14
14
|
unique: true;
|
|
15
15
|
returned: true;
|
|
16
16
|
transform: {
|
|
17
|
-
input(value:
|
|
17
|
+
input(value: _better_auth_core_db14.DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
displayUsername: {
|
|
21
21
|
type: "string";
|
|
22
22
|
required: false;
|
|
23
23
|
transform: {
|
|
24
|
-
input(value:
|
|
24
|
+
input(value: _better_auth_core_db14.DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
};
|