@rolder/kit 3.0.0-alpha.11 → 3.0.0-alpha.111

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 (299) hide show
  1. package/dist/ai/index.d.ts +2 -0
  2. package/dist/ai/index.js +2 -0
  3. package/dist/ai/ui/chat/Root.d.ts +55 -0
  4. package/dist/ai/ui/chat/Root.js +18 -0
  5. package/dist/ai/ui/chat/chatInput/File.js +71 -0
  6. package/dist/ai/ui/chat/chatInput/FileIcon.js +43 -0
  7. package/dist/ai/ui/chat/chatInput/Root.d.ts +9 -0
  8. package/dist/ai/ui/chat/chatInput/Root.js +24 -0
  9. package/dist/ai/ui/chat/chatInput/Submit.js +23 -0
  10. package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.js +8 -7
  11. package/dist/ai/ui/{promptInput → chat/chatInput}/index.d.ts +2 -3
  12. package/dist/ai/ui/{promptInput → chat/chatInput}/index.js +2 -2
  13. package/dist/ai/ui/chat/chatInput/store/file.d.ts +8 -0
  14. package/dist/ai/ui/chat/chatInput/store/file.js +32 -0
  15. package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.d.ts +2 -0
  16. package/dist/ai/ui/chat/chatInput/store/fileErrorNotificaton.js +21 -0
  17. package/dist/ai/ui/chat/chatInput/store/index.d.ts +2 -0
  18. package/dist/ai/ui/chat/chatInput/store/index.js +2 -0
  19. package/dist/ai/ui/chat/chatInput/store/input.d.ts +13 -0
  20. package/dist/ai/ui/chat/chatInput/store/input.js +81 -0
  21. package/dist/ai/ui/chat/chatInput/store/parseFile.d.ts +2 -0
  22. package/dist/ai/ui/chat/chatInput/store/parseFile.js +23 -0
  23. package/dist/ai/ui/chat/index.d.ts +12 -0
  24. package/dist/ai/ui/chat/index.js +15 -0
  25. package/dist/ai/ui/chat/messages/Empty.d.ts +4 -0
  26. package/dist/ai/ui/chat/messages/Empty.js +11 -0
  27. package/dist/ai/ui/chat/messages/Loader.d.ts +5 -0
  28. package/dist/ai/ui/chat/messages/Loader.js +12 -0
  29. package/dist/ai/ui/chat/messages/Message.d.ts +8 -0
  30. package/dist/ai/ui/chat/messages/Message.js +22 -0
  31. package/dist/ai/ui/chat/messages/Messages.d.ts +3 -0
  32. package/dist/ai/ui/chat/messages/Messages.js +40 -0
  33. package/dist/ai/ui/chat/messages/index.d.ts +2 -0
  34. package/dist/ai/ui/chat/messages/index.js +2 -0
  35. package/dist/ai/ui/chat/parts/File.d.ts +6 -0
  36. package/dist/ai/ui/{conversation → chat/parts}/File.js +10 -10
  37. package/dist/ai/ui/chat/parts/FileIcon.js +43 -0
  38. package/dist/ai/ui/chat/parts/PartPaper.d.ts +8 -0
  39. package/dist/ai/ui/chat/parts/PartPaper.js +14 -0
  40. package/dist/ai/ui/chat/parts/TextPart.d.ts +6 -0
  41. package/dist/ai/ui/chat/parts/TextPart.js +15 -0
  42. package/dist/ai/ui/chat/parts/ToolExecution.d.ts +7 -0
  43. package/dist/ai/ui/chat/parts/ToolExecution.js +56 -0
  44. package/dist/ai/ui/chat/parts/ToolPart.d.ts +10 -0
  45. package/dist/ai/ui/chat/parts/ToolPart.js +24 -0
  46. package/dist/ai/ui/chat/parts/index.d.ts +3 -0
  47. package/dist/ai/ui/chat/parts/index.js +3 -0
  48. package/dist/ai/ui/chat/store/index.d.ts +4 -0
  49. package/dist/ai/ui/chat/store/index.js +4 -0
  50. package/dist/ai/ui/chat/store/messages.d.ts +12 -0
  51. package/dist/ai/ui/chat/store/messages.js +40 -0
  52. package/dist/ai/ui/chat/store/send.d.ts +14 -0
  53. package/dist/ai/ui/chat/store/send.js +16 -0
  54. package/dist/ai/ui/chat/store/states.d.ts +11 -0
  55. package/dist/ai/ui/chat/store/states.js +20 -0
  56. package/dist/ai/ui/chat/store/useInitChat.d.ts +3 -0
  57. package/dist/ai/ui/chat/store/useInitChat.js +40 -0
  58. package/dist/ai/ui/index.d.ts +1 -0
  59. package/dist/ai/ui/index.js +1 -0
  60. package/dist/ai/utils/index.d.ts +2 -0
  61. package/dist/ai/utils/index.js +2 -0
  62. package/dist/app/AppDefaults.js +1 -1
  63. package/dist/app/DefaultApp.js +1 -1
  64. package/dist/app/cookieColorSchemeManager.js +1 -1
  65. package/dist/app/defaultTheme.d.ts +7 -7
  66. package/dist/app/index.d.ts +3 -0
  67. package/dist/app/index.js +3 -0
  68. package/dist/betterAuth/client/getAuthClient.d.ts +3050 -0
  69. package/dist/betterAuth/client/getAuthClient.js +18 -0
  70. package/dist/betterAuth/client/index.d.ts +1 -0
  71. package/dist/betterAuth/client/index.js +1 -0
  72. package/dist/betterAuth/index.d.ts +3 -0
  73. package/dist/betterAuth/index.js +3 -0
  74. package/dist/betterAuth/server/defaultAuthServerConfig.d.ts +1243 -0
  75. package/dist/betterAuth/server/defaultAuthServerConfig.js +50 -0
  76. package/dist/betterAuth/server/env.d.ts +1 -0
  77. package/dist/betterAuth/server/env.js +8 -0
  78. package/dist/betterAuth/server/getDBSession.d.ts +2 -0
  79. package/dist/betterAuth/server/getDBSession.js +85 -0
  80. package/dist/betterAuth/server/getSessionToken.d.ts +1 -0
  81. package/dist/betterAuth/server/getSessionToken.js +15 -0
  82. package/dist/betterAuth/server/getSessionUser.d.ts +1 -0
  83. package/dist/betterAuth/server/getSessionUser.js +22 -0
  84. package/dist/betterAuth/server/index.d.ts +10 -0
  85. package/dist/betterAuth/server/index.js +11 -0
  86. package/dist/betterAuth/server/surrealDbAdapter/adapter.d.ts +8 -0
  87. package/dist/betterAuth/server/surrealDbAdapter/adapter.js +64 -0
  88. package/dist/betterAuth/server/surrealDbAdapter/adapter.test.d.ts +1 -0
  89. package/dist/betterAuth/server/surrealDbAdapter/adapter.test.js +84 -0
  90. package/dist/betterAuth/server/surrealDbAdapter/db/getDB.d.ts +2 -0
  91. package/dist/betterAuth/server/surrealDbAdapter/db/getDB.js +26 -0
  92. package/dist/betterAuth/server/surrealDbAdapter/db/index.d.ts +1 -0
  93. package/dist/betterAuth/server/surrealDbAdapter/db/index.js +1 -0
  94. package/dist/betterAuth/server/surrealDbAdapter/db/schema.d.ts +1 -0
  95. package/dist/betterAuth/server/surrealDbAdapter/db/schema.js +97 -0
  96. package/dist/betterAuth/server/surrealDbAdapter/index.d.ts +1 -0
  97. package/dist/betterAuth/server/surrealDbAdapter/index.js +1 -0
  98. package/dist/betterAuth/server/surrealDbAdapter/methods/count.d.ts +2 -0
  99. package/dist/betterAuth/server/surrealDbAdapter/methods/count.js +17 -0
  100. package/dist/betterAuth/server/surrealDbAdapter/methods/create.d.ts +2 -0
  101. package/dist/betterAuth/server/surrealDbAdapter/methods/create.js +21 -0
  102. package/dist/betterAuth/server/surrealDbAdapter/methods/delete.d.ts +2 -0
  103. package/dist/betterAuth/server/surrealDbAdapter/methods/delete.js +18 -0
  104. package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.d.ts +2 -0
  105. package/dist/betterAuth/server/surrealDbAdapter/methods/deleteMany.js +19 -0
  106. package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.d.ts +2 -0
  107. package/dist/betterAuth/server/surrealDbAdapter/methods/findMany.js +51 -0
  108. package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.d.ts +2 -0
  109. package/dist/betterAuth/server/surrealDbAdapter/methods/findOne.js +42 -0
  110. package/dist/betterAuth/server/surrealDbAdapter/methods/index.d.ts +8 -0
  111. package/dist/betterAuth/server/surrealDbAdapter/methods/index.js +8 -0
  112. package/dist/betterAuth/server/surrealDbAdapter/methods/types.d.ts +56 -0
  113. package/dist/betterAuth/server/surrealDbAdapter/methods/update.d.ts +2 -0
  114. package/dist/betterAuth/server/surrealDbAdapter/methods/update.js +25 -0
  115. package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.d.ts +2 -0
  116. package/dist/betterAuth/server/surrealDbAdapter/methods/updateMany.js +21 -0
  117. package/dist/betterAuth/server/surrealDbAdapter/types.d.ts +2 -0
  118. package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.d.ts +2 -0
  119. package/dist/betterAuth/server/surrealDbAdapter/utils/applyJoinMappings.js +31 -0
  120. package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.d.ts +3 -0
  121. package/dist/betterAuth/server/surrealDbAdapter/utils/buildExpression.js +58 -0
  122. package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.d.ts +9 -0
  123. package/dist/betterAuth/server/surrealDbAdapter/utils/buildJoinPlan.js +46 -0
  124. package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.d.ts +1 -0
  125. package/dist/betterAuth/server/surrealDbAdapter/utils/buildSelectFields.js +5 -0
  126. package/dist/betterAuth/server/surrealDbAdapter/utils/index.d.ts +6 -0
  127. package/dist/betterAuth/server/surrealDbAdapter/utils/index.js +6 -0
  128. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.d.ts +2 -0
  129. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeOutputRecordIds.js +43 -0
  130. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.d.ts +2 -0
  131. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeRecordIds.js +38 -0
  132. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.d.ts +2 -0
  133. package/dist/betterAuth/server/surrealDbAdapter/utils/normalizeWhereValue.js +33 -0
  134. package/dist/betterAuth/server/surrealDbAdapter/utils/types.d.ts +34 -0
  135. package/dist/betterAuth/server/types.d.ts +8 -0
  136. package/dist/betterAuth/useSessionUser.d.ts +1 -0
  137. package/dist/betterAuth/useSessionUser.js +8 -0
  138. package/dist/hooks/index.d.ts +2 -0
  139. package/dist/hooks/index.js +2 -0
  140. package/dist/styles.css +3 -8
  141. package/dist/surrealDB/deafaultCrud.d.ts +2 -0
  142. package/dist/{surreal → surrealDB}/deafaultCrud.js +6 -5
  143. package/dist/surrealDB/getDBInstance.d.ts +3 -0
  144. package/dist/surrealDB/getDBInstance.js +34 -0
  145. package/dist/surrealDB/getDBInstanceTanstack.d.ts +3 -0
  146. package/dist/{surreal/connection.js → surrealDB/getDBInstanceTanstack.js} +2 -2
  147. package/dist/surrealDB/index.d.ts +6 -0
  148. package/dist/surrealDB/index.js +6 -0
  149. package/dist/{surreal/connection.d.ts → surrealDB/types.d.ts} +3 -3
  150. package/dist/surrealDB/types.js +0 -0
  151. package/dist/tanstack/cookie/index.d.ts +3 -0
  152. package/dist/tanstack/cookie/index.js +4 -0
  153. package/dist/{functions → tanstack/cookie}/setCookie.d.ts +1 -1
  154. package/dist/tanstack/index.d.ts +3 -0
  155. package/dist/tanstack/index.js +3 -0
  156. package/dist/tanstack/middlewares/index.d.ts +6 -0
  157. package/dist/tanstack/middlewares/index.js +5 -0
  158. package/dist/tanstack/middlewares/locale.d.ts +4 -0
  159. package/dist/{app/defaultRequestMiddlewares.js → tanstack/middlewares/locale.js} +2 -5
  160. package/dist/tanstack/s3/getS3Client.d.ts +2 -0
  161. package/dist/tanstack/s3/getS3Client.js +18 -0
  162. package/dist/tanstack/s3/getSignedFileUrlFn.d.ts +4 -0
  163. package/dist/tanstack/s3/getSignedFileUrlFn.js +21 -0
  164. package/dist/tanstack/s3/index.d.ts +2 -0
  165. package/dist/tanstack/s3/index.js +2 -0
  166. package/dist/tanstack/s3/uploadRequest.d.ts +3 -0
  167. package/dist/tanstack/s3/uploadRequest.js +21 -0
  168. package/dist/ui/AnimatedChevron.d.ts +3 -4
  169. package/dist/ui/AnimatedChevron.js +6 -25
  170. package/dist/ui/JsonInput.d.ts +1 -1
  171. package/dist/ui/JsonInput.js +1 -1
  172. package/dist/ui/editor/Content.d.ts +2 -2
  173. package/dist/ui/editor/Content.js +2 -2
  174. package/dist/ui/editor/Root.d.ts +7 -1
  175. package/dist/ui/editor/Root.js +42 -5
  176. package/dist/ui/editor/Toolbar.d.ts +3 -2
  177. package/dist/ui/editor/Toolbar.js +7 -25
  178. package/dist/ui/editor/index.d.ts +5 -9
  179. package/dist/ui/editor/index.js +3 -4
  180. package/dist/ui/editor/store.d.ts +6 -0
  181. package/dist/ui/editor/store.js +10 -0
  182. package/dist/ui/error/DefaultError.d.ts +1 -1
  183. package/dist/ui/error/DefaultNotFound.d.ts +1 -1
  184. package/dist/ui/error/Forbidden.d.ts +1 -1
  185. package/dist/ui/form/buttons/CancelButton.d.ts +2 -2
  186. package/dist/ui/form/buttons/CancelButton.js +4 -26
  187. package/dist/ui/form/buttons/SubmitButton.d.ts +2 -2
  188. package/dist/ui/form/buttons/SubmitButton.js +4 -29
  189. package/dist/ui/form/buttons/SubscribeActionIcon.d.ts +2 -2
  190. package/dist/ui/form/buttons/SubscribeButton.d.ts +2 -2
  191. package/dist/ui/form/context.d.ts +55 -55
  192. package/dist/ui/form/context.js +3 -3
  193. package/dist/ui/form/fields/JsonField.d.ts +1 -1
  194. package/dist/ui/form/fields/MultiSelectField.d.ts +1 -1
  195. package/dist/ui/form/fields/NumberField.d.ts +1 -1
  196. package/dist/ui/form/fields/PasswordField.d.ts +2 -0
  197. package/dist/ui/form/fields/{PassowrdField.js → PasswordField.js} +2 -2
  198. package/dist/ui/form/fields/SelectField.d.ts +1 -1
  199. package/dist/ui/form/fields/SwitchField.d.ts +1 -1
  200. package/dist/ui/form/fields/TextField.d.ts +1 -1
  201. package/dist/ui/form/fields/TextPasswordField.d.ts +2 -0
  202. package/dist/ui/form/fields/TextPasswordField.js +29 -0
  203. package/dist/ui/form/fields/TextareaField.d.ts +1 -1
  204. package/dist/ui/form/fields/index.d.ts +2 -2
  205. package/dist/ui/form/fields/index.js +2 -2
  206. package/dist/ui/form/index.d.ts +0 -1
  207. package/dist/ui/form/index.js +1 -2
  208. package/dist/ui/index.d.ts +9 -0
  209. package/dist/ui/index.js +9 -0
  210. package/dist/ui/saveInput/JsonInput.d.ts +2 -2
  211. package/dist/ui/saveInput/NumberInput.d.ts +2 -2
  212. package/dist/ui/saveInput/SaveInput.d.ts +14 -14
  213. package/dist/ui/saveInput/Select.d.ts +2 -2
  214. package/dist/ui/saveInput/Switch.d.ts +2 -2
  215. package/dist/ui/saveInput/TextInput.d.ts +2 -2
  216. package/dist/ui/saveInput/Textarea.d.ts +2 -2
  217. package/dist/ui/scrollArea/Root.d.ts +7 -0
  218. package/dist/ui/scrollArea/Root.js +42 -0
  219. package/dist/ui/scrollArea/ScrollButton.d.ts +7 -0
  220. package/dist/ui/scrollArea/ScrollButton.js +30 -0
  221. package/dist/ui/scrollArea/index.d.ts +6 -3
  222. package/dist/ui/scrollArea/index.js +7 -3
  223. package/dist/ui/scrollArea/methods.d.ts +4 -0
  224. package/dist/ui/scrollArea/methods.js +32 -0
  225. package/dist/ui/scrollArea/store.d.ts +12 -0
  226. package/dist/ui/scrollArea/store.js +25 -0
  227. package/dist/{ui/form/fieldsSchema.d.ts → zodSchemas.d.ts} +1 -1
  228. package/dist/{ui/form/fieldsSchema.js → zodSchemas.js} +2 -2
  229. package/package.json +103 -71
  230. package/dist/ai/ui/conversation/ConversationContext.d.ts +0 -7
  231. package/dist/ai/ui/conversation/ConversationContext.js +0 -8
  232. package/dist/ai/ui/conversation/ConversationProvider.d.ts +0 -2
  233. package/dist/ai/ui/conversation/ConversationProvider.js +0 -14
  234. package/dist/ai/ui/conversation/Empty.d.ts +0 -1
  235. package/dist/ai/ui/conversation/Empty.js +0 -21
  236. package/dist/ai/ui/conversation/File.d.ts +0 -4
  237. package/dist/ai/ui/conversation/FileIcon.js +0 -225
  238. package/dist/ai/ui/conversation/Loader.d.ts +0 -2
  239. package/dist/ai/ui/conversation/Loader.js +0 -12
  240. package/dist/ai/ui/conversation/Message.d.ts +0 -4
  241. package/dist/ai/ui/conversation/Message.js +0 -25
  242. package/dist/ai/ui/conversation/Root.d.ts +0 -2
  243. package/dist/ai/ui/conversation/Root.js +0 -26
  244. package/dist/ai/ui/conversation/index.d.ts +0 -13
  245. package/dist/ai/ui/conversation/index.js +0 -14
  246. package/dist/ai/ui/conversation/types.d.ts +0 -7
  247. package/dist/ai/ui/conversation/useChatMessage.d.ts +0 -2
  248. package/dist/ai/ui/conversation/useChatMessage.js +0 -12
  249. package/dist/ai/ui/promptInput/File.js +0 -117
  250. package/dist/ai/ui/promptInput/FileIcon.js +0 -225
  251. package/dist/ai/ui/promptInput/PromptInputContext.d.ts +0 -12
  252. package/dist/ai/ui/promptInput/PromptInputContext.js +0 -8
  253. package/dist/ai/ui/promptInput/PromptInputProvider.d.ts +0 -2
  254. package/dist/ai/ui/promptInput/PromptInputProvider.js +0 -50
  255. package/dist/ai/ui/promptInput/Root.d.ts +0 -3
  256. package/dist/ai/ui/promptInput/Root.js +0 -17
  257. package/dist/ai/ui/promptInput/Submit.js +0 -40
  258. package/dist/ai/ui/promptInput/types.d.ts +0 -11
  259. package/dist/app/defaultRequestMiddlewares.d.ts +0 -4
  260. package/dist/index.d.ts +0 -26
  261. package/dist/index.js +0 -26
  262. package/dist/surreal/deafaultCrud.d.ts +0 -2
  263. package/dist/ui/editor/Provider.d.ts +0 -17
  264. package/dist/ui/editor/Provider.js +0 -80
  265. package/dist/ui/editor/types.d.ts +0 -7
  266. package/dist/ui/form/fields/PassowrdField.d.ts +0 -2
  267. package/dist/ui/form/fields/TextPassowrdField.d.ts +0 -2
  268. package/dist/ui/form/fields/TextPassowrdField.js +0 -51
  269. package/dist/ui/scrollArea/ScrollArea.d.ts +0 -62
  270. package/dist/ui/scrollArea/ScrollArea.js +0 -30
  271. package/dist/ui/scrollArea/ScrollAreaButton.d.ts +0 -5
  272. package/dist/ui/scrollArea/ScrollAreaButton.js +0 -51
  273. package/dist/ui/scrollArea/ScrollAreaContent.d.ts +0 -6
  274. package/dist/ui/scrollArea/ScrollAreaContent.js +0 -29
  275. package/dist/ui/scrollArea/context.d.ts +0 -28
  276. package/dist/ui/scrollArea/context.js +0 -10
  277. package/dist/ui/scrollArea/types.d.ts +0 -65
  278. package/dist/ui/scrollArea/useScrollArea.d.ts +0 -9
  279. package/dist/ui/scrollArea/useScrollArea.js +0 -146
  280. /package/dist/ai/ui/{promptInput → chat/chatInput}/File.d.ts +0 -0
  281. /package/dist/ai/ui/{conversation → chat/chatInput}/FileIcon.d.ts +0 -0
  282. /package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.d.ts +0 -0
  283. /package/dist/ai/ui/{promptInput → chat/chatInput}/Footer.js +0 -0
  284. /package/dist/ai/ui/{promptInput → chat/chatInput}/Submit.d.ts +0 -0
  285. /package/dist/ai/ui/{promptInput → chat/chatInput}/Textarea.d.ts +0 -0
  286. /package/dist/ai/ui/{promptInput → chat/parts}/FileIcon.d.ts +0 -0
  287. /package/dist/{ai/ui/conversation → betterAuth/server/surrealDbAdapter/methods}/types.js +0 -0
  288. /package/dist/{ai/ui/promptInput → betterAuth/server/surrealDbAdapter}/types.js +0 -0
  289. /package/dist/{ui/editor → betterAuth/server/surrealDbAdapter/utils}/types.js +0 -0
  290. /package/dist/{ui/scrollArea → betterAuth/server}/types.js +0 -0
  291. /package/dist/{surreal → surrealDB}/deserialize.d.ts +0 -0
  292. /package/dist/{surreal → surrealDB}/deserialize.js +0 -0
  293. /package/dist/{surreal → surrealDB}/encryption.d.ts +0 -0
  294. /package/dist/{surreal → surrealDB}/encryption.js +0 -0
  295. /package/dist/{functions → tanstack/cookie}/getCookie.d.ts +0 -0
  296. /package/dist/{functions → tanstack/cookie}/getCookie.js +0 -0
  297. /package/dist/{functions → tanstack/cookie}/setCookie.js +0 -0
  298. /package/dist/{functions → tanstack/cookie}/setCookies.d.ts +0 -0
  299. /package/dist/{functions → tanstack/cookie}/setCookies.js +0 -0
