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
|
@@ -7,9 +7,9 @@ import { teamSchema } from "../schema.mjs";
|
|
|
7
7
|
import "../../index.mjs";
|
|
8
8
|
import { defaultRoles } from "../access/statement.mjs";
|
|
9
9
|
import "../access/index.mjs";
|
|
10
|
-
import * as
|
|
11
|
-
import * as
|
|
12
|
-
import * as
|
|
10
|
+
import * as _better_auth_core45 from "@better-auth/core";
|
|
11
|
+
import * as _better_auth_core_db60 from "@better-auth/core/db";
|
|
12
|
+
import * as better_call840 from "better-call";
|
|
13
13
|
import * as z from "zod";
|
|
14
14
|
|
|
15
15
|
//#region src/plugins/organization/routes/crud-team.d.ts
|
|
@@ -17,23 +17,23 @@ declare const teamBaseSchema: z.ZodObject<{
|
|
|
17
17
|
name: z.ZodString;
|
|
18
18
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
19
19
|
}, z.core.$strip>;
|
|
20
|
-
declare const createTeam: <O extends OrganizationOptions>(options: O) =>
|
|
20
|
+
declare const createTeam: <O extends OrganizationOptions>(options: O) => better_call840.StrictEndpoint<"/organization/create-team", {
|
|
21
21
|
method: "POST";
|
|
22
22
|
body: z.ZodObject<{
|
|
23
23
|
name: z.ZodString;
|
|
24
24
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
25
25
|
}, z.core.$strip>;
|
|
26
|
-
use: ((inputContext:
|
|
26
|
+
use: ((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
27
27
|
orgOptions: OrganizationOptions;
|
|
28
28
|
roles: typeof defaultRoles & {
|
|
29
29
|
[key: string]: Role<{}>;
|
|
30
30
|
};
|
|
31
|
-
getSession: (context:
|
|
32
|
-
session:
|
|
31
|
+
getSession: (context: _better_auth_core45.GenericEndpointContext) => Promise<{
|
|
32
|
+
session: _better_auth_core_db60.Session & {
|
|
33
33
|
activeTeamId?: string | undefined;
|
|
34
34
|
activeOrganizationId?: string | undefined;
|
|
35
35
|
};
|
|
36
|
-
user:
|
|
36
|
+
user: _better_auth_core_db60.User;
|
|
37
37
|
}>;
|
|
38
38
|
}>)[];
|
|
39
39
|
metadata: {
|
|
@@ -89,26 +89,26 @@ declare const createTeam: <O extends OrganizationOptions>(options: O) => better_
|
|
|
89
89
|
updatedAt?: Date | undefined;
|
|
90
90
|
} & (O["schema"] extends {
|
|
91
91
|
team?: {
|
|
92
|
-
additionalFields: infer Field extends Record<string,
|
|
92
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db60.DBFieldAttribute>;
|
|
93
93
|
} | undefined;
|
|
94
94
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never>;
|
|
95
|
-
declare const removeTeam: <O extends OrganizationOptions>(options: O) =>
|
|
95
|
+
declare const removeTeam: <O extends OrganizationOptions>(options: O) => better_call840.StrictEndpoint<"/organization/remove-team", {
|
|
96
96
|
method: "POST";
|
|
97
97
|
body: z.ZodObject<{
|
|
98
98
|
teamId: z.ZodString;
|
|
99
99
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
100
100
|
}, z.core.$strip>;
|
|
101
|
-
use: ((inputContext:
|
|
101
|
+
use: ((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
102
102
|
orgOptions: OrganizationOptions;
|
|
103
103
|
roles: typeof defaultRoles & {
|
|
104
104
|
[key: string]: Role<{}>;
|
|
105
105
|
};
|
|
106
|
-
getSession: (context:
|
|
107
|
-
session:
|
|
106
|
+
getSession: (context: _better_auth_core45.GenericEndpointContext) => Promise<{
|
|
107
|
+
session: _better_auth_core_db60.Session & {
|
|
108
108
|
activeTeamId?: string | undefined;
|
|
109
109
|
activeOrganizationId?: string | undefined;
|
|
110
110
|
};
|
|
111
|
-
user:
|
|
111
|
+
user: _better_auth_core_db60.User;
|
|
112
112
|
}>;
|
|
113
113
|
}>)[];
|
|
114
114
|
metadata: {
|
|
@@ -139,7 +139,7 @@ declare const removeTeam: <O extends OrganizationOptions>(options: O) => better_
|
|
|
139
139
|
}, {
|
|
140
140
|
message: string;
|
|
141
141
|
} | null>;
|
|
142
|
-
declare const updateTeam: <O extends OrganizationOptions>(options: O) =>
|
|
142
|
+
declare const updateTeam: <O extends OrganizationOptions>(options: O) => better_call840.StrictEndpoint<"/organization/update-team", {
|
|
143
143
|
method: "POST";
|
|
144
144
|
body: z.ZodObject<{
|
|
145
145
|
teamId: z.ZodString;
|
|
@@ -152,20 +152,20 @@ declare const updateTeam: <O extends OrganizationOptions>(options: O) => better_
|
|
|
152
152
|
}, z.core.$strip>;
|
|
153
153
|
}, z.core.$strip>;
|
|
154
154
|
requireHeaders: true;
|
|
155
|
-
use: (((inputContext:
|
|
155
|
+
use: (((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
156
156
|
orgOptions: OrganizationOptions;
|
|
157
157
|
roles: typeof defaultRoles & {
|
|
158
158
|
[key: string]: Role<{}>;
|
|
159
159
|
};
|
|
160
|
-
getSession: (context:
|
|
161
|
-
session:
|
|
160
|
+
getSession: (context: _better_auth_core45.GenericEndpointContext) => Promise<{
|
|
161
|
+
session: _better_auth_core_db60.Session & {
|
|
162
162
|
activeTeamId?: string | undefined;
|
|
163
163
|
activeOrganizationId?: string | undefined;
|
|
164
164
|
};
|
|
165
|
-
user:
|
|
165
|
+
user: _better_auth_core_db60.User;
|
|
166
166
|
}>;
|
|
167
|
-
}>) | ((inputContext:
|
|
168
|
-
use: ((inputContext:
|
|
167
|
+
}>) | ((inputContext: better_call840.MiddlewareInputContext<{
|
|
168
|
+
use: ((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
169
169
|
session: {
|
|
170
170
|
session: Record<string, any> & {
|
|
171
171
|
id: string;
|
|
@@ -190,11 +190,11 @@ declare const updateTeam: <O extends OrganizationOptions>(options: O) => better_
|
|
|
190
190
|
}>)[];
|
|
191
191
|
}>) => Promise<{
|
|
192
192
|
session: {
|
|
193
|
-
session:
|
|
193
|
+
session: _better_auth_core_db60.Session & {
|
|
194
194
|
activeTeamId?: string | undefined;
|
|
195
195
|
activeOrganizationId?: string | undefined;
|
|
196
196
|
};
|
|
197
|
-
user:
|
|
197
|
+
user: _better_auth_core_db60.User;
|
|
198
198
|
};
|
|
199
199
|
}>))[];
|
|
200
200
|
metadata: {
|
|
@@ -253,10 +253,10 @@ declare const updateTeam: <O extends OrganizationOptions>(options: O) => better_
|
|
|
253
253
|
updatedAt?: Date | undefined;
|
|
254
254
|
} & (O["schema"] extends {
|
|
255
255
|
team?: {
|
|
256
|
-
additionalFields: infer Field extends Record<string,
|
|
256
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db60.DBFieldAttribute>;
|
|
257
257
|
} | undefined;
|
|
258
258
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never) & InferAdditionalFieldsFromPluginOptions<"team", O, true>) | null>;
|
|
259
|
-
declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O) =>
|
|
259
|
+
declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O) => better_call840.StrictEndpoint<"/organization/list-teams", {
|
|
260
260
|
method: "GET";
|
|
261
261
|
query: z.ZodOptional<z.ZodObject<{
|
|
262
262
|
organizationId: z.ZodOptional<z.ZodString>;
|
|
@@ -308,20 +308,20 @@ declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O)
|
|
|
308
308
|
};
|
|
309
309
|
};
|
|
310
310
|
requireHeaders: true;
|
|
311
|
-
use: (((inputContext:
|
|
311
|
+
use: (((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
312
312
|
orgOptions: OrganizationOptions;
|
|
313
313
|
roles: typeof defaultRoles & {
|
|
314
314
|
[key: string]: Role<{}>;
|
|
315
315
|
};
|
|
316
|
-
getSession: (context:
|
|
317
|
-
session:
|
|
316
|
+
getSession: (context: _better_auth_core45.GenericEndpointContext) => Promise<{
|
|
317
|
+
session: _better_auth_core_db60.Session & {
|
|
318
318
|
activeTeamId?: string | undefined;
|
|
319
319
|
activeOrganizationId?: string | undefined;
|
|
320
320
|
};
|
|
321
|
-
user:
|
|
321
|
+
user: _better_auth_core_db60.User;
|
|
322
322
|
}>;
|
|
323
|
-
}>) | ((inputContext:
|
|
324
|
-
use: ((inputContext:
|
|
323
|
+
}>) | ((inputContext: better_call840.MiddlewareInputContext<{
|
|
324
|
+
use: ((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
325
325
|
session: {
|
|
326
326
|
session: Record<string, any> & {
|
|
327
327
|
id: string;
|
|
@@ -346,11 +346,11 @@ declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O)
|
|
|
346
346
|
}>)[];
|
|
347
347
|
}>) => Promise<{
|
|
348
348
|
session: {
|
|
349
|
-
session:
|
|
349
|
+
session: _better_auth_core_db60.Session & {
|
|
350
350
|
activeTeamId?: string | undefined;
|
|
351
351
|
activeOrganizationId?: string | undefined;
|
|
352
352
|
};
|
|
353
|
-
user:
|
|
353
|
+
user: _better_auth_core_db60.User;
|
|
354
354
|
};
|
|
355
355
|
}>))[];
|
|
356
356
|
}, ({
|
|
@@ -361,29 +361,29 @@ declare const listOrganizationTeams: <O extends OrganizationOptions>(options: O)
|
|
|
361
361
|
updatedAt?: Date | undefined;
|
|
362
362
|
} & (O["schema"] extends {
|
|
363
363
|
team?: {
|
|
364
|
-
additionalFields: infer Field extends Record<string,
|
|
364
|
+
additionalFields: infer Field extends Record<string, _better_auth_core_db60.DBFieldAttribute>;
|
|
365
365
|
} | undefined;
|
|
366
366
|
} ? FieldAttributeToObject<Field> : {}) extends infer T ? { [K in keyof T]: T[K] } : never)[]>;
|
|
367
|
-
declare const setActiveTeam: <O extends OrganizationOptions>(options: O) =>
|
|
367
|
+
declare const setActiveTeam: <O extends OrganizationOptions>(options: O) => better_call840.StrictEndpoint<"/organization/set-active-team", {
|
|
368
368
|
method: "POST";
|
|
369
369
|
body: z.ZodObject<{
|
|
370
370
|
teamId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
371
371
|
}, z.core.$strip>;
|
|
372
372
|
requireHeaders: true;
|
|
373
|
-
use: (((inputContext:
|
|
373
|
+
use: (((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
374
374
|
orgOptions: OrganizationOptions;
|
|
375
375
|
roles: typeof defaultRoles & {
|
|
376
376
|
[key: string]: Role<{}>;
|
|
377
377
|
};
|
|
378
|
-
getSession: (context:
|
|
379
|
-
session:
|
|
378
|
+
getSession: (context: _better_auth_core45.GenericEndpointContext) => Promise<{
|
|
379
|
+
session: _better_auth_core_db60.Session & {
|
|
380
380
|
activeTeamId?: string | undefined;
|
|
381
381
|
activeOrganizationId?: string | undefined;
|
|
382
382
|
};
|
|
383
|
-
user:
|
|
383
|
+
user: _better_auth_core_db60.User;
|
|
384
384
|
}>;
|
|
385
|
-
}>) | ((inputContext:
|
|
386
|
-
use: ((inputContext:
|
|
385
|
+
}>) | ((inputContext: better_call840.MiddlewareInputContext<{
|
|
386
|
+
use: ((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
387
387
|
session: {
|
|
388
388
|
session: Record<string, any> & {
|
|
389
389
|
id: string;
|
|
@@ -408,11 +408,11 @@ declare const setActiveTeam: <O extends OrganizationOptions>(options: O) => bett
|
|
|
408
408
|
}>)[];
|
|
409
409
|
}>) => Promise<{
|
|
410
410
|
session: {
|
|
411
|
-
session:
|
|
411
|
+
session: _better_auth_core_db60.Session & {
|
|
412
412
|
activeTeamId?: string | undefined;
|
|
413
413
|
activeOrganizationId?: string | undefined;
|
|
414
414
|
};
|
|
415
|
-
user:
|
|
415
|
+
user: _better_auth_core_db60.User;
|
|
416
416
|
};
|
|
417
417
|
}>))[];
|
|
418
418
|
metadata: {
|
|
@@ -441,7 +441,7 @@ declare const setActiveTeam: <O extends OrganizationOptions>(options: O) => bett
|
|
|
441
441
|
createdAt: Date;
|
|
442
442
|
updatedAt?: Date | undefined;
|
|
443
443
|
} | null>;
|
|
444
|
-
declare const listUserTeams: <O extends OrganizationOptions>(options: O) =>
|
|
444
|
+
declare const listUserTeams: <O extends OrganizationOptions>(options: O) => better_call840.StrictEndpoint<"/organization/list-user-teams", {
|
|
445
445
|
method: "GET";
|
|
446
446
|
metadata: {
|
|
447
447
|
openapi: {
|
|
@@ -467,20 +467,20 @@ declare const listUserTeams: <O extends OrganizationOptions>(options: O) => bett
|
|
|
467
467
|
};
|
|
468
468
|
};
|
|
469
469
|
requireHeaders: true;
|
|
470
|
-
use: (((inputContext:
|
|
470
|
+
use: (((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
471
471
|
orgOptions: OrganizationOptions;
|
|
472
472
|
roles: typeof defaultRoles & {
|
|
473
473
|
[key: string]: Role<{}>;
|
|
474
474
|
};
|
|
475
|
-
getSession: (context:
|
|
476
|
-
session:
|
|
475
|
+
getSession: (context: _better_auth_core45.GenericEndpointContext) => Promise<{
|
|
476
|
+
session: _better_auth_core_db60.Session & {
|
|
477
477
|
activeTeamId?: string | undefined;
|
|
478
478
|
activeOrganizationId?: string | undefined;
|
|
479
479
|
};
|
|
480
|
-
user:
|
|
480
|
+
user: _better_auth_core_db60.User;
|
|
481
481
|
}>;
|
|
482
|
-
}>) | ((inputContext:
|
|
483
|
-
use: ((inputContext:
|
|
482
|
+
}>) | ((inputContext: better_call840.MiddlewareInputContext<{
|
|
483
|
+
use: ((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
484
484
|
session: {
|
|
485
485
|
session: Record<string, any> & {
|
|
486
486
|
id: string;
|
|
@@ -505,11 +505,11 @@ declare const listUserTeams: <O extends OrganizationOptions>(options: O) => bett
|
|
|
505
505
|
}>)[];
|
|
506
506
|
}>) => Promise<{
|
|
507
507
|
session: {
|
|
508
|
-
session:
|
|
508
|
+
session: _better_auth_core_db60.Session & {
|
|
509
509
|
activeTeamId?: string | undefined;
|
|
510
510
|
activeOrganizationId?: string | undefined;
|
|
511
511
|
};
|
|
512
|
-
user:
|
|
512
|
+
user: _better_auth_core_db60.User;
|
|
513
513
|
};
|
|
514
514
|
}>))[];
|
|
515
515
|
}, {
|
|
@@ -519,7 +519,7 @@ declare const listUserTeams: <O extends OrganizationOptions>(options: O) => bett
|
|
|
519
519
|
createdAt: Date;
|
|
520
520
|
updatedAt?: Date | undefined;
|
|
521
521
|
}[]>;
|
|
522
|
-
declare const listTeamMembers: <O extends OrganizationOptions>(options: O) =>
|
|
522
|
+
declare const listTeamMembers: <O extends OrganizationOptions>(options: O) => better_call840.StrictEndpoint<"/organization/list-team-members", {
|
|
523
523
|
method: "GET";
|
|
524
524
|
query: z.ZodOptional<z.ZodObject<{
|
|
525
525
|
teamId: z.ZodOptional<z.ZodString>;
|
|
@@ -567,20 +567,20 @@ declare const listTeamMembers: <O extends OrganizationOptions>(options: O) => be
|
|
|
567
567
|
};
|
|
568
568
|
};
|
|
569
569
|
requireHeaders: true;
|
|
570
|
-
use: (((inputContext:
|
|
570
|
+
use: (((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
571
571
|
orgOptions: OrganizationOptions;
|
|
572
572
|
roles: typeof defaultRoles & {
|
|
573
573
|
[key: string]: Role<{}>;
|
|
574
574
|
};
|
|
575
|
-
getSession: (context:
|
|
576
|
-
session:
|
|
575
|
+
getSession: (context: _better_auth_core45.GenericEndpointContext) => Promise<{
|
|
576
|
+
session: _better_auth_core_db60.Session & {
|
|
577
577
|
activeTeamId?: string | undefined;
|
|
578
578
|
activeOrganizationId?: string | undefined;
|
|
579
579
|
};
|
|
580
|
-
user:
|
|
580
|
+
user: _better_auth_core_db60.User;
|
|
581
581
|
}>;
|
|
582
|
-
}>) | ((inputContext:
|
|
583
|
-
use: ((inputContext:
|
|
582
|
+
}>) | ((inputContext: better_call840.MiddlewareInputContext<{
|
|
583
|
+
use: ((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
584
584
|
session: {
|
|
585
585
|
session: Record<string, any> & {
|
|
586
586
|
id: string;
|
|
@@ -605,11 +605,11 @@ declare const listTeamMembers: <O extends OrganizationOptions>(options: O) => be
|
|
|
605
605
|
}>)[];
|
|
606
606
|
}>) => Promise<{
|
|
607
607
|
session: {
|
|
608
|
-
session:
|
|
608
|
+
session: _better_auth_core_db60.Session & {
|
|
609
609
|
activeTeamId?: string | undefined;
|
|
610
610
|
activeOrganizationId?: string | undefined;
|
|
611
611
|
};
|
|
612
|
-
user:
|
|
612
|
+
user: _better_auth_core_db60.User;
|
|
613
613
|
};
|
|
614
614
|
}>))[];
|
|
615
615
|
}, {
|
|
@@ -618,7 +618,7 @@ declare const listTeamMembers: <O extends OrganizationOptions>(options: O) => be
|
|
|
618
618
|
userId: string;
|
|
619
619
|
createdAt: Date;
|
|
620
620
|
}[]>;
|
|
621
|
-
declare const addTeamMember: <O extends OrganizationOptions>(options: O) =>
|
|
621
|
+
declare const addTeamMember: <O extends OrganizationOptions>(options: O) => better_call840.StrictEndpoint<"/organization/add-team-member", {
|
|
622
622
|
method: "POST";
|
|
623
623
|
body: z.ZodObject<{
|
|
624
624
|
teamId: z.ZodString;
|
|
@@ -663,20 +663,20 @@ declare const addTeamMember: <O extends OrganizationOptions>(options: O) => bett
|
|
|
663
663
|
};
|
|
664
664
|
};
|
|
665
665
|
requireHeaders: true;
|
|
666
|
-
use: (((inputContext:
|
|
666
|
+
use: (((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
667
667
|
orgOptions: OrganizationOptions;
|
|
668
668
|
roles: typeof defaultRoles & {
|
|
669
669
|
[key: string]: Role<{}>;
|
|
670
670
|
};
|
|
671
|
-
getSession: (context:
|
|
672
|
-
session:
|
|
671
|
+
getSession: (context: _better_auth_core45.GenericEndpointContext) => Promise<{
|
|
672
|
+
session: _better_auth_core_db60.Session & {
|
|
673
673
|
activeTeamId?: string | undefined;
|
|
674
674
|
activeOrganizationId?: string | undefined;
|
|
675
675
|
};
|
|
676
|
-
user:
|
|
676
|
+
user: _better_auth_core_db60.User;
|
|
677
677
|
}>;
|
|
678
|
-
}>) | ((inputContext:
|
|
679
|
-
use: ((inputContext:
|
|
678
|
+
}>) | ((inputContext: better_call840.MiddlewareInputContext<{
|
|
679
|
+
use: ((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
680
680
|
session: {
|
|
681
681
|
session: Record<string, any> & {
|
|
682
682
|
id: string;
|
|
@@ -701,11 +701,11 @@ declare const addTeamMember: <O extends OrganizationOptions>(options: O) => bett
|
|
|
701
701
|
}>)[];
|
|
702
702
|
}>) => Promise<{
|
|
703
703
|
session: {
|
|
704
|
-
session:
|
|
704
|
+
session: _better_auth_core_db60.Session & {
|
|
705
705
|
activeTeamId?: string | undefined;
|
|
706
706
|
activeOrganizationId?: string | undefined;
|
|
707
707
|
};
|
|
708
|
-
user:
|
|
708
|
+
user: _better_auth_core_db60.User;
|
|
709
709
|
};
|
|
710
710
|
}>))[];
|
|
711
711
|
}, {
|
|
@@ -714,7 +714,7 @@ declare const addTeamMember: <O extends OrganizationOptions>(options: O) => bett
|
|
|
714
714
|
userId: string;
|
|
715
715
|
createdAt: Date;
|
|
716
716
|
}>;
|
|
717
|
-
declare const removeTeamMember: <O extends OrganizationOptions>(options: O) =>
|
|
717
|
+
declare const removeTeamMember: <O extends OrganizationOptions>(options: O) => better_call840.StrictEndpoint<"/organization/remove-team-member", {
|
|
718
718
|
method: "POST";
|
|
719
719
|
body: z.ZodObject<{
|
|
720
720
|
teamId: z.ZodString;
|
|
@@ -746,20 +746,20 @@ declare const removeTeamMember: <O extends OrganizationOptions>(options: O) => b
|
|
|
746
746
|
};
|
|
747
747
|
};
|
|
748
748
|
requireHeaders: true;
|
|
749
|
-
use: (((inputContext:
|
|
749
|
+
use: (((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
750
750
|
orgOptions: OrganizationOptions;
|
|
751
751
|
roles: typeof defaultRoles & {
|
|
752
752
|
[key: string]: Role<{}>;
|
|
753
753
|
};
|
|
754
|
-
getSession: (context:
|
|
755
|
-
session:
|
|
754
|
+
getSession: (context: _better_auth_core45.GenericEndpointContext) => Promise<{
|
|
755
|
+
session: _better_auth_core_db60.Session & {
|
|
756
756
|
activeTeamId?: string | undefined;
|
|
757
757
|
activeOrganizationId?: string | undefined;
|
|
758
758
|
};
|
|
759
|
-
user:
|
|
759
|
+
user: _better_auth_core_db60.User;
|
|
760
760
|
}>;
|
|
761
|
-
}>) | ((inputContext:
|
|
762
|
-
use: ((inputContext:
|
|
761
|
+
}>) | ((inputContext: better_call840.MiddlewareInputContext<{
|
|
762
|
+
use: ((inputContext: better_call840.MiddlewareInputContext<better_call840.MiddlewareOptions>) => Promise<{
|
|
763
763
|
session: {
|
|
764
764
|
session: Record<string, any> & {
|
|
765
765
|
id: string;
|
|
@@ -784,11 +784,11 @@ declare const removeTeamMember: <O extends OrganizationOptions>(options: O) => b
|
|
|
784
784
|
}>)[];
|
|
785
785
|
}>) => Promise<{
|
|
786
786
|
session: {
|
|
787
|
-
session:
|
|
787
|
+
session: _better_auth_core_db60.Session & {
|
|
788
788
|
activeTeamId?: string | undefined;
|
|
789
789
|
activeOrganizationId?: string | undefined;
|
|
790
790
|
};
|
|
791
|
-
user:
|
|
791
|
+
user: _better_auth_core_db60.User;
|
|
792
792
|
};
|
|
793
793
|
}>))[];
|
|
794
794
|
}, {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { PhoneNumberOptions, UserWithPhoneNumber } from "./types.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
2
|
+
import * as _better_auth_core10 from "@better-auth/core";
|
|
3
|
+
import * as better_call79 from "better-call";
|
|
4
|
+
import * as zod64 from "zod";
|
|
5
|
+
import * as zod_v4_core11 from "zod/v4/core";
|
|
6
6
|
|
|
7
7
|
//#region src/plugins/phone-number/index.d.ts
|
|
8
8
|
declare const phoneNumber: (options?: PhoneNumberOptions | undefined) => {
|
|
9
9
|
id: "phone-number";
|
|
10
10
|
hooks: {
|
|
11
11
|
before: {
|
|
12
|
-
matcher: (ctx:
|
|
13
|
-
handler: (inputContext:
|
|
12
|
+
matcher: (ctx: _better_auth_core10.HookEndpointContext) => boolean;
|
|
13
|
+
handler: (inputContext: better_call79.MiddlewareInputContext<better_call79.MiddlewareOptions>) => Promise<never>;
|
|
14
14
|
}[];
|
|
15
15
|
};
|
|
16
16
|
endpoints: {
|
|
17
|
-
signInPhoneNumber:
|
|
17
|
+
signInPhoneNumber: better_call79.StrictEndpoint<"/sign-in/phone-number", {
|
|
18
18
|
method: "POST";
|
|
19
|
-
body:
|
|
20
|
-
phoneNumber:
|
|
21
|
-
password:
|
|
22
|
-
rememberMe:
|
|
23
|
-
},
|
|
19
|
+
body: zod64.ZodObject<{
|
|
20
|
+
phoneNumber: zod64.ZodString;
|
|
21
|
+
password: zod64.ZodString;
|
|
22
|
+
rememberMe: zod64.ZodOptional<zod64.ZodBoolean>;
|
|
23
|
+
}, zod_v4_core11.$strip>;
|
|
24
24
|
metadata: {
|
|
25
25
|
openapi: {
|
|
26
26
|
summary: string;
|
|
@@ -54,11 +54,11 @@ declare const phoneNumber: (options?: PhoneNumberOptions | undefined) => {
|
|
|
54
54
|
token: string;
|
|
55
55
|
user: UserWithPhoneNumber;
|
|
56
56
|
}>;
|
|
57
|
-
sendPhoneNumberOTP:
|
|
57
|
+
sendPhoneNumberOTP: better_call79.StrictEndpoint<"/phone-number/send-otp", {
|
|
58
58
|
method: "POST";
|
|
59
|
-
body:
|
|
60
|
-
phoneNumber:
|
|
61
|
-
},
|
|
59
|
+
body: zod64.ZodObject<{
|
|
60
|
+
phoneNumber: zod64.ZodString;
|
|
61
|
+
}, zod_v4_core11.$strip>;
|
|
62
62
|
metadata: {
|
|
63
63
|
openapi: {
|
|
64
64
|
summary: string;
|
|
@@ -85,14 +85,14 @@ declare const phoneNumber: (options?: PhoneNumberOptions | undefined) => {
|
|
|
85
85
|
}, {
|
|
86
86
|
message: string;
|
|
87
87
|
}>;
|
|
88
|
-
verifyPhoneNumber:
|
|
88
|
+
verifyPhoneNumber: better_call79.StrictEndpoint<"/phone-number/verify", {
|
|
89
89
|
method: "POST";
|
|
90
|
-
body:
|
|
91
|
-
phoneNumber:
|
|
92
|
-
code:
|
|
93
|
-
disableSession:
|
|
94
|
-
updatePhoneNumber:
|
|
95
|
-
},
|
|
90
|
+
body: zod64.ZodIntersection<zod64.ZodObject<{
|
|
91
|
+
phoneNumber: zod64.ZodString;
|
|
92
|
+
code: zod64.ZodString;
|
|
93
|
+
disableSession: zod64.ZodOptional<zod64.ZodBoolean>;
|
|
94
|
+
updatePhoneNumber: zod64.ZodOptional<zod64.ZodBoolean>;
|
|
95
|
+
}, zod_v4_core11.$strip>, zod64.ZodRecord<zod64.ZodString, zod64.ZodAny>>;
|
|
96
96
|
metadata: {
|
|
97
97
|
openapi: {
|
|
98
98
|
summary: string;
|
|
@@ -196,11 +196,11 @@ declare const phoneNumber: (options?: PhoneNumberOptions | undefined) => {
|
|
|
196
196
|
token: null;
|
|
197
197
|
user: UserWithPhoneNumber;
|
|
198
198
|
}>;
|
|
199
|
-
requestPasswordResetPhoneNumber:
|
|
199
|
+
requestPasswordResetPhoneNumber: better_call79.StrictEndpoint<"/phone-number/request-password-reset", {
|
|
200
200
|
method: "POST";
|
|
201
|
-
body:
|
|
202
|
-
phoneNumber:
|
|
203
|
-
},
|
|
201
|
+
body: zod64.ZodObject<{
|
|
202
|
+
phoneNumber: zod64.ZodString;
|
|
203
|
+
}, zod_v4_core11.$strip>;
|
|
204
204
|
metadata: {
|
|
205
205
|
openapi: {
|
|
206
206
|
description: string;
|
|
@@ -229,13 +229,13 @@ declare const phoneNumber: (options?: PhoneNumberOptions | undefined) => {
|
|
|
229
229
|
}, {
|
|
230
230
|
status: boolean;
|
|
231
231
|
}>;
|
|
232
|
-
resetPasswordPhoneNumber:
|
|
232
|
+
resetPasswordPhoneNumber: better_call79.StrictEndpoint<"/phone-number/reset-password", {
|
|
233
233
|
method: "POST";
|
|
234
|
-
body:
|
|
235
|
-
otp:
|
|
236
|
-
phoneNumber:
|
|
237
|
-
newPassword:
|
|
238
|
-
},
|
|
234
|
+
body: zod64.ZodObject<{
|
|
235
|
+
otp: zod64.ZodString;
|
|
236
|
+
phoneNumber: zod64.ZodString;
|
|
237
|
+
newPassword: zod64.ZodString;
|
|
238
|
+
}, zod_v4_core11.$strip>;
|
|
239
239
|
metadata: {
|
|
240
240
|
openapi: {
|
|
241
241
|
description: string;
|
|
@@ -2,7 +2,7 @@ import { InferOptionSchema } from "../../types/plugins.mjs";
|
|
|
2
2
|
import "../../types/index.mjs";
|
|
3
3
|
import { schema } from "./schema.mjs";
|
|
4
4
|
import { ENSLookupArgs, ENSLookupResult, SIWEVerifyMessageArgs } from "./types.mjs";
|
|
5
|
-
import * as
|
|
5
|
+
import * as better_call116 from "better-call";
|
|
6
6
|
import * as z from "zod";
|
|
7
7
|
|
|
8
8
|
//#region src/plugins/siwe/index.d.ts
|
|
@@ -49,7 +49,7 @@ declare const siwe: (options: SIWEPluginOptions) => {
|
|
|
49
49
|
};
|
|
50
50
|
};
|
|
51
51
|
endpoints: {
|
|
52
|
-
getSiweNonce:
|
|
52
|
+
getSiweNonce: better_call116.StrictEndpoint<"/siwe/nonce", {
|
|
53
53
|
method: "POST";
|
|
54
54
|
body: z.ZodObject<{
|
|
55
55
|
walletAddress: z.ZodString;
|
|
@@ -58,7 +58,7 @@ declare const siwe: (options: SIWEPluginOptions) => {
|
|
|
58
58
|
}, {
|
|
59
59
|
nonce: string;
|
|
60
60
|
}>;
|
|
61
|
-
verifySiweMessage:
|
|
61
|
+
verifySiweMessage: better_call116.StrictEndpoint<"/siwe/verify", {
|
|
62
62
|
method: "POST";
|
|
63
63
|
body: z.ZodObject<{
|
|
64
64
|
message: z.ZodString;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UserWithTwoFactor } from "../types.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as better_call753 from "better-call";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/plugins/two-factor/backup-codes/index.d.ts
|
|
@@ -61,7 +61,7 @@ declare const backupCode2fa: (opts: BackupCodeOptions) => {
|
|
|
61
61
|
*
|
|
62
62
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/2fa#api-method-two-factor-verify-backup-code)
|
|
63
63
|
*/
|
|
64
|
-
verifyBackupCode:
|
|
64
|
+
verifyBackupCode: better_call753.StrictEndpoint<"/two-factor/verify-backup-code", {
|
|
65
65
|
method: "POST";
|
|
66
66
|
body: z.ZodObject<{
|
|
67
67
|
code: z.ZodString;
|
|
@@ -187,12 +187,12 @@ declare const backupCode2fa: (opts: BackupCodeOptions) => {
|
|
|
187
187
|
*
|
|
188
188
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/2fa#api-method-two-factor-generate-backup-codes)
|
|
189
189
|
*/
|
|
190
|
-
generateBackupCodes:
|
|
190
|
+
generateBackupCodes: better_call753.StrictEndpoint<"/two-factor/generate-backup-codes", {
|
|
191
191
|
method: "POST";
|
|
192
192
|
body: z.ZodObject<{
|
|
193
193
|
password: z.ZodString;
|
|
194
194
|
}, z.core.$strip>;
|
|
195
|
-
use: ((inputContext:
|
|
195
|
+
use: ((inputContext: better_call753.MiddlewareInputContext<better_call753.MiddlewareOptions>) => Promise<{
|
|
196
196
|
session: {
|
|
197
197
|
session: Record<string, any> & {
|
|
198
198
|
id: string;
|
|
@@ -263,7 +263,7 @@ declare const backupCode2fa: (opts: BackupCodeOptions) => {
|
|
|
263
263
|
*
|
|
264
264
|
* @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/2fa#api-method-two-factor-view-backup-codes)
|
|
265
265
|
*/
|
|
266
|
-
viewBackupCodes:
|
|
266
|
+
viewBackupCodes: better_call753.StrictEndpoint<string, {
|
|
267
267
|
method: "POST";
|
|
268
268
|
body: z.ZodObject<{
|
|
269
269
|
userId: z.ZodCoercedString<unknown>;
|