@nest-boot/auth 8.0.2 → 9.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/README.md +48 -0
  2. package/dist/abilities/index.d.ts +2 -0
  3. package/dist/abilities/index.js +3 -0
  4. package/dist/abilities/index.js.map +1 -0
  5. package/dist/abilities/user.ability.d.ts +5 -0
  6. package/dist/abilities/user.ability.js +11 -0
  7. package/dist/abilities/user.ability.js.map +1 -0
  8. package/dist/abilities/workspace.ability.d.ts +5 -0
  9. package/dist/abilities/workspace.ability.js +11 -0
  10. package/dist/abilities/workspace.ability.js.map +1 -0
  11. package/dist/access-control.service.d.ts +18 -0
  12. package/dist/access-control.service.js +153 -0
  13. package/dist/access-control.service.js.map +1 -0
  14. package/dist/adapters/mikro-orm/adapter-config.d.ts +13 -0
  15. package/dist/adapters/mikro-orm/adapter-config.js +15 -0
  16. package/dist/adapters/mikro-orm/adapter-config.js.map +1 -0
  17. package/dist/adapters/mikro-orm/create-custom-adapter.d.ts +10 -0
  18. package/dist/adapters/mikro-orm/create-custom-adapter.js +106 -0
  19. package/dist/adapters/mikro-orm/create-custom-adapter.js.map +1 -0
  20. package/dist/adapters/mikro-orm/entity-metadata-resolver.d.ts +14 -0
  21. package/dist/adapters/mikro-orm/entity-metadata-resolver.js +68 -0
  22. package/dist/adapters/mikro-orm/entity-metadata-resolver.js.map +1 -0
  23. package/dist/adapters/mikro-orm/where-compiler.d.ts +156 -0
  24. package/dist/adapters/mikro-orm/where-compiler.js +69 -0
  25. package/dist/adapters/mikro-orm/where-compiler.js.map +1 -0
  26. package/dist/adapters/mikro-orm-adapter.d.ts +8 -11
  27. package/dist/adapters/mikro-orm-adapter.js +32 -162
  28. package/dist/adapters/mikro-orm-adapter.js.map +1 -1
  29. package/dist/api-key-usage.interceptor.d.ts +8 -0
  30. package/dist/api-key-usage.interceptor.js +35 -0
  31. package/dist/api-key-usage.interceptor.js.map +1 -0
  32. package/dist/api-key.service.d.ts +75 -0
  33. package/dist/api-key.service.js +336 -0
  34. package/dist/api-key.service.js.map +1 -0
  35. package/dist/auth-handler.middleware.d.ts +7 -0
  36. package/dist/auth-handler.middleware.js +31 -0
  37. package/dist/auth-handler.middleware.js.map +1 -0
  38. package/dist/auth-module-options.interface.d.ts +341 -6
  39. package/dist/auth.guard.d.ts +36 -4
  40. package/dist/auth.guard.js +297 -7
  41. package/dist/auth.guard.js.map +1 -1
  42. package/dist/auth.middleware.d.ts +16 -6
  43. package/dist/auth.middleware.js +97 -42
  44. package/dist/auth.middleware.js.map +1 -1
  45. package/dist/auth.module-definition.d.ts +1 -1
  46. package/dist/auth.module.d.ts +10 -7
  47. package/dist/auth.module.js +157 -44
  48. package/dist/auth.module.js.map +1 -1
  49. package/dist/auth.service.d.ts +24 -1857
  50. package/dist/auth.service.js +174 -4
  51. package/dist/auth.service.js.map +1 -1
  52. package/dist/decorators/can.decorator.d.ts +6 -0
  53. package/dist/decorators/can.decorator.js +8 -0
  54. package/dist/decorators/can.decorator.js.map +1 -0
  55. package/dist/decorators/current-api-key.decorator.d.ts +1 -0
  56. package/dist/decorators/current-api-key.decorator.js +5 -0
  57. package/dist/decorators/current-api-key.decorator.js.map +1 -0
  58. package/dist/decorators/current-workspace-member.decorator.d.ts +1 -0
  59. package/dist/decorators/current-workspace-member.decorator.js +5 -0
  60. package/dist/decorators/current-workspace-member.decorator.js.map +1 -0
  61. package/dist/decorators/current-workspace.decorator.d.ts +1 -0
  62. package/dist/decorators/current-workspace.decorator.js +5 -0
  63. package/dist/decorators/current-workspace.decorator.js.map +1 -0
  64. package/dist/decorators/index.d.ts +6 -0
  65. package/dist/decorators/index.js +6 -0
  66. package/dist/decorators/index.js.map +1 -1
  67. package/dist/decorators/user-can.decorator.d.ts +5 -0
  68. package/dist/decorators/user-can.decorator.js +13 -0
  69. package/dist/decorators/user-can.decorator.js.map +1 -0
  70. package/dist/decorators/workspace-can.decorator.d.ts +5 -0
  71. package/dist/decorators/workspace-can.decorator.js +13 -0
  72. package/dist/decorators/workspace-can.decorator.js.map +1 -0
  73. package/dist/entities/account.entity.d.ts +1 -0
  74. package/dist/entities/account.entity.js +12 -3
  75. package/dist/entities/account.entity.js.map +1 -1
  76. package/dist/entities/api-key.entity.d.ts +17 -0
  77. package/dist/entities/api-key.entity.js +92 -0
  78. package/dist/entities/api-key.entity.js.map +1 -0
  79. package/dist/entities/index.d.ts +4 -0
  80. package/dist/entities/index.js +4 -0
  81. package/dist/entities/index.js.map +1 -1
  82. package/dist/entities/resolve-auth-relation-target.d.ts +3 -0
  83. package/dist/entities/resolve-auth-relation-target.js +30 -0
  84. package/dist/entities/resolve-auth-relation-target.js.map +1 -0
  85. package/dist/entities/session.entity.d.ts +3 -1
  86. package/dist/entities/session.entity.js +15 -2
  87. package/dist/entities/session.entity.js.map +1 -1
  88. package/dist/entities/user.entity.d.ts +5 -0
  89. package/dist/entities/user.entity.js +25 -0
  90. package/dist/entities/user.entity.js.map +1 -1
  91. package/dist/entities/verification.entity.js +2 -1
  92. package/dist/entities/verification.entity.js.map +1 -1
  93. package/dist/entities/workspace-invitation.entity.d.ts +14 -0
  94. package/dist/entities/workspace-invitation.entity.js +74 -0
  95. package/dist/entities/workspace-invitation.entity.js.map +1 -0
  96. package/dist/entities/workspace-member.entity.d.ts +16 -0
  97. package/dist/entities/workspace-member.entity.js +86 -0
  98. package/dist/entities/workspace-member.entity.js.map +1 -0
  99. package/dist/entities/workspace.entity.d.ts +8 -0
  100. package/dist/entities/workspace.entity.js +48 -0
  101. package/dist/entities/workspace.entity.js.map +1 -0
  102. package/dist/index.d.ts +32 -2
  103. package/dist/index.js +32 -2
  104. package/dist/index.js.map +1 -1
  105. package/dist/interfaces/auth-role.interface.d.ts +4 -0
  106. package/dist/interfaces/auth-role.interface.js +2 -0
  107. package/dist/interfaces/auth-role.interface.js.map +1 -0
  108. package/dist/interfaces/auth-service.interface.d.ts +160 -0
  109. package/dist/interfaces/auth-service.interface.js +2 -0
  110. package/dist/interfaces/auth-service.interface.js.map +1 -0
  111. package/dist/interfaces/can-options.interface.d.ts +3 -0
  112. package/dist/interfaces/can-options.interface.js +2 -0
  113. package/dist/interfaces/can-options.interface.js.map +1 -0
  114. package/dist/interfaces/route-argument-metadata-value.interface.d.ts +6 -0
  115. package/dist/interfaces/route-argument-metadata-value.interface.js +2 -0
  116. package/dist/interfaces/route-argument-metadata-value.interface.js.map +1 -0
  117. package/dist/interfaces/serialized-ability-rule.interface.d.ts +9 -0
  118. package/dist/interfaces/serialized-ability-rule.interface.js +2 -0
  119. package/dist/interfaces/serialized-ability-rule.interface.js.map +1 -0
  120. package/dist/interfaces/session-service.interface.d.ts +5 -0
  121. package/dist/interfaces/session-service.interface.js +2 -0
  122. package/dist/interfaces/session-service.interface.js.map +1 -0
  123. package/dist/interfaces/user-can-metadata.interface.d.ts +6 -0
  124. package/dist/interfaces/user-can-metadata.interface.js +2 -0
  125. package/dist/interfaces/user-can-metadata.interface.js.map +1 -0
  126. package/dist/interfaces/user-service.interface.d.ts +44 -0
  127. package/dist/interfaces/user-service.interface.js +2 -0
  128. package/dist/interfaces/user-service.interface.js.map +1 -0
  129. package/dist/interfaces/workspace-can-metadata.interface.d.ts +6 -0
  130. package/dist/interfaces/workspace-can-metadata.interface.js +2 -0
  131. package/dist/interfaces/workspace-can-metadata.interface.js.map +1 -0
  132. package/dist/interfaces/workspace-service.interface.d.ts +37 -0
  133. package/dist/interfaces/workspace-service.interface.js +2 -0
  134. package/dist/interfaces/workspace-service.interface.js.map +1 -0
  135. package/dist/permission.constants.d.ts +25 -0
  136. package/dist/permission.constants.js +26 -0
  137. package/dist/permission.constants.js.map +1 -0
  138. package/dist/session.service.d.ts +18 -0
  139. package/dist/session.service.js +171 -0
  140. package/dist/session.service.js.map +1 -0
  141. package/dist/tsconfig.tsbuildinfo +1 -0
  142. package/dist/types/auth-module-roles.type.d.ts +1 -0
  143. package/dist/types/auth-module-roles.type.js +2 -0
  144. package/dist/types/auth-module-roles.type.js.map +1 -0
  145. package/dist/types/build-user-ability-callback.type.d.ts +4 -0
  146. package/dist/types/build-user-ability-callback.type.js +2 -0
  147. package/dist/types/build-user-ability-callback.type.js.map +1 -0
  148. package/dist/types/build-workspace-ability-callback.type.d.ts +4 -0
  149. package/dist/types/build-workspace-ability-callback.type.js +2 -0
  150. package/dist/types/build-workspace-ability-callback.type.js.map +1 -0
  151. package/dist/types/can-subject-factory.type.d.ts +2 -0
  152. package/dist/types/can-subject-factory.type.js +2 -0
  153. package/dist/types/can-subject-factory.type.js.map +1 -0
  154. package/dist/types/can-subject.type.d.ts +4 -0
  155. package/dist/types/can-subject.type.js +2 -0
  156. package/dist/types/can-subject.type.js.map +1 -0
  157. package/dist/types/route-argument-metadata.type.d.ts +2 -0
  158. package/dist/types/route-argument-metadata.type.js +2 -0
  159. package/dist/types/route-argument-metadata.type.js.map +1 -0
  160. package/dist/user-deletion.service.d.ts +19 -0
  161. package/dist/user-deletion.service.js +103 -0
  162. package/dist/user-deletion.service.js.map +1 -0
  163. package/dist/user.constants.d.ts +7 -0
  164. package/dist/user.constants.js +23 -0
  165. package/dist/user.constants.js.map +1 -0
  166. package/dist/user.service.d.ts +54 -0
  167. package/dist/user.service.js +386 -0
  168. package/dist/user.service.js.map +1 -0
  169. package/dist/utils/append-metadata.util.d.ts +3 -0
  170. package/dist/utils/append-metadata.util.js +12 -0
  171. package/dist/utils/append-metadata.util.js.map +1 -0
  172. package/dist/utils/apply-auth-response-cookies.util.d.ts +1 -0
  173. package/dist/utils/apply-auth-response-cookies.util.js +13 -0
  174. package/dist/utils/apply-auth-response-cookies.util.js.map +1 -0
  175. package/dist/utils/auth-role.util.d.ts +11 -0
  176. package/dist/utils/auth-role.util.js +88 -0
  177. package/dist/utils/auth-role.util.js.map +1 -0
  178. package/dist/utils/can.util.d.ts +3 -0
  179. package/dist/utils/can.util.js +8 -0
  180. package/dist/utils/can.util.js.map +1 -0
  181. package/dist/utils/create-email-and-password-config.d.ts +7 -3
  182. package/dist/utils/create-email-and-password-config.js +22 -1
  183. package/dist/utils/create-email-and-password-config.js.map +1 -1
  184. package/dist/utils/create-email-verification-config.d.ts +7 -0
  185. package/dist/utils/create-email-verification-config.js +14 -0
  186. package/dist/utils/create-email-verification-config.js.map +1 -0
  187. package/dist/utils/create-generic-oauth-config.d.ts +2 -0
  188. package/dist/utils/create-generic-oauth-config.js +15 -0
  189. package/dist/utils/create-generic-oauth-config.js.map +1 -0
  190. package/dist/utils/create-social-provider-config.d.ts +2 -2
  191. package/dist/utils/create-social-provider-config.js +6 -0
  192. package/dist/utils/create-social-provider-config.js.map +1 -1
  193. package/dist/utils/create-social-providers-config.d.ts +2 -2
  194. package/dist/utils/create-social-providers-config.js.map +1 -1
  195. package/dist/utils/create-user-config.d.ts +7 -0
  196. package/dist/utils/create-user-config.js +48 -0
  197. package/dist/utils/create-user-config.js.map +1 -0
  198. package/dist/utils/extract-api-key.util.d.ts +2 -0
  199. package/dist/utils/extract-api-key.util.js +14 -0
  200. package/dist/utils/extract-api-key.util.js.map +1 -0
  201. package/dist/utils/get-user-ability.util.d.ts +2 -0
  202. package/dist/utils/get-user-ability.util.js +11 -0
  203. package/dist/utils/get-user-ability.util.js.map +1 -0
  204. package/dist/utils/get-workspace-ability.util.d.ts +2 -0
  205. package/dist/utils/get-workspace-ability.util.js +11 -0
  206. package/dist/utils/get-workspace-ability.util.js.map +1 -0
  207. package/dist/utils/serialize-ability-rules.util.d.ts +3 -0
  208. package/dist/utils/serialize-ability-rules.util.js +23 -0
  209. package/dist/utils/serialize-ability-rules.util.js.map +1 -0
  210. package/dist/utils/split-auth-providers.d.ts +10 -0
  211. package/dist/utils/split-auth-providers.js +34 -0
  212. package/dist/utils/split-auth-providers.js.map +1 -0
  213. package/dist/utils/user-can.util.d.ts +2 -0
  214. package/dist/utils/user-can.util.js +18 -0
  215. package/dist/utils/user-can.util.js.map +1 -0
  216. package/dist/utils/workspace-can.util.d.ts +2 -0
  217. package/dist/utils/workspace-can.util.js +18 -0
  218. package/dist/utils/workspace-can.util.js.map +1 -0
  219. package/dist/workspace.constants.d.ts +8 -0
  220. package/dist/workspace.constants.js +24 -0
  221. package/dist/workspace.constants.js.map +1 -0
  222. package/dist/workspace.service.d.ts +59 -0
  223. package/dist/workspace.service.js +611 -0
  224. package/dist/workspace.service.js.map +1 -0
  225. package/package.json +26 -14
  226. package/dist/auth.transaction-context.d.ts +0 -10
  227. package/dist/auth.transaction-context.js +0 -22
  228. package/dist/auth.transaction-context.js.map +0 -1
  229. package/dist/utils/assert-no-duplicate-generic-oauth-plugin.d.ts +0 -2
  230. package/dist/utils/assert-no-duplicate-generic-oauth-plugin.js +0 -8
  231. package/dist/utils/assert-no-duplicate-generic-oauth-plugin.js.map +0 -1
