deepspace 0.5.0 → 0.5.2

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/index.d.ts CHANGED
@@ -2,14 +2,15 @@ import * as Y from 'yjs';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import * as React$1 from 'react';
4
4
  import React__default, { ReactNode } from 'react';
5
- import * as node_modules_better_auth_dist_client_path_to_object_mjs from 'node_modules/better-auth/dist/client/path-to-object.mjs';
6
- import * as node_modules_better_auth_dist_client_query_mjs from 'node_modules/better-auth/dist/client/query.mjs';
7
- import * as node_modules_better_auth_dist_plugins_organization_organization_mjs from 'node_modules/better-auth/dist/plugins/organization/organization.mjs';
8
- import * as node_modules_better_auth_dist_plugins_access_types_mjs from 'node_modules/better-auth/dist/plugins/access/types.mjs';
5
+ import * as zod_v4_core from 'zod/v4/core';
6
+ import * as zod from 'zod';
9
7
  import * as better_auth_plugins_two_factor from 'better-auth/plugins/two-factor';
8
+ import * as node_modules_better_auth_dist_client_query_mjs from 'node_modules/better-auth/dist/client/query.mjs';
9
+ import * as better_auth_client_plugins from 'better-auth/client/plugins';
10
10
  import * as better_auth_react from 'better-auth/react';
11
+ import * as node_modules_better_auth_dist_plugins_organization_organization_mjs from 'node_modules/better-auth/dist/plugins/organization/organization.mjs';
11
12
  import * as better_auth from 'better-auth';
12
- import * as better_auth_client_plugins from 'better-auth/client/plugins';
13
+ import * as node_modules_better_auth_dist_plugins_access_types_mjs from 'node_modules/better-auth/dist/plugins/access/types.mjs';
13
14
 
14
15
  /**
15
16
  * Shared type definitions for the DeepSpace SDK
@@ -1343,2559 +1344,343 @@ declare function useAuthUser(): {
1343
1344
  * own /api/auth/* proxy (same-origin cookies, no CORS issues).
1344
1345
  * The app's worker proxies these requests to the auth-worker.
1345
1346
  */
