@protobase/server 0.3.5 → 0.5.0
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/admin-options.d.ts +35 -0
- package/dist/aggregate-service.js +1 -1
- package/dist/assistant/assistant-settings.d.ts +4 -7
- package/dist/assistant/built-in-assistant.js +21 -5
- package/dist/assistant/chat-completions.d.ts +7 -1
- package/dist/assistant/conversations.d.ts +1 -1
- package/dist/assistant/records.d.ts +23 -0
- package/dist/assistant/records.js +53 -0
- package/dist/assistant/tools.d.ts +3 -0
- package/dist/assistant/turn.d.ts +4 -2
- package/dist/assistant/turn.js +3 -1
- package/dist/assistant/widget.d.ts +15 -0
- package/dist/assistant/widget.js +32 -0
- package/dist/batch/reorder.js +3 -3
- package/dist/better-auth/admin-only.js +13 -0
- package/dist/better-auth/create-auth.d.ts +2357 -30
- package/dist/better-auth/create-auth.js +70 -24
- package/dist/better-auth/operator-provider.d.ts +29 -0
- package/dist/better-auth/operator-provider.js +130 -0
- package/dist/better-auth/parse-roles.d.ts +7 -0
- package/dist/better-auth/parse-roles.js +12 -0
- package/dist/better-auth/policy-plugin.js +142 -0
- package/dist/better-auth/policy-store.js +65 -0
- package/dist/better-auth/sign-in-enforcement.js +65 -0
- package/dist/better-auth/sign-in-mail.js +78 -0
- package/dist/better-auth/sign-in-policy.d.ts +49 -0
- package/dist/better-auth/sign-in-policy.js +83 -0
- package/dist/better-auth/staff-checks.js +65 -0
- package/dist/better-auth/staff-log.d.ts +14 -0
- package/dist/better-auth/staff-log.js +96 -0
- package/dist/better-auth/staff-plugin.js +61 -0
- package/dist/better-auth/staff-sign-in-endpoints.js +162 -0
- package/dist/better-auth/status-route.js +23 -8
- package/dist/better-auth/tokens.js +1 -1
- package/dist/better-auth/two-factor-challenge.js +23 -0
- package/dist/better-auth/users.d.ts +5 -7
- package/dist/better-auth/users.js +3 -10
- package/dist/create-admin.d.ts +2 -1
- package/dist/create-admin.js +15 -8
- package/dist/deps.d.ts +6 -0
- package/dist/index.d.ts +17 -9
- package/dist/index.js +7 -2
- package/dist/list-service.js +4 -4
- package/dist/project-config.d.ts +28 -0
- package/dist/project-config.js +111 -0
- package/dist/read-service.js +3 -3
- package/dist/registry.d.ts +2 -0
- package/dist/routes/record.js +2 -2
- package/dist/row-permissions.js +2 -2
- package/dist/scan-guard.d.ts +4 -0
- package/dist/types.d.ts +1 -32
- package/dist/write-pipeline.js +2 -2
- package/dist/write-shared.js +2 -2
- package/dist/write-update.js +2 -2
- package/package.json +6 -4
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { SignInPolicy } from "./sign-in-policy.js";
|
|
2
|
+
import { StaffSignIn } from "./staff-log.js";
|
|
1
3
|
import { Mailer } from "../mail/smtp-mailer.js";
|
|
4
|
+
import { OperatorProvider } from "./operator-provider.js";
|
|
2
5
|
import { BetterAuthOptions } from "better-auth";
|
|
3
6
|
//#region src/better-auth/create-auth.d.ts
|
|
4
7
|
export type CreateAuthOptions = {
|
|
5
8
|
/** A `pg` Pool, or `{ dialect, type: 'postgres', schemaName? }` for a Kysely dialect: the admin store, apart from the application's tables (its own schema or database). */
|
|
6
9
|
database: BetterAuthOptions['database'];
|
|
7
|
-
/** Public origin of the API, for example `https://admin.example.com`. Issuer and audience of the tokens. */
|
|
10
|
+
/** Public origin of the API, for example `https://admin.example.com`. Issuer and audience of the tokens; passkeys belong to its host. */
|
|
8
11
|
baseURL: string;
|
|
12
|
+
/** The name authenticator apps and passkey prompts show for this app. Default `Protobase`. */
|
|
13
|
+
appName?: string;
|
|
9
14
|
/** Signs cookies and encrypts the JWT private keys. Generate with `openssl rand -base64 32`. */
|
|
10
15
|
secret: string;
|
|
11
16
|
/** Extra origins that may call the auth endpoints. `baseURL` and `https://*.trycloudflare.com` are always trusted. */
|
|
@@ -20,9 +25,9 @@ export type CreateAuthOptions = {
|
|
|
20
25
|
/** Sign-in attempts allowed per minute and client, default 5. */
|
|
21
26
|
signInPerMinute?: number;
|
|
22
27
|
/**
|
|
23
|
-
* Sends the password-reset email
|
|
24
|
-
* the platform passes in `PROTOBASE_SMTP_URL` and `PROTOBASE_MAIL_FROM`
|
|
25
|
-
* turns
|
|
28
|
+
* Sends the password-reset email and the emailed sign-in and two-factor codes; without a mailer none of them is
|
|
29
|
+
* offered. Defaults to SMTP with the settings the platform passes in `PROTOBASE_SMTP_URL` and `PROTOBASE_MAIL_FROM`
|
|
30
|
+
* (see `readMailSettings`), when set; `false` turns mail off whatever the environment says.
|
|
26
31
|
*/
|
|
27
32
|
mailer?: Mailer | false;
|
|
28
33
|
/**
|
|
@@ -35,6 +40,13 @@ export type CreateAuthOptions = {
|
|
|
35
40
|
encryptOAuthTokens?: boolean;
|
|
36
41
|
/** Runs after a user is created, by any route: `createUser`, an admin, or a social sign-up. Default none. */
|
|
37
42
|
onUserCreated?: UserCreatedHook;
|
|
43
|
+
/**
|
|
44
|
+
* The identity provider the operator's staff sign in with to sign in as people of this app, for support. Defaults
|
|
45
|
+
* to the one the platform passes in `PROTOBASE_OPERATOR_ISSUER`, `PROTOBASE_OPERATOR_CLIENT_ID` and
|
|
46
|
+
* `PROTOBASE_OPERATOR_CLIENT_SECRET` (see `readOperatorSettings`), when set; `false` turns staff sign-in off
|
|
47
|
+
* whatever the environment says.
|
|
48
|
+
*/
|
|
49
|
+
operator?: OperatorProvider | false;
|
|
38
50
|
};
|
|
39
51
|
type UserCreateHooks = NonNullable<NonNullable<NonNullable<BetterAuthOptions['databaseHooks']>['user']>['create']>;
|
|
40
52
|
/** Better Auth's `databaseHooks.user.create.after`: the created user (with its `role`) and the request context, `null` outside a request. */
|
|
@@ -961,6 +973,7 @@ export declare const createAuth: (options: CreateAuthOptions) => import("better-
|
|
|
961
973
|
role: any;
|
|
962
974
|
};
|
|
963
975
|
};
|
|
976
|
+
disableSettingJwtHeader: true;
|
|
964
977
|
}>;
|
|
965
978
|
init(ctx: import("better-auth").AuthContext): {
|
|
966
979
|
context: {
|
|
@@ -1184,12 +1197,261 @@ export declare const createAuth: (options: CreateAuthOptions) => import("better-
|
|
|
1184
1197
|
};
|
|
1185
1198
|
};
|
|
1186
1199
|
};
|
|
1187
|
-
}
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1200
|
+
}, {
|
|
1201
|
+
hooks: {
|
|
1202
|
+
after: {
|
|
1203
|
+
matcher: (context: Parameters<(context: import("better-auth").HookEndpointContext) => boolean>[0]) => boolean;
|
|
1204
|
+
handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
1205
|
+
twoFactorRedirect: boolean;
|
|
1206
|
+
twoFactorMethods: string[];
|
|
1207
|
+
} | undefined>>;
|
|
1208
|
+
}[];
|
|
1209
|
+
};
|
|
1210
|
+
id: "two-factor";
|
|
1211
|
+
version: string;
|
|
1212
|
+
endpoints: {
|
|
1213
|
+
enableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/enable", {
|
|
1214
|
+
method: "POST";
|
|
1215
|
+
body: import("zod").ZodObject<{
|
|
1216
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1217
|
+
method: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
1218
|
+
otp: "otp";
|
|
1219
|
+
totp: "totp";
|
|
1220
|
+
}>>;
|
|
1221
|
+
issuer: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1222
|
+
}, import("zod/v4/core").$strip> | import("zod").ZodObject<{
|
|
1223
|
+
password: import("zod").ZodString;
|
|
1224
|
+
method: import("zod").ZodDefault<import("zod").ZodEnum<{
|
|
1225
|
+
otp: "otp";
|
|
1226
|
+
totp: "totp";
|
|
1227
|
+
}>>;
|
|
1228
|
+
issuer: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1229
|
+
}, import("zod/v4/core").$strip>;
|
|
1230
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
1231
|
+
session: {
|
|
1232
|
+
session: Record<string, any> & {
|
|
1233
|
+
id: string;
|
|
1234
|
+
createdAt: Date;
|
|
1235
|
+
updatedAt: Date;
|
|
1236
|
+
userId: string;
|
|
1237
|
+
expiresAt: Date;
|
|
1238
|
+
token: string;
|
|
1239
|
+
ipAddress?: string | null | undefined;
|
|
1240
|
+
userAgent?: string | null | undefined;
|
|
1241
|
+
};
|
|
1242
|
+
user: Record<string, any> & {
|
|
1243
|
+
id: string;
|
|
1244
|
+
createdAt: Date;
|
|
1245
|
+
updatedAt: Date;
|
|
1246
|
+
email: string;
|
|
1247
|
+
emailVerified: boolean;
|
|
1248
|
+
name: string;
|
|
1249
|
+
image?: string | null | undefined;
|
|
1250
|
+
};
|
|
1251
|
+
};
|
|
1252
|
+
}>>[];
|
|
1253
|
+
metadata: {
|
|
1254
|
+
openapi: {
|
|
1255
|
+
summary: string;
|
|
1256
|
+
description: string;
|
|
1257
|
+
responses: {
|
|
1258
|
+
200: {
|
|
1259
|
+
description: string;
|
|
1260
|
+
content: {
|
|
1261
|
+
"application/json": {
|
|
1262
|
+
schema: {
|
|
1263
|
+
type: "object";
|
|
1264
|
+
properties: {
|
|
1265
|
+
method: {
|
|
1266
|
+
type: string;
|
|
1267
|
+
enum: string[];
|
|
1268
|
+
description: string;
|
|
1269
|
+
};
|
|
1270
|
+
totpURI: {
|
|
1271
|
+
type: string;
|
|
1272
|
+
description: string;
|
|
1273
|
+
};
|
|
1274
|
+
backupCodes: {
|
|
1275
|
+
type: string;
|
|
1276
|
+
items: {
|
|
1277
|
+
type: string;
|
|
1278
|
+
};
|
|
1279
|
+
description: string;
|
|
1280
|
+
};
|
|
1281
|
+
};
|
|
1282
|
+
required: string[];
|
|
1283
|
+
};
|
|
1284
|
+
};
|
|
1285
|
+
};
|
|
1286
|
+
};
|
|
1287
|
+
};
|
|
1288
|
+
};
|
|
1289
|
+
};
|
|
1290
|
+
}, {
|
|
1291
|
+
method: "otp";
|
|
1292
|
+
} | {
|
|
1293
|
+
method: "totp";
|
|
1294
|
+
totpURI: string;
|
|
1295
|
+
backupCodes: string[];
|
|
1296
|
+
}>;
|
|
1297
|
+
disableTwoFactor: import("better-auth").StrictEndpoint<"/two-factor/disable", {
|
|
1298
|
+
method: "POST";
|
|
1299
|
+
body: import("zod").ZodObject<{
|
|
1300
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1301
|
+
}, import("zod/v4/core").$strip> | import("zod").ZodObject<{
|
|
1302
|
+
password: import("zod").ZodString;
|
|
1303
|
+
}, import("zod/v4/core").$strip>;
|
|
1304
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
1305
|
+
session: {
|
|
1306
|
+
session: Record<string, any> & {
|
|
1307
|
+
id: string;
|
|
1308
|
+
createdAt: Date;
|
|
1309
|
+
updatedAt: Date;
|
|
1310
|
+
userId: string;
|
|
1311
|
+
expiresAt: Date;
|
|
1312
|
+
token: string;
|
|
1313
|
+
ipAddress?: string | null | undefined;
|
|
1314
|
+
userAgent?: string | null | undefined;
|
|
1315
|
+
};
|
|
1316
|
+
user: Record<string, any> & {
|
|
1317
|
+
id: string;
|
|
1318
|
+
createdAt: Date;
|
|
1319
|
+
updatedAt: Date;
|
|
1320
|
+
email: string;
|
|
1321
|
+
emailVerified: boolean;
|
|
1322
|
+
name: string;
|
|
1323
|
+
image?: string | null | undefined;
|
|
1324
|
+
};
|
|
1325
|
+
};
|
|
1326
|
+
}>>[];
|
|
1327
|
+
metadata: {
|
|
1328
|
+
openapi: {
|
|
1329
|
+
summary: string;
|
|
1330
|
+
description: string;
|
|
1331
|
+
responses: {
|
|
1332
|
+
200: {
|
|
1333
|
+
description: string;
|
|
1334
|
+
content: {
|
|
1335
|
+
"application/json": {
|
|
1336
|
+
schema: {
|
|
1337
|
+
type: "object";
|
|
1338
|
+
properties: {
|
|
1339
|
+
status: {
|
|
1340
|
+
type: string;
|
|
1341
|
+
};
|
|
1342
|
+
};
|
|
1343
|
+
};
|
|
1344
|
+
};
|
|
1345
|
+
};
|
|
1346
|
+
};
|
|
1347
|
+
};
|
|
1348
|
+
};
|
|
1349
|
+
};
|
|
1350
|
+
}, {
|
|
1351
|
+
status: boolean;
|
|
1352
|
+
}>;
|
|
1353
|
+
verifyBackupCode: import("better-auth").StrictEndpoint<"/two-factor/verify-backup-code", {
|
|
1354
|
+
method: "POST";
|
|
1355
|
+
body: import("zod").ZodObject<{
|
|
1356
|
+
code: import("zod").ZodString;
|
|
1357
|
+
disableSession: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1358
|
+
trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1359
|
+
}, import("zod/v4/core").$strip>;
|
|
1360
|
+
metadata: {
|
|
1361
|
+
openapi: {
|
|
1362
|
+
description: string;
|
|
1363
|
+
responses: {
|
|
1364
|
+
"200": {
|
|
1365
|
+
description: string;
|
|
1366
|
+
content: {
|
|
1367
|
+
"application/json": {
|
|
1368
|
+
schema: {
|
|
1369
|
+
type: "object";
|
|
1370
|
+
properties: {
|
|
1371
|
+
user: {
|
|
1372
|
+
type: string;
|
|
1373
|
+
properties: {
|
|
1374
|
+
id: {
|
|
1375
|
+
type: string;
|
|
1376
|
+
description: string;
|
|
1377
|
+
};
|
|
1378
|
+
email: {
|
|
1379
|
+
type: string;
|
|
1380
|
+
format: string;
|
|
1381
|
+
nullable: boolean;
|
|
1382
|
+
description: string;
|
|
1383
|
+
};
|
|
1384
|
+
emailVerified: {
|
|
1385
|
+
type: string;
|
|
1386
|
+
nullable: boolean;
|
|
1387
|
+
description: string;
|
|
1388
|
+
};
|
|
1389
|
+
name: {
|
|
1390
|
+
type: string;
|
|
1391
|
+
nullable: boolean;
|
|
1392
|
+
description: string;
|
|
1393
|
+
};
|
|
1394
|
+
image: {
|
|
1395
|
+
type: string;
|
|
1396
|
+
format: string;
|
|
1397
|
+
nullable: boolean;
|
|
1398
|
+
description: string;
|
|
1399
|
+
};
|
|
1400
|
+
twoFactorEnabled: {
|
|
1401
|
+
type: string;
|
|
1402
|
+
description: string;
|
|
1403
|
+
};
|
|
1404
|
+
createdAt: {
|
|
1405
|
+
type: string;
|
|
1406
|
+
format: string;
|
|
1407
|
+
description: string;
|
|
1408
|
+
};
|
|
1409
|
+
updatedAt: {
|
|
1410
|
+
type: string;
|
|
1411
|
+
format: string;
|
|
1412
|
+
description: string;
|
|
1413
|
+
};
|
|
1414
|
+
};
|
|
1415
|
+
required: string[];
|
|
1416
|
+
description: string;
|
|
1417
|
+
};
|
|
1418
|
+
session: {
|
|
1419
|
+
type: string;
|
|
1420
|
+
properties: {
|
|
1421
|
+
token: {
|
|
1422
|
+
type: string;
|
|
1423
|
+
description: string;
|
|
1424
|
+
};
|
|
1425
|
+
userId: {
|
|
1426
|
+
type: string;
|
|
1427
|
+
description: string;
|
|
1428
|
+
};
|
|
1429
|
+
createdAt: {
|
|
1430
|
+
type: string;
|
|
1431
|
+
format: string;
|
|
1432
|
+
description: string;
|
|
1433
|
+
};
|
|
1434
|
+
expiresAt: {
|
|
1435
|
+
type: string;
|
|
1436
|
+
format: string;
|
|
1437
|
+
description: string;
|
|
1438
|
+
};
|
|
1439
|
+
};
|
|
1440
|
+
required: string[];
|
|
1441
|
+
description: string;
|
|
1442
|
+
};
|
|
1443
|
+
};
|
|
1444
|
+
required: string[];
|
|
1445
|
+
};
|
|
1446
|
+
};
|
|
1447
|
+
};
|
|
1448
|
+
};
|
|
1449
|
+
};
|
|
1450
|
+
};
|
|
1451
|
+
};
|
|
1452
|
+
}, {
|
|
1453
|
+
token: string | undefined;
|
|
1454
|
+
user: (Record<string, any> & {
|
|
1193
1455
|
id: string;
|
|
1194
1456
|
createdAt: Date;
|
|
1195
1457
|
updatedAt: Date;
|
|
@@ -1197,26 +1459,2088 @@ export declare const createAuth: (options: CreateAuthOptions) => import("better-
|
|
|
1197
1459
|
emailVerified: boolean;
|
|
1198
1460
|
name: string;
|
|
1199
1461
|
image?: string | null | undefined;
|
|
1200
|
-
}
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1462
|
+
}) | import("better-auth/plugins").UserWithTwoFactor;
|
|
1463
|
+
}>;
|
|
1464
|
+
generateBackupCodes: import("better-auth").StrictEndpoint<"/two-factor/generate-backup-codes", {
|
|
1465
|
+
method: "POST";
|
|
1466
|
+
body: import("zod").ZodObject<{
|
|
1467
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1468
|
+
}, import("zod/v4/core").$strip> | import("zod").ZodObject<{
|
|
1469
|
+
password: import("zod").ZodString;
|
|
1470
|
+
}, import("zod/v4/core").$strip>;
|
|
1471
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
1472
|
+
session: {
|
|
1473
|
+
session: Record<string, any> & {
|
|
1474
|
+
id: string;
|
|
1475
|
+
createdAt: Date;
|
|
1476
|
+
updatedAt: Date;
|
|
1477
|
+
userId: string;
|
|
1478
|
+
expiresAt: Date;
|
|
1479
|
+
token: string;
|
|
1480
|
+
ipAddress?: string | null | undefined;
|
|
1481
|
+
userAgent?: string | null | undefined;
|
|
1482
|
+
};
|
|
1483
|
+
user: Record<string, any> & {
|
|
1484
|
+
id: string;
|
|
1485
|
+
createdAt: Date;
|
|
1486
|
+
updatedAt: Date;
|
|
1487
|
+
email: string;
|
|
1488
|
+
emailVerified: boolean;
|
|
1489
|
+
name: string;
|
|
1490
|
+
image?: string | null | undefined;
|
|
1491
|
+
};
|
|
1492
|
+
};
|
|
1493
|
+
}>>[];
|
|
1494
|
+
metadata: {
|
|
1495
|
+
openapi: {
|
|
1496
|
+
description: string;
|
|
1497
|
+
responses: {
|
|
1498
|
+
"200": {
|
|
1499
|
+
description: string;
|
|
1500
|
+
content: {
|
|
1501
|
+
"application/json": {
|
|
1502
|
+
schema: {
|
|
1503
|
+
type: "object";
|
|
1504
|
+
properties: {
|
|
1505
|
+
status: {
|
|
1506
|
+
type: string;
|
|
1507
|
+
description: string;
|
|
1508
|
+
enum: boolean[];
|
|
1509
|
+
};
|
|
1510
|
+
backupCodes: {
|
|
1511
|
+
type: string;
|
|
1512
|
+
items: {
|
|
1513
|
+
type: string;
|
|
1514
|
+
};
|
|
1515
|
+
description: string;
|
|
1516
|
+
};
|
|
1517
|
+
};
|
|
1518
|
+
required: string[];
|
|
1519
|
+
};
|
|
1520
|
+
};
|
|
1521
|
+
};
|
|
1522
|
+
};
|
|
1523
|
+
};
|
|
1524
|
+
};
|
|
1525
|
+
};
|
|
1526
|
+
}, {
|
|
1527
|
+
status: boolean;
|
|
1528
|
+
backupCodes: string[];
|
|
1529
|
+
}>;
|
|
1530
|
+
viewBackupCodes: import("better-auth").StrictEndpoint<string, {
|
|
1531
|
+
method: "POST";
|
|
1532
|
+
body: import("zod").ZodObject<{
|
|
1533
|
+
userId: import("zod").ZodCoercedString<unknown>;
|
|
1534
|
+
}, import("zod/v4/core").$strip>;
|
|
1535
|
+
}, {
|
|
1536
|
+
status: boolean;
|
|
1537
|
+
backupCodes: string[];
|
|
1538
|
+
}>;
|
|
1539
|
+
sendTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/send-otp", {
|
|
1540
|
+
method: "POST";
|
|
1541
|
+
body: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
1542
|
+
trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1543
|
+
}, import("zod/v4/core").$strip>>;
|
|
1544
|
+
metadata: {
|
|
1545
|
+
openapi: {
|
|
1546
|
+
summary: string;
|
|
1547
|
+
description: string;
|
|
1548
|
+
responses: {
|
|
1549
|
+
200: {
|
|
1550
|
+
description: string;
|
|
1551
|
+
content: {
|
|
1552
|
+
"application/json": {
|
|
1553
|
+
schema: {
|
|
1554
|
+
type: "object";
|
|
1555
|
+
properties: {
|
|
1556
|
+
status: {
|
|
1557
|
+
type: string;
|
|
1558
|
+
};
|
|
1559
|
+
};
|
|
1560
|
+
};
|
|
1561
|
+
};
|
|
1562
|
+
};
|
|
1563
|
+
};
|
|
1564
|
+
};
|
|
1565
|
+
};
|
|
1566
|
+
};
|
|
1567
|
+
}, {
|
|
1568
|
+
status: boolean;
|
|
1569
|
+
}>;
|
|
1570
|
+
verifyTwoFactorOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-otp", {
|
|
1571
|
+
method: "POST";
|
|
1572
|
+
body: import("zod").ZodObject<{
|
|
1573
|
+
code: import("zod").ZodString;
|
|
1574
|
+
trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1575
|
+
}, import("zod/v4/core").$strip>;
|
|
1576
|
+
metadata: {
|
|
1577
|
+
openapi: {
|
|
1578
|
+
summary: string;
|
|
1579
|
+
description: string;
|
|
1580
|
+
responses: {
|
|
1581
|
+
"200": {
|
|
1582
|
+
description: string;
|
|
1583
|
+
content: {
|
|
1584
|
+
"application/json": {
|
|
1585
|
+
schema: {
|
|
1586
|
+
type: "object";
|
|
1587
|
+
properties: {
|
|
1588
|
+
token: {
|
|
1589
|
+
type: string;
|
|
1590
|
+
description: string;
|
|
1591
|
+
};
|
|
1592
|
+
user: {
|
|
1593
|
+
type: string;
|
|
1594
|
+
properties: {
|
|
1595
|
+
id: {
|
|
1596
|
+
type: string;
|
|
1597
|
+
description: string;
|
|
1598
|
+
};
|
|
1599
|
+
email: {
|
|
1600
|
+
type: string;
|
|
1601
|
+
format: string;
|
|
1602
|
+
nullable: boolean;
|
|
1603
|
+
description: string;
|
|
1604
|
+
};
|
|
1605
|
+
emailVerified: {
|
|
1606
|
+
type: string;
|
|
1607
|
+
nullable: boolean;
|
|
1608
|
+
description: string;
|
|
1609
|
+
};
|
|
1610
|
+
name: {
|
|
1611
|
+
type: string;
|
|
1612
|
+
nullable: boolean;
|
|
1613
|
+
description: string;
|
|
1614
|
+
};
|
|
1615
|
+
image: {
|
|
1616
|
+
type: string;
|
|
1617
|
+
format: string;
|
|
1618
|
+
nullable: boolean;
|
|
1619
|
+
description: string;
|
|
1620
|
+
};
|
|
1621
|
+
createdAt: {
|
|
1622
|
+
type: string;
|
|
1623
|
+
format: string;
|
|
1624
|
+
description: string;
|
|
1625
|
+
};
|
|
1626
|
+
updatedAt: {
|
|
1627
|
+
type: string;
|
|
1628
|
+
format: string;
|
|
1629
|
+
description: string;
|
|
1630
|
+
};
|
|
1631
|
+
};
|
|
1632
|
+
required: string[];
|
|
1633
|
+
description: string;
|
|
1634
|
+
};
|
|
1635
|
+
};
|
|
1636
|
+
required: string[];
|
|
1637
|
+
};
|
|
1638
|
+
};
|
|
1639
|
+
};
|
|
1640
|
+
};
|
|
1641
|
+
};
|
|
1642
|
+
};
|
|
1643
|
+
};
|
|
1644
|
+
}, {
|
|
1645
|
+
token: string;
|
|
1646
|
+
user: import("better-auth/plugins").UserWithTwoFactor;
|
|
1647
|
+
} | {
|
|
1648
|
+
token: string;
|
|
1649
|
+
user: Record<string, any> & {
|
|
1650
|
+
id: string;
|
|
1651
|
+
createdAt: Date;
|
|
1652
|
+
updatedAt: Date;
|
|
1653
|
+
email: string;
|
|
1654
|
+
emailVerified: boolean;
|
|
1655
|
+
name: string;
|
|
1656
|
+
image?: string | null | undefined;
|
|
1657
|
+
};
|
|
1658
|
+
}>;
|
|
1659
|
+
generateTOTP: import("better-auth").StrictEndpoint<string, {
|
|
1660
|
+
method: "POST";
|
|
1661
|
+
body: import("zod").ZodObject<{
|
|
1662
|
+
secret: import("zod").ZodString;
|
|
1663
|
+
}, import("zod/v4/core").$strip>;
|
|
1664
|
+
metadata: {
|
|
1665
|
+
openapi: {
|
|
1666
|
+
summary: string;
|
|
1667
|
+
description: string;
|
|
1668
|
+
responses: {
|
|
1669
|
+
200: {
|
|
1670
|
+
description: string;
|
|
1671
|
+
content: {
|
|
1672
|
+
"application/json": {
|
|
1673
|
+
schema: {
|
|
1674
|
+
type: "object";
|
|
1675
|
+
properties: {
|
|
1676
|
+
code: {
|
|
1677
|
+
type: string;
|
|
1678
|
+
};
|
|
1679
|
+
};
|
|
1680
|
+
};
|
|
1681
|
+
};
|
|
1682
|
+
};
|
|
1683
|
+
};
|
|
1684
|
+
};
|
|
1685
|
+
};
|
|
1686
|
+
};
|
|
1687
|
+
}, {
|
|
1688
|
+
code: string;
|
|
1689
|
+
}>;
|
|
1690
|
+
getTOTPURI: import("better-auth").StrictEndpoint<"/two-factor/get-totp-uri", {
|
|
1691
|
+
method: "POST";
|
|
1692
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
1693
|
+
session: {
|
|
1694
|
+
session: Record<string, any> & {
|
|
1695
|
+
id: string;
|
|
1696
|
+
createdAt: Date;
|
|
1697
|
+
updatedAt: Date;
|
|
1698
|
+
userId: string;
|
|
1699
|
+
expiresAt: Date;
|
|
1700
|
+
token: string;
|
|
1701
|
+
ipAddress?: string | null | undefined;
|
|
1702
|
+
userAgent?: string | null | undefined;
|
|
1703
|
+
};
|
|
1704
|
+
user: Record<string, any> & {
|
|
1705
|
+
id: string;
|
|
1706
|
+
createdAt: Date;
|
|
1707
|
+
updatedAt: Date;
|
|
1708
|
+
email: string;
|
|
1709
|
+
emailVerified: boolean;
|
|
1710
|
+
name: string;
|
|
1711
|
+
image?: string | null | undefined;
|
|
1712
|
+
};
|
|
1713
|
+
};
|
|
1714
|
+
}>>[];
|
|
1715
|
+
body: import("zod").ZodObject<{
|
|
1716
|
+
password: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1717
|
+
}, import("zod/v4/core").$strip> | import("zod").ZodObject<{
|
|
1718
|
+
password: import("zod").ZodString;
|
|
1719
|
+
}, import("zod/v4/core").$strip>;
|
|
1720
|
+
metadata: {
|
|
1721
|
+
openapi: {
|
|
1722
|
+
summary: string;
|
|
1723
|
+
description: string;
|
|
1724
|
+
responses: {
|
|
1725
|
+
200: {
|
|
1726
|
+
description: string;
|
|
1727
|
+
content: {
|
|
1728
|
+
"application/json": {
|
|
1729
|
+
schema: {
|
|
1730
|
+
type: "object";
|
|
1731
|
+
properties: {
|
|
1732
|
+
totpURI: {
|
|
1733
|
+
type: string;
|
|
1734
|
+
};
|
|
1735
|
+
};
|
|
1736
|
+
};
|
|
1737
|
+
};
|
|
1738
|
+
};
|
|
1739
|
+
};
|
|
1740
|
+
};
|
|
1741
|
+
};
|
|
1742
|
+
};
|
|
1743
|
+
}, {
|
|
1744
|
+
totpURI: string;
|
|
1745
|
+
}>;
|
|
1746
|
+
verifyTOTP: import("better-auth").StrictEndpoint<"/two-factor/verify-totp", {
|
|
1747
|
+
method: "POST";
|
|
1748
|
+
body: import("zod").ZodObject<{
|
|
1749
|
+
code: import("zod").ZodString;
|
|
1750
|
+
trustDevice: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
1751
|
+
}, import("zod/v4/core").$strip>;
|
|
1752
|
+
metadata: {
|
|
1753
|
+
openapi: {
|
|
1754
|
+
summary: string;
|
|
1755
|
+
description: string;
|
|
1756
|
+
responses: {
|
|
1757
|
+
200: {
|
|
1758
|
+
description: string;
|
|
1759
|
+
content: {
|
|
1760
|
+
"application/json": {
|
|
1761
|
+
schema: {
|
|
1762
|
+
type: "object";
|
|
1763
|
+
properties: {
|
|
1764
|
+
status: {
|
|
1765
|
+
type: string;
|
|
1766
|
+
};
|
|
1767
|
+
};
|
|
1768
|
+
};
|
|
1769
|
+
};
|
|
1770
|
+
};
|
|
1771
|
+
};
|
|
1772
|
+
};
|
|
1773
|
+
};
|
|
1774
|
+
};
|
|
1775
|
+
}, {
|
|
1776
|
+
token: string;
|
|
1777
|
+
user: import("better-auth/plugins").UserWithTwoFactor;
|
|
1778
|
+
} | {
|
|
1779
|
+
token: string;
|
|
1780
|
+
user: Record<string, any> & {
|
|
1781
|
+
id: string;
|
|
1782
|
+
createdAt: Date;
|
|
1783
|
+
updatedAt: Date;
|
|
1784
|
+
email: string;
|
|
1785
|
+
emailVerified: boolean;
|
|
1786
|
+
name: string;
|
|
1787
|
+
image?: string | null | undefined;
|
|
1788
|
+
};
|
|
1789
|
+
}>;
|
|
1790
|
+
};
|
|
1791
|
+
options: NoInfer<import("better-auth/plugins").TwoFactorOptions>;
|
|
1792
|
+
schema: {
|
|
1793
|
+
user: {
|
|
1794
|
+
fields: {
|
|
1795
|
+
twoFactorEnabled: {
|
|
1796
|
+
type: "boolean";
|
|
1797
|
+
required: false;
|
|
1798
|
+
defaultValue: false;
|
|
1799
|
+
input: false;
|
|
1800
|
+
};
|
|
1801
|
+
};
|
|
1802
|
+
};
|
|
1803
|
+
twoFactor: {
|
|
1804
|
+
fields: {
|
|
1805
|
+
secret: {
|
|
1806
|
+
type: "string";
|
|
1807
|
+
required: true;
|
|
1808
|
+
returned: false;
|
|
1809
|
+
index: true;
|
|
1810
|
+
};
|
|
1811
|
+
backupCodes: {
|
|
1812
|
+
type: "string";
|
|
1813
|
+
required: true;
|
|
1814
|
+
returned: false;
|
|
1815
|
+
};
|
|
1816
|
+
userId: {
|
|
1817
|
+
type: "string";
|
|
1818
|
+
required: true;
|
|
1819
|
+
returned: false;
|
|
1820
|
+
references: {
|
|
1821
|
+
model: string;
|
|
1822
|
+
field: string;
|
|
1823
|
+
};
|
|
1824
|
+
index: true;
|
|
1825
|
+
};
|
|
1826
|
+
verified: {
|
|
1827
|
+
type: "boolean";
|
|
1828
|
+
required: false;
|
|
1829
|
+
defaultValue: true;
|
|
1830
|
+
input: false;
|
|
1831
|
+
};
|
|
1832
|
+
failedVerificationCount: {
|
|
1833
|
+
type: "number";
|
|
1834
|
+
required: false;
|
|
1835
|
+
defaultValue: number;
|
|
1836
|
+
input: false;
|
|
1837
|
+
returned: false;
|
|
1838
|
+
};
|
|
1839
|
+
lockedUntil: {
|
|
1840
|
+
type: "date";
|
|
1841
|
+
required: false;
|
|
1842
|
+
input: false;
|
|
1843
|
+
returned: false;
|
|
1844
|
+
};
|
|
1845
|
+
};
|
|
1846
|
+
};
|
|
1847
|
+
};
|
|
1848
|
+
rateLimit: {
|
|
1849
|
+
pathMatcher(path: string): boolean;
|
|
1850
|
+
window: number;
|
|
1851
|
+
max: number;
|
|
1852
|
+
}[];
|
|
1853
|
+
$ERROR_CODES: {
|
|
1854
|
+
OTP_NOT_ENABLED: import("better-auth").RawError<"OTP_NOT_ENABLED">;
|
|
1855
|
+
OTP_NOT_CONFIGURED: import("better-auth").RawError<"OTP_NOT_CONFIGURED">;
|
|
1856
|
+
OTP_HAS_EXPIRED: import("better-auth").RawError<"OTP_HAS_EXPIRED">;
|
|
1857
|
+
TOTP_NOT_ENABLED: import("better-auth").RawError<"TOTP_NOT_ENABLED">;
|
|
1858
|
+
TOTP_ALREADY_ENABLED: import("better-auth").RawError<"TOTP_ALREADY_ENABLED">;
|
|
1859
|
+
TOTP_NOT_CONFIGURED: import("better-auth").RawError<"TOTP_NOT_CONFIGURED">;
|
|
1860
|
+
TWO_FACTOR_NOT_ENABLED: import("better-auth").RawError<"TWO_FACTOR_NOT_ENABLED">;
|
|
1861
|
+
BACKUP_CODES_NOT_ENABLED: import("better-auth").RawError<"BACKUP_CODES_NOT_ENABLED">;
|
|
1862
|
+
INVALID_BACKUP_CODE: import("better-auth").RawError<"INVALID_BACKUP_CODE">;
|
|
1863
|
+
INVALID_CODE: import("better-auth").RawError<"INVALID_CODE">;
|
|
1864
|
+
TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: import("better-auth").RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
|
|
1865
|
+
ACCOUNT_TEMPORARILY_LOCKED: import("better-auth").RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
|
|
1866
|
+
INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
|
|
1867
|
+
};
|
|
1868
|
+
}, {
|
|
1869
|
+
id: "passkey";
|
|
1870
|
+
version: string;
|
|
1871
|
+
endpoints: {
|
|
1872
|
+
generatePasskeyRegistrationOptions: import("better-auth").StrictEndpoint<"/passkey/generate-register-options", {
|
|
1873
|
+
method: "GET";
|
|
1874
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
1875
|
+
session: {
|
|
1876
|
+
session: Record<string, any> & {
|
|
1877
|
+
id: string;
|
|
1878
|
+
createdAt: Date;
|
|
1879
|
+
updatedAt: Date;
|
|
1880
|
+
userId: string;
|
|
1881
|
+
expiresAt: Date;
|
|
1882
|
+
token: string;
|
|
1883
|
+
ipAddress?: string | null | undefined;
|
|
1884
|
+
userAgent?: string | null | undefined;
|
|
1885
|
+
};
|
|
1886
|
+
user: Record<string, any> & {
|
|
1887
|
+
id: string;
|
|
1888
|
+
createdAt: Date;
|
|
1889
|
+
updatedAt: Date;
|
|
1890
|
+
email: string;
|
|
1891
|
+
emailVerified: boolean;
|
|
1892
|
+
name: string;
|
|
1893
|
+
image?: string | null | undefined;
|
|
1894
|
+
};
|
|
1895
|
+
};
|
|
1896
|
+
}>>[];
|
|
1897
|
+
query: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
1898
|
+
authenticatorAttachment: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
1899
|
+
platform: "platform";
|
|
1900
|
+
"cross-platform": "cross-platform";
|
|
1901
|
+
}>>;
|
|
1902
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1903
|
+
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1904
|
+
}, import("zod/v4/core").$strip>>;
|
|
1905
|
+
metadata: {
|
|
1906
|
+
openapi: {
|
|
1907
|
+
operationId: string;
|
|
1908
|
+
description: string;
|
|
1909
|
+
parameters: import("better-auth").OpenAPIParameter[];
|
|
1910
|
+
responses: {
|
|
1911
|
+
200: {
|
|
1912
|
+
description: string;
|
|
1913
|
+
content: {
|
|
1914
|
+
"application/json": {
|
|
1915
|
+
schema: {
|
|
1916
|
+
type: "object";
|
|
1917
|
+
properties: {
|
|
1918
|
+
challenge: {
|
|
1919
|
+
type: string;
|
|
1920
|
+
};
|
|
1921
|
+
rp: {
|
|
1922
|
+
type: string;
|
|
1923
|
+
properties: {
|
|
1924
|
+
name: {
|
|
1925
|
+
type: string;
|
|
1926
|
+
};
|
|
1927
|
+
id: {
|
|
1928
|
+
type: string;
|
|
1929
|
+
};
|
|
1930
|
+
};
|
|
1931
|
+
};
|
|
1932
|
+
user: {
|
|
1933
|
+
type: string;
|
|
1934
|
+
properties: {
|
|
1935
|
+
id: {
|
|
1936
|
+
type: string;
|
|
1937
|
+
};
|
|
1938
|
+
name: {
|
|
1939
|
+
type: string;
|
|
1940
|
+
};
|
|
1941
|
+
displayName: {
|
|
1942
|
+
type: string;
|
|
1943
|
+
};
|
|
1944
|
+
};
|
|
1945
|
+
};
|
|
1946
|
+
pubKeyCredParams: {
|
|
1947
|
+
type: string;
|
|
1948
|
+
items: {
|
|
1949
|
+
type: string;
|
|
1950
|
+
properties: {
|
|
1951
|
+
type: {
|
|
1952
|
+
type: string;
|
|
1953
|
+
};
|
|
1954
|
+
alg: {
|
|
1955
|
+
type: string;
|
|
1956
|
+
};
|
|
1957
|
+
};
|
|
1958
|
+
};
|
|
1959
|
+
};
|
|
1960
|
+
timeout: {
|
|
1961
|
+
type: string;
|
|
1962
|
+
};
|
|
1963
|
+
excludeCredentials: {
|
|
1964
|
+
type: string;
|
|
1965
|
+
items: {
|
|
1966
|
+
type: string;
|
|
1967
|
+
properties: {
|
|
1968
|
+
id: {
|
|
1969
|
+
type: string;
|
|
1970
|
+
};
|
|
1971
|
+
type: {
|
|
1972
|
+
type: string;
|
|
1973
|
+
};
|
|
1974
|
+
transports: {
|
|
1975
|
+
type: string;
|
|
1976
|
+
items: {
|
|
1977
|
+
type: string;
|
|
1978
|
+
};
|
|
1979
|
+
};
|
|
1980
|
+
};
|
|
1981
|
+
};
|
|
1982
|
+
};
|
|
1983
|
+
authenticatorSelection: {
|
|
1984
|
+
type: string;
|
|
1985
|
+
properties: {
|
|
1986
|
+
authenticatorAttachment: {
|
|
1987
|
+
type: string;
|
|
1988
|
+
};
|
|
1989
|
+
requireResidentKey: {
|
|
1990
|
+
type: string;
|
|
1991
|
+
};
|
|
1992
|
+
userVerification: {
|
|
1993
|
+
type: string;
|
|
1994
|
+
};
|
|
1995
|
+
};
|
|
1996
|
+
};
|
|
1997
|
+
attestation: {
|
|
1998
|
+
type: string;
|
|
1999
|
+
};
|
|
2000
|
+
extensions: {
|
|
2001
|
+
type: string;
|
|
2002
|
+
};
|
|
2003
|
+
};
|
|
2004
|
+
};
|
|
2005
|
+
};
|
|
2006
|
+
};
|
|
2007
|
+
};
|
|
2008
|
+
};
|
|
2009
|
+
};
|
|
2010
|
+
};
|
|
2011
|
+
}, import("@simplewebauthn/server").PublicKeyCredentialCreationOptionsJSON>;
|
|
2012
|
+
generatePasskeyAuthenticationOptions: import("better-auth").StrictEndpoint<"/passkey/generate-authenticate-options", {
|
|
2013
|
+
method: "GET";
|
|
2014
|
+
metadata: {
|
|
2015
|
+
openapi: {
|
|
2016
|
+
operationId: string;
|
|
2017
|
+
description: string;
|
|
2018
|
+
responses: {
|
|
2019
|
+
200: {
|
|
2020
|
+
description: string;
|
|
2021
|
+
content: {
|
|
2022
|
+
"application/json": {
|
|
2023
|
+
schema: {
|
|
2024
|
+
type: "object";
|
|
2025
|
+
properties: {
|
|
2026
|
+
challenge: {
|
|
2027
|
+
type: string;
|
|
2028
|
+
};
|
|
2029
|
+
rp: {
|
|
2030
|
+
type: string;
|
|
2031
|
+
properties: {
|
|
2032
|
+
name: {
|
|
2033
|
+
type: string;
|
|
2034
|
+
};
|
|
2035
|
+
id: {
|
|
2036
|
+
type: string;
|
|
2037
|
+
};
|
|
2038
|
+
};
|
|
2039
|
+
};
|
|
2040
|
+
user: {
|
|
2041
|
+
type: string;
|
|
2042
|
+
properties: {
|
|
2043
|
+
id: {
|
|
2044
|
+
type: string;
|
|
2045
|
+
};
|
|
2046
|
+
name: {
|
|
2047
|
+
type: string;
|
|
2048
|
+
};
|
|
2049
|
+
displayName: {
|
|
2050
|
+
type: string;
|
|
2051
|
+
};
|
|
2052
|
+
};
|
|
2053
|
+
};
|
|
2054
|
+
timeout: {
|
|
2055
|
+
type: string;
|
|
2056
|
+
};
|
|
2057
|
+
allowCredentials: {
|
|
2058
|
+
type: string;
|
|
2059
|
+
items: {
|
|
2060
|
+
type: string;
|
|
2061
|
+
properties: {
|
|
2062
|
+
id: {
|
|
2063
|
+
type: string;
|
|
2064
|
+
};
|
|
2065
|
+
type: {
|
|
2066
|
+
type: string;
|
|
2067
|
+
};
|
|
2068
|
+
transports: {
|
|
2069
|
+
type: string;
|
|
2070
|
+
items: {
|
|
2071
|
+
type: string;
|
|
2072
|
+
};
|
|
2073
|
+
};
|
|
2074
|
+
};
|
|
2075
|
+
};
|
|
2076
|
+
};
|
|
2077
|
+
userVerification: {
|
|
2078
|
+
type: string;
|
|
2079
|
+
};
|
|
2080
|
+
authenticatorSelection: {
|
|
2081
|
+
type: string;
|
|
2082
|
+
properties: {
|
|
2083
|
+
authenticatorAttachment: {
|
|
2084
|
+
type: string;
|
|
2085
|
+
};
|
|
2086
|
+
requireResidentKey: {
|
|
2087
|
+
type: string;
|
|
2088
|
+
};
|
|
2089
|
+
userVerification: {
|
|
2090
|
+
type: string;
|
|
2091
|
+
};
|
|
2092
|
+
};
|
|
2093
|
+
};
|
|
2094
|
+
extensions: {
|
|
2095
|
+
type: string;
|
|
2096
|
+
};
|
|
2097
|
+
};
|
|
2098
|
+
};
|
|
2099
|
+
};
|
|
2100
|
+
};
|
|
2101
|
+
};
|
|
2102
|
+
};
|
|
2103
|
+
};
|
|
2104
|
+
};
|
|
2105
|
+
}, import("@simplewebauthn/server").PublicKeyCredentialRequestOptionsJSON>;
|
|
2106
|
+
verifyPasskeyRegistration: import("better-auth").StrictEndpoint<"/passkey/verify-registration", {
|
|
2107
|
+
method: "POST";
|
|
2108
|
+
body: import("zod").ZodObject<{
|
|
2109
|
+
response: import("zod").ZodAny;
|
|
2110
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2111
|
+
createSession: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
2112
|
+
}, import("zod/v4/core").$strip>;
|
|
2113
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
2114
|
+
session: {
|
|
2115
|
+
session: Record<string, any> & {
|
|
2116
|
+
id: string;
|
|
2117
|
+
createdAt: Date;
|
|
2118
|
+
updatedAt: Date;
|
|
2119
|
+
userId: string;
|
|
2120
|
+
expiresAt: Date;
|
|
2121
|
+
token: string;
|
|
2122
|
+
ipAddress?: string | null | undefined;
|
|
2123
|
+
userAgent?: string | null | undefined;
|
|
2124
|
+
};
|
|
2125
|
+
user: Record<string, any> & {
|
|
2126
|
+
id: string;
|
|
2127
|
+
createdAt: Date;
|
|
2128
|
+
updatedAt: Date;
|
|
2129
|
+
email: string;
|
|
2130
|
+
emailVerified: boolean;
|
|
2131
|
+
name: string;
|
|
2132
|
+
image?: string | null | undefined;
|
|
2133
|
+
};
|
|
2134
|
+
};
|
|
2135
|
+
}>>[];
|
|
2136
|
+
metadata: {
|
|
2137
|
+
openapi: {
|
|
2138
|
+
operationId: string;
|
|
2139
|
+
description: string;
|
|
2140
|
+
responses: {
|
|
2141
|
+
200: {
|
|
2142
|
+
description: string;
|
|
2143
|
+
content: {
|
|
2144
|
+
"application/json": {
|
|
2145
|
+
schema: {
|
|
2146
|
+
readonly type: "object";
|
|
2147
|
+
readonly allOf: readonly [{
|
|
2148
|
+
readonly $ref: "#/components/schemas/Passkey";
|
|
2149
|
+
}, {
|
|
2150
|
+
readonly type: "object";
|
|
2151
|
+
readonly properties: {
|
|
2152
|
+
readonly session: {
|
|
2153
|
+
readonly $ref: "#/components/schemas/Session";
|
|
2154
|
+
};
|
|
2155
|
+
readonly user: {
|
|
2156
|
+
readonly $ref: "#/components/schemas/User";
|
|
2157
|
+
};
|
|
2158
|
+
};
|
|
2159
|
+
}];
|
|
2160
|
+
};
|
|
2161
|
+
};
|
|
2162
|
+
};
|
|
2163
|
+
};
|
|
2164
|
+
400: {
|
|
2165
|
+
description: string;
|
|
2166
|
+
};
|
|
2167
|
+
};
|
|
2168
|
+
};
|
|
2169
|
+
};
|
|
2170
|
+
}, import("@better-auth/passkey").Passkey>;
|
|
2171
|
+
verifyPasskeyAuthentication: import("better-auth").StrictEndpoint<"/passkey/verify-authentication", {
|
|
2172
|
+
method: "POST";
|
|
2173
|
+
body: import("zod").ZodObject<{
|
|
2174
|
+
response: import("zod").ZodRecord<import("zod").ZodAny, import("zod").ZodAny>;
|
|
2175
|
+
}, import("zod/v4/core").$strip>;
|
|
2176
|
+
metadata: {
|
|
2177
|
+
openapi: {
|
|
2178
|
+
operationId: string;
|
|
2179
|
+
description: string;
|
|
2180
|
+
responses: {
|
|
2181
|
+
200: {
|
|
2182
|
+
description: string;
|
|
2183
|
+
content: {
|
|
2184
|
+
"application/json": {
|
|
2185
|
+
schema: {
|
|
2186
|
+
type: "object";
|
|
2187
|
+
properties: {
|
|
2188
|
+
session: {
|
|
2189
|
+
$ref: string;
|
|
2190
|
+
};
|
|
2191
|
+
user: {
|
|
2192
|
+
$ref: string;
|
|
2193
|
+
};
|
|
2194
|
+
};
|
|
2195
|
+
};
|
|
2196
|
+
};
|
|
2197
|
+
};
|
|
2198
|
+
};
|
|
2199
|
+
};
|
|
2200
|
+
};
|
|
2201
|
+
$Infer: {
|
|
2202
|
+
body: {
|
|
2203
|
+
response: import("@simplewebauthn/server").AuthenticationResponseJSON;
|
|
2204
|
+
};
|
|
2205
|
+
};
|
|
2206
|
+
};
|
|
2207
|
+
}, {
|
|
2208
|
+
session: {
|
|
2209
|
+
id: string;
|
|
2210
|
+
createdAt: Date;
|
|
2211
|
+
updatedAt: Date;
|
|
2212
|
+
userId: string;
|
|
2213
|
+
expiresAt: Date;
|
|
2214
|
+
token: string;
|
|
2215
|
+
ipAddress?: string | null | undefined;
|
|
2216
|
+
userAgent?: string | null | undefined;
|
|
2217
|
+
};
|
|
2218
|
+
user: {
|
|
2219
|
+
id: string;
|
|
2220
|
+
createdAt: Date;
|
|
2221
|
+
updatedAt: Date;
|
|
2222
|
+
email: string;
|
|
2223
|
+
emailVerified: boolean;
|
|
2224
|
+
name: string;
|
|
2225
|
+
image?: string | null | undefined;
|
|
2226
|
+
};
|
|
2227
|
+
}>;
|
|
2228
|
+
listPasskeys: import("better-auth").StrictEndpoint<"/passkey/list-user-passkeys", {
|
|
2229
|
+
method: "GET";
|
|
2230
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
2231
|
+
session: {
|
|
2232
|
+
session: Record<string, any> & {
|
|
2233
|
+
id: string;
|
|
2234
|
+
createdAt: Date;
|
|
2235
|
+
updatedAt: Date;
|
|
2236
|
+
userId: string;
|
|
2237
|
+
expiresAt: Date;
|
|
2238
|
+
token: string;
|
|
2239
|
+
ipAddress?: string | null | undefined;
|
|
2240
|
+
userAgent?: string | null | undefined;
|
|
2241
|
+
};
|
|
2242
|
+
user: Record<string, any> & {
|
|
2243
|
+
id: string;
|
|
2244
|
+
createdAt: Date;
|
|
2245
|
+
updatedAt: Date;
|
|
2246
|
+
email: string;
|
|
2247
|
+
emailVerified: boolean;
|
|
2248
|
+
name: string;
|
|
2249
|
+
image?: string | null | undefined;
|
|
2250
|
+
};
|
|
2251
|
+
};
|
|
2252
|
+
}>>[];
|
|
2253
|
+
metadata: {
|
|
2254
|
+
openapi: {
|
|
2255
|
+
description: string;
|
|
2256
|
+
responses: {
|
|
2257
|
+
"200": {
|
|
2258
|
+
description: string;
|
|
2259
|
+
content: {
|
|
2260
|
+
"application/json": {
|
|
2261
|
+
schema: {
|
|
2262
|
+
type: "array";
|
|
2263
|
+
items: {
|
|
2264
|
+
$ref: string;
|
|
2265
|
+
required: string[];
|
|
2266
|
+
};
|
|
2267
|
+
description: string;
|
|
2268
|
+
};
|
|
2269
|
+
};
|
|
2270
|
+
};
|
|
2271
|
+
};
|
|
2272
|
+
};
|
|
2273
|
+
};
|
|
2274
|
+
};
|
|
2275
|
+
}, import("@better-auth/passkey").Passkey[]>;
|
|
2276
|
+
deletePasskey: import("better-auth").StrictEndpoint<"/passkey/delete-passkey", {
|
|
2277
|
+
method: "POST";
|
|
2278
|
+
body: import("zod").ZodObject<{
|
|
2279
|
+
id: import("zod").ZodString;
|
|
2280
|
+
}, import("zod/v4/core").$strip>;
|
|
2281
|
+
use: (import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
2282
|
+
session: {
|
|
2283
|
+
session: Record<string, any> & {
|
|
2284
|
+
id: string;
|
|
2285
|
+
createdAt: Date;
|
|
2286
|
+
updatedAt: Date;
|
|
2287
|
+
userId: string;
|
|
2288
|
+
expiresAt: Date;
|
|
2289
|
+
token: string;
|
|
2290
|
+
ipAddress?: string | null | undefined;
|
|
2291
|
+
userAgent?: string | null | undefined;
|
|
2292
|
+
};
|
|
2293
|
+
user: Record<string, any> & {
|
|
2294
|
+
id: string;
|
|
2295
|
+
createdAt: Date;
|
|
2296
|
+
updatedAt: Date;
|
|
2297
|
+
email: string;
|
|
2298
|
+
emailVerified: boolean;
|
|
2299
|
+
name: string;
|
|
2300
|
+
image?: string | null | undefined;
|
|
2301
|
+
};
|
|
2302
|
+
};
|
|
2303
|
+
}>> | import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
2304
|
+
verifiedResource: {};
|
|
2305
|
+
}>>)[];
|
|
2306
|
+
metadata: {
|
|
2307
|
+
openapi: {
|
|
2308
|
+
description: string;
|
|
2309
|
+
responses: {
|
|
2310
|
+
"200": {
|
|
2311
|
+
description: string;
|
|
2312
|
+
content: {
|
|
2313
|
+
"application/json": {
|
|
2314
|
+
schema: {
|
|
2315
|
+
type: "object";
|
|
2316
|
+
properties: {
|
|
2317
|
+
status: {
|
|
2318
|
+
type: string;
|
|
2319
|
+
description: string;
|
|
2320
|
+
};
|
|
2321
|
+
};
|
|
2322
|
+
required: string[];
|
|
2323
|
+
};
|
|
2324
|
+
};
|
|
2325
|
+
};
|
|
2326
|
+
};
|
|
2327
|
+
};
|
|
2328
|
+
};
|
|
2329
|
+
};
|
|
2330
|
+
}, {
|
|
2331
|
+
status: boolean;
|
|
2332
|
+
}>;
|
|
2333
|
+
updatePasskey: import("better-auth").StrictEndpoint<"/passkey/update-passkey", {
|
|
2334
|
+
method: "POST";
|
|
2335
|
+
body: import("zod").ZodObject<{
|
|
2336
|
+
id: import("zod").ZodString;
|
|
2337
|
+
name: import("zod").ZodString;
|
|
2338
|
+
}, import("zod/v4/core").$strip>;
|
|
2339
|
+
use: (import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
2340
|
+
session: {
|
|
2341
|
+
session: Record<string, any> & {
|
|
2342
|
+
id: string;
|
|
2343
|
+
createdAt: Date;
|
|
2344
|
+
updatedAt: Date;
|
|
2345
|
+
userId: string;
|
|
2346
|
+
expiresAt: Date;
|
|
2347
|
+
token: string;
|
|
2348
|
+
ipAddress?: string | null | undefined;
|
|
2349
|
+
userAgent?: string | null | undefined;
|
|
2350
|
+
};
|
|
2351
|
+
user: Record<string, any> & {
|
|
2352
|
+
id: string;
|
|
2353
|
+
createdAt: Date;
|
|
2354
|
+
updatedAt: Date;
|
|
2355
|
+
email: string;
|
|
2356
|
+
emailVerified: boolean;
|
|
2357
|
+
name: string;
|
|
2358
|
+
image?: string | null | undefined;
|
|
2359
|
+
};
|
|
2360
|
+
};
|
|
2361
|
+
}>> | import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
2362
|
+
verifiedResource: {};
|
|
2363
|
+
}>>)[];
|
|
2364
|
+
metadata: {
|
|
2365
|
+
openapi: {
|
|
2366
|
+
description: string;
|
|
2367
|
+
responses: {
|
|
2368
|
+
"200": {
|
|
2369
|
+
description: string;
|
|
2370
|
+
content: {
|
|
2371
|
+
"application/json": {
|
|
2372
|
+
schema: {
|
|
2373
|
+
type: "object";
|
|
2374
|
+
properties: {
|
|
2375
|
+
passkey: {
|
|
2376
|
+
$ref: string;
|
|
2377
|
+
};
|
|
2378
|
+
};
|
|
2379
|
+
required: string[];
|
|
2380
|
+
};
|
|
2381
|
+
};
|
|
2382
|
+
};
|
|
2383
|
+
};
|
|
2384
|
+
};
|
|
2385
|
+
};
|
|
2386
|
+
};
|
|
2387
|
+
}, {
|
|
2388
|
+
passkey: import("@better-auth/passkey").Passkey;
|
|
2389
|
+
}>;
|
|
2390
|
+
};
|
|
2391
|
+
schema: {
|
|
2392
|
+
passkey: {
|
|
2393
|
+
fields: {
|
|
2394
|
+
name: {
|
|
2395
|
+
type: "string";
|
|
2396
|
+
required: false;
|
|
2397
|
+
};
|
|
2398
|
+
publicKey: {
|
|
2399
|
+
type: "string";
|
|
2400
|
+
required: true;
|
|
2401
|
+
};
|
|
2402
|
+
userId: {
|
|
2403
|
+
type: "string";
|
|
2404
|
+
references: {
|
|
2405
|
+
model: string;
|
|
2406
|
+
field: string;
|
|
2407
|
+
};
|
|
2408
|
+
required: true;
|
|
2409
|
+
index: true;
|
|
2410
|
+
};
|
|
2411
|
+
credentialID: {
|
|
2412
|
+
type: "string";
|
|
2413
|
+
required: true;
|
|
2414
|
+
index: true;
|
|
2415
|
+
};
|
|
2416
|
+
counter: {
|
|
2417
|
+
type: "number";
|
|
2418
|
+
required: true;
|
|
2419
|
+
};
|
|
2420
|
+
deviceType: {
|
|
2421
|
+
type: "string";
|
|
2422
|
+
required: true;
|
|
2423
|
+
};
|
|
2424
|
+
backedUp: {
|
|
2425
|
+
type: "boolean";
|
|
2426
|
+
required: true;
|
|
2427
|
+
};
|
|
2428
|
+
transports: {
|
|
2429
|
+
type: "string";
|
|
2430
|
+
required: false;
|
|
2431
|
+
};
|
|
2432
|
+
createdAt: {
|
|
2433
|
+
type: "date";
|
|
2434
|
+
required: false;
|
|
2435
|
+
};
|
|
2436
|
+
aaguid: {
|
|
2437
|
+
type: "string";
|
|
2438
|
+
required: false;
|
|
2439
|
+
};
|
|
2440
|
+
};
|
|
2441
|
+
};
|
|
2442
|
+
};
|
|
2443
|
+
$ERROR_CODES: {
|
|
2444
|
+
CHALLENGE_NOT_FOUND: import("better-auth").RawError<"CHALLENGE_NOT_FOUND">;
|
|
2445
|
+
YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
|
|
2446
|
+
FAILED_TO_VERIFY_REGISTRATION: import("better-auth").RawError<"FAILED_TO_VERIFY_REGISTRATION">;
|
|
2447
|
+
PASSKEY_NOT_FOUND: import("better-auth").RawError<"PASSKEY_NOT_FOUND">;
|
|
2448
|
+
AUTHENTICATION_FAILED: import("better-auth").RawError<"AUTHENTICATION_FAILED">;
|
|
2449
|
+
UNABLE_TO_CREATE_SESSION: import("better-auth").RawError<"UNABLE_TO_CREATE_SESSION">;
|
|
2450
|
+
USER_NOT_FOUND: import("better-auth").RawError<"USER_NOT_FOUND">;
|
|
2451
|
+
FAILED_TO_UPDATE_PASSKEY: import("better-auth").RawError<"FAILED_TO_UPDATE_PASSKEY">;
|
|
2452
|
+
PREVIOUSLY_REGISTERED: import("better-auth").RawError<"PREVIOUSLY_REGISTERED">;
|
|
2453
|
+
REGISTRATION_CANCELLED: import("better-auth").RawError<"REGISTRATION_CANCELLED">;
|
|
2454
|
+
AUTH_CANCELLED: import("better-auth").RawError<"AUTH_CANCELLED">;
|
|
2455
|
+
UNKNOWN_ERROR: import("better-auth").RawError<"UNKNOWN_ERROR">;
|
|
2456
|
+
SESSION_REQUIRED: import("better-auth").RawError<"SESSION_REQUIRED">;
|
|
2457
|
+
RESOLVE_USER_REQUIRED: import("better-auth").RawError<"RESOLVE_USER_REQUIRED">;
|
|
2458
|
+
RESOLVED_USER_INVALID: import("better-auth").RawError<"RESOLVED_USER_INVALID">;
|
|
2459
|
+
};
|
|
2460
|
+
options: import("@better-auth/passkey").PasskeyOptions | undefined;
|
|
2461
|
+
}, ...{
|
|
2462
|
+
id: "email-otp";
|
|
2463
|
+
version: string;
|
|
2464
|
+
init(ctx: import("better-auth").AuthContext): {
|
|
2465
|
+
options: {
|
|
2466
|
+
emailVerification: {
|
|
2467
|
+
sendVerificationEmail(data: {
|
|
2468
|
+
user: import("better-auth").User;
|
|
2469
|
+
url: string;
|
|
2470
|
+
token: string;
|
|
2471
|
+
}, request: Request | undefined): Promise<void>;
|
|
2472
|
+
};
|
|
2473
|
+
};
|
|
2474
|
+
} | undefined;
|
|
2475
|
+
endpoints: {
|
|
2476
|
+
sendVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/send-verification-otp", {
|
|
2477
|
+
method: "POST";
|
|
2478
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>[];
|
|
2479
|
+
body: import("zod").ZodObject<{
|
|
2480
|
+
email: import("zod").ZodString;
|
|
2481
|
+
type: import("zod").ZodEnum<{
|
|
2482
|
+
"sign-in": "sign-in";
|
|
2483
|
+
"change-email": "change-email";
|
|
2484
|
+
"email-verification": "email-verification";
|
|
2485
|
+
"forget-password": "forget-password";
|
|
2486
|
+
}>;
|
|
2487
|
+
}, import("zod/v4/core").$strip>;
|
|
2488
|
+
metadata: {
|
|
2489
|
+
openapi: {
|
|
2490
|
+
operationId: string;
|
|
2491
|
+
description: string;
|
|
2492
|
+
responses: {
|
|
2493
|
+
200: {
|
|
2494
|
+
description: string;
|
|
2495
|
+
content: {
|
|
2496
|
+
"application/json": {
|
|
2497
|
+
schema: {
|
|
2498
|
+
type: "object";
|
|
2499
|
+
properties: {
|
|
2500
|
+
success: {
|
|
2501
|
+
type: string;
|
|
2502
|
+
};
|
|
2503
|
+
};
|
|
2504
|
+
};
|
|
2505
|
+
};
|
|
2506
|
+
};
|
|
2507
|
+
};
|
|
2508
|
+
};
|
|
2509
|
+
};
|
|
2510
|
+
};
|
|
2511
|
+
}, {
|
|
2512
|
+
success: boolean;
|
|
2513
|
+
}>;
|
|
2514
|
+
createVerificationOTP: import("better-auth").StrictEndpoint<string, {
|
|
2515
|
+
method: "POST";
|
|
2516
|
+
body: import("zod").ZodObject<{
|
|
2517
|
+
email: import("zod").ZodString;
|
|
2518
|
+
type: import("zod").ZodEnum<{
|
|
2519
|
+
"sign-in": "sign-in";
|
|
2520
|
+
"change-email": "change-email";
|
|
2521
|
+
"email-verification": "email-verification";
|
|
2522
|
+
"forget-password": "forget-password";
|
|
2523
|
+
}>;
|
|
2524
|
+
}, import("zod/v4/core").$strip>;
|
|
2525
|
+
metadata: {
|
|
2526
|
+
openapi: {
|
|
2527
|
+
operationId: string;
|
|
2528
|
+
description: string;
|
|
2529
|
+
responses: {
|
|
2530
|
+
200: {
|
|
2531
|
+
description: string;
|
|
2532
|
+
content: {
|
|
2533
|
+
"application/json": {
|
|
2534
|
+
schema: {
|
|
2535
|
+
type: "string";
|
|
2536
|
+
};
|
|
2537
|
+
};
|
|
2538
|
+
};
|
|
2539
|
+
};
|
|
2540
|
+
};
|
|
2541
|
+
};
|
|
2542
|
+
};
|
|
2543
|
+
}, string>;
|
|
2544
|
+
getVerificationOTP: import("better-auth").StrictEndpoint<string, {
|
|
2545
|
+
method: "GET";
|
|
2546
|
+
query: import("zod").ZodObject<{
|
|
2547
|
+
email: import("zod").ZodString;
|
|
2548
|
+
type: import("zod").ZodEnum<{
|
|
2549
|
+
"sign-in": "sign-in";
|
|
2550
|
+
"change-email": "change-email";
|
|
2551
|
+
"email-verification": "email-verification";
|
|
2552
|
+
"forget-password": "forget-password";
|
|
2553
|
+
}>;
|
|
2554
|
+
}, import("zod/v4/core").$strip>;
|
|
2555
|
+
metadata: {
|
|
2556
|
+
openapi: {
|
|
2557
|
+
operationId: string;
|
|
2558
|
+
description: string;
|
|
2559
|
+
responses: {
|
|
2560
|
+
"200": {
|
|
2561
|
+
description: string;
|
|
2562
|
+
content: {
|
|
2563
|
+
"application/json": {
|
|
2564
|
+
schema: {
|
|
2565
|
+
type: "object";
|
|
2566
|
+
properties: {
|
|
2567
|
+
otp: {
|
|
2568
|
+
type: string;
|
|
2569
|
+
nullable: boolean;
|
|
2570
|
+
description: string;
|
|
2571
|
+
};
|
|
2572
|
+
};
|
|
2573
|
+
required: string[];
|
|
2574
|
+
};
|
|
2575
|
+
};
|
|
2576
|
+
};
|
|
2577
|
+
};
|
|
2578
|
+
};
|
|
2579
|
+
};
|
|
2580
|
+
};
|
|
2581
|
+
}, {
|
|
2582
|
+
otp: null;
|
|
2583
|
+
} | {
|
|
2584
|
+
otp: string;
|
|
2585
|
+
}>;
|
|
2586
|
+
checkVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/check-verification-otp", {
|
|
2587
|
+
method: "POST";
|
|
2588
|
+
body: import("zod").ZodObject<{
|
|
2589
|
+
email: import("zod").ZodString;
|
|
2590
|
+
type: import("zod").ZodEnum<{
|
|
2591
|
+
"sign-in": "sign-in";
|
|
2592
|
+
"change-email": "change-email";
|
|
2593
|
+
"email-verification": "email-verification";
|
|
2594
|
+
"forget-password": "forget-password";
|
|
2595
|
+
}>;
|
|
2596
|
+
otp: import("zod").ZodString;
|
|
2597
|
+
}, import("zod/v4/core").$strip>;
|
|
2598
|
+
metadata: {
|
|
2599
|
+
openapi: {
|
|
2600
|
+
operationId: string;
|
|
2601
|
+
description: string;
|
|
2602
|
+
responses: {
|
|
2603
|
+
200: {
|
|
2604
|
+
description: string;
|
|
2605
|
+
content: {
|
|
2606
|
+
"application/json": {
|
|
2607
|
+
schema: {
|
|
2608
|
+
type: "object";
|
|
2609
|
+
properties: {
|
|
2610
|
+
success: {
|
|
2611
|
+
type: string;
|
|
2612
|
+
};
|
|
2613
|
+
};
|
|
2614
|
+
};
|
|
2615
|
+
};
|
|
2616
|
+
};
|
|
2617
|
+
};
|
|
2618
|
+
};
|
|
2619
|
+
};
|
|
2620
|
+
};
|
|
2621
|
+
}, {
|
|
2622
|
+
success: boolean;
|
|
2623
|
+
}>;
|
|
2624
|
+
verifyEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/verify-email", {
|
|
2625
|
+
method: "POST";
|
|
2626
|
+
body: import("zod").ZodObject<{
|
|
2627
|
+
email: import("zod").ZodString;
|
|
2628
|
+
otp: import("zod").ZodString;
|
|
2629
|
+
}, import("zod/v4/core").$strip>;
|
|
2630
|
+
metadata: {
|
|
2631
|
+
openapi: {
|
|
2632
|
+
description: string;
|
|
2633
|
+
responses: {
|
|
2634
|
+
200: {
|
|
2635
|
+
description: string;
|
|
2636
|
+
content: {
|
|
2637
|
+
"application/json": {
|
|
2638
|
+
schema: {
|
|
2639
|
+
type: "object";
|
|
2640
|
+
properties: {
|
|
2641
|
+
status: {
|
|
2642
|
+
type: string;
|
|
2643
|
+
description: string;
|
|
2644
|
+
enum: boolean[];
|
|
2645
|
+
};
|
|
2646
|
+
token: {
|
|
2647
|
+
type: string;
|
|
2648
|
+
nullable: boolean;
|
|
2649
|
+
description: string;
|
|
2650
|
+
};
|
|
2651
|
+
user: {
|
|
2652
|
+
$ref: string;
|
|
2653
|
+
};
|
|
2654
|
+
};
|
|
2655
|
+
required: string[];
|
|
2656
|
+
};
|
|
2657
|
+
};
|
|
2658
|
+
};
|
|
2659
|
+
};
|
|
2660
|
+
};
|
|
2661
|
+
};
|
|
2662
|
+
};
|
|
2663
|
+
}, {
|
|
2664
|
+
status: boolean;
|
|
2665
|
+
token: string;
|
|
2666
|
+
user: {
|
|
2667
|
+
id: string;
|
|
2668
|
+
createdAt: Date;
|
|
2669
|
+
updatedAt: Date;
|
|
2670
|
+
email: string;
|
|
2671
|
+
emailVerified: boolean;
|
|
2672
|
+
name: string;
|
|
2673
|
+
image?: string | null | undefined;
|
|
2674
|
+
} & Record<string, any>;
|
|
2675
|
+
} | {
|
|
2676
|
+
status: boolean;
|
|
2677
|
+
token: null;
|
|
2678
|
+
user: {
|
|
2679
|
+
id: string;
|
|
2680
|
+
createdAt: Date;
|
|
2681
|
+
updatedAt: Date;
|
|
2682
|
+
email: string;
|
|
2683
|
+
emailVerified: boolean;
|
|
2684
|
+
name: string;
|
|
2685
|
+
image?: string | null | undefined;
|
|
2686
|
+
} & Record<string, any>;
|
|
2687
|
+
}>;
|
|
2688
|
+
signInEmailOTP: import("better-auth").StrictEndpoint<"/sign-in/email-otp", {
|
|
2689
|
+
method: "POST";
|
|
2690
|
+
body: import("zod").ZodIntersection<import("zod").ZodObject<{
|
|
2691
|
+
email: import("zod").ZodString;
|
|
2692
|
+
otp: import("zod").ZodString;
|
|
2693
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2694
|
+
image: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2695
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
2696
|
+
metadata: {
|
|
2697
|
+
openapi: {
|
|
2698
|
+
operationId: string;
|
|
2699
|
+
description: string;
|
|
2700
|
+
responses: {
|
|
2701
|
+
200: {
|
|
2702
|
+
description: string;
|
|
2703
|
+
content: {
|
|
2704
|
+
"application/json": {
|
|
2705
|
+
schema: {
|
|
2706
|
+
type: "object";
|
|
2707
|
+
properties: {
|
|
2708
|
+
token: {
|
|
2709
|
+
type: string;
|
|
2710
|
+
description: string;
|
|
2711
|
+
};
|
|
2712
|
+
user: {
|
|
2713
|
+
$ref: string;
|
|
2714
|
+
};
|
|
2715
|
+
};
|
|
2716
|
+
required: string[];
|
|
2717
|
+
};
|
|
2718
|
+
};
|
|
2719
|
+
};
|
|
2720
|
+
};
|
|
2721
|
+
};
|
|
2722
|
+
};
|
|
2723
|
+
};
|
|
2724
|
+
}, {
|
|
2725
|
+
token: string;
|
|
2726
|
+
user: {
|
|
2727
|
+
id: string;
|
|
2728
|
+
createdAt: Date;
|
|
2729
|
+
updatedAt: Date;
|
|
2730
|
+
email: string;
|
|
2731
|
+
emailVerified: boolean;
|
|
2732
|
+
name: string;
|
|
2733
|
+
image?: string | null | undefined;
|
|
2734
|
+
};
|
|
2735
|
+
}>;
|
|
2736
|
+
requestPasswordResetEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-password-reset", {
|
|
2737
|
+
method: "POST";
|
|
2738
|
+
body: import("zod").ZodObject<{
|
|
2739
|
+
email: import("zod").ZodString;
|
|
2740
|
+
}, import("zod/v4/core").$strip>;
|
|
2741
|
+
metadata: {
|
|
2742
|
+
openapi: {
|
|
2743
|
+
operationId: string;
|
|
2744
|
+
description: string;
|
|
2745
|
+
responses: {
|
|
2746
|
+
200: {
|
|
2747
|
+
description: string;
|
|
2748
|
+
content: {
|
|
2749
|
+
"application/json": {
|
|
2750
|
+
schema: {
|
|
2751
|
+
type: "object";
|
|
2752
|
+
properties: {
|
|
2753
|
+
success: {
|
|
2754
|
+
type: string;
|
|
2755
|
+
description: string;
|
|
2756
|
+
};
|
|
2757
|
+
};
|
|
2758
|
+
};
|
|
2759
|
+
};
|
|
2760
|
+
};
|
|
2761
|
+
};
|
|
2762
|
+
};
|
|
2763
|
+
};
|
|
2764
|
+
};
|
|
2765
|
+
}, {
|
|
2766
|
+
success: boolean;
|
|
2767
|
+
}>;
|
|
2768
|
+
forgetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/forget-password/email-otp", {
|
|
2769
|
+
method: "POST";
|
|
2770
|
+
body: import("zod").ZodObject<{
|
|
2771
|
+
email: import("zod").ZodString;
|
|
2772
|
+
}, import("zod/v4/core").$strip>;
|
|
2773
|
+
metadata: {
|
|
2774
|
+
openapi: {
|
|
2775
|
+
operationId: string;
|
|
2776
|
+
description: string;
|
|
2777
|
+
responses: {
|
|
2778
|
+
200: {
|
|
2779
|
+
description: string;
|
|
2780
|
+
content: {
|
|
2781
|
+
"application/json": {
|
|
2782
|
+
schema: {
|
|
2783
|
+
type: "object";
|
|
2784
|
+
properties: {
|
|
2785
|
+
success: {
|
|
2786
|
+
type: string;
|
|
2787
|
+
description: string;
|
|
2788
|
+
};
|
|
2789
|
+
};
|
|
2790
|
+
};
|
|
2791
|
+
};
|
|
2792
|
+
};
|
|
2793
|
+
};
|
|
2794
|
+
};
|
|
2795
|
+
};
|
|
2796
|
+
};
|
|
2797
|
+
}, {
|
|
2798
|
+
success: boolean;
|
|
2799
|
+
}>;
|
|
2800
|
+
resetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/reset-password", {
|
|
2801
|
+
method: "POST";
|
|
2802
|
+
body: import("zod").ZodObject<{
|
|
2803
|
+
email: import("zod").ZodString;
|
|
2804
|
+
otp: import("zod").ZodString;
|
|
2805
|
+
password: import("zod").ZodString;
|
|
2806
|
+
}, import("zod/v4/core").$strip>;
|
|
2807
|
+
metadata: {
|
|
2808
|
+
openapi: {
|
|
2809
|
+
operationId: string;
|
|
2810
|
+
description: string;
|
|
2811
|
+
responses: {
|
|
2812
|
+
200: {
|
|
2813
|
+
description: string;
|
|
2814
|
+
content: {
|
|
2815
|
+
"application/json": {
|
|
2816
|
+
schema: {
|
|
2817
|
+
type: "object";
|
|
2818
|
+
properties: {
|
|
2819
|
+
success: {
|
|
2820
|
+
type: string;
|
|
2821
|
+
};
|
|
2822
|
+
};
|
|
2823
|
+
};
|
|
2824
|
+
};
|
|
2825
|
+
};
|
|
2826
|
+
};
|
|
2827
|
+
};
|
|
2828
|
+
};
|
|
2829
|
+
};
|
|
2830
|
+
}, {
|
|
2831
|
+
success: boolean;
|
|
2832
|
+
}>;
|
|
2833
|
+
requestEmailChangeEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-email-change", {
|
|
2834
|
+
method: "POST";
|
|
2835
|
+
body: import("zod").ZodObject<{
|
|
2836
|
+
newEmail: import("zod").ZodString;
|
|
2837
|
+
otp: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2838
|
+
}, import("zod/v4/core").$strip>;
|
|
2839
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
2840
|
+
session: {
|
|
2841
|
+
session: Record<string, any> & {
|
|
2842
|
+
id: string;
|
|
2843
|
+
createdAt: Date;
|
|
2844
|
+
updatedAt: Date;
|
|
2845
|
+
userId: string;
|
|
2846
|
+
expiresAt: Date;
|
|
2847
|
+
token: string;
|
|
2848
|
+
ipAddress?: string | null | undefined;
|
|
2849
|
+
userAgent?: string | null | undefined;
|
|
2850
|
+
};
|
|
2851
|
+
user: Record<string, any> & {
|
|
2852
|
+
id: string;
|
|
2853
|
+
createdAt: Date;
|
|
2854
|
+
updatedAt: Date;
|
|
2855
|
+
email: string;
|
|
2856
|
+
emailVerified: boolean;
|
|
2857
|
+
name: string;
|
|
2858
|
+
image?: string | null | undefined;
|
|
2859
|
+
};
|
|
2860
|
+
};
|
|
2861
|
+
}>>[];
|
|
2862
|
+
metadata: {
|
|
2863
|
+
openapi: {
|
|
2864
|
+
operationId: string;
|
|
2865
|
+
description: string;
|
|
2866
|
+
responses: {
|
|
2867
|
+
200: {
|
|
2868
|
+
description: string;
|
|
2869
|
+
content: {
|
|
2870
|
+
"application/json": {
|
|
2871
|
+
schema: {
|
|
2872
|
+
type: "object";
|
|
2873
|
+
properties: {
|
|
2874
|
+
success: {
|
|
2875
|
+
type: string;
|
|
2876
|
+
};
|
|
2877
|
+
};
|
|
2878
|
+
};
|
|
2879
|
+
};
|
|
2880
|
+
};
|
|
2881
|
+
};
|
|
2882
|
+
};
|
|
2883
|
+
};
|
|
2884
|
+
};
|
|
2885
|
+
}, {
|
|
2886
|
+
success: boolean;
|
|
2887
|
+
}>;
|
|
2888
|
+
changeEmailEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/change-email", {
|
|
2889
|
+
method: "POST";
|
|
2890
|
+
body: import("zod").ZodObject<{
|
|
2891
|
+
newEmail: import("zod").ZodString;
|
|
2892
|
+
otp: import("zod").ZodString;
|
|
2893
|
+
}, import("zod/v4/core").$strip>;
|
|
2894
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
2895
|
+
session: {
|
|
2896
|
+
session: Record<string, any> & {
|
|
2897
|
+
id: string;
|
|
2898
|
+
createdAt: Date;
|
|
2899
|
+
updatedAt: Date;
|
|
2900
|
+
userId: string;
|
|
2901
|
+
expiresAt: Date;
|
|
2902
|
+
token: string;
|
|
2903
|
+
ipAddress?: string | null | undefined;
|
|
2904
|
+
userAgent?: string | null | undefined;
|
|
2905
|
+
};
|
|
2906
|
+
user: Record<string, any> & {
|
|
2907
|
+
id: string;
|
|
2908
|
+
createdAt: Date;
|
|
2909
|
+
updatedAt: Date;
|
|
2910
|
+
email: string;
|
|
2911
|
+
emailVerified: boolean;
|
|
2912
|
+
name: string;
|
|
2913
|
+
image?: string | null | undefined;
|
|
2914
|
+
};
|
|
2915
|
+
};
|
|
2916
|
+
}>>[];
|
|
2917
|
+
metadata: {
|
|
2918
|
+
openapi: {
|
|
2919
|
+
operationId: string;
|
|
2920
|
+
description: string;
|
|
2921
|
+
responses: {
|
|
2922
|
+
200: {
|
|
2923
|
+
description: string;
|
|
2924
|
+
content: {
|
|
2925
|
+
"application/json": {
|
|
2926
|
+
schema: {
|
|
2927
|
+
type: "object";
|
|
2928
|
+
properties: {
|
|
2929
|
+
success: {
|
|
2930
|
+
type: string;
|
|
2931
|
+
};
|
|
2932
|
+
};
|
|
2933
|
+
};
|
|
2934
|
+
};
|
|
2935
|
+
};
|
|
2936
|
+
};
|
|
2937
|
+
};
|
|
2938
|
+
};
|
|
2939
|
+
};
|
|
2940
|
+
}, {
|
|
2941
|
+
success: boolean;
|
|
2942
|
+
}>;
|
|
2943
|
+
};
|
|
2944
|
+
hooks: {
|
|
2945
|
+
after: {
|
|
2946
|
+
matcher(context: import("better-auth").HookEndpointContext): boolean;
|
|
2947
|
+
handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
|
|
2948
|
+
}[];
|
|
2949
|
+
};
|
|
2950
|
+
rateLimit: ({
|
|
2951
|
+
pathMatcher(path: string): path is "/email-otp/send-verification-otp";
|
|
2952
|
+
window: number;
|
|
2953
|
+
max: number;
|
|
2954
|
+
} | {
|
|
2955
|
+
pathMatcher(path: string): path is "/email-otp/check-verification-otp";
|
|
2956
|
+
window: number;
|
|
2957
|
+
max: number;
|
|
2958
|
+
} | {
|
|
2959
|
+
pathMatcher(path: string): path is "/email-otp/verify-email";
|
|
2960
|
+
window: number;
|
|
2961
|
+
max: number;
|
|
2962
|
+
} | {
|
|
2963
|
+
pathMatcher(path: string): path is "/sign-in/email-otp";
|
|
2964
|
+
window: number;
|
|
2965
|
+
max: number;
|
|
2966
|
+
} | {
|
|
2967
|
+
pathMatcher(path: string): path is "/email-otp/request-password-reset";
|
|
2968
|
+
window: number;
|
|
2969
|
+
max: number;
|
|
2970
|
+
} | {
|
|
2971
|
+
pathMatcher(path: string): path is "/email-otp/reset-password";
|
|
2972
|
+
window: number;
|
|
2973
|
+
max: number;
|
|
2974
|
+
} | {
|
|
2975
|
+
pathMatcher(path: string): path is "/forget-password/email-otp";
|
|
2976
|
+
window: number;
|
|
2977
|
+
max: number;
|
|
2978
|
+
} | {
|
|
2979
|
+
pathMatcher(path: string): path is "/email-otp/request-email-change";
|
|
2980
|
+
window: number;
|
|
2981
|
+
max: number;
|
|
2982
|
+
} | {
|
|
2983
|
+
pathMatcher(path: string): path is "/email-otp/change-email";
|
|
2984
|
+
window: number;
|
|
2985
|
+
max: number;
|
|
2986
|
+
})[];
|
|
2987
|
+
options: import("better-auth/plugins").EmailOTPOptions;
|
|
2988
|
+
$ERROR_CODES: {
|
|
2989
|
+
OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
|
|
2990
|
+
INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
|
|
2991
|
+
TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
|
|
2992
|
+
};
|
|
2993
|
+
}[], {
|
|
2994
|
+
id: "protobase-sign-in-policy";
|
|
2995
|
+
schema: {
|
|
2996
|
+
readonly signInPolicy: {
|
|
2997
|
+
readonly fields: {
|
|
2998
|
+
readonly password: {
|
|
2999
|
+
readonly type: "string";
|
|
3000
|
+
readonly required: true;
|
|
3001
|
+
};
|
|
3002
|
+
readonly emailCode: {
|
|
3003
|
+
readonly type: "string";
|
|
3004
|
+
readonly required: true;
|
|
3005
|
+
};
|
|
3006
|
+
readonly passkey: {
|
|
3007
|
+
readonly type: "string";
|
|
3008
|
+
readonly required: true;
|
|
3009
|
+
};
|
|
3010
|
+
readonly twoFactor: {
|
|
3011
|
+
readonly type: "string";
|
|
3012
|
+
readonly required: true;
|
|
3013
|
+
};
|
|
3014
|
+
readonly staffAccess: {
|
|
3015
|
+
readonly type: "string";
|
|
3016
|
+
readonly required: true;
|
|
3017
|
+
readonly defaultValue: "allowed";
|
|
3018
|
+
};
|
|
3019
|
+
readonly createdAt: {
|
|
3020
|
+
readonly type: "date";
|
|
3021
|
+
readonly required: true;
|
|
3022
|
+
};
|
|
3023
|
+
readonly createdBy: {
|
|
3024
|
+
readonly type: "string";
|
|
3025
|
+
readonly required: false;
|
|
3026
|
+
};
|
|
3027
|
+
};
|
|
3028
|
+
};
|
|
3029
|
+
};
|
|
3030
|
+
endpoints: {
|
|
3031
|
+
getSignInPolicy: import("better-auth").StrictEndpoint<"/policy/sign-in", {
|
|
3032
|
+
method: "GET";
|
|
3033
|
+
use: import("better-auth").Middleware<{
|
|
3034
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
3035
|
+
session: {
|
|
3036
|
+
session: Record<string, any> & {
|
|
3037
|
+
id: string;
|
|
3038
|
+
createdAt: Date;
|
|
3039
|
+
updatedAt: Date;
|
|
3040
|
+
userId: string;
|
|
3041
|
+
expiresAt: Date;
|
|
3042
|
+
token: string;
|
|
3043
|
+
ipAddress?: string | null | undefined;
|
|
3044
|
+
userAgent?: string | null | undefined;
|
|
3045
|
+
};
|
|
3046
|
+
user: Record<string, any> & {
|
|
3047
|
+
id: string;
|
|
3048
|
+
createdAt: Date;
|
|
3049
|
+
updatedAt: Date;
|
|
3050
|
+
email: string;
|
|
3051
|
+
emailVerified: boolean;
|
|
3052
|
+
name: string;
|
|
3053
|
+
image?: string | null | undefined;
|
|
3054
|
+
};
|
|
3055
|
+
};
|
|
3056
|
+
}>>[];
|
|
3057
|
+
}, (inputContext: import("better-auth").MiddlewareInputContext<{
|
|
3058
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
3059
|
+
session: {
|
|
3060
|
+
session: Record<string, any> & {
|
|
3061
|
+
id: string;
|
|
3062
|
+
createdAt: Date;
|
|
3063
|
+
updatedAt: Date;
|
|
3064
|
+
userId: string;
|
|
3065
|
+
expiresAt: Date;
|
|
3066
|
+
token: string;
|
|
3067
|
+
ipAddress?: string | null | undefined;
|
|
3068
|
+
userAgent?: string | null | undefined;
|
|
3069
|
+
};
|
|
3070
|
+
user: Record<string, any> & {
|
|
3071
|
+
id: string;
|
|
3072
|
+
createdAt: Date;
|
|
3073
|
+
updatedAt: Date;
|
|
3074
|
+
email: string;
|
|
3075
|
+
emailVerified: boolean;
|
|
3076
|
+
name: string;
|
|
3077
|
+
image?: string | null | undefined;
|
|
3078
|
+
};
|
|
3079
|
+
};
|
|
3080
|
+
}>>[];
|
|
3081
|
+
}>) => Promise<{
|
|
3082
|
+
session: {
|
|
3083
|
+
session: Record<string, any> & {
|
|
3084
|
+
id: string;
|
|
3085
|
+
createdAt: Date;
|
|
3086
|
+
updatedAt: Date;
|
|
3087
|
+
userId: string;
|
|
3088
|
+
expiresAt: Date;
|
|
3089
|
+
token: string;
|
|
3090
|
+
ipAddress?: string | null | undefined;
|
|
3091
|
+
userAgent?: string | null | undefined;
|
|
3092
|
+
};
|
|
3093
|
+
user: Record<string, any> & {
|
|
3094
|
+
id: string;
|
|
3095
|
+
createdAt: Date;
|
|
3096
|
+
updatedAt: Date;
|
|
3097
|
+
email: string;
|
|
3098
|
+
emailVerified: boolean;
|
|
3099
|
+
name: string;
|
|
3100
|
+
image?: string | null | undefined;
|
|
3101
|
+
};
|
|
3102
|
+
} & {
|
|
3103
|
+
session: {
|
|
3104
|
+
id: string;
|
|
3105
|
+
createdAt: Date;
|
|
3106
|
+
updatedAt: Date;
|
|
3107
|
+
userId: string;
|
|
3108
|
+
expiresAt: Date;
|
|
3109
|
+
token: string;
|
|
3110
|
+
ipAddress?: string | null | undefined;
|
|
3111
|
+
userAgent?: string | null | undefined;
|
|
3112
|
+
} & Record<string, any>;
|
|
3113
|
+
user: {
|
|
3114
|
+
id: string;
|
|
3115
|
+
createdAt: Date;
|
|
3116
|
+
updatedAt: Date;
|
|
3117
|
+
email: string;
|
|
3118
|
+
emailVerified: boolean;
|
|
3119
|
+
name: string;
|
|
3120
|
+
image?: string | null | undefined;
|
|
3121
|
+
} & Record<string, any>;
|
|
3122
|
+
};
|
|
3123
|
+
}>>[];
|
|
3124
|
+
}, {
|
|
3125
|
+
savedBy?: string | undefined;
|
|
3126
|
+
savedAt?: string | undefined;
|
|
3127
|
+
operator?: string | undefined;
|
|
3128
|
+
policy: SignInPolicy;
|
|
3129
|
+
effective: SignInPolicy;
|
|
3130
|
+
mail: boolean;
|
|
3131
|
+
}>;
|
|
3132
|
+
setSignInPolicy: import("better-auth").StrictEndpoint<"/policy/sign-in", {
|
|
3133
|
+
method: "POST";
|
|
3134
|
+
use: import("better-auth").Middleware<{
|
|
3135
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
3136
|
+
session: {
|
|
3137
|
+
session: Record<string, any> & {
|
|
3138
|
+
id: string;
|
|
3139
|
+
createdAt: Date;
|
|
3140
|
+
updatedAt: Date;
|
|
3141
|
+
userId: string;
|
|
3142
|
+
expiresAt: Date;
|
|
3143
|
+
token: string;
|
|
3144
|
+
ipAddress?: string | null | undefined;
|
|
3145
|
+
userAgent?: string | null | undefined;
|
|
3146
|
+
};
|
|
3147
|
+
user: Record<string, any> & {
|
|
3148
|
+
id: string;
|
|
3149
|
+
createdAt: Date;
|
|
3150
|
+
updatedAt: Date;
|
|
3151
|
+
email: string;
|
|
3152
|
+
emailVerified: boolean;
|
|
3153
|
+
name: string;
|
|
3154
|
+
image?: string | null | undefined;
|
|
3155
|
+
};
|
|
3156
|
+
};
|
|
3157
|
+
}>>[];
|
|
3158
|
+
}, (inputContext: import("better-auth").MiddlewareInputContext<{
|
|
3159
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
3160
|
+
session: {
|
|
3161
|
+
session: Record<string, any> & {
|
|
3162
|
+
id: string;
|
|
3163
|
+
createdAt: Date;
|
|
3164
|
+
updatedAt: Date;
|
|
3165
|
+
userId: string;
|
|
3166
|
+
expiresAt: Date;
|
|
3167
|
+
token: string;
|
|
3168
|
+
ipAddress?: string | null | undefined;
|
|
3169
|
+
userAgent?: string | null | undefined;
|
|
3170
|
+
};
|
|
3171
|
+
user: Record<string, any> & {
|
|
3172
|
+
id: string;
|
|
3173
|
+
createdAt: Date;
|
|
3174
|
+
updatedAt: Date;
|
|
3175
|
+
email: string;
|
|
3176
|
+
emailVerified: boolean;
|
|
3177
|
+
name: string;
|
|
3178
|
+
image?: string | null | undefined;
|
|
3179
|
+
};
|
|
3180
|
+
};
|
|
3181
|
+
}>>[];
|
|
3182
|
+
}>) => Promise<{
|
|
3183
|
+
session: {
|
|
3184
|
+
session: Record<string, any> & {
|
|
3185
|
+
id: string;
|
|
3186
|
+
createdAt: Date;
|
|
3187
|
+
updatedAt: Date;
|
|
3188
|
+
userId: string;
|
|
3189
|
+
expiresAt: Date;
|
|
3190
|
+
token: string;
|
|
3191
|
+
ipAddress?: string | null | undefined;
|
|
3192
|
+
userAgent?: string | null | undefined;
|
|
3193
|
+
};
|
|
3194
|
+
user: Record<string, any> & {
|
|
3195
|
+
id: string;
|
|
3196
|
+
createdAt: Date;
|
|
3197
|
+
updatedAt: Date;
|
|
3198
|
+
email: string;
|
|
3199
|
+
emailVerified: boolean;
|
|
3200
|
+
name: string;
|
|
3201
|
+
image?: string | null | undefined;
|
|
3202
|
+
};
|
|
3203
|
+
} & {
|
|
3204
|
+
session: {
|
|
3205
|
+
id: string;
|
|
3206
|
+
createdAt: Date;
|
|
3207
|
+
updatedAt: Date;
|
|
3208
|
+
userId: string;
|
|
3209
|
+
expiresAt: Date;
|
|
3210
|
+
token: string;
|
|
3211
|
+
ipAddress?: string | null | undefined;
|
|
3212
|
+
userAgent?: string | null | undefined;
|
|
3213
|
+
} & Record<string, any>;
|
|
3214
|
+
user: {
|
|
3215
|
+
id: string;
|
|
3216
|
+
createdAt: Date;
|
|
3217
|
+
updatedAt: Date;
|
|
3218
|
+
email: string;
|
|
3219
|
+
emailVerified: boolean;
|
|
3220
|
+
name: string;
|
|
3221
|
+
image?: string | null | undefined;
|
|
3222
|
+
} & Record<string, any>;
|
|
3223
|
+
};
|
|
3224
|
+
}>>[];
|
|
3225
|
+
body: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodUnknown>;
|
|
3226
|
+
}, {
|
|
3227
|
+
savedBy?: string | undefined;
|
|
3228
|
+
savedAt?: string | undefined;
|
|
3229
|
+
operator?: string | undefined;
|
|
3230
|
+
policy: SignInPolicy;
|
|
3231
|
+
effective: SignInPolicy;
|
|
3232
|
+
mail: boolean;
|
|
3233
|
+
}>;
|
|
3234
|
+
getSignInMethods: import("better-auth").StrictEndpoint<"/account/sign-in-methods", {
|
|
3235
|
+
method: "GET";
|
|
3236
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
3237
|
+
session: {
|
|
3238
|
+
session: Record<string, any> & {
|
|
3239
|
+
id: string;
|
|
3240
|
+
createdAt: Date;
|
|
3241
|
+
updatedAt: Date;
|
|
3242
|
+
userId: string;
|
|
3243
|
+
expiresAt: Date;
|
|
3244
|
+
token: string;
|
|
3245
|
+
ipAddress?: string | null | undefined;
|
|
3246
|
+
userAgent?: string | null | undefined;
|
|
3247
|
+
};
|
|
3248
|
+
user: Record<string, any> & {
|
|
3249
|
+
id: string;
|
|
3250
|
+
createdAt: Date;
|
|
3251
|
+
updatedAt: Date;
|
|
3252
|
+
email: string;
|
|
3253
|
+
emailVerified: boolean;
|
|
3254
|
+
name: string;
|
|
3255
|
+
image?: string | null | undefined;
|
|
3256
|
+
};
|
|
3257
|
+
};
|
|
3258
|
+
}>>[];
|
|
3259
|
+
}, {
|
|
3260
|
+
policy: SignInPolicy;
|
|
3261
|
+
mail: boolean;
|
|
3262
|
+
account: {
|
|
3263
|
+
password: boolean;
|
|
3264
|
+
passkeys: number;
|
|
3265
|
+
twoFactor: boolean;
|
|
3266
|
+
authenticatorApp: boolean;
|
|
3267
|
+
};
|
|
3268
|
+
missing: ("passkey" | "twoFactor")[];
|
|
3269
|
+
}>;
|
|
3270
|
+
};
|
|
3271
|
+
hooks: {
|
|
3272
|
+
before: {
|
|
3273
|
+
matcher: (context: import("better-auth").HookEndpointContext) => boolean;
|
|
3274
|
+
handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
|
|
3275
|
+
}[];
|
|
3276
|
+
};
|
|
3277
|
+
}, {
|
|
3278
|
+
id: "protobase-staff-sign-in";
|
|
3279
|
+
schema: {
|
|
3280
|
+
readonly staffSignIn: {
|
|
3281
|
+
readonly fields: {
|
|
3282
|
+
readonly userId: {
|
|
3283
|
+
readonly type: "string";
|
|
3284
|
+
readonly required: true;
|
|
3285
|
+
};
|
|
3286
|
+
readonly userEmail: {
|
|
3287
|
+
readonly type: "string";
|
|
3288
|
+
readonly required: true;
|
|
3289
|
+
};
|
|
3290
|
+
readonly staff: {
|
|
3291
|
+
readonly type: "string";
|
|
3292
|
+
readonly required: true;
|
|
3293
|
+
};
|
|
3294
|
+
readonly staffName: {
|
|
3295
|
+
readonly type: "string";
|
|
3296
|
+
readonly required: false;
|
|
3297
|
+
};
|
|
3298
|
+
readonly staffSubject: {
|
|
3299
|
+
readonly type: "string";
|
|
3300
|
+
readonly required: true;
|
|
3301
|
+
};
|
|
3302
|
+
readonly issuer: {
|
|
3303
|
+
readonly type: "string";
|
|
3304
|
+
readonly required: true;
|
|
3305
|
+
};
|
|
3306
|
+
readonly reason: {
|
|
3307
|
+
readonly type: "string";
|
|
3308
|
+
readonly required: true;
|
|
3309
|
+
};
|
|
3310
|
+
readonly sessionId: {
|
|
3311
|
+
readonly type: "string";
|
|
3312
|
+
readonly required: true;
|
|
3313
|
+
};
|
|
3314
|
+
readonly startedAt: {
|
|
3315
|
+
readonly type: "date";
|
|
3316
|
+
readonly required: true;
|
|
3317
|
+
};
|
|
3318
|
+
readonly expiresAt: {
|
|
3319
|
+
readonly type: "date";
|
|
3320
|
+
readonly required: true;
|
|
3321
|
+
};
|
|
3322
|
+
readonly endedAt: {
|
|
3323
|
+
readonly type: "date";
|
|
3324
|
+
readonly required: false;
|
|
3325
|
+
};
|
|
3326
|
+
};
|
|
3327
|
+
};
|
|
3328
|
+
};
|
|
3329
|
+
endpoints: {
|
|
3330
|
+
getStaffSession: import("better-auth").StrictEndpoint<"/staff/session", {
|
|
3331
|
+
method: "GET";
|
|
3332
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
3333
|
+
session: {
|
|
3334
|
+
session: Record<string, any> & {
|
|
3335
|
+
id: string;
|
|
3336
|
+
createdAt: Date;
|
|
3337
|
+
updatedAt: Date;
|
|
3338
|
+
userId: string;
|
|
3339
|
+
expiresAt: Date;
|
|
3340
|
+
token: string;
|
|
3341
|
+
ipAddress?: string | null | undefined;
|
|
3342
|
+
userAgent?: string | null | undefined;
|
|
3343
|
+
};
|
|
3344
|
+
user: Record<string, any> & {
|
|
3345
|
+
id: string;
|
|
3346
|
+
createdAt: Date;
|
|
3347
|
+
updatedAt: Date;
|
|
3348
|
+
email: string;
|
|
3349
|
+
emailVerified: boolean;
|
|
3350
|
+
name: string;
|
|
3351
|
+
image?: string | null | undefined;
|
|
3352
|
+
};
|
|
3353
|
+
};
|
|
3354
|
+
}>>[];
|
|
3355
|
+
}, {
|
|
3356
|
+
staff: StaffSignIn | null;
|
|
3357
|
+
}>;
|
|
3358
|
+
stopStaffSession: import("better-auth").StrictEndpoint<"/staff/stop", {
|
|
3359
|
+
method: "POST";
|
|
3360
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
3361
|
+
session: {
|
|
3362
|
+
session: Record<string, any> & {
|
|
3363
|
+
id: string;
|
|
3364
|
+
createdAt: Date;
|
|
3365
|
+
updatedAt: Date;
|
|
3366
|
+
userId: string;
|
|
3367
|
+
expiresAt: Date;
|
|
3368
|
+
token: string;
|
|
3369
|
+
ipAddress?: string | null | undefined;
|
|
3370
|
+
userAgent?: string | null | undefined;
|
|
3371
|
+
};
|
|
3372
|
+
user: Record<string, any> & {
|
|
3373
|
+
id: string;
|
|
3374
|
+
createdAt: Date;
|
|
3375
|
+
updatedAt: Date;
|
|
3376
|
+
email: string;
|
|
3377
|
+
emailVerified: boolean;
|
|
3378
|
+
name: string;
|
|
3379
|
+
image?: string | null | undefined;
|
|
3380
|
+
};
|
|
3381
|
+
};
|
|
3382
|
+
}>>[];
|
|
3383
|
+
}, {
|
|
3384
|
+
stopped: boolean;
|
|
3385
|
+
}>;
|
|
3386
|
+
listStaffSignIns: import("better-auth").StrictEndpoint<"/staff/sign-ins", {
|
|
3387
|
+
method: "GET";
|
|
3388
|
+
use: import("better-auth").Middleware<{
|
|
3389
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
3390
|
+
session: {
|
|
3391
|
+
session: Record<string, any> & {
|
|
3392
|
+
id: string;
|
|
3393
|
+
createdAt: Date;
|
|
3394
|
+
updatedAt: Date;
|
|
3395
|
+
userId: string;
|
|
3396
|
+
expiresAt: Date;
|
|
3397
|
+
token: string;
|
|
3398
|
+
ipAddress?: string | null | undefined;
|
|
3399
|
+
userAgent?: string | null | undefined;
|
|
3400
|
+
};
|
|
3401
|
+
user: Record<string, any> & {
|
|
3402
|
+
id: string;
|
|
3403
|
+
createdAt: Date;
|
|
3404
|
+
updatedAt: Date;
|
|
3405
|
+
email: string;
|
|
3406
|
+
emailVerified: boolean;
|
|
3407
|
+
name: string;
|
|
3408
|
+
image?: string | null | undefined;
|
|
3409
|
+
};
|
|
3410
|
+
};
|
|
3411
|
+
}>>[];
|
|
3412
|
+
}, (inputContext: import("better-auth").MiddlewareInputContext<{
|
|
3413
|
+
use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
|
|
3414
|
+
session: {
|
|
3415
|
+
session: Record<string, any> & {
|
|
3416
|
+
id: string;
|
|
3417
|
+
createdAt: Date;
|
|
3418
|
+
updatedAt: Date;
|
|
3419
|
+
userId: string;
|
|
3420
|
+
expiresAt: Date;
|
|
3421
|
+
token: string;
|
|
3422
|
+
ipAddress?: string | null | undefined;
|
|
3423
|
+
userAgent?: string | null | undefined;
|
|
3424
|
+
};
|
|
3425
|
+
user: Record<string, any> & {
|
|
3426
|
+
id: string;
|
|
3427
|
+
createdAt: Date;
|
|
3428
|
+
updatedAt: Date;
|
|
3429
|
+
email: string;
|
|
3430
|
+
emailVerified: boolean;
|
|
3431
|
+
name: string;
|
|
3432
|
+
image?: string | null | undefined;
|
|
3433
|
+
};
|
|
3434
|
+
};
|
|
3435
|
+
}>>[];
|
|
3436
|
+
}>) => Promise<{
|
|
3437
|
+
session: {
|
|
3438
|
+
session: Record<string, any> & {
|
|
3439
|
+
id: string;
|
|
3440
|
+
createdAt: Date;
|
|
3441
|
+
updatedAt: Date;
|
|
3442
|
+
userId: string;
|
|
3443
|
+
expiresAt: Date;
|
|
3444
|
+
token: string;
|
|
3445
|
+
ipAddress?: string | null | undefined;
|
|
3446
|
+
userAgent?: string | null | undefined;
|
|
3447
|
+
};
|
|
3448
|
+
user: Record<string, any> & {
|
|
3449
|
+
id: string;
|
|
3450
|
+
createdAt: Date;
|
|
3451
|
+
updatedAt: Date;
|
|
3452
|
+
email: string;
|
|
3453
|
+
emailVerified: boolean;
|
|
3454
|
+
name: string;
|
|
3455
|
+
image?: string | null | undefined;
|
|
3456
|
+
};
|
|
3457
|
+
} & {
|
|
3458
|
+
session: {
|
|
3459
|
+
id: string;
|
|
3460
|
+
createdAt: Date;
|
|
3461
|
+
updatedAt: Date;
|
|
3462
|
+
userId: string;
|
|
3463
|
+
expiresAt: Date;
|
|
3464
|
+
token: string;
|
|
3465
|
+
ipAddress?: string | null | undefined;
|
|
3466
|
+
userAgent?: string | null | undefined;
|
|
3467
|
+
} & Record<string, any>;
|
|
3468
|
+
user: {
|
|
3469
|
+
id: string;
|
|
3470
|
+
createdAt: Date;
|
|
3471
|
+
updatedAt: Date;
|
|
3472
|
+
email: string;
|
|
3473
|
+
emailVerified: boolean;
|
|
3474
|
+
name: string;
|
|
3475
|
+
image?: string | null | undefined;
|
|
3476
|
+
} & Record<string, any>;
|
|
3477
|
+
};
|
|
3478
|
+
}>>[];
|
|
3479
|
+
}, {
|
|
3480
|
+
signIns: StaffSignIn[];
|
|
3481
|
+
}>;
|
|
3482
|
+
startStaffSignIn?: import("better-auth").StrictEndpoint<"/staff/sign-in", {
|
|
3483
|
+
method: "POST";
|
|
3484
|
+
body: import("zod").ZodObject<{
|
|
3485
|
+
email: import("zod").ZodEmail;
|
|
3486
|
+
reason: import("zod").ZodString;
|
|
3487
|
+
callbackURL: import("zod").ZodString;
|
|
3488
|
+
}, import("zod/v4/core").$strip>;
|
|
3489
|
+
}, {
|
|
3490
|
+
url: string;
|
|
3491
|
+
}> | undefined;
|
|
3492
|
+
staffCallback?: import("better-auth").StrictEndpoint<"/staff/callback", {
|
|
3493
|
+
method: "GET";
|
|
3494
|
+
query: import("zod").ZodObject<{
|
|
3495
|
+
state: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3496
|
+
code: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3497
|
+
}, import("zod/v4/core").$strip>;
|
|
3498
|
+
}, never> | undefined;
|
|
3499
|
+
};
|
|
3500
|
+
hooks: {
|
|
3501
|
+
before: {
|
|
3502
|
+
matcher: (context: import("better-auth").HookEndpointContext) => boolean;
|
|
3503
|
+
handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
|
|
3504
|
+
}[];
|
|
3505
|
+
};
|
|
3506
|
+
}];
|
|
3507
|
+
disabledPaths: string[];
|
|
3508
|
+
databaseHooks: {
|
|
3509
|
+
user: {
|
|
3510
|
+
create: {
|
|
3511
|
+
after?: ((user: import("better-auth").User & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<void>) | undefined;
|
|
3512
|
+
before: (user: {
|
|
3513
|
+
id: string;
|
|
3514
|
+
createdAt: Date;
|
|
3515
|
+
updatedAt: Date;
|
|
3516
|
+
email: string;
|
|
3517
|
+
emailVerified: boolean;
|
|
3518
|
+
name: string;
|
|
3519
|
+
image?: string | null | undefined;
|
|
3520
|
+
} & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null) => Promise<{
|
|
3521
|
+
data: {
|
|
3522
|
+
id: string;
|
|
3523
|
+
createdAt: Date;
|
|
3524
|
+
updatedAt: Date;
|
|
3525
|
+
email: string;
|
|
3526
|
+
emailVerified: boolean;
|
|
3527
|
+
name: string;
|
|
3528
|
+
image?: string | null | undefined;
|
|
3529
|
+
} & Record<string, unknown>;
|
|
3530
|
+
}>;
|
|
3531
|
+
};
|
|
3532
|
+
};
|
|
3533
|
+
};
|
|
3534
|
+
rateLimit: {
|
|
3535
|
+
enabled: true;
|
|
3536
|
+
window: number;
|
|
3537
|
+
max: number;
|
|
3538
|
+
customRules: {
|
|
3539
|
+
'/sign-in/email': {
|
|
3540
|
+
window: number;
|
|
3541
|
+
max: number;
|
|
3542
|
+
};
|
|
3543
|
+
'/staff/sign-in': {
|
|
1220
3544
|
window: number;
|
|
1221
3545
|
max: number;
|
|
1222
3546
|
};
|
|
@@ -1236,6 +3560,7 @@ export declare const createAuth: (options: CreateAuthOptions) => import("better-
|
|
|
1236
3560
|
encryptOAuthTokens: true;
|
|
1237
3561
|
} | undefined;
|
|
1238
3562
|
socialProviders?: import("better-auth").SocialProviders | undefined;
|
|
3563
|
+
appName: string;
|
|
1239
3564
|
database: any;
|
|
1240
3565
|
baseURL: string;
|
|
1241
3566
|
basePath: string;
|
|
@@ -1256,8 +3581,10 @@ export declare const createAuth: (options: CreateAuthOptions) => import("better-
|
|
|
1256
3581
|
}> & {
|
|
1257
3582
|
roles: string[];
|
|
1258
3583
|
defaultRole: string | undefined;
|
|
3584
|
+
mail: boolean;
|
|
1259
3585
|
passwordReset: boolean;
|
|
1260
3586
|
socialProviders: string[];
|
|
3587
|
+
operator: string | undefined;
|
|
1261
3588
|
};
|
|
1262
3589
|
export type AdminAuth = ReturnType<typeof createAuth>;
|
|
1263
3590
|
//#endregion
|