better-auth 1.4.20 → 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/adapters/memory-adapter/memory-adapter.d.mts +2 -2
- package/dist/api/index.d.mts +99 -99
- 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 +13 -13
- 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/db/field.d.mts +3 -3
- 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 +3 -3
- package/dist/plugins/anonymous/index.d.mts +7 -7
- package/dist/plugins/api-key/index.d.mts +36 -36
- 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 +14 -14
- package/dist/plugins/generic-oauth/index.d.mts +5 -5
- 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 +8 -8
- package/dist/plugins/oidc-provider/index.d.mts +13 -13
- 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/adapter.d.mts +24 -24
- package/dist/plugins/organization/client.d.mts +9 -9
- package/dist/plugins/organization/organization.d.mts +3 -3
- 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 +9 -9
- package/dist/plugins/siwe/index.d.mts +3 -3
- package/dist/plugins/two-factor/client.d.mts +2 -2
- package/dist/plugins/two-factor/index.d.mts +18 -18
- package/dist/plugins/username/index.d.mts +4 -4
- package/dist/plugins/username/schema.d.mts +3 -3
- package/dist/test-utils/test-instance.d.mts +312 -312
- package/package.json +3 -3
|
@@ -4,8 +4,8 @@ import { TOTPOptions, totp2fa } from "./totp/index.mjs";
|
|
|
4
4
|
import { TwoFactorOptions, TwoFactorProvider, TwoFactorTable, UserWithTwoFactor } from "./types.mjs";
|
|
5
5
|
import { TWO_FACTOR_ERROR_CODES } from "./error-code.mjs";
|
|
6
6
|
import { twoFactorClient } from "./client.mjs";
|
|
7
|
-
import * as
|
|
8
|
-
import * as
|
|
7
|
+
import * as _better_auth_core11 from "@better-auth/core";
|
|
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;
|
|
@@ -597,8 +597,8 @@ declare const twoFactor: <O extends TwoFactorOptions>(options?: O) => {
|
|
|
597
597
|
options: NoInfer<O>;
|
|
598
598
|
hooks: {
|
|
599
599
|
after: {
|
|
600
|
-
matcher(context:
|
|
601
|
-
handler: (inputContext:
|
|
600
|
+
matcher(context: _better_auth_core11.HookEndpointContext): boolean;
|
|
601
|
+
handler: (inputContext: better_call86.MiddlewareInputContext<better_call86.MiddlewareOptions>) => Promise<{
|
|
602
602
|
twoFactorRedirect: boolean;
|
|
603
603
|
} | undefined>;
|
|
604
604
|
}[];
|
|
@@ -3,7 +3,7 @@ import { UsernameSchema } from "./schema.mjs";
|
|
|
3
3
|
import { USERNAME_ERROR_CODES } from "./error-codes.mjs";
|
|
4
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
|
|
@@ -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;
|
|
@@ -223,7 +223,7 @@ declare const username: (options?: UsernameOptions | undefined) => {
|
|
|
223
223
|
hooks: {
|
|
224
224
|
before: {
|
|
225
225
|
matcher(context: _better_auth_core12.HookEndpointContext): boolean;
|
|
226
|
-
handler: (inputContext:
|
|
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
|
};
|