@@ -0,0 +1,1243 @@
1
+ import { type JwtOptions } from 'better-auth/plugins';
2
+ export declare const defaultAuthServerPluginOptions: {
3
+ admin: {
4
+ bannedUserMessage: string;
5
+ };
6
+ jwt: {
7
+ jwks: {
8
+ keyPairConfig: {
9
+ alg: "EdDSA";
10
+ crv: "Ed25519";
11
+ };
12
+ };
13
+ jwt: {
14
+ issuer: string;
15
+ audience: string;
16
+ expirationTime: string;
17
+ definePayload: ({ user, session }: {
18
+ user: import("better-auth").User & Record<string, any>;
19
+ session: import("better-auth").Session & Record<string, any>;
20
+ }) => {
21
+ id: string;
22
+ ns: string;
23
+ db: string;
24
+ ac: string;
25
+ email: string;
26
+ name: string;
27
+ role: string;
28
+ sessionId: string;
29
+ };
30
+ };
31
+ };
32
+ };
33
+ export declare const defaultAuthServerConfig: {
34
+ baseURL: string;
35
+ secret: string | undefined;
36
+ database: (options: Parameters<import("better-auth/adapters").AdapterFactory>[0]) => import("better-auth").DBAdapter<import("better-auth").BetterAuthOptions>;
37
+ experimental: {
38
+ joins: boolean;
39
+ };
40
+ emailAndPassword: {
41
+ enabled: boolean;
42
+ };
43
+ plugins: ({
44
+ id: "username";
45
+ init(ctx: import("better-auth").AuthContext): {
46
+ options: {
47
+ databaseHooks: {
48
+ user: {
49
+ create: {
50
+ before(user: {
51
+ id: string;
52
+ createdAt: Date;
53
+ updatedAt: Date;
54
+ email: string;
55
+ emailVerified: boolean;
56
+ name: string;
57
+ image?: string | null | undefined;
58
+ } & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null): Promise<{
59
+ data: {
60
+ displayUsername?: string | undefined;
61
+ username?: string | undefined;
62
+ id: string;
63
+ createdAt: Date;
64
+ updatedAt: Date;
65
+ email: string;
66
+ emailVerified: boolean;
67
+ name: string;
68
+ image?: string | null | undefined;
69
+ };
70
+ }>;
71
+ };
72
+ update: {
73
+ before(user: Partial<{
74
+ id: string;
75
+ createdAt: Date;
76
+ updatedAt: Date;
77
+ email: string;
78
+ emailVerified: boolean;
79
+ name: string;
80
+ image?: string | null | undefined;
81
+ }> & Record<string, unknown>, context: import("better-auth").GenericEndpointContext | null): Promise<{
82
+ data: {
83
+ displayUsername?: string | undefined;
84
+ username?: string | undefined;
85
+ id?: string | undefined;
86
+ createdAt?: Date | undefined;
87
+ updatedAt?: Date | undefined;
88
+ email?: string | undefined;
89
+ emailVerified?: boolean | undefined;
90
+ name?: string | undefined;
91
+ image?: string | null | undefined;
92
+ };
93
+ }>;
94
+ };
95
+ };
96
+ };
97
+ };
98
+ };
99
+ endpoints: {
100
+ signInUsername: import("better-auth").StrictEndpoint<"/sign-in/username", {
101
+ method: "POST";
102
+ body: import("zod").ZodObject<{
103
+ username: import("zod").ZodString;
104
+ password: import("zod").ZodString;
105
+ rememberMe: import("zod").ZodOptional<import("zod").ZodBoolean>;
106
+ callbackURL: import("zod").ZodOptional<import("zod").ZodString>;
107
+ }, import("better-auth").$strip>;
108
+ metadata: {
109
+ openapi: {
110
+ summary: string;
111
+ description: string;
112
+ responses: {
113
+ 200: {
114
+ description: string;
115
+ content: {
116
+ "application/json": {
117
+ schema: {
118
+ type: "object";
119
+ properties: {
120
+ token: {
121
+ type: string;
122
+ description: string;
123
+ };
124
+ user: {
125
+ $ref: string;
126
+ };
127
+ };
128
+ required: string[];
129
+ };
130
+ };
131
+ };
132
+ };
133
+ 422: {
134
+ description: string;
135
+ content: {
136
+ "application/json": {
137
+ schema: {
138
+ type: "object";
139
+ properties: {
140
+ message: {
141
+ type: string;
142
+ };
143
+ };
144
+ };
145
+ };
146
+ };
147
+ };
148
+ };
149
+ };
150
+ };
151
+ }, {
152
+ token: string;
153
+ user: {
154
+ id: string;
155
+ createdAt: Date;
156
+ updatedAt: Date;
157
+ email: string;
158
+ emailVerified: boolean;
159
+ name: string;
160
+ image?: string | null | undefined;
161
+ } & {
162
+ username: string;
163
+ displayUsername: string;
164
+ };
165
+ } | null>;
166
+ isUsernameAvailable: import("better-auth").StrictEndpoint<"/is-username-available", {
167
+ method: "POST";
168
+ body: import("zod").ZodObject<{
169
+ username: import("zod").ZodString;
170
+ }, import("better-auth").$strip>;
171
+ }, {
172
+ available: boolean;
173
+ }>;
174
+ };
175
+ schema: {
176
+ user: {
177
+ fields: {
178
+ username: {
179
+ type: "string";
180
+ required: false;
181
+ sortable: true;
182
+ unique: true;
183
+ returned: true;
184
+ transform: {
185
+ input(value: import("better-auth").DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
186
+ };
187
+ };
188
+ displayUsername: {
189
+ type: "string";
190
+ required: false;
191
+ transform: {
192
+ input(value: import("better-auth").DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
193
+ };
194
+ };
195
+ };
196
+ };
197
+ };
198
+ hooks: {
199
+ before: {
200
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
201
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
202
+ }[];
203
+ };
204
+ options: import("better-auth/plugins").UsernameOptions | undefined;
205
+ $ERROR_CODES: {
206
+ readonly INVALID_USERNAME_OR_PASSWORD: "Invalid username or password";
207
+ readonly EMAIL_NOT_VERIFIED: "Email not verified";
208
+ readonly UNEXPECTED_ERROR: "Unexpected error";
209
+ readonly USERNAME_IS_ALREADY_TAKEN: "Username is already taken. Please try another.";
210
+ readonly USERNAME_TOO_SHORT: "Username is too short";
211
+ readonly USERNAME_TOO_LONG: "Username is too long";
212
+ readonly INVALID_USERNAME: "Username is invalid";
213
+ readonly INVALID_DISPLAY_USERNAME: "Display username is invalid";
214
+ };
215
+ } | {
216
+ id: "admin";
217
+ init(): {
218
+ options: {
219
+ databaseHooks: {
220
+ user: {
221
+ create: {
222
+ before(user: {
223
+ id: string;
224
+ createdAt: Date;
225
+ updatedAt: Date;
226
+ email: string;
227
+ emailVerified: boolean;
228
+ name: string;
229
+ image?: string | null | undefined;
230
+ } & Record<string, unknown>): Promise<{
231
+ data: {
232
+ id: string;
233
+ createdAt: Date;
234
+ updatedAt: Date;
235
+ email: string;
236
+ emailVerified: boolean;
237
+ name: string;
238
+ image?: string | null | undefined;
239
+ role: string;
240
+ };
241
+ }>;
242
+ };
243
+ };
244
+ session: {
245
+ create: {
246
+ before(session: {
247
+ id: string;
248
+ createdAt: Date;
249
+ updatedAt: Date;
250
+ userId: string;
251
+ expiresAt: Date;
252
+ token: string;
253
+ ipAddress?: string | null | undefined;
254
+ userAgent?: string | null | undefined;
255
+ } & Record<string, unknown>, ctx: import("better-auth").GenericEndpointContext | null): Promise<void>;
256
+ };
257
+ };
258
+ };
259
+ };
260
+ };
261
+ hooks: {
262
+ after: {
263
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
264
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<import("better-auth/plugins").SessionWithImpersonatedBy[] | undefined>;
265
+ }[];
266
+ };
267
+ endpoints: {
268
+ setRole: import("better-auth").StrictEndpoint<"/admin/set-role", {
269
+ method: "POST";
270
+ body: import("zod").ZodObject<{
271
+ userId: import("zod").ZodCoercedString<unknown>;
272
+ role: import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>;
273
+ }, import("better-auth").$strip>;
274
+ requireHeaders: true;
275
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
276
+ session: {
277
+ user: import("better-auth/plugins").UserWithRole;
278
+ session: import("better-auth").Session;
279
+ };
280
+ }>)[];
281
+ metadata: {
282
+ openapi: {
283
+ operationId: string;
284
+ summary: string;
285
+ description: string;
286
+ responses: {
287
+ 200: {
288
+ description: string;
289
+ content: {
290
+ "application/json": {
291
+ schema: {
292
+ type: "object";
293
+ properties: {
294
+ user: {
295
+ $ref: string;
296
+ };
297
+ };
298
+ };
299
+ };
300
+ };
301
+ };
302
+ };
303
+ };
304
+ $Infer: {
305
+ body: {
306
+ userId: string;
307
+ role: "user" | "admin" | ("user" | "admin")[];
308
+ };
309
+ };
310
+ };
311
+ }, {
312
+ user: import("better-auth/plugins").UserWithRole;
313
+ }>;
314
+ getUser: import("better-auth").StrictEndpoint<"/admin/get-user", {
315
+ method: "GET";
316
+ query: import("zod").ZodObject<{
317
+ id: import("zod").ZodString;
318
+ }, import("better-auth").$strip>;
319
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
320
+ session: {
321
+ user: import("better-auth/plugins").UserWithRole;
322
+ session: import("better-auth").Session;
323
+ };
324
+ }>)[];
325
+ metadata: {
326
+ openapi: {
327
+ operationId: string;
328
+ summary: string;
329
+ description: string;
330
+ responses: {
331
+ 200: {
332
+ description: string;
333
+ content: {
334
+ "application/json": {
335
+ schema: {
336
+ type: "object";
337
+ properties: {
338
+ user: {
339
+ $ref: string;
340
+ };
341
+ };
342
+ };
343
+ };
344
+ };
345
+ };
346
+ };
347
+ };
348
+ };
349
+ }, import("better-auth/plugins").UserWithRole>;
350
+ createUser: import("better-auth").StrictEndpoint<"/admin/create-user", {
351
+ method: "POST";
352
+ body: import("zod").ZodObject<{
353
+ email: import("zod").ZodString;
354
+ password: import("zod").ZodOptional<import("zod").ZodString>;
355
+ name: import("zod").ZodString;
356
+ role: import("zod").ZodOptional<import("zod").ZodUnion<readonly [import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>]>>;
357
+ data: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
358
+ }, import("better-auth").$strip>;
359
+ metadata: {
360
+ openapi: {
361
+ operationId: string;
362
+ summary: string;
363
+ description: string;
364
+ responses: {
365
+ 200: {
366
+ description: string;
367
+ content: {
368
+ "application/json": {
369
+ schema: {
370
+ type: "object";
371
+ properties: {
372
+ user: {
373
+ $ref: string;
374
+ };
375
+ };
376
+ };
377
+ };
378
+ };
379
+ };
380
+ };
381
+ };
382
+ $Infer: {
383
+ body: {
384
+ email: string;
385
+ password?: string | undefined;
386
+ name: string;
387
+ role?: "user" | "admin" | ("user" | "admin")[] | undefined;
388
+ data?: Record<string, any> | undefined;
389
+ };
390
+ };
391
+ };
392
+ }, {
393
+ user: import("better-auth/plugins").UserWithRole;
394
+ }>;
395
+ adminUpdateUser: import("better-auth").StrictEndpoint<"/admin/update-user", {
396
+ method: "POST";
397
+ body: import("zod").ZodObject<{
398
+ userId: import("zod").ZodCoercedString<unknown>;
399
+ data: import("zod").ZodRecord<import("zod").ZodAny, import("zod").ZodAny>;
400
+ }, import("better-auth").$strip>;
401
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
402
+ session: {
403
+ user: import("better-auth/plugins").UserWithRole;
404
+ session: import("better-auth").Session;
405
+ };
406
+ }>)[];
407
+ metadata: {
408
+ openapi: {
409
+ operationId: string;
410
+ summary: string;
411
+ description: string;
412
+ responses: {
413
+ 200: {
414
+ description: string;
415
+ content: {
416
+ "application/json": {
417
+ schema: {
418
+ type: "object";
419
+ properties: {
420
+ user: {
421
+ $ref: string;
422
+ };
423
+ };
424
+ };
425
+ };
426
+ };
427
+ };
428
+ };
429
+ };
430
+ };
431
+ }, import("better-auth/plugins").UserWithRole>;
432
+ listUsers: import("better-auth").StrictEndpoint<"/admin/list-users", {
433
+ method: "GET";
434
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
435
+ session: {
436
+ user: import("better-auth/plugins").UserWithRole;
437
+ session: import("better-auth").Session;
438
+ };
439
+ }>)[];
440
+ query: import("zod").ZodObject<{
441
+ searchValue: import("zod").ZodOptional<import("zod").ZodString>;
442
+ searchField: import("zod").ZodOptional<import("zod").ZodEnum<{
443
+ name: "name";
444
+ email: "email";
445
+ }>>;
446
+ searchOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
447
+ contains: "contains";
448
+ starts_with: "starts_with";
449
+ ends_with: "ends_with";
450
+ }>>;
451
+ limit: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
452
+ offset: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>>;
453
+ sortBy: import("zod").ZodOptional<import("zod").ZodString>;
454
+ sortDirection: import("zod").ZodOptional<import("zod").ZodEnum<{
455
+ asc: "asc";
456
+ desc: "desc";
457
+ }>>;
458
+ filterField: import("zod").ZodOptional<import("zod").ZodString>;
459
+ filterValue: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber]>, import("zod").ZodBoolean]>>;
460
+ filterOperator: import("zod").ZodOptional<import("zod").ZodEnum<{
461
+ eq: "eq";
462
+ ne: "ne";
463
+ lt: "lt";
464
+ lte: "lte";
465
+ gt: "gt";
466
+ gte: "gte";
467
+ contains: "contains";
468
+ }>>;
469
+ }, import("better-auth").$strip>;
470
+ metadata: {
471
+ openapi: {
472
+ operationId: string;
473
+ summary: string;
474
+ description: string;
475
+ responses: {
476
+ 200: {
477
+ description: string;
478
+ content: {
479
+ "application/json": {
480
+ schema: {
481
+ type: "object";
482
+ properties: {
483
+ users: {
484
+ type: string;
485
+ items: {
486
+ $ref: string;
487
+ };
488
+ };
489
+ total: {
490
+ type: string;
491
+ };
492
+ limit: {
493
+ type: string;
494
+ };
495
+ offset: {
496
+ type: string;
497
+ };
498
+ };
499
+ required: string[];
500
+ };
501
+ };
502
+ };
503
+ };
504
+ };
505
+ };
506
+ };
507
+ }, {
508
+ users: import("better-auth/plugins").UserWithRole[];
509
+ total: number;
510
+ limit: number | undefined;
511
+ offset: number | undefined;
512
+ } | {
513
+ users: never[];
514
+ total: number;
515
+ }>;
516
+ listUserSessions: import("better-auth").StrictEndpoint<"/admin/list-user-sessions", {
517
+ method: "POST";
518
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
519
+ session: {
520
+ user: import("better-auth/plugins").UserWithRole;
521
+ session: import("better-auth").Session;
522
+ };
523
+ }>)[];
524
+ body: import("zod").ZodObject<{
525
+ userId: import("zod").ZodCoercedString<unknown>;
526
+ }, import("better-auth").$strip>;
527
+ metadata: {
528
+ openapi: {
529
+ operationId: string;
530
+ summary: string;
531
+ description: string;
532
+ responses: {
533
+ 200: {
534
+ description: string;
535
+ content: {
536
+ "application/json": {
537
+ schema: {
538
+ type: "object";
539
+ properties: {
540
+ sessions: {
541
+ type: string;
542
+ items: {
543
+ $ref: string;
544
+ };
545
+ };
546
+ };
547
+ };
548
+ };
549
+ };
550
+ };
551
+ };
552
+ };
553
+ };
554
+ }, {
555
+ sessions: import("better-auth/plugins").SessionWithImpersonatedBy[];
556
+ }>;
557
+ unbanUser: import("better-auth").StrictEndpoint<"/admin/unban-user", {
558
+ method: "POST";
559
+ body: import("zod").ZodObject<{
560
+ userId: import("zod").ZodCoercedString<unknown>;
561
+ }, import("better-auth").$strip>;
562
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
563
+ session: {
564
+ user: import("better-auth/plugins").UserWithRole;
565
+ session: import("better-auth").Session;
566
+ };
567
+ }>)[];
568
+ metadata: {
569
+ openapi: {
570
+ operationId: string;
571
+ summary: string;
572
+ description: string;
573
+ responses: {
574
+ 200: {
575
+ description: string;
576
+ content: {
577
+ "application/json": {
578
+ schema: {
579
+ type: "object";
580
+ properties: {
581
+ user: {
582
+ $ref: string;
583
+ };
584
+ };
585
+ };
586
+ };
587
+ };
588
+ };
589
+ };
590
+ };
591
+ };
592
+ }, {
593
+ user: import("better-auth/plugins").UserWithRole;
594
+ }>;
595
+ banUser: import("better-auth").StrictEndpoint<"/admin/ban-user", {
596
+ method: "POST";
597
+ body: import("zod").ZodObject<{
598
+ userId: import("zod").ZodCoercedString<unknown>;
599
+ banReason: import("zod").ZodOptional<import("zod").ZodString>;
600
+ banExpiresIn: import("zod").ZodOptional<import("zod").ZodNumber>;
601
+ }, import("better-auth").$strip>;
602
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
603
+ session: {
604
+ user: import("better-auth/plugins").UserWithRole;
605
+ session: import("better-auth").Session;
606
+ };
607
+ }>)[];
608
+ metadata: {
609
+ openapi: {
610
+ operationId: string;
611
+ summary: string;
612
+ description: string;
613
+ responses: {
614
+ 200: {
615
+ description: string;
616
+ content: {
617
+ "application/json": {
618
+ schema: {
619
+ type: "object";
620
+ properties: {
621
+ user: {
622
+ $ref: string;
623
+ };
624
+ };
625
+ };
626
+ };
627
+ };
628
+ };
629
+ };
630
+ };
631
+ };
632
+ }, {
633
+ user: import("better-auth/plugins").UserWithRole;
634
+ }>;
635
+ impersonateUser: import("better-auth").StrictEndpoint<"/admin/impersonate-user", {
636
+ method: "POST";
637
+ body: import("zod").ZodObject<{
638
+ userId: import("zod").ZodCoercedString<unknown>;
639
+ }, import("better-auth").$strip>;
640
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
641
+ session: {
642
+ user: import("better-auth/plugins").UserWithRole;
643
+ session: import("better-auth").Session;
644
+ };
645
+ }>)[];
646
+ metadata: {
647
+ openapi: {
648
+ operationId: string;
649
+ summary: string;
650
+ description: string;
651
+ responses: {
652
+ 200: {
653
+ description: string;
654
+ content: {
655
+ "application/json": {
656
+ schema: {
657
+ type: "object";
658
+ properties: {
659
+ session: {
660
+ $ref: string;
661
+ };
662
+ user: {
663
+ $ref: string;
664
+ };
665
+ };
666
+ };
667
+ };
668
+ };
669
+ };
670
+ };
671
+ };
672
+ };
673
+ }, {
674
+ session: {
675
+ id: string;
676
+ createdAt: Date;
677
+ updatedAt: Date;
678
+ userId: string;
679
+ expiresAt: Date;
680
+ token: string;
681
+ ipAddress?: string | null | undefined;
682
+ userAgent?: string | null | undefined;
683
+ };
684
+ user: import("better-auth/plugins").UserWithRole;
685
+ }>;
686
+ stopImpersonating: import("better-auth").StrictEndpoint<"/admin/stop-impersonating", {
687
+ method: "POST";
688
+ requireHeaders: true;
689
+ }, {
690
+ session: {
691
+ id: string;
692
+ createdAt: Date;
693
+ updatedAt: Date;
694
+ userId: string;
695
+ expiresAt: Date;
696
+ token: string;
697
+ ipAddress?: string | null | undefined;
698
+ userAgent?: string | null | undefined;
699
+ } & Record<string, any>;
700
+ user: {
701
+ id: string;
702
+ createdAt: Date;
703
+ updatedAt: Date;
704
+ email: string;
705
+ emailVerified: boolean;
706
+ name: string;
707
+ image?: string | null | undefined;
708
+ } & Record<string, any>;
709
+ }>;
710
+ revokeUserSession: import("better-auth").StrictEndpoint<"/admin/revoke-user-session", {
711
+ method: "POST";
712
+ body: import("zod").ZodObject<{
713
+ sessionToken: import("zod").ZodString;
714
+ }, import("better-auth").$strip>;
715
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
716
+ session: {
717
+ user: import("better-auth/plugins").UserWithRole;
718
+ session: import("better-auth").Session;
719
+ };
720
+ }>)[];
721
+ metadata: {
722
+ openapi: {
723
+ operationId: string;
724
+ summary: string;
725
+ description: string;
726
+ responses: {
727
+ 200: {
728
+ description: string;
729
+ content: {
730
+ "application/json": {
731
+ schema: {
732
+ type: "object";
733
+ properties: {
734
+ success: {
735
+ type: string;
736
+ };
737
+ };
738
+ };
739
+ };
740
+ };
741
+ };
742
+ };
743
+ };
744
+ };
745
+ }, {
746
+ success: boolean;
747
+ }>;
748
+ revokeUserSessions: import("better-auth").StrictEndpoint<"/admin/revoke-user-sessions", {
749
+ method: "POST";
750
+ body: import("zod").ZodObject<{
751
+ userId: import("zod").ZodCoercedString<unknown>;
752
+ }, import("better-auth").$strip>;
753
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
754
+ session: {
755
+ user: import("better-auth/plugins").UserWithRole;
756
+ session: import("better-auth").Session;
757
+ };
758
+ }>)[];
759
+ metadata: {
760
+ openapi: {
761
+ operationId: string;
762
+ summary: string;
763
+ description: string;
764
+ responses: {
765
+ 200: {
766
+ description: string;
767
+ content: {
768
+ "application/json": {
769
+ schema: {
770
+ type: "object";
771
+ properties: {
772
+ success: {
773
+ type: string;
774
+ };
775
+ };
776
+ };
777
+ };
778
+ };
779
+ };
780
+ };
781
+ };
782
+ };
783
+ }, {
784
+ success: boolean;
785
+ }>;
786
+ removeUser: import("better-auth").StrictEndpoint<"/admin/remove-user", {
787
+ method: "POST";
788
+ body: import("zod").ZodObject<{
789
+ userId: import("zod").ZodCoercedString<unknown>;
790
+ }, import("better-auth").$strip>;
791
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
792
+ session: {
793
+ user: import("better-auth/plugins").UserWithRole;
794
+ session: import("better-auth").Session;
795
+ };
796
+ }>)[];
797
+ metadata: {
798
+ openapi: {
799
+ operationId: string;
800
+ summary: string;
801
+ description: string;
802
+ responses: {
803
+ 200: {
804
+ description: string;
805
+ content: {
806
+ "application/json": {
807
+ schema: {
808
+ type: "object";
809
+ properties: {
810
+ success: {
811
+ type: string;
812
+ };
813
+ };
814
+ };
815
+ };
816
+ };
817
+ };
818
+ };
819
+ };
820
+ };
821
+ }, {
822
+ success: boolean;
823
+ }>;
824
+ setUserPassword: import("better-auth").StrictEndpoint<"/admin/set-user-password", {
825
+ method: "POST";
826
+ body: import("zod").ZodObject<{
827
+ newPassword: import("zod").ZodString;
828
+ userId: import("zod").ZodCoercedString<unknown>;
829
+ }, import("better-auth").$strip>;
830
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
831
+ session: {
832
+ user: import("better-auth/plugins").UserWithRole;
833
+ session: import("better-auth").Session;
834
+ };
835
+ }>)[];
836
+ metadata: {
837
+ openapi: {
838
+ operationId: string;
839
+ summary: string;
840
+ description: string;
841
+ responses: {
842
+ 200: {
843
+ description: string;
844
+ content: {
845
+ "application/json": {
846
+ schema: {
847
+ type: "object";
848
+ properties: {
849
+ status: {
850
+ type: string;
851
+ };
852
+ };
853
+ };
854
+ };
855
+ };
856
+ };
857
+ };
858
+ };
859
+ };
860
+ }, {
861
+ status: boolean;
862
+ }>;
863
+ userHasPermission: import("better-auth").StrictEndpoint<"/admin/has-permission", {
864
+ method: "POST";
865
+ body: import("zod").ZodIntersection<import("zod").ZodObject<{
866
+ userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
867
+ role: import("zod").ZodOptional<import("zod").ZodString>;
868
+ }, import("better-auth").$strip>, import("zod").ZodUnion<readonly [import("zod").ZodObject<{
869
+ permission: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
870
+ permissions: import("zod").ZodUndefined;
871
+ }, import("better-auth").$strip>, import("zod").ZodObject<{
872
+ permission: import("zod").ZodUndefined;
873
+ permissions: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>;
874
+ }, import("better-auth").$strip>]>>;
875
+ metadata: {
876
+ openapi: {
877
+ description: string;
878
+ requestBody: {
879
+ content: {
880
+ "application/json": {
881
+ schema: {
882
+ type: "object";
883
+ properties: {
884
+ permission: {
885
+ type: string;
886
+ description: string;
887
+ deprecated: boolean;
888
+ };
889
+ permissions: {
890
+ type: string;
891
+ description: string;
892
+ };
893
+ };
894
+ required: string[];
895
+ };
896
+ };
897
+ };
898
+ };
899
+ responses: {
900
+ "200": {
901
+ description: string;
902
+ content: {
903
+ "application/json": {
904
+ schema: {
905
+ type: "object";
906
+ properties: {
907
+ error: {
908
+ type: string;
909
+ };
910
+ success: {
911
+ type: string;
912
+ };
913
+ };
914
+ required: string[];
915
+ };
916
+ };
917
+ };
918
+ };
919
+ };
920
+ };
921
+ $Infer: {
922
+ body: ({
923
+ permission: {
924
+ readonly user?: ("list" | "create" | "update" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get")[] | undefined;
925
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
926
+ };
927
+ permissions?: never | undefined;
928
+ } | {
929
+ permissions: {
930
+ readonly user?: ("list" | "create" | "update" | "set-role" | "ban" | "impersonate" | "delete" | "set-password" | "get")[] | undefined;
931
+ readonly session?: ("list" | "delete" | "revoke")[] | undefined;
932
+ };
933
+ permission?: never | undefined;
934
+ }) & {
935
+ userId?: string | undefined;
936
+ role?: "user" | "admin" | undefined;
937
+ };
938
+ };
939
+ };
940
+ }, {
941
+ error: null;
942
+ success: boolean;
943
+ }>;
944
+ };
945
+ $ERROR_CODES: {
946
+ readonly FAILED_TO_CREATE_USER: "Failed to create user";
947
+ readonly USER_ALREADY_EXISTS: "User already exists.";
948
+ readonly USER_ALREADY_EXISTS_USE_ANOTHER_EMAIL: "User already exists. Use another email.";
949
+ readonly YOU_CANNOT_BAN_YOURSELF: "You cannot ban yourself";
950
+ readonly YOU_ARE_NOT_ALLOWED_TO_CHANGE_USERS_ROLE: "You are not allowed to change users role";
951
+ readonly YOU_ARE_NOT_ALLOWED_TO_CREATE_USERS: "You are not allowed to create users";
952
+ readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS: "You are not allowed to list users";
953
+ readonly YOU_ARE_NOT_ALLOWED_TO_LIST_USERS_SESSIONS: "You are not allowed to list users sessions";
954
+ readonly YOU_ARE_NOT_ALLOWED_TO_BAN_USERS: "You are not allowed to ban users";
955
+ readonly YOU_ARE_NOT_ALLOWED_TO_IMPERSONATE_USERS: "You are not allowed to impersonate users";
956
+ readonly YOU_ARE_NOT_ALLOWED_TO_REVOKE_USERS_SESSIONS: "You are not allowed to revoke users sessions";
957
+ readonly YOU_ARE_NOT_ALLOWED_TO_DELETE_USERS: "You are not allowed to delete users";
958
+ readonly YOU_ARE_NOT_ALLOWED_TO_SET_USERS_PASSWORD: "You are not allowed to set users password";
959
+ readonly BANNED_USER: "You have been banned from this application";
960
+ readonly YOU_ARE_NOT_ALLOWED_TO_GET_USER: "You are not allowed to get user";
961
+ readonly NO_DATA_TO_UPDATE: "No data to update";
962
+ readonly YOU_ARE_NOT_ALLOWED_TO_UPDATE_USERS: "You are not allowed to update users";
963
+ readonly YOU_CANNOT_REMOVE_YOURSELF: "You cannot remove yourself";
964
+ readonly YOU_ARE_NOT_ALLOWED_TO_SET_NON_EXISTENT_VALUE: "You are not allowed to set a non-existent role value";
965
+ readonly YOU_CANNOT_IMPERSONATE_ADMINS: "You cannot impersonate admins";
966
+ readonly INVALID_ROLE_TYPE: "Invalid role type";
967
+ };
968
+ schema: {
969
+ user: {
970
+ fields: {
971
+ role: {
972
+ type: "string";
973
+ required: false;
974
+ input: false;
975
+ };
976
+ banned: {
977
+ type: "boolean";
978
+ defaultValue: false;
979
+ required: false;
980
+ input: false;
981
+ };
982
+ banReason: {
983
+ type: "string";
984
+ required: false;
985
+ input: false;
986
+ };
987
+ banExpires: {
988
+ type: "date";
989
+ required: false;
990
+ input: false;
991
+ };
992
+ };
993
+ };
994
+ session: {
995
+ fields: {
996
+ impersonatedBy: {
997
+ type: "string";
998
+ required: false;
999
+ };
1000
+ };
1001
+ };
1002
+ };
1003
+ options: NoInfer<{
1004
+ bannedUserMessage: string;
1005
+ }>;
1006
+ } | {
1007
+ id: "jwt";
1008
+ options: NoInfer<{
1009
+ jwks: {
1010
+ keyPairConfig: {
1011
+ alg: "EdDSA";
1012
+ crv: "Ed25519";
1013
+ };
1014
+ };
1015
+ jwt: {
1016
+ issuer: string;
1017
+ audience: string;
1018
+ expirationTime: string;
1019
+ definePayload: ({ user, session }: {
1020
+ user: import("better-auth").User & Record<string, any>;
1021
+ session: import("better-auth").Session & Record<string, any>;
1022
+ }) => {
1023
+ id: string;
1024
+ ns: string;
1025
+ db: string;
1026
+ ac: string;
1027
+ email: string;
1028
+ name: string;
1029
+ role: string;
1030
+ sessionId: string;
1031
+ };
1032
+ };
1033
+ }>;
1034
+ endpoints: {
1035
+ getJwks: import("better-auth").StrictEndpoint<string, {
1036
+ method: "GET";
1037
+ metadata: {
1038
+ openapi: {
1039
+ operationId: string;
1040
+ description: string;
1041
+ responses: {
1042
+ "200": {
1043
+ description: string;
1044
+ content: {
1045
+ "application/json": {
1046
+ schema: {
1047
+ type: "object";
1048
+ properties: {
1049
+ keys: {
1050
+ type: string;
1051
+ description: string;
1052
+ items: {
1053
+ type: string;
1054
+ properties: {
1055
+ kid: {
1056
+ type: string;
1057
+ description: string;
1058
+ };
1059
+ kty: {
1060
+ type: string;
1061
+ description: string;
1062
+ };
1063
+ alg: {
1064
+ type: string;
1065
+ description: string;
1066
+ };
1067
+ use: {
1068
+ type: string;
1069
+ description: string;
1070
+ enum: string[];
1071
+ nullable: boolean;
1072
+ };
1073
+ n: {
1074
+ type: string;
1075
+ description: string;
1076
+ nullable: boolean;
1077
+ };
1078
+ e: {
1079
+ type: string;
1080
+ description: string;
1081
+ nullable: boolean;
1082
+ };
1083
+ crv: {
1084
+ type: string;
1085
+ description: string;
1086
+ nullable: boolean;
1087
+ };
1088
+ x: {
1089
+ type: string;
1090
+ description: string;
1091
+ nullable: boolean;
1092
+ };
1093
+ y: {
1094
+ type: string;
1095
+ description: string;
1096
+ nullable: boolean;
1097
+ };
1098
+ };
1099
+ required: string[];
1100
+ };
1101
+ };
1102
+ };
1103
+ required: string[];
1104
+ };
1105
+ };
1106
+ };
1107
+ };
1108
+ };
1109
+ };
1110
+ };
1111
+ }, import("better-auth").JSONWebKeySet>;
1112
+ getToken: import("better-auth").StrictEndpoint<"/token", {
1113
+ method: "GET";
1114
+ requireHeaders: true;
1115
+ use: ((inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1116
+ session: {
1117
+ session: Record<string, any> & {
1118
+ id: string;
1119
+ createdAt: Date;
1120
+ updatedAt: Date;
1121
+ userId: string;
1122
+ expiresAt: Date;
1123
+ token: string;
1124
+ ipAddress?: string | null | undefined;
1125
+ userAgent?: string | null | undefined;
1126
+ };
1127
+ user: Record<string, any> & {
1128
+ id: string;
1129
+ createdAt: Date;
1130
+ updatedAt: Date;
1131
+ email: string;
1132
+ emailVerified: boolean;
1133
+ name: string;
1134
+ image?: string | null | undefined;
1135
+ };
1136
+ };
1137
+ }>)[];
1138
+ metadata: {
1139
+ openapi: {
1140
+ operationId: string;
1141
+ description: string;
1142
+ responses: {
1143
+ 200: {
1144
+ description: string;
1145
+ content: {
1146
+ "application/json": {
1147
+ schema: {
1148
+ type: "object";
1149
+ properties: {
1150
+ token: {
1151
+ type: string;
1152
+ };
1153
+ };
1154
+ };
1155
+ };
1156
+ };
1157
+ };
1158
+ };
1159
+ };
1160
+ };
1161
+ }, {
1162
+ token: string;
1163
+ }>;
1164
+ signJWT: import("better-auth").StrictEndpoint<string, {
1165
+ method: "POST";
1166
+ metadata: {
1167
+ $Infer: {
1168
+ body: {
1169
+ payload: import("better-auth").JWTPayload;
1170
+ overrideOptions?: JwtOptions | undefined;
1171
+ };
1172
+ };
1173
+ };
1174
+ body: import("zod").ZodObject<{
1175
+ payload: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>;
1176
+ overrideOptions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
1177
+ }, import("better-auth").$strip>;
1178
+ }, {
1179
+ token: string;
1180
+ }>;
1181
+ verifyJWT: import("better-auth").StrictEndpoint<string, {
1182
+ method: "POST";
1183
+ metadata: {
1184
+ $Infer: {
1185
+ body: {
1186
+ token: string;
1187
+ issuer?: string;
1188
+ };
1189
+ response: {
1190
+ payload: {
1191
+ sub: string;
1192
+ aud: string;
1193
+ [key: string]: any;
1194
+ } | null;
1195
+ };
1196
+ };
1197
+ };
1198
+ body: import("zod").ZodObject<{
1199
+ token: import("zod").ZodString;
1200
+ issuer: import("zod").ZodOptional<import("zod").ZodString>;
1201
+ }, import("better-auth").$strip>;
1202
+ }, {
1203
+ payload: (import("better-auth").JWTPayload & Required<Pick<import("better-auth").JWTPayload, "sub" | "aud">>) | null;
1204
+ }>;
1205
+ };
1206
+ hooks: {
1207
+ after: {
1208
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
1209
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
1210
+ }[];
1211
+ };
1212
+ schema: {
1213
+ jwks: {
1214
+ fields: {
1215
+ publicKey: {
1216
+ type: "string";
1217
+ required: true;
1218
+ };
1219
+ privateKey: {
1220
+ type: "string";
1221
+ required: true;
1222
+ };
1223
+ createdAt: {
1224
+ type: "date";
1225
+ required: true;
1226
+ };
1227
+ expiresAt: {
1228
+ type: "date";
1229
+ required: false;
1230
+ };
1231
+ };
1232
+ };
1233
+ };
1234
+ } | {
1235
+ id: "tanstack-start-cookies";
1236
+ hooks: {
1237
+ after: {
1238
+ matcher(ctx: import("better-auth").HookEndpointContext): true;
1239
+ handler: (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>;
1240
+ }[];
1241
+ };
1242
+ })[];
1243
+ };