1346
- declare const authClient: {
1347
- useActiveOrganization: () => {
1348
- data: better_auth.Prettify<{
1349
- id: string;
1350
- name: string;
1351
- slug: string;
1352
- createdAt: Date;
1353
- logo?: string | null | undefined | undefined;
1354
- metadata?: any;
1355
- } & {
1356
- members: {
1357
- id: string;
1358
- organizationId: string;
1359
- role: "member" | "admin" | "owner";
1360
- createdAt: Date;
1361
- userId: string;
1362
- user: {
1347
+ declare const authClient: better_auth_react.ReactAuthClient<{
1348
+ baseURL: string;
1349
+ plugins: ({
1350
+ id: "organization";
1351
+ version: string;
1352
+ $InferServerPlugin: node_modules_better_auth_dist_plugins_organization_organization_mjs.OrganizationPlugin<{
1353
+ ac: node_modules_better_auth_dist_plugins_access_types_mjs.AccessControl<{
1354
+ readonly organization: readonly ["update", "delete"];
1355
+ readonly member: readonly ["create", "update", "delete"];
1356
+ readonly invitation: readonly ["create", "cancel"];
1357
+ readonly team: readonly ["create", "update", "delete"];
1358
+ readonly ac: readonly ["create", "read", "update", "delete"];
1359
+ }>;
1360
+ roles: {
1361
+ admin: node_modules_better_auth_dist_plugins_access_types_mjs.Role;
1362
+ member: node_modules_better_auth_dist_plugins_access_types_mjs.Role;
1363
+ owner: node_modules_better_auth_dist_plugins_access_types_mjs.Role;
1364
+ };
1365
+ teams: {
1366
+ enabled: false;
1367
+ };
1368
+ schema: {
1369
+ organization?: {
1370
+ additionalFields?: {
1371
+ [key: string]: better_auth.DBFieldAttribute;
1372
+ };
1373
+ };
1374
+ member?: {
1375
+ additionalFields?: {
1376
+ [key: string]: better_auth.DBFieldAttribute;
1377
+ };
1378
+ };
1379
+ invitation?: {
1380
+ additionalFields?: {
1381
+ [key: string]: better_auth.DBFieldAttribute;
1382
+ };
1383
+ };
1384
+ team?: {
1385
+ additionalFields?: {
1386
+ [key: string]: better_auth.DBFieldAttribute;
1387
+ };
1388
+ };
1389
+ organizationRole?: {
1390
+ additionalFields?: {
1391
+ [key: string]: better_auth.DBFieldAttribute;
1392
+ };
1393
+ };
1394
+ } | undefined;
1395
+ dynamicAccessControl: {
1396
+ enabled: false;
1397
+ };
1398
+ }>;
1399
+ getActions: ($fetch: better_auth_react.BetterFetch, _$store: better_auth.ClientStore, co: better_auth.BetterAuthClientOptions | undefined) => {
1400
+ $Infer: {
1401
+ ActiveOrganization: {
1402
+ members: {
1403
+ id: string;
1404
+ organizationId: string;
1405
+ role: "member" | "admin" | "owner";
1406
+ createdAt: Date;
1407
+ userId: string;
1408
+ user: {
1409
+ id: string;
1410
+ email: string;
1411
+ name: string;
1412
+ image?: string | undefined;
1413
+ };
1414
+ }[];
1415
+ invitations: {
1416
+ id: string;
1417
+ organizationId: string;
1418
+ email: string;
1419
+ role: "member" | "admin" | "owner";
1420
+ status: better_auth_client_plugins.InvitationStatus;
1421
+ inviterId: string;
1422
+ expiresAt: Date;
1423
+ createdAt: Date;
1424
+ }[];
1425
+ } & {
1363
1426
  id: string;
1364
- email: string;
1365
1427
  name: string;
1366
- image?: string | undefined;
1428
+ slug: string;
1429
+ createdAt: Date;
1430
+ logo?: string | null | undefined | undefined;
1431
+ metadata?: any;
1367
1432
  };
1368
- }[];
1369
- invitations: {
1370
- id: string;
1371
- organizationId: string;
1372
- email: string;
1373
- role: "member" | "admin" | "owner";
1374
- status: better_auth_client_plugins.InvitationStatus;
1375
- inviterId: string;
1376
- expiresAt: Date;
1377
- createdAt: Date;
1378
- }[];
1379
- }> | null;
1380
- error: null | better_auth_react.BetterFetchError;
1381
- isPending: boolean;
1382
- isRefetching: boolean;
1383
- refetch: (queryParams?: {
1384
- query?: better_auth.SessionQueryParams;
1385
- } | undefined) => Promise<void>;
1386
- };
1387
- useListOrganizations: () => {
1388
- data: {
1389
- id: string;
1390
- name: string;
1391
- slug: string;
1392
- createdAt: Date;
1393
- logo?: string | null | undefined | undefined;
1394
- metadata?: any;
1395
- }[] | null;
1396
- error: null | better_auth_react.BetterFetchError;
1397
- isPending: boolean;
1398
- isRefetching: boolean;
1399
- refetch: (queryParams?: {
1400
- query?: better_auth.SessionQueryParams;
1401
- } | undefined) => Promise<void>;
1402
- };
1403
- useActiveMember: () => {
1404
- data: {
1405
- id: string;
1406
- organizationId: string;
1407
- userId: string;
1408
- role: string;
1409
- createdAt: Date;
1410
- } | null;
1411
- error: null | better_auth_react.BetterFetchError;
1412
- isPending: boolean;
1413
- isRefetching: boolean;
1414
- refetch: (queryParams?: {
1415
- query?: better_auth.SessionQueryParams;
1416
- } | undefined) => Promise<void>;
1417
- };
1418
- useActiveMemberRole: () => {
1419
- data: {
1420
- role: string;
1421
- } | null;
1422
- error: null | better_auth_react.BetterFetchError;
1423
- isPending: boolean;
1424
- isRefetching: boolean;
1425
- refetch: (queryParams?: {
1426
- query?: better_auth.SessionQueryParams;
1427
- } | undefined) => Promise<void>;
1428
- };
1429
- } & {
1430
- organization: {
1431
- create: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1432
- name: string;
1433
- slug: string;
1434
- userId?: string | undefined;
1435
- logo?: string | undefined;
1436
- metadata?: Record<string, any> | undefined;
1437
- keepCurrentActiveOrganization?: boolean | undefined;
1438
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1439
- name: string;
1440
- slug: string;
1441
- userId?: string | undefined;
1442
- logo?: string | undefined;
1443
- metadata?: Record<string, any> | undefined;
1444
- keepCurrentActiveOrganization?: boolean | undefined;
1445
- } & {
1446
- fetchOptions?: FetchOptions | undefined;
1447
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<NonNullable<{
1448
- id: string;
1449
- name: string;
1450
- slug: string;
1451
- createdAt: Date;
1452
- logo?: string | null | undefined | undefined;
1453
- metadata?: any;
1454
- } & {
1455
- metadata: any;
1456
- members: ({
1457
- id: string;
1458
- organizationId: string;
1459
- userId: string;
1460
- role: string;
1461
- createdAt: Date;
1462
- } | undefined)[];
1463
- }>, {
1464
- code?: string | undefined;
1465
- message?: string | undefined;
1466
- }, FetchOptions["throw"] extends true ? true : false>>;
1467
- };
1468
- } & {
1469
- organization: {
1470
- update: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1471
- data: {
1472
- name?: string | undefined;
1473
- slug?: string | undefined;
1474
- logo?: string | undefined;
1475
- metadata?: Record<string, any> | undefined;
1476
- } & Partial<{}>;
1477
- organizationId?: string | undefined;
1478
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1479
- data: {
1480
- name?: string | undefined;
1481
- slug?: string | undefined;
1482
- logo?: string | undefined;
1483
- metadata?: Record<string, any> | undefined;
1484
- } & Partial<{}>;
1485
- organizationId?: string | undefined;
1486
- } & {
1487
- fetchOptions?: FetchOptions | undefined;
1488
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1489
- id: string;
1490
- name: string;
1491
- slug: string;
1492
- createdAt: Date;
1493
- logo?: string | null | undefined | undefined;
1494
- metadata?: any;
1495
- }, {
1496
- code?: string | undefined;
1497
- message?: string | undefined;
1498
- }, FetchOptions["throw"] extends true ? true : false>>;
1499
- };
1500
- } & {
1501
- organization: {
1502
- delete: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1503
- organizationId: string;
1504
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1505
- organizationId: string;
1506
- } & {
1507
- fetchOptions?: FetchOptions | undefined;
1508
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1509
- id: string;
1510
- name: string;
1511
- slug: string;
1512
- createdAt: Date;
1513
- logo?: string | null | undefined | undefined;
1514
- metadata?: any;
1515
- }, {
1516
- code?: string | undefined;
1517
- message?: string | undefined;
1518
- }, FetchOptions["throw"] extends true ? true : false>>;
1519
- };
1520
- } & {
1521
- organization: {
1522
- setActive: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1523
- organizationId?: string | null | undefined;
1524
- organizationSlug?: string | undefined;
1525
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1526
- organizationId?: string | null | undefined;
1527
- organizationSlug?: string | undefined;
1528
- } & {
1529
- fetchOptions?: FetchOptions | undefined;
1530
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1531
- members: {
1532
- id: string;
1533
- organizationId: string;
1534
- role: "member" | "admin" | "owner";
1535
- createdAt: Date;
1536
- userId: string;
1537
- user: {
1433
+ Organization: {
1538
1434
  id: string;
1539
- email: string;
1540
1435
  name: string;
1541
- image?: string | undefined;
1436
+ slug: string;
1437
+ createdAt: Date;
1438
+ logo?: string | null | undefined;
1439
+ metadata?: any;
1542
1440
  };
1543
- }[];
1544
- invitations: {
1545
- id: string;
1546
- organizationId: string;
1547
- email: string;
1548
- role: "member" | "admin" | "owner";
1549
- status: better_auth_client_plugins.InvitationStatus;
1550
- inviterId: string;
1551
- expiresAt: Date;
1552
- createdAt: Date;
1553
- }[];
1554
- } & {
1555
- id: string;
1556
- name: string;
1557
- slug: string;
1558
- createdAt: Date;
1559
- logo?: string | null | undefined | undefined;
1560
- metadata?: any;
1561
- }, {
1562
- code?: string | undefined;
1563
- message?: string | undefined;
1564
- }, FetchOptions["throw"] extends true ? true : false>>;
1565
- };
1566
- } & {
1567
- organization: {
1568
- getFullOrganization: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1569
- organizationId?: string | undefined;
1570
- organizationSlug?: string | undefined;
1571
- membersLimit?: string | number | undefined;
1572
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1573
- query?: {
1574
- organizationId?: string | undefined;
1575
- organizationSlug?: string | undefined;
1576
- membersLimit?: string | number | undefined;
1577
- } | undefined;
1578
- fetchOptions?: FetchOptions | undefined;
1579
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1580
- members: {
1581
- id: string;
1582
- organizationId: string;
1583
- role: "member" | "admin" | "owner";
1584
- createdAt: Date;
1585
- userId: string;
1586
- user: {
1441
+ Invitation: {
1587
1442
  id: string;
1443
+ organizationId: string;
1588
1444
  email: string;
1445
+ role: "member" | "admin" | "owner";
1446
+ status: better_auth_client_plugins.InvitationStatus;
1447
+ inviterId: string;
1448
+ expiresAt: Date;
1449
+ createdAt: Date;
1450
+ };
1451
+ Member: {
1452
+ id: string;
1453
+ organizationId: string;
1454
+ role: "member" | "admin" | "owner";
1455
+ createdAt: Date;
1456
+ userId: string;
1457
+ user: {
1458
+ id: string;
1459
+ email: string;
1460
+ name: string;
1461
+ image?: string | undefined;
1462
+ };
1463
+ };
1464
+ Team: {
1465
+ id: string;
1589
1466
  name: string;
1590
- image?: string | undefined;
1467
+ organizationId: string;
1468
+ createdAt: Date;
1469
+ updatedAt?: Date | undefined;
1591
1470
  };
1592
- }[];
1593
- invitations: {
1471
+ };
1472
+ organization: {
1473
+ checkRolePermission: <R extends "member" | "admin" | "owner">(data: {
1474
+ permissions: {
1475
+ readonly organization?: ("update" | "delete")[] | undefined;
1476
+ readonly member?: ("update" | "create" | "delete")[] | undefined;
1477
+ readonly invitation?: ("create" | "cancel")[] | undefined;
1478
+ readonly team?: ("update" | "create" | "delete")[] | undefined;
1479
+ readonly ac?: ("update" | "create" | "delete" | "read")[] | undefined;
1480
+ };
1481
+ } & {
1482
+ role: R;
1483
+ }) => boolean;
1484
+ };
1485
+ };
1486
+ getAtoms: ($fetch: better_auth_react.BetterFetch) => {
1487
+ $listOrg: better_auth_react.PreinitializedWritableAtom<boolean> & object;
1488
+ $activeOrgSignal: better_auth_react.PreinitializedWritableAtom<boolean> & object;
1489
+ $activeMemberSignal: better_auth_react.PreinitializedWritableAtom<boolean> & object;
1490
+ $activeMemberRoleSignal: better_auth_react.PreinitializedWritableAtom<boolean> & object;
1491
+ activeOrganization: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<better_auth.Prettify<{
1594
1492
  id: string;
1595
- organizationId: string;
1596
- email: string;
1597
- role: "member" | "admin" | "owner";
1598
- status: better_auth_client_plugins.InvitationStatus;
1599
- inviterId: string;
1600
- expiresAt: Date;
1493
+ name: string;
1494
+ slug: string;
1601
1495
  createdAt: Date;
1602
- }[];
1603
- } & {
1604
- id: string;
1605
- name: string;
1606
- slug: string;
1607
- createdAt: Date;
1608
- logo?: string | null | undefined | undefined;
1609
- metadata?: any;
1610
- }, {
1611
- code?: string | undefined;
1612
- message?: string | undefined;
1613
- }, FetchOptions["throw"] extends true ? true : false>>;
1614
- };
1615
- } & {
1616
- organization: {
1617
- list: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1618
- query?: Record<string, any> | undefined;
1619
- fetchOptions?: FetchOptions | undefined;
1620
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1621
- id: string;
1622
- name: string;
1623
- slug: string;
1624
- createdAt: Date;
1625
- logo?: string | null | undefined | undefined;
1626
- metadata?: any;
1627
- }[], {
1628
- code?: string | undefined;
1629
- message?: string | undefined;
1630
- }, FetchOptions["throw"] extends true ? true : false>>;
1631
- };
1632
- } & {
1633
- organization: {
1634
- inviteMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1635
- email: string;
1636
- role: "member" | "admin" | "owner" | ("member" | "admin" | "owner")[];
1637
- organizationId?: string | undefined;
1638
- resend?: boolean | undefined;
1639
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1640
- email: string;
1641
- role: "member" | "admin" | "owner" | ("member" | "admin" | "owner")[];
1642
- organizationId?: string | undefined;
1643
- resend?: boolean | undefined;
1644
- } & {
1645
- fetchOptions?: FetchOptions | undefined;
1646
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<NonNullable<{
1647
- id: string;
1648
- organizationId: string;
1649
- email: string;
1650
- role: "member" | "admin" | "owner";
1651
- status: better_auth_client_plugins.InvitationStatus;
1652
- inviterId: string;
1653
- expiresAt: Date;
1654
- createdAt: Date;
1655
- } | {
1656
- id: string;
1657
- organizationId: string;
1658
- email: string;
1659
- role: "member" | "admin" | "owner";
1660
- status: better_auth_client_plugins.InvitationStatus;
1661
- inviterId: string;
1662
- expiresAt: Date;
1663
- createdAt: Date;
1664
- }>, {
1665
- code?: string | undefined;
1666
- message?: string | undefined;
1667
- }, FetchOptions["throw"] extends true ? true : false>>;
1668
- };
1669
- } & {
1670
- organization: {
1671
- cancelInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1672
- invitationId: string;
1673
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1674
- invitationId: string;
1675
- } & {
1676
- fetchOptions?: FetchOptions | undefined;
1677
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1678
- id: string;
1679
- organizationId: string;
1680
- email: string;
1681
- role: "member" | "admin" | "owner";
1682
- status: better_auth_client_plugins.InvitationStatus;
1683
- inviterId: string;
1684
- expiresAt: Date;
1685
- createdAt: Date;
1686
- }, {
1687
- code?: string | undefined;
1688
- message?: string | undefined;
1689
- }, FetchOptions["throw"] extends true ? true : false>>;
1690
- };
1691
- } & {
1692
- organization: {
1693
- acceptInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1694
- invitationId: string;
1695
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1696
- invitationId: string;
1697
- } & {
1698
- fetchOptions?: FetchOptions | undefined;
1699
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1700
- invitation: {
1496
+ logo?: string | null | undefined | undefined;
1497
+ metadata?: any;
1498
+ } & {
1499
+ members: {
1500
+ id: string;
1501
+ organizationId: string;
1502
+ role: "member" | "admin" | "owner";
1503
+ createdAt: Date;
1504
+ userId: string;
1505
+ user: {
1506
+ id: string;
1507
+ email: string;
1508
+ name: string;
1509
+ image?: string | undefined;
1510
+ };
1511
+ }[];
1512
+ invitations: {
1513
+ id: string;
1514
+ organizationId: string;
1515
+ email: string;
1516
+ role: "member" | "admin" | "owner";
1517
+ status: better_auth_client_plugins.InvitationStatus;
1518
+ inviterId: string;
1519
+ expiresAt: Date;
1520
+ createdAt: Date;
1521
+ }[];
1522
+ }>>;
1523
+ listOrganizations: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<{
1701
1524
  id: string;
1702
- organizationId: string;
1703
- email: string;
1704
- role: "member" | "admin" | "owner";
1705
- status: better_auth_client_plugins.InvitationStatus;
1706
- inviterId: string;
1707
- expiresAt: Date;
1525
+ name: string;
1526
+ slug: string;
1708
1527
  createdAt: Date;
1709
- };
1710
- member: {
1528
+ logo?: string | null | undefined | undefined;
1529
+ metadata?: any;
1530
+ }[]>;
1531
+ activeMember: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<{
1711
1532
  id: string;
1712
1533
  organizationId: string;
1713
1534
  userId: string;
1714
1535
  role: string;
1715
1536
  createdAt: Date;
1716
- };
1717
- }, {
1718
- code?: string | undefined;
1719
- message?: string | undefined;
1720
- }, FetchOptions["throw"] extends true ? true : false>>;
1721
- };
1722
- } & {
1723
- organization: {
1724
- getInvitation: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1725
- id: string;
1726
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1727
- query: {
1728
- id: string;
1729
- };
1730
- fetchOptions?: FetchOptions | undefined;
1731
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<NonNullable<{
1732
- id: string;
1733
- organizationId: string;
1734
- email: string;
1735
- role: "member" | "admin" | "owner";
1736
- status: better_auth_client_plugins.InvitationStatus;
1737
- inviterId: string;
1738
- expiresAt: Date;
1739
- createdAt: Date;
1740
- } & {
1741
- organizationName: string;
1742
- organizationSlug: string;
1743
- inviterEmail: string;
1744
- }>, {
1745
- code?: string | undefined;
1746
- message?: string | undefined;
1747
- }, FetchOptions["throw"] extends true ? true : false>>;
1748
- };
1749
- } & {
1750
- organization: {
1751
- rejectInvitation: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1752
- invitationId: string;
1753
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1754
- invitationId: string;
1755
- } & {
1756
- fetchOptions?: FetchOptions | undefined;
1757
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1758
- invitation: {
1759
- id: string;
1760
- organizationId: string;
1761
- email: string;
1762
- role: "admin" | "member" | "owner";
1763
- status: better_auth_client_plugins.InvitationStatus;
1764
- inviterId: string;
1765
- expiresAt: Date;
1766
- createdAt: Date;
1767
- } | null;
1768
- member: null;
1769
- }, {
1770
- code?: string | undefined;
1771
- message?: string | undefined;
1772
- }, FetchOptions["throw"] extends true ? true : false>>;
1773
- };
1774
- } & {
1775
- organization: {
1776
- listInvitations: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1777
- organizationId?: string | undefined;
1778
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1779
- query?: {
1780
- organizationId?: string | undefined;
1781
- } | undefined;
1782
- fetchOptions?: FetchOptions | undefined;
1783
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1784
- id: string;
1785
- organizationId: string;
1786
- email: string;
1787
- role: "member" | "admin" | "owner";
1788
- status: better_auth_client_plugins.InvitationStatus;
1789
- inviterId: string;
1790
- expiresAt: Date;
1791
- createdAt: Date;
1792
- }[], {
1793
- code?: string | undefined;
1794
- message?: string | undefined;
1795
- }, FetchOptions["throw"] extends true ? true : false>>;
1796
- };
1797
- } & {
1798
- organization: {
1799
- getActiveMember: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1800
- query?: Record<string, any> | undefined;
1801
- fetchOptions?: FetchOptions | undefined;
1802
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<NonNullable<Omit<{
1803
- id: string;
1804
- organizationId: string;
1805
- role: "member" | "admin" | "owner";
1806
- createdAt: Date;
1807
- userId: string;
1808
- user: {
1809
- id: string;
1810
- email: string;
1811
- name: string;
1812
- image?: string | undefined;
1813
- };
1814
- } & {
1815
- user: {
1816
- id: string;
1817
- createdAt: Date;
1818
- updatedAt: Date;
1819
- email: string;
1820
- emailVerified: boolean;
1821
- name: string;
1822
- image?: string | null | undefined;
1823
- };
1824
- }, "user"> & {
1825
- user: {
1826
- id: string;
1827
- name: string;
1828
- email: string;
1829
- image: string | undefined;
1830
- };
1831
- }>, {
1832
- code?: string | undefined;
1833
- message?: string | undefined;
1834
- }, FetchOptions["throw"] extends true ? true : false>>;
1835
- };
1836
- } & {
1837
- organization: {
1838
- checkSlug: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1839
- slug: string;
1840
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1841
- slug: string;
1842
- } & {
1843
- fetchOptions?: FetchOptions | undefined;
1844
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1845
- status: boolean;
1846
- }, {
1847
- code?: string | undefined;
1848
- message?: string | undefined;
1849
- }, FetchOptions["throw"] extends true ? true : false>>;
1850
- };
1851
- } & {
1852
- organization: {
1853
- removeMember: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1854
- memberIdOrEmail: string;
1855
- organizationId?: string | undefined;
1856
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1857
- memberIdOrEmail: string;
1858
- organizationId?: string | undefined;
1859
- } & {
1860
- fetchOptions?: FetchOptions | undefined;
1861
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1862
- member: {
1863
- id: string;
1864
- organizationId: string;
1865
- role: "member" | "admin" | "owner";
1866
- createdAt: Date;
1867
- userId: string;
1868
- user: {
1869
- id: string;
1870
- email: string;
1871
- name: string;
1872
- image?: string | undefined;
1873
- };
1874
- };
1875
- }, {
1876
- code?: string | undefined;
1877
- message?: string | undefined;
1878
- }, FetchOptions["throw"] extends true ? true : false>>;
1879
- };
1880
- } & {
1881
- organization: {
1882
- updateMemberRole: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1883
- role: "member" | "admin" | better_auth.LiteralString | better_auth.LiteralString[] | "owner" | ("member" | "admin" | "owner")[];
1884
- memberId: string;
1885
- organizationId?: string | undefined;
1886
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1887
- role: "member" | "admin" | better_auth.LiteralString | better_auth.LiteralString[] | "owner" | ("member" | "admin" | "owner")[];
1888
- memberId: string;
1889
- organizationId?: string | undefined;
1890
- } & {
1891
- fetchOptions?: FetchOptions | undefined;
1892
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
1893
- id: string;
1894
- organizationId: string;
1895
- role: "admin" | "member" | "owner";
1896
- createdAt: Date;
1897
- userId: string;
1898
- user: {
1899
- id: string;
1900
- email: string;
1901
- name: string;
1902
- image?: string | undefined;
1903
- };
1904
- }, {
1905
- code?: string | undefined;
1906
- message?: string | undefined;
1907
- }, FetchOptions["throw"] extends true ? true : false>>;
1908
- };
1909
- } & {
1910
- organization: {
1911
- leave: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
1912
- organizationId: string;
1913
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
1914
- organizationId: string;
1915
- } & {
1916
- fetchOptions?: FetchOptions | undefined;
1917
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<NonNullable<Omit<{
1918
- id: string;
1919
- organizationId: string;
1920
- role: "member" | "admin" | "owner";
1921
- createdAt: Date;
1922
- userId: string;
1923
- user: {
1924
- id: string;
1925
- email: string;
1926
- name: string;
1927
- image?: string | undefined;
1928
- };
1929
- } & {
1930
- user: {
1931
- id: string;
1932
- createdAt: Date;
1933
- updatedAt: Date;
1934
- email: string;
1935
- emailVerified: boolean;
1936
- name: string;
1937
- image?: string | null | undefined;
1938
- };
1939
- }, "user"> & {
1940
- user: {
1941
- id: string;
1942
- name: string;
1943
- email: string;
1944
- image: string | undefined;
1945
- };
1946
- }>, {
1947
- code?: string | undefined;
1948
- message?: string | undefined;
1949
- }, FetchOptions["throw"] extends true ? true : false>>;
1950
- };
1951
- } & {
1952
- organization: {
1953
- listUserInvitations: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1954
- email?: string | undefined;
1955
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1956
- query?: {
1957
- email?: string | undefined;
1958
- } | undefined;
1959
- fetchOptions?: FetchOptions | undefined;
1960
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<(Omit<{
1961
- id: string;
1962
- organizationId: string;
1963
- email: string;
1964
- role: "member" | "admin" | "owner";
1965
- status: better_auth_client_plugins.InvitationStatus;
1966
- inviterId: string;
1967
- expiresAt: Date;
1968
- createdAt: Date;
1969
- } & {
1970
- organization: {
1971
- id: string;
1972
- name: string;
1973
- slug: string;
1974
- createdAt: Date;
1975
- logo?: string | null | undefined | undefined;
1976
- metadata?: any;
1977
- };
1978
- }, "organization"> & {
1979
- organizationName: string;
1980
- })[], {
1981
- code?: string | undefined;
1982
- message?: string | undefined;
1983
- }, FetchOptions["throw"] extends true ? true : false>>;
1984
- };
1985
- } & {
1986
- organization: {
1987
- listMembers: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
1988
- limit?: string | number | undefined;
1989
- offset?: string | number | undefined;
1990
- sortBy?: string | undefined;
1991
- sortDirection?: "asc" | "desc" | undefined;
1992
- filterField?: string | undefined;
1993
- filterValue?: string | number | boolean | string[] | number[] | undefined;
1994
- filterOperator?: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
1995
- organizationId?: string | undefined;
1996
- organizationSlug?: string | undefined;
1997
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
1998
- query?: {
1999
- limit?: string | number | undefined;
2000
- offset?: string | number | undefined;
2001
- sortBy?: string | undefined;
2002
- sortDirection?: "asc" | "desc" | undefined;
2003
- filterField?: string | undefined;
2004
- filterValue?: string | number | boolean | string[] | number[] | undefined;
2005
- filterOperator?: "eq" | "ne" | "gt" | "gte" | "lt" | "lte" | "in" | "not_in" | "contains" | "starts_with" | "ends_with" | undefined;
2006
- organizationId?: string | undefined;
2007
- organizationSlug?: string | undefined;
2008
- } | undefined;
2009
- fetchOptions?: FetchOptions | undefined;
2010
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
2011
- members: ({
2012
- id: string;
2013
- organizationId: string;
2014
- role: "member" | "admin" | "owner";
2015
- createdAt: Date;
2016
- userId: string;
2017
- user: {
2018
- id: string;
2019
- email: string;
2020
- name: string;
2021
- image?: string | undefined;
2022
- };
2023
- } & {
2024
- user: {
2025
- id: string;
2026
- name: string;
2027
- email: string;
2028
- image: string | null | undefined;
2029
- };
2030
- })[];
2031
- total: number;
2032
- }, {
2033
- code?: string | undefined;
2034
- message?: string | undefined;
2035
- }, FetchOptions["throw"] extends true ? true : false>>;
2036
- };
2037
- } & {
2038
- organization: {
2039
- getActiveMemberRole: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
2040
- userId?: string | undefined;
2041
- organizationId?: string | undefined;
2042
- organizationSlug?: string | undefined;
2043
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2044
- query?: {
2045
- userId?: string | undefined;
2046
- organizationId?: string | undefined;
2047
- organizationSlug?: string | undefined;
2048
- } | undefined;
2049
- fetchOptions?: FetchOptions | undefined;
2050
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
2051
- role: "member" | "admin" | "owner";
2052
- }, {
2053
- code?: string | undefined;
2054
- message?: string | undefined;
2055
- }, FetchOptions["throw"] extends true ? true : false>>;
2056
- };
2057
- } & {
2058
- organization: {
2059
- hasPermission: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2060
- permissions: {
2061
- readonly organization?: ("update" | "delete")[] | undefined;
2062
- readonly member?: ("update" | "create" | "delete")[] | undefined;
2063
- readonly invitation?: ("create" | "cancel")[] | undefined;
2064
- readonly team?: ("update" | "create" | "delete")[] | undefined;
2065
- readonly ac?: ("update" | "create" | "delete" | "read")[] | undefined;
2066
- };
2067
- } & {
2068
- organizationId?: string | undefined;
2069
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2070
- permissions: {
2071
- readonly organization?: ("update" | "delete")[] | undefined;
2072
- readonly member?: ("update" | "create" | "delete")[] | undefined;
2073
- readonly invitation?: ("create" | "cancel")[] | undefined;
2074
- readonly team?: ("update" | "create" | "delete")[] | undefined;
2075
- readonly ac?: ("update" | "create" | "delete" | "read")[] | undefined;
2076
- };
2077
- } & {
2078
- organizationId?: string | undefined;
2079
- } & {
2080
- fetchOptions?: FetchOptions | undefined;
2081
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
2082
- error: null;
2083
- success: boolean;
2084
- }, {
2085
- code?: string | undefined;
2086
- message?: string | undefined;
2087
- }, FetchOptions["throw"] extends true ? true : false>>;
2088
- };
2089
- } & {
2090
- twoFactor: {
2091
- enable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2092
- password: string;
2093
- issuer?: string | undefined;
2094
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2095
- password: string;
2096
- issuer?: string | undefined;
2097
- } & {
2098
- fetchOptions?: FetchOptions | undefined;
2099
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
2100
- totpURI: string;
2101
- backupCodes: string[];
2102
- }, {
2103
- code?: string | undefined;
2104
- message?: string | undefined;
2105
- }, FetchOptions["throw"] extends true ? true : false>>;
2106
- };
2107
- } & {
2108
- twoFactor: {
2109
- disable: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2110
- password: string;
2111
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2112
- password: string;
2113
- } & {
2114
- fetchOptions?: FetchOptions | undefined;
2115
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
2116
- status: boolean;
2117
- }, {
2118
- code?: string | undefined;
2119
- message?: string | undefined;
2120
- }, FetchOptions["throw"] extends true ? true : false>>;
2121
- };
2122
- } & {
2123
- twoFactor: {
2124
- verifyBackupCode: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2125
- code: string;
2126
- disableSession?: boolean | undefined;
2127
- trustDevice?: boolean | undefined;
2128
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2129
- code: string;
2130
- disableSession?: boolean | undefined;
2131
- trustDevice?: boolean | undefined;
2132
- } & {
2133
- fetchOptions?: FetchOptions | undefined;
2134
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<Omit<{
2135
- token: string | undefined;
2136
- user: (Record<string, any> & {
2137
- id: string;
2138
- createdAt: Date;
2139
- updatedAt: Date;
2140
- email: string;
2141
- emailVerified: boolean;
2142
- name: string;
2143
- image?: string | null | undefined;
2144
- }) | better_auth_plugins_two_factor.UserWithTwoFactor;
2145
- }, "user"> & {
2146
- user: better_auth.StripEmptyObjects<{
2147
- id: string;
2148
- createdAt: Date;
2149
- updatedAt: Date;
2150
- email: string;
2151
- emailVerified: boolean;
2152
- name: string;
2153
- image?: string | null | undefined;
2154
- } & {
2155
- twoFactorEnabled: boolean | null | undefined;
2156
- } & {}>;
2157
- }, {
2158
- code?: string | undefined;
2159
- message?: string | undefined;
2160
- }, FetchOptions["throw"] extends true ? true : false>>;
2161
- };
2162
- } & {
2163
- twoFactor: {
2164
- generateBackupCodes: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2165
- password: string;
2166
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2167
- password: string;
2168
- } & {
2169
- fetchOptions?: FetchOptions | undefined;
2170
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
2171
- status: boolean;
2172
- backupCodes: string[];
2173
- }, {
2174
- code?: string | undefined;
2175
- message?: string | undefined;
2176
- }, FetchOptions["throw"] extends true ? true : false>>;
2177
- };
2178
- } & {
2179
- twoFactor: {
2180
- sendOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2181
- trustDevice?: boolean | undefined;
2182
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2183
- query?: Record<string, any> | undefined;
2184
- fetchOptions?: FetchOptions | undefined;
2185
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
2186
- status: boolean;
2187
- }, {
2188
- code?: string | undefined;
2189
- message?: string | undefined;
2190
- }, FetchOptions["throw"] extends true ? true : false>>;
2191
- };
2192
- } & {
2193
- twoFactor: {
2194
- verifyOtp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2195
- code: string;
2196
- trustDevice?: boolean | undefined;
2197
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2198
- code: string;
2199
- trustDevice?: boolean | undefined;
2200
- } & {
2201
- fetchOptions?: FetchOptions | undefined;
2202
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<(Omit<{
2203
- token: string;
2204
- user: better_auth_plugins_two_factor.UserWithTwoFactor;
2205
- }, "user"> & {
2206
- user: better_auth.StripEmptyObjects<{
2207
- id: string;
2208
- createdAt: Date;
2209
- updatedAt: Date;
2210
- email: string;
2211
- emailVerified: boolean;
2212
- name: string;
2213
- image?: string | null | undefined;
2214
- } & {
2215
- twoFactorEnabled: boolean | null | undefined;
2216
- } & {}>;
2217
- }) | (Omit<{
2218
- token: string;
2219
- user: Record<string, any> & {
2220
- id: string;
2221
- createdAt: Date;
2222
- updatedAt: Date;
2223
- email: string;
2224
- emailVerified: boolean;
2225
- name: string;
2226
- image?: string | null | undefined;
2227
- };
2228
- }, "user"> & {
2229
- user: better_auth.StripEmptyObjects<{
2230
- id: string;
2231
- createdAt: Date;
2232
- updatedAt: Date;
2233
- email: string;
2234
- emailVerified: boolean;
2235
- name: string;
2236
- image?: string | null | undefined;
2237
- } & {
2238
- twoFactorEnabled: boolean | null | undefined;
2239
- } & {}>;
2240
- }), {
2241
- code?: string | undefined;
2242
- message?: string | undefined;
2243
- }, FetchOptions["throw"] extends true ? true : false>>;
2244
- };
2245
- } & {
2246
- twoFactor: {
2247
- getTotpUri: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2248
- password: string;
2249
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2250
- password: string;
2251
- } & {
2252
- fetchOptions?: FetchOptions | undefined;
2253
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
2254
- totpURI: string;
2255
- }, {
2256
- code?: string | undefined;
2257
- message?: string | undefined;
2258
- }, FetchOptions["throw"] extends true ? true : false>>;
2259
- };
2260
- } & {
2261
- twoFactor: {
2262
- verifyTotp: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2263
- code: string;
2264
- trustDevice?: boolean | undefined;
2265
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2266
- code: string;
2267
- trustDevice?: boolean | undefined;
2268
- } & {
2269
- fetchOptions?: FetchOptions | undefined;
2270
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<(Omit<{
2271
- token: string;
2272
- user: better_auth_plugins_two_factor.UserWithTwoFactor;
2273
- }, "user"> & {
2274
- user: better_auth.StripEmptyObjects<{
2275
- id: string;
2276
- createdAt: Date;
2277
- updatedAt: Date;
2278
- email: string;
2279
- emailVerified: boolean;
2280
- name: string;
2281
- image?: string | null | undefined;
2282
- } & {
2283
- twoFactorEnabled: boolean | null | undefined;
2284
- } & {}>;
2285
- }) | (Omit<{
2286
- token: string;
2287
- user: Record<string, any> & {
2288
- id: string;
2289
- createdAt: Date;
2290
- updatedAt: Date;
2291
- email: string;
2292
- emailVerified: boolean;
2293
- name: string;
2294
- image?: string | null | undefined;
2295
- };
2296
- }, "user"> & {
2297
- user: better_auth.StripEmptyObjects<{
2298
- id: string;
2299
- createdAt: Date;
2300
- updatedAt: Date;
2301
- email: string;
2302
- emailVerified: boolean;
2303
- name: string;
2304
- image?: string | null | undefined;
2305
- } & {
2306
- twoFactorEnabled: boolean | null | undefined;
2307
- } & {}>;
2308
- }), {
2309
- code?: string | undefined;
2310
- message?: string | undefined;
2311
- }, FetchOptions["throw"] extends true ? true : false>>;
2312
- };
2313
- } & {
2314
- signIn: {
2315
- social: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2316
- provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
2317
- callbackURL?: string | undefined;
2318
- newUserCallbackURL?: string | undefined;
2319
- errorCallbackURL?: string | undefined;
2320
- disableRedirect?: boolean | undefined;
2321
- idToken?: {
2322
- token: string;
2323
- nonce?: string | undefined;
2324
- accessToken?: string | undefined;
2325
- refreshToken?: string | undefined;
2326
- expiresAt?: number | undefined;
2327
- user?: {
2328
- name?: {
2329
- firstName?: string | undefined;
2330
- lastName?: string | undefined;
2331
- } | undefined;
2332
- email?: string | undefined;
2333
- } | undefined;
2334
- } | undefined;
2335
- scopes?: string[] | undefined;
2336
- requestSignUp?: boolean | undefined;
2337
- loginHint?: string | undefined;
2338
- additionalData?: Record<string, any> | undefined;
2339
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
2340
- provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
2341
- callbackURL?: string | undefined;
2342
- newUserCallbackURL?: string | undefined;
2343
- errorCallbackURL?: string | undefined;
2344
- disableRedirect?: boolean | undefined;
2345
- idToken?: {
2346
- token: string;
2347
- nonce?: string | undefined;
2348
- accessToken?: string | undefined;
2349
- refreshToken?: string | undefined;
2350
- expiresAt?: number | undefined;
2351
- user?: {
2352
- name?: {
2353
- firstName?: string | undefined;
2354
- lastName?: string | undefined;
2355
- } | undefined;
2356
- email?: string | undefined;
2357
- } | undefined;
2358
- } | undefined;
2359
- scopes?: string[] | undefined;
2360
- requestSignUp?: boolean | undefined;
2361
- loginHint?: string | undefined;
2362
- additionalData?: Record<string, any> | undefined;
2363
- } & {
2364
- fetchOptions?: FetchOptions | undefined;
2365
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
2366
- redirect: boolean;
2367
- url: string;
2368
- } | (Omit<{
2369
- redirect: boolean;
2370
- token: string;
2371
- url: undefined;
2372
- user: {
2373
- id: string;
2374
- createdAt: Date;
2375
- updatedAt: Date;
2376
- email: string;
2377
- emailVerified: boolean;
2378
- name: string;
2379
- image?: string | null | undefined | undefined;
2380
- };
2381
- }, "user"> & {
2382
- user: better_auth.StripEmptyObjects<{
2383
- id: string;
2384
- createdAt: Date;
2385
- updatedAt: Date;
2386
- email: string;
2387
- emailVerified: boolean;
2388
- name: string;
2389
- image?: string | null | undefined;
2390
- } & {
2391
- twoFactorEnabled: boolean | null | undefined;
2392
- } & {}>;
2393
- }), {
2394
- code?: string | undefined;
2395
- message?: string | undefined;
2396
- }, FetchOptions["throw"] extends true ? true : false>>;
2397
- };
2398
- } & {
2399
- signOut: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
2400
- query?: Record<string, any> | undefined;
2401
- fetchOptions?: FetchOptions | undefined;
2402
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
2403
- success: boolean;
2404
- }, {
2405
- code?: string | undefined;
2406
- message?: string | undefined;
2407
- }, FetchOptions["throw"] extends true ? true : false>>;
2408
- } & {
2409
- signUp: {
2410
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
2411
- name: string;
2412
- email: string;
2413
- password: string;
2414
- image?: string | undefined;
2415
- callbackURL?: string | undefined;
2416
- rememberMe?: boolean | undefined;
2417
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<node_modules_better_auth_dist_client_path_to_object_mjs.InferSignUpEmailCtx<{
2418
- baseURL: string;
2419
- plugins: ({
2420
- id: "organization";
2421
- $InferServerPlugin: node_modules_better_auth_dist_plugins_organization_organization_mjs.OrganizationPlugin<{
2422
- ac: node_modules_better_auth_dist_plugins_access_types_mjs.AccessControl<{
2423
- readonly organization: readonly ["update", "delete"];
2424
- readonly member: readonly ["create", "update", "delete"];
2425
- readonly invitation: readonly ["create", "cancel"];
2426
- readonly team: readonly ["create", "update", "delete"];
2427
- readonly ac: readonly ["create", "read", "update", "delete"];
2428
- }>;
2429
- roles: {
2430
- admin: node_modules_better_auth_dist_plugins_access_types_mjs.Role;
2431
- member: node_modules_better_auth_dist_plugins_access_types_mjs.Role;
2432
- owner: node_modules_better_auth_dist_plugins_access_types_mjs.Role;
2433
- };
2434
- teams: {
2435
- enabled: false;
2436
- };
2437
- schema: {
2438
- organization?: {
2439
- additionalFields?: {
2440
- [key: string]: better_auth.DBFieldAttribute;
2441
- };
2442
- };
2443
- member?: {
2444
- additionalFields?: {
2445
- [key: string]: better_auth.DBFieldAttribute;
2446
- };
2447
- };
2448
- invitation?: {
2449
- additionalFields?: {
2450
- [key: string]: better_auth.DBFieldAttribute;
2451
- };
2452
- };
2453
- team?: {
2454
- additionalFields?: {
2455
- [key: string]: better_auth.DBFieldAttribute;
2456
- };
2457
- };
2458
- organizationRole?: {
2459
- additionalFields?: {
2460
- [key: string]: better_auth.DBFieldAttribute;
2461
- };
2462
- };
2463
- } | undefined;
2464
- dynamicAccessControl: {
2465
- enabled: false;
2466
- };
2467
- }>;
2468
- getActions: ($fetch: better_auth_react.BetterFetch, _$store: better_auth.ClientStore, co: better_auth.BetterAuthClientOptions | undefined) => {
2469
- $Infer: {
2470
- ActiveOrganization: {
2471
- members: {
2472
- id: string;
2473
- organizationId: string;
2474
- role: "member" | "admin" | "owner";
2475
- createdAt: Date;
2476
- userId: string;
2477
- user: {
2478
- id: string;
2479
- email: string;
2480
- name: string;
2481
- image?: string | undefined;
2482
- };
2483
- }[];
2484
- invitations: {
2485
- id: string;
2486
- organizationId: string;
2487
- email: string;
2488
- role: "member" | "admin" | "owner";
2489
- status: better_auth_client_plugins.InvitationStatus;
2490
- inviterId: string;
2491
- expiresAt: Date;
2492
- createdAt: Date;
2493
- }[];
2494
- } & {
2495
- id: string;
2496
- name: string;
2497
- slug: string;
2498
- createdAt: Date;
2499
- logo?: string | null | undefined | undefined;
2500
- metadata?: any;
2501
- };
2502
- Organization: {
2503
- id: string;
2504
- name: string;
2505
- slug: string;
2506
- createdAt: Date;
2507
- logo?: string | null | undefined;
2508
- metadata?: any;
2509
- };
2510
- Invitation: {
2511
- id: string;
2512
- organizationId: string;
2513
- email: string;
2514
- role: "member" | "admin" | "owner";
2515
- status: better_auth_client_plugins.InvitationStatus;
2516
- inviterId: string;
2517
- expiresAt: Date;
2518
- createdAt: Date;
2519
- };
2520
- Member: {
2521
- id: string;
2522
- organizationId: string;
2523
- role: "member" | "admin" | "owner";
2524
- createdAt: Date;
2525
- userId: string;
2526
- user: {
2527
- id: string;
2528
- email: string;
2529
- name: string;
2530
- image?: string | undefined;
2531
- };
2532
- };
2533
- Team: {
2534
- id: string;
2535
- name: string;
2536
- organizationId: string;
2537
- createdAt: Date;
2538
- updatedAt?: Date | undefined;
2539
- };
2540
- };
2541
- organization: {
2542
- checkRolePermission: <R extends "member" | "admin" | "owner">(data: {
2543
- permissions: {
2544
- readonly organization?: ("update" | "delete")[] | undefined;
2545
- readonly member?: ("update" | "create" | "delete")[] | undefined;
2546
- readonly invitation?: ("create" | "cancel")[] | undefined;
2547
- readonly team?: ("update" | "create" | "delete")[] | undefined;
2548
- readonly ac?: ("update" | "create" | "delete" | "read")[] | undefined;
2549
- };
2550
- } & {
2551
- role: R;
2552
- }) => boolean;
2553
- };
2554
- };
2555
- getAtoms: ($fetch: better_auth_react.BetterFetch) => {
2556
- $listOrg: better_auth_react.PreinitializedWritableAtom<boolean> & object;
2557
- $activeOrgSignal: better_auth_react.PreinitializedWritableAtom<boolean> & object;
2558
- $activeMemberSignal: better_auth_react.PreinitializedWritableAtom<boolean> & object;
2559
- $activeMemberRoleSignal: better_auth_react.PreinitializedWritableAtom<boolean> & object;
2560
- activeOrganization: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<better_auth.Prettify<{
2561
- id: string;
2562
- name: string;
2563
- slug: string;
2564
- createdAt: Date;
2565
- logo?: string | null | undefined | undefined;
2566
- metadata?: any;
2567
- } & {
2568
- members: {
2569
- id: string;
2570
- organizationId: string;
2571
- role: "member" | "admin" | "owner";
2572
- createdAt: Date;
2573
- userId: string;
2574
- user: {
2575
- id: string;
2576
- email: string;
2577
- name: string;
2578
- image?: string | undefined;
2579
- };
2580
- }[];
2581
- invitations: {
2582
- id: string;
2583
- organizationId: string;
2584
- email: string;
2585
- role: "member" | "admin" | "owner";
2586
- status: better_auth_client_plugins.InvitationStatus;
2587
- inviterId: string;
2588
- expiresAt: Date;
2589
- createdAt: Date;
2590
- }[];
2591
- }>>;
2592
- listOrganizations: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<{
2593
- id: string;
2594
- name: string;
2595
- slug: string;
2596
- createdAt: Date;
2597
- logo?: string | null | undefined | undefined;
2598
- metadata?: any;
2599
- }[]>;
2600
- activeMember: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<{
2601
- id: string;
2602
- organizationId: string;
2603
- userId: string;
2604
- role: string;
2605
- createdAt: Date;
2606
- }>;
2607
- activeMemberRole: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<{
2608
- role: string;
2609
- }>;
2610
- };
2611
- pathMethods: {
2612
- "/organization/get-full-organization": "GET";
2613
- "/organization/list-user-teams": "GET";
2614
- };
2615
- atomListeners: ({
2616
- matcher(path: string): path is "/organization/create" | "/organization/update" | "/organization/delete";
2617
- signal: "$listOrg";
2618
- } | {
2619
- matcher(path: string): boolean;
2620
- signal: "$activeOrgSignal";
2621
- } | {
2622
- matcher(path: string): boolean;
2623
- signal: "$sessionSignal";
2624
- } | {
2625
- matcher(path: string): boolean;
2626
- signal: "$activeMemberSignal";
2627
- } | {
2628
- matcher(path: string): boolean;
2629
- signal: "$activeMemberRoleSignal";
2630
- })[];
2631
- $ERROR_CODES: {
2632
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION">;
2633
- YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: better_auth.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS">;
2634
- ORGANIZATION_ALREADY_EXISTS: better_auth.RawError<"ORGANIZATION_ALREADY_EXISTS">;
2635
- ORGANIZATION_SLUG_ALREADY_TAKEN: better_auth.RawError<"ORGANIZATION_SLUG_ALREADY_TAKEN">;
2636
- ORGANIZATION_NOT_FOUND: better_auth.RawError<"ORGANIZATION_NOT_FOUND">;
2637
- USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: better_auth.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION">;
2638
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION">;
2639
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION">;
2640
- NO_ACTIVE_ORGANIZATION: better_auth.RawError<"NO_ACTIVE_ORGANIZATION">;
2641
- USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: better_auth.RawError<"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION">;
2642
- MEMBER_NOT_FOUND: better_auth.RawError<"MEMBER_NOT_FOUND">;
2643
- ROLE_NOT_FOUND: better_auth.RawError<"ROLE_NOT_FOUND">;
2644
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM">;
2645
- TEAM_ALREADY_EXISTS: better_auth.RawError<"TEAM_ALREADY_EXISTS">;
2646
- TEAM_NOT_FOUND: better_auth.RawError<"TEAM_NOT_FOUND">;
2647
- YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: better_auth.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER">;
2648
- YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: better_auth.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER">;
2649
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER">;
2650
- YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION">;
2651
- USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: better_auth.RawError<"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION">;
2652
- INVITATION_NOT_FOUND: better_auth.RawError<"INVITATION_NOT_FOUND">;
2653
- YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: better_auth.RawError<"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION">;
2654
- EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: better_auth.RawError<"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION">;
2655
- YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION">;
2656
- INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: better_auth.RawError<"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION">;
2657
- YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE">;
2658
- FAILED_TO_RETRIEVE_INVITATION: better_auth.RawError<"FAILED_TO_RETRIEVE_INVITATION">;
2659
- YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: better_auth.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS">;
2660
- UNABLE_TO_REMOVE_LAST_TEAM: better_auth.RawError<"UNABLE_TO_REMOVE_LAST_TEAM">;
2661
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER">;
2662
- ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: better_auth.RawError<"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED">;
2663
- YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION">;
2664
- YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION">;
2665
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM">;
2666
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM">;
2667
- INVITATION_LIMIT_REACHED: better_auth.RawError<"INVITATION_LIMIT_REACHED">;
2668
- TEAM_MEMBER_LIMIT_REACHED: better_auth.RawError<"TEAM_MEMBER_LIMIT_REACHED">;
2669
- USER_IS_NOT_A_MEMBER_OF_THE_TEAM: better_auth.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_TEAM">;
2670
- YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: better_auth.RawError<"YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM">;
2671
- YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: better_auth.RawError<"YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM">;
2672
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER">;
2673
- YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER">;
2674
- YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION">;
2675
- YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION">;
2676
- MISSING_AC_INSTANCE: better_auth.RawError<"MISSING_AC_INSTANCE">;
2677
- YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: better_auth.RawError<"YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE">;
2678
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE">;
2679
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE">;
2680
- YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE">;
2681
- YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE">;
2682
- YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE">;
2683
- YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE">;
2684
- TOO_MANY_ROLES: better_auth.RawError<"TOO_MANY_ROLES">;
2685
- INVALID_RESOURCE: better_auth.RawError<"INVALID_RESOURCE">;
2686
- ROLE_NAME_IS_ALREADY_TAKEN: better_auth.RawError<"ROLE_NAME_IS_ALREADY_TAKEN">;
2687
- CANNOT_DELETE_A_PRE_DEFINED_ROLE: better_auth.RawError<"CANNOT_DELETE_A_PRE_DEFINED_ROLE">;
2688
- ROLE_IS_ASSIGNED_TO_MEMBERS: better_auth.RawError<"ROLE_IS_ASSIGNED_TO_MEMBERS">;
2689
- };
2690
- } | {
2691
- id: "two-factor";
2692
- $InferServerPlugin: ReturnType<(<O extends better_auth_plugins_two_factor.TwoFactorOptions>(options?: O) => {
2693
- id: "two-factor";
2694
- endpoints: {
2695
- enableTwoFactor: better_auth.StrictEndpoint<"/two-factor/enable", {
2696
- method: "POST";
2697
- body: better_auth.ZodObject<{
2698
- password: better_auth.ZodString;
2699
- issuer: better_auth.ZodOptional<better_auth.ZodString>;
2700
- }, better_auth.$strip>;
2701
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2702
- session: {
2703
- session: Record<string, any> & {
2704
- id: string;
2705
- createdAt: Date;
2706
- updatedAt: Date;
2707
- userId: string;
2708
- expiresAt: Date;
2709
- token: string;
2710
- ipAddress?: string | null | undefined;
2711
- userAgent?: string | null | undefined;
2712
- };
2713
- user: Record<string, any> & {
2714
- id: string;
2715
- createdAt: Date;
2716
- updatedAt: Date;
2717
- email: string;
2718
- emailVerified: boolean;
2719
- name: string;
2720
- image?: string | null | undefined;
2721
- };
2722
- };
2723
- }>)[];
2724
- metadata: {
2725
- openapi: {
2726
- summary: string;
2727
- description: string;
2728
- responses: {
2729
- 200: {
2730
- description: string;
2731
- content: {
2732
- "application/json": {
2733
- schema: {
2734
- type: "object";
2735
- properties: {
2736
- totpURI: {
2737
- type: string;
2738
- description: string;
2739
- };
2740
- backupCodes: {
2741
- type: string;
2742
- items: {
2743
- type: string;
2744
- };
2745
- description: string;
2746
- };
2747
- };
2748
- };
2749
- };
2750
- };
2751
- };
2752
- };
2753
- };
2754
- };
2755
- }, {
2756
- totpURI: string;
2757
- backupCodes: string[];
2758
- }>;
2759
- disableTwoFactor: better_auth.StrictEndpoint<"/two-factor/disable", {
2760
- method: "POST";
2761
- body: better_auth.ZodObject<{
2762
- password: better_auth.ZodString;
2763
- }, better_auth.$strip>;
2764
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2765
- session: {
2766
- session: Record<string, any> & {
2767
- id: string;
2768
- createdAt: Date;
2769
- updatedAt: Date;
2770
- userId: string;
2771
- expiresAt: Date;
2772
- token: string;
2773
- ipAddress?: string | null | undefined;
2774
- userAgent?: string | null | undefined;
2775
- };
2776
- user: Record<string, any> & {
2777
- id: string;
2778
- createdAt: Date;
2779
- updatedAt: Date;
2780
- email: string;
2781
- emailVerified: boolean;
2782
- name: string;
2783
- image?: string | null | undefined;
2784
- };
2785
- };
2786
- }>)[];
2787
- metadata: {
2788
- openapi: {
2789
- summary: string;
2790
- description: string;
2791
- responses: {
2792
- 200: {
2793
- description: string;
2794
- content: {
2795
- "application/json": {
2796
- schema: {
2797
- type: "object";
2798
- properties: {
2799
- status: {
2800
- type: string;
2801
- };
2802
- };
2803
- };
2804
- };
2805
- };
2806
- };
2807
- };
2808
- };
2809
- };
2810
- }, {
2811
- status: boolean;
2812
- }>;
2813
- verifyBackupCode: better_auth.StrictEndpoint<"/two-factor/verify-backup-code", {
2814
- method: "POST";
2815
- body: better_auth.ZodObject<{
2816
- code: better_auth.ZodString;
2817
- disableSession: better_auth.ZodOptional<better_auth.ZodBoolean>;
2818
- trustDevice: better_auth.ZodOptional<better_auth.ZodBoolean>;
2819
- }, better_auth.$strip>;
2820
- metadata: {
2821
- openapi: {
2822
- description: string;
2823
- responses: {
2824
- "200": {
2825
- description: string;
2826
- content: {
2827
- "application/json": {
2828
- schema: {
2829
- type: "object";
2830
- properties: {
2831
- user: {
2832
- type: string;
2833
- properties: {
2834
- id: {
2835
- type: string;
2836
- description: string;
2837
- };
2838
- email: {
2839
- type: string;
2840
- format: string;
2841
- nullable: boolean;
2842
- description: string;
2843
- };
2844
- emailVerified: {
2845
- type: string;
2846
- nullable: boolean;
2847
- description: string;
2848
- };
2849
- name: {
2850
- type: string;
2851
- nullable: boolean;
2852
- description: string;
2853
- };
2854
- image: {
2855
- type: string;
2856
- format: string;
2857
- nullable: boolean;
2858
- description: string;
2859
- };
2860
- twoFactorEnabled: {
2861
- type: string;
2862
- description: string;
2863
- };
2864
- createdAt: {
2865
- type: string;
2866
- format: string;
2867
- description: string;
2868
- };
2869
- updatedAt: {
2870
- type: string;
2871
- format: string;
2872
- description: string;
2873
- };
2874
- };
2875
- required: string[];
2876
- description: string;
2877
- };
2878
- session: {
2879
- type: string;
2880
- properties: {
2881
- token: {
2882
- type: string;
2883
- description: string;
2884
- };
2885
- userId: {
2886
- type: string;
2887
- description: string;
2888
- };
2889
- createdAt: {
2890
- type: string;
2891
- format: string;
2892
- description: string;
2893
- };
2894
- expiresAt: {
2895
- type: string;
2896
- format: string;
2897
- description: string;
2898
- };
2899
- };
2900
- required: string[];
2901
- description: string;
2902
- };
2903
- };
2904
- required: string[];
2905
- };
2906
- };
2907
- };
2908
- };
2909
- };
2910
- };
2911
- };
2912
- }, {
2913
- token: string | undefined;
2914
- user: (Record<string, any> & {
2915
- id: string;
2916
- createdAt: Date;
2917
- updatedAt: Date;
2918
- email: string;
2919
- emailVerified: boolean;
2920
- name: string;
2921
- image?: string | null | undefined;
2922
- }) | better_auth_plugins_two_factor.UserWithTwoFactor;
2923
- }>;
2924
- generateBackupCodes: better_auth.StrictEndpoint<"/two-factor/generate-backup-codes", {
2925
- method: "POST";
2926
- body: better_auth.ZodObject<{
2927
- password: better_auth.ZodString;
2928
- }, better_auth.$strip>;
2929
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2930
- session: {
2931
- session: Record<string, any> & {
2932
- id: string;
2933
- createdAt: Date;
2934
- updatedAt: Date;
2935
- userId: string;
2936
- expiresAt: Date;
2937
- token: string;
2938
- ipAddress?: string | null | undefined;
2939
- userAgent?: string | null | undefined;
2940
- };
2941
- user: Record<string, any> & {
2942
- id: string;
2943
- createdAt: Date;
2944
- updatedAt: Date;
2945
- email: string;
2946
- emailVerified: boolean;
2947
- name: string;
2948
- image?: string | null | undefined;
2949
- };
2950
- };
2951
- }>)[];
2952
- metadata: {
2953
- openapi: {
2954
- description: string;
2955
- responses: {
2956
- "200": {
2957
- description: string;
2958
- content: {
2959
- "application/json": {
2960
- schema: {
2961
- type: "object";
2962
- properties: {
2963
- status: {
2964
- type: string;
2965
- description: string;
2966
- enum: boolean[];
2967
- };
2968
- backupCodes: {
2969
- type: string;
2970
- items: {
2971
- type: string;
2972
- };
2973
- description: string;
2974
- };
2975
- };
2976
- required: string[];
2977
- };
2978
- };
2979
- };
2980
- };
2981
- };
2982
- };
2983
- };
2984
- }, {
2985
- status: boolean;
2986
- backupCodes: string[];
2987
- }>;
2988
- viewBackupCodes: better_auth.StrictEndpoint<string, {
2989
- method: "POST";
2990
- body: better_auth.ZodObject<{
2991
- userId: better_auth.ZodCoercedString<unknown>;
2992
- }, better_auth.$strip>;
2993
- }, {
2994
- status: boolean;
2995
- backupCodes: string[];
2996
- }>;
2997
- sendTwoFactorOTP: better_auth.StrictEndpoint<"/two-factor/send-otp", {
2998
- method: "POST";
2999
- body: better_auth.ZodOptional<better_auth.ZodObject<{
3000
- trustDevice: better_auth.ZodOptional<better_auth.ZodBoolean>;
3001
- }, better_auth.$strip>>;
3002
- metadata: {
3003
- openapi: {
3004
- summary: string;
3005
- description: string;
3006
- responses: {
3007
- 200: {
3008
- description: string;
3009
- content: {
3010
- "application/json": {
3011
- schema: {
3012
- type: "object";
3013
- properties: {
3014
- status: {
3015
- type: string;
3016
- };
3017
- };
3018
- };
3019
- };
3020
- };
3021
- };
3022
- };
3023
- };
3024
- };
3025
- }, {
3026
- status: boolean;
3027
- }>;
3028
- verifyTwoFactorOTP: better_auth.StrictEndpoint<"/two-factor/verify-otp", {
3029
- method: "POST";
3030
- body: better_auth.ZodObject<{
3031
- code: better_auth.ZodString;
3032
- trustDevice: better_auth.ZodOptional<better_auth.ZodBoolean>;
3033
- }, better_auth.$strip>;
3034
- metadata: {
3035
- openapi: {
3036
- summary: string;
3037
- description: string;
3038
- responses: {
3039
- "200": {
3040
- description: string;
3041
- content: {
3042
- "application/json": {
3043
- schema: {
3044
- type: "object";
3045
- properties: {
3046
- token: {
3047
- type: string;
3048
- description: string;
3049
- };
3050
- user: {
3051
- type: string;
3052
- properties: {
3053
- id: {
3054
- type: string;
3055
- description: string;
3056
- };
3057
- email: {
3058
- type: string;
3059
- format: string;
3060
- nullable: boolean;
3061
- description: string;
3062
- };
3063
- emailVerified: {
3064
- type: string;
3065
- nullable: boolean;
3066
- description: string;
3067
- };
3068
- name: {
3069
- type: string;
3070
- nullable: boolean;
3071
- description: string;
3072
- };
3073
- image: {
3074
- type: string;
3075
- format: string;
3076
- nullable: boolean;
3077
- description: string;
3078
- };
3079
- createdAt: {
3080
- type: string;
3081
- format: string;
3082
- description: string;
3083
- };
3084
- updatedAt: {
3085
- type: string;
3086
- format: string;
3087
- description: string;
3088
- };
3089
- };
3090
- required: string[];
3091
- description: string;
3092
- };
3093
- };
3094
- required: string[];
3095
- };
3096
- };
3097
- };
3098
- };
3099
- };
3100
- };
3101
- };
3102
- }, {
3103
- token: string;
3104
- user: better_auth_plugins_two_factor.UserWithTwoFactor;
3105
- } | {
3106
- token: string;
3107
- user: Record<string, any> & {
3108
- id: string;
3109
- createdAt: Date;
3110
- updatedAt: Date;
3111
- email: string;
3112
- emailVerified: boolean;
3113
- name: string;
3114
- image?: string | null | undefined;
3115
- };
3116
- }>;
3117
- generateTOTP: better_auth.StrictEndpoint<string, {
3118
- method: "POST";
3119
- body: better_auth.ZodObject<{
3120
- secret: better_auth.ZodString;
3121
- }, better_auth.$strip>;
3122
- metadata: {
3123
- openapi: {
3124
- summary: string;
3125
- description: string;
3126
- responses: {
3127
- 200: {
3128
- description: string;
3129
- content: {
3130
- "application/json": {
3131
- schema: {
3132
- type: "object";
3133
- properties: {
3134
- code: {
3135
- type: string;
3136
- };
3137
- };
3138
- };
3139
- };
3140
- };
3141
- };
3142
- };
3143
- };
3144
- };
3145
- }, {
3146
- code: string;
3147
- }>;
3148
- getTOTPURI: better_auth.StrictEndpoint<"/two-factor/get-totp-uri", {
3149
- method: "POST";
3150
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
3151
- session: {
3152
- session: Record<string, any> & {
3153
- id: string;
3154
- createdAt: Date;
3155
- updatedAt: Date;
3156
- userId: string;
3157
- expiresAt: Date;
3158
- token: string;
3159
- ipAddress?: string | null | undefined;
3160
- userAgent?: string | null | undefined;
3161
- };
3162
- user: Record<string, any> & {
3163
- id: string;
3164
- createdAt: Date;
3165
- updatedAt: Date;
3166
- email: string;
3167
- emailVerified: boolean;
3168
- name: string;
3169
- image?: string | null | undefined;
3170
- };
3171
- };
3172
- }>)[];
3173
- body: better_auth.ZodObject<{
3174
- password: better_auth.ZodString;
3175
- }, better_auth.$strip>;
3176
- metadata: {
3177
- openapi: {
3178
- summary: string;
3179
- description: string;
3180
- responses: {
3181
- 200: {
3182
- description: string;
3183
- content: {
3184
- "application/json": {
3185
- schema: {
3186
- type: "object";
3187
- properties: {
3188
- totpURI: {
3189
- type: string;
3190
- };
3191
- };
3192
- };
3193
- };
3194
- };
3195
- };
3196
- };
3197
- };
3198
- };
3199
- }, {
3200
- totpURI: string;
3201
- }>;
3202
- verifyTOTP: better_auth.StrictEndpoint<"/two-factor/verify-totp", {
3203
- method: "POST";
3204
- body: better_auth.ZodObject<{
3205
- code: better_auth.ZodString;
3206
- trustDevice: better_auth.ZodOptional<better_auth.ZodBoolean>;
3207
- }, better_auth.$strip>;
3208
- metadata: {
3209
- openapi: {
3210
- summary: string;
3211
- description: string;
3212
- responses: {
3213
- 200: {
3214
- description: string;
3215
- content: {
3216
- "application/json": {
3217
- schema: {
3218
- type: "object";
3219
- properties: {
3220
- status: {
3221
- type: string;
3222
- };
3223
- };
3224
- };
3225
- };
3226
- };
3227
- };
3228
- };
3229
- };
3230
- };
3231
- }, {
3232
- token: string;
3233
- user: better_auth_plugins_two_factor.UserWithTwoFactor;
3234
- } | {
3235
- token: string;
3236
- user: Record<string, any> & {
3237
- id: string;
3238
- createdAt: Date;
3239
- updatedAt: Date;
3240
- email: string;
3241
- emailVerified: boolean;
3242
- name: string;
3243
- image?: string | null | undefined;
3244
- };
3245
- }>;
3246
- };
3247
- options: NoInfer<O>;
3248
- hooks: {
3249
- after: {
3250
- matcher(context: better_auth.HookEndpointContext): boolean;
3251
- handler: (inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
3252
- twoFactorRedirect: boolean;
3253
- } | undefined>;
3254
- }[];
3255
- };
3256
- schema: {
3257
- user: {
3258
- fields: {
3259
- twoFactorEnabled: {
3260
- type: "boolean";
3261
- required: false;
3262
- defaultValue: false;
3263
- input: false;
3264
- };
3265
- };
3266
- };
3267
- twoFactor: {
3268
- fields: {
3269
- secret: {
3270
- type: "string";
3271
- required: true;
3272
- returned: false;
3273
- index: true;
3274
- };
3275
- backupCodes: {
3276
- type: "string";
3277
- required: true;
3278
- returned: false;
3279
- };
3280
- userId: {
3281
- type: "string";
3282
- required: true;
3283
- returned: false;
3284
- references: {
3285
- model: string;
3286
- field: string;
3287
- };
3288
- index: true;
3289
- };
3290
- };
3291
- };
3292
- };
3293
- rateLimit: {
3294
- pathMatcher(path: string): boolean;
3295
- window: number;
3296
- max: number;
3297
- }[];
3298
- $ERROR_CODES: {
3299
- OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
3300
- OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
3301
- TOTP_NOT_ENABLED: better_auth.RawError<"TOTP_NOT_ENABLED">;
3302
- TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
3303
- BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
3304
- INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
3305
- INVALID_CODE: better_auth.RawError<"INVALID_CODE">;
3306
- TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: better_auth.RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
3307
- INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
3308
- };
3309
- })>;
3310
- atomListeners: {
3311
- matcher: (path: string) => boolean;
3312
- signal: "$sessionSignal";
3313
- }[];
3314
- pathMethods: {
3315
- "/two-factor/disable": "POST";
3316
- "/two-factor/enable": "POST";
3317
- "/two-factor/send-otp": "POST";
3318
- "/two-factor/generate-backup-codes": "POST";
3319
- "/two-factor/get-totp-uri": "POST";
3320
- "/two-factor/verify-totp": "POST";
3321
- "/two-factor/verify-otp": "POST";
3322
- "/two-factor/verify-backup-code": "POST";
3323
- };
3324
- fetchPlugins: {
3325
- id: string;
3326
- name: string;
3327
- hooks: {
3328
- onSuccess(context: better_auth_react.SuccessContext<any>): Promise<void>;
3329
- };
3330
- }[];
3331
- $ERROR_CODES: {
3332
- OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
3333
- OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
3334
- TOTP_NOT_ENABLED: better_auth.RawError<"TOTP_NOT_ENABLED">;
3335
- TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
3336
- BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
3337
- INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
3338
- INVALID_CODE: better_auth.RawError<"INVALID_CODE">;
3339
- TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: better_auth.RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
3340
- INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
3341
- };
3342
- })[];
3343
- }, FetchOptions>>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<(Omit<{
3344
- token: null;
3345
- user: {
3346
- id: string;
3347
- createdAt: Date;
3348
- updatedAt: Date;
3349
- email: string;
3350
- emailVerified: boolean;
3351
- name: string;
3352
- image?: string | null | undefined | undefined;
3353
- };
3354
- }, "user"> & {
3355
- user: better_auth.StripEmptyObjects<{
3356
- id: string;
3357
- createdAt: Date;
3358
- updatedAt: Date;
3359
- email: string;
3360
- emailVerified: boolean;
3361
- name: string;
3362
- image?: string | null | undefined;
3363
- } & {
3364
- twoFactorEnabled: boolean | null | undefined;
3365
- } & {}>;
3366
- }) | (Omit<{
3367
- token: string;
3368
- user: {
3369
- id: string;
3370
- createdAt: Date;
3371
- updatedAt: Date;
3372
- email: string;
3373
- emailVerified: boolean;
3374
- name: string;
3375
- image?: string | null | undefined | undefined;
3376
- };
3377
- }, "user"> & {
3378
- user: better_auth.StripEmptyObjects<{
3379
- id: string;
3380
- createdAt: Date;
3381
- updatedAt: Date;
3382
- email: string;
3383
- emailVerified: boolean;
3384
- name: string;
3385
- image?: string | null | undefined;
3386
- } & {
3387
- twoFactorEnabled: boolean | null | undefined;
3388
- } & {}>;
3389
- }), {
3390
- code?: string | undefined;
3391
- message?: string | undefined;
3392
- }, FetchOptions["throw"] extends true ? true : false>>;
3393
- };
3394
- } & {
3395
- signIn: {
3396
- email: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
3397
- email: string;
3398
- password: string;
3399
- callbackURL?: string | undefined;
3400
- rememberMe?: boolean | undefined;
3401
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
3402
- email: string;
3403
- password: string;
3404
- callbackURL?: string | undefined;
3405
- rememberMe?: boolean | undefined;
3406
- } & {
3407
- fetchOptions?: FetchOptions | undefined;
3408
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<Omit<{
3409
- redirect: boolean;
3410
- token: string;
3411
- url?: string | undefined;
3412
- user: {
3413
- id: string;
3414
- createdAt: Date;
3415
- updatedAt: Date;
3416
- email: string;
3417
- emailVerified: boolean;
3418
- name: string;
3419
- image?: string | null | undefined | undefined;
3420
- };
3421
- }, "user"> & {
3422
- user: better_auth.StripEmptyObjects<{
3423
- id: string;
3424
- createdAt: Date;
3425
- updatedAt: Date;
3426
- email: string;
3427
- emailVerified: boolean;
3428
- name: string;
3429
- image?: string | null | undefined;
3430
- } & {
3431
- twoFactorEnabled: boolean | null | undefined;
3432
- } & {}>;
3433
- }, {
3434
- code?: string | undefined;
3435
- message?: string | undefined;
3436
- }, FetchOptions["throw"] extends true ? true : false>>;
3437
- };
3438
- } & {
3439
- resetPassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
3440
- newPassword: string;
3441
- token?: string | undefined;
3442
- }> & Record<string, any>, Partial<{
3443
- token?: string | undefined;
3444
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
3445
- newPassword: string;
3446
- token?: string | undefined;
3447
- } & {
3448
- fetchOptions?: FetchOptions | undefined;
3449
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
3450
- status: boolean;
3451
- }, {
3452
- code?: string | undefined;
3453
- message?: string | undefined;
3454
- }, FetchOptions["throw"] extends true ? true : false>>;
3455
- } & {
3456
- verifyEmail: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
3457
- token: string;
3458
- callbackURL?: string | undefined;
3459
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
3460
- query: {
3461
- token: string;
3462
- callbackURL?: string | undefined;
3463
- };
3464
- fetchOptions?: FetchOptions | undefined;
3465
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<NonNullable<void | {
3466
- status: boolean;
3467
- }>, {
3468
- code?: string | undefined;
3469
- message?: string | undefined;
3470
- }, FetchOptions["throw"] extends true ? true : false>>;
3471
- } & {
3472
- sendVerificationEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
3473
- email: string;
3474
- callbackURL?: string | undefined;
3475
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
3476
- email: string;
3477
- callbackURL?: string | undefined;
3478
- } & {
3479
- fetchOptions?: FetchOptions | undefined;
3480
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
3481
- status: boolean;
3482
- }, {
3483
- code?: string | undefined;
3484
- message?: string | undefined;
3485
- }, FetchOptions["throw"] extends true ? true : false>>;
3486
- } & {
3487
- changeEmail: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
3488
- newEmail: string;
3489
- callbackURL?: string | undefined;
3490
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
3491
- newEmail: string;
3492
- callbackURL?: string | undefined;
3493
- } & {
3494
- fetchOptions?: FetchOptions | undefined;
3495
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
3496
- status: boolean;
3497
- }, {
3498
- code?: string | undefined;
3499
- message?: string | undefined;
3500
- }, FetchOptions["throw"] extends true ? true : false>>;
3501
- } & {
3502
- changePassword: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
3503
- newPassword: string;
3504
- currentPassword: string;
3505
- revokeOtherSessions?: boolean | undefined;
3506
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
3507
- newPassword: string;
3508
- currentPassword: string;
3509
- revokeOtherSessions?: boolean | undefined;
3510
- } & {
3511
- fetchOptions?: FetchOptions | undefined;
3512
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<Omit<{
3513
- token: string | null;
3514
- user: {
3515
- id: string;
3516
- createdAt: Date;
3517
- updatedAt: Date;
3518
- email: string;
3519
- emailVerified: boolean;
3520
- name: string;
3521
- image?: string | null | undefined;
3522
- } & Record<string, any> & {
3523
- id: string;
3524
- createdAt: Date;
3525
- updatedAt: Date;
3526
- email: string;
3527
- emailVerified: boolean;
3528
- name: string;
3529
- image?: string | null | undefined;
3530
- };
3531
- }, "user"> & {
3532
- user: better_auth.StripEmptyObjects<{
3533
- id: string;
3534
- createdAt: Date;
3535
- updatedAt: Date;
3536
- email: string;
3537
- emailVerified: boolean;
3538
- name: string;
3539
- image?: string | null | undefined;
3540
- } & {
3541
- twoFactorEnabled: boolean | null | undefined;
3542
- } & {}>;
3543
- }, {
3544
- code?: string | undefined;
3545
- message?: string | undefined;
3546
- }, FetchOptions["throw"] extends true ? true : false>>;
3547
- } & {
3548
- updateSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}>> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<Partial<{}> & {
3549
- fetchOptions?: FetchOptions | undefined;
3550
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
3551
- session: {
3552
- id: string;
3553
- createdAt: Date;
3554
- updatedAt: Date;
3555
- userId: string;
3556
- expiresAt: Date;
3557
- token: string;
3558
- ipAddress?: string | null | undefined;
3559
- userAgent?: string | null | undefined;
3560
- };
3561
- }, {
3562
- code?: string | undefined;
3563
- message?: string | undefined;
3564
- }, FetchOptions["throw"] extends true ? true : false>>;
3565
- } & {
3566
- updateUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<Partial<{}> & {
3567
- name?: string | undefined;
3568
- image?: string | undefined | null;
3569
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<node_modules_better_auth_dist_client_path_to_object_mjs.InferUserUpdateCtx<{
3570
- baseURL: string;
3571
- plugins: ({
3572
- id: "organization";
3573
- $InferServerPlugin: node_modules_better_auth_dist_plugins_organization_organization_mjs.OrganizationPlugin<{
3574
- ac: node_modules_better_auth_dist_plugins_access_types_mjs.AccessControl<{
3575
- readonly organization: readonly ["update", "delete"];
3576
- readonly member: readonly ["create", "update", "delete"];
3577
- readonly invitation: readonly ["create", "cancel"];
3578
- readonly team: readonly ["create", "update", "delete"];
3579
- readonly ac: readonly ["create", "read", "update", "delete"];
3580
- }>;
3581
- roles: {
3582
- admin: node_modules_better_auth_dist_plugins_access_types_mjs.Role;
3583
- member: node_modules_better_auth_dist_plugins_access_types_mjs.Role;
3584
- owner: node_modules_better_auth_dist_plugins_access_types_mjs.Role;
3585
- };
3586
- teams: {
3587
- enabled: false;
3588
- };
3589
- schema: {
3590
- organization?: {
3591
- additionalFields?: {
3592
- [key: string]: better_auth.DBFieldAttribute;
3593
- };
3594
- };
3595
- member?: {
3596
- additionalFields?: {
3597
- [key: string]: better_auth.DBFieldAttribute;
3598
- };
3599
- };
3600
- invitation?: {
3601
- additionalFields?: {
3602
- [key: string]: better_auth.DBFieldAttribute;
3603
- };
3604
- };
3605
- team?: {
3606
- additionalFields?: {
3607
- [key: string]: better_auth.DBFieldAttribute;
3608
- };
3609
- };
3610
- organizationRole?: {
3611
- additionalFields?: {
3612
- [key: string]: better_auth.DBFieldAttribute;
3613
- };
3614
- };
3615
- } | undefined;
3616
- dynamicAccessControl: {
3617
- enabled: false;
3618
- };
3619
- }>;
3620
- getActions: ($fetch: better_auth_react.BetterFetch, _$store: better_auth.ClientStore, co: better_auth.BetterAuthClientOptions | undefined) => {
3621
- $Infer: {
3622
- ActiveOrganization: {
3623
- members: {
3624
- id: string;
3625
- organizationId: string;
3626
- role: "member" | "admin" | "owner";
3627
- createdAt: Date;
3628
- userId: string;
3629
- user: {
3630
- id: string;
3631
- email: string;
3632
- name: string;
3633
- image?: string | undefined;
3634
- };
3635
- }[];
3636
- invitations: {
3637
- id: string;
3638
- organizationId: string;
3639
- email: string;
3640
- role: "member" | "admin" | "owner";
3641
- status: better_auth_client_plugins.InvitationStatus;
3642
- inviterId: string;
3643
- expiresAt: Date;
3644
- createdAt: Date;
3645
- }[];
3646
- } & {
3647
- id: string;
3648
- name: string;
3649
- slug: string;
3650
- createdAt: Date;
3651
- logo?: string | null | undefined | undefined;
3652
- metadata?: any;
3653
- };
3654
- Organization: {
3655
- id: string;
3656
- name: string;
3657
- slug: string;
3658
- createdAt: Date;
3659
- logo?: string | null | undefined;
3660
- metadata?: any;
3661
- };
3662
- Invitation: {
3663
- id: string;
3664
- organizationId: string;
3665
- email: string;
3666
- role: "member" | "admin" | "owner";
3667
- status: better_auth_client_plugins.InvitationStatus;
3668
- inviterId: string;
3669
- expiresAt: Date;
3670
- createdAt: Date;
3671
- };
3672
- Member: {
3673
- id: string;
3674
- organizationId: string;
3675
- role: "member" | "admin" | "owner";
3676
- createdAt: Date;
3677
- userId: string;
3678
- user: {
3679
- id: string;
3680
- email: string;
3681
- name: string;
3682
- image?: string | undefined;
3683
- };
3684
- };
3685
- Team: {
3686
- id: string;
3687
- name: string;
3688
- organizationId: string;
3689
- createdAt: Date;
3690
- updatedAt?: Date | undefined;
3691
- };
3692
- };
3693
- organization: {
3694
- checkRolePermission: <R extends "member" | "admin" | "owner">(data: {
3695
- permissions: {
3696
- readonly organization?: ("update" | "delete")[] | undefined;
3697
- readonly member?: ("update" | "create" | "delete")[] | undefined;
3698
- readonly invitation?: ("create" | "cancel")[] | undefined;
3699
- readonly team?: ("update" | "create" | "delete")[] | undefined;
3700
- readonly ac?: ("update" | "create" | "delete" | "read")[] | undefined;
3701
- };
3702
- } & {
3703
- role: R;
3704
- }) => boolean;
3705
- };
3706
- };
3707
- getAtoms: ($fetch: better_auth_react.BetterFetch) => {
3708
- $listOrg: better_auth_react.PreinitializedWritableAtom<boolean> & object;
3709
- $activeOrgSignal: better_auth_react.PreinitializedWritableAtom<boolean> & object;
3710
- $activeMemberSignal: better_auth_react.PreinitializedWritableAtom<boolean> & object;
3711
- $activeMemberRoleSignal: better_auth_react.PreinitializedWritableAtom<boolean> & object;
3712
- activeOrganization: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<better_auth.Prettify<{
3713
- id: string;
3714
- name: string;
3715
- slug: string;
3716
- createdAt: Date;
3717
- logo?: string | null | undefined | undefined;
3718
- metadata?: any;
3719
- } & {
3720
- members: {
3721
- id: string;
3722
- organizationId: string;
3723
- role: "member" | "admin" | "owner";
3724
- createdAt: Date;
3725
- userId: string;
3726
- user: {
3727
- id: string;
3728
- email: string;
3729
- name: string;
3730
- image?: string | undefined;
3731
- };
3732
- }[];
3733
- invitations: {
3734
- id: string;
3735
- organizationId: string;
3736
- email: string;
3737
- role: "member" | "admin" | "owner";
3738
- status: better_auth_client_plugins.InvitationStatus;
3739
- inviterId: string;
3740
- expiresAt: Date;
3741
- createdAt: Date;
3742
- }[];
3743
- }>>;
3744
- listOrganizations: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<{
3745
- id: string;
3746
- name: string;
3747
- slug: string;
3748
- createdAt: Date;
3749
- logo?: string | null | undefined | undefined;
3750
- metadata?: any;
3751
- }[]>;
3752
- activeMember: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<{
3753
- id: string;
3754
- organizationId: string;
3755
- userId: string;
3756
- role: string;
3757
- createdAt: Date;
3758
- }>;
3759
- activeMemberRole: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<{
3760
- role: string;
3761
- }>;
3762
- };
3763
- pathMethods: {
3764
- "/organization/get-full-organization": "GET";
3765
- "/organization/list-user-teams": "GET";
3766
- };
3767
- atomListeners: ({
3768
- matcher(path: string): path is "/organization/create" | "/organization/update" | "/organization/delete";
3769
- signal: "$listOrg";
3770
- } | {
3771
- matcher(path: string): boolean;
3772
- signal: "$activeOrgSignal";
3773
- } | {
3774
- matcher(path: string): boolean;
3775
- signal: "$sessionSignal";
3776
- } | {
3777
- matcher(path: string): boolean;
3778
- signal: "$activeMemberSignal";
3779
- } | {
3780
- matcher(path: string): boolean;
3781
- signal: "$activeMemberRoleSignal";
3782
- })[];
3783
- $ERROR_CODES: {
3784
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION">;
3785
- YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: better_auth.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS">;
3786
- ORGANIZATION_ALREADY_EXISTS: better_auth.RawError<"ORGANIZATION_ALREADY_EXISTS">;
3787
- ORGANIZATION_SLUG_ALREADY_TAKEN: better_auth.RawError<"ORGANIZATION_SLUG_ALREADY_TAKEN">;
3788
- ORGANIZATION_NOT_FOUND: better_auth.RawError<"ORGANIZATION_NOT_FOUND">;
3789
- USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: better_auth.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION">;
3790
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION">;
3791
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION">;
3792
- NO_ACTIVE_ORGANIZATION: better_auth.RawError<"NO_ACTIVE_ORGANIZATION">;
3793
- USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: better_auth.RawError<"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION">;
3794
- MEMBER_NOT_FOUND: better_auth.RawError<"MEMBER_NOT_FOUND">;
3795
- ROLE_NOT_FOUND: better_auth.RawError<"ROLE_NOT_FOUND">;
3796
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM">;
3797
- TEAM_ALREADY_EXISTS: better_auth.RawError<"TEAM_ALREADY_EXISTS">;
3798
- TEAM_NOT_FOUND: better_auth.RawError<"TEAM_NOT_FOUND">;
3799
- YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: better_auth.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER">;
3800
- YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: better_auth.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER">;
3801
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER">;
3802
- YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION">;
3803
- USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: better_auth.RawError<"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION">;
3804
- INVITATION_NOT_FOUND: better_auth.RawError<"INVITATION_NOT_FOUND">;
3805
- YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: better_auth.RawError<"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION">;
3806
- EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: better_auth.RawError<"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION">;
3807
- YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION">;
3808
- INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: better_auth.RawError<"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION">;
3809
- YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE">;
3810
- FAILED_TO_RETRIEVE_INVITATION: better_auth.RawError<"FAILED_TO_RETRIEVE_INVITATION">;
3811
- YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: better_auth.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS">;
3812
- UNABLE_TO_REMOVE_LAST_TEAM: better_auth.RawError<"UNABLE_TO_REMOVE_LAST_TEAM">;
3813
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER">;
3814
- ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: better_auth.RawError<"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED">;
3815
- YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION">;
3816
- YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION">;
3817
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM">;
3818
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM">;
3819
- INVITATION_LIMIT_REACHED: better_auth.RawError<"INVITATION_LIMIT_REACHED">;
3820
- TEAM_MEMBER_LIMIT_REACHED: better_auth.RawError<"TEAM_MEMBER_LIMIT_REACHED">;
3821
- USER_IS_NOT_A_MEMBER_OF_THE_TEAM: better_auth.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_TEAM">;
3822
- YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: better_auth.RawError<"YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM">;
3823
- YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: better_auth.RawError<"YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM">;
3824
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER">;
3825
- YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER">;
3826
- YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION">;
3827
- YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION">;
3828
- MISSING_AC_INSTANCE: better_auth.RawError<"MISSING_AC_INSTANCE">;
3829
- YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: better_auth.RawError<"YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE">;
3830
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE">;
3831
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE">;
3832
- YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE">;
3833
- YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE">;
3834
- YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE">;
3835
- YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE">;
3836
- TOO_MANY_ROLES: better_auth.RawError<"TOO_MANY_ROLES">;
3837
- INVALID_RESOURCE: better_auth.RawError<"INVALID_RESOURCE">;
3838
- ROLE_NAME_IS_ALREADY_TAKEN: better_auth.RawError<"ROLE_NAME_IS_ALREADY_TAKEN">;
3839
- CANNOT_DELETE_A_PRE_DEFINED_ROLE: better_auth.RawError<"CANNOT_DELETE_A_PRE_DEFINED_ROLE">;
3840
- ROLE_IS_ASSIGNED_TO_MEMBERS: better_auth.RawError<"ROLE_IS_ASSIGNED_TO_MEMBERS">;
3841
- };
1537
+ }>;
1538
+ activeMemberRole: node_modules_better_auth_dist_client_query_mjs.AuthQueryAtom<{
1539
+ role: string;
1540
+ }>;
1541
+ };
1542
+ pathMethods: {
1543
+ "/organization/get-full-organization": "GET";
1544
+ "/organization/list-user-teams": "GET";
1545
+ };
1546
+ atomListeners: ({
1547
+ matcher(path: string): path is "/organization/create" | "/organization/update" | "/organization/delete";
1548
+ signal: "$listOrg";
1549
+ } | {
1550
+ matcher(path: string): boolean;
1551
+ signal: "$activeOrgSignal";
1552
+ } | {
1553
+ matcher(path: string): boolean;
1554
+ signal: "$sessionSignal";
1555
+ } | {
1556
+ matcher(path: string): boolean;
1557
+ signal: "$activeMemberSignal";
3842
1558
  } | {
1559
+ matcher(path: string): boolean;
1560
+ signal: "$activeMemberRoleSignal";
1561
+ })[];
1562
+ $ERROR_CODES: {
1563
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION">;
1564
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: better_auth.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS">;
1565
+ ORGANIZATION_ALREADY_EXISTS: better_auth.RawError<"ORGANIZATION_ALREADY_EXISTS">;
1566
+ ORGANIZATION_SLUG_ALREADY_TAKEN: better_auth.RawError<"ORGANIZATION_SLUG_ALREADY_TAKEN">;
1567
+ ORGANIZATION_NOT_FOUND: better_auth.RawError<"ORGANIZATION_NOT_FOUND">;
1568
+ USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: better_auth.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION">;
1569
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION">;
1570
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION">;
1571
+ NO_ACTIVE_ORGANIZATION: better_auth.RawError<"NO_ACTIVE_ORGANIZATION">;
1572
+ USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: better_auth.RawError<"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION">;
1573
+ MEMBER_NOT_FOUND: better_auth.RawError<"MEMBER_NOT_FOUND">;
1574
+ ROLE_NOT_FOUND: better_auth.RawError<"ROLE_NOT_FOUND">;
1575
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM">;
1576
+ TEAM_ALREADY_EXISTS: better_auth.RawError<"TEAM_ALREADY_EXISTS">;
1577
+ TEAM_NOT_FOUND: better_auth.RawError<"TEAM_NOT_FOUND">;
1578
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: better_auth.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER">;
1579
+ YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: better_auth.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER">;
1580
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER">;
1581
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION">;
1582
+ USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: better_auth.RawError<"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION">;
1583
+ INVITATION_NOT_FOUND: better_auth.RawError<"INVITATION_NOT_FOUND">;
1584
+ YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: better_auth.RawError<"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION">;
1585
+ EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: better_auth.RawError<"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION">;
1586
+ EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION: better_auth.RawError<"EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION">;
1587
+ YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION">;
1588
+ INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: better_auth.RawError<"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION">;
1589
+ YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE">;
1590
+ FAILED_TO_RETRIEVE_INVITATION: better_auth.RawError<"FAILED_TO_RETRIEVE_INVITATION">;
1591
+ YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: better_auth.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS">;
1592
+ UNABLE_TO_REMOVE_LAST_TEAM: better_auth.RawError<"UNABLE_TO_REMOVE_LAST_TEAM">;
1593
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER">;
1594
+ ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: better_auth.RawError<"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED">;
1595
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION">;
1596
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION">;
1597
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM">;
1598
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM">;
1599
+ INVITATION_LIMIT_REACHED: better_auth.RawError<"INVITATION_LIMIT_REACHED">;
1600
+ TEAM_MEMBER_LIMIT_REACHED: better_auth.RawError<"TEAM_MEMBER_LIMIT_REACHED">;
1601
+ USER_IS_NOT_A_MEMBER_OF_THE_TEAM: better_auth.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_TEAM">;
1602
+ YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: better_auth.RawError<"YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM">;
1603
+ YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: better_auth.RawError<"YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM">;
1604
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER">;
1605
+ YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER">;
1606
+ YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION">;
1607
+ YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION">;
1608
+ MISSING_AC_INSTANCE: better_auth.RawError<"MISSING_AC_INSTANCE">;
1609
+ YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: better_auth.RawError<"YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE">;
1610
+ YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE">;
1611
+ YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE">;
1612
+ YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE">;
1613
+ YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE">;
1614
+ YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE">;
1615
+ YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE">;
1616
+ TOO_MANY_ROLES: better_auth.RawError<"TOO_MANY_ROLES">;
1617
+ INVALID_RESOURCE: better_auth.RawError<"INVALID_RESOURCE">;
1618
+ ROLE_NAME_IS_ALREADY_TAKEN: better_auth.RawError<"ROLE_NAME_IS_ALREADY_TAKEN">;
1619
+ CANNOT_DELETE_A_PRE_DEFINED_ROLE: better_auth.RawError<"CANNOT_DELETE_A_PRE_DEFINED_ROLE">;
1620
+ ROLE_IS_ASSIGNED_TO_MEMBERS: better_auth.RawError<"ROLE_IS_ASSIGNED_TO_MEMBERS">;
1621
+ INVALID_TEAM_ID: better_auth.RawError<"INVALID_TEAM_ID">;
1622
+ };
1623
+ } | {
1624
+ id: "two-factor";
1625
+ version: string;
1626
+ $InferServerPlugin: ReturnType<(<O extends better_auth_plugins_two_factor.TwoFactorOptions>(options?: O) => {
3843
1627
  id: "two-factor";
3844
- $InferServerPlugin: ReturnType<(<O extends better_auth_plugins_two_factor.TwoFactorOptions>(options?: O) => {
3845
- id: "two-factor";
3846
- endpoints: {
3847
- enableTwoFactor: better_auth.StrictEndpoint<"/two-factor/enable", {
3848
- method: "POST";
3849
- body: better_auth.ZodObject<{
3850
- password: better_auth.ZodString;
3851
- issuer: better_auth.ZodOptional<better_auth.ZodString>;
3852
- }, better_auth.$strip>;
3853
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
3854
- session: {
3855
- session: Record<string, any> & {
3856
- id: string;
3857
- createdAt: Date;
3858
- updatedAt: Date;
3859
- userId: string;
3860
- expiresAt: Date;
3861
- token: string;
3862
- ipAddress?: string | null | undefined;
3863
- userAgent?: string | null | undefined;
3864
- };
3865
- user: Record<string, any> & {
3866
- id: string;
3867
- createdAt: Date;
3868
- updatedAt: Date;
3869
- email: string;
3870
- emailVerified: boolean;
3871
- name: string;
3872
- image?: string | null | undefined;
3873
- };
1628
+ version: string;
1629
+ endpoints: {
1630
+ enableTwoFactor: better_auth.StrictEndpoint<"/two-factor/enable", {
1631
+ method: "POST";
1632
+ body: zod.ZodObject<{
1633
+ password: zod.ZodOptional<zod.ZodString>;
1634
+ issuer: zod.ZodOptional<zod.ZodString>;
1635
+ }, zod_v4_core.$strip> | zod.ZodObject<{
1636
+ password: zod.ZodString;
1637
+ issuer: zod.ZodOptional<zod.ZodString>;
1638
+ }, zod_v4_core.$strip>;
1639
+ use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
1640
+ session: {
1641
+ session: Record<string, any> & {
1642
+ id: string;
1643
+ createdAt: Date;
1644
+ updatedAt: Date;
1645
+ userId: string;
1646
+ expiresAt: Date;
1647
+ token: string;
1648
+ ipAddress?: string | null | undefined;
1649
+ userAgent?: string | null | undefined;
3874
1650
  };
3875
- }>)[];
3876
- metadata: {
3877
- openapi: {
3878
- summary: string;
3879
- description: string;
3880
- responses: {
3881
- 200: {
3882
- description: string;
3883
- content: {
3884
- "application/json": {
3885
- schema: {
3886
- type: "object";
3887
- properties: {
3888
- totpURI: {
3889
- type: string;
3890
- description: string;
3891
- };
3892
- backupCodes: {
1651
+ user: Record<string, any> & {
1652
+ id: string;
1653
+ createdAt: Date;
1654
+ updatedAt: Date;
1655
+ email: string;
1656
+ emailVerified: boolean;
1657
+ name: string;
1658
+ image?: string | null | undefined;
1659
+ };
1660
+ };
1661
+ }>)[];
1662
+ metadata: {
1663
+ openapi: {
1664
+ summary: string;
1665
+ description: string;
1666
+ responses: {
1667
+ 200: {
1668
+ description: string;
1669
+ content: {
1670
+ "application/json": {
1671
+ schema: {
1672
+ type: "object";
1673
+ properties: {
1674
+ totpURI: {
1675
+ type: string;
1676
+ description: string;
1677
+ };
1678
+ backupCodes: {
1679
+ type: string;
1680
+ items: {
3893
1681
  type: string;
3894
- items: {
3895
- type: string;
3896
- };
3897
- description: string;
3898
1682
  };
1683
+ description: string;
3899
1684
  };
3900
1685
  };
3901
1686
  };
@@ -3904,53 +1689,55 @@ declare const authClient: {
3904
1689
  };
3905
1690
  };
3906
1691
  };
3907
- }, {
3908
- totpURI: string;
3909
- backupCodes: string[];
3910
- }>;
3911
- disableTwoFactor: better_auth.StrictEndpoint<"/two-factor/disable", {
3912
- method: "POST";
3913
- body: better_auth.ZodObject<{
3914
- password: better_auth.ZodString;
3915
- }, better_auth.$strip>;
3916
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
3917
- session: {
3918
- session: Record<string, any> & {
3919
- id: string;
3920
- createdAt: Date;
3921
- updatedAt: Date;
3922
- userId: string;
3923
- expiresAt: Date;
3924
- token: string;
3925
- ipAddress?: string | null | undefined;
3926
- userAgent?: string | null | undefined;
3927
- };
3928
- user: Record<string, any> & {
3929
- id: string;
3930
- createdAt: Date;
3931
- updatedAt: Date;
3932
- email: string;
3933
- emailVerified: boolean;
3934
- name: string;
3935
- image?: string | null | undefined;
3936
- };
1692
+ };
1693
+ }, {
1694
+ totpURI: string;
1695
+ backupCodes: string[];
1696
+ }>;
1697
+ disableTwoFactor: better_auth.StrictEndpoint<"/two-factor/disable", {
1698
+ method: "POST";
1699
+ body: zod.ZodObject<{
1700
+ password: zod.ZodOptional<zod.ZodString>;
1701
+ }, zod_v4_core.$strip> | zod.ZodObject<{
1702
+ password: zod.ZodString;
1703
+ }, zod_v4_core.$strip>;
1704
+ use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
1705
+ session: {
1706
+ session: Record<string, any> & {
1707
+ id: string;
1708
+ createdAt: Date;
1709
+ updatedAt: Date;
1710
+ userId: string;
1711
+ expiresAt: Date;
1712
+ token: string;
1713
+ ipAddress?: string | null | undefined;
1714
+ userAgent?: string | null | undefined;
3937
1715
  };
3938
- }>)[];
3939
- metadata: {
3940
- openapi: {
3941
- summary: string;
3942
- description: string;
3943
- responses: {
3944
- 200: {
3945
- description: string;
3946
- content: {
3947
- "application/json": {
3948
- schema: {
3949
- type: "object";
3950
- properties: {
3951
- status: {
3952
- type: string;
3953
- };
1716
+ user: Record<string, any> & {
1717
+ id: string;
1718
+ createdAt: Date;
1719
+ updatedAt: Date;
1720
+ email: string;
1721
+ emailVerified: boolean;
1722
+ name: string;
1723
+ image?: string | null | undefined;
1724
+ };
1725
+ };
1726
+ }>)[];
1727
+ metadata: {
1728
+ openapi: {
1729
+ summary: string;
1730
+ description: string;
1731
+ responses: {
1732
+ 200: {
1733
+ description: string;
1734
+ content: {
1735
+ "application/json": {
1736
+ schema: {
1737
+ type: "object";
1738
+ properties: {
1739
+ status: {
1740
+ type: string;
3954
1741
  };
3955
1742
  };
3956
1743
  };
@@ -3959,213 +1746,215 @@ declare const authClient: {
3959
1746
  };
3960
1747
  };
3961
1748
  };
3962
- }, {
3963
- status: boolean;
3964
- }>;
3965
- verifyBackupCode: better_auth.StrictEndpoint<"/two-factor/verify-backup-code", {
3966
- method: "POST";
3967
- body: better_auth.ZodObject<{
3968
- code: better_auth.ZodString;
3969
- disableSession: better_auth.ZodOptional<better_auth.ZodBoolean>;
3970
- trustDevice: better_auth.ZodOptional<better_auth.ZodBoolean>;
3971
- }, better_auth.$strip>;
3972
- metadata: {
3973
- openapi: {
3974
- description: string;
3975
- responses: {
3976
- "200": {
3977
- description: string;
3978
- content: {
3979
- "application/json": {
3980
- schema: {
3981
- type: "object";
3982
- properties: {
3983
- user: {
3984
- type: string;
3985
- properties: {
3986
- id: {
3987
- type: string;
3988
- description: string;
3989
- };
3990
- email: {
3991
- type: string;
3992
- format: string;
3993
- nullable: boolean;
3994
- description: string;
3995
- };
3996
- emailVerified: {
3997
- type: string;
3998
- nullable: boolean;
3999
- description: string;
4000
- };
4001
- name: {
4002
- type: string;
4003
- nullable: boolean;
4004
- description: string;
4005
- };
4006
- image: {
4007
- type: string;
4008
- format: string;
4009
- nullable: boolean;
4010
- description: string;
4011
- };
4012
- twoFactorEnabled: {
4013
- type: string;
4014
- description: string;
4015
- };
4016
- createdAt: {
4017
- type: string;
4018
- format: string;
4019
- description: string;
4020
- };
4021
- updatedAt: {
4022
- type: string;
4023
- format: string;
4024
- description: string;
4025
- };
1749
+ };
1750
+ }, {
1751
+ status: boolean;
1752
+ }>;
1753
+ verifyBackupCode: better_auth.StrictEndpoint<"/two-factor/verify-backup-code", {
1754
+ method: "POST";
1755
+ body: zod.ZodObject<{
1756
+ code: zod.ZodString;
1757
+ disableSession: zod.ZodOptional<zod.ZodBoolean>;
1758
+ trustDevice: zod.ZodOptional<zod.ZodBoolean>;
1759
+ }, zod_v4_core.$strip>;
1760
+ metadata: {
1761
+ openapi: {
1762
+ description: string;
1763
+ responses: {
1764
+ "200": {
1765
+ description: string;
1766
+ content: {
1767
+ "application/json": {
1768
+ schema: {
1769
+ type: "object";
1770
+ properties: {
1771
+ user: {
1772
+ type: string;
1773
+ properties: {
1774
+ id: {
1775
+ type: string;
1776
+ description: string;
1777
+ };
1778
+ email: {
1779
+ type: string;
1780
+ format: string;
1781
+ nullable: boolean;
1782
+ description: string;
1783
+ };
1784
+ emailVerified: {
1785
+ type: string;
1786
+ nullable: boolean;
1787
+ description: string;
1788
+ };
1789
+ name: {
1790
+ type: string;
1791
+ nullable: boolean;
1792
+ description: string;
1793
+ };
1794
+ image: {
1795
+ type: string;
1796
+ format: string;
1797
+ nullable: boolean;
1798
+ description: string;
1799
+ };
1800
+ twoFactorEnabled: {
1801
+ type: string;
1802
+ description: string;
1803
+ };
1804
+ createdAt: {
1805
+ type: string;
1806
+ format: string;
1807
+ description: string;
1808
+ };
1809
+ updatedAt: {
1810
+ type: string;
1811
+ format: string;
1812
+ description: string;
4026
1813
  };
4027
- required: string[];
4028
- description: string;
4029
1814
  };
4030
- session: {
4031
- type: string;
4032
- properties: {
4033
- token: {
4034
- type: string;
4035
- description: string;
4036
- };
4037
- userId: {
4038
- type: string;
4039
- description: string;
4040
- };
4041
- createdAt: {
4042
- type: string;
4043
- format: string;
4044
- description: string;
4045
- };
4046
- expiresAt: {
4047
- type: string;
4048
- format: string;
4049
- description: string;
4050
- };
1815
+ required: string[];
1816
+ description: string;
1817
+ };
1818
+ session: {
1819
+ type: string;
1820
+ properties: {
1821
+ token: {
1822
+ type: string;
1823
+ description: string;
1824
+ };
1825
+ userId: {
1826
+ type: string;
1827
+ description: string;
1828
+ };
1829
+ createdAt: {
1830
+ type: string;
1831
+ format: string;
1832
+ description: string;
1833
+ };
1834
+ expiresAt: {
1835
+ type: string;
1836
+ format: string;
1837
+ description: string;
4051
1838
  };
4052
- required: string[];
4053
- description: string;
4054
1839
  };
1840
+ required: string[];
1841
+ description: string;
4055
1842
  };
4056
- required: string[];
4057
1843
  };
1844
+ required: string[];
4058
1845
  };
4059
1846
  };
4060
1847
  };
4061
1848
  };
4062
1849
  };
4063
1850
  };
4064
- }, {
4065
- token: string | undefined;
4066
- user: (Record<string, any> & {
4067
- id: string;
4068
- createdAt: Date;
4069
- updatedAt: Date;
4070
- email: string;
4071
- emailVerified: boolean;
4072
- name: string;
4073
- image?: string | null | undefined;
4074
- }) | better_auth_plugins_two_factor.UserWithTwoFactor;
4075
- }>;
4076
- generateBackupCodes: better_auth.StrictEndpoint<"/two-factor/generate-backup-codes", {
4077
- method: "POST";
4078
- body: better_auth.ZodObject<{
4079
- password: better_auth.ZodString;
4080
- }, better_auth.$strip>;
4081
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
4082
- session: {
4083
- session: Record<string, any> & {
4084
- id: string;
4085
- createdAt: Date;
4086
- updatedAt: Date;
4087
- userId: string;
4088
- expiresAt: Date;
4089
- token: string;
4090
- ipAddress?: string | null | undefined;
4091
- userAgent?: string | null | undefined;
4092
- };
4093
- user: Record<string, any> & {
4094
- id: string;
4095
- createdAt: Date;
4096
- updatedAt: Date;
4097
- email: string;
4098
- emailVerified: boolean;
4099
- name: string;
4100
- image?: string | null | undefined;
4101
- };
1851
+ };
1852
+ }, {
1853
+ token: string | undefined;
1854
+ user: (Record<string, any> & {
1855
+ id: string;
1856
+ createdAt: Date;
1857
+ updatedAt: Date;
1858
+ email: string;
1859
+ emailVerified: boolean;
1860
+ name: string;
1861
+ image?: string | null | undefined;
1862
+ }) | better_auth_plugins_two_factor.UserWithTwoFactor;
1863
+ }>;
1864
+ generateBackupCodes: better_auth.StrictEndpoint<"/two-factor/generate-backup-codes", {
1865
+ method: "POST";
1866
+ body: zod.ZodObject<{
1867
+ password: zod.ZodOptional<zod.ZodString>;
1868
+ }, zod_v4_core.$strip> | zod.ZodObject<{
1869
+ password: zod.ZodString;
1870
+ }, zod_v4_core.$strip>;
1871
+ use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
1872
+ session: {
1873
+ session: Record<string, any> & {
1874
+ id: string;
1875
+ createdAt: Date;
1876
+ updatedAt: Date;
1877
+ userId: string;
1878
+ expiresAt: Date;
1879
+ token: string;
1880
+ ipAddress?: string | null | undefined;
1881
+ userAgent?: string | null | undefined;
4102
1882
  };
4103
- }>)[];
4104
- metadata: {
4105
- openapi: {
4106
- description: string;
4107
- responses: {
4108
- "200": {
4109
- description: string;
4110
- content: {
4111
- "application/json": {
4112
- schema: {
4113
- type: "object";
4114
- properties: {
4115
- status: {
4116
- type: string;
4117
- description: string;
4118
- enum: boolean[];
4119
- };
4120
- backupCodes: {
1883
+ user: Record<string, any> & {
1884
+ id: string;
1885
+ createdAt: Date;
1886
+ updatedAt: Date;
1887
+ email: string;
1888
+ emailVerified: boolean;
1889
+ name: string;
1890
+ image?: string | null | undefined;
1891
+ };
1892
+ };
1893
+ }>)[];
1894
+ metadata: {
1895
+ openapi: {
1896
+ description: string;
1897
+ responses: {
1898
+ "200": {
1899
+ description: string;
1900
+ content: {
1901
+ "application/json": {
1902
+ schema: {
1903
+ type: "object";
1904
+ properties: {
1905
+ status: {
1906
+ type: string;
1907
+ description: string;
1908
+ enum: boolean[];
1909
+ };
1910
+ backupCodes: {
1911
+ type: string;
1912
+ items: {
4121
1913
  type: string;
4122
- items: {
4123
- type: string;
4124
- };
4125
- description: string;
4126
1914
  };
1915
+ description: string;
4127
1916
  };
4128
- required: string[];
4129
1917
  };
1918
+ required: string[];
4130
1919
  };
4131
1920
  };
4132
1921
  };
4133
1922
  };
4134
1923
  };
4135
1924
  };
4136
- }, {
4137
- status: boolean;
4138
- backupCodes: string[];
4139
- }>;
4140
- viewBackupCodes: better_auth.StrictEndpoint<string, {
4141
- method: "POST";
4142
- body: better_auth.ZodObject<{
4143
- userId: better_auth.ZodCoercedString<unknown>;
4144
- }, better_auth.$strip>;
4145
- }, {
4146
- status: boolean;
4147
- backupCodes: string[];
4148
- }>;
4149
- sendTwoFactorOTP: better_auth.StrictEndpoint<"/two-factor/send-otp", {
4150
- method: "POST";
4151
- body: better_auth.ZodOptional<better_auth.ZodObject<{
4152
- trustDevice: better_auth.ZodOptional<better_auth.ZodBoolean>;
4153
- }, better_auth.$strip>>;
4154
- metadata: {
4155
- openapi: {
4156
- summary: string;
4157
- description: string;
4158
- responses: {
4159
- 200: {
4160
- description: string;
4161
- content: {
4162
- "application/json": {
4163
- schema: {
4164
- type: "object";
4165
- properties: {
4166
- status: {
4167
- type: string;
4168
- };
1925
+ };
1926
+ }, {
1927
+ status: boolean;
1928
+ backupCodes: string[];
1929
+ }>;
1930
+ viewBackupCodes: better_auth.StrictEndpoint<string, {
1931
+ method: "POST";
1932
+ body: zod.ZodObject<{
1933
+ userId: zod.ZodCoercedString<unknown>;
1934
+ }, zod_v4_core.$strip>;
1935
+ }, {
1936
+ status: boolean;
1937
+ backupCodes: string[];
1938
+ }>;
1939
+ sendTwoFactorOTP: better_auth.StrictEndpoint<"/two-factor/send-otp", {
1940
+ method: "POST";
1941
+ body: zod.ZodOptional<zod.ZodObject<{
1942
+ trustDevice: zod.ZodOptional<zod.ZodBoolean>;
1943
+ }, zod_v4_core.$strip>>;
1944
+ metadata: {
1945
+ openapi: {
1946
+ summary: string;
1947
+ description: string;
1948
+ responses: {
1949
+ 200: {
1950
+ description: string;
1951
+ content: {
1952
+ "application/json": {
1953
+ schema: {
1954
+ type: "object";
1955
+ properties: {
1956
+ status: {
1957
+ type: string;
4169
1958
  };
4170
1959
  };
4171
1960
  };
@@ -4174,118 +1963,118 @@ declare const authClient: {
4174
1963
  };
4175
1964
  };
4176
1965
  };
4177
- }, {
4178
- status: boolean;
4179
- }>;
4180
- verifyTwoFactorOTP: better_auth.StrictEndpoint<"/two-factor/verify-otp", {
4181
- method: "POST";
4182
- body: better_auth.ZodObject<{
4183
- code: better_auth.ZodString;
4184
- trustDevice: better_auth.ZodOptional<better_auth.ZodBoolean>;
4185
- }, better_auth.$strip>;
4186
- metadata: {
4187
- openapi: {
4188
- summary: string;
4189
- description: string;
4190
- responses: {
4191
- "200": {
4192
- description: string;
4193
- content: {
4194
- "application/json": {
4195
- schema: {
4196
- type: "object";
4197
- properties: {
4198
- token: {
4199
- type: string;
4200
- description: string;
4201
- };
4202
- user: {
4203
- type: string;
4204
- properties: {
4205
- id: {
4206
- type: string;
4207
- description: string;
4208
- };
4209
- email: {
4210
- type: string;
4211
- format: string;
4212
- nullable: boolean;
4213
- description: string;
4214
- };
4215
- emailVerified: {
4216
- type: string;
4217
- nullable: boolean;
4218
- description: string;
4219
- };
4220
- name: {
4221
- type: string;
4222
- nullable: boolean;
4223
- description: string;
4224
- };
4225
- image: {
4226
- type: string;
4227
- format: string;
4228
- nullable: boolean;
4229
- description: string;
4230
- };
4231
- createdAt: {
4232
- type: string;
4233
- format: string;
4234
- description: string;
4235
- };
4236
- updatedAt: {
4237
- type: string;
4238
- format: string;
4239
- description: string;
4240
- };
1966
+ };
1967
+ }, {
1968
+ status: boolean;
1969
+ }>;
1970
+ verifyTwoFactorOTP: better_auth.StrictEndpoint<"/two-factor/verify-otp", {
1971
+ method: "POST";
1972
+ body: zod.ZodObject<{
1973
+ code: zod.ZodString;
1974
+ trustDevice: zod.ZodOptional<zod.ZodBoolean>;
1975
+ }, zod_v4_core.$strip>;
1976
+ metadata: {
1977
+ openapi: {
1978
+ summary: string;
1979
+ description: string;
1980
+ responses: {
1981
+ "200": {
1982
+ description: string;
1983
+ content: {
1984
+ "application/json": {
1985
+ schema: {
1986
+ type: "object";
1987
+ properties: {
1988
+ token: {
1989
+ type: string;
1990
+ description: string;
1991
+ };
1992
+ user: {
1993
+ type: string;
1994
+ properties: {
1995
+ id: {
1996
+ type: string;
1997
+ description: string;
1998
+ };
1999
+ email: {
2000
+ type: string;
2001
+ format: string;
2002
+ nullable: boolean;
2003
+ description: string;
2004
+ };
2005
+ emailVerified: {
2006
+ type: string;
2007
+ nullable: boolean;
2008
+ description: string;
2009
+ };
2010
+ name: {
2011
+ type: string;
2012
+ nullable: boolean;
2013
+ description: string;
2014
+ };
2015
+ image: {
2016
+ type: string;
2017
+ format: string;
2018
+ nullable: boolean;
2019
+ description: string;
2020
+ };
2021
+ createdAt: {
2022
+ type: string;
2023
+ format: string;
2024
+ description: string;
2025
+ };
2026
+ updatedAt: {
2027
+ type: string;
2028
+ format: string;
2029
+ description: string;
4241
2030
  };
4242
- required: string[];
4243
- description: string;
4244
2031
  };
2032
+ required: string[];
2033
+ description: string;
4245
2034
  };
4246
- required: string[];
4247
2035
  };
2036
+ required: string[];
4248
2037
  };
4249
2038
  };
4250
2039
  };
4251
2040
  };
4252
2041
  };
4253
2042
  };
4254
- }, {
4255
- token: string;
4256
- user: better_auth_plugins_two_factor.UserWithTwoFactor;
4257
- } | {
4258
- token: string;
4259
- user: Record<string, any> & {
4260
- id: string;
4261
- createdAt: Date;
4262
- updatedAt: Date;
4263
- email: string;
4264
- emailVerified: boolean;
4265
- name: string;
4266
- image?: string | null | undefined;
4267
- };
4268
- }>;
4269
- generateTOTP: better_auth.StrictEndpoint<string, {
4270
- method: "POST";
4271
- body: better_auth.ZodObject<{
4272
- secret: better_auth.ZodString;
4273
- }, better_auth.$strip>;
4274
- metadata: {
4275
- openapi: {
4276
- summary: string;
4277
- description: string;
4278
- responses: {
4279
- 200: {
4280
- description: string;
4281
- content: {
4282
- "application/json": {
4283
- schema: {
4284
- type: "object";
4285
- properties: {
4286
- code: {
4287
- type: string;
4288
- };
2043
+ };
2044
+ }, {
2045
+ token: string;
2046
+ user: better_auth_plugins_two_factor.UserWithTwoFactor;
2047
+ } | {
2048
+ token: string;
2049
+ user: Record<string, any> & {
2050
+ id: string;
2051
+ createdAt: Date;
2052
+ updatedAt: Date;
2053
+ email: string;
2054
+ emailVerified: boolean;
2055
+ name: string;
2056
+ image?: string | null | undefined;
2057
+ };
2058
+ }>;
2059
+ generateTOTP: better_auth.StrictEndpoint<string, {
2060
+ method: "POST";
2061
+ body: zod.ZodObject<{
2062
+ secret: zod.ZodString;
2063
+ }, zod_v4_core.$strip>;
2064
+ metadata: {
2065
+ openapi: {
2066
+ summary: string;
2067
+ description: string;
2068
+ responses: {
2069
+ 200: {
2070
+ description: string;
2071
+ content: {
2072
+ "application/json": {
2073
+ schema: {
2074
+ type: "object";
2075
+ properties: {
2076
+ code: {
2077
+ type: string;
4289
2078
  };
4290
2079
  };
4291
2080
  };
@@ -4294,52 +2083,54 @@ declare const authClient: {
4294
2083
  };
4295
2084
  };
4296
2085
  };
4297
- }, {
4298
- code: string;
4299
- }>;
4300
- getTOTPURI: better_auth.StrictEndpoint<"/two-factor/get-totp-uri", {
4301
- method: "POST";
4302
- use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
4303
- session: {
4304
- session: Record<string, any> & {
4305
- id: string;
4306
- createdAt: Date;
4307
- updatedAt: Date;
4308
- userId: string;
4309
- expiresAt: Date;
4310
- token: string;
4311
- ipAddress?: string | null | undefined;
4312
- userAgent?: string | null | undefined;
4313
- };
4314
- user: Record<string, any> & {
4315
- id: string;
4316
- createdAt: Date;
4317
- updatedAt: Date;
4318
- email: string;
4319
- emailVerified: boolean;
4320
- name: string;
4321
- image?: string | null | undefined;
4322
- };
2086
+ };
2087
+ }, {
2088
+ code: string;
2089
+ }>;
2090
+ getTOTPURI: better_auth.StrictEndpoint<"/two-factor/get-totp-uri", {
2091
+ method: "POST";
2092
+ use: ((inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2093
+ session: {
2094
+ session: Record<string, any> & {
2095
+ id: string;
2096
+ createdAt: Date;
2097
+ updatedAt: Date;
2098
+ userId: string;
2099
+ expiresAt: Date;
2100
+ token: string;
2101
+ ipAddress?: string | null | undefined;
2102
+ userAgent?: string | null | undefined;
4323
2103
  };
4324
- }>)[];
4325
- body: better_auth.ZodObject<{
4326
- password: better_auth.ZodString;
4327
- }, better_auth.$strip>;
4328
- metadata: {
4329
- openapi: {
4330
- summary: string;
4331
- description: string;
4332
- responses: {
4333
- 200: {
4334
- description: string;
4335
- content: {
4336
- "application/json": {
4337
- schema: {
4338
- type: "object";
4339
- properties: {
4340
- totpURI: {
4341
- type: string;
4342
- };
2104
+ user: Record<string, any> & {
2105
+ id: string;
2106
+ createdAt: Date;
2107
+ updatedAt: Date;
2108
+ email: string;
2109
+ emailVerified: boolean;
2110
+ name: string;
2111
+ image?: string | null | undefined;
2112
+ };
2113
+ };
2114
+ }>)[];
2115
+ body: zod.ZodObject<{
2116
+ password: zod.ZodOptional<zod.ZodString>;
2117
+ }, zod_v4_core.$strip> | zod.ZodObject<{
2118
+ password: zod.ZodString;
2119
+ }, zod_v4_core.$strip>;
2120
+ metadata: {
2121
+ openapi: {
2122
+ summary: string;
2123
+ description: string;
2124
+ responses: {
2125
+ 200: {
2126
+ description: string;
2127
+ content: {
2128
+ "application/json": {
2129
+ schema: {
2130
+ type: "object";
2131
+ properties: {
2132
+ totpURI: {
2133
+ type: string;
4343
2134
  };
4344
2135
  };
4345
2136
  };
@@ -4348,30 +2139,30 @@ declare const authClient: {
4348
2139
  };
4349
2140
  };
4350
2141
  };
4351
- }, {
4352
- totpURI: string;
4353
- }>;
4354
- verifyTOTP: better_auth.StrictEndpoint<"/two-factor/verify-totp", {
4355
- method: "POST";
4356
- body: better_auth.ZodObject<{
4357
- code: better_auth.ZodString;
4358
- trustDevice: better_auth.ZodOptional<better_auth.ZodBoolean>;
4359
- }, better_auth.$strip>;
4360
- metadata: {
4361
- openapi: {
4362
- summary: string;
4363
- description: string;
4364
- responses: {
4365
- 200: {
4366
- description: string;
4367
- content: {
4368
- "application/json": {
4369
- schema: {
4370
- type: "object";
4371
- properties: {
4372
- status: {
4373
- type: string;
4374
- };
2142
+ };
2143
+ }, {
2144
+ totpURI: string;
2145
+ }>;
2146
+ verifyTOTP: better_auth.StrictEndpoint<"/two-factor/verify-totp", {
2147
+ method: "POST";
2148
+ body: zod.ZodObject<{
2149
+ code: zod.ZodString;
2150
+ trustDevice: zod.ZodOptional<zod.ZodBoolean>;
2151
+ }, zod_v4_core.$strip>;
2152
+ metadata: {
2153
+ openapi: {
2154
+ summary: string;
2155
+ description: string;
2156
+ responses: {
2157
+ 200: {
2158
+ description: string;
2159
+ content: {
2160
+ "application/json": {
2161
+ schema: {
2162
+ type: "object";
2163
+ properties: {
2164
+ status: {
2165
+ type: string;
4375
2166
  };
4376
2167
  };
4377
2168
  };
@@ -4380,105 +2171,93 @@ declare const authClient: {
4380
2171
  };
4381
2172
  };
4382
2173
  };
4383
- }, {
4384
- token: string;
4385
- user: better_auth_plugins_two_factor.UserWithTwoFactor;
4386
- } | {
4387
- token: string;
4388
- user: Record<string, any> & {
4389
- id: string;
4390
- createdAt: Date;
4391
- updatedAt: Date;
4392
- email: string;
4393
- emailVerified: boolean;
4394
- name: string;
4395
- image?: string | null | undefined;
2174
+ };
2175
+ }, {
2176
+ token: string;
2177
+ user: better_auth_plugins_two_factor.UserWithTwoFactor;
2178
+ } | {
2179
+ token: string;
2180
+ user: Record<string, any> & {
2181
+ id: string;
2182
+ createdAt: Date;
2183
+ updatedAt: Date;
2184
+ email: string;
2185
+ emailVerified: boolean;
2186
+ name: string;
2187
+ image?: string | null | undefined;
2188
+ };
2189
+ }>;
2190
+ };
2191
+ options: NoInfer<O>;
2192
+ hooks: {
2193
+ after: {
2194
+ matcher(context: better_auth.HookEndpointContext): boolean;
2195
+ handler: (inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
2196
+ twoFactorRedirect: boolean;
2197
+ twoFactorMethods: string[];
2198
+ } | undefined>;
2199
+ }[];
2200
+ };
2201
+ schema: {
2202
+ user: {
2203
+ fields: {
2204
+ twoFactorEnabled: {
2205
+ type: "boolean";
2206
+ required: false;
2207
+ defaultValue: false;
2208
+ input: false;
4396
2209
  };
4397
- }>;
4398
- };
4399
- options: NoInfer<O>;
4400
- hooks: {
4401
- after: {
4402
- matcher(context: better_auth.HookEndpointContext): boolean;
4403
- handler: (inputContext: better_auth.MiddlewareInputContext<better_auth.MiddlewareOptions>) => Promise<{
4404
- twoFactorRedirect: boolean;
4405
- } | undefined>;
4406
- }[];
2210
+ };
4407
2211
  };
4408
- schema: {
4409
- user: {
4410
- fields: {
4411
- twoFactorEnabled: {
4412
- type: "boolean";
4413
- required: false;
4414
- defaultValue: false;
4415
- input: false;
4416
- };
2212
+ twoFactor: {
2213
+ fields: {
2214
+ secret: {
2215
+ type: "string";
2216
+ required: true;
2217
+ returned: false;
2218
+ index: true;
4417
2219
  };
4418
- };
4419
- twoFactor: {
4420
- fields: {
4421
- secret: {
4422
- type: "string";
4423
- required: true;
4424
- returned: false;
4425
- index: true;
4426
- };
4427
- backupCodes: {
4428
- type: "string";
4429
- required: true;
4430
- returned: false;
4431
- };
4432
- userId: {
4433
- type: "string";
4434
- required: true;
4435
- returned: false;
4436
- references: {
4437
- model: string;
4438
- field: string;
4439
- };
4440
- index: true;
2220
+ backupCodes: {
2221
+ type: "string";
2222
+ required: true;
2223
+ returned: false;
2224
+ };
2225
+ userId: {
2226
+ type: "string";
2227
+ required: true;
2228
+ returned: false;
2229
+ references: {
2230
+ model: string;
2231
+ field: string;
4441
2232
  };
2233
+ index: true;
2234
+ };
2235
+ verified: {
2236
+ type: "boolean";
2237
+ required: false;
2238
+ defaultValue: true;
2239
+ input: false;
2240
+ };
2241
+ failedVerificationCount: {
2242
+ type: "number";
2243
+ required: false;
2244
+ defaultValue: number;
2245
+ input: false;
2246
+ returned: false;
2247
+ };
2248
+ lockedUntil: {
2249
+ type: "date";
2250
+ required: false;
2251
+ input: false;
2252
+ returned: false;
4442
2253
  };
4443
2254
  };
4444
2255
  };
4445
- rateLimit: {
4446
- pathMatcher(path: string): boolean;
4447
- window: number;
4448
- max: number;
4449
- }[];
4450
- $ERROR_CODES: {
4451
- OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
4452
- OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
4453
- TOTP_NOT_ENABLED: better_auth.RawError<"TOTP_NOT_ENABLED">;
4454
- TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
4455
- BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
4456
- INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
4457
- INVALID_CODE: better_auth.RawError<"INVALID_CODE">;
4458
- TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: better_auth.RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
4459
- INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
4460
- };
4461
- })>;
4462
- atomListeners: {
4463
- matcher: (path: string) => boolean;
4464
- signal: "$sessionSignal";
4465
- }[];
4466
- pathMethods: {
4467
- "/two-factor/disable": "POST";
4468
- "/two-factor/enable": "POST";
4469
- "/two-factor/send-otp": "POST";
4470
- "/two-factor/generate-backup-codes": "POST";
4471
- "/two-factor/get-totp-uri": "POST";
4472
- "/two-factor/verify-totp": "POST";
4473
- "/two-factor/verify-otp": "POST";
4474
- "/two-factor/verify-backup-code": "POST";
4475
2256
  };
4476
- fetchPlugins: {
4477
- id: string;
4478
- name: string;
4479
- hooks: {
4480
- onSuccess(context: better_auth_react.SuccessContext<any>): Promise<void>;
4481
- };
2257
+ rateLimit: {
2258
+ pathMatcher(path: string): boolean;
2259
+ window: number;
2260
+ max: number;
4482
2261
  }[];
4483
2262
  $ERROR_CODES: {
4484
2263
  OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
@@ -4489,639 +2268,45 @@ declare const authClient: {
4489
2268
  INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
4490
2269
  INVALID_CODE: better_auth.RawError<"INVALID_CODE">;
4491
2270
  TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: better_auth.RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
2271
+ ACCOUNT_TEMPORARILY_LOCKED: better_auth.RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
4492
2272
  INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
4493
2273
  };
4494
- })[];
4495
- }, FetchOptions>> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4496
- status: boolean;
4497
- }, {
4498
- code?: string | undefined;
4499
- message?: string | undefined;
4500
- }, FetchOptions["throw"] extends true ? true : false>>;
4501
- } & {
4502
- deleteUser: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
4503
- callbackURL?: string | undefined;
4504
- password?: string | undefined;
4505
- token?: string | undefined;
4506
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
4507
- callbackURL?: string | undefined;
4508
- password?: string | undefined;
4509
- token?: string | undefined;
4510
- } & {
4511
- fetchOptions?: FetchOptions | undefined;
4512
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4513
- success: boolean;
4514
- message: string;
4515
- }, {
4516
- code?: string | undefined;
4517
- message?: string | undefined;
4518
- }, FetchOptions["throw"] extends true ? true : false>>;
4519
- } & {
4520
- requestPasswordReset: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
4521
- email: string;
4522
- redirectTo?: string | undefined;
4523
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
4524
- email: string;
4525
- redirectTo?: string | undefined;
4526
- } & {
4527
- fetchOptions?: FetchOptions | undefined;
4528
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4529
- status: boolean;
4530
- message: string;
4531
- }, {
4532
- code?: string | undefined;
4533
- message?: string | undefined;
4534
- }, FetchOptions["throw"] extends true ? true : false>>;
4535
- } & {
4536
- resetPassword: {
4537
- ":token": <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
4538
- callbackURL: string;
4539
- }> & Record<string, any>, {
4540
- token: string;
4541
- }>>(data_0: better_auth.Prettify<{
4542
- query: {
4543
- callbackURL: string;
4544
- };
4545
- fetchOptions?: FetchOptions | undefined;
4546
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<never, {
4547
- code?: string | undefined;
4548
- message?: string | undefined;
4549
- }, FetchOptions["throw"] extends true ? true : false>>;
4550
- };
4551
- } & {
4552
- listSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
4553
- query?: Record<string, any> | undefined;
4554
- fetchOptions?: FetchOptions | undefined;
4555
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<better_auth.Prettify<{
4556
- id: string;
4557
- createdAt: Date;
4558
- updatedAt: Date;
4559
- userId: string;
4560
- expiresAt: Date;
4561
- token: string;
4562
- ipAddress?: string | null | undefined | undefined;
4563
- userAgent?: string | null | undefined | undefined;
4564
- }>[], {
4565
- code?: string | undefined;
4566
- message?: string | undefined;
4567
- }, FetchOptions["throw"] extends true ? true : false>>;
4568
- } & {
4569
- revokeSession: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
4570
- token: string;
4571
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
4572
- token: string;
4573
- } & {
4574
- fetchOptions?: FetchOptions | undefined;
4575
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4576
- status: boolean;
4577
- }, {
4578
- code?: string | undefined;
4579
- message?: string | undefined;
4580
- }, FetchOptions["throw"] extends true ? true : false>>;
4581
- } & {
4582
- revokeSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
4583
- query?: Record<string, any> | undefined;
4584
- fetchOptions?: FetchOptions | undefined;
4585
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4586
- status: boolean;
4587
- }, {
4588
- code?: string | undefined;
4589
- message?: string | undefined;
4590
- }, FetchOptions["throw"] extends true ? true : false>>;
4591
- } & {
4592
- revokeOtherSessions: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
4593
- query?: Record<string, any> | undefined;
4594
- fetchOptions?: FetchOptions | undefined;
4595
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4596
- status: boolean;
4597
- }, {
4598
- code?: string | undefined;
4599
- message?: string | undefined;
4600
- }, FetchOptions["throw"] extends true ? true : false>>;
4601
- } & {
4602
- linkSocial: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
4603
- provider: unknown;
4604
- callbackURL?: string | undefined;
4605
- idToken?: {
4606
- token: string;
4607
- nonce?: string | undefined;
4608
- accessToken?: string | undefined;
4609
- refreshToken?: string | undefined;
4610
- scopes?: string[] | undefined;
4611
- } | undefined;
4612
- requestSignUp?: boolean | undefined;
4613
- scopes?: string[] | undefined;
4614
- errorCallbackURL?: string | undefined;
4615
- disableRedirect?: boolean | undefined;
4616
- additionalData?: Record<string, any> | undefined;
4617
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
4618
- provider: unknown;
4619
- callbackURL?: string | undefined;
4620
- idToken?: {
4621
- token: string;
4622
- nonce?: string | undefined;
4623
- accessToken?: string | undefined;
4624
- refreshToken?: string | undefined;
4625
- scopes?: string[] | undefined;
4626
- } | undefined;
4627
- requestSignUp?: boolean | undefined;
4628
- scopes?: string[] | undefined;
4629
- errorCallbackURL?: string | undefined;
4630
- disableRedirect?: boolean | undefined;
4631
- additionalData?: Record<string, any> | undefined;
4632
- } & {
4633
- fetchOptions?: FetchOptions | undefined;
4634
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4635
- url: string;
4636
- redirect: boolean;
4637
- }, {
4638
- code?: string | undefined;
4639
- message?: string | undefined;
4640
- }, FetchOptions["throw"] extends true ? true : false>>;
4641
- } & {
4642
- listAccounts: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
4643
- query?: Record<string, any> | undefined;
4644
- fetchOptions?: FetchOptions | undefined;
4645
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4646
- scopes: string[];
4647
- id: string;
4648
- createdAt: Date;
4649
- updatedAt: Date;
4650
- userId: string;
4651
- providerId: string;
4652
- accountId: string;
4653
- }[], {
4654
- code?: string | undefined;
4655
- message?: string | undefined;
4656
- }, FetchOptions["throw"] extends true ? true : false>>;
4657
- } & {
4658
- deleteUser: {
4659
- callback: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
4660
- token: string;
4661
- callbackURL?: string | undefined;
4662
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
4663
- query: {
4664
- token: string;
4665
- callbackURL?: string | undefined;
4666
- };
4667
- fetchOptions?: FetchOptions | undefined;
4668
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4669
- success: boolean;
4670
- message: string;
4671
- }, {
4672
- code?: string | undefined;
4673
- message?: string | undefined;
4674
- }, FetchOptions["throw"] extends true ? true : false>>;
4675
- };
4676
- } & {
4677
- unlinkAccount: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
4678
- providerId: string;
4679
- accountId?: string | undefined;
4680
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
4681
- providerId: string;
4682
- accountId?: string | undefined;
4683
- } & {
4684
- fetchOptions?: FetchOptions | undefined;
4685
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4686
- status: boolean;
4687
- }, {
4688
- code?: string | undefined;
4689
- message?: string | undefined;
4690
- }, FetchOptions["throw"] extends true ? true : false>>;
4691
- } & {
4692
- refreshToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
4693
- providerId: string;
4694
- accountId?: string | undefined;
4695
- userId?: string | undefined;
4696
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
4697
- providerId: string;
4698
- accountId?: string | undefined;
4699
- userId?: string | undefined;
4700
- } & {
4701
- fetchOptions?: FetchOptions | undefined;
4702
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4703
- accessToken: string | undefined;
4704
- refreshToken: string;
4705
- accessTokenExpiresAt: Date | undefined;
4706
- refreshTokenExpiresAt: Date | null | undefined;
4707
- scope: string | null | undefined;
4708
- idToken: string | null | undefined;
4709
- providerId: string;
4710
- accountId: string;
4711
- }, {
4712
- code?: string | undefined;
4713
- message?: string | undefined;
4714
- }, FetchOptions["throw"] extends true ? true : false>>;
4715
- } & {
4716
- getAccessToken: <FetchOptions extends better_auth.ClientFetchOption<Partial<{
4717
- providerId: string;
4718
- accountId?: string | undefined;
4719
- userId?: string | undefined;
4720
- }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: better_auth.Prettify<{
4721
- providerId: string;
4722
- accountId?: string | undefined;
4723
- userId?: string | undefined;
4724
- } & {
4725
- fetchOptions?: FetchOptions | undefined;
4726
- }>, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4727
- accessToken: string;
4728
- accessTokenExpiresAt: Date | undefined;
4729
- scopes: string[];
4730
- idToken: string | undefined;
4731
- }, {
4732
- code?: string | undefined;
4733
- message?: string | undefined;
4734
- }, FetchOptions["throw"] extends true ? true : false>>;
4735
- } & {
4736
- accountInfo: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
4737
- accountId?: string | undefined;
4738
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
4739
- query?: {
4740
- accountId?: string | undefined;
4741
- } | undefined;
4742
- fetchOptions?: FetchOptions | undefined;
4743
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4744
- user: better_auth.OAuth2UserInfo;
4745
- data: Record<string, any>;
4746
- }, {
4747
- code?: string | undefined;
4748
- message?: string | undefined;
4749
- }, FetchOptions["throw"] extends true ? true : false>>;
4750
- } & {
4751
- getSession: <FetchOptions extends better_auth.ClientFetchOption<never, Partial<{
4752
- disableCookieCache?: unknown;
4753
- disableRefresh?: unknown;
4754
- }> & Record<string, any>, Record<string, any> | undefined>>(data_0?: better_auth.Prettify<{
4755
- query?: {
4756
- disableCookieCache?: unknown;
4757
- disableRefresh?: unknown;
4758
- } | undefined;
4759
- fetchOptions?: FetchOptions | undefined;
4760
- }> | undefined, data_1?: FetchOptions | undefined) => Promise<better_auth_react.BetterFetchResponse<{
4761
- user: better_auth.StripEmptyObjects<{
4762
- id: string;
4763
- createdAt: Date;
4764
- updatedAt: Date;
4765
- email: string;
4766
- emailVerified: boolean;
4767
- name: string;
4768
- image?: string | null | undefined;
4769
- } & {
4770
- twoFactorEnabled: boolean | null | undefined;
4771
- } & {}>;
4772
- session: better_auth.StripEmptyObjects<{
4773
- id: string;
4774
- createdAt: Date;
4775
- updatedAt: Date;
4776
- userId: string;
4777
- expiresAt: Date;
4778
- token: string;
4779
- ipAddress?: string | null | undefined;
4780
- userAgent?: string | null | undefined;
4781
- } & {} & {
4782
- activeOrganizationId?: string | null | undefined;
4783
- }>;
4784
- } | null, {
4785
- code?: string | undefined;
4786
- message?: string | undefined;
4787
- }, FetchOptions["throw"] extends true ? true : false>>;
4788
- } & {
4789
- $Infer: {
4790
- ActiveOrganization: {
4791
- members: {
4792
- id: string;
4793
- organizationId: string;
4794
- role: "member" | "admin" | "owner";
4795
- createdAt: Date;
4796
- userId: string;
4797
- user: {
4798
- id: string;
4799
- email: string;
4800
- name: string;
4801
- image?: string | undefined;
4802
- };
4803
- }[];
4804
- invitations: {
4805
- id: string;
4806
- organizationId: string;
4807
- email: string;
4808
- role: "member" | "admin" | "owner";
4809
- status: better_auth_client_plugins.InvitationStatus;
4810
- inviterId: string;
4811
- expiresAt: Date;
4812
- createdAt: Date;
4813
- }[];
4814
- } & {
4815
- id: string;
4816
- name: string;
4817
- slug: string;
4818
- createdAt: Date;
4819
- logo?: string | null | undefined | undefined;
4820
- metadata?: any;
4821
- };
4822
- Organization: {
4823
- id: string;
4824
- name: string;
4825
- slug: string;
4826
- createdAt: Date;
4827
- logo?: string | null | undefined;
4828
- metadata?: any;
4829
- };
4830
- Invitation: {
4831
- id: string;
4832
- organizationId: string;
4833
- email: string;
4834
- role: "member" | "admin" | "owner";
4835
- status: better_auth_client_plugins.InvitationStatus;
4836
- inviterId: string;
4837
- expiresAt: Date;
4838
- createdAt: Date;
4839
- };
4840
- Member: {
4841
- id: string;
4842
- organizationId: string;
4843
- role: "member" | "admin" | "owner";
4844
- createdAt: Date;
4845
- userId: string;
4846
- user: {
4847
- id: string;
4848
- email: string;
4849
- name: string;
4850
- image?: string | undefined;
4851
- };
4852
- };
4853
- Team: {
4854
- id: string;
4855
- name: string;
4856
- organizationId: string;
4857
- createdAt: Date;
4858
- updatedAt?: Date | undefined;
4859
- };
4860
- };
4861
- organization: {
4862
- checkRolePermission: <R extends "member" | "admin" | "owner">(data: {
4863
- permissions: {
4864
- readonly organization?: ("update" | "delete")[] | undefined;
4865
- readonly member?: ("update" | "create" | "delete")[] | undefined;
4866
- readonly invitation?: ("create" | "cancel")[] | undefined;
4867
- readonly team?: ("update" | "create" | "delete")[] | undefined;
4868
- readonly ac?: ("update" | "create" | "delete" | "read")[] | undefined;
4869
- };
4870
- } & {
4871
- role: R;
4872
- }) => boolean;
4873
- };
4874
- } & {
4875
- useSession: () => {
4876
- data: {
4877
- user: better_auth.StripEmptyObjects<{
4878
- id: string;
4879
- createdAt: Date;
4880
- updatedAt: Date;
4881
- email: string;
4882
- emailVerified: boolean;
4883
- name: string;
4884
- image?: string | null | undefined;
4885
- } & {
4886
- twoFactorEnabled: boolean | null | undefined;
4887
- } & {}>;
4888
- session: better_auth.StripEmptyObjects<{
4889
- id: string;
4890
- createdAt: Date;
4891
- updatedAt: Date;
4892
- userId: string;
4893
- expiresAt: Date;
4894
- token: string;
4895
- ipAddress?: string | null | undefined;
4896
- userAgent?: string | null | undefined;
4897
- } & {} & {
4898
- activeOrganizationId?: string | null | undefined;
4899
- }>;
4900
- } | null;
4901
- isPending: boolean;
4902
- isRefetching: boolean;
4903
- error: better_auth_react.BetterFetchError | null;
4904
- refetch: (queryParams?: {
4905
- query?: better_auth.SessionQueryParams;
4906
- } | undefined) => Promise<void>;
4907
- };
4908
- $Infer: {
4909
- Session: {
4910
- user: better_auth.StripEmptyObjects<{
4911
- id: string;
4912
- createdAt: Date;
4913
- updatedAt: Date;
4914
- email: string;
4915
- emailVerified: boolean;
4916
- name: string;
4917
- image?: string | null | undefined;
4918
- } & {
4919
- twoFactorEnabled: boolean | null | undefined;
4920
- } & {}>;
4921
- session: better_auth.StripEmptyObjects<{
4922
- id: string;
4923
- createdAt: Date;
4924
- updatedAt: Date;
4925
- userId: string;
4926
- expiresAt: Date;
4927
- token: string;
4928
- ipAddress?: string | null | undefined;
4929
- userAgent?: string | null | undefined;
4930
- } & {} & {
4931
- activeOrganizationId?: string | null | undefined;
4932
- }>;
2274
+ })>;
2275
+ atomListeners: {
2276
+ matcher: (path: string) => boolean;
2277
+ signal: "$sessionSignal";
2278
+ }[];
2279
+ pathMethods: {
2280
+ "/two-factor/disable": "POST";
2281
+ "/two-factor/enable": "POST";
2282
+ "/two-factor/send-otp": "POST";
2283
+ "/two-factor/generate-backup-codes": "POST";
2284
+ "/two-factor/get-totp-uri": "POST";
2285
+ "/two-factor/verify-totp": "POST";
2286
+ "/two-factor/verify-otp": "POST";
2287
+ "/two-factor/verify-backup-code": "POST";
4933
2288
  };
4934
- };
4935
- $fetch: better_auth_react.BetterFetch<{
4936
- plugins: (better_auth_react.BetterFetchPlugin<Record<string, any>> | {
4937
- id: string;
4938
- name: string;
4939
- hooks: {
4940
- onSuccess(context: better_auth_react.SuccessContext<any>): void;
4941
- };
4942
- } | {
2289
+ fetchPlugins: {
4943
2290
  id: string;
4944
2291
  name: string;
4945
2292
  hooks: {
4946
- onSuccess: ((context: better_auth_react.SuccessContext<any>) => Promise<void> | void) | undefined;
4947
- onError: ((context: better_auth_react.ErrorContext) => Promise<void> | void) | undefined;
4948
- onRequest: (<T extends Record<string, any>>(context: better_auth_react.RequestContext<T>) => Promise<better_auth_react.RequestContext | void> | better_auth_react.RequestContext | void) | undefined;
4949
- onResponse: ((context: better_auth_react.ResponseContext) => Promise<Response | void | better_auth_react.ResponseContext> | Response | better_auth_react.ResponseContext | void) | undefined;
2293
+ onSuccess(context: better_auth_react.SuccessContext<any>): Promise<void>;
4950
2294
  };
4951
- })[];
4952
- cache?: RequestCache | undefined;
4953
- priority?: RequestPriority | undefined;
4954
- credentials?: RequestCredentials;
4955
- headers?: (HeadersInit & (HeadersInit | {
4956
- accept: "application/json" | "text/plain" | "application/octet-stream";
4957
- "content-type": "application/json" | "text/plain" | "application/x-www-form-urlencoded" | "multipart/form-data" | "application/octet-stream";
4958
- authorization: "Bearer" | "Basic";
4959
- })) | undefined;
4960
- integrity?: string | undefined;
4961
- keepalive?: boolean | undefined;
4962
- method: string;
4963
- mode?: RequestMode | undefined;
4964
- redirect?: RequestRedirect | undefined;
4965
- referrer?: string | undefined;
4966
- referrerPolicy?: ReferrerPolicy | undefined;
4967
- signal?: (AbortSignal | null) | undefined;
4968
- window?: null | undefined;
4969
- onRetry?: ((response: better_auth_react.ResponseContext) => Promise<void> | void) | undefined;
4970
- hookOptions?: {
4971
- cloneResponse?: boolean;
4972
- } | undefined;
4973
- timeout?: number | undefined;
4974
- customFetchImpl: better_auth_react.FetchEsque;
4975
- baseURL: string;
4976
- throw?: boolean | undefined;
4977
- auth?: ({
4978
- type: "Bearer";
4979
- token: string | Promise<string | undefined> | (() => string | Promise<string | undefined> | undefined) | undefined;
4980
- } | {
4981
- type: "Basic";
4982
- username: string | (() => string | undefined) | undefined;
4983
- password: string | (() => string | undefined) | undefined;
4984
- } | {
4985
- type: "Custom";
4986
- prefix: string | (() => string | undefined) | undefined;
4987
- value: string | (() => string | undefined) | undefined;
4988
- }) | undefined;
4989
- body?: any;
4990
- query?: any;
4991
- params?: any;
4992
- duplex?: "full" | "half" | undefined;
4993
- jsonParser: (text: string) => Promise<any> | any;
4994
- retry?: better_auth_react.RetryOptions | undefined;
4995
- retryAttempt?: number | undefined;
4996
- output?: (better_auth_react.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
4997
- errorSchema?: better_auth_react.StandardSchemaV1 | undefined;
4998
- disableValidation?: boolean | undefined;
4999
- disableSignal?: boolean | undefined;
5000
- }, unknown, unknown, {}>;
5001
- $store: {
5002
- notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
5003
- listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
5004
- atoms: Record<string, better_auth_react.WritableAtom<any>>;
5005
- };
5006
- $ERROR_CODES: {
5007
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION">;
5008
- YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: better_auth.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS">;
5009
- ORGANIZATION_ALREADY_EXISTS: better_auth.RawError<"ORGANIZATION_ALREADY_EXISTS">;
5010
- ORGANIZATION_SLUG_ALREADY_TAKEN: better_auth.RawError<"ORGANIZATION_SLUG_ALREADY_TAKEN">;
5011
- ORGANIZATION_NOT_FOUND: better_auth.RawError<"ORGANIZATION_NOT_FOUND">;
5012
- USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: better_auth.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION">;
5013
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION">;
5014
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION">;
5015
- NO_ACTIVE_ORGANIZATION: better_auth.RawError<"NO_ACTIVE_ORGANIZATION">;
5016
- USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: better_auth.RawError<"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION">;
5017
- MEMBER_NOT_FOUND: better_auth.RawError<"MEMBER_NOT_FOUND">;
5018
- ROLE_NOT_FOUND: better_auth.RawError<"ROLE_NOT_FOUND">;
5019
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM">;
5020
- TEAM_ALREADY_EXISTS: better_auth.RawError<"TEAM_ALREADY_EXISTS">;
5021
- TEAM_NOT_FOUND: better_auth.RawError<"TEAM_NOT_FOUND">;
5022
- YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: better_auth.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER">;
5023
- YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: better_auth.RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER">;
5024
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER">;
5025
- YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION">;
5026
- USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: better_auth.RawError<"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION">;
5027
- INVITATION_NOT_FOUND: better_auth.RawError<"INVITATION_NOT_FOUND">;
5028
- YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: better_auth.RawError<"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION">;
5029
- EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: better_auth.RawError<"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION">;
5030
- YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION">;
5031
- INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: better_auth.RawError<"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION">;
5032
- YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE">;
5033
- FAILED_TO_RETRIEVE_INVITATION: better_auth.RawError<"FAILED_TO_RETRIEVE_INVITATION">;
5034
- YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: better_auth.RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS">;
5035
- UNABLE_TO_REMOVE_LAST_TEAM: better_auth.RawError<"UNABLE_TO_REMOVE_LAST_TEAM">;
5036
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER">;
5037
- ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: better_auth.RawError<"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED">;
5038
- YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION">;
5039
- YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION">;
5040
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM">;
5041
- YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM">;
5042
- INVITATION_LIMIT_REACHED: better_auth.RawError<"INVITATION_LIMIT_REACHED">;
5043
- TEAM_MEMBER_LIMIT_REACHED: better_auth.RawError<"TEAM_MEMBER_LIMIT_REACHED">;
5044
- USER_IS_NOT_A_MEMBER_OF_THE_TEAM: better_auth.RawError<"USER_IS_NOT_A_MEMBER_OF_THE_TEAM">;
5045
- YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: better_auth.RawError<"YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM">;
5046
- YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: better_auth.RawError<"YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM">;
5047
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER">;
5048
- YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER">;
5049
- YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION">;
5050
- YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: better_auth.RawError<"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION">;
5051
- MISSING_AC_INSTANCE: better_auth.RawError<"MISSING_AC_INSTANCE">;
5052
- YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: better_auth.RawError<"YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE">;
5053
- YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE">;
5054
- YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE">;
5055
- YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE">;
5056
- YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE">;
5057
- YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE">;
5058
- YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: better_auth.RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE">;
5059
- TOO_MANY_ROLES: better_auth.RawError<"TOO_MANY_ROLES">;
5060
- INVALID_RESOURCE: better_auth.RawError<"INVALID_RESOURCE">;
5061
- ROLE_NAME_IS_ALREADY_TAKEN: better_auth.RawError<"ROLE_NAME_IS_ALREADY_TAKEN">;
5062
- CANNOT_DELETE_A_PRE_DEFINED_ROLE: better_auth.RawError<"CANNOT_DELETE_A_PRE_DEFINED_ROLE">;
5063
- ROLE_IS_ASSIGNED_TO_MEMBERS: better_auth.RawError<"ROLE_IS_ASSIGNED_TO_MEMBERS">;
5064
- } & {
5065
- OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
5066
- OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
5067
- TOTP_NOT_ENABLED: better_auth.RawError<"TOTP_NOT_ENABLED">;
5068
- TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
5069
- BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
5070
- INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
5071
- INVALID_CODE: better_auth.RawError<"INVALID_CODE">;
5072
- TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: better_auth.RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
5073
- INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
5074
- } & {
5075
- USER_NOT_FOUND: better_auth.RawError<"USER_NOT_FOUND">;
5076
- FAILED_TO_CREATE_USER: better_auth.RawError<"FAILED_TO_CREATE_USER">;
5077
- FAILED_TO_CREATE_SESSION: better_auth.RawError<"FAILED_TO_CREATE_SESSION">;
5078
- FAILED_TO_UPDATE_USER: better_auth.RawError<"FAILED_TO_UPDATE_USER">;
5079
- FAILED_TO_GET_SESSION: better_auth.RawError<"FAILED_TO_GET_SESSION">;
5080
- INVALID_PASSWORD: better_auth.RawError<"INVALID_PASSWORD">;
5081
- INVALID_EMAIL: better_auth.RawError<"INVALID_EMAIL">;
5082
- INVALID_EMAIL_OR_PASSWORD: better_auth.RawError<"INVALID_EMAIL_OR_PASSWORD">;
5083
- INVALID_USER: better_auth.RawError<"INVALID_USER">;
5084
- SOCIAL_ACCOUNT_ALREADY_LINKED: better_auth.RawError<"SOCIAL_ACCOUNT_ALREADY_LINKED">;
5085
- PROVIDER_NOT_FOUND: better_auth.RawError<"PROVIDER_NOT_FOUND">;
5086
- INVALID_TOKEN: better_auth.RawError<"INVALID_TOKEN">;
5087
- TOKEN_EXPIRED: better_auth.RawError<"TOKEN_EXPIRED">;
5088
- ID_TOKEN_NOT_SUPPORTED: better_auth.RawError<"ID_TOKEN_NOT_SUPPORTED">;
5089
- FAILED_TO_GET_USER_INFO: better_auth.RawError<"FAILED_TO_GET_USER_INFO">;
5090
- USER_EMAIL_NOT_FOUND: better_auth.RawError<"USER_EMAIL_NOT_FOUND">;
5091
- EMAIL_NOT_VERIFIED: better_auth.RawError<"EMAIL_NOT_VERIFIED">;
5092
- PASSWORD_TOO_SHORT: better_auth.RawError<"PASSWORD_TOO_SHORT">;
5093
- PASSWORD_TOO_LONG: better_auth.RawError<"PASSWORD_TOO_LONG">;
5094
- USER_ALREADY_EXISTS: better_auth.RawError<"USER_ALREADY_EXISTS">;
5095
- USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: better_auth.RawError<"USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL">;
5096
- EMAIL_CAN_NOT_BE_UPDATED: better_auth.RawError<"EMAIL_CAN_NOT_BE_UPDATED">;
5097
- CREDENTIAL_ACCOUNT_NOT_FOUND: better_auth.RawError<"CREDENTIAL_ACCOUNT_NOT_FOUND">;
5098
- ACCOUNT_NOT_FOUND: better_auth.RawError<"ACCOUNT_NOT_FOUND">;
5099
- SESSION_EXPIRED: better_auth.RawError<"SESSION_EXPIRED">;
5100
- FAILED_TO_UNLINK_LAST_ACCOUNT: better_auth.RawError<"FAILED_TO_UNLINK_LAST_ACCOUNT">;
5101
- USER_ALREADY_HAS_PASSWORD: better_auth.RawError<"USER_ALREADY_HAS_PASSWORD">;
5102
- CROSS_SITE_NAVIGATION_LOGIN_BLOCKED: better_auth.RawError<"CROSS_SITE_NAVIGATION_LOGIN_BLOCKED">;
5103
- VERIFICATION_EMAIL_NOT_ENABLED: better_auth.RawError<"VERIFICATION_EMAIL_NOT_ENABLED">;
5104
- EMAIL_ALREADY_VERIFIED: better_auth.RawError<"EMAIL_ALREADY_VERIFIED">;
5105
- EMAIL_MISMATCH: better_auth.RawError<"EMAIL_MISMATCH">;
5106
- SESSION_NOT_FRESH: better_auth.RawError<"SESSION_NOT_FRESH">;
5107
- LINKED_ACCOUNT_ALREADY_EXISTS: better_auth.RawError<"LINKED_ACCOUNT_ALREADY_EXISTS">;
5108
- INVALID_ORIGIN: better_auth.RawError<"INVALID_ORIGIN">;
5109
- INVALID_CALLBACK_URL: better_auth.RawError<"INVALID_CALLBACK_URL">;
5110
- INVALID_REDIRECT_URL: better_auth.RawError<"INVALID_REDIRECT_URL">;
5111
- INVALID_ERROR_CALLBACK_URL: better_auth.RawError<"INVALID_ERROR_CALLBACK_URL">;
5112
- INVALID_NEW_USER_CALLBACK_URL: better_auth.RawError<"INVALID_NEW_USER_CALLBACK_URL">;
5113
- MISSING_OR_NULL_ORIGIN: better_auth.RawError<"MISSING_OR_NULL_ORIGIN">;
5114
- CALLBACK_URL_REQUIRED: better_auth.RawError<"CALLBACK_URL_REQUIRED">;
5115
- FAILED_TO_CREATE_VERIFICATION: better_auth.RawError<"FAILED_TO_CREATE_VERIFICATION">;
5116
- FIELD_NOT_ALLOWED: better_auth.RawError<"FIELD_NOT_ALLOWED">;
5117
- ASYNC_VALIDATION_NOT_SUPPORTED: better_auth.RawError<"ASYNC_VALIDATION_NOT_SUPPORTED">;
5118
- VALIDATION_ERROR: better_auth.RawError<"VALIDATION_ERROR">;
5119
- MISSING_FIELD: better_auth.RawError<"MISSING_FIELD">;
5120
- METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED: better_auth.RawError<"METHOD_NOT_ALLOWED_DEFER_SESSION_REQUIRED">;
5121
- BODY_MUST_BE_AN_OBJECT: better_auth.RawError<"BODY_MUST_BE_AN_OBJECT">;
5122
- PASSWORD_ALREADY_SET: better_auth.RawError<"PASSWORD_ALREADY_SET">;
5123
- };
5124
- };
2295
+ }[];
2296
+ $ERROR_CODES: {
2297
+ OTP_NOT_ENABLED: better_auth.RawError<"OTP_NOT_ENABLED">;
2298
+ OTP_HAS_EXPIRED: better_auth.RawError<"OTP_HAS_EXPIRED">;
2299
+ TOTP_NOT_ENABLED: better_auth.RawError<"TOTP_NOT_ENABLED">;
2300
+ TWO_FACTOR_NOT_ENABLED: better_auth.RawError<"TWO_FACTOR_NOT_ENABLED">;
2301
+ BACKUP_CODES_NOT_ENABLED: better_auth.RawError<"BACKUP_CODES_NOT_ENABLED">;
2302
+ INVALID_BACKUP_CODE: better_auth.RawError<"INVALID_BACKUP_CODE">;
2303
+ INVALID_CODE: better_auth.RawError<"INVALID_CODE">;
2304
+ TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE: better_auth.RawError<"TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE">;
2305
+ ACCOUNT_TEMPORARILY_LOCKED: better_auth.RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
2306
+ INVALID_TWO_FACTOR_COOKIE: better_auth.RawError<"INVALID_TWO_FACTOR_COOKIE">;
2307
+ };
2308
+ })[];
2309
+ }>;
5125
2310
  declare const useSession: () => {
5126
2311
  data: {
5127
2312
  user: better_auth.StripEmptyObjects<{