@podosoft/podokit-api-client 0.4.0 → 0.5.1
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 +3565 -0
- package/dist/index.js +4 -2
- package/package.json +5 -2
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,13 @@ export interface ApiClientOptions {
|
|
|
12
12
|
/** Credentials mode for requests. Default `include` (send cookies). */
|
|
13
13
|
credentials?: RequestCredentials;
|
|
14
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Feature flags the API reports at `GET /account/capabilities`. The web app gates
|
|
17
|
+
* optional auth features (2FA, social providers, account deletion, ...) on these
|
|
18
|
+
* so UI never offers an endpoint the server didn't enable. Single source of truth
|
|
19
|
+
* for the shape — the backend controller and every SvelteKit loader import it.
|
|
20
|
+
*/
|
|
21
|
+
export type { Capabilities } from "@podosoft/podokit-contracts";
|
|
15
22
|
/** Error thrown when the API returns the standard error envelope or a non-2xx status. */
|
|
16
23
|
export declare class ApiError extends Error {
|
|
17
24
|
readonly code: string;
|
|
@@ -1662,6 +1669,3564 @@ export declare function createApiClient(options?: ApiClientOptions): {
|
|
|
1662
1669
|
ACCOUNT_TEMPORARILY_LOCKED: import("better-auth").RawError<"ACCOUNT_TEMPORARILY_LOCKED">;
|
|
1663
1670
|
INVALID_TWO_FACTOR_COOKIE: import("better-auth").RawError<"INVALID_TWO_FACTOR_COOKIE">;
|
|
1664
1671
|
};
|
|
1672
|
+
} | {
|
|
1673
|
+
id: "magic-link";
|
|
1674
|
+
version: string;
|
|
1675
|
+
$InferServerPlugin: ReturnType<(options: import("better-auth/plugins/magic-link").MagicLinkOptions) => {
|
|
1676
|
+
id: "magic-link";
|
|
1677
|
+
version: string;
|
|
1678
|
+
endpoints: {
|
|
1679
|
+
signInMagicLink: import("better-call").StrictEndpoint<"/sign-in/magic-link", {
|
|
1680
|
+
method: "POST";
|
|
1681
|
+
requireHeaders: true;
|
|
1682
|
+
body: import("zod").ZodObject<{
|
|
1683
|
+
email: import("zod").ZodEmail;
|
|
1684
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1685
|
+
callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1686
|
+
newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1687
|
+
errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1688
|
+
metadata: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
1689
|
+
}, import("zod/v4/core").$strip>;
|
|
1690
|
+
metadata: {
|
|
1691
|
+
openapi: {
|
|
1692
|
+
operationId: string;
|
|
1693
|
+
description: string;
|
|
1694
|
+
responses: {
|
|
1695
|
+
200: {
|
|
1696
|
+
description: string;
|
|
1697
|
+
content: {
|
|
1698
|
+
"application/json": {
|
|
1699
|
+
schema: {
|
|
1700
|
+
type: "object";
|
|
1701
|
+
properties: {
|
|
1702
|
+
status: {
|
|
1703
|
+
type: string;
|
|
1704
|
+
};
|
|
1705
|
+
};
|
|
1706
|
+
};
|
|
1707
|
+
};
|
|
1708
|
+
};
|
|
1709
|
+
};
|
|
1710
|
+
};
|
|
1711
|
+
};
|
|
1712
|
+
};
|
|
1713
|
+
}, {
|
|
1714
|
+
status: boolean;
|
|
1715
|
+
}>;
|
|
1716
|
+
magicLinkVerify: import("better-call").StrictEndpoint<"/magic-link/verify", {
|
|
1717
|
+
method: "GET";
|
|
1718
|
+
query: import("zod").ZodObject<{
|
|
1719
|
+
token: import("zod").ZodString;
|
|
1720
|
+
callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1721
|
+
errorCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1722
|
+
newUserCallbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
1723
|
+
}, import("zod/v4/core").$strip>;
|
|
1724
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>)[];
|
|
1725
|
+
requireHeaders: true;
|
|
1726
|
+
metadata: {
|
|
1727
|
+
openapi: {
|
|
1728
|
+
operationId: string;
|
|
1729
|
+
description: string;
|
|
1730
|
+
responses: {
|
|
1731
|
+
200: {
|
|
1732
|
+
description: string;
|
|
1733
|
+
content: {
|
|
1734
|
+
"application/json": {
|
|
1735
|
+
schema: {
|
|
1736
|
+
type: "object";
|
|
1737
|
+
properties: {
|
|
1738
|
+
session: {
|
|
1739
|
+
$ref: string;
|
|
1740
|
+
};
|
|
1741
|
+
user: {
|
|
1742
|
+
$ref: string;
|
|
1743
|
+
};
|
|
1744
|
+
};
|
|
1745
|
+
};
|
|
1746
|
+
};
|
|
1747
|
+
};
|
|
1748
|
+
};
|
|
1749
|
+
};
|
|
1750
|
+
};
|
|
1751
|
+
};
|
|
1752
|
+
}, {
|
|
1753
|
+
token: string;
|
|
1754
|
+
user: {
|
|
1755
|
+
id: string;
|
|
1756
|
+
createdAt: Date;
|
|
1757
|
+
updatedAt: Date;
|
|
1758
|
+
email: string;
|
|
1759
|
+
emailVerified: boolean;
|
|
1760
|
+
name: string;
|
|
1761
|
+
image?: string | null | undefined;
|
|
1762
|
+
};
|
|
1763
|
+
session: {
|
|
1764
|
+
id: string;
|
|
1765
|
+
createdAt: Date;
|
|
1766
|
+
updatedAt: Date;
|
|
1767
|
+
userId: string;
|
|
1768
|
+
expiresAt: Date;
|
|
1769
|
+
token: string;
|
|
1770
|
+
ipAddress?: string | null | undefined;
|
|
1771
|
+
userAgent?: string | null | undefined;
|
|
1772
|
+
};
|
|
1773
|
+
}>;
|
|
1774
|
+
};
|
|
1775
|
+
rateLimit: {
|
|
1776
|
+
pathMatcher(path: string): boolean;
|
|
1777
|
+
window: number;
|
|
1778
|
+
max: number;
|
|
1779
|
+
}[];
|
|
1780
|
+
options: import("better-auth/plugins/magic-link").MagicLinkOptions;
|
|
1781
|
+
}>;
|
|
1782
|
+
} | {
|
|
1783
|
+
id: "email-otp";
|
|
1784
|
+
version: string;
|
|
1785
|
+
$InferServerPlugin: ReturnType<(options: import("better-auth/plugins/email-otp").EmailOTPOptions) => {
|
|
1786
|
+
id: "email-otp";
|
|
1787
|
+
version: string;
|
|
1788
|
+
init(ctx: import("better-auth").AuthContext): {
|
|
1789
|
+
options: {
|
|
1790
|
+
emailVerification: {
|
|
1791
|
+
sendVerificationEmail(data: {
|
|
1792
|
+
user: import("better-auth").User;
|
|
1793
|
+
url: string;
|
|
1794
|
+
token: string;
|
|
1795
|
+
}, request: Request | undefined): Promise<void>;
|
|
1796
|
+
};
|
|
1797
|
+
};
|
|
1798
|
+
} | undefined;
|
|
1799
|
+
endpoints: {
|
|
1800
|
+
sendVerificationOTP: import("better-call").StrictEndpoint<"/email-otp/send-verification-otp", {
|
|
1801
|
+
method: "POST";
|
|
1802
|
+
body: import("zod").ZodObject<{
|
|
1803
|
+
email: import("zod").ZodString;
|
|
1804
|
+
type: import("zod").ZodEnum<{
|
|
1805
|
+
"sign-in": "sign-in";
|
|
1806
|
+
"change-email": "change-email";
|
|
1807
|
+
"email-verification": "email-verification";
|
|
1808
|
+
"forget-password": "forget-password";
|
|
1809
|
+
}>;
|
|
1810
|
+
}, import("zod/v4/core").$strip>;
|
|
1811
|
+
metadata: {
|
|
1812
|
+
openapi: {
|
|
1813
|
+
operationId: string;
|
|
1814
|
+
description: string;
|
|
1815
|
+
responses: {
|
|
1816
|
+
200: {
|
|
1817
|
+
description: string;
|
|
1818
|
+
content: {
|
|
1819
|
+
"application/json": {
|
|
1820
|
+
schema: {
|
|
1821
|
+
type: "object";
|
|
1822
|
+
properties: {
|
|
1823
|
+
success: {
|
|
1824
|
+
type: string;
|
|
1825
|
+
};
|
|
1826
|
+
};
|
|
1827
|
+
};
|
|
1828
|
+
};
|
|
1829
|
+
};
|
|
1830
|
+
};
|
|
1831
|
+
};
|
|
1832
|
+
};
|
|
1833
|
+
};
|
|
1834
|
+
}, {
|
|
1835
|
+
success: boolean;
|
|
1836
|
+
}>;
|
|
1837
|
+
createVerificationOTP: import("better-call").StrictEndpoint<string, {
|
|
1838
|
+
method: "POST";
|
|
1839
|
+
body: import("zod").ZodObject<{
|
|
1840
|
+
email: import("zod").ZodString;
|
|
1841
|
+
type: import("zod").ZodEnum<{
|
|
1842
|
+
"sign-in": "sign-in";
|
|
1843
|
+
"change-email": "change-email";
|
|
1844
|
+
"email-verification": "email-verification";
|
|
1845
|
+
"forget-password": "forget-password";
|
|
1846
|
+
}>;
|
|
1847
|
+
}, import("zod/v4/core").$strip>;
|
|
1848
|
+
metadata: {
|
|
1849
|
+
openapi: {
|
|
1850
|
+
operationId: string;
|
|
1851
|
+
description: string;
|
|
1852
|
+
responses: {
|
|
1853
|
+
200: {
|
|
1854
|
+
description: string;
|
|
1855
|
+
content: {
|
|
1856
|
+
"application/json": {
|
|
1857
|
+
schema: {
|
|
1858
|
+
type: "string";
|
|
1859
|
+
};
|
|
1860
|
+
};
|
|
1861
|
+
};
|
|
1862
|
+
};
|
|
1863
|
+
};
|
|
1864
|
+
};
|
|
1865
|
+
};
|
|
1866
|
+
}, string>;
|
|
1867
|
+
getVerificationOTP: import("better-call").StrictEndpoint<string, {
|
|
1868
|
+
method: "GET";
|
|
1869
|
+
query: import("zod").ZodObject<{
|
|
1870
|
+
email: import("zod").ZodString;
|
|
1871
|
+
type: import("zod").ZodEnum<{
|
|
1872
|
+
"sign-in": "sign-in";
|
|
1873
|
+
"change-email": "change-email";
|
|
1874
|
+
"email-verification": "email-verification";
|
|
1875
|
+
"forget-password": "forget-password";
|
|
1876
|
+
}>;
|
|
1877
|
+
}, import("zod/v4/core").$strip>;
|
|
1878
|
+
metadata: {
|
|
1879
|
+
openapi: {
|
|
1880
|
+
operationId: string;
|
|
1881
|
+
description: string;
|
|
1882
|
+
responses: {
|
|
1883
|
+
"200": {
|
|
1884
|
+
description: string;
|
|
1885
|
+
content: {
|
|
1886
|
+
"application/json": {
|
|
1887
|
+
schema: {
|
|
1888
|
+
type: "object";
|
|
1889
|
+
properties: {
|
|
1890
|
+
otp: {
|
|
1891
|
+
type: string;
|
|
1892
|
+
nullable: boolean;
|
|
1893
|
+
description: string;
|
|
1894
|
+
};
|
|
1895
|
+
};
|
|
1896
|
+
required: string[];
|
|
1897
|
+
};
|
|
1898
|
+
};
|
|
1899
|
+
};
|
|
1900
|
+
};
|
|
1901
|
+
};
|
|
1902
|
+
};
|
|
1903
|
+
};
|
|
1904
|
+
}, {
|
|
1905
|
+
otp: null;
|
|
1906
|
+
} | {
|
|
1907
|
+
otp: string;
|
|
1908
|
+
}>;
|
|
1909
|
+
checkVerificationOTP: import("better-call").StrictEndpoint<"/email-otp/check-verification-otp", {
|
|
1910
|
+
method: "POST";
|
|
1911
|
+
body: import("zod").ZodObject<{
|
|
1912
|
+
email: import("zod").ZodString;
|
|
1913
|
+
type: import("zod").ZodEnum<{
|
|
1914
|
+
"sign-in": "sign-in";
|
|
1915
|
+
"change-email": "change-email";
|
|
1916
|
+
"email-verification": "email-verification";
|
|
1917
|
+
"forget-password": "forget-password";
|
|
1918
|
+
}>;
|
|
1919
|
+
otp: import("zod").ZodString;
|
|
1920
|
+
}, import("zod/v4/core").$strip>;
|
|
1921
|
+
metadata: {
|
|
1922
|
+
openapi: {
|
|
1923
|
+
operationId: string;
|
|
1924
|
+
description: string;
|
|
1925
|
+
responses: {
|
|
1926
|
+
200: {
|
|
1927
|
+
description: string;
|
|
1928
|
+
content: {
|
|
1929
|
+
"application/json": {
|
|
1930
|
+
schema: {
|
|
1931
|
+
type: "object";
|
|
1932
|
+
properties: {
|
|
1933
|
+
success: {
|
|
1934
|
+
type: string;
|
|
1935
|
+
};
|
|
1936
|
+
};
|
|
1937
|
+
};
|
|
1938
|
+
};
|
|
1939
|
+
};
|
|
1940
|
+
};
|
|
1941
|
+
};
|
|
1942
|
+
};
|
|
1943
|
+
};
|
|
1944
|
+
}, {
|
|
1945
|
+
success: boolean;
|
|
1946
|
+
}>;
|
|
1947
|
+
verifyEmailOTP: import("better-call").StrictEndpoint<"/email-otp/verify-email", {
|
|
1948
|
+
method: "POST";
|
|
1949
|
+
body: import("zod").ZodObject<{
|
|
1950
|
+
email: import("zod").ZodString;
|
|
1951
|
+
otp: import("zod").ZodString;
|
|
1952
|
+
}, import("zod/v4/core").$strip>;
|
|
1953
|
+
metadata: {
|
|
1954
|
+
openapi: {
|
|
1955
|
+
description: string;
|
|
1956
|
+
responses: {
|
|
1957
|
+
200: {
|
|
1958
|
+
description: string;
|
|
1959
|
+
content: {
|
|
1960
|
+
"application/json": {
|
|
1961
|
+
schema: {
|
|
1962
|
+
type: "object";
|
|
1963
|
+
properties: {
|
|
1964
|
+
status: {
|
|
1965
|
+
type: string;
|
|
1966
|
+
description: string;
|
|
1967
|
+
enum: boolean[];
|
|
1968
|
+
};
|
|
1969
|
+
token: {
|
|
1970
|
+
type: string;
|
|
1971
|
+
nullable: boolean;
|
|
1972
|
+
description: string;
|
|
1973
|
+
};
|
|
1974
|
+
user: {
|
|
1975
|
+
$ref: string;
|
|
1976
|
+
};
|
|
1977
|
+
};
|
|
1978
|
+
required: string[];
|
|
1979
|
+
};
|
|
1980
|
+
};
|
|
1981
|
+
};
|
|
1982
|
+
};
|
|
1983
|
+
};
|
|
1984
|
+
};
|
|
1985
|
+
};
|
|
1986
|
+
}, {
|
|
1987
|
+
status: boolean;
|
|
1988
|
+
token: string;
|
|
1989
|
+
user: {
|
|
1990
|
+
id: string;
|
|
1991
|
+
createdAt: Date;
|
|
1992
|
+
updatedAt: Date;
|
|
1993
|
+
email: string;
|
|
1994
|
+
emailVerified: boolean;
|
|
1995
|
+
name: string;
|
|
1996
|
+
image?: string | null | undefined;
|
|
1997
|
+
} & Record<string, any>;
|
|
1998
|
+
} | {
|
|
1999
|
+
status: boolean;
|
|
2000
|
+
token: null;
|
|
2001
|
+
user: {
|
|
2002
|
+
id: string;
|
|
2003
|
+
createdAt: Date;
|
|
2004
|
+
updatedAt: Date;
|
|
2005
|
+
email: string;
|
|
2006
|
+
emailVerified: boolean;
|
|
2007
|
+
name: string;
|
|
2008
|
+
image?: string | null | undefined;
|
|
2009
|
+
} & Record<string, any>;
|
|
2010
|
+
}>;
|
|
2011
|
+
signInEmailOTP: import("better-call").StrictEndpoint<"/sign-in/email-otp", {
|
|
2012
|
+
method: "POST";
|
|
2013
|
+
body: import("zod").ZodIntersection<import("zod").ZodObject<{
|
|
2014
|
+
email: import("zod").ZodString;
|
|
2015
|
+
otp: import("zod").ZodString;
|
|
2016
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2017
|
+
image: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2018
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
2019
|
+
metadata: {
|
|
2020
|
+
openapi: {
|
|
2021
|
+
operationId: string;
|
|
2022
|
+
description: string;
|
|
2023
|
+
responses: {
|
|
2024
|
+
200: {
|
|
2025
|
+
description: string;
|
|
2026
|
+
content: {
|
|
2027
|
+
"application/json": {
|
|
2028
|
+
schema: {
|
|
2029
|
+
type: "object";
|
|
2030
|
+
properties: {
|
|
2031
|
+
token: {
|
|
2032
|
+
type: string;
|
|
2033
|
+
description: string;
|
|
2034
|
+
};
|
|
2035
|
+
user: {
|
|
2036
|
+
$ref: string;
|
|
2037
|
+
};
|
|
2038
|
+
};
|
|
2039
|
+
required: string[];
|
|
2040
|
+
};
|
|
2041
|
+
};
|
|
2042
|
+
};
|
|
2043
|
+
};
|
|
2044
|
+
};
|
|
2045
|
+
};
|
|
2046
|
+
};
|
|
2047
|
+
}, {
|
|
2048
|
+
token: string;
|
|
2049
|
+
user: {
|
|
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
|
+
requestPasswordResetEmailOTP: import("better-call").StrictEndpoint<"/email-otp/request-password-reset", {
|
|
2060
|
+
method: "POST";
|
|
2061
|
+
body: import("zod").ZodObject<{
|
|
2062
|
+
email: import("zod").ZodString;
|
|
2063
|
+
}, import("zod/v4/core").$strip>;
|
|
2064
|
+
metadata: {
|
|
2065
|
+
openapi: {
|
|
2066
|
+
operationId: string;
|
|
2067
|
+
description: string;
|
|
2068
|
+
responses: {
|
|
2069
|
+
200: {
|
|
2070
|
+
description: string;
|
|
2071
|
+
content: {
|
|
2072
|
+
"application/json": {
|
|
2073
|
+
schema: {
|
|
2074
|
+
type: "object";
|
|
2075
|
+
properties: {
|
|
2076
|
+
success: {
|
|
2077
|
+
type: string;
|
|
2078
|
+
description: string;
|
|
2079
|
+
};
|
|
2080
|
+
};
|
|
2081
|
+
};
|
|
2082
|
+
};
|
|
2083
|
+
};
|
|
2084
|
+
};
|
|
2085
|
+
};
|
|
2086
|
+
};
|
|
2087
|
+
};
|
|
2088
|
+
}, {
|
|
2089
|
+
success: boolean;
|
|
2090
|
+
}>;
|
|
2091
|
+
forgetPasswordEmailOTP: import("better-call").StrictEndpoint<"/forget-password/email-otp", {
|
|
2092
|
+
method: "POST";
|
|
2093
|
+
body: import("zod").ZodObject<{
|
|
2094
|
+
email: import("zod").ZodString;
|
|
2095
|
+
}, import("zod/v4/core").$strip>;
|
|
2096
|
+
metadata: {
|
|
2097
|
+
openapi: {
|
|
2098
|
+
operationId: string;
|
|
2099
|
+
description: string;
|
|
2100
|
+
responses: {
|
|
2101
|
+
200: {
|
|
2102
|
+
description: string;
|
|
2103
|
+
content: {
|
|
2104
|
+
"application/json": {
|
|
2105
|
+
schema: {
|
|
2106
|
+
type: "object";
|
|
2107
|
+
properties: {
|
|
2108
|
+
success: {
|
|
2109
|
+
type: string;
|
|
2110
|
+
description: string;
|
|
2111
|
+
};
|
|
2112
|
+
};
|
|
2113
|
+
};
|
|
2114
|
+
};
|
|
2115
|
+
};
|
|
2116
|
+
};
|
|
2117
|
+
};
|
|
2118
|
+
};
|
|
2119
|
+
};
|
|
2120
|
+
}, {
|
|
2121
|
+
success: boolean;
|
|
2122
|
+
}>;
|
|
2123
|
+
resetPasswordEmailOTP: import("better-call").StrictEndpoint<"/email-otp/reset-password", {
|
|
2124
|
+
method: "POST";
|
|
2125
|
+
body: import("zod").ZodObject<{
|
|
2126
|
+
email: import("zod").ZodString;
|
|
2127
|
+
otp: import("zod").ZodString;
|
|
2128
|
+
password: import("zod").ZodString;
|
|
2129
|
+
}, import("zod/v4/core").$strip>;
|
|
2130
|
+
metadata: {
|
|
2131
|
+
openapi: {
|
|
2132
|
+
operationId: string;
|
|
2133
|
+
description: string;
|
|
2134
|
+
responses: {
|
|
2135
|
+
200: {
|
|
2136
|
+
description: string;
|
|
2137
|
+
content: {
|
|
2138
|
+
"application/json": {
|
|
2139
|
+
schema: {
|
|
2140
|
+
type: "object";
|
|
2141
|
+
properties: {
|
|
2142
|
+
success: {
|
|
2143
|
+
type: string;
|
|
2144
|
+
};
|
|
2145
|
+
};
|
|
2146
|
+
};
|
|
2147
|
+
};
|
|
2148
|
+
};
|
|
2149
|
+
};
|
|
2150
|
+
};
|
|
2151
|
+
};
|
|
2152
|
+
};
|
|
2153
|
+
}, {
|
|
2154
|
+
success: boolean;
|
|
2155
|
+
}>;
|
|
2156
|
+
requestEmailChangeEmailOTP: import("better-call").StrictEndpoint<"/email-otp/request-email-change", {
|
|
2157
|
+
method: "POST";
|
|
2158
|
+
body: import("zod").ZodObject<{
|
|
2159
|
+
newEmail: import("zod").ZodString;
|
|
2160
|
+
otp: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2161
|
+
}, import("zod/v4/core").$strip>;
|
|
2162
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
2163
|
+
session: {
|
|
2164
|
+
session: Record<string, any> & {
|
|
2165
|
+
id: string;
|
|
2166
|
+
createdAt: Date;
|
|
2167
|
+
updatedAt: Date;
|
|
2168
|
+
userId: string;
|
|
2169
|
+
expiresAt: Date;
|
|
2170
|
+
token: string;
|
|
2171
|
+
ipAddress?: string | null | undefined;
|
|
2172
|
+
userAgent?: string | null | undefined;
|
|
2173
|
+
};
|
|
2174
|
+
user: Record<string, any> & {
|
|
2175
|
+
id: string;
|
|
2176
|
+
createdAt: Date;
|
|
2177
|
+
updatedAt: Date;
|
|
2178
|
+
email: string;
|
|
2179
|
+
emailVerified: boolean;
|
|
2180
|
+
name: string;
|
|
2181
|
+
image?: string | null | undefined;
|
|
2182
|
+
};
|
|
2183
|
+
};
|
|
2184
|
+
}>)[];
|
|
2185
|
+
metadata: {
|
|
2186
|
+
openapi: {
|
|
2187
|
+
operationId: string;
|
|
2188
|
+
description: string;
|
|
2189
|
+
responses: {
|
|
2190
|
+
200: {
|
|
2191
|
+
description: string;
|
|
2192
|
+
content: {
|
|
2193
|
+
"application/json": {
|
|
2194
|
+
schema: {
|
|
2195
|
+
type: "object";
|
|
2196
|
+
properties: {
|
|
2197
|
+
success: {
|
|
2198
|
+
type: string;
|
|
2199
|
+
};
|
|
2200
|
+
};
|
|
2201
|
+
};
|
|
2202
|
+
};
|
|
2203
|
+
};
|
|
2204
|
+
};
|
|
2205
|
+
};
|
|
2206
|
+
};
|
|
2207
|
+
};
|
|
2208
|
+
}, {
|
|
2209
|
+
success: boolean;
|
|
2210
|
+
}>;
|
|
2211
|
+
changeEmailEmailOTP: import("better-call").StrictEndpoint<"/email-otp/change-email", {
|
|
2212
|
+
method: "POST";
|
|
2213
|
+
body: import("zod").ZodObject<{
|
|
2214
|
+
newEmail: import("zod").ZodString;
|
|
2215
|
+
otp: import("zod").ZodString;
|
|
2216
|
+
}, import("zod/v4/core").$strip>;
|
|
2217
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
2218
|
+
session: {
|
|
2219
|
+
session: Record<string, any> & {
|
|
2220
|
+
id: string;
|
|
2221
|
+
createdAt: Date;
|
|
2222
|
+
updatedAt: Date;
|
|
2223
|
+
userId: string;
|
|
2224
|
+
expiresAt: Date;
|
|
2225
|
+
token: string;
|
|
2226
|
+
ipAddress?: string | null | undefined;
|
|
2227
|
+
userAgent?: string | null | undefined;
|
|
2228
|
+
};
|
|
2229
|
+
user: Record<string, any> & {
|
|
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
|
+
};
|
|
2239
|
+
}>)[];
|
|
2240
|
+
metadata: {
|
|
2241
|
+
openapi: {
|
|
2242
|
+
operationId: string;
|
|
2243
|
+
description: string;
|
|
2244
|
+
responses: {
|
|
2245
|
+
200: {
|
|
2246
|
+
description: string;
|
|
2247
|
+
content: {
|
|
2248
|
+
"application/json": {
|
|
2249
|
+
schema: {
|
|
2250
|
+
type: "object";
|
|
2251
|
+
properties: {
|
|
2252
|
+
success: {
|
|
2253
|
+
type: string;
|
|
2254
|
+
};
|
|
2255
|
+
};
|
|
2256
|
+
};
|
|
2257
|
+
};
|
|
2258
|
+
};
|
|
2259
|
+
};
|
|
2260
|
+
};
|
|
2261
|
+
};
|
|
2262
|
+
};
|
|
2263
|
+
}, {
|
|
2264
|
+
success: boolean;
|
|
2265
|
+
}>;
|
|
2266
|
+
};
|
|
2267
|
+
hooks: {
|
|
2268
|
+
after: {
|
|
2269
|
+
matcher(context: import("better-auth").HookEndpointContext): boolean;
|
|
2270
|
+
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>;
|
|
2271
|
+
}[];
|
|
2272
|
+
};
|
|
2273
|
+
rateLimit: ({
|
|
2274
|
+
pathMatcher(path: string): path is "/email-otp/send-verification-otp";
|
|
2275
|
+
window: number;
|
|
2276
|
+
max: number;
|
|
2277
|
+
} | {
|
|
2278
|
+
pathMatcher(path: string): path is "/email-otp/check-verification-otp";
|
|
2279
|
+
window: number;
|
|
2280
|
+
max: number;
|
|
2281
|
+
} | {
|
|
2282
|
+
pathMatcher(path: string): path is "/email-otp/verify-email";
|
|
2283
|
+
window: number;
|
|
2284
|
+
max: number;
|
|
2285
|
+
} | {
|
|
2286
|
+
pathMatcher(path: string): path is "/sign-in/email-otp";
|
|
2287
|
+
window: number;
|
|
2288
|
+
max: number;
|
|
2289
|
+
} | {
|
|
2290
|
+
pathMatcher(path: string): path is "/email-otp/request-password-reset";
|
|
2291
|
+
window: number;
|
|
2292
|
+
max: number;
|
|
2293
|
+
} | {
|
|
2294
|
+
pathMatcher(path: string): path is "/email-otp/reset-password";
|
|
2295
|
+
window: number;
|
|
2296
|
+
max: number;
|
|
2297
|
+
} | {
|
|
2298
|
+
pathMatcher(path: string): path is "/forget-password/email-otp";
|
|
2299
|
+
window: number;
|
|
2300
|
+
max: number;
|
|
2301
|
+
} | {
|
|
2302
|
+
pathMatcher(path: string): path is "/email-otp/request-email-change";
|
|
2303
|
+
window: number;
|
|
2304
|
+
max: number;
|
|
2305
|
+
} | {
|
|
2306
|
+
pathMatcher(path: string): path is "/email-otp/change-email";
|
|
2307
|
+
window: number;
|
|
2308
|
+
max: number;
|
|
2309
|
+
})[];
|
|
2310
|
+
options: import("better-auth/plugins/email-otp").EmailOTPOptions;
|
|
2311
|
+
$ERROR_CODES: {
|
|
2312
|
+
OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
|
|
2313
|
+
INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
|
|
2314
|
+
TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
|
|
2315
|
+
};
|
|
2316
|
+
}>;
|
|
2317
|
+
atomListeners: {
|
|
2318
|
+
matcher: (path: string) => path is "/email-otp/verify-email" | "/sign-in/email-otp" | "/email-otp/request-email-change";
|
|
2319
|
+
signal: "$sessionSignal";
|
|
2320
|
+
}[];
|
|
2321
|
+
$ERROR_CODES: {
|
|
2322
|
+
OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
|
|
2323
|
+
INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
|
|
2324
|
+
TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
|
|
2325
|
+
};
|
|
2326
|
+
} | {
|
|
2327
|
+
id: "username";
|
|
2328
|
+
version: string;
|
|
2329
|
+
$InferServerPlugin: ReturnType<(options?: import("better-auth/plugins/username").UsernameOptions | undefined) => {
|
|
2330
|
+
id: "username";
|
|
2331
|
+
version: string;
|
|
2332
|
+
init(ctx: import("better-auth").AuthContext): {
|
|
2333
|
+
options: {
|
|
2334
|
+
databaseHooks: {
|
|
2335
|
+
user: {
|
|
2336
|
+
create: {
|
|
2337
|
+
before(user: {
|
|
2338
|
+
id: string;
|
|
2339
|
+
createdAt: Date;
|
|
2340
|
+
updatedAt: Date;
|
|
2341
|
+
email: string;
|
|
2342
|
+
emailVerified: boolean;
|
|
2343
|
+
name: string;
|
|
2344
|
+
image?: string | null | undefined;
|
|
2345
|
+
} & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null): Promise<{
|
|
2346
|
+
data: {
|
|
2347
|
+
username: string;
|
|
2348
|
+
displayUsername: string;
|
|
2349
|
+
id: string;
|
|
2350
|
+
createdAt: Date;
|
|
2351
|
+
updatedAt: Date;
|
|
2352
|
+
email: string;
|
|
2353
|
+
emailVerified: boolean;
|
|
2354
|
+
name: string;
|
|
2355
|
+
image?: string | null | undefined;
|
|
2356
|
+
};
|
|
2357
|
+
} | {
|
|
2358
|
+
data: {
|
|
2359
|
+
displayUsername?: string | undefined;
|
|
2360
|
+
id: string;
|
|
2361
|
+
createdAt: Date;
|
|
2362
|
+
updatedAt: Date;
|
|
2363
|
+
email: string;
|
|
2364
|
+
emailVerified: boolean;
|
|
2365
|
+
name: string;
|
|
2366
|
+
image?: string | null | undefined;
|
|
2367
|
+
};
|
|
2368
|
+
}>;
|
|
2369
|
+
};
|
|
2370
|
+
update: {
|
|
2371
|
+
before(user: Partial<{
|
|
2372
|
+
id: string;
|
|
2373
|
+
createdAt: Date;
|
|
2374
|
+
updatedAt: Date;
|
|
2375
|
+
email: string;
|
|
2376
|
+
emailVerified: boolean;
|
|
2377
|
+
name: string;
|
|
2378
|
+
image?: string | null | undefined;
|
|
2379
|
+
}> & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null): Promise<{
|
|
2380
|
+
data: {
|
|
2381
|
+
displayUsername?: string | undefined;
|
|
2382
|
+
username: string;
|
|
2383
|
+
id?: string | undefined;
|
|
2384
|
+
createdAt?: Date | undefined;
|
|
2385
|
+
updatedAt?: Date | undefined;
|
|
2386
|
+
email?: string | undefined;
|
|
2387
|
+
emailVerified?: boolean | undefined;
|
|
2388
|
+
name?: string | undefined;
|
|
2389
|
+
image?: string | null | undefined;
|
|
2390
|
+
};
|
|
2391
|
+
} | {
|
|
2392
|
+
data: {
|
|
2393
|
+
displayUsername?: string | undefined;
|
|
2394
|
+
id?: string | undefined;
|
|
2395
|
+
createdAt?: Date | undefined;
|
|
2396
|
+
updatedAt?: Date | undefined;
|
|
2397
|
+
email?: string | undefined;
|
|
2398
|
+
emailVerified?: boolean | undefined;
|
|
2399
|
+
name?: string | undefined;
|
|
2400
|
+
image?: string | null | undefined;
|
|
2401
|
+
};
|
|
2402
|
+
}>;
|
|
2403
|
+
};
|
|
2404
|
+
};
|
|
2405
|
+
};
|
|
2406
|
+
};
|
|
2407
|
+
};
|
|
2408
|
+
endpoints: {
|
|
2409
|
+
signInUsername: import("better-call").StrictEndpoint<"/sign-in/username", {
|
|
2410
|
+
method: "POST";
|
|
2411
|
+
body: import("zod").ZodObject<{
|
|
2412
|
+
username: import("zod").ZodString;
|
|
2413
|
+
password: import("zod").ZodString;
|
|
2414
|
+
rememberMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
2415
|
+
callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
|
|
2416
|
+
}, import("zod/v4/core").$strip>;
|
|
2417
|
+
metadata: {
|
|
2418
|
+
openapi: {
|
|
2419
|
+
summary: string;
|
|
2420
|
+
description: string;
|
|
2421
|
+
responses: {
|
|
2422
|
+
200: {
|
|
2423
|
+
description: string;
|
|
2424
|
+
content: {
|
|
2425
|
+
"application/json": {
|
|
2426
|
+
schema: {
|
|
2427
|
+
type: "object";
|
|
2428
|
+
properties: {
|
|
2429
|
+
redirect: {
|
|
2430
|
+
type: string;
|
|
2431
|
+
description: string;
|
|
2432
|
+
};
|
|
2433
|
+
token: {
|
|
2434
|
+
type: string;
|
|
2435
|
+
description: string;
|
|
2436
|
+
};
|
|
2437
|
+
url: {
|
|
2438
|
+
type: string;
|
|
2439
|
+
nullable: boolean;
|
|
2440
|
+
description: string;
|
|
2441
|
+
};
|
|
2442
|
+
user: {
|
|
2443
|
+
$ref: string;
|
|
2444
|
+
};
|
|
2445
|
+
};
|
|
2446
|
+
required: string[];
|
|
2447
|
+
};
|
|
2448
|
+
};
|
|
2449
|
+
};
|
|
2450
|
+
};
|
|
2451
|
+
422: {
|
|
2452
|
+
description: string;
|
|
2453
|
+
content: {
|
|
2454
|
+
"application/json": {
|
|
2455
|
+
schema: {
|
|
2456
|
+
type: "object";
|
|
2457
|
+
properties: {
|
|
2458
|
+
message: {
|
|
2459
|
+
type: string;
|
|
2460
|
+
};
|
|
2461
|
+
};
|
|
2462
|
+
};
|
|
2463
|
+
};
|
|
2464
|
+
};
|
|
2465
|
+
};
|
|
2466
|
+
};
|
|
2467
|
+
};
|
|
2468
|
+
};
|
|
2469
|
+
}, {
|
|
2470
|
+
redirect: boolean;
|
|
2471
|
+
token: string;
|
|
2472
|
+
url: string | undefined;
|
|
2473
|
+
user: {
|
|
2474
|
+
id: string;
|
|
2475
|
+
createdAt: Date;
|
|
2476
|
+
updatedAt: Date;
|
|
2477
|
+
email: string;
|
|
2478
|
+
emailVerified: boolean;
|
|
2479
|
+
name: string;
|
|
2480
|
+
image?: string | null | undefined;
|
|
2481
|
+
} & {
|
|
2482
|
+
username: string;
|
|
2483
|
+
displayUsername: string;
|
|
2484
|
+
};
|
|
2485
|
+
}>;
|
|
2486
|
+
isUsernameAvailable: import("better-call").StrictEndpoint<"/is-username-available", {
|
|
2487
|
+
method: "POST";
|
|
2488
|
+
body: import("zod").ZodObject<{
|
|
2489
|
+
username: import("zod").ZodString;
|
|
2490
|
+
}, import("zod/v4/core").$strip>;
|
|
2491
|
+
}, {
|
|
2492
|
+
available: boolean;
|
|
2493
|
+
}>;
|
|
2494
|
+
};
|
|
2495
|
+
schema: {
|
|
2496
|
+
user: {
|
|
2497
|
+
fields: {
|
|
2498
|
+
username: {
|
|
2499
|
+
type: "string";
|
|
2500
|
+
required: false;
|
|
2501
|
+
sortable: true;
|
|
2502
|
+
unique: true;
|
|
2503
|
+
returned: true;
|
|
2504
|
+
transform: {
|
|
2505
|
+
input(value: import("better-auth").DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
|
|
2506
|
+
};
|
|
2507
|
+
};
|
|
2508
|
+
displayUsername: {
|
|
2509
|
+
type: "string";
|
|
2510
|
+
required: false;
|
|
2511
|
+
transform: {
|
|
2512
|
+
input(value: import("better-auth").DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
|
|
2513
|
+
};
|
|
2514
|
+
};
|
|
2515
|
+
};
|
|
2516
|
+
};
|
|
2517
|
+
};
|
|
2518
|
+
hooks: {
|
|
2519
|
+
before: {
|
|
2520
|
+
matcher(context: import("better-auth").HookEndpointContext): boolean;
|
|
2521
|
+
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>;
|
|
2522
|
+
}[];
|
|
2523
|
+
};
|
|
2524
|
+
options: import("better-auth/plugins/username").UsernameOptions | undefined;
|
|
2525
|
+
$ERROR_CODES: {
|
|
2526
|
+
EMAIL_NOT_VERIFIED: import("better-auth").RawError<"EMAIL_NOT_VERIFIED">;
|
|
2527
|
+
UNEXPECTED_ERROR: import("better-auth").RawError<"UNEXPECTED_ERROR">;
|
|
2528
|
+
INVALID_USERNAME_OR_PASSWORD: import("better-auth").RawError<"INVALID_USERNAME_OR_PASSWORD">;
|
|
2529
|
+
USERNAME_IS_ALREADY_TAKEN: import("better-auth").RawError<"USERNAME_IS_ALREADY_TAKEN">;
|
|
2530
|
+
USERNAME_TOO_SHORT: import("better-auth").RawError<"USERNAME_TOO_SHORT">;
|
|
2531
|
+
USERNAME_TOO_LONG: import("better-auth").RawError<"USERNAME_TOO_LONG">;
|
|
2532
|
+
INVALID_USERNAME: import("better-auth").RawError<"INVALID_USERNAME">;
|
|
2533
|
+
INVALID_DISPLAY_USERNAME: import("better-auth").RawError<"INVALID_DISPLAY_USERNAME">;
|
|
2534
|
+
};
|
|
2535
|
+
}>;
|
|
2536
|
+
atomListeners: {
|
|
2537
|
+
matcher: (path: string) => path is "/sign-in/username";
|
|
2538
|
+
signal: "$sessionSignal";
|
|
2539
|
+
}[];
|
|
2540
|
+
$ERROR_CODES: {
|
|
2541
|
+
EMAIL_NOT_VERIFIED: import("better-auth").RawError<"EMAIL_NOT_VERIFIED">;
|
|
2542
|
+
UNEXPECTED_ERROR: import("better-auth").RawError<"UNEXPECTED_ERROR">;
|
|
2543
|
+
INVALID_USERNAME_OR_PASSWORD: import("better-auth").RawError<"INVALID_USERNAME_OR_PASSWORD">;
|
|
2544
|
+
USERNAME_IS_ALREADY_TAKEN: import("better-auth").RawError<"USERNAME_IS_ALREADY_TAKEN">;
|
|
2545
|
+
USERNAME_TOO_SHORT: import("better-auth").RawError<"USERNAME_TOO_SHORT">;
|
|
2546
|
+
USERNAME_TOO_LONG: import("better-auth").RawError<"USERNAME_TOO_LONG">;
|
|
2547
|
+
INVALID_USERNAME: import("better-auth").RawError<"INVALID_USERNAME">;
|
|
2548
|
+
INVALID_DISPLAY_USERNAME: import("better-auth").RawError<"INVALID_DISPLAY_USERNAME">;
|
|
2549
|
+
};
|
|
2550
|
+
} | {
|
|
2551
|
+
id: "multi-session";
|
|
2552
|
+
version: string;
|
|
2553
|
+
$InferServerPlugin: ReturnType<(options?: import("better-auth/plugins/multi-session").MultiSessionConfig | undefined) => {
|
|
2554
|
+
id: "multi-session";
|
|
2555
|
+
version: string;
|
|
2556
|
+
endpoints: {
|
|
2557
|
+
listDeviceSessions: import("better-call").StrictEndpoint<"/multi-session/list-device-sessions", {
|
|
2558
|
+
method: "GET";
|
|
2559
|
+
requireHeaders: true;
|
|
2560
|
+
}, {
|
|
2561
|
+
session: {
|
|
2562
|
+
id: string;
|
|
2563
|
+
createdAt: Date;
|
|
2564
|
+
updatedAt: Date;
|
|
2565
|
+
userId: string;
|
|
2566
|
+
expiresAt: Date;
|
|
2567
|
+
token: string;
|
|
2568
|
+
ipAddress?: string | null | undefined;
|
|
2569
|
+
userAgent?: string | null | undefined;
|
|
2570
|
+
};
|
|
2571
|
+
user: {
|
|
2572
|
+
id: string;
|
|
2573
|
+
createdAt: Date;
|
|
2574
|
+
updatedAt: Date;
|
|
2575
|
+
email: string;
|
|
2576
|
+
emailVerified: boolean;
|
|
2577
|
+
name: string;
|
|
2578
|
+
image?: string | null | undefined;
|
|
2579
|
+
};
|
|
2580
|
+
}[]>;
|
|
2581
|
+
setActiveSession: import("better-call").StrictEndpoint<"/multi-session/set-active", {
|
|
2582
|
+
method: "POST";
|
|
2583
|
+
body: import("zod").ZodObject<{
|
|
2584
|
+
sessionToken: import("zod").ZodString;
|
|
2585
|
+
}, import("zod/v4/core").$strip>;
|
|
2586
|
+
requireHeaders: true;
|
|
2587
|
+
metadata: {
|
|
2588
|
+
openapi: {
|
|
2589
|
+
description: string;
|
|
2590
|
+
responses: {
|
|
2591
|
+
200: {
|
|
2592
|
+
description: string;
|
|
2593
|
+
content: {
|
|
2594
|
+
"application/json": {
|
|
2595
|
+
schema: {
|
|
2596
|
+
type: "object";
|
|
2597
|
+
properties: {
|
|
2598
|
+
session: {
|
|
2599
|
+
$ref: string;
|
|
2600
|
+
};
|
|
2601
|
+
};
|
|
2602
|
+
};
|
|
2603
|
+
};
|
|
2604
|
+
};
|
|
2605
|
+
};
|
|
2606
|
+
};
|
|
2607
|
+
};
|
|
2608
|
+
};
|
|
2609
|
+
}, {
|
|
2610
|
+
session: {
|
|
2611
|
+
id: string;
|
|
2612
|
+
createdAt: Date;
|
|
2613
|
+
updatedAt: Date;
|
|
2614
|
+
userId: string;
|
|
2615
|
+
expiresAt: Date;
|
|
2616
|
+
token: string;
|
|
2617
|
+
ipAddress?: string | null | undefined;
|
|
2618
|
+
userAgent?: string | null | undefined;
|
|
2619
|
+
} & Record<string, any>;
|
|
2620
|
+
user: {
|
|
2621
|
+
id: string;
|
|
2622
|
+
createdAt: Date;
|
|
2623
|
+
updatedAt: Date;
|
|
2624
|
+
email: string;
|
|
2625
|
+
emailVerified: boolean;
|
|
2626
|
+
name: string;
|
|
2627
|
+
image?: string | null | undefined;
|
|
2628
|
+
} & Record<string, any>;
|
|
2629
|
+
}>;
|
|
2630
|
+
revokeDeviceSession: import("better-call").StrictEndpoint<"/multi-session/revoke", {
|
|
2631
|
+
method: "POST";
|
|
2632
|
+
body: import("zod").ZodObject<{
|
|
2633
|
+
sessionToken: import("zod").ZodString;
|
|
2634
|
+
}, import("zod/v4/core").$strip>;
|
|
2635
|
+
requireHeaders: true;
|
|
2636
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
2637
|
+
session: {
|
|
2638
|
+
session: Record<string, any> & {
|
|
2639
|
+
id: string;
|
|
2640
|
+
createdAt: Date;
|
|
2641
|
+
updatedAt: Date;
|
|
2642
|
+
userId: string;
|
|
2643
|
+
expiresAt: Date;
|
|
2644
|
+
token: string;
|
|
2645
|
+
ipAddress?: string | null | undefined;
|
|
2646
|
+
userAgent?: string | null | undefined;
|
|
2647
|
+
};
|
|
2648
|
+
user: Record<string, any> & {
|
|
2649
|
+
id: string;
|
|
2650
|
+
createdAt: Date;
|
|
2651
|
+
updatedAt: Date;
|
|
2652
|
+
email: string;
|
|
2653
|
+
emailVerified: boolean;
|
|
2654
|
+
name: string;
|
|
2655
|
+
image?: string | null | undefined;
|
|
2656
|
+
};
|
|
2657
|
+
};
|
|
2658
|
+
}>)[];
|
|
2659
|
+
metadata: {
|
|
2660
|
+
openapi: {
|
|
2661
|
+
description: string;
|
|
2662
|
+
responses: {
|
|
2663
|
+
200: {
|
|
2664
|
+
description: string;
|
|
2665
|
+
content: {
|
|
2666
|
+
"application/json": {
|
|
2667
|
+
schema: {
|
|
2668
|
+
type: "object";
|
|
2669
|
+
properties: {
|
|
2670
|
+
status: {
|
|
2671
|
+
type: string;
|
|
2672
|
+
};
|
|
2673
|
+
};
|
|
2674
|
+
};
|
|
2675
|
+
};
|
|
2676
|
+
};
|
|
2677
|
+
};
|
|
2678
|
+
};
|
|
2679
|
+
};
|
|
2680
|
+
};
|
|
2681
|
+
}, {
|
|
2682
|
+
status: boolean;
|
|
2683
|
+
}>;
|
|
2684
|
+
};
|
|
2685
|
+
hooks: {
|
|
2686
|
+
after: {
|
|
2687
|
+
matcher: (context: import("better-auth").HookEndpointContext) => boolean;
|
|
2688
|
+
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<void>;
|
|
2689
|
+
}[];
|
|
2690
|
+
};
|
|
2691
|
+
options: import("better-auth/plugins/multi-session").MultiSessionConfig | undefined;
|
|
2692
|
+
$ERROR_CODES: {
|
|
2693
|
+
INVALID_SESSION_TOKEN: import("better-auth").RawError<"INVALID_SESSION_TOKEN">;
|
|
2694
|
+
};
|
|
2695
|
+
}>;
|
|
2696
|
+
atomListeners: {
|
|
2697
|
+
matcher(path: string): path is "/multi-session/set-active";
|
|
2698
|
+
signal: "$sessionSignal";
|
|
2699
|
+
}[];
|
|
2700
|
+
$ERROR_CODES: {
|
|
2701
|
+
INVALID_SESSION_TOKEN: import("better-auth").RawError<"INVALID_SESSION_TOKEN">;
|
|
2702
|
+
};
|
|
2703
|
+
} | {
|
|
2704
|
+
id: "phoneNumber";
|
|
2705
|
+
version: string;
|
|
2706
|
+
$InferServerPlugin: ReturnType<(options?: import("better-auth/plugins/phone-number").PhoneNumberOptions | undefined) => {
|
|
2707
|
+
id: "phone-number";
|
|
2708
|
+
version: string;
|
|
2709
|
+
init(): {
|
|
2710
|
+
options: {
|
|
2711
|
+
databaseHooks: {
|
|
2712
|
+
user: {
|
|
2713
|
+
update: {
|
|
2714
|
+
before(data: Partial<{
|
|
2715
|
+
id: string;
|
|
2716
|
+
createdAt: Date;
|
|
2717
|
+
updatedAt: Date;
|
|
2718
|
+
email: string;
|
|
2719
|
+
emailVerified: boolean;
|
|
2720
|
+
name: string;
|
|
2721
|
+
image?: string | null | undefined;
|
|
2722
|
+
}> & Record<string, unknown>): Promise<{
|
|
2723
|
+
data: {
|
|
2724
|
+
[x: string]: unknown;
|
|
2725
|
+
id?: string | undefined;
|
|
2726
|
+
createdAt?: Date | undefined;
|
|
2727
|
+
updatedAt?: Date | undefined;
|
|
2728
|
+
email?: string | undefined;
|
|
2729
|
+
emailVerified?: boolean | undefined;
|
|
2730
|
+
name?: string | undefined;
|
|
2731
|
+
image?: string | null | undefined;
|
|
2732
|
+
};
|
|
2733
|
+
} | undefined>;
|
|
2734
|
+
};
|
|
2735
|
+
};
|
|
2736
|
+
};
|
|
2737
|
+
};
|
|
2738
|
+
};
|
|
2739
|
+
hooks: {
|
|
2740
|
+
before: {
|
|
2741
|
+
matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
|
|
2742
|
+
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<never>;
|
|
2743
|
+
}[];
|
|
2744
|
+
};
|
|
2745
|
+
endpoints: {
|
|
2746
|
+
signInPhoneNumber: import("better-call").StrictEndpoint<"/sign-in/phone-number", {
|
|
2747
|
+
method: "POST";
|
|
2748
|
+
body: import("zod").ZodObject<{
|
|
2749
|
+
phoneNumber: import("zod").ZodString;
|
|
2750
|
+
password: import("zod").ZodString;
|
|
2751
|
+
rememberMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
2752
|
+
}, import("zod/v4/core").$strip>;
|
|
2753
|
+
metadata: {
|
|
2754
|
+
openapi: {
|
|
2755
|
+
summary: string;
|
|
2756
|
+
description: string;
|
|
2757
|
+
responses: {
|
|
2758
|
+
200: {
|
|
2759
|
+
description: string;
|
|
2760
|
+
content: {
|
|
2761
|
+
"application/json": {
|
|
2762
|
+
schema: {
|
|
2763
|
+
type: "object";
|
|
2764
|
+
properties: {
|
|
2765
|
+
user: {
|
|
2766
|
+
$ref: string;
|
|
2767
|
+
};
|
|
2768
|
+
session: {
|
|
2769
|
+
$ref: string;
|
|
2770
|
+
};
|
|
2771
|
+
};
|
|
2772
|
+
};
|
|
2773
|
+
};
|
|
2774
|
+
};
|
|
2775
|
+
};
|
|
2776
|
+
400: {
|
|
2777
|
+
description: string;
|
|
2778
|
+
};
|
|
2779
|
+
};
|
|
2780
|
+
};
|
|
2781
|
+
};
|
|
2782
|
+
}, {
|
|
2783
|
+
token: string;
|
|
2784
|
+
user: import("better-auth/plugins/phone-number").UserWithPhoneNumber;
|
|
2785
|
+
}>;
|
|
2786
|
+
sendPhoneNumberOTP: import("better-call").StrictEndpoint<"/phone-number/send-otp", {
|
|
2787
|
+
method: "POST";
|
|
2788
|
+
body: import("zod").ZodObject<{
|
|
2789
|
+
phoneNumber: import("zod").ZodString;
|
|
2790
|
+
}, import("zod/v4/core").$strip>;
|
|
2791
|
+
metadata: {
|
|
2792
|
+
openapi: {
|
|
2793
|
+
summary: string;
|
|
2794
|
+
description: string;
|
|
2795
|
+
responses: {
|
|
2796
|
+
200: {
|
|
2797
|
+
description: string;
|
|
2798
|
+
content: {
|
|
2799
|
+
"application/json": {
|
|
2800
|
+
schema: {
|
|
2801
|
+
type: "object";
|
|
2802
|
+
properties: {
|
|
2803
|
+
message: {
|
|
2804
|
+
type: string;
|
|
2805
|
+
};
|
|
2806
|
+
};
|
|
2807
|
+
};
|
|
2808
|
+
};
|
|
2809
|
+
};
|
|
2810
|
+
};
|
|
2811
|
+
};
|
|
2812
|
+
};
|
|
2813
|
+
};
|
|
2814
|
+
}, {
|
|
2815
|
+
message: string;
|
|
2816
|
+
}>;
|
|
2817
|
+
verifyPhoneNumber: import("better-call").StrictEndpoint<"/phone-number/verify", {
|
|
2818
|
+
method: "POST";
|
|
2819
|
+
body: import("zod").ZodIntersection<import("zod").ZodObject<{
|
|
2820
|
+
phoneNumber: import("zod").ZodString;
|
|
2821
|
+
code: import("zod").ZodString;
|
|
2822
|
+
disableSession: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
2823
|
+
updatePhoneNumber: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
2824
|
+
}, import("zod/v4/core").$strip>, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
|
|
2825
|
+
metadata: {
|
|
2826
|
+
openapi: {
|
|
2827
|
+
summary: string;
|
|
2828
|
+
description: string;
|
|
2829
|
+
responses: {
|
|
2830
|
+
"200": {
|
|
2831
|
+
description: string;
|
|
2832
|
+
content: {
|
|
2833
|
+
"application/json": {
|
|
2834
|
+
schema: {
|
|
2835
|
+
type: "object";
|
|
2836
|
+
properties: {
|
|
2837
|
+
status: {
|
|
2838
|
+
type: string;
|
|
2839
|
+
description: string;
|
|
2840
|
+
enum: boolean[];
|
|
2841
|
+
};
|
|
2842
|
+
token: {
|
|
2843
|
+
type: string;
|
|
2844
|
+
nullable: boolean;
|
|
2845
|
+
description: string;
|
|
2846
|
+
};
|
|
2847
|
+
user: {
|
|
2848
|
+
type: string;
|
|
2849
|
+
nullable: boolean;
|
|
2850
|
+
properties: {
|
|
2851
|
+
id: {
|
|
2852
|
+
type: string;
|
|
2853
|
+
description: string;
|
|
2854
|
+
};
|
|
2855
|
+
email: {
|
|
2856
|
+
type: string;
|
|
2857
|
+
format: string;
|
|
2858
|
+
nullable: boolean;
|
|
2859
|
+
description: string;
|
|
2860
|
+
};
|
|
2861
|
+
emailVerified: {
|
|
2862
|
+
type: string;
|
|
2863
|
+
nullable: boolean;
|
|
2864
|
+
description: string;
|
|
2865
|
+
};
|
|
2866
|
+
name: {
|
|
2867
|
+
type: string;
|
|
2868
|
+
nullable: boolean;
|
|
2869
|
+
description: string;
|
|
2870
|
+
};
|
|
2871
|
+
image: {
|
|
2872
|
+
type: string;
|
|
2873
|
+
format: string;
|
|
2874
|
+
nullable: boolean;
|
|
2875
|
+
description: string;
|
|
2876
|
+
};
|
|
2877
|
+
phoneNumber: {
|
|
2878
|
+
type: string;
|
|
2879
|
+
description: string;
|
|
2880
|
+
};
|
|
2881
|
+
phoneNumberVerified: {
|
|
2882
|
+
type: string;
|
|
2883
|
+
description: string;
|
|
2884
|
+
};
|
|
2885
|
+
createdAt: {
|
|
2886
|
+
type: string;
|
|
2887
|
+
format: string;
|
|
2888
|
+
description: string;
|
|
2889
|
+
};
|
|
2890
|
+
updatedAt: {
|
|
2891
|
+
type: string;
|
|
2892
|
+
format: string;
|
|
2893
|
+
description: string;
|
|
2894
|
+
};
|
|
2895
|
+
};
|
|
2896
|
+
required: string[];
|
|
2897
|
+
description: string;
|
|
2898
|
+
};
|
|
2899
|
+
};
|
|
2900
|
+
required: string[];
|
|
2901
|
+
};
|
|
2902
|
+
};
|
|
2903
|
+
};
|
|
2904
|
+
};
|
|
2905
|
+
400: {
|
|
2906
|
+
description: string;
|
|
2907
|
+
};
|
|
2908
|
+
};
|
|
2909
|
+
};
|
|
2910
|
+
};
|
|
2911
|
+
}, {
|
|
2912
|
+
status: boolean;
|
|
2913
|
+
token: string;
|
|
2914
|
+
user: {
|
|
2915
|
+
id: string;
|
|
2916
|
+
createdAt: Date;
|
|
2917
|
+
updatedAt: Date;
|
|
2918
|
+
email: string;
|
|
2919
|
+
emailVerified: boolean;
|
|
2920
|
+
name: string;
|
|
2921
|
+
image?: string | null | undefined;
|
|
2922
|
+
} & import("better-auth/plugins/phone-number").UserWithPhoneNumber;
|
|
2923
|
+
} | {
|
|
2924
|
+
status: boolean;
|
|
2925
|
+
token: null;
|
|
2926
|
+
user: import("better-auth/plugins/phone-number").UserWithPhoneNumber;
|
|
2927
|
+
}>;
|
|
2928
|
+
requestPasswordResetPhoneNumber: import("better-call").StrictEndpoint<"/phone-number/request-password-reset", {
|
|
2929
|
+
method: "POST";
|
|
2930
|
+
body: import("zod").ZodObject<{
|
|
2931
|
+
phoneNumber: import("zod").ZodString;
|
|
2932
|
+
}, import("zod/v4/core").$strip>;
|
|
2933
|
+
metadata: {
|
|
2934
|
+
openapi: {
|
|
2935
|
+
description: string;
|
|
2936
|
+
responses: {
|
|
2937
|
+
"200": {
|
|
2938
|
+
description: string;
|
|
2939
|
+
content: {
|
|
2940
|
+
"application/json": {
|
|
2941
|
+
schema: {
|
|
2942
|
+
type: "object";
|
|
2943
|
+
properties: {
|
|
2944
|
+
status: {
|
|
2945
|
+
type: string;
|
|
2946
|
+
description: string;
|
|
2947
|
+
enum: boolean[];
|
|
2948
|
+
};
|
|
2949
|
+
};
|
|
2950
|
+
required: string[];
|
|
2951
|
+
};
|
|
2952
|
+
};
|
|
2953
|
+
};
|
|
2954
|
+
};
|
|
2955
|
+
};
|
|
2956
|
+
};
|
|
2957
|
+
};
|
|
2958
|
+
}, {
|
|
2959
|
+
status: boolean;
|
|
2960
|
+
}>;
|
|
2961
|
+
resetPasswordPhoneNumber: import("better-call").StrictEndpoint<"/phone-number/reset-password", {
|
|
2962
|
+
method: "POST";
|
|
2963
|
+
body: import("zod").ZodObject<{
|
|
2964
|
+
otp: import("zod").ZodString;
|
|
2965
|
+
phoneNumber: import("zod").ZodString;
|
|
2966
|
+
newPassword: import("zod").ZodString;
|
|
2967
|
+
}, import("zod/v4/core").$strip>;
|
|
2968
|
+
metadata: {
|
|
2969
|
+
openapi: {
|
|
2970
|
+
description: string;
|
|
2971
|
+
responses: {
|
|
2972
|
+
"200": {
|
|
2973
|
+
description: string;
|
|
2974
|
+
content: {
|
|
2975
|
+
"application/json": {
|
|
2976
|
+
schema: {
|
|
2977
|
+
type: "object";
|
|
2978
|
+
properties: {
|
|
2979
|
+
status: {
|
|
2980
|
+
type: string;
|
|
2981
|
+
description: string;
|
|
2982
|
+
enum: boolean[];
|
|
2983
|
+
};
|
|
2984
|
+
};
|
|
2985
|
+
required: string[];
|
|
2986
|
+
};
|
|
2987
|
+
};
|
|
2988
|
+
};
|
|
2989
|
+
};
|
|
2990
|
+
};
|
|
2991
|
+
};
|
|
2992
|
+
};
|
|
2993
|
+
}, {
|
|
2994
|
+
status: boolean;
|
|
2995
|
+
}>;
|
|
2996
|
+
};
|
|
2997
|
+
schema: {
|
|
2998
|
+
user: {
|
|
2999
|
+
fields: {
|
|
3000
|
+
phoneNumber: {
|
|
3001
|
+
type: "string";
|
|
3002
|
+
required: false;
|
|
3003
|
+
unique: true;
|
|
3004
|
+
sortable: true;
|
|
3005
|
+
returned: true;
|
|
3006
|
+
};
|
|
3007
|
+
phoneNumberVerified: {
|
|
3008
|
+
type: "boolean";
|
|
3009
|
+
required: false;
|
|
3010
|
+
returned: true;
|
|
3011
|
+
input: false;
|
|
3012
|
+
};
|
|
3013
|
+
};
|
|
3014
|
+
};
|
|
3015
|
+
};
|
|
3016
|
+
rateLimit: {
|
|
3017
|
+
pathMatcher(path: string): boolean;
|
|
3018
|
+
window: number;
|
|
3019
|
+
max: number;
|
|
3020
|
+
}[];
|
|
3021
|
+
options: import("better-auth/plugins/phone-number").PhoneNumberOptions | undefined;
|
|
3022
|
+
$ERROR_CODES: {
|
|
3023
|
+
OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
|
|
3024
|
+
INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
|
|
3025
|
+
TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
|
|
3026
|
+
INVALID_PHONE_NUMBER: import("better-auth").RawError<"INVALID_PHONE_NUMBER">;
|
|
3027
|
+
PHONE_NUMBER_EXIST: import("better-auth").RawError<"PHONE_NUMBER_EXIST">;
|
|
3028
|
+
PHONE_NUMBER_NOT_EXIST: import("better-auth").RawError<"PHONE_NUMBER_NOT_EXIST">;
|
|
3029
|
+
INVALID_PHONE_NUMBER_OR_PASSWORD: import("better-auth").RawError<"INVALID_PHONE_NUMBER_OR_PASSWORD">;
|
|
3030
|
+
UNEXPECTED_ERROR: import("better-auth").RawError<"UNEXPECTED_ERROR">;
|
|
3031
|
+
OTP_NOT_FOUND: import("better-auth").RawError<"OTP_NOT_FOUND">;
|
|
3032
|
+
PHONE_NUMBER_NOT_VERIFIED: import("better-auth").RawError<"PHONE_NUMBER_NOT_VERIFIED">;
|
|
3033
|
+
PHONE_NUMBER_CANNOT_BE_UPDATED: import("better-auth").RawError<"PHONE_NUMBER_CANNOT_BE_UPDATED">;
|
|
3034
|
+
SEND_OTP_NOT_IMPLEMENTED: import("better-auth").RawError<"SEND_OTP_NOT_IMPLEMENTED">;
|
|
3035
|
+
};
|
|
3036
|
+
}>;
|
|
3037
|
+
atomListeners: {
|
|
3038
|
+
matcher(path: string): path is "/phone-number/verify" | "/sign-in/phone-number" | "/phone-number/update";
|
|
3039
|
+
signal: "$sessionSignal";
|
|
3040
|
+
}[];
|
|
3041
|
+
$ERROR_CODES: {
|
|
3042
|
+
OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
|
|
3043
|
+
INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
|
|
3044
|
+
TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
|
|
3045
|
+
INVALID_PHONE_NUMBER: import("better-auth").RawError<"INVALID_PHONE_NUMBER">;
|
|
3046
|
+
PHONE_NUMBER_EXIST: import("better-auth").RawError<"PHONE_NUMBER_EXIST">;
|
|
3047
|
+
PHONE_NUMBER_NOT_EXIST: import("better-auth").RawError<"PHONE_NUMBER_NOT_EXIST">;
|
|
3048
|
+
INVALID_PHONE_NUMBER_OR_PASSWORD: import("better-auth").RawError<"INVALID_PHONE_NUMBER_OR_PASSWORD">;
|
|
3049
|
+
UNEXPECTED_ERROR: import("better-auth").RawError<"UNEXPECTED_ERROR">;
|
|
3050
|
+
OTP_NOT_FOUND: import("better-auth").RawError<"OTP_NOT_FOUND">;
|
|
3051
|
+
PHONE_NUMBER_NOT_VERIFIED: import("better-auth").RawError<"PHONE_NUMBER_NOT_VERIFIED">;
|
|
3052
|
+
PHONE_NUMBER_CANNOT_BE_UPDATED: import("better-auth").RawError<"PHONE_NUMBER_CANNOT_BE_UPDATED">;
|
|
3053
|
+
SEND_OTP_NOT_IMPLEMENTED: import("better-auth").RawError<"SEND_OTP_NOT_IMPLEMENTED">;
|
|
3054
|
+
};
|
|
3055
|
+
} | {
|
|
3056
|
+
id: "api-key";
|
|
3057
|
+
version: string;
|
|
3058
|
+
$InferServerPlugin: {
|
|
3059
|
+
id: "api-key";
|
|
3060
|
+
version: string;
|
|
3061
|
+
$ERROR_CODES: {
|
|
3062
|
+
INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
|
|
3063
|
+
REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
|
|
3064
|
+
REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
|
|
3065
|
+
USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
|
|
3066
|
+
UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
|
|
3067
|
+
KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
|
|
3068
|
+
KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
|
|
3069
|
+
KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
|
|
3070
|
+
USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
|
|
3071
|
+
KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
|
|
3072
|
+
EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
|
|
3073
|
+
EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
|
|
3074
|
+
INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
|
|
3075
|
+
INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
|
|
3076
|
+
INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
|
|
3077
|
+
METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
|
|
3078
|
+
RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
|
|
3079
|
+
NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
|
|
3080
|
+
KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
|
|
3081
|
+
INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
|
|
3082
|
+
INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
|
|
3083
|
+
INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
|
|
3084
|
+
INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
|
|
3085
|
+
SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
|
|
3086
|
+
FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
|
|
3087
|
+
NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
|
|
3088
|
+
ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
|
|
3089
|
+
USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
|
|
3090
|
+
INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
|
|
3091
|
+
NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
|
|
3092
|
+
ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
|
|
3093
|
+
};
|
|
3094
|
+
hooks: {
|
|
3095
|
+
before: {
|
|
3096
|
+
matcher: (ctx: import("better-auth").HookEndpointContext) => boolean;
|
|
3097
|
+
handler: (inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
3098
|
+
user: {
|
|
3099
|
+
id: string;
|
|
3100
|
+
createdAt: Date;
|
|
3101
|
+
updatedAt: Date;
|
|
3102
|
+
email: string;
|
|
3103
|
+
emailVerified: boolean;
|
|
3104
|
+
name: string;
|
|
3105
|
+
image?: string | null | undefined;
|
|
3106
|
+
};
|
|
3107
|
+
session: {
|
|
3108
|
+
id: string;
|
|
3109
|
+
token: string;
|
|
3110
|
+
userId: string;
|
|
3111
|
+
userAgent: string | null;
|
|
3112
|
+
ipAddress: string | null;
|
|
3113
|
+
createdAt: Date;
|
|
3114
|
+
updatedAt: Date;
|
|
3115
|
+
expiresAt: Date;
|
|
3116
|
+
};
|
|
3117
|
+
} | {
|
|
3118
|
+
context: import("better-call").MiddlewareContext<import("better-call").MiddlewareOptions, {
|
|
3119
|
+
returned?: unknown | undefined;
|
|
3120
|
+
responseHeaders?: Headers | undefined;
|
|
3121
|
+
} & import("better-auth").PluginContext<import("better-auth").BetterAuthOptions> & import("better-auth").InfoContext & {
|
|
3122
|
+
options: import("better-auth").BetterAuthOptions;
|
|
3123
|
+
trustedOrigins: string[];
|
|
3124
|
+
trustedProviders: string[];
|
|
3125
|
+
isTrustedOrigin: (url: string, settings?: {
|
|
3126
|
+
allowRelativePaths: boolean;
|
|
3127
|
+
}) => boolean;
|
|
3128
|
+
oauthConfig: {
|
|
3129
|
+
skipStateCookieCheck?: boolean | undefined;
|
|
3130
|
+
storeStateStrategy: "database" | "cookie";
|
|
3131
|
+
};
|
|
3132
|
+
newSession: {
|
|
3133
|
+
session: {
|
|
3134
|
+
id: string;
|
|
3135
|
+
createdAt: Date;
|
|
3136
|
+
updatedAt: Date;
|
|
3137
|
+
userId: string;
|
|
3138
|
+
expiresAt: Date;
|
|
3139
|
+
token: string;
|
|
3140
|
+
ipAddress?: string | null | undefined;
|
|
3141
|
+
userAgent?: string | null | undefined;
|
|
3142
|
+
} & Record<string, any>;
|
|
3143
|
+
user: {
|
|
3144
|
+
id: string;
|
|
3145
|
+
createdAt: Date;
|
|
3146
|
+
updatedAt: Date;
|
|
3147
|
+
email: string;
|
|
3148
|
+
emailVerified: boolean;
|
|
3149
|
+
name: string;
|
|
3150
|
+
image?: string | null | undefined;
|
|
3151
|
+
} & Record<string, any>;
|
|
3152
|
+
} | null;
|
|
3153
|
+
session: {
|
|
3154
|
+
session: {
|
|
3155
|
+
id: string;
|
|
3156
|
+
createdAt: Date;
|
|
3157
|
+
updatedAt: Date;
|
|
3158
|
+
userId: string;
|
|
3159
|
+
expiresAt: Date;
|
|
3160
|
+
token: string;
|
|
3161
|
+
ipAddress?: string | null | undefined;
|
|
3162
|
+
userAgent?: string | null | undefined;
|
|
3163
|
+
} & Record<string, any>;
|
|
3164
|
+
user: {
|
|
3165
|
+
id: string;
|
|
3166
|
+
createdAt: Date;
|
|
3167
|
+
updatedAt: Date;
|
|
3168
|
+
email: string;
|
|
3169
|
+
emailVerified: boolean;
|
|
3170
|
+
name: string;
|
|
3171
|
+
image?: string | null | undefined;
|
|
3172
|
+
} & Record<string, any>;
|
|
3173
|
+
} | null;
|
|
3174
|
+
setNewSession: (session: {
|
|
3175
|
+
session: {
|
|
3176
|
+
id: string;
|
|
3177
|
+
createdAt: Date;
|
|
3178
|
+
updatedAt: Date;
|
|
3179
|
+
userId: string;
|
|
3180
|
+
expiresAt: Date;
|
|
3181
|
+
token: string;
|
|
3182
|
+
ipAddress?: string | null | undefined;
|
|
3183
|
+
userAgent?: string | null | undefined;
|
|
3184
|
+
} & Record<string, any>;
|
|
3185
|
+
user: {
|
|
3186
|
+
id: string;
|
|
3187
|
+
createdAt: Date;
|
|
3188
|
+
updatedAt: Date;
|
|
3189
|
+
email: string;
|
|
3190
|
+
emailVerified: boolean;
|
|
3191
|
+
name: string;
|
|
3192
|
+
image?: string | null | undefined;
|
|
3193
|
+
} & Record<string, any>;
|
|
3194
|
+
} | null) => void;
|
|
3195
|
+
socialProviders: import("better-auth").OAuthProvider[];
|
|
3196
|
+
authCookies: import("better-auth").BetterAuthCookies;
|
|
3197
|
+
logger: ReturnType<(options?: import("better-auth").Logger | undefined) => import("better-auth").InternalLogger>;
|
|
3198
|
+
rateLimit: {
|
|
3199
|
+
enabled: boolean;
|
|
3200
|
+
window: number;
|
|
3201
|
+
max: number;
|
|
3202
|
+
storage: "memory" | "database" | "secondary-storage";
|
|
3203
|
+
} & Omit<import("better-auth").BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
|
|
3204
|
+
adapter: import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
|
|
3205
|
+
internalAdapter: import("better-auth").InternalAdapter<import("better-auth").BetterAuthOptions>;
|
|
3206
|
+
createAuthCookie: (cookieName: string, overrideAttributes?: Partial<import("better-call").CookieOptions> | undefined) => import("better-auth").BetterAuthCookie;
|
|
3207
|
+
secret: string;
|
|
3208
|
+
secretConfig: string | import("better-auth").SecretConfig;
|
|
3209
|
+
sessionConfig: {
|
|
3210
|
+
updateAge: number;
|
|
3211
|
+
expiresIn: number;
|
|
3212
|
+
freshAge: number;
|
|
3213
|
+
cookieRefreshCache: false | {
|
|
3214
|
+
enabled: true;
|
|
3215
|
+
updateAge: number;
|
|
3216
|
+
};
|
|
3217
|
+
};
|
|
3218
|
+
generateId: (options: {
|
|
3219
|
+
model: import("better-auth").ModelNames;
|
|
3220
|
+
size?: number | undefined;
|
|
3221
|
+
}) => string | false;
|
|
3222
|
+
secondaryStorage: import("better-auth").SecondaryStorage | undefined;
|
|
3223
|
+
password: {
|
|
3224
|
+
hash: (password: string) => Promise<string>;
|
|
3225
|
+
verify: (data: {
|
|
3226
|
+
password: string;
|
|
3227
|
+
hash: string;
|
|
3228
|
+
}) => Promise<boolean>;
|
|
3229
|
+
config: {
|
|
3230
|
+
minPasswordLength: number;
|
|
3231
|
+
maxPasswordLength: number;
|
|
3232
|
+
};
|
|
3233
|
+
checkPassword: (userId: string, ctx: import("better-auth").GenericEndpointContext<import("better-auth").BetterAuthOptions>) => Promise<boolean>;
|
|
3234
|
+
};
|
|
3235
|
+
tables: import("better-auth").BetterAuthDBSchema;
|
|
3236
|
+
runMigrations: () => Promise<void>;
|
|
3237
|
+
publishTelemetry: (event: {
|
|
3238
|
+
type: string;
|
|
3239
|
+
anonymousId?: string | undefined;
|
|
3240
|
+
payload: Record<string, any>;
|
|
3241
|
+
}) => Promise<void>;
|
|
3242
|
+
skipOriginCheck: boolean | string[];
|
|
3243
|
+
skipCSRFCheck: boolean;
|
|
3244
|
+
runInBackground: (promise: Promise<unknown>) => void;
|
|
3245
|
+
runInBackgroundOrAwait: (promise: Promise<unknown> | void) => import("better-auth").Awaitable<unknown>;
|
|
3246
|
+
}>;
|
|
3247
|
+
}>;
|
|
3248
|
+
}[];
|
|
3249
|
+
};
|
|
3250
|
+
endpoints: {
|
|
3251
|
+
createApiKey: import("better-call").StrictEndpoint<"/api-key/create", {
|
|
3252
|
+
method: "POST";
|
|
3253
|
+
body: import("zod").ZodObject<{
|
|
3254
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3255
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3256
|
+
expiresIn: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
|
|
3257
|
+
prefix: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3258
|
+
remaining: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
|
|
3259
|
+
metadata: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
3260
|
+
refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
3261
|
+
refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
3262
|
+
rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
3263
|
+
rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
3264
|
+
rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
3265
|
+
permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
|
|
3266
|
+
userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
|
|
3267
|
+
organizationId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
|
|
3268
|
+
}, import("zod/v4/core").$strip>;
|
|
3269
|
+
metadata: {
|
|
3270
|
+
openapi: {
|
|
3271
|
+
description: string;
|
|
3272
|
+
responses: {
|
|
3273
|
+
"200": {
|
|
3274
|
+
description: string;
|
|
3275
|
+
content: {
|
|
3276
|
+
"application/json": {
|
|
3277
|
+
schema: {
|
|
3278
|
+
type: "object";
|
|
3279
|
+
properties: {
|
|
3280
|
+
id: {
|
|
3281
|
+
type: string;
|
|
3282
|
+
description: string;
|
|
3283
|
+
};
|
|
3284
|
+
createdAt: {
|
|
3285
|
+
type: string;
|
|
3286
|
+
format: string;
|
|
3287
|
+
description: string;
|
|
3288
|
+
};
|
|
3289
|
+
updatedAt: {
|
|
3290
|
+
type: string;
|
|
3291
|
+
format: string;
|
|
3292
|
+
description: string;
|
|
3293
|
+
};
|
|
3294
|
+
name: {
|
|
3295
|
+
type: string;
|
|
3296
|
+
nullable: boolean;
|
|
3297
|
+
description: string;
|
|
3298
|
+
};
|
|
3299
|
+
prefix: {
|
|
3300
|
+
type: string;
|
|
3301
|
+
nullable: boolean;
|
|
3302
|
+
description: string;
|
|
3303
|
+
};
|
|
3304
|
+
start: {
|
|
3305
|
+
type: string;
|
|
3306
|
+
nullable: boolean;
|
|
3307
|
+
description: string;
|
|
3308
|
+
};
|
|
3309
|
+
key: {
|
|
3310
|
+
type: string;
|
|
3311
|
+
description: string;
|
|
3312
|
+
};
|
|
3313
|
+
enabled: {
|
|
3314
|
+
type: string;
|
|
3315
|
+
description: string;
|
|
3316
|
+
};
|
|
3317
|
+
expiresAt: {
|
|
3318
|
+
type: string;
|
|
3319
|
+
format: string;
|
|
3320
|
+
nullable: boolean;
|
|
3321
|
+
description: string;
|
|
3322
|
+
};
|
|
3323
|
+
referenceId: {
|
|
3324
|
+
type: string;
|
|
3325
|
+
description: string;
|
|
3326
|
+
};
|
|
3327
|
+
lastRefillAt: {
|
|
3328
|
+
type: string;
|
|
3329
|
+
format: string;
|
|
3330
|
+
nullable: boolean;
|
|
3331
|
+
description: string;
|
|
3332
|
+
};
|
|
3333
|
+
lastRequest: {
|
|
3334
|
+
type: string;
|
|
3335
|
+
format: string;
|
|
3336
|
+
nullable: boolean;
|
|
3337
|
+
description: string;
|
|
3338
|
+
};
|
|
3339
|
+
metadata: {
|
|
3340
|
+
type: string;
|
|
3341
|
+
nullable: boolean;
|
|
3342
|
+
additionalProperties: boolean;
|
|
3343
|
+
description: string;
|
|
3344
|
+
};
|
|
3345
|
+
rateLimitMax: {
|
|
3346
|
+
type: string;
|
|
3347
|
+
nullable: boolean;
|
|
3348
|
+
description: string;
|
|
3349
|
+
};
|
|
3350
|
+
rateLimitTimeWindow: {
|
|
3351
|
+
type: string;
|
|
3352
|
+
nullable: boolean;
|
|
3353
|
+
description: string;
|
|
3354
|
+
};
|
|
3355
|
+
remaining: {
|
|
3356
|
+
type: string;
|
|
3357
|
+
nullable: boolean;
|
|
3358
|
+
description: string;
|
|
3359
|
+
};
|
|
3360
|
+
refillAmount: {
|
|
3361
|
+
type: string;
|
|
3362
|
+
nullable: boolean;
|
|
3363
|
+
description: string;
|
|
3364
|
+
};
|
|
3365
|
+
refillInterval: {
|
|
3366
|
+
type: string;
|
|
3367
|
+
nullable: boolean;
|
|
3368
|
+
description: string;
|
|
3369
|
+
};
|
|
3370
|
+
rateLimitEnabled: {
|
|
3371
|
+
type: string;
|
|
3372
|
+
description: string;
|
|
3373
|
+
};
|
|
3374
|
+
requestCount: {
|
|
3375
|
+
type: string;
|
|
3376
|
+
description: string;
|
|
3377
|
+
};
|
|
3378
|
+
permissions: {
|
|
3379
|
+
type: string;
|
|
3380
|
+
nullable: boolean;
|
|
3381
|
+
additionalProperties: {
|
|
3382
|
+
type: string;
|
|
3383
|
+
items: {
|
|
3384
|
+
type: string;
|
|
3385
|
+
};
|
|
3386
|
+
};
|
|
3387
|
+
description: string;
|
|
3388
|
+
};
|
|
3389
|
+
};
|
|
3390
|
+
required: string[];
|
|
3391
|
+
};
|
|
3392
|
+
};
|
|
3393
|
+
};
|
|
3394
|
+
};
|
|
3395
|
+
};
|
|
3396
|
+
};
|
|
3397
|
+
};
|
|
3398
|
+
}, {
|
|
3399
|
+
key: string;
|
|
3400
|
+
metadata: any;
|
|
3401
|
+
permissions: any;
|
|
3402
|
+
id: string;
|
|
3403
|
+
configId: string;
|
|
3404
|
+
name: string | null;
|
|
3405
|
+
start: string | null;
|
|
3406
|
+
prefix: string | null;
|
|
3407
|
+
referenceId: string;
|
|
3408
|
+
refillInterval: number | null;
|
|
3409
|
+
refillAmount: number | null;
|
|
3410
|
+
lastRefillAt: Date | null;
|
|
3411
|
+
enabled: boolean;
|
|
3412
|
+
rateLimitEnabled: boolean;
|
|
3413
|
+
rateLimitTimeWindow: number | null;
|
|
3414
|
+
rateLimitMax: number | null;
|
|
3415
|
+
requestCount: number;
|
|
3416
|
+
remaining: number | null;
|
|
3417
|
+
lastRequest: Date | null;
|
|
3418
|
+
expiresAt: Date | null;
|
|
3419
|
+
createdAt: Date;
|
|
3420
|
+
updatedAt: Date;
|
|
3421
|
+
}>;
|
|
3422
|
+
verifyApiKey: import("better-call").StrictEndpoint<string, {
|
|
3423
|
+
method: "POST";
|
|
3424
|
+
body: import("zod").ZodObject<{
|
|
3425
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3426
|
+
key: import("zod").ZodString;
|
|
3427
|
+
permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
|
|
3428
|
+
}, import("zod/v4/core").$strip>;
|
|
3429
|
+
}, {
|
|
3430
|
+
valid: boolean;
|
|
3431
|
+
error: {
|
|
3432
|
+
message: import("better-auth").RawError<"INVALID_API_KEY">;
|
|
3433
|
+
code: "KEY_NOT_FOUND";
|
|
3434
|
+
};
|
|
3435
|
+
key: null;
|
|
3436
|
+
} | {
|
|
3437
|
+
valid: boolean;
|
|
3438
|
+
error: {
|
|
3439
|
+
message: string | undefined;
|
|
3440
|
+
code: string;
|
|
3441
|
+
cause?: unknown;
|
|
3442
|
+
};
|
|
3443
|
+
key: null;
|
|
3444
|
+
} | {
|
|
3445
|
+
valid: boolean;
|
|
3446
|
+
error: {
|
|
3447
|
+
message: import("better-auth").RawError<"INVALID_API_KEY">;
|
|
3448
|
+
code: "INVALID_API_KEY";
|
|
3449
|
+
};
|
|
3450
|
+
key: null;
|
|
3451
|
+
} | {
|
|
3452
|
+
valid: boolean;
|
|
3453
|
+
error: null;
|
|
3454
|
+
key: Omit<import("@better-auth/api-key/client").ApiKey, "key"> | null;
|
|
3455
|
+
}>;
|
|
3456
|
+
getApiKey: import("better-call").StrictEndpoint<"/api-key/get", {
|
|
3457
|
+
method: "GET";
|
|
3458
|
+
query: import("zod").ZodObject<{
|
|
3459
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3460
|
+
id: import("zod").ZodString;
|
|
3461
|
+
}, import("zod/v4/core").$strip>;
|
|
3462
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
3463
|
+
session: {
|
|
3464
|
+
session: Record<string, any> & {
|
|
3465
|
+
id: string;
|
|
3466
|
+
createdAt: Date;
|
|
3467
|
+
updatedAt: Date;
|
|
3468
|
+
userId: string;
|
|
3469
|
+
expiresAt: Date;
|
|
3470
|
+
token: string;
|
|
3471
|
+
ipAddress?: string | null | undefined;
|
|
3472
|
+
userAgent?: string | null | undefined;
|
|
3473
|
+
};
|
|
3474
|
+
user: Record<string, any> & {
|
|
3475
|
+
id: string;
|
|
3476
|
+
createdAt: Date;
|
|
3477
|
+
updatedAt: Date;
|
|
3478
|
+
email: string;
|
|
3479
|
+
emailVerified: boolean;
|
|
3480
|
+
name: string;
|
|
3481
|
+
image?: string | null | undefined;
|
|
3482
|
+
};
|
|
3483
|
+
};
|
|
3484
|
+
}>)[];
|
|
3485
|
+
metadata: {
|
|
3486
|
+
openapi: {
|
|
3487
|
+
description: string;
|
|
3488
|
+
responses: {
|
|
3489
|
+
"200": {
|
|
3490
|
+
description: string;
|
|
3491
|
+
content: {
|
|
3492
|
+
"application/json": {
|
|
3493
|
+
schema: {
|
|
3494
|
+
type: "object";
|
|
3495
|
+
properties: {
|
|
3496
|
+
id: {
|
|
3497
|
+
type: string;
|
|
3498
|
+
description: string;
|
|
3499
|
+
};
|
|
3500
|
+
name: {
|
|
3501
|
+
type: string;
|
|
3502
|
+
nullable: boolean;
|
|
3503
|
+
description: string;
|
|
3504
|
+
};
|
|
3505
|
+
start: {
|
|
3506
|
+
type: string;
|
|
3507
|
+
nullable: boolean;
|
|
3508
|
+
description: string;
|
|
3509
|
+
};
|
|
3510
|
+
prefix: {
|
|
3511
|
+
type: string;
|
|
3512
|
+
nullable: boolean;
|
|
3513
|
+
description: string;
|
|
3514
|
+
};
|
|
3515
|
+
userId: {
|
|
3516
|
+
type: string;
|
|
3517
|
+
description: string;
|
|
3518
|
+
};
|
|
3519
|
+
refillInterval: {
|
|
3520
|
+
type: string;
|
|
3521
|
+
nullable: boolean;
|
|
3522
|
+
description: string;
|
|
3523
|
+
};
|
|
3524
|
+
refillAmount: {
|
|
3525
|
+
type: string;
|
|
3526
|
+
nullable: boolean;
|
|
3527
|
+
description: string;
|
|
3528
|
+
};
|
|
3529
|
+
lastRefillAt: {
|
|
3530
|
+
type: string;
|
|
3531
|
+
format: string;
|
|
3532
|
+
nullable: boolean;
|
|
3533
|
+
description: string;
|
|
3534
|
+
};
|
|
3535
|
+
enabled: {
|
|
3536
|
+
type: string;
|
|
3537
|
+
description: string;
|
|
3538
|
+
default: boolean;
|
|
3539
|
+
};
|
|
3540
|
+
rateLimitEnabled: {
|
|
3541
|
+
type: string;
|
|
3542
|
+
description: string;
|
|
3543
|
+
};
|
|
3544
|
+
rateLimitTimeWindow: {
|
|
3545
|
+
type: string;
|
|
3546
|
+
nullable: boolean;
|
|
3547
|
+
description: string;
|
|
3548
|
+
};
|
|
3549
|
+
rateLimitMax: {
|
|
3550
|
+
type: string;
|
|
3551
|
+
nullable: boolean;
|
|
3552
|
+
description: string;
|
|
3553
|
+
};
|
|
3554
|
+
requestCount: {
|
|
3555
|
+
type: string;
|
|
3556
|
+
description: string;
|
|
3557
|
+
};
|
|
3558
|
+
remaining: {
|
|
3559
|
+
type: string;
|
|
3560
|
+
nullable: boolean;
|
|
3561
|
+
description: string;
|
|
3562
|
+
};
|
|
3563
|
+
lastRequest: {
|
|
3564
|
+
type: string;
|
|
3565
|
+
format: string;
|
|
3566
|
+
nullable: boolean;
|
|
3567
|
+
description: string;
|
|
3568
|
+
};
|
|
3569
|
+
expiresAt: {
|
|
3570
|
+
type: string;
|
|
3571
|
+
format: string;
|
|
3572
|
+
nullable: boolean;
|
|
3573
|
+
description: string;
|
|
3574
|
+
};
|
|
3575
|
+
createdAt: {
|
|
3576
|
+
type: string;
|
|
3577
|
+
format: string;
|
|
3578
|
+
description: string;
|
|
3579
|
+
};
|
|
3580
|
+
updatedAt: {
|
|
3581
|
+
type: string;
|
|
3582
|
+
format: string;
|
|
3583
|
+
description: string;
|
|
3584
|
+
};
|
|
3585
|
+
metadata: {
|
|
3586
|
+
type: string;
|
|
3587
|
+
nullable: boolean;
|
|
3588
|
+
additionalProperties: boolean;
|
|
3589
|
+
description: string;
|
|
3590
|
+
};
|
|
3591
|
+
permissions: {
|
|
3592
|
+
type: string;
|
|
3593
|
+
nullable: boolean;
|
|
3594
|
+
description: string;
|
|
3595
|
+
};
|
|
3596
|
+
};
|
|
3597
|
+
required: string[];
|
|
3598
|
+
};
|
|
3599
|
+
};
|
|
3600
|
+
};
|
|
3601
|
+
};
|
|
3602
|
+
};
|
|
3603
|
+
};
|
|
3604
|
+
};
|
|
3605
|
+
}, {
|
|
3606
|
+
metadata: Record<string, any> | null;
|
|
3607
|
+
permissions: {
|
|
3608
|
+
[key: string]: string[];
|
|
3609
|
+
} | null;
|
|
3610
|
+
id: string;
|
|
3611
|
+
configId: string;
|
|
3612
|
+
name: string | null;
|
|
3613
|
+
start: string | null;
|
|
3614
|
+
prefix: string | null;
|
|
3615
|
+
referenceId: string;
|
|
3616
|
+
refillInterval: number | null;
|
|
3617
|
+
refillAmount: number | null;
|
|
3618
|
+
lastRefillAt: Date | null;
|
|
3619
|
+
enabled: boolean;
|
|
3620
|
+
rateLimitEnabled: boolean;
|
|
3621
|
+
rateLimitTimeWindow: number | null;
|
|
3622
|
+
rateLimitMax: number | null;
|
|
3623
|
+
requestCount: number;
|
|
3624
|
+
remaining: number | null;
|
|
3625
|
+
lastRequest: Date | null;
|
|
3626
|
+
expiresAt: Date | null;
|
|
3627
|
+
createdAt: Date;
|
|
3628
|
+
updatedAt: Date;
|
|
3629
|
+
}>;
|
|
3630
|
+
updateApiKey: import("better-call").StrictEndpoint<"/api-key/update", {
|
|
3631
|
+
method: "POST";
|
|
3632
|
+
body: import("zod").ZodObject<{
|
|
3633
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3634
|
+
keyId: import("zod").ZodString;
|
|
3635
|
+
userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
|
|
3636
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3637
|
+
enabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
3638
|
+
remaining: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
3639
|
+
refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
3640
|
+
refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
3641
|
+
metadata: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
3642
|
+
expiresIn: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>;
|
|
3643
|
+
rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
3644
|
+
rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
3645
|
+
rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
|
|
3646
|
+
permissions: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>>;
|
|
3647
|
+
}, import("zod/v4/core").$strip>;
|
|
3648
|
+
metadata: {
|
|
3649
|
+
openapi: {
|
|
3650
|
+
description: string;
|
|
3651
|
+
responses: {
|
|
3652
|
+
"200": {
|
|
3653
|
+
description: string;
|
|
3654
|
+
content: {
|
|
3655
|
+
"application/json": {
|
|
3656
|
+
schema: {
|
|
3657
|
+
type: "object";
|
|
3658
|
+
properties: {
|
|
3659
|
+
id: {
|
|
3660
|
+
type: string;
|
|
3661
|
+
description: string;
|
|
3662
|
+
};
|
|
3663
|
+
name: {
|
|
3664
|
+
type: string;
|
|
3665
|
+
nullable: boolean;
|
|
3666
|
+
description: string;
|
|
3667
|
+
};
|
|
3668
|
+
start: {
|
|
3669
|
+
type: string;
|
|
3670
|
+
nullable: boolean;
|
|
3671
|
+
description: string;
|
|
3672
|
+
};
|
|
3673
|
+
prefix: {
|
|
3674
|
+
type: string;
|
|
3675
|
+
nullable: boolean;
|
|
3676
|
+
description: string;
|
|
3677
|
+
};
|
|
3678
|
+
userId: {
|
|
3679
|
+
type: string;
|
|
3680
|
+
description: string;
|
|
3681
|
+
};
|
|
3682
|
+
refillInterval: {
|
|
3683
|
+
type: string;
|
|
3684
|
+
nullable: boolean;
|
|
3685
|
+
description: string;
|
|
3686
|
+
};
|
|
3687
|
+
refillAmount: {
|
|
3688
|
+
type: string;
|
|
3689
|
+
nullable: boolean;
|
|
3690
|
+
description: string;
|
|
3691
|
+
};
|
|
3692
|
+
lastRefillAt: {
|
|
3693
|
+
type: string;
|
|
3694
|
+
format: string;
|
|
3695
|
+
nullable: boolean;
|
|
3696
|
+
description: string;
|
|
3697
|
+
};
|
|
3698
|
+
enabled: {
|
|
3699
|
+
type: string;
|
|
3700
|
+
description: string;
|
|
3701
|
+
default: boolean;
|
|
3702
|
+
};
|
|
3703
|
+
rateLimitEnabled: {
|
|
3704
|
+
type: string;
|
|
3705
|
+
description: string;
|
|
3706
|
+
};
|
|
3707
|
+
rateLimitTimeWindow: {
|
|
3708
|
+
type: string;
|
|
3709
|
+
nullable: boolean;
|
|
3710
|
+
description: string;
|
|
3711
|
+
};
|
|
3712
|
+
rateLimitMax: {
|
|
3713
|
+
type: string;
|
|
3714
|
+
nullable: boolean;
|
|
3715
|
+
description: string;
|
|
3716
|
+
};
|
|
3717
|
+
requestCount: {
|
|
3718
|
+
type: string;
|
|
3719
|
+
description: string;
|
|
3720
|
+
};
|
|
3721
|
+
remaining: {
|
|
3722
|
+
type: string;
|
|
3723
|
+
nullable: boolean;
|
|
3724
|
+
description: string;
|
|
3725
|
+
};
|
|
3726
|
+
lastRequest: {
|
|
3727
|
+
type: string;
|
|
3728
|
+
format: string;
|
|
3729
|
+
nullable: boolean;
|
|
3730
|
+
description: string;
|
|
3731
|
+
};
|
|
3732
|
+
expiresAt: {
|
|
3733
|
+
type: string;
|
|
3734
|
+
format: string;
|
|
3735
|
+
nullable: boolean;
|
|
3736
|
+
description: string;
|
|
3737
|
+
};
|
|
3738
|
+
createdAt: {
|
|
3739
|
+
type: string;
|
|
3740
|
+
format: string;
|
|
3741
|
+
description: string;
|
|
3742
|
+
};
|
|
3743
|
+
updatedAt: {
|
|
3744
|
+
type: string;
|
|
3745
|
+
format: string;
|
|
3746
|
+
description: string;
|
|
3747
|
+
};
|
|
3748
|
+
metadata: {
|
|
3749
|
+
type: string;
|
|
3750
|
+
nullable: boolean;
|
|
3751
|
+
additionalProperties: boolean;
|
|
3752
|
+
description: string;
|
|
3753
|
+
};
|
|
3754
|
+
permissions: {
|
|
3755
|
+
type: string;
|
|
3756
|
+
nullable: boolean;
|
|
3757
|
+
description: string;
|
|
3758
|
+
};
|
|
3759
|
+
};
|
|
3760
|
+
required: string[];
|
|
3761
|
+
};
|
|
3762
|
+
};
|
|
3763
|
+
};
|
|
3764
|
+
};
|
|
3765
|
+
};
|
|
3766
|
+
};
|
|
3767
|
+
};
|
|
3768
|
+
}, {
|
|
3769
|
+
metadata: Record<string, any> | null;
|
|
3770
|
+
permissions: {
|
|
3771
|
+
[key: string]: string[];
|
|
3772
|
+
} | null;
|
|
3773
|
+
id: string;
|
|
3774
|
+
configId: string;
|
|
3775
|
+
name: string | null;
|
|
3776
|
+
start: string | null;
|
|
3777
|
+
prefix: string | null;
|
|
3778
|
+
referenceId: string;
|
|
3779
|
+
refillInterval: number | null;
|
|
3780
|
+
refillAmount: number | null;
|
|
3781
|
+
lastRefillAt: Date | null;
|
|
3782
|
+
enabled: boolean;
|
|
3783
|
+
rateLimitEnabled: boolean;
|
|
3784
|
+
rateLimitTimeWindow: number | null;
|
|
3785
|
+
rateLimitMax: number | null;
|
|
3786
|
+
requestCount: number;
|
|
3787
|
+
remaining: number | null;
|
|
3788
|
+
lastRequest: Date | null;
|
|
3789
|
+
expiresAt: Date | null;
|
|
3790
|
+
createdAt: Date;
|
|
3791
|
+
updatedAt: Date;
|
|
3792
|
+
}>;
|
|
3793
|
+
deleteApiKey: import("better-call").StrictEndpoint<"/api-key/delete", {
|
|
3794
|
+
method: "POST";
|
|
3795
|
+
body: import("zod").ZodObject<{
|
|
3796
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3797
|
+
keyId: import("zod").ZodString;
|
|
3798
|
+
}, import("zod/v4/core").$strip>;
|
|
3799
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
3800
|
+
session: {
|
|
3801
|
+
session: Record<string, any> & {
|
|
3802
|
+
id: string;
|
|
3803
|
+
createdAt: Date;
|
|
3804
|
+
updatedAt: Date;
|
|
3805
|
+
userId: string;
|
|
3806
|
+
expiresAt: Date;
|
|
3807
|
+
token: string;
|
|
3808
|
+
ipAddress?: string | null | undefined;
|
|
3809
|
+
userAgent?: string | null | undefined;
|
|
3810
|
+
};
|
|
3811
|
+
user: Record<string, any> & {
|
|
3812
|
+
id: string;
|
|
3813
|
+
createdAt: Date;
|
|
3814
|
+
updatedAt: Date;
|
|
3815
|
+
email: string;
|
|
3816
|
+
emailVerified: boolean;
|
|
3817
|
+
name: string;
|
|
3818
|
+
image?: string | null | undefined;
|
|
3819
|
+
};
|
|
3820
|
+
};
|
|
3821
|
+
}>)[];
|
|
3822
|
+
metadata: {
|
|
3823
|
+
openapi: {
|
|
3824
|
+
description: string;
|
|
3825
|
+
requestBody: {
|
|
3826
|
+
content: {
|
|
3827
|
+
"application/json": {
|
|
3828
|
+
schema: {
|
|
3829
|
+
type: "object";
|
|
3830
|
+
properties: {
|
|
3831
|
+
keyId: {
|
|
3832
|
+
type: string;
|
|
3833
|
+
description: string;
|
|
3834
|
+
};
|
|
3835
|
+
};
|
|
3836
|
+
required: string[];
|
|
3837
|
+
};
|
|
3838
|
+
};
|
|
3839
|
+
};
|
|
3840
|
+
};
|
|
3841
|
+
responses: {
|
|
3842
|
+
"200": {
|
|
3843
|
+
description: string;
|
|
3844
|
+
content: {
|
|
3845
|
+
"application/json": {
|
|
3846
|
+
schema: {
|
|
3847
|
+
type: "object";
|
|
3848
|
+
properties: {
|
|
3849
|
+
success: {
|
|
3850
|
+
type: string;
|
|
3851
|
+
description: string;
|
|
3852
|
+
};
|
|
3853
|
+
};
|
|
3854
|
+
required: string[];
|
|
3855
|
+
};
|
|
3856
|
+
};
|
|
3857
|
+
};
|
|
3858
|
+
};
|
|
3859
|
+
};
|
|
3860
|
+
};
|
|
3861
|
+
};
|
|
3862
|
+
}, {
|
|
3863
|
+
success: boolean;
|
|
3864
|
+
}>;
|
|
3865
|
+
listApiKeys: import("better-call").StrictEndpoint<"/api-key/list", {
|
|
3866
|
+
method: "GET";
|
|
3867
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
3868
|
+
session: {
|
|
3869
|
+
session: Record<string, any> & {
|
|
3870
|
+
id: string;
|
|
3871
|
+
createdAt: Date;
|
|
3872
|
+
updatedAt: Date;
|
|
3873
|
+
userId: string;
|
|
3874
|
+
expiresAt: Date;
|
|
3875
|
+
token: string;
|
|
3876
|
+
ipAddress?: string | null | undefined;
|
|
3877
|
+
userAgent?: string | null | undefined;
|
|
3878
|
+
};
|
|
3879
|
+
user: Record<string, any> & {
|
|
3880
|
+
id: string;
|
|
3881
|
+
createdAt: Date;
|
|
3882
|
+
updatedAt: Date;
|
|
3883
|
+
email: string;
|
|
3884
|
+
emailVerified: boolean;
|
|
3885
|
+
name: string;
|
|
3886
|
+
image?: string | null | undefined;
|
|
3887
|
+
};
|
|
3888
|
+
};
|
|
3889
|
+
}>)[];
|
|
3890
|
+
query: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
3891
|
+
configId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3892
|
+
organizationId: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3893
|
+
limit: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
|
|
3894
|
+
offset: import("zod").ZodOptional<import("zod").ZodCoercedNumber<unknown>>;
|
|
3895
|
+
sortBy: import("zod").ZodOptional<import("zod").ZodString>;
|
|
3896
|
+
sortDirection: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
3897
|
+
asc: "asc";
|
|
3898
|
+
desc: "desc";
|
|
3899
|
+
}>>;
|
|
3900
|
+
}, import("zod/v4/core").$strip>>;
|
|
3901
|
+
metadata: {
|
|
3902
|
+
openapi: {
|
|
3903
|
+
description: string;
|
|
3904
|
+
responses: {
|
|
3905
|
+
"200": {
|
|
3906
|
+
description: string;
|
|
3907
|
+
content: {
|
|
3908
|
+
"application/json": {
|
|
3909
|
+
schema: {
|
|
3910
|
+
type: "object";
|
|
3911
|
+
properties: {
|
|
3912
|
+
apiKeys: {
|
|
3913
|
+
type: string;
|
|
3914
|
+
items: {
|
|
3915
|
+
type: string;
|
|
3916
|
+
properties: {
|
|
3917
|
+
id: {
|
|
3918
|
+
type: string;
|
|
3919
|
+
description: string;
|
|
3920
|
+
};
|
|
3921
|
+
name: {
|
|
3922
|
+
type: string;
|
|
3923
|
+
nullable: boolean;
|
|
3924
|
+
description: string;
|
|
3925
|
+
};
|
|
3926
|
+
start: {
|
|
3927
|
+
type: string;
|
|
3928
|
+
nullable: boolean;
|
|
3929
|
+
description: string;
|
|
3930
|
+
};
|
|
3931
|
+
prefix: {
|
|
3932
|
+
type: string;
|
|
3933
|
+
nullable: boolean;
|
|
3934
|
+
description: string;
|
|
3935
|
+
};
|
|
3936
|
+
userId: {
|
|
3937
|
+
type: string;
|
|
3938
|
+
description: string;
|
|
3939
|
+
};
|
|
3940
|
+
refillInterval: {
|
|
3941
|
+
type: string;
|
|
3942
|
+
nullable: boolean;
|
|
3943
|
+
description: string;
|
|
3944
|
+
};
|
|
3945
|
+
refillAmount: {
|
|
3946
|
+
type: string;
|
|
3947
|
+
nullable: boolean;
|
|
3948
|
+
description: string;
|
|
3949
|
+
};
|
|
3950
|
+
lastRefillAt: {
|
|
3951
|
+
type: string;
|
|
3952
|
+
format: string;
|
|
3953
|
+
nullable: boolean;
|
|
3954
|
+
description: string;
|
|
3955
|
+
};
|
|
3956
|
+
enabled: {
|
|
3957
|
+
type: string;
|
|
3958
|
+
description: string;
|
|
3959
|
+
default: boolean;
|
|
3960
|
+
};
|
|
3961
|
+
rateLimitEnabled: {
|
|
3962
|
+
type: string;
|
|
3963
|
+
description: string;
|
|
3964
|
+
};
|
|
3965
|
+
rateLimitTimeWindow: {
|
|
3966
|
+
type: string;
|
|
3967
|
+
nullable: boolean;
|
|
3968
|
+
description: string;
|
|
3969
|
+
};
|
|
3970
|
+
rateLimitMax: {
|
|
3971
|
+
type: string;
|
|
3972
|
+
nullable: boolean;
|
|
3973
|
+
description: string;
|
|
3974
|
+
};
|
|
3975
|
+
requestCount: {
|
|
3976
|
+
type: string;
|
|
3977
|
+
description: string;
|
|
3978
|
+
};
|
|
3979
|
+
remaining: {
|
|
3980
|
+
type: string;
|
|
3981
|
+
nullable: boolean;
|
|
3982
|
+
description: string;
|
|
3983
|
+
};
|
|
3984
|
+
lastRequest: {
|
|
3985
|
+
type: string;
|
|
3986
|
+
format: string;
|
|
3987
|
+
nullable: boolean;
|
|
3988
|
+
description: string;
|
|
3989
|
+
};
|
|
3990
|
+
expiresAt: {
|
|
3991
|
+
type: string;
|
|
3992
|
+
format: string;
|
|
3993
|
+
nullable: boolean;
|
|
3994
|
+
description: string;
|
|
3995
|
+
};
|
|
3996
|
+
createdAt: {
|
|
3997
|
+
type: string;
|
|
3998
|
+
format: string;
|
|
3999
|
+
description: string;
|
|
4000
|
+
};
|
|
4001
|
+
updatedAt: {
|
|
4002
|
+
type: string;
|
|
4003
|
+
format: string;
|
|
4004
|
+
description: string;
|
|
4005
|
+
};
|
|
4006
|
+
metadata: {
|
|
4007
|
+
type: string;
|
|
4008
|
+
nullable: boolean;
|
|
4009
|
+
additionalProperties: boolean;
|
|
4010
|
+
description: string;
|
|
4011
|
+
};
|
|
4012
|
+
permissions: {
|
|
4013
|
+
type: string;
|
|
4014
|
+
nullable: boolean;
|
|
4015
|
+
description: string;
|
|
4016
|
+
};
|
|
4017
|
+
};
|
|
4018
|
+
required: string[];
|
|
4019
|
+
};
|
|
4020
|
+
};
|
|
4021
|
+
total: {
|
|
4022
|
+
type: string;
|
|
4023
|
+
description: string;
|
|
4024
|
+
};
|
|
4025
|
+
limit: {
|
|
4026
|
+
type: string;
|
|
4027
|
+
nullable: boolean;
|
|
4028
|
+
description: string;
|
|
4029
|
+
};
|
|
4030
|
+
offset: {
|
|
4031
|
+
type: string;
|
|
4032
|
+
nullable: boolean;
|
|
4033
|
+
description: string;
|
|
4034
|
+
};
|
|
4035
|
+
};
|
|
4036
|
+
required: string[];
|
|
4037
|
+
};
|
|
4038
|
+
};
|
|
4039
|
+
};
|
|
4040
|
+
};
|
|
4041
|
+
};
|
|
4042
|
+
};
|
|
4043
|
+
};
|
|
4044
|
+
}, {
|
|
4045
|
+
apiKeys: {
|
|
4046
|
+
metadata: Record<string, any> | null;
|
|
4047
|
+
permissions: {
|
|
4048
|
+
[key: string]: string[];
|
|
4049
|
+
} | null;
|
|
4050
|
+
id: string;
|
|
4051
|
+
configId: string;
|
|
4052
|
+
name: string | null;
|
|
4053
|
+
start: string | null;
|
|
4054
|
+
prefix: string | null;
|
|
4055
|
+
referenceId: string;
|
|
4056
|
+
refillInterval: number | null;
|
|
4057
|
+
refillAmount: number | null;
|
|
4058
|
+
lastRefillAt: Date | null;
|
|
4059
|
+
enabled: boolean;
|
|
4060
|
+
rateLimitEnabled: boolean;
|
|
4061
|
+
rateLimitTimeWindow: number | null;
|
|
4062
|
+
rateLimitMax: number | null;
|
|
4063
|
+
requestCount: number;
|
|
4064
|
+
remaining: number | null;
|
|
4065
|
+
lastRequest: Date | null;
|
|
4066
|
+
expiresAt: Date | null;
|
|
4067
|
+
createdAt: Date;
|
|
4068
|
+
updatedAt: Date;
|
|
4069
|
+
}[];
|
|
4070
|
+
total: number;
|
|
4071
|
+
limit: number | undefined;
|
|
4072
|
+
offset: number | undefined;
|
|
4073
|
+
}>;
|
|
4074
|
+
deleteAllExpiredApiKeys: import("better-call").StrictEndpoint<string, {
|
|
4075
|
+
method: "POST";
|
|
4076
|
+
}, {
|
|
4077
|
+
success: boolean;
|
|
4078
|
+
error: unknown;
|
|
4079
|
+
}>;
|
|
4080
|
+
};
|
|
4081
|
+
schema: {
|
|
4082
|
+
apikey: {
|
|
4083
|
+
fields: {
|
|
4084
|
+
configId: {
|
|
4085
|
+
type: "string";
|
|
4086
|
+
required: true;
|
|
4087
|
+
defaultValue: string;
|
|
4088
|
+
input: false;
|
|
4089
|
+
index: true;
|
|
4090
|
+
};
|
|
4091
|
+
name: {
|
|
4092
|
+
type: "string";
|
|
4093
|
+
required: false;
|
|
4094
|
+
input: false;
|
|
4095
|
+
};
|
|
4096
|
+
start: {
|
|
4097
|
+
type: "string";
|
|
4098
|
+
required: false;
|
|
4099
|
+
input: false;
|
|
4100
|
+
};
|
|
4101
|
+
referenceId: {
|
|
4102
|
+
type: "string";
|
|
4103
|
+
required: true;
|
|
4104
|
+
input: false;
|
|
4105
|
+
index: true;
|
|
4106
|
+
};
|
|
4107
|
+
prefix: {
|
|
4108
|
+
type: "string";
|
|
4109
|
+
required: false;
|
|
4110
|
+
input: false;
|
|
4111
|
+
};
|
|
4112
|
+
key: {
|
|
4113
|
+
type: "string";
|
|
4114
|
+
required: true;
|
|
4115
|
+
input: false;
|
|
4116
|
+
index: true;
|
|
4117
|
+
};
|
|
4118
|
+
refillInterval: {
|
|
4119
|
+
type: "number";
|
|
4120
|
+
required: false;
|
|
4121
|
+
input: false;
|
|
4122
|
+
};
|
|
4123
|
+
refillAmount: {
|
|
4124
|
+
type: "number";
|
|
4125
|
+
required: false;
|
|
4126
|
+
input: false;
|
|
4127
|
+
};
|
|
4128
|
+
lastRefillAt: {
|
|
4129
|
+
type: "date";
|
|
4130
|
+
required: false;
|
|
4131
|
+
input: false;
|
|
4132
|
+
};
|
|
4133
|
+
enabled: {
|
|
4134
|
+
type: "boolean";
|
|
4135
|
+
required: false;
|
|
4136
|
+
input: false;
|
|
4137
|
+
defaultValue: true;
|
|
4138
|
+
};
|
|
4139
|
+
rateLimitEnabled: {
|
|
4140
|
+
type: "boolean";
|
|
4141
|
+
required: false;
|
|
4142
|
+
input: false;
|
|
4143
|
+
defaultValue: true;
|
|
4144
|
+
};
|
|
4145
|
+
rateLimitTimeWindow: {
|
|
4146
|
+
type: "number";
|
|
4147
|
+
required: false;
|
|
4148
|
+
input: false;
|
|
4149
|
+
defaultValue: number;
|
|
4150
|
+
};
|
|
4151
|
+
rateLimitMax: {
|
|
4152
|
+
type: "number";
|
|
4153
|
+
required: false;
|
|
4154
|
+
input: false;
|
|
4155
|
+
defaultValue: number;
|
|
4156
|
+
};
|
|
4157
|
+
requestCount: {
|
|
4158
|
+
type: "number";
|
|
4159
|
+
required: false;
|
|
4160
|
+
input: false;
|
|
4161
|
+
defaultValue: number;
|
|
4162
|
+
};
|
|
4163
|
+
remaining: {
|
|
4164
|
+
type: "number";
|
|
4165
|
+
required: false;
|
|
4166
|
+
input: false;
|
|
4167
|
+
};
|
|
4168
|
+
lastRequest: {
|
|
4169
|
+
type: "date";
|
|
4170
|
+
required: false;
|
|
4171
|
+
input: false;
|
|
4172
|
+
};
|
|
4173
|
+
expiresAt: {
|
|
4174
|
+
type: "date";
|
|
4175
|
+
required: false;
|
|
4176
|
+
input: false;
|
|
4177
|
+
};
|
|
4178
|
+
createdAt: {
|
|
4179
|
+
type: "date";
|
|
4180
|
+
required: true;
|
|
4181
|
+
input: false;
|
|
4182
|
+
};
|
|
4183
|
+
updatedAt: {
|
|
4184
|
+
type: "date";
|
|
4185
|
+
required: true;
|
|
4186
|
+
input: false;
|
|
4187
|
+
};
|
|
4188
|
+
permissions: {
|
|
4189
|
+
type: "string";
|
|
4190
|
+
required: false;
|
|
4191
|
+
input: false;
|
|
4192
|
+
};
|
|
4193
|
+
metadata: {
|
|
4194
|
+
type: "string";
|
|
4195
|
+
required: false;
|
|
4196
|
+
input: true;
|
|
4197
|
+
transform: {
|
|
4198
|
+
input(value: import("better-auth").DBPrimitive): string;
|
|
4199
|
+
output(value: import("better-auth").DBPrimitive): any;
|
|
4200
|
+
};
|
|
4201
|
+
};
|
|
4202
|
+
};
|
|
4203
|
+
};
|
|
4204
|
+
};
|
|
4205
|
+
};
|
|
4206
|
+
pathMethods: {
|
|
4207
|
+
"/api-key/create": "POST";
|
|
4208
|
+
"/api-key/delete": "POST";
|
|
4209
|
+
"/api-key/delete-all-expired-api-keys": "POST";
|
|
4210
|
+
};
|
|
4211
|
+
$ERROR_CODES: {
|
|
4212
|
+
INVALID_METADATA_TYPE: import("better-auth").RawError<"INVALID_METADATA_TYPE">;
|
|
4213
|
+
REFILL_AMOUNT_AND_INTERVAL_REQUIRED: import("better-auth").RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
|
|
4214
|
+
REFILL_INTERVAL_AND_AMOUNT_REQUIRED: import("better-auth").RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
|
|
4215
|
+
USER_BANNED: import("better-auth").RawError<"USER_BANNED">;
|
|
4216
|
+
UNAUTHORIZED_SESSION: import("better-auth").RawError<"UNAUTHORIZED_SESSION">;
|
|
4217
|
+
KEY_NOT_FOUND: import("better-auth").RawError<"KEY_NOT_FOUND">;
|
|
4218
|
+
KEY_DISABLED: import("better-auth").RawError<"KEY_DISABLED">;
|
|
4219
|
+
KEY_EXPIRED: import("better-auth").RawError<"KEY_EXPIRED">;
|
|
4220
|
+
USAGE_EXCEEDED: import("better-auth").RawError<"USAGE_EXCEEDED">;
|
|
4221
|
+
KEY_NOT_RECOVERABLE: import("better-auth").RawError<"KEY_NOT_RECOVERABLE">;
|
|
4222
|
+
EXPIRES_IN_IS_TOO_SMALL: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_SMALL">;
|
|
4223
|
+
EXPIRES_IN_IS_TOO_LARGE: import("better-auth").RawError<"EXPIRES_IN_IS_TOO_LARGE">;
|
|
4224
|
+
INVALID_REMAINING: import("better-auth").RawError<"INVALID_REMAINING">;
|
|
4225
|
+
INVALID_PREFIX_LENGTH: import("better-auth").RawError<"INVALID_PREFIX_LENGTH">;
|
|
4226
|
+
INVALID_NAME_LENGTH: import("better-auth").RawError<"INVALID_NAME_LENGTH">;
|
|
4227
|
+
METADATA_DISABLED: import("better-auth").RawError<"METADATA_DISABLED">;
|
|
4228
|
+
RATE_LIMIT_EXCEEDED: import("better-auth").RawError<"RATE_LIMIT_EXCEEDED">;
|
|
4229
|
+
NO_VALUES_TO_UPDATE: import("better-auth").RawError<"NO_VALUES_TO_UPDATE">;
|
|
4230
|
+
KEY_DISABLED_EXPIRATION: import("better-auth").RawError<"KEY_DISABLED_EXPIRATION">;
|
|
4231
|
+
INVALID_API_KEY: import("better-auth").RawError<"INVALID_API_KEY">;
|
|
4232
|
+
INVALID_USER_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_USER_ID_FROM_API_KEY">;
|
|
4233
|
+
INVALID_REFERENCE_ID_FROM_API_KEY: import("better-auth").RawError<"INVALID_REFERENCE_ID_FROM_API_KEY">;
|
|
4234
|
+
INVALID_API_KEY_GETTER_RETURN_TYPE: import("better-auth").RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
|
|
4235
|
+
SERVER_ONLY_PROPERTY: import("better-auth").RawError<"SERVER_ONLY_PROPERTY">;
|
|
4236
|
+
FAILED_TO_UPDATE_API_KEY: import("better-auth").RawError<"FAILED_TO_UPDATE_API_KEY">;
|
|
4237
|
+
NAME_REQUIRED: import("better-auth").RawError<"NAME_REQUIRED">;
|
|
4238
|
+
ORGANIZATION_ID_REQUIRED: import("better-auth").RawError<"ORGANIZATION_ID_REQUIRED">;
|
|
4239
|
+
USER_NOT_MEMBER_OF_ORGANIZATION: import("better-auth").RawError<"USER_NOT_MEMBER_OF_ORGANIZATION">;
|
|
4240
|
+
INSUFFICIENT_API_KEY_PERMISSIONS: import("better-auth").RawError<"INSUFFICIENT_API_KEY_PERMISSIONS">;
|
|
4241
|
+
NO_DEFAULT_API_KEY_CONFIGURATION_FOUND: import("better-auth").RawError<"NO_DEFAULT_API_KEY_CONFIGURATION_FOUND">;
|
|
4242
|
+
ORGANIZATION_PLUGIN_REQUIRED: import("better-auth").RawError<"ORGANIZATION_PLUGIN_REQUIRED">;
|
|
4243
|
+
};
|
|
4244
|
+
} | {
|
|
4245
|
+
id: "passkey";
|
|
4246
|
+
version: string;
|
|
4247
|
+
$InferServerPlugin: ReturnType<(options?: import("@better-auth/passkey/client").PasskeyOptions | undefined) => {
|
|
4248
|
+
id: "passkey";
|
|
4249
|
+
version: string;
|
|
4250
|
+
endpoints: {
|
|
4251
|
+
generatePasskeyRegistrationOptions: import("better-call").StrictEndpoint<"/passkey/generate-register-options", {
|
|
4252
|
+
method: "GET";
|
|
4253
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
4254
|
+
session: {
|
|
4255
|
+
session: Record<string, any> & {
|
|
4256
|
+
id: string;
|
|
4257
|
+
createdAt: Date;
|
|
4258
|
+
updatedAt: Date;
|
|
4259
|
+
userId: string;
|
|
4260
|
+
expiresAt: Date;
|
|
4261
|
+
token: string;
|
|
4262
|
+
ipAddress?: string | null | undefined;
|
|
4263
|
+
userAgent?: string | null | undefined;
|
|
4264
|
+
};
|
|
4265
|
+
user: Record<string, any> & {
|
|
4266
|
+
id: string;
|
|
4267
|
+
createdAt: Date;
|
|
4268
|
+
updatedAt: Date;
|
|
4269
|
+
email: string;
|
|
4270
|
+
emailVerified: boolean;
|
|
4271
|
+
name: string;
|
|
4272
|
+
image?: string | null | undefined;
|
|
4273
|
+
};
|
|
4274
|
+
};
|
|
4275
|
+
}>)[];
|
|
4276
|
+
query: import("zod").ZodOptional<import("zod").ZodObject<{
|
|
4277
|
+
authenticatorAttachment: import("zod").ZodOptional<import("zod").ZodEnum<{
|
|
4278
|
+
platform: "platform";
|
|
4279
|
+
"cross-platform": "cross-platform";
|
|
4280
|
+
}>>;
|
|
4281
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4282
|
+
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4283
|
+
}, import("zod/v4/core").$strip>>;
|
|
4284
|
+
metadata: {
|
|
4285
|
+
openapi: {
|
|
4286
|
+
operationId: string;
|
|
4287
|
+
description: string;
|
|
4288
|
+
parameters: {
|
|
4289
|
+
name: string;
|
|
4290
|
+
in: "query";
|
|
4291
|
+
required: false;
|
|
4292
|
+
description: string;
|
|
4293
|
+
schema: {
|
|
4294
|
+
type: "string";
|
|
4295
|
+
};
|
|
4296
|
+
}[];
|
|
4297
|
+
responses: {
|
|
4298
|
+
200: {
|
|
4299
|
+
description: string;
|
|
4300
|
+
content: {
|
|
4301
|
+
"application/json": {
|
|
4302
|
+
schema: {
|
|
4303
|
+
type: "object";
|
|
4304
|
+
properties: {
|
|
4305
|
+
challenge: {
|
|
4306
|
+
type: string;
|
|
4307
|
+
};
|
|
4308
|
+
rp: {
|
|
4309
|
+
type: string;
|
|
4310
|
+
properties: {
|
|
4311
|
+
name: {
|
|
4312
|
+
type: string;
|
|
4313
|
+
};
|
|
4314
|
+
id: {
|
|
4315
|
+
type: string;
|
|
4316
|
+
};
|
|
4317
|
+
};
|
|
4318
|
+
};
|
|
4319
|
+
user: {
|
|
4320
|
+
type: string;
|
|
4321
|
+
properties: {
|
|
4322
|
+
id: {
|
|
4323
|
+
type: string;
|
|
4324
|
+
};
|
|
4325
|
+
name: {
|
|
4326
|
+
type: string;
|
|
4327
|
+
};
|
|
4328
|
+
displayName: {
|
|
4329
|
+
type: string;
|
|
4330
|
+
};
|
|
4331
|
+
};
|
|
4332
|
+
};
|
|
4333
|
+
pubKeyCredParams: {
|
|
4334
|
+
type: string;
|
|
4335
|
+
items: {
|
|
4336
|
+
type: string;
|
|
4337
|
+
properties: {
|
|
4338
|
+
type: {
|
|
4339
|
+
type: string;
|
|
4340
|
+
};
|
|
4341
|
+
alg: {
|
|
4342
|
+
type: string;
|
|
4343
|
+
};
|
|
4344
|
+
};
|
|
4345
|
+
};
|
|
4346
|
+
};
|
|
4347
|
+
timeout: {
|
|
4348
|
+
type: string;
|
|
4349
|
+
};
|
|
4350
|
+
excludeCredentials: {
|
|
4351
|
+
type: string;
|
|
4352
|
+
items: {
|
|
4353
|
+
type: string;
|
|
4354
|
+
properties: {
|
|
4355
|
+
id: {
|
|
4356
|
+
type: string;
|
|
4357
|
+
};
|
|
4358
|
+
type: {
|
|
4359
|
+
type: string;
|
|
4360
|
+
};
|
|
4361
|
+
transports: {
|
|
4362
|
+
type: string;
|
|
4363
|
+
items: {
|
|
4364
|
+
type: string;
|
|
4365
|
+
};
|
|
4366
|
+
};
|
|
4367
|
+
};
|
|
4368
|
+
};
|
|
4369
|
+
};
|
|
4370
|
+
authenticatorSelection: {
|
|
4371
|
+
type: string;
|
|
4372
|
+
properties: {
|
|
4373
|
+
authenticatorAttachment: {
|
|
4374
|
+
type: string;
|
|
4375
|
+
};
|
|
4376
|
+
requireResidentKey: {
|
|
4377
|
+
type: string;
|
|
4378
|
+
};
|
|
4379
|
+
userVerification: {
|
|
4380
|
+
type: string;
|
|
4381
|
+
};
|
|
4382
|
+
};
|
|
4383
|
+
};
|
|
4384
|
+
attestation: {
|
|
4385
|
+
type: string;
|
|
4386
|
+
};
|
|
4387
|
+
extensions: {
|
|
4388
|
+
type: string;
|
|
4389
|
+
};
|
|
4390
|
+
};
|
|
4391
|
+
};
|
|
4392
|
+
};
|
|
4393
|
+
};
|
|
4394
|
+
};
|
|
4395
|
+
};
|
|
4396
|
+
};
|
|
4397
|
+
};
|
|
4398
|
+
}, import("@simplewebauthn/server").PublicKeyCredentialCreationOptionsJSON>;
|
|
4399
|
+
generatePasskeyAuthenticationOptions: import("better-call").StrictEndpoint<"/passkey/generate-authenticate-options", {
|
|
4400
|
+
method: "GET";
|
|
4401
|
+
metadata: {
|
|
4402
|
+
openapi: {
|
|
4403
|
+
operationId: string;
|
|
4404
|
+
description: string;
|
|
4405
|
+
responses: {
|
|
4406
|
+
200: {
|
|
4407
|
+
description: string;
|
|
4408
|
+
content: {
|
|
4409
|
+
"application/json": {
|
|
4410
|
+
schema: {
|
|
4411
|
+
type: "object";
|
|
4412
|
+
properties: {
|
|
4413
|
+
challenge: {
|
|
4414
|
+
type: string;
|
|
4415
|
+
};
|
|
4416
|
+
rp: {
|
|
4417
|
+
type: string;
|
|
4418
|
+
properties: {
|
|
4419
|
+
name: {
|
|
4420
|
+
type: string;
|
|
4421
|
+
};
|
|
4422
|
+
id: {
|
|
4423
|
+
type: string;
|
|
4424
|
+
};
|
|
4425
|
+
};
|
|
4426
|
+
};
|
|
4427
|
+
user: {
|
|
4428
|
+
type: string;
|
|
4429
|
+
properties: {
|
|
4430
|
+
id: {
|
|
4431
|
+
type: string;
|
|
4432
|
+
};
|
|
4433
|
+
name: {
|
|
4434
|
+
type: string;
|
|
4435
|
+
};
|
|
4436
|
+
displayName: {
|
|
4437
|
+
type: string;
|
|
4438
|
+
};
|
|
4439
|
+
};
|
|
4440
|
+
};
|
|
4441
|
+
timeout: {
|
|
4442
|
+
type: string;
|
|
4443
|
+
};
|
|
4444
|
+
allowCredentials: {
|
|
4445
|
+
type: string;
|
|
4446
|
+
items: {
|
|
4447
|
+
type: string;
|
|
4448
|
+
properties: {
|
|
4449
|
+
id: {
|
|
4450
|
+
type: string;
|
|
4451
|
+
};
|
|
4452
|
+
type: {
|
|
4453
|
+
type: string;
|
|
4454
|
+
};
|
|
4455
|
+
transports: {
|
|
4456
|
+
type: string;
|
|
4457
|
+
items: {
|
|
4458
|
+
type: string;
|
|
4459
|
+
};
|
|
4460
|
+
};
|
|
4461
|
+
};
|
|
4462
|
+
};
|
|
4463
|
+
};
|
|
4464
|
+
userVerification: {
|
|
4465
|
+
type: string;
|
|
4466
|
+
};
|
|
4467
|
+
authenticatorSelection: {
|
|
4468
|
+
type: string;
|
|
4469
|
+
properties: {
|
|
4470
|
+
authenticatorAttachment: {
|
|
4471
|
+
type: string;
|
|
4472
|
+
};
|
|
4473
|
+
requireResidentKey: {
|
|
4474
|
+
type: string;
|
|
4475
|
+
};
|
|
4476
|
+
userVerification: {
|
|
4477
|
+
type: string;
|
|
4478
|
+
};
|
|
4479
|
+
};
|
|
4480
|
+
};
|
|
4481
|
+
extensions: {
|
|
4482
|
+
type: string;
|
|
4483
|
+
};
|
|
4484
|
+
};
|
|
4485
|
+
};
|
|
4486
|
+
};
|
|
4487
|
+
};
|
|
4488
|
+
};
|
|
4489
|
+
};
|
|
4490
|
+
};
|
|
4491
|
+
};
|
|
4492
|
+
}, import("@simplewebauthn/server").PublicKeyCredentialRequestOptionsJSON>;
|
|
4493
|
+
verifyPasskeyRegistration: import("better-call").StrictEndpoint<"/passkey/verify-registration", {
|
|
4494
|
+
method: "POST";
|
|
4495
|
+
body: import("zod").ZodObject<{
|
|
4496
|
+
response: import("zod").ZodAny;
|
|
4497
|
+
name: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4498
|
+
}, import("zod/v4/core").$strip>;
|
|
4499
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
4500
|
+
session: {
|
|
4501
|
+
session: Record<string, any> & {
|
|
4502
|
+
id: string;
|
|
4503
|
+
createdAt: Date;
|
|
4504
|
+
updatedAt: Date;
|
|
4505
|
+
userId: string;
|
|
4506
|
+
expiresAt: Date;
|
|
4507
|
+
token: string;
|
|
4508
|
+
ipAddress?: string | null | undefined;
|
|
4509
|
+
userAgent?: string | null | undefined;
|
|
4510
|
+
};
|
|
4511
|
+
user: Record<string, any> & {
|
|
4512
|
+
id: string;
|
|
4513
|
+
createdAt: Date;
|
|
4514
|
+
updatedAt: Date;
|
|
4515
|
+
email: string;
|
|
4516
|
+
emailVerified: boolean;
|
|
4517
|
+
name: string;
|
|
4518
|
+
image?: string | null | undefined;
|
|
4519
|
+
};
|
|
4520
|
+
};
|
|
4521
|
+
}>)[];
|
|
4522
|
+
metadata: {
|
|
4523
|
+
openapi: {
|
|
4524
|
+
operationId: string;
|
|
4525
|
+
description: string;
|
|
4526
|
+
responses: {
|
|
4527
|
+
200: {
|
|
4528
|
+
description: string;
|
|
4529
|
+
content: {
|
|
4530
|
+
"application/json": {
|
|
4531
|
+
schema: {
|
|
4532
|
+
$ref: string;
|
|
4533
|
+
};
|
|
4534
|
+
};
|
|
4535
|
+
};
|
|
4536
|
+
};
|
|
4537
|
+
400: {
|
|
4538
|
+
description: string;
|
|
4539
|
+
};
|
|
4540
|
+
};
|
|
4541
|
+
};
|
|
4542
|
+
};
|
|
4543
|
+
}, import("@better-auth/passkey/client").Passkey>;
|
|
4544
|
+
verifyPasskeyAuthentication: import("better-call").StrictEndpoint<"/passkey/verify-authentication", {
|
|
4545
|
+
method: "POST";
|
|
4546
|
+
body: import("zod").ZodObject<{
|
|
4547
|
+
response: import("zod").ZodRecord<import("zod").ZodAny, import("zod").ZodAny>;
|
|
4548
|
+
}, import("zod/v4/core").$strip>;
|
|
4549
|
+
metadata: {
|
|
4550
|
+
openapi: {
|
|
4551
|
+
operationId: string;
|
|
4552
|
+
description: string;
|
|
4553
|
+
responses: {
|
|
4554
|
+
200: {
|
|
4555
|
+
description: string;
|
|
4556
|
+
content: {
|
|
4557
|
+
"application/json": {
|
|
4558
|
+
schema: {
|
|
4559
|
+
type: "object";
|
|
4560
|
+
properties: {
|
|
4561
|
+
session: {
|
|
4562
|
+
$ref: string;
|
|
4563
|
+
};
|
|
4564
|
+
user: {
|
|
4565
|
+
$ref: string;
|
|
4566
|
+
};
|
|
4567
|
+
};
|
|
4568
|
+
};
|
|
4569
|
+
};
|
|
4570
|
+
};
|
|
4571
|
+
};
|
|
4572
|
+
};
|
|
4573
|
+
};
|
|
4574
|
+
$Infer: {
|
|
4575
|
+
body: {
|
|
4576
|
+
response: import("@simplewebauthn/server").AuthenticationResponseJSON;
|
|
4577
|
+
};
|
|
4578
|
+
};
|
|
4579
|
+
};
|
|
4580
|
+
}, {
|
|
4581
|
+
session: {
|
|
4582
|
+
id: string;
|
|
4583
|
+
createdAt: Date;
|
|
4584
|
+
updatedAt: Date;
|
|
4585
|
+
userId: string;
|
|
4586
|
+
expiresAt: Date;
|
|
4587
|
+
token: string;
|
|
4588
|
+
ipAddress?: string | null | undefined;
|
|
4589
|
+
userAgent?: string | null | undefined;
|
|
4590
|
+
};
|
|
4591
|
+
user: {
|
|
4592
|
+
id: string;
|
|
4593
|
+
createdAt: Date;
|
|
4594
|
+
updatedAt: Date;
|
|
4595
|
+
email: string;
|
|
4596
|
+
emailVerified: boolean;
|
|
4597
|
+
name: string;
|
|
4598
|
+
image?: string | null | undefined;
|
|
4599
|
+
};
|
|
4600
|
+
}>;
|
|
4601
|
+
listPasskeys: import("better-call").StrictEndpoint<"/passkey/list-user-passkeys", {
|
|
4602
|
+
method: "GET";
|
|
4603
|
+
use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
4604
|
+
session: {
|
|
4605
|
+
session: Record<string, any> & {
|
|
4606
|
+
id: string;
|
|
4607
|
+
createdAt: Date;
|
|
4608
|
+
updatedAt: Date;
|
|
4609
|
+
userId: string;
|
|
4610
|
+
expiresAt: Date;
|
|
4611
|
+
token: string;
|
|
4612
|
+
ipAddress?: string | null | undefined;
|
|
4613
|
+
userAgent?: string | null | undefined;
|
|
4614
|
+
};
|
|
4615
|
+
user: Record<string, any> & {
|
|
4616
|
+
id: string;
|
|
4617
|
+
createdAt: Date;
|
|
4618
|
+
updatedAt: Date;
|
|
4619
|
+
email: string;
|
|
4620
|
+
emailVerified: boolean;
|
|
4621
|
+
name: string;
|
|
4622
|
+
image?: string | null | undefined;
|
|
4623
|
+
};
|
|
4624
|
+
};
|
|
4625
|
+
}>)[];
|
|
4626
|
+
metadata: {
|
|
4627
|
+
openapi: {
|
|
4628
|
+
description: string;
|
|
4629
|
+
responses: {
|
|
4630
|
+
"200": {
|
|
4631
|
+
description: string;
|
|
4632
|
+
content: {
|
|
4633
|
+
"application/json": {
|
|
4634
|
+
schema: {
|
|
4635
|
+
type: "array";
|
|
4636
|
+
items: {
|
|
4637
|
+
$ref: string;
|
|
4638
|
+
required: string[];
|
|
4639
|
+
};
|
|
4640
|
+
description: string;
|
|
4641
|
+
};
|
|
4642
|
+
};
|
|
4643
|
+
};
|
|
4644
|
+
};
|
|
4645
|
+
};
|
|
4646
|
+
};
|
|
4647
|
+
};
|
|
4648
|
+
}, import("@better-auth/passkey/client").Passkey[]>;
|
|
4649
|
+
deletePasskey: import("better-call").StrictEndpoint<"/passkey/delete-passkey", {
|
|
4650
|
+
method: "POST";
|
|
4651
|
+
body: import("zod").ZodObject<{
|
|
4652
|
+
id: import("zod").ZodString;
|
|
4653
|
+
}, import("zod/v4/core").$strip>;
|
|
4654
|
+
use: (((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
4655
|
+
session: {
|
|
4656
|
+
session: Record<string, any> & {
|
|
4657
|
+
id: string;
|
|
4658
|
+
createdAt: Date;
|
|
4659
|
+
updatedAt: Date;
|
|
4660
|
+
userId: string;
|
|
4661
|
+
expiresAt: Date;
|
|
4662
|
+
token: string;
|
|
4663
|
+
ipAddress?: string | null | undefined;
|
|
4664
|
+
userAgent?: string | null | undefined;
|
|
4665
|
+
};
|
|
4666
|
+
user: Record<string, any> & {
|
|
4667
|
+
id: string;
|
|
4668
|
+
createdAt: Date;
|
|
4669
|
+
updatedAt: Date;
|
|
4670
|
+
email: string;
|
|
4671
|
+
emailVerified: boolean;
|
|
4672
|
+
name: string;
|
|
4673
|
+
image?: string | null | undefined;
|
|
4674
|
+
};
|
|
4675
|
+
};
|
|
4676
|
+
}>) | ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
4677
|
+
verifiedResource: {};
|
|
4678
|
+
}>))[];
|
|
4679
|
+
metadata: {
|
|
4680
|
+
openapi: {
|
|
4681
|
+
description: string;
|
|
4682
|
+
responses: {
|
|
4683
|
+
"200": {
|
|
4684
|
+
description: string;
|
|
4685
|
+
content: {
|
|
4686
|
+
"application/json": {
|
|
4687
|
+
schema: {
|
|
4688
|
+
type: "object";
|
|
4689
|
+
properties: {
|
|
4690
|
+
status: {
|
|
4691
|
+
type: string;
|
|
4692
|
+
description: string;
|
|
4693
|
+
};
|
|
4694
|
+
};
|
|
4695
|
+
required: string[];
|
|
4696
|
+
};
|
|
4697
|
+
};
|
|
4698
|
+
};
|
|
4699
|
+
};
|
|
4700
|
+
};
|
|
4701
|
+
};
|
|
4702
|
+
};
|
|
4703
|
+
}, {
|
|
4704
|
+
status: boolean;
|
|
4705
|
+
}>;
|
|
4706
|
+
updatePasskey: import("better-call").StrictEndpoint<"/passkey/update-passkey", {
|
|
4707
|
+
method: "POST";
|
|
4708
|
+
body: import("zod").ZodObject<{
|
|
4709
|
+
id: import("zod").ZodString;
|
|
4710
|
+
name: import("zod").ZodString;
|
|
4711
|
+
}, import("zod/v4/core").$strip>;
|
|
4712
|
+
use: (((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
4713
|
+
session: {
|
|
4714
|
+
session: Record<string, any> & {
|
|
4715
|
+
id: string;
|
|
4716
|
+
createdAt: Date;
|
|
4717
|
+
updatedAt: Date;
|
|
4718
|
+
userId: string;
|
|
4719
|
+
expiresAt: Date;
|
|
4720
|
+
token: string;
|
|
4721
|
+
ipAddress?: string | null | undefined;
|
|
4722
|
+
userAgent?: string | null | undefined;
|
|
4723
|
+
};
|
|
4724
|
+
user: Record<string, any> & {
|
|
4725
|
+
id: string;
|
|
4726
|
+
createdAt: Date;
|
|
4727
|
+
updatedAt: Date;
|
|
4728
|
+
email: string;
|
|
4729
|
+
emailVerified: boolean;
|
|
4730
|
+
name: string;
|
|
4731
|
+
image?: string | null | undefined;
|
|
4732
|
+
};
|
|
4733
|
+
};
|
|
4734
|
+
}>) | ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
|
|
4735
|
+
verifiedResource: {};
|
|
4736
|
+
}>))[];
|
|
4737
|
+
metadata: {
|
|
4738
|
+
openapi: {
|
|
4739
|
+
description: string;
|
|
4740
|
+
responses: {
|
|
4741
|
+
"200": {
|
|
4742
|
+
description: string;
|
|
4743
|
+
content: {
|
|
4744
|
+
"application/json": {
|
|
4745
|
+
schema: {
|
|
4746
|
+
type: "object";
|
|
4747
|
+
properties: {
|
|
4748
|
+
passkey: {
|
|
4749
|
+
$ref: string;
|
|
4750
|
+
};
|
|
4751
|
+
};
|
|
4752
|
+
required: string[];
|
|
4753
|
+
};
|
|
4754
|
+
};
|
|
4755
|
+
};
|
|
4756
|
+
};
|
|
4757
|
+
};
|
|
4758
|
+
};
|
|
4759
|
+
};
|
|
4760
|
+
}, {
|
|
4761
|
+
passkey: import("@better-auth/passkey/client").Passkey;
|
|
4762
|
+
}>;
|
|
4763
|
+
};
|
|
4764
|
+
schema: {
|
|
4765
|
+
passkey: {
|
|
4766
|
+
fields: {
|
|
4767
|
+
name: {
|
|
4768
|
+
type: "string";
|
|
4769
|
+
required: false;
|
|
4770
|
+
};
|
|
4771
|
+
publicKey: {
|
|
4772
|
+
type: "string";
|
|
4773
|
+
required: true;
|
|
4774
|
+
};
|
|
4775
|
+
userId: {
|
|
4776
|
+
type: "string";
|
|
4777
|
+
references: {
|
|
4778
|
+
model: string;
|
|
4779
|
+
field: string;
|
|
4780
|
+
};
|
|
4781
|
+
required: true;
|
|
4782
|
+
index: true;
|
|
4783
|
+
};
|
|
4784
|
+
credentialID: {
|
|
4785
|
+
type: "string";
|
|
4786
|
+
required: true;
|
|
4787
|
+
index: true;
|
|
4788
|
+
};
|
|
4789
|
+
counter: {
|
|
4790
|
+
type: "number";
|
|
4791
|
+
required: true;
|
|
4792
|
+
};
|
|
4793
|
+
deviceType: {
|
|
4794
|
+
type: "string";
|
|
4795
|
+
required: true;
|
|
4796
|
+
};
|
|
4797
|
+
backedUp: {
|
|
4798
|
+
type: "boolean";
|
|
4799
|
+
required: true;
|
|
4800
|
+
};
|
|
4801
|
+
transports: {
|
|
4802
|
+
type: "string";
|
|
4803
|
+
required: false;
|
|
4804
|
+
};
|
|
4805
|
+
createdAt: {
|
|
4806
|
+
type: "date";
|
|
4807
|
+
required: false;
|
|
4808
|
+
};
|
|
4809
|
+
aaguid: {
|
|
4810
|
+
type: "string";
|
|
4811
|
+
required: false;
|
|
4812
|
+
};
|
|
4813
|
+
};
|
|
4814
|
+
};
|
|
4815
|
+
};
|
|
4816
|
+
$ERROR_CODES: {
|
|
4817
|
+
CHALLENGE_NOT_FOUND: import("better-auth").RawError<"CHALLENGE_NOT_FOUND">;
|
|
4818
|
+
YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
|
|
4819
|
+
FAILED_TO_VERIFY_REGISTRATION: import("better-auth").RawError<"FAILED_TO_VERIFY_REGISTRATION">;
|
|
4820
|
+
PASSKEY_NOT_FOUND: import("better-auth").RawError<"PASSKEY_NOT_FOUND">;
|
|
4821
|
+
AUTHENTICATION_FAILED: import("better-auth").RawError<"AUTHENTICATION_FAILED">;
|
|
4822
|
+
UNABLE_TO_CREATE_SESSION: import("better-auth").RawError<"UNABLE_TO_CREATE_SESSION">;
|
|
4823
|
+
FAILED_TO_UPDATE_PASSKEY: import("better-auth").RawError<"FAILED_TO_UPDATE_PASSKEY">;
|
|
4824
|
+
PREVIOUSLY_REGISTERED: import("better-auth").RawError<"PREVIOUSLY_REGISTERED">;
|
|
4825
|
+
REGISTRATION_CANCELLED: import("better-auth").RawError<"REGISTRATION_CANCELLED">;
|
|
4826
|
+
AUTH_CANCELLED: import("better-auth").RawError<"AUTH_CANCELLED">;
|
|
4827
|
+
UNKNOWN_ERROR: import("better-auth").RawError<"UNKNOWN_ERROR">;
|
|
4828
|
+
SESSION_REQUIRED: import("better-auth").RawError<"SESSION_REQUIRED">;
|
|
4829
|
+
RESOLVE_USER_REQUIRED: import("better-auth").RawError<"RESOLVE_USER_REQUIRED">;
|
|
4830
|
+
RESOLVED_USER_INVALID: import("better-auth").RawError<"RESOLVED_USER_INVALID">;
|
|
4831
|
+
};
|
|
4832
|
+
options: import("@better-auth/passkey/client").PasskeyOptions | undefined;
|
|
4833
|
+
}>;
|
|
4834
|
+
getActions: ($fetch: import("@better-fetch/fetch").BetterFetch, $store: import("better-auth").ClientStore) => {
|
|
4835
|
+
signIn: {
|
|
4836
|
+
passkey: (opts?: {
|
|
4837
|
+
autoFill?: boolean;
|
|
4838
|
+
extensions?: import("@simplewebauthn/server").AuthenticationExtensionsClientInputs;
|
|
4839
|
+
returnWebAuthnResponse?: boolean;
|
|
4840
|
+
fetchOptions?: import("better-auth").ClientFetchOption;
|
|
4841
|
+
} | undefined, options?: import("better-auth").ClientFetchOption | undefined) => Promise<{
|
|
4842
|
+
data: null;
|
|
4843
|
+
error: {
|
|
4844
|
+
message?: string | undefined;
|
|
4845
|
+
status: number;
|
|
4846
|
+
statusText: string;
|
|
4847
|
+
};
|
|
4848
|
+
} | {
|
|
4849
|
+
data: {
|
|
4850
|
+
session: import("better-auth").Session;
|
|
4851
|
+
user: import("better-auth").User;
|
|
4852
|
+
};
|
|
4853
|
+
error: null;
|
|
4854
|
+
} | {
|
|
4855
|
+
data: null;
|
|
4856
|
+
error: {
|
|
4857
|
+
code: string;
|
|
4858
|
+
message: string;
|
|
4859
|
+
status: number;
|
|
4860
|
+
statusText: string;
|
|
4861
|
+
};
|
|
4862
|
+
} | {
|
|
4863
|
+
webauthn: {
|
|
4864
|
+
response: import("@simplewebauthn/server").AuthenticationResponseJSON;
|
|
4865
|
+
clientExtensionResults: import("@simplewebauthn/server").AuthenticationExtensionsClientOutputs;
|
|
4866
|
+
};
|
|
4867
|
+
data: null;
|
|
4868
|
+
error: {
|
|
4869
|
+
message?: string | undefined;
|
|
4870
|
+
status: number;
|
|
4871
|
+
statusText: string;
|
|
4872
|
+
};
|
|
4873
|
+
} | {
|
|
4874
|
+
webauthn: {
|
|
4875
|
+
response: import("@simplewebauthn/server").AuthenticationResponseJSON;
|
|
4876
|
+
clientExtensionResults: import("@simplewebauthn/server").AuthenticationExtensionsClientOutputs;
|
|
4877
|
+
};
|
|
4878
|
+
data: {
|
|
4879
|
+
session: import("better-auth").Session;
|
|
4880
|
+
user: import("better-auth").User;
|
|
4881
|
+
};
|
|
4882
|
+
error: null;
|
|
4883
|
+
}>;
|
|
4884
|
+
};
|
|
4885
|
+
passkey: {
|
|
4886
|
+
addPasskey: (opts?: {
|
|
4887
|
+
fetchOptions?: import("better-auth").ClientFetchOption;
|
|
4888
|
+
name?: string;
|
|
4889
|
+
authenticatorAttachment?: "platform" | "cross-platform";
|
|
4890
|
+
context?: string | null;
|
|
4891
|
+
extensions?: import("@simplewebauthn/server").AuthenticationExtensionsClientInputs;
|
|
4892
|
+
useAutoRegister?: boolean;
|
|
4893
|
+
returnWebAuthnResponse?: boolean;
|
|
4894
|
+
} | undefined, fetchOpts?: import("better-auth").ClientFetchOption | undefined) => Promise<{
|
|
4895
|
+
data: null;
|
|
4896
|
+
error: {
|
|
4897
|
+
message?: string | undefined;
|
|
4898
|
+
status: number;
|
|
4899
|
+
statusText: string;
|
|
4900
|
+
};
|
|
4901
|
+
} | {
|
|
4902
|
+
data: import("@better-auth/passkey/client").Passkey;
|
|
4903
|
+
error: null;
|
|
4904
|
+
} | {
|
|
4905
|
+
webauthn: {
|
|
4906
|
+
response: import("@simplewebauthn/server").RegistrationResponseJSON;
|
|
4907
|
+
clientExtensionResults: import("@simplewebauthn/server").AuthenticationExtensionsClientOutputs;
|
|
4908
|
+
};
|
|
4909
|
+
data: import("@better-auth/passkey/client").Passkey;
|
|
4910
|
+
error: null;
|
|
4911
|
+
} | {
|
|
4912
|
+
data: null;
|
|
4913
|
+
error: {
|
|
4914
|
+
code: string;
|
|
4915
|
+
message: string;
|
|
4916
|
+
status: number;
|
|
4917
|
+
statusText: string;
|
|
4918
|
+
};
|
|
4919
|
+
}>;
|
|
4920
|
+
};
|
|
4921
|
+
$Infer: {
|
|
4922
|
+
Passkey: import("@better-auth/passkey/client").Passkey;
|
|
4923
|
+
};
|
|
4924
|
+
};
|
|
4925
|
+
getAtoms($fetch: import("@better-fetch/fetch").BetterFetch): {
|
|
4926
|
+
listPasskeys: import("better-auth/client").AuthQueryAtom<import("@better-auth/passkey/client").Passkey[]>;
|
|
4927
|
+
$listPasskeys: import("nanostores").PreinitializedWritableAtom<any> & object;
|
|
4928
|
+
};
|
|
4929
|
+
pathMethods: {
|
|
4930
|
+
"/passkey/register": "POST";
|
|
4931
|
+
"/passkey/authenticate": "POST";
|
|
4932
|
+
};
|
|
4933
|
+
atomListeners: ({
|
|
4934
|
+
matcher(path: string): path is "/passkey/delete-passkey" | "/passkey/update-passkey" | "/passkey/verify-registration" | "/sign-out";
|
|
4935
|
+
signal: "$listPasskeys";
|
|
4936
|
+
} | {
|
|
4937
|
+
matcher: (path: string) => path is "/passkey/verify-authentication";
|
|
4938
|
+
signal: "$sessionSignal";
|
|
4939
|
+
})[];
|
|
4940
|
+
$ERROR_CODES: {
|
|
4941
|
+
CHALLENGE_NOT_FOUND: import("better-auth").RawError<"CHALLENGE_NOT_FOUND">;
|
|
4942
|
+
YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY">;
|
|
4943
|
+
FAILED_TO_VERIFY_REGISTRATION: import("better-auth").RawError<"FAILED_TO_VERIFY_REGISTRATION">;
|
|
4944
|
+
PASSKEY_NOT_FOUND: import("better-auth").RawError<"PASSKEY_NOT_FOUND">;
|
|
4945
|
+
AUTHENTICATION_FAILED: import("better-auth").RawError<"AUTHENTICATION_FAILED">;
|
|
4946
|
+
UNABLE_TO_CREATE_SESSION: import("better-auth").RawError<"UNABLE_TO_CREATE_SESSION">;
|
|
4947
|
+
FAILED_TO_UPDATE_PASSKEY: import("better-auth").RawError<"FAILED_TO_UPDATE_PASSKEY">;
|
|
4948
|
+
PREVIOUSLY_REGISTERED: import("better-auth").RawError<"PREVIOUSLY_REGISTERED">;
|
|
4949
|
+
REGISTRATION_CANCELLED: import("better-auth").RawError<"REGISTRATION_CANCELLED">;
|
|
4950
|
+
AUTH_CANCELLED: import("better-auth").RawError<"AUTH_CANCELLED">;
|
|
4951
|
+
UNKNOWN_ERROR: import("better-auth").RawError<"UNKNOWN_ERROR">;
|
|
4952
|
+
SESSION_REQUIRED: import("better-auth").RawError<"SESSION_REQUIRED">;
|
|
4953
|
+
RESOLVE_USER_REQUIRED: import("better-auth").RawError<"RESOLVE_USER_REQUIRED">;
|
|
4954
|
+
RESOLVED_USER_INVALID: import("better-auth").RawError<"RESOLVED_USER_INVALID">;
|
|
4955
|
+
};
|
|
4956
|
+
} | {
|
|
4957
|
+
id: "organization";
|
|
4958
|
+
version: string;
|
|
4959
|
+
$InferServerPlugin: import("better-auth/client").OrganizationPlugin<{
|
|
4960
|
+
ac: import("better-auth/client").AccessControl<{
|
|
4961
|
+
readonly organization: readonly ["update", "delete"];
|
|
4962
|
+
readonly member: readonly ["create", "update", "delete"];
|
|
4963
|
+
readonly invitation: readonly ["create", "cancel"];
|
|
4964
|
+
readonly team: readonly ["create", "update", "delete"];
|
|
4965
|
+
readonly ac: readonly ["create", "read", "update", "delete"];
|
|
4966
|
+
}>;
|
|
4967
|
+
roles: {
|
|
4968
|
+
admin: import("better-auth/client").Role;
|
|
4969
|
+
member: import("better-auth/client").Role;
|
|
4970
|
+
owner: import("better-auth/client").Role;
|
|
4971
|
+
};
|
|
4972
|
+
teams: {
|
|
4973
|
+
enabled: false;
|
|
4974
|
+
};
|
|
4975
|
+
schema: {
|
|
4976
|
+
organization?: {
|
|
4977
|
+
additionalFields?: {
|
|
4978
|
+
[key: string]: import("better-auth").DBFieldAttribute;
|
|
4979
|
+
};
|
|
4980
|
+
};
|
|
4981
|
+
member?: {
|
|
4982
|
+
additionalFields?: {
|
|
4983
|
+
[key: string]: import("better-auth").DBFieldAttribute;
|
|
4984
|
+
};
|
|
4985
|
+
};
|
|
4986
|
+
invitation?: {
|
|
4987
|
+
additionalFields?: {
|
|
4988
|
+
[key: string]: import("better-auth").DBFieldAttribute;
|
|
4989
|
+
};
|
|
4990
|
+
};
|
|
4991
|
+
team?: {
|
|
4992
|
+
additionalFields?: {
|
|
4993
|
+
[key: string]: import("better-auth").DBFieldAttribute;
|
|
4994
|
+
};
|
|
4995
|
+
};
|
|
4996
|
+
organizationRole?: {
|
|
4997
|
+
additionalFields?: {
|
|
4998
|
+
[key: string]: import("better-auth").DBFieldAttribute;
|
|
4999
|
+
};
|
|
5000
|
+
};
|
|
5001
|
+
} | undefined;
|
|
5002
|
+
dynamicAccessControl: {
|
|
5003
|
+
enabled: false;
|
|
5004
|
+
};
|
|
5005
|
+
}>;
|
|
5006
|
+
getActions: ($fetch: import("@better-fetch/fetch").BetterFetch, _$store: import("better-auth").ClientStore, co: import("better-auth").BetterAuthClientOptions | undefined) => {
|
|
5007
|
+
$Infer: {
|
|
5008
|
+
ActiveOrganization: {
|
|
5009
|
+
members: {
|
|
5010
|
+
id: string;
|
|
5011
|
+
organizationId: string;
|
|
5012
|
+
role: "admin" | "member" | "owner";
|
|
5013
|
+
createdAt: Date;
|
|
5014
|
+
userId: string;
|
|
5015
|
+
user: {
|
|
5016
|
+
id: string;
|
|
5017
|
+
email: string;
|
|
5018
|
+
name: string;
|
|
5019
|
+
image?: string | undefined;
|
|
5020
|
+
};
|
|
5021
|
+
}[];
|
|
5022
|
+
invitations: {
|
|
5023
|
+
id: string;
|
|
5024
|
+
organizationId: string;
|
|
5025
|
+
email: string;
|
|
5026
|
+
role: "admin" | "member" | "owner";
|
|
5027
|
+
status: import("better-auth/client").InvitationStatus;
|
|
5028
|
+
inviterId: string;
|
|
5029
|
+
expiresAt: Date;
|
|
5030
|
+
createdAt: Date;
|
|
5031
|
+
}[];
|
|
5032
|
+
} & {
|
|
5033
|
+
id: string;
|
|
5034
|
+
name: string;
|
|
5035
|
+
slug: string;
|
|
5036
|
+
createdAt: Date;
|
|
5037
|
+
logo?: string | null | undefined | undefined;
|
|
5038
|
+
metadata?: any;
|
|
5039
|
+
};
|
|
5040
|
+
Organization: {
|
|
5041
|
+
id: string;
|
|
5042
|
+
name: string;
|
|
5043
|
+
slug: string;
|
|
5044
|
+
createdAt: Date;
|
|
5045
|
+
logo?: string | null | undefined;
|
|
5046
|
+
metadata?: any;
|
|
5047
|
+
};
|
|
5048
|
+
Invitation: {
|
|
5049
|
+
id: string;
|
|
5050
|
+
organizationId: string;
|
|
5051
|
+
email: string;
|
|
5052
|
+
role: "admin" | "member" | "owner";
|
|
5053
|
+
status: import("better-auth/client").InvitationStatus;
|
|
5054
|
+
inviterId: string;
|
|
5055
|
+
expiresAt: Date;
|
|
5056
|
+
createdAt: Date;
|
|
5057
|
+
};
|
|
5058
|
+
Member: {
|
|
5059
|
+
id: string;
|
|
5060
|
+
organizationId: string;
|
|
5061
|
+
role: "admin" | "member" | "owner";
|
|
5062
|
+
createdAt: Date;
|
|
5063
|
+
userId: string;
|
|
5064
|
+
user: {
|
|
5065
|
+
id: string;
|
|
5066
|
+
email: string;
|
|
5067
|
+
name: string;
|
|
5068
|
+
image?: string | undefined;
|
|
5069
|
+
};
|
|
5070
|
+
};
|
|
5071
|
+
Team: {
|
|
5072
|
+
id: string;
|
|
5073
|
+
name: string;
|
|
5074
|
+
organizationId: string;
|
|
5075
|
+
createdAt: Date;
|
|
5076
|
+
updatedAt?: Date | undefined;
|
|
5077
|
+
};
|
|
5078
|
+
};
|
|
5079
|
+
organization: {
|
|
5080
|
+
checkRolePermission: <R extends "admin" | "member" | "owner">(data: {
|
|
5081
|
+
permissions: {
|
|
5082
|
+
readonly organization?: ("delete" | "update")[] | undefined;
|
|
5083
|
+
readonly member?: ("create" | "delete" | "update")[] | undefined;
|
|
5084
|
+
readonly invitation?: ("create" | "cancel")[] | undefined;
|
|
5085
|
+
readonly team?: ("create" | "delete" | "update")[] | undefined;
|
|
5086
|
+
readonly ac?: ("create" | "delete" | "update" | "read")[] | undefined;
|
|
5087
|
+
};
|
|
5088
|
+
} & {
|
|
5089
|
+
role: R;
|
|
5090
|
+
}) => boolean;
|
|
5091
|
+
};
|
|
5092
|
+
};
|
|
5093
|
+
getAtoms: ($fetch: import("@better-fetch/fetch").BetterFetch) => {
|
|
5094
|
+
$listOrg: import("nanostores").PreinitializedWritableAtom<boolean> & object;
|
|
5095
|
+
$activeOrgSignal: import("nanostores").PreinitializedWritableAtom<boolean> & object;
|
|
5096
|
+
$activeMemberSignal: import("nanostores").PreinitializedWritableAtom<boolean> & object;
|
|
5097
|
+
$activeMemberRoleSignal: import("nanostores").PreinitializedWritableAtom<boolean> & object;
|
|
5098
|
+
activeOrganization: import("better-auth/client").AuthQueryAtom<import("better-auth").Prettify<{
|
|
5099
|
+
id: string;
|
|
5100
|
+
name: string;
|
|
5101
|
+
slug: string;
|
|
5102
|
+
createdAt: Date;
|
|
5103
|
+
logo?: string | null | undefined | undefined;
|
|
5104
|
+
metadata?: any;
|
|
5105
|
+
} & {
|
|
5106
|
+
members: {
|
|
5107
|
+
id: string;
|
|
5108
|
+
organizationId: string;
|
|
5109
|
+
role: "admin" | "member" | "owner";
|
|
5110
|
+
createdAt: Date;
|
|
5111
|
+
userId: string;
|
|
5112
|
+
user: {
|
|
5113
|
+
id: string;
|
|
5114
|
+
email: string;
|
|
5115
|
+
name: string;
|
|
5116
|
+
image?: string | undefined;
|
|
5117
|
+
};
|
|
5118
|
+
}[];
|
|
5119
|
+
invitations: {
|
|
5120
|
+
id: string;
|
|
5121
|
+
organizationId: string;
|
|
5122
|
+
email: string;
|
|
5123
|
+
role: "admin" | "member" | "owner";
|
|
5124
|
+
status: import("better-auth/client").InvitationStatus;
|
|
5125
|
+
inviterId: string;
|
|
5126
|
+
expiresAt: Date;
|
|
5127
|
+
createdAt: Date;
|
|
5128
|
+
}[];
|
|
5129
|
+
}>>;
|
|
5130
|
+
listOrganizations: import("better-auth/client").AuthQueryAtom<{
|
|
5131
|
+
id: string;
|
|
5132
|
+
name: string;
|
|
5133
|
+
slug: string;
|
|
5134
|
+
createdAt: Date;
|
|
5135
|
+
logo?: string | null | undefined | undefined;
|
|
5136
|
+
metadata?: any;
|
|
5137
|
+
}[]>;
|
|
5138
|
+
activeMember: import("better-auth/client").AuthQueryAtom<{
|
|
5139
|
+
id: string;
|
|
5140
|
+
organizationId: string;
|
|
5141
|
+
userId: string;
|
|
5142
|
+
role: string;
|
|
5143
|
+
createdAt: Date;
|
|
5144
|
+
}>;
|
|
5145
|
+
activeMemberRole: import("better-auth/client").AuthQueryAtom<{
|
|
5146
|
+
role: string;
|
|
5147
|
+
}>;
|
|
5148
|
+
};
|
|
5149
|
+
pathMethods: {
|
|
5150
|
+
"/organization/get-full-organization": "GET";
|
|
5151
|
+
"/organization/list-user-teams": "GET";
|
|
5152
|
+
};
|
|
5153
|
+
atomListeners: ({
|
|
5154
|
+
matcher(path: string): path is "/organization/create" | "/organization/update" | "/organization/delete";
|
|
5155
|
+
signal: "$listOrg";
|
|
5156
|
+
} | {
|
|
5157
|
+
matcher(path: string): boolean;
|
|
5158
|
+
signal: "$activeOrgSignal";
|
|
5159
|
+
} | {
|
|
5160
|
+
matcher(path: string): boolean;
|
|
5161
|
+
signal: "$sessionSignal";
|
|
5162
|
+
} | {
|
|
5163
|
+
matcher(path: string): boolean;
|
|
5164
|
+
signal: "$activeMemberSignal";
|
|
5165
|
+
} | {
|
|
5166
|
+
matcher(path: string): boolean;
|
|
5167
|
+
signal: "$activeMemberRoleSignal";
|
|
5168
|
+
})[];
|
|
5169
|
+
$ERROR_CODES: {
|
|
5170
|
+
YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_ORGANIZATION">;
|
|
5171
|
+
YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS: import("better-auth").RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_ORGANIZATIONS">;
|
|
5172
|
+
ORGANIZATION_ALREADY_EXISTS: import("better-auth").RawError<"ORGANIZATION_ALREADY_EXISTS">;
|
|
5173
|
+
ORGANIZATION_SLUG_ALREADY_TAKEN: import("better-auth").RawError<"ORGANIZATION_SLUG_ALREADY_TAKEN">;
|
|
5174
|
+
ORGANIZATION_NOT_FOUND: import("better-auth").RawError<"ORGANIZATION_NOT_FOUND">;
|
|
5175
|
+
USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION: import("better-auth").RawError<"USER_IS_NOT_A_MEMBER_OF_THE_ORGANIZATION">;
|
|
5176
|
+
YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION">;
|
|
5177
|
+
YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_ORGANIZATION">;
|
|
5178
|
+
NO_ACTIVE_ORGANIZATION: import("better-auth").RawError<"NO_ACTIVE_ORGANIZATION">;
|
|
5179
|
+
USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION: import("better-auth").RawError<"USER_IS_ALREADY_A_MEMBER_OF_THIS_ORGANIZATION">;
|
|
5180
|
+
MEMBER_NOT_FOUND: import("better-auth").RawError<"MEMBER_NOT_FOUND">;
|
|
5181
|
+
ROLE_NOT_FOUND: import("better-auth").RawError<"ROLE_NOT_FOUND">;
|
|
5182
|
+
YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM">;
|
|
5183
|
+
TEAM_ALREADY_EXISTS: import("better-auth").RawError<"TEAM_ALREADY_EXISTS">;
|
|
5184
|
+
TEAM_NOT_FOUND: import("better-auth").RawError<"TEAM_NOT_FOUND">;
|
|
5185
|
+
YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER: import("better-auth").RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_AS_THE_ONLY_OWNER">;
|
|
5186
|
+
YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER: import("better-auth").RawError<"YOU_CANNOT_LEAVE_THE_ORGANIZATION_WITHOUT_AN_OWNER">;
|
|
5187
|
+
YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_MEMBER">;
|
|
5188
|
+
YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USERS_TO_THIS_ORGANIZATION">;
|
|
5189
|
+
USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION: import("better-auth").RawError<"USER_IS_ALREADY_INVITED_TO_THIS_ORGANIZATION">;
|
|
5190
|
+
INVITATION_NOT_FOUND: import("better-auth").RawError<"INVITATION_NOT_FOUND">;
|
|
5191
|
+
YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION: import("better-auth").RawError<"YOU_ARE_NOT_THE_RECIPIENT_OF_THE_INVITATION">;
|
|
5192
|
+
EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION: import("better-auth").RawError<"EMAIL_VERIFICATION_REQUIRED_BEFORE_ACCEPTING_OR_REJECTING_INVITATION">;
|
|
5193
|
+
EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION: import("better-auth").RawError<"EMAIL_VERIFICATION_REQUIRED_FOR_INVITATION">;
|
|
5194
|
+
YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CANCEL_THIS_INVITATION">;
|
|
5195
|
+
INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION: import("better-auth").RawError<"INVITER_IS_NO_LONGER_A_MEMBER_OF_THE_ORGANIZATION">;
|
|
5196
|
+
YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_INVITE_USER_WITH_THIS_ROLE">;
|
|
5197
|
+
FAILED_TO_RETRIEVE_INVITATION: import("better-auth").RawError<"FAILED_TO_RETRIEVE_INVITATION">;
|
|
5198
|
+
YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS: import("better-auth").RawError<"YOU_HAVE_REACHED_THE_MAXIMUM_NUMBER_OF_TEAMS">;
|
|
5199
|
+
UNABLE_TO_REMOVE_LAST_TEAM: import("better-auth").RawError<"UNABLE_TO_REMOVE_LAST_TEAM">;
|
|
5200
|
+
YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_MEMBER">;
|
|
5201
|
+
ORGANIZATION_MEMBERSHIP_LIMIT_REACHED: import("better-auth").RawError<"ORGANIZATION_MEMBERSHIP_LIMIT_REACHED">;
|
|
5202
|
+
YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_TEAMS_IN_THIS_ORGANIZATION">;
|
|
5203
|
+
YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_TEAMS_IN_THIS_ORGANIZATION">;
|
|
5204
|
+
YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_TEAM">;
|
|
5205
|
+
YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_THIS_TEAM">;
|
|
5206
|
+
INVITATION_LIMIT_REACHED: import("better-auth").RawError<"INVITATION_LIMIT_REACHED">;
|
|
5207
|
+
TEAM_MEMBER_LIMIT_REACHED: import("better-auth").RawError<"TEAM_MEMBER_LIMIT_REACHED">;
|
|
5208
|
+
USER_IS_NOT_A_MEMBER_OF_THE_TEAM: import("better-auth").RawError<"USER_IS_NOT_A_MEMBER_OF_THE_TEAM">;
|
|
5209
|
+
YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM: import("better-auth").RawError<"YOU_CAN_NOT_ACCESS_THE_MEMBERS_OF_THIS_TEAM">;
|
|
5210
|
+
YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM: import("better-auth").RawError<"YOU_DO_NOT_HAVE_AN_ACTIVE_TEAM">;
|
|
5211
|
+
YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_NEW_TEAM_MEMBER">;
|
|
5212
|
+
YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_REMOVE_A_TEAM_MEMBER">;
|
|
5213
|
+
YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_ACCESS_THIS_ORGANIZATION">;
|
|
5214
|
+
YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION: import("better-auth").RawError<"YOU_ARE_NOT_A_MEMBER_OF_THIS_ORGANIZATION">;
|
|
5215
|
+
MISSING_AC_INSTANCE: import("better-auth").RawError<"MISSING_AC_INSTANCE">;
|
|
5216
|
+
YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE: import("better-auth").RawError<"YOU_MUST_BE_IN_AN_ORGANIZATION_TO_CREATE_A_ROLE">;
|
|
5217
|
+
YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_CREATE_A_ROLE">;
|
|
5218
|
+
YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_UPDATE_A_ROLE">;
|
|
5219
|
+
YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_DELETE_A_ROLE">;
|
|
5220
|
+
YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_READ_A_ROLE">;
|
|
5221
|
+
YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_LIST_A_ROLE">;
|
|
5222
|
+
YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE: import("better-auth").RawError<"YOU_ARE_NOT_ALLOWED_TO_GET_A_ROLE">;
|
|
5223
|
+
TOO_MANY_ROLES: import("better-auth").RawError<"TOO_MANY_ROLES">;
|
|
5224
|
+
INVALID_RESOURCE: import("better-auth").RawError<"INVALID_RESOURCE">;
|
|
5225
|
+
ROLE_NAME_IS_ALREADY_TAKEN: import("better-auth").RawError<"ROLE_NAME_IS_ALREADY_TAKEN">;
|
|
5226
|
+
CANNOT_DELETE_A_PRE_DEFINED_ROLE: import("better-auth").RawError<"CANNOT_DELETE_A_PRE_DEFINED_ROLE">;
|
|
5227
|
+
ROLE_IS_ASSIGNED_TO_MEMBERS: import("better-auth").RawError<"ROLE_IS_ASSIGNED_TO_MEMBERS">;
|
|
5228
|
+
INVALID_TEAM_ID: import("better-auth").RawError<"INVALID_TEAM_ID">;
|
|
5229
|
+
};
|
|
1665
5230
|
})[];
|
|
1666
5231
|
fetchOptions: {
|
|
1667
5232
|
customFetchImpl?: typeof fetch | undefined;
|