@@ -1,1860 +1,27 @@
1
- import { type Auth } from "better-auth";
1
+ import type { AuthAccessToken, AuthAccount, AuthAccountInfo, AuthAccountSelector, AuthProviderUserInfo, AuthRefreshedToken, AuthSocialProvider, AuthUser, ChangeAuthEmailOptions, ChangeAuthPasswordOptions, ChangeAuthPasswordResult, DeleteAuthUserOptions, DeleteAuthUserResult, LinkAuthSocialAccountOptions, LinkAuthSocialAccountResult, RequestPasswordResetOptions, RequestPasswordResetResult, ResetPasswordOptions, SendVerificationEmailOptions, SignInOptions, SignInResult, SignInSocialOptions, SignInSocialResult, SignUpOptions, SignUpResult, UnlinkAuthAccountOptions, UpdateAuthUserOptions } from "./interfaces/auth-service.interface.js";
2
2
  export declare class AuthService {
3
+ constructor(auth: unknown);
3
4
  private readonly auth;
4
- constructor(auth: Auth);
5
- get api(): import("better-auth").InferAPI<{
6
- readonly ok: import("better-auth").StrictEndpoint<"/ok", {
7
- method: "GET";
8
- metadata: {
9
- openapi: {
10
- description: string;
11
- responses: {
12
- "200": {
13
- description: string;
14
- content: {
15
- "application/json": {
16
- schema: {
17
- type: "object";
18
- properties: {
19
- ok: {
20
- type: string;
21
- description: string;
22
- };
23
- };
24
- required: string[];
25
- };
26
- };
27
- };
28
- };
29
- };
30
- };
31
- scope: "server";
32
- };
33
- }, {
34
- ok: boolean;
35
- }>;
36
- readonly error: import("better-auth").StrictEndpoint<"/error", {
37
- method: "GET";
38
- metadata: {
39
- openapi: {
40
- description: string;
41
- responses: {
42
- "200": {
43
- description: string;
44
- content: {
45
- "text/html": {
46
- schema: {
47
- type: "string";
48
- description: string;
49
- };
50
- };
51
- };
52
- };
53
- };
54
- };
55
- scope: "server";
56
- };
57
- }, Response>;
58
- readonly signInSocial: import("better-auth").StrictEndpoint<"/sign-in/social", {
59
- method: "POST";
60
- operationId: string;
61
- body: import("better-auth").ZodObject<{
62
- callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
63
- newUserCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
64
- errorCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
65
- provider: import("better-auth").ZodType<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown, import("better-auth").$ZodTypeInternals<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown>>;
66
- disableRedirect: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
67
- idToken: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
68
- token: import("better-auth").ZodString;
69
- nonce: import("better-auth").ZodOptional<import("better-auth").ZodString>;
70
- accessToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
71
- refreshToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
72
- expiresAt: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
73
- }, import("better-auth").$strip>>;
74
- scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
75
- requestSignUp: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
76
- loginHint: import("better-auth").ZodOptional<import("better-auth").ZodString>;
77
- additionalData: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
78
- }, import("better-auth").$strip>;
79
- metadata: {
80
- $Infer: {
81
- body: import("better-auth").infer<import("better-auth").ZodObject<{
82
- callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
83
- newUserCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
84
- errorCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
85
- provider: import("better-auth").ZodType<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown, import("better-auth").$ZodTypeInternals<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown>>;
86
- disableRedirect: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
87
- idToken: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
88
- token: import("better-auth").ZodString;
89
- nonce: import("better-auth").ZodOptional<import("better-auth").ZodString>;
90
- accessToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
91
- refreshToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
92
- expiresAt: import("better-auth").ZodOptional<import("better-auth").ZodNumber>;
93
- }, import("better-auth").$strip>>;
94
- scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
95
- requestSignUp: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
96
- loginHint: import("better-auth").ZodOptional<import("better-auth").ZodString>;
97
- additionalData: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
98
- }, import("better-auth").$strip>>;
99
- returned: {
100
- redirect: boolean;
101
- token?: string | undefined;
102
- url?: string | undefined;
103
- user?: {
104
- id: string;
105
- createdAt: Date;
106
- updatedAt: Date;
107
- email: string;
108
- emailVerified: boolean;
109
- name: string;
110
- image?: string | null | undefined | undefined;
111
- } | undefined;
112
- };
113
- };
114
- openapi: {
115
- description: string;
116
- operationId: string;
117
- responses: {
118
- "200": {
119
- description: string;
120
- content: {
121
- "application/json": {
122
- schema: {
123
- type: "object";
124
- description: string;
125
- properties: {
126
- token: {
127
- type: string;
128
- };
129
- user: {
130
- type: string;
131
- $ref: string;
132
- };
133
- url: {
134
- type: string;
135
- };
136
- redirect: {
137
- type: string;
138
- enum: boolean[];
139
- };
140
- };
141
- required: string[];
142
- };
143
- };
144
- };
145
- };
146
- };
147
- };
148
- };
149
- }, {
150
- redirect: boolean;
151
- url: string;
152
- } | {
153
- redirect: boolean;
154
- token: string;
155
- url: undefined;
156
- user: {
157
- id: string;
158
- createdAt: Date;
159
- updatedAt: Date;
160
- email: string;
161
- emailVerified: boolean;
162
- name: string;
163
- image?: string | null | undefined | undefined;
164
- };
165
- }>;
166
- readonly callbackOAuth: import("better-auth").StrictEndpoint<"/callback/:id", {
167
- method: ("GET" | "POST")[];
168
- operationId: string;
169
- body: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
170
- code: import("better-auth").ZodOptional<import("better-auth").ZodString>;
171
- error: import("better-auth").ZodOptional<import("better-auth").ZodString>;
172
- device_id: import("better-auth").ZodOptional<import("better-auth").ZodString>;
173
- error_description: import("better-auth").ZodOptional<import("better-auth").ZodString>;
174
- state: import("better-auth").ZodOptional<import("better-auth").ZodString>;
175
- user: import("better-auth").ZodOptional<import("better-auth").ZodString>;
176
- }, import("better-auth").$strip>>;
177
- query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
178
- code: import("better-auth").ZodOptional<import("better-auth").ZodString>;
179
- error: import("better-auth").ZodOptional<import("better-auth").ZodString>;
180
- device_id: import("better-auth").ZodOptional<import("better-auth").ZodString>;
181
- error_description: import("better-auth").ZodOptional<import("better-auth").ZodString>;
182
- state: import("better-auth").ZodOptional<import("better-auth").ZodString>;
183
- user: import("better-auth").ZodOptional<import("better-auth").ZodString>;
184
- }, import("better-auth").$strip>>;
185
- metadata: {
186
- allowedMediaTypes: string[];
187
- scope: "server";
188
- };
189
- }, void>;
190
- readonly getSession: import("better-auth").StrictEndpoint<"/get-session", {
191
- method: "GET";
192
- operationId: string;
193
- query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
194
- disableCookieCache: import("better-auth").ZodOptional<import("better-auth").ZodCoercedBoolean<unknown>>;
195
- disableRefresh: import("better-auth").ZodOptional<import("better-auth").ZodCoercedBoolean<unknown>>;
196
- }, import("better-auth").$strip>>;
197
- requireHeaders: true;
198
- metadata: {
199
- openapi: {
200
- operationId: string;
201
- description: string;
202
- responses: {
203
- "200": {
204
- description: string;
205
- content: {
206
- "application/json": {
207
- schema: {
208
- type: "object";
209
- nullable: boolean;
210
- properties: {
211
- session: {
212
- $ref: string;
213
- };
214
- user: {
215
- $ref: string;
216
- };
217
- };
218
- required: string[];
219
- };
220
- };
221
- };
222
- };
223
- };
224
- };
225
- };
226
- }, {
227
- session: {
228
- id: string;
229
- createdAt: Date;
230
- updatedAt: Date;
231
- userId: string;
232
- expiresAt: Date;
233
- token: string;
234
- ipAddress?: string | null | undefined | undefined;
235
- userAgent?: string | null | undefined | undefined;
236
- };
237
- user: {
238
- id: string;
239
- createdAt: Date;
240
- updatedAt: Date;
241
- email: string;
242
- emailVerified: boolean;
243
- name: string;
244
- image?: string | null | undefined | undefined;
245
- };
246
- } | null>;
247
- readonly signOut: import("better-auth").StrictEndpoint<"/sign-out", {
248
- method: "POST";
249
- operationId: string;
250
- requireHeaders: true;
251
- metadata: {
252
- openapi: {
253
- operationId: string;
254
- description: string;
255
- responses: {
256
- "200": {
257
- description: string;
258
- content: {
259
- "application/json": {
260
- schema: {
261
- type: "object";
262
- properties: {
263
- success: {
264
- type: string;
265
- };
266
- };
267
- };
268
- };
269
- };
270
- };
271
- };
272
- };
273
- };
274
- }, {
275
- success: boolean;
276
- }>;
277
- readonly signUpEmail: import("better-auth").StrictEndpoint<"/sign-up/email", {
278
- method: "POST";
279
- operationId: string;
280
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>)[];
281
- body: import("better-auth").ZodIntersection<import("better-auth").ZodObject<{
282
- name: import("better-auth").ZodString;
283
- email: import("better-auth").ZodEmail;
284
- password: import("better-auth").ZodString;
285
- image: import("better-auth").ZodOptional<import("better-auth").ZodString>;
286
- callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
287
- rememberMe: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
288
- }, import("better-auth").$strip>, import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
289
- metadata: {
290
- allowedMediaTypes: string[];
291
- $Infer: {
292
- body: {
293
- name: string;
294
- email: string;
295
- password: string;
296
- image?: string | undefined;
297
- callbackURL?: string | undefined;
298
- rememberMe?: boolean | undefined;
299
- };
300
- returned: {
301
- token: string | null;
302
- user: {
303
- id: string;
304
- createdAt: Date;
305
- updatedAt: Date;
306
- email: string;
307
- emailVerified: boolean;
308
- name: string;
309
- image?: string | null | undefined | undefined;
310
- };
311
- };
312
- };
313
- openapi: {
314
- operationId: string;
315
- description: string;
316
- requestBody: {
317
- content: {
318
- "application/json": {
319
- schema: {
320
- type: "object";
321
- properties: {
322
- name: {
323
- type: string;
324
- description: string;
325
- };
326
- email: {
327
- type: string;
328
- description: string;
329
- };
330
- password: {
331
- type: string;
332
- description: string;
333
- };
334
- image: {
335
- type: string;
336
- description: string;
337
- };
338
- callbackURL: {
339
- type: string;
340
- description: string;
341
- };
342
- rememberMe: {
343
- type: string;
344
- description: string;
345
- };
346
- };
347
- required: string[];
348
- };
349
- };
350
- };
351
- };
352
- responses: {
353
- "200": {
354
- description: string;
355
- content: {
356
- "application/json": {
357
- schema: {
358
- type: "object";
359
- properties: {
360
- token: {
361
- type: string;
362
- nullable: boolean;
363
- description: string;
364
- };
365
- user: {
366
- type: string;
367
- properties: {
368
- id: {
369
- type: string;
370
- description: string;
371
- };
372
- email: {
373
- type: string;
374
- format: string;
375
- description: string;
376
- };
377
- name: {
378
- type: string;
379
- description: string;
380
- };
381
- image: {
382
- type: string;
383
- format: string;
384
- nullable: boolean;
385
- description: string;
386
- };
387
- emailVerified: {
388
- type: string;
389
- description: string;
390
- };
391
- createdAt: {
392
- type: string;
393
- format: string;
394
- description: string;
395
- };
396
- updatedAt: {
397
- type: string;
398
- format: string;
399
- description: string;
400
- };
401
- };
402
- required: string[];
403
- };
404
- };
405
- required: string[];
406
- };
407
- };
408
- };
409
- };
410
- "422": {
411
- description: string;
412
- content: {
413
- "application/json": {
414
- schema: {
415
- type: "object";
416
- properties: {
417
- message: {
418
- type: string;
419
- };
420
- };
421
- };
422
- };
423
- };
424
- };
425
- };
426
- };
427
- };
428
- }, {
429
- token: null;
430
- user: {
431
- id: string;
432
- createdAt: Date;
433
- updatedAt: Date;
434
- email: string;
435
- emailVerified: boolean;
436
- name: string;
437
- image?: string | null | undefined | undefined;
438
- };
439
- } | {
440
- token: string;
441
- user: {
442
- id: string;
443
- createdAt: Date;
444
- updatedAt: Date;
445
- email: string;
446
- emailVerified: boolean;
447
- name: string;
448
- image?: string | null | undefined | undefined;
449
- };
450
- }>;
451
- readonly signInEmail: import("better-auth").StrictEndpoint<"/sign-in/email", {
452
- method: "POST";
453
- operationId: string;
454
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>)[];
455
- body: import("better-auth").ZodObject<{
456
- email: import("better-auth").ZodString;
457
- password: import("better-auth").ZodString;
458
- callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
459
- rememberMe: import("better-auth").ZodOptional<import("better-auth").ZodDefault<import("better-auth").ZodBoolean>>;
460
- }, import("better-auth").$strip>;
461
- metadata: {
462
- allowedMediaTypes: string[];
463
- $Infer: {
464
- body: {
465
- email: string;
466
- password: string;
467
- callbackURL?: string | undefined;
468
- rememberMe?: boolean | undefined;
469
- };
470
- returned: {
471
- redirect: boolean;
472
- token: string;
473
- url?: string | undefined;
474
- user: {
475
- id: string;
476
- createdAt: Date;
477
- updatedAt: Date;
478
- email: string;
479
- emailVerified: boolean;
480
- name: string;
481
- image?: string | null | undefined | undefined;
482
- };
483
- };
484
- };
485
- openapi: {
486
- operationId: string;
487
- description: string;
488
- responses: {
489
- "200": {
490
- description: string;
491
- content: {
492
- "application/json": {
493
- schema: {
494
- type: "object";
495
- description: string;
496
- properties: {
497
- redirect: {
498
- type: string;
499
- enum: boolean[];
500
- };
501
- token: {
502
- type: string;
503
- description: string;
504
- };
505
- url: {
506
- type: string;
507
- nullable: boolean;
508
- };
509
- user: {
510
- type: string;
511
- $ref: string;
512
- };
513
- };
514
- required: string[];
515
- };
516
- };
517
- };
518
- };
519
- };
520
- };
521
- };
522
- }, {
523
- redirect: boolean;
524
- token: string;
525
- url?: string | undefined;
526
- user: {
527
- id: string;
528
- createdAt: Date;
529
- updatedAt: Date;
530
- email: string;
531
- emailVerified: boolean;
532
- name: string;
533
- image?: string | null | undefined | undefined;
534
- };
535
- }>;
536
- readonly resetPassword: import("better-auth").StrictEndpoint<"/reset-password", {
537
- method: "POST";
538
- operationId: string;
539
- query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
540
- token: import("better-auth").ZodOptional<import("better-auth").ZodString>;
541
- }, import("better-auth").$strip>>;
542
- body: import("better-auth").ZodObject<{
543
- newPassword: import("better-auth").ZodString;
544
- token: import("better-auth").ZodOptional<import("better-auth").ZodString>;
545
- }, import("better-auth").$strip>;
546
- metadata: {
547
- openapi: {
548
- operationId: string;
549
- description: string;
550
- responses: {
551
- "200": {
552
- description: string;
553
- content: {
554
- "application/json": {
555
- schema: {
556
- type: "object";
557
- properties: {
558
- status: {
559
- type: string;
560
- };
561
- };
562
- };
563
- };
564
- };
565
- };
566
- };
567
- };
568
- };
569
- }, {
570
- status: boolean;
571
- }>;
572
- readonly verifyEmail: import("better-auth").StrictEndpoint<"/verify-email", {
573
- method: "GET";
574
- operationId: string;
575
- query: import("better-auth").ZodObject<{
576
- token: import("better-auth").ZodString;
577
- callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
578
- }, import("better-auth").$strip>;
579
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>)[];
580
- metadata: {
581
- openapi: {
582
- description: string;
583
- parameters: ({
584
- name: string;
585
- in: "query";
586
- description: string;
587
- required: true;
588
- schema: {
589
- type: "string";
590
- };
591
- } | {
592
- name: string;
593
- in: "query";
594
- description: string;
595
- required: false;
596
- schema: {
597
- type: "string";
598
- };
599
- })[];
600
- responses: {
601
- "200": {
602
- description: string;
603
- content: {
604
- "application/json": {
605
- schema: {
606
- type: "object";
607
- properties: {
608
- user: {
609
- type: string;
610
- $ref: string;
611
- };
612
- status: {
613
- type: string;
614
- description: string;
615
- };
616
- };
617
- required: string[];
618
- };
619
- };
620
- };
621
- };
622
- };
623
- };
624
- };
625
- }, void | {
626
- status: boolean;
627
- }>;
628
- readonly sendVerificationEmail: import("better-auth").StrictEndpoint<"/send-verification-email", {
629
- method: "POST";
630
- operationId: string;
631
- body: import("better-auth").ZodObject<{
632
- email: import("better-auth").ZodEmail;
633
- callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
634
- }, import("better-auth").$strip>;
635
- metadata: {
636
- openapi: {
637
- operationId: string;
638
- description: string;
639
- requestBody: {
640
- content: {
641
- "application/json": {
642
- schema: {
643
- type: "object";
644
- properties: {
645
- email: {
646
- type: string;
647
- description: string;
648
- example: string;
649
- };
650
- callbackURL: {
651
- type: string;
652
- description: string;
653
- example: string;
654
- nullable: boolean;
655
- };
656
- };
657
- required: string[];
658
- };
659
- };
660
- };
661
- };
662
- responses: {
663
- "200": {
664
- description: string;
665
- content: {
666
- "application/json": {
667
- schema: {
668
- type: "object";
669
- properties: {
670
- status: {
671
- type: string;
672
- description: string;
673
- example: boolean;
674
- };
675
- };
676
- };
677
- };
678
- };
679
- };
680
- "400": {
681
- description: string;
682
- content: {
683
- "application/json": {
684
- schema: {
685
- type: "object";
686
- properties: {
687
- message: {
688
- type: string;
689
- description: string;
690
- example: string;
691
- };
692
- };
693
- };
694
- };
695
- };
696
- };
697
- };
698
- };
699
- };
700
- }, {
701
- status: boolean;
702
- }>;
703
- readonly changeEmail: import("better-auth").StrictEndpoint<"/change-email", {
704
- method: "POST";
705
- body: import("better-auth").ZodObject<{
706
- newEmail: import("better-auth").ZodEmail;
707
- callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
708
- }, import("better-auth").$strip>;
709
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
710
- session: {
711
- session: Record<string, any> & {
712
- id: string;
713
- createdAt: Date;
714
- updatedAt: Date;
715
- userId: string;
716
- expiresAt: Date;
717
- token: string;
718
- ipAddress?: string | null | undefined;
719
- userAgent?: string | null | undefined;
720
- };
721
- user: Record<string, any> & {
722
- id: string;
723
- createdAt: Date;
724
- updatedAt: Date;
725
- email: string;
726
- emailVerified: boolean;
727
- name: string;
728
- image?: string | null | undefined;
729
- };
730
- };
731
- }>)[];
732
- metadata: {
733
- openapi: {
734
- operationId: string;
735
- responses: {
736
- "200": {
737
- description: string;
738
- content: {
739
- "application/json": {
740
- schema: {
741
- type: "object";
742
- properties: {
743
- user: {
744
- type: string;
745
- $ref: string;
746
- };
747
- status: {
748
- type: string;
749
- description: string;
750
- };
751
- message: {
752
- type: string;
753
- enum: string[];
754
- description: string;
755
- nullable: boolean;
756
- };
757
- };
758
- required: string[];
759
- };
760
- };
761
- };
762
- };
763
- "422": {
764
- description: string;
765
- content: {
766
- "application/json": {
767
- schema: {
768
- type: "object";
769
- properties: {
770
- message: {
771
- type: string;
772
- };
773
- };
774
- };
775
- };
776
- };
777
- };
778
- };
779
- };
780
- };
781
- }, {
782
- status: boolean;
783
- }>;
784
- readonly changePassword: import("better-auth").StrictEndpoint<"/change-password", {
785
- method: "POST";
786
- operationId: string;
787
- body: import("better-auth").ZodObject<{
788
- newPassword: import("better-auth").ZodString;
789
- currentPassword: import("better-auth").ZodString;
790
- revokeOtherSessions: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
791
- }, import("better-auth").$strip>;
792
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
793
- session: {
794
- session: Record<string, any> & {
795
- id: string;
796
- createdAt: Date;
797
- updatedAt: Date;
798
- userId: string;
799
- expiresAt: Date;
800
- token: string;
801
- ipAddress?: string | null | undefined;
802
- userAgent?: string | null | undefined;
803
- };
804
- user: Record<string, any> & {
805
- id: string;
806
- createdAt: Date;
807
- updatedAt: Date;
808
- email: string;
809
- emailVerified: boolean;
810
- name: string;
811
- image?: string | null | undefined;
812
- };
813
- };
814
- }>)[];
815
- metadata: {
816
- openapi: {
817
- operationId: string;
818
- description: string;
819
- responses: {
820
- "200": {
821
- description: string;
822
- content: {
823
- "application/json": {
824
- schema: {
825
- type: "object";
826
- properties: {
827
- token: {
828
- type: string;
829
- nullable: boolean;
830
- description: string;
831
- };
832
- user: {
833
- type: string;
834
- properties: {
835
- id: {
836
- type: string;
837
- description: string;
838
- };
839
- email: {
840
- type: string;
841
- format: string;
842
- description: string;
843
- };
844
- name: {
845
- type: string;
846
- description: string;
847
- };
848
- image: {
849
- type: string;
850
- format: string;
851
- nullable: boolean;
852
- description: string;
853
- };
854
- emailVerified: {
855
- type: string;
856
- description: string;
857
- };
858
- createdAt: {
859
- type: string;
860
- format: string;
861
- description: string;
862
- };
863
- updatedAt: {
864
- type: string;
865
- format: string;
866
- description: string;
867
- };
868
- };
869
- required: string[];
870
- };
871
- };
872
- required: string[];
873
- };
874
- };
875
- };
876
- };
877
- };
878
- };
879
- };
880
- }, {
881
- token: string | null;
882
- user: {
883
- id: string;
884
- email: string;
885
- name: string;
886
- image: string | null | undefined;
887
- emailVerified: boolean;
888
- createdAt: Date;
889
- updatedAt: Date;
890
- };
891
- }>;
892
- readonly setPassword: import("better-auth").StrictEndpoint<string, {
893
- method: "POST";
894
- body: import("better-auth").ZodObject<{
895
- newPassword: import("better-auth").ZodString;
896
- }, import("better-auth").$strip>;
897
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
898
- session: {
899
- session: Record<string, any> & {
900
- id: string;
901
- createdAt: Date;
902
- updatedAt: Date;
903
- userId: string;
904
- expiresAt: Date;
905
- token: string;
906
- ipAddress?: string | null | undefined;
907
- userAgent?: string | null | undefined;
908
- };
909
- user: Record<string, any> & {
910
- id: string;
911
- createdAt: Date;
912
- updatedAt: Date;
913
- email: string;
914
- emailVerified: boolean;
915
- name: string;
916
- image?: string | null | undefined;
917
- };
918
- };
919
- }>)[];
920
- }, {
921
- status: boolean;
922
- }>;
923
- readonly updateUser: import("better-auth").StrictEndpoint<"/update-user", {
924
- method: "POST";
925
- operationId: string;
926
- body: import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>;
927
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
928
- session: {
929
- session: Record<string, any> & {
930
- id: string;
931
- createdAt: Date;
932
- updatedAt: Date;
933
- userId: string;
934
- expiresAt: Date;
935
- token: string;
936
- ipAddress?: string | null | undefined;
937
- userAgent?: string | null | undefined;
938
- };
939
- user: Record<string, any> & {
940
- id: string;
941
- createdAt: Date;
942
- updatedAt: Date;
943
- email: string;
944
- emailVerified: boolean;
945
- name: string;
946
- image?: string | null | undefined;
947
- };
948
- };
949
- }>)[];
950
- metadata: {
951
- $Infer: {
952
- body: Partial<{}> & {
953
- name?: string | undefined;
954
- image?: string | undefined | null;
955
- };
956
- };
957
- openapi: {
958
- operationId: string;
959
- description: string;
960
- requestBody: {
961
- content: {
962
- "application/json": {
963
- schema: {
964
- type: "object";
965
- properties: {
966
- name: {
967
- type: string;
968
- description: string;
969
- };
970
- image: {
971
- type: string;
972
- description: string;
973
- nullable: boolean;
974
- };
975
- };
976
- };
977
- };
978
- };
979
- };
980
- responses: {
981
- "200": {
982
- description: string;
983
- content: {
984
- "application/json": {
985
- schema: {
986
- type: "object";
987
- properties: {
988
- user: {
989
- type: string;
990
- $ref: string;
991
- };
992
- };
993
- };
994
- };
995
- };
996
- };
997
- };
998
- };
999
- };
1000
- }, {
1001
- status: boolean;
1002
- }>;
1003
- readonly deleteUser: import("better-auth").StrictEndpoint<"/delete-user", {
1004
- method: "POST";
1005
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1006
- session: {
1007
- session: Record<string, any> & {
1008
- id: string;
1009
- createdAt: Date;
1010
- updatedAt: Date;
1011
- userId: string;
1012
- expiresAt: Date;
1013
- token: string;
1014
- ipAddress?: string | null | undefined;
1015
- userAgent?: string | null | undefined;
1016
- };
1017
- user: Record<string, any> & {
1018
- id: string;
1019
- createdAt: Date;
1020
- updatedAt: Date;
1021
- email: string;
1022
- emailVerified: boolean;
1023
- name: string;
1024
- image?: string | null | undefined;
1025
- };
1026
- };
1027
- }>)[];
1028
- body: import("better-auth").ZodObject<{
1029
- callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1030
- password: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1031
- token: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1032
- }, import("better-auth").$strip>;
1033
- metadata: {
1034
- openapi: {
1035
- operationId: string;
1036
- description: string;
1037
- requestBody: {
1038
- content: {
1039
- "application/json": {
1040
- schema: {
1041
- type: "object";
1042
- properties: {
1043
- callbackURL: {
1044
- type: string;
1045
- description: string;
1046
- };
1047
- password: {
1048
- type: string;
1049
- description: string;
1050
- };
1051
- token: {
1052
- type: string;
1053
- description: string;
1054
- };
1055
- };
1056
- };
1057
- };
1058
- };
1059
- };
1060
- responses: {
1061
- "200": {
1062
- description: string;
1063
- content: {
1064
- "application/json": {
1065
- schema: {
1066
- type: "object";
1067
- properties: {
1068
- success: {
1069
- type: string;
1070
- description: string;
1071
- };
1072
- message: {
1073
- type: string;
1074
- enum: string[];
1075
- description: string;
1076
- };
1077
- };
1078
- required: string[];
1079
- };
1080
- };
1081
- };
1082
- };
1083
- };
1084
- };
1085
- };
1086
- }, {
1087
- success: boolean;
1088
- message: string;
1089
- }>;
1090
- readonly requestPasswordReset: import("better-auth").StrictEndpoint<"/request-password-reset", {
1091
- method: "POST";
1092
- body: import("better-auth").ZodObject<{
1093
- email: import("better-auth").ZodEmail;
1094
- redirectTo: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1095
- }, import("better-auth").$strip>;
1096
- metadata: {
1097
- openapi: {
1098
- operationId: string;
1099
- description: string;
1100
- responses: {
1101
- "200": {
1102
- description: string;
1103
- content: {
1104
- "application/json": {
1105
- schema: {
1106
- type: "object";
1107
- properties: {
1108
- status: {
1109
- type: string;
1110
- };
1111
- message: {
1112
- type: string;
1113
- };
1114
- };
1115
- };
1116
- };
1117
- };
1118
- };
1119
- };
1120
- };
1121
- };
1122
- }, {
1123
- status: boolean;
1124
- message: string;
1125
- }>;
1126
- readonly requestPasswordResetCallback: import("better-auth").StrictEndpoint<"/reset-password/:token", {
1127
- method: "GET";
1128
- operationId: string;
1129
- query: import("better-auth").ZodObject<{
1130
- callbackURL: import("better-auth").ZodString;
1131
- }, import("better-auth").$strip>;
1132
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>)[];
1133
- metadata: {
1134
- openapi: {
1135
- operationId: string;
1136
- description: string;
1137
- parameters: ({
1138
- name: string;
1139
- in: "path";
1140
- required: true;
1141
- description: string;
1142
- schema: {
1143
- type: "string";
1144
- };
1145
- } | {
1146
- name: string;
1147
- in: "query";
1148
- required: true;
1149
- description: string;
1150
- schema: {
1151
- type: "string";
1152
- };
1153
- })[];
1154
- responses: {
1155
- "200": {
1156
- description: string;
1157
- content: {
1158
- "application/json": {
1159
- schema: {
1160
- type: "object";
1161
- properties: {
1162
- token: {
1163
- type: string;
1164
- };
1165
- };
1166
- };
1167
- };
1168
- };
1169
- };
1170
- };
1171
- };
1172
- };
1173
- }, never>;
1174
- readonly listSessions: import("better-auth").StrictEndpoint<"/list-sessions", {
1175
- method: "GET";
1176
- operationId: string;
1177
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1178
- session: {
1179
- session: Record<string, any> & {
1180
- id: string;
1181
- createdAt: Date;
1182
- updatedAt: Date;
1183
- userId: string;
1184
- expiresAt: Date;
1185
- token: string;
1186
- ipAddress?: string | null | undefined;
1187
- userAgent?: string | null | undefined;
1188
- };
1189
- user: Record<string, any> & {
1190
- id: string;
1191
- createdAt: Date;
1192
- updatedAt: Date;
1193
- email: string;
1194
- emailVerified: boolean;
1195
- name: string;
1196
- image?: string | null | undefined;
1197
- };
1198
- };
1199
- }>)[];
1200
- requireHeaders: true;
1201
- metadata: {
1202
- openapi: {
1203
- operationId: string;
1204
- description: string;
1205
- responses: {
1206
- "200": {
1207
- description: string;
1208
- content: {
1209
- "application/json": {
1210
- schema: {
1211
- type: "array";
1212
- items: {
1213
- $ref: string;
1214
- };
1215
- };
1216
- };
1217
- };
1218
- };
1219
- };
1220
- };
1221
- };
1222
- }, import("better-auth").Prettify<{
1223
- id: string;
1224
- createdAt: Date;
1225
- updatedAt: Date;
1226
- userId: string;
1227
- expiresAt: Date;
1228
- token: string;
1229
- ipAddress?: string | null | undefined | undefined;
1230
- userAgent?: string | null | undefined | undefined;
1231
- }>[]>;
1232
- readonly revokeSession: import("better-auth").StrictEndpoint<"/revoke-session", {
1233
- method: "POST";
1234
- body: import("better-auth").ZodObject<{
1235
- token: import("better-auth").ZodString;
1236
- }, import("better-auth").$strip>;
1237
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1238
- session: {
1239
- session: Record<string, any> & {
1240
- id: string;
1241
- createdAt: Date;
1242
- updatedAt: Date;
1243
- userId: string;
1244
- expiresAt: Date;
1245
- token: string;
1246
- ipAddress?: string | null | undefined;
1247
- userAgent?: string | null | undefined;
1248
- };
1249
- user: Record<string, any> & {
1250
- id: string;
1251
- createdAt: Date;
1252
- updatedAt: Date;
1253
- email: string;
1254
- emailVerified: boolean;
1255
- name: string;
1256
- image?: string | null | undefined;
1257
- };
1258
- };
1259
- }>)[];
1260
- requireHeaders: true;
1261
- metadata: {
1262
- openapi: {
1263
- description: string;
1264
- requestBody: {
1265
- content: {
1266
- "application/json": {
1267
- schema: {
1268
- type: "object";
1269
- properties: {
1270
- token: {
1271
- type: string;
1272
- description: string;
1273
- };
1274
- };
1275
- required: string[];
1276
- };
1277
- };
1278
- };
1279
- };
1280
- responses: {
1281
- "200": {
1282
- description: string;
1283
- content: {
1284
- "application/json": {
1285
- schema: {
1286
- type: "object";
1287
- properties: {
1288
- status: {
1289
- type: string;
1290
- description: string;
1291
- };
1292
- };
1293
- required: string[];
1294
- };
1295
- };
1296
- };
1297
- };
1298
- };
1299
- };
1300
- };
1301
- }, {
1302
- status: boolean;
1303
- }>;
1304
- readonly revokeSessions: import("better-auth").StrictEndpoint<"/revoke-sessions", {
1305
- method: "POST";
1306
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1307
- session: {
1308
- session: Record<string, any> & {
1309
- id: string;
1310
- createdAt: Date;
1311
- updatedAt: Date;
1312
- userId: string;
1313
- expiresAt: Date;
1314
- token: string;
1315
- ipAddress?: string | null | undefined;
1316
- userAgent?: string | null | undefined;
1317
- };
1318
- user: Record<string, any> & {
1319
- id: string;
1320
- createdAt: Date;
1321
- updatedAt: Date;
1322
- email: string;
1323
- emailVerified: boolean;
1324
- name: string;
1325
- image?: string | null | undefined;
1326
- };
1327
- };
1328
- }>)[];
1329
- requireHeaders: true;
1330
- metadata: {
1331
- openapi: {
1332
- description: string;
1333
- responses: {
1334
- "200": {
1335
- description: string;
1336
- content: {
1337
- "application/json": {
1338
- schema: {
1339
- type: "object";
1340
- properties: {
1341
- status: {
1342
- type: string;
1343
- description: string;
1344
- };
1345
- };
1346
- required: string[];
1347
- };
1348
- };
1349
- };
1350
- };
1351
- };
1352
- };
1353
- };
1354
- }, {
1355
- status: boolean;
1356
- }>;
1357
- readonly revokeOtherSessions: import("better-auth").StrictEndpoint<"/revoke-other-sessions", {
1358
- method: "POST";
1359
- requireHeaders: true;
1360
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1361
- session: {
1362
- session: Record<string, any> & {
1363
- id: string;
1364
- createdAt: Date;
1365
- updatedAt: Date;
1366
- userId: string;
1367
- expiresAt: Date;
1368
- token: string;
1369
- ipAddress?: string | null | undefined;
1370
- userAgent?: string | null | undefined;
1371
- };
1372
- user: Record<string, any> & {
1373
- id: string;
1374
- createdAt: Date;
1375
- updatedAt: Date;
1376
- email: string;
1377
- emailVerified: boolean;
1378
- name: string;
1379
- image?: string | null | undefined;
1380
- };
1381
- };
1382
- }>)[];
1383
- metadata: {
1384
- openapi: {
1385
- description: string;
1386
- responses: {
1387
- "200": {
1388
- description: string;
1389
- content: {
1390
- "application/json": {
1391
- schema: {
1392
- type: "object";
1393
- properties: {
1394
- status: {
1395
- type: string;
1396
- description: string;
1397
- };
1398
- };
1399
- required: string[];
1400
- };
1401
- };
1402
- };
1403
- };
1404
- };
1405
- };
1406
- };
1407
- }, {
1408
- status: boolean;
1409
- }>;
1410
- readonly linkSocialAccount: import("better-auth").StrictEndpoint<"/link-social", {
1411
- method: "POST";
1412
- requireHeaders: true;
1413
- body: import("better-auth").ZodObject<{
1414
- callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1415
- provider: import("better-auth").ZodType<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown, import("better-auth").$ZodTypeInternals<"github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "vercel" | (string & {}), unknown>>;
1416
- idToken: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
1417
- token: import("better-auth").ZodString;
1418
- nonce: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1419
- accessToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1420
- refreshToken: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1421
- scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
1422
- }, import("better-auth").$strip>>;
1423
- requestSignUp: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
1424
- scopes: import("better-auth").ZodOptional<import("better-auth").ZodArray<import("better-auth").ZodString>>;
1425
- errorCallbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1426
- disableRedirect: import("better-auth").ZodOptional<import("better-auth").ZodBoolean>;
1427
- additionalData: import("better-auth").ZodOptional<import("better-auth").ZodRecord<import("better-auth").ZodString, import("better-auth").ZodAny>>;
1428
- }, import("better-auth").$strip>;
1429
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1430
- session: {
1431
- session: Record<string, any> & {
1432
- id: string;
1433
- createdAt: Date;
1434
- updatedAt: Date;
1435
- userId: string;
1436
- expiresAt: Date;
1437
- token: string;
1438
- ipAddress?: string | null | undefined;
1439
- userAgent?: string | null | undefined;
1440
- };
1441
- user: Record<string, any> & {
1442
- id: string;
1443
- createdAt: Date;
1444
- updatedAt: Date;
1445
- email: string;
1446
- emailVerified: boolean;
1447
- name: string;
1448
- image?: string | null | undefined;
1449
- };
1450
- };
1451
- }>)[];
1452
- metadata: {
1453
- openapi: {
1454
- description: string;
1455
- operationId: string;
1456
- responses: {
1457
- "200": {
1458
- description: string;
1459
- content: {
1460
- "application/json": {
1461
- schema: {
1462
- type: "object";
1463
- properties: {
1464
- url: {
1465
- type: string;
1466
- description: string;
1467
- };
1468
- redirect: {
1469
- type: string;
1470
- description: string;
1471
- };
1472
- status: {
1473
- type: string;
1474
- };
1475
- };
1476
- required: string[];
1477
- };
1478
- };
1479
- };
1480
- };
1481
- };
1482
- };
1483
- };
1484
- }, {
1485
- url: string;
1486
- redirect: boolean;
1487
- }>;
1488
- readonly listUserAccounts: import("better-auth").StrictEndpoint<"/list-accounts", {
1489
- method: "GET";
1490
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1491
- session: {
1492
- session: Record<string, any> & {
1493
- id: string;
1494
- createdAt: Date;
1495
- updatedAt: Date;
1496
- userId: string;
1497
- expiresAt: Date;
1498
- token: string;
1499
- ipAddress?: string | null | undefined;
1500
- userAgent?: string | null | undefined;
1501
- };
1502
- user: Record<string, any> & {
1503
- id: string;
1504
- createdAt: Date;
1505
- updatedAt: Date;
1506
- email: string;
1507
- emailVerified: boolean;
1508
- name: string;
1509
- image?: string | null | undefined;
1510
- };
1511
- };
1512
- }>)[];
1513
- metadata: {
1514
- openapi: {
1515
- operationId: string;
1516
- description: string;
1517
- responses: {
1518
- "200": {
1519
- description: string;
1520
- content: {
1521
- "application/json": {
1522
- schema: {
1523
- type: "array";
1524
- items: {
1525
- type: string;
1526
- properties: {
1527
- id: {
1528
- type: string;
1529
- };
1530
- providerId: {
1531
- type: string;
1532
- };
1533
- createdAt: {
1534
- type: string;
1535
- format: string;
1536
- };
1537
- updatedAt: {
1538
- type: string;
1539
- format: string;
1540
- };
1541
- accountId: {
1542
- type: string;
1543
- };
1544
- userId: {
1545
- type: string;
1546
- };
1547
- scopes: {
1548
- type: string;
1549
- items: {
1550
- type: string;
1551
- };
1552
- };
1553
- };
1554
- required: string[];
1555
- };
1556
- };
1557
- };
1558
- };
1559
- };
1560
- };
1561
- };
1562
- };
1563
- }, {
1564
- id: string;
1565
- providerId: string;
1566
- createdAt: Date;
1567
- updatedAt: Date;
1568
- accountId: string;
1569
- userId: string;
1570
- scopes: string[];
1571
- }[]>;
1572
- readonly deleteUserCallback: import("better-auth").StrictEndpoint<"/delete-user/callback", {
1573
- method: "GET";
1574
- query: import("better-auth").ZodObject<{
1575
- token: import("better-auth").ZodString;
1576
- callbackURL: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1577
- }, import("better-auth").$strip>;
1578
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>)[];
1579
- metadata: {
1580
- openapi: {
1581
- description: string;
1582
- responses: {
1583
- "200": {
1584
- description: string;
1585
- content: {
1586
- "application/json": {
1587
- schema: {
1588
- type: "object";
1589
- properties: {
1590
- success: {
1591
- type: string;
1592
- description: string;
1593
- };
1594
- message: {
1595
- type: string;
1596
- enum: string[];
1597
- description: string;
1598
- };
1599
- };
1600
- required: string[];
1601
- };
1602
- };
1603
- };
1604
- };
1605
- };
1606
- };
1607
- };
1608
- }, {
1609
- success: boolean;
1610
- message: string;
1611
- }>;
1612
- readonly unlinkAccount: import("better-auth").StrictEndpoint<"/unlink-account", {
1613
- method: "POST";
1614
- body: import("better-auth").ZodObject<{
1615
- providerId: import("better-auth").ZodString;
1616
- accountId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1617
- }, import("better-auth").$strip>;
1618
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1619
- session: {
1620
- session: Record<string, any> & {
1621
- id: string;
1622
- createdAt: Date;
1623
- updatedAt: Date;
1624
- userId: string;
1625
- expiresAt: Date;
1626
- token: string;
1627
- ipAddress?: string | null | undefined;
1628
- userAgent?: string | null | undefined;
1629
- };
1630
- user: Record<string, any> & {
1631
- id: string;
1632
- createdAt: Date;
1633
- updatedAt: Date;
1634
- email: string;
1635
- emailVerified: boolean;
1636
- name: string;
1637
- image?: string | null | undefined;
1638
- };
1639
- };
1640
- }>)[];
1641
- metadata: {
1642
- openapi: {
1643
- description: string;
1644
- responses: {
1645
- "200": {
1646
- description: string;
1647
- content: {
1648
- "application/json": {
1649
- schema: {
1650
- type: "object";
1651
- properties: {
1652
- status: {
1653
- type: string;
1654
- };
1655
- };
1656
- };
1657
- };
1658
- };
1659
- };
1660
- };
1661
- };
1662
- };
1663
- }, {
1664
- status: boolean;
1665
- }>;
1666
- readonly refreshToken: import("better-auth").StrictEndpoint<"/refresh-token", {
1667
- method: "POST";
1668
- body: import("better-auth").ZodObject<{
1669
- providerId: import("better-auth").ZodString;
1670
- accountId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1671
- userId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1672
- }, import("better-auth").$strip>;
1673
- metadata: {
1674
- openapi: {
1675
- description: string;
1676
- responses: {
1677
- 200: {
1678
- description: string;
1679
- content: {
1680
- "application/json": {
1681
- schema: {
1682
- type: "object";
1683
- properties: {
1684
- tokenType: {
1685
- type: string;
1686
- };
1687
- idToken: {
1688
- type: string;
1689
- };
1690
- accessToken: {
1691
- type: string;
1692
- };
1693
- refreshToken: {
1694
- type: string;
1695
- };
1696
- accessTokenExpiresAt: {
1697
- type: string;
1698
- format: string;
1699
- };
1700
- refreshTokenExpiresAt: {
1701
- type: string;
1702
- format: string;
1703
- };
1704
- };
1705
- };
1706
- };
1707
- };
1708
- };
1709
- 400: {
1710
- description: string;
1711
- };
1712
- };
1713
- };
1714
- };
1715
- }, {
1716
- accessToken: string | undefined;
1717
- refreshToken: string | undefined;
1718
- accessTokenExpiresAt: Date | undefined;
1719
- refreshTokenExpiresAt: Date | undefined;
1720
- scope: string | null | undefined;
1721
- idToken: string | null | undefined;
1722
- providerId: string;
1723
- accountId: string;
1724
- }>;
1725
- readonly getAccessToken: import("better-auth").StrictEndpoint<"/get-access-token", {
1726
- method: "POST";
1727
- body: import("better-auth").ZodObject<{
1728
- providerId: import("better-auth").ZodString;
1729
- accountId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1730
- userId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1731
- }, import("better-auth").$strip>;
1732
- metadata: {
1733
- openapi: {
1734
- description: string;
1735
- responses: {
1736
- 200: {
1737
- description: string;
1738
- content: {
1739
- "application/json": {
1740
- schema: {
1741
- type: "object";
1742
- properties: {
1743
- tokenType: {
1744
- type: string;
1745
- };
1746
- idToken: {
1747
- type: string;
1748
- };
1749
- accessToken: {
1750
- type: string;
1751
- };
1752
- refreshToken: {
1753
- type: string;
1754
- };
1755
- accessTokenExpiresAt: {
1756
- type: string;
1757
- format: string;
1758
- };
1759
- refreshTokenExpiresAt: {
1760
- type: string;
1761
- format: string;
1762
- };
1763
- };
1764
- };
1765
- };
1766
- };
1767
- };
1768
- 400: {
1769
- description: string;
1770
- };
1771
- };
1772
- };
1773
- };
1774
- }, {
1775
- accessToken: string;
1776
- accessTokenExpiresAt: Date | undefined;
1777
- scopes: string[];
1778
- idToken: string | undefined;
1779
- }>;
1780
- readonly accountInfo: import("better-auth").StrictEndpoint<"/account-info", {
1781
- method: "GET";
1782
- use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1783
- session: {
1784
- session: Record<string, any> & {
1785
- id: string;
1786
- createdAt: Date;
1787
- updatedAt: Date;
1788
- userId: string;
1789
- expiresAt: Date;
1790
- token: string;
1791
- ipAddress?: string | null | undefined;
1792
- userAgent?: string | null | undefined;
1793
- };
1794
- user: Record<string, any> & {
1795
- id: string;
1796
- createdAt: Date;
1797
- updatedAt: Date;
1798
- email: string;
1799
- emailVerified: boolean;
1800
- name: string;
1801
- image?: string | null | undefined;
1802
- };
1803
- };
1804
- }>)[];
1805
- metadata: {
1806
- openapi: {
1807
- description: string;
1808
- responses: {
1809
- "200": {
1810
- description: string;
1811
- content: {
1812
- "application/json": {
1813
- schema: {
1814
- type: "object";
1815
- properties: {
1816
- user: {
1817
- type: string;
1818
- properties: {
1819
- id: {
1820
- type: string;
1821
- };
1822
- name: {
1823
- type: string;
1824
- };
1825
- email: {
1826
- type: string;
1827
- };
1828
- image: {
1829
- type: string;
1830
- };
1831
- emailVerified: {
1832
- type: string;
1833
- };
1834
- };
1835
- required: string[];
1836
- };
1837
- data: {
1838
- type: string;
1839
- properties: {};
1840
- additionalProperties: boolean;
1841
- };
1842
- };
1843
- required: string[];
1844
- additionalProperties: boolean;
1845
- };
1846
- };
1847
- };
1848
- };
1849
- };
1850
- };
1851
- };
1852
- query: import("better-auth").ZodOptional<import("better-auth").ZodObject<{
1853
- accountId: import("better-auth").ZodOptional<import("better-auth").ZodString>;
1854
- }, import("better-auth").$strip>>;
1855
- }, {
1856
- user: import("better-auth").OAuth2UserInfo;
1857
- data: Record<string, any>;
1858
- } | null>;
1859
- }>;
5
+ listSocialProviders(): Promise<AuthSocialProvider[]>;
6
+ signUp<User extends AuthUser = AuthUser>(options: SignUpOptions): Promise<SignUpResult<User>>;
7
+ signIn<User extends AuthUser = AuthUser>(options: SignInOptions): Promise<SignInResult<User>>;
8
+ signInSocial<User extends AuthUser = AuthUser>(options: SignInSocialOptions): Promise<SignInSocialResult<User>>;
9
+ signOut(): Promise<boolean>;
10
+ sendVerificationEmail(options: SendVerificationEmailOptions): Promise<boolean>;
11
+ requestPasswordReset(options: RequestPasswordResetOptions): Promise<RequestPasswordResetResult>;
12
+ resetPassword(options: ResetPasswordOptions): Promise<boolean>;
13
+ verifyPassword(password: string): Promise<boolean>;
14
+ updateUser(options: UpdateAuthUserOptions): Promise<boolean>;
15
+ changeEmail(options: ChangeAuthEmailOptions): Promise<boolean>;
16
+ changePassword(options: ChangeAuthPasswordOptions): Promise<ChangeAuthPasswordResult>;
17
+ setPassword(newPassword: string): Promise<boolean>;
18
+ deleteUser(options?: DeleteAuthUserOptions): Promise<DeleteAuthUserResult>;
19
+ listAccounts(): Promise<AuthAccount[]>;
20
+ linkSocialAccount(options: LinkAuthSocialAccountOptions): Promise<LinkAuthSocialAccountResult>;
21
+ unlinkAccount(options: UnlinkAuthAccountOptions): Promise<boolean>;
22
+ getAccessToken(selector: AuthAccountSelector): Promise<AuthAccessToken>;
23
+ refreshToken(selector: AuthAccountSelector): Promise<AuthRefreshedToken>;
24
+ accountInfo<UserInfo extends AuthProviderUserInfo = AuthProviderUserInfo, Data extends object = Record<string, unknown>>(selector: AuthAccountSelector): Promise<AuthAccountInfo<UserInfo, Data>>;
25
+ private normalizeSignInResult;
26
+ private normalizeSignInSocialResult;
1860
27
  }