@sirketio/auth 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (594) hide show
  1. package/dist/_virtual/_rolldown/runtime.mjs +36 -0
  2. package/dist/adapter/index.d.mts +4 -0
  3. package/dist/adapter/index.mjs +7 -0
  4. package/dist/api/index.d.mts +3872 -0
  5. package/dist/api/index.mjs +206 -0
  6. package/dist/api/index.mjs.map +1 -0
  7. package/dist/api/middlewares/index.d.mts +1 -0
  8. package/dist/api/middlewares/index.mjs +3 -0
  9. package/dist/api/middlewares/origin-check.d.mts +18 -0
  10. package/dist/api/middlewares/origin-check.mjs +140 -0
  11. package/dist/api/middlewares/origin-check.mjs.map +1 -0
  12. package/dist/api/rate-limiter/index.mjs +204 -0
  13. package/dist/api/rate-limiter/index.mjs.map +1 -0
  14. package/dist/api/routes/account.d.mts +410 -0
  15. package/dist/api/routes/account.mjs +493 -0
  16. package/dist/api/routes/account.mjs.map +1 -0
  17. package/dist/api/routes/callback.d.mts +31 -0
  18. package/dist/api/routes/callback.mjs +179 -0
  19. package/dist/api/routes/callback.mjs.map +1 -0
  20. package/dist/api/routes/email-verification.d.mts +161 -0
  21. package/dist/api/routes/email-verification.mjs +299 -0
  22. package/dist/api/routes/email-verification.mjs.map +1 -0
  23. package/dist/api/routes/error.d.mts +28 -0
  24. package/dist/api/routes/error.mjs +386 -0
  25. package/dist/api/routes/error.mjs.map +1 -0
  26. package/dist/api/routes/index.d.mts +11 -0
  27. package/dist/api/routes/index.mjs +13 -0
  28. package/dist/api/routes/ok.d.mts +36 -0
  29. package/dist/api/routes/ok.mjs +30 -0
  30. package/dist/api/routes/ok.mjs.map +1 -0
  31. package/dist/api/routes/password.d.mts +182 -0
  32. package/dist/api/routes/password.mjs +198 -0
  33. package/dist/api/routes/password.mjs.map +1 -0
  34. package/dist/api/routes/session.d.mts +415 -0
  35. package/dist/api/routes/session.mjs +483 -0
  36. package/dist/api/routes/session.mjs.map +1 -0
  37. package/dist/api/routes/sign-in.d.mts +171 -0
  38. package/dist/api/routes/sign-in.mjs +263 -0
  39. package/dist/api/routes/sign-in.mjs.map +1 -0
  40. package/dist/api/routes/sign-out.d.mts +36 -0
  41. package/dist/api/routes/sign-out.mjs +33 -0
  42. package/dist/api/routes/sign-out.mjs.map +1 -0
  43. package/dist/api/routes/sign-up.d.mts +160 -0
  44. package/dist/api/routes/sign-up.mjs +227 -0
  45. package/dist/api/routes/sign-up.mjs.map +1 -0
  46. package/dist/api/routes/update-user.d.mts +445 -0
  47. package/dist/api/routes/update-user.mjs +493 -0
  48. package/dist/api/routes/update-user.mjs.map +1 -0
  49. package/dist/api/state/oauth.d.mts +18 -0
  50. package/dist/api/state/oauth.mjs +8 -0
  51. package/dist/api/state/oauth.mjs.map +1 -0
  52. package/dist/api/state/should-session-refresh.d.mts +13 -0
  53. package/dist/api/state/should-session-refresh.mjs +16 -0
  54. package/dist/api/state/should-session-refresh.mjs.map +1 -0
  55. package/dist/api/to-auth-endpoints.mjs +197 -0
  56. package/dist/api/to-auth-endpoints.mjs.map +1 -0
  57. package/dist/auth/base.mjs +45 -0
  58. package/dist/auth/base.mjs.map +1 -0
  59. package/dist/auth/minimal.d.mts +12 -0
  60. package/dist/auth/minimal.mjs +14 -0
  61. package/dist/auth/minimal.mjs.map +1 -0
  62. package/dist/auth/trusted-origins.mjs +31 -0
  63. package/dist/auth/trusted-origins.mjs.map +1 -0
  64. package/dist/client/broadcast-channel.d.mts +20 -0
  65. package/dist/client/broadcast-channel.mjs +46 -0
  66. package/dist/client/broadcast-channel.mjs.map +1 -0
  67. package/dist/client/config.mjs +90 -0
  68. package/dist/client/config.mjs.map +1 -0
  69. package/dist/client/fetch-plugins.mjs +18 -0
  70. package/dist/client/fetch-plugins.mjs.map +1 -0
  71. package/dist/client/focus-manager.d.mts +11 -0
  72. package/dist/client/focus-manager.mjs +32 -0
  73. package/dist/client/focus-manager.mjs.map +1 -0
  74. package/dist/client/index.d.mts +33 -0
  75. package/dist/client/index.mjs +21 -0
  76. package/dist/client/index.mjs.map +1 -0
  77. package/dist/client/online-manager.d.mts +12 -0
  78. package/dist/client/online-manager.mjs +35 -0
  79. package/dist/client/online-manager.mjs.map +1 -0
  80. package/dist/client/parser.mjs +73 -0
  81. package/dist/client/parser.mjs.map +1 -0
  82. package/dist/client/path-to-object.d.mts +65 -0
  83. package/dist/client/plugins/index.d.mts +53 -0
  84. package/dist/client/plugins/index.mjs +30 -0
  85. package/dist/client/plugins/infer-plugin.d.mts +16 -0
  86. package/dist/client/plugins/infer-plugin.mjs +11 -0
  87. package/dist/client/plugins/infer-plugin.mjs.map +1 -0
  88. package/dist/client/proxy.mjs +79 -0
  89. package/dist/client/proxy.mjs.map +1 -0
  90. package/dist/client/query.d.mts +23 -0
  91. package/dist/client/query.mjs +98 -0
  92. package/dist/client/query.mjs.map +1 -0
  93. package/dist/client/react/index.d.mts +128 -0
  94. package/dist/client/react/index.mjs +24 -0
  95. package/dist/client/react/index.mjs.map +1 -0
  96. package/dist/client/react/react-store.d.mts +47 -0
  97. package/dist/client/react/react-store.mjs +47 -0
  98. package/dist/client/react/react-store.mjs.map +1 -0
  99. package/dist/client/session-atom.mjs +29 -0
  100. package/dist/client/session-atom.mjs.map +1 -0
  101. package/dist/client/session-refresh.d.mts +28 -0
  102. package/dist/client/session-refresh.mjs +140 -0
  103. package/dist/client/session-refresh.mjs.map +1 -0
  104. package/dist/client/types.d.mts +41 -0
  105. package/dist/client/vanilla.d.mts +127 -0
  106. package/dist/client/vanilla.mjs +20 -0
  107. package/dist/client/vanilla.mjs.map +1 -0
  108. package/dist/context/create-context.mjs +211 -0
  109. package/dist/context/create-context.mjs.map +1 -0
  110. package/dist/context/helpers.mjs +83 -0
  111. package/dist/context/helpers.mjs.map +1 -0
  112. package/dist/context/init.mjs +20 -0
  113. package/dist/context/init.mjs.map +1 -0
  114. package/dist/cookies/cookie-utils.d.mts +29 -0
  115. package/dist/cookies/cookie-utils.mjs +105 -0
  116. package/dist/cookies/cookie-utils.mjs.map +1 -0
  117. package/dist/cookies/index.d.mts +121 -0
  118. package/dist/cookies/index.mjs +261 -0
  119. package/dist/cookies/index.mjs.map +1 -0
  120. package/dist/cookies/session-store.d.mts +36 -0
  121. package/dist/cookies/session-store.mjs +200 -0
  122. package/dist/cookies/session-store.mjs.map +1 -0
  123. package/dist/crypto/buffer.d.mts +8 -0
  124. package/dist/crypto/buffer.mjs +18 -0
  125. package/dist/crypto/buffer.mjs.map +1 -0
  126. package/dist/crypto/index.d.mts +27 -0
  127. package/dist/crypto/index.mjs +38 -0
  128. package/dist/crypto/index.mjs.map +1 -0
  129. package/dist/crypto/jwt.d.mts +8 -0
  130. package/dist/crypto/jwt.mjs +95 -0
  131. package/dist/crypto/jwt.mjs.map +1 -0
  132. package/dist/crypto/password.d.mts +12 -0
  133. package/dist/crypto/password.mjs +36 -0
  134. package/dist/crypto/password.mjs.map +1 -0
  135. package/dist/crypto/random.d.mts +5 -0
  136. package/dist/crypto/random.mjs +8 -0
  137. package/dist/crypto/random.mjs.map +1 -0
  138. package/dist/db/adapter-base.d.mts +8 -0
  139. package/dist/db/adapter-base.mjs +19 -0
  140. package/dist/db/adapter-base.mjs.map +1 -0
  141. package/dist/db/field-converter.d.mts +8 -0
  142. package/dist/db/field-converter.mjs +21 -0
  143. package/dist/db/field-converter.mjs.map +1 -0
  144. package/dist/db/field.d.mts +42 -0
  145. package/dist/db/get-schema.d.mts +11 -0
  146. package/dist/db/get-schema.mjs +39 -0
  147. package/dist/db/get-schema.mjs.map +1 -0
  148. package/dist/db/index.d.mts +18 -0
  149. package/dist/db/index.mjs +34 -0
  150. package/dist/db/index.mjs.map +1 -0
  151. package/dist/db/internal-adapter.d.mts +14 -0
  152. package/dist/db/internal-adapter.mjs +616 -0
  153. package/dist/db/internal-adapter.mjs.map +1 -0
  154. package/dist/db/schema.d.mts +49 -0
  155. package/dist/db/schema.mjs +118 -0
  156. package/dist/db/schema.mjs.map +1 -0
  157. package/dist/db/to-zod.d.mts +36 -0
  158. package/dist/db/to-zod.mjs +26 -0
  159. package/dist/db/to-zod.mjs.map +1 -0
  160. package/dist/db/verification-token-storage.mjs +28 -0
  161. package/dist/db/verification-token-storage.mjs.map +1 -0
  162. package/dist/db/with-hooks.d.mts +33 -0
  163. package/dist/db/with-hooks.mjs +159 -0
  164. package/dist/db/with-hooks.mjs.map +1 -0
  165. package/dist/index.d.mts +53 -0
  166. package/dist/index.mjs +27 -0
  167. package/dist/integrations/next-js.d.mts +29 -0
  168. package/dist/integrations/next-js.mjs +85 -0
  169. package/dist/integrations/next-js.mjs.map +1 -0
  170. package/dist/oauth2/index.d.mts +5 -0
  171. package/dist/oauth2/index.mjs +7 -0
  172. package/dist/oauth2/link-account.d.mts +48 -0
  173. package/dist/oauth2/link-account.mjs +143 -0
  174. package/dist/oauth2/link-account.mjs.map +1 -0
  175. package/dist/oauth2/state.d.mts +26 -0
  176. package/dist/oauth2/state.mjs +51 -0
  177. package/dist/oauth2/state.mjs.map +1 -0
  178. package/dist/oauth2/utils.d.mts +8 -0
  179. package/dist/oauth2/utils.mjs +31 -0
  180. package/dist/oauth2/utils.mjs.map +1 -0
  181. package/dist/plugins/access/access.d.mts +30 -0
  182. package/dist/plugins/access/access.mjs +46 -0
  183. package/dist/plugins/access/access.mjs.map +1 -0
  184. package/dist/plugins/access/index.d.mts +3 -0
  185. package/dist/plugins/access/index.mjs +3 -0
  186. package/dist/plugins/access/types.d.mts +17 -0
  187. package/dist/plugins/additional-fields/client.d.mts +96 -0
  188. package/dist/plugins/additional-fields/client.mjs +11 -0
  189. package/dist/plugins/additional-fields/client.mjs.map +1 -0
  190. package/dist/plugins/admin/access/index.d.mts +2 -0
  191. package/dist/plugins/admin/access/index.mjs +3 -0
  192. package/dist/plugins/admin/access/statement.d.mts +118 -0
  193. package/dist/plugins/admin/access/statement.mjs +53 -0
  194. package/dist/plugins/admin/access/statement.mjs.map +1 -0
  195. package/dist/plugins/admin/admin.d.mts +911 -0
  196. package/dist/plugins/admin/admin.mjs +95 -0
  197. package/dist/plugins/admin/admin.mjs.map +1 -0
  198. package/dist/plugins/admin/client.d.mts +76 -0
  199. package/dist/plugins/admin/client.mjs +36 -0
  200. package/dist/plugins/admin/client.mjs.map +1 -0
  201. package/dist/plugins/admin/error-codes.d.mts +29 -0
  202. package/dist/plugins/admin/error-codes.mjs +30 -0
  203. package/dist/plugins/admin/error-codes.mjs.map +1 -0
  204. package/dist/plugins/admin/has-permission.mjs +16 -0
  205. package/dist/plugins/admin/has-permission.mjs.map +1 -0
  206. package/dist/plugins/admin/index.d.mts +3 -0
  207. package/dist/plugins/admin/index.mjs +3 -0
  208. package/dist/plugins/admin/routes.mjs +841 -0
  209. package/dist/plugins/admin/routes.mjs.map +1 -0
  210. package/dist/plugins/admin/schema.d.mts +40 -0
  211. package/dist/plugins/admin/schema.mjs +34 -0
  212. package/dist/plugins/admin/schema.mjs.map +1 -0
  213. package/dist/plugins/admin/types.d.mts +89 -0
  214. package/dist/plugins/api-key/adapter.mjs +468 -0
  215. package/dist/plugins/api-key/adapter.mjs.map +1 -0
  216. package/dist/plugins/api-key/client.d.mts +46 -0
  217. package/dist/plugins/api-key/client.mjs +19 -0
  218. package/dist/plugins/api-key/client.mjs.map +1 -0
  219. package/dist/plugins/api-key/error-codes.d.mts +33 -0
  220. package/dist/plugins/api-key/error-codes.mjs +34 -0
  221. package/dist/plugins/api-key/error-codes.mjs.map +1 -0
  222. package/dist/plugins/api-key/index.d.mts +1251 -0
  223. package/dist/plugins/api-key/index.mjs +134 -0
  224. package/dist/plugins/api-key/index.mjs.map +1 -0
  225. package/dist/plugins/api-key/rate-limit.mjs +74 -0
  226. package/dist/plugins/api-key/rate-limit.mjs.map +1 -0
  227. package/dist/plugins/api-key/routes/create-api-key.mjs +252 -0
  228. package/dist/plugins/api-key/routes/create-api-key.mjs.map +1 -0
  229. package/dist/plugins/api-key/routes/delete-all-expired-api-keys.mjs +24 -0
  230. package/dist/plugins/api-key/routes/delete-all-expired-api-keys.mjs.map +1 -0
  231. package/dist/plugins/api-key/routes/delete-api-key.mjs +74 -0
  232. package/dist/plugins/api-key/routes/delete-api-key.mjs.map +1 -0
  233. package/dist/plugins/api-key/routes/get-api-key.mjs +158 -0
  234. package/dist/plugins/api-key/routes/get-api-key.mjs.map +1 -0
  235. package/dist/plugins/api-key/routes/index.mjs +71 -0
  236. package/dist/plugins/api-key/routes/index.mjs.map +1 -0
  237. package/dist/plugins/api-key/routes/list-api-keys.mjs +194 -0
  238. package/dist/plugins/api-key/routes/list-api-keys.mjs.map +1 -0
  239. package/dist/plugins/api-key/routes/update-api-key.mjs +248 -0
  240. package/dist/plugins/api-key/routes/update-api-key.mjs.map +1 -0
  241. package/dist/plugins/api-key/routes/verify-api-key.mjs +224 -0
  242. package/dist/plugins/api-key/routes/verify-api-key.mjs.map +1 -0
  243. package/dist/plugins/api-key/schema.d.mts +199 -0
  244. package/dist/plugins/api-key/schema.mjs +130 -0
  245. package/dist/plugins/api-key/schema.mjs.map +1 -0
  246. package/dist/plugins/api-key/types.d.mts +346 -0
  247. package/dist/plugins/bearer/index.d.mts +45 -0
  248. package/dist/plugins/bearer/index.mjs +66 -0
  249. package/dist/plugins/bearer/index.mjs.map +1 -0
  250. package/dist/plugins/captcha/constants.d.mts +10 -0
  251. package/dist/plugins/captcha/constants.mjs +22 -0
  252. package/dist/plugins/captcha/constants.mjs.map +1 -0
  253. package/dist/plugins/captcha/error-codes.mjs +16 -0
  254. package/dist/plugins/captcha/error-codes.mjs.map +1 -0
  255. package/dist/plugins/captcha/index.d.mts +21 -0
  256. package/dist/plugins/captcha/index.mjs +62 -0
  257. package/dist/plugins/captcha/index.mjs.map +1 -0
  258. package/dist/plugins/captcha/types.d.mts +28 -0
  259. package/dist/plugins/captcha/utils.mjs +11 -0
  260. package/dist/plugins/captcha/utils.mjs.map +1 -0
  261. package/dist/plugins/captcha/verify-handlers/captchafox.mjs +28 -0
  262. package/dist/plugins/captcha/verify-handlers/captchafox.mjs.map +1 -0
  263. package/dist/plugins/captcha/verify-handlers/cloudflare-turnstile.mjs +26 -0
  264. package/dist/plugins/captcha/verify-handlers/cloudflare-turnstile.mjs.map +1 -0
  265. package/dist/plugins/captcha/verify-handlers/google-recaptcha.mjs +30 -0
  266. package/dist/plugins/captcha/verify-handlers/google-recaptcha.mjs.map +1 -0
  267. package/dist/plugins/captcha/verify-handlers/h-captcha.mjs +28 -0
  268. package/dist/plugins/captcha/verify-handlers/h-captcha.mjs.map +1 -0
  269. package/dist/plugins/captcha/verify-handlers/index.mjs +6 -0
  270. package/dist/plugins/custom-session/client.d.mts +17 -0
  271. package/dist/plugins/custom-session/client.mjs +11 -0
  272. package/dist/plugins/custom-session/client.mjs.map +1 -0
  273. package/dist/plugins/custom-session/index.d.mts +72 -0
  274. package/dist/plugins/custom-session/index.mjs +78 -0
  275. package/dist/plugins/custom-session/index.mjs.map +1 -0
  276. package/dist/plugins/device-authorization/client.d.mts +17 -0
  277. package/dist/plugins/device-authorization/client.mjs +18 -0
  278. package/dist/plugins/device-authorization/client.mjs.map +1 -0
  279. package/dist/plugins/device-authorization/error-codes.mjs +21 -0
  280. package/dist/plugins/device-authorization/error-codes.mjs.map +1 -0
  281. package/dist/plugins/device-authorization/index.d.mts +424 -0
  282. package/dist/plugins/device-authorization/index.mjs +50 -0
  283. package/dist/plugins/device-authorization/index.mjs.map +1 -0
  284. package/dist/plugins/device-authorization/routes.mjs +510 -0
  285. package/dist/plugins/device-authorization/routes.mjs.map +1 -0
  286. package/dist/plugins/device-authorization/schema.mjs +57 -0
  287. package/dist/plugins/device-authorization/schema.mjs.map +1 -0
  288. package/dist/plugins/email-otp/client.d.mts +21 -0
  289. package/dist/plugins/email-otp/client.mjs +18 -0
  290. package/dist/plugins/email-otp/client.mjs.map +1 -0
  291. package/dist/plugins/email-otp/error-codes.d.mts +11 -0
  292. package/dist/plugins/email-otp/error-codes.mjs +12 -0
  293. package/dist/plugins/email-otp/error-codes.mjs.map +1 -0
  294. package/dist/plugins/email-otp/index.d.mts +428 -0
  295. package/dist/plugins/email-otp/index.mjs +130 -0
  296. package/dist/plugins/email-otp/index.mjs.map +1 -0
  297. package/dist/plugins/email-otp/otp-token.mjs +29 -0
  298. package/dist/plugins/email-otp/otp-token.mjs.map +1 -0
  299. package/dist/plugins/email-otp/routes.mjs +631 -0
  300. package/dist/plugins/email-otp/routes.mjs.map +1 -0
  301. package/dist/plugins/email-otp/types.d.mts +86 -0
  302. package/dist/plugins/email-otp/utils.mjs +17 -0
  303. package/dist/plugins/email-otp/utils.mjs.map +1 -0
  304. package/dist/plugins/generic-oauth/client.d.mts +33 -0
  305. package/dist/plugins/generic-oauth/client.mjs +14 -0
  306. package/dist/plugins/generic-oauth/client.mjs.map +1 -0
  307. package/dist/plugins/generic-oauth/error-codes.d.mts +16 -0
  308. package/dist/plugins/generic-oauth/error-codes.mjs +17 -0
  309. package/dist/plugins/generic-oauth/error-codes.mjs.map +1 -0
  310. package/dist/plugins/generic-oauth/index.d.mts +201 -0
  311. package/dist/plugins/generic-oauth/index.mjs +145 -0
  312. package/dist/plugins/generic-oauth/index.mjs.map +1 -0
  313. package/dist/plugins/generic-oauth/providers/auth0.d.mts +37 -0
  314. package/dist/plugins/generic-oauth/providers/auth0.mjs +62 -0
  315. package/dist/plugins/generic-oauth/providers/auth0.mjs.map +1 -0
  316. package/dist/plugins/generic-oauth/providers/gumroad.d.mts +32 -0
  317. package/dist/plugins/generic-oauth/providers/gumroad.mjs +60 -0
  318. package/dist/plugins/generic-oauth/providers/gumroad.mjs.map +1 -0
  319. package/dist/plugins/generic-oauth/providers/hubspot.d.mts +37 -0
  320. package/dist/plugins/generic-oauth/providers/hubspot.mjs +60 -0
  321. package/dist/plugins/generic-oauth/providers/hubspot.mjs.map +1 -0
  322. package/dist/plugins/generic-oauth/providers/index.d.mts +9 -0
  323. package/dist/plugins/generic-oauth/providers/index.mjs +11 -0
  324. package/dist/plugins/generic-oauth/providers/keycloak.d.mts +37 -0
  325. package/dist/plugins/generic-oauth/providers/keycloak.mjs +62 -0
  326. package/dist/plugins/generic-oauth/providers/keycloak.mjs.map +1 -0
  327. package/dist/plugins/generic-oauth/providers/line.d.mts +55 -0
  328. package/dist/plugins/generic-oauth/providers/line.mjs +91 -0
  329. package/dist/plugins/generic-oauth/providers/line.mjs.map +1 -0
  330. package/dist/plugins/generic-oauth/providers/microsoft-entra-id.d.mts +37 -0
  331. package/dist/plugins/generic-oauth/providers/microsoft-entra-id.mjs +66 -0
  332. package/dist/plugins/generic-oauth/providers/microsoft-entra-id.mjs.map +1 -0
  333. package/dist/plugins/generic-oauth/providers/okta.d.mts +37 -0
  334. package/dist/plugins/generic-oauth/providers/okta.mjs +62 -0
  335. package/dist/plugins/generic-oauth/providers/okta.mjs.map +1 -0
  336. package/dist/plugins/generic-oauth/providers/patreon.d.mts +30 -0
  337. package/dist/plugins/generic-oauth/providers/patreon.mjs +59 -0
  338. package/dist/plugins/generic-oauth/providers/patreon.mjs.map +1 -0
  339. package/dist/plugins/generic-oauth/providers/slack.d.mts +30 -0
  340. package/dist/plugins/generic-oauth/providers/slack.mjs +61 -0
  341. package/dist/plugins/generic-oauth/providers/slack.mjs.map +1 -0
  342. package/dist/plugins/generic-oauth/routes.mjs +411 -0
  343. package/dist/plugins/generic-oauth/routes.mjs.map +1 -0
  344. package/dist/plugins/generic-oauth/types.d.mts +159 -0
  345. package/dist/plugins/haveibeenpwned/index.d.mts +46 -0
  346. package/dist/plugins/haveibeenpwned/index.mjs +57 -0
  347. package/dist/plugins/haveibeenpwned/index.mjs.map +1 -0
  348. package/dist/plugins/index.d.mts +65 -0
  349. package/dist/plugins/index.mjs +48 -0
  350. package/dist/plugins/jwt/adapter.mjs +27 -0
  351. package/dist/plugins/jwt/adapter.mjs.map +1 -0
  352. package/dist/plugins/jwt/client.d.mts +40 -0
  353. package/dist/plugins/jwt/client.mjs +19 -0
  354. package/dist/plugins/jwt/client.mjs.map +1 -0
  355. package/dist/plugins/jwt/index.d.mts +224 -0
  356. package/dist/plugins/jwt/index.mjs +202 -0
  357. package/dist/plugins/jwt/index.mjs.map +1 -0
  358. package/dist/plugins/jwt/schema.d.mts +26 -0
  359. package/dist/plugins/jwt/schema.mjs +23 -0
  360. package/dist/plugins/jwt/schema.mjs.map +1 -0
  361. package/dist/plugins/jwt/sign.d.mts +57 -0
  362. package/dist/plugins/jwt/sign.mjs +66 -0
  363. package/dist/plugins/jwt/sign.mjs.map +1 -0
  364. package/dist/plugins/jwt/types.d.mts +194 -0
  365. package/dist/plugins/jwt/utils.d.mts +42 -0
  366. package/dist/plugins/jwt/utils.mjs +64 -0
  367. package/dist/plugins/jwt/utils.mjs.map +1 -0
  368. package/dist/plugins/jwt/verify.d.mts +12 -0
  369. package/dist/plugins/jwt/verify.mjs +46 -0
  370. package/dist/plugins/jwt/verify.mjs.map +1 -0
  371. package/dist/plugins/last-login-method/client.d.mts +38 -0
  372. package/dist/plugins/last-login-method/client.mjs +32 -0
  373. package/dist/plugins/last-login-method/client.mjs.map +1 -0
  374. package/dist/plugins/last-login-method/index.d.mts +118 -0
  375. package/dist/plugins/last-login-method/index.mjs +76 -0
  376. package/dist/plugins/last-login-method/index.mjs.map +1 -0
  377. package/dist/plugins/magic-link/client.d.mts +10 -0
  378. package/dist/plugins/magic-link/client.mjs +11 -0
  379. package/dist/plugins/magic-link/client.mjs.map +1 -0
  380. package/dist/plugins/magic-link/index.d.mts +193 -0
  381. package/dist/plugins/magic-link/index.mjs +177 -0
  382. package/dist/plugins/magic-link/index.mjs.map +1 -0
  383. package/dist/plugins/magic-link/utils.mjs +12 -0
  384. package/dist/plugins/magic-link/utils.mjs.map +1 -0
  385. package/dist/plugins/mcp/authorize.mjs +133 -0
  386. package/dist/plugins/mcp/authorize.mjs.map +1 -0
  387. package/dist/plugins/mcp/index.d.mts +458 -0
  388. package/dist/plugins/mcp/index.mjs +717 -0
  389. package/dist/plugins/mcp/index.mjs.map +1 -0
  390. package/dist/plugins/multi-session/client.d.mts +19 -0
  391. package/dist/plugins/multi-session/client.mjs +20 -0
  392. package/dist/plugins/multi-session/client.mjs.map +1 -0
  393. package/dist/plugins/multi-session/error-codes.d.mts +9 -0
  394. package/dist/plugins/multi-session/error-codes.mjs +8 -0
  395. package/dist/plugins/multi-session/error-codes.mjs.map +1 -0
  396. package/dist/plugins/multi-session/index.d.mts +235 -0
  397. package/dist/plugins/multi-session/index.mjs +172 -0
  398. package/dist/plugins/multi-session/index.mjs.map +1 -0
  399. package/dist/plugins/oauth-proxy/index.d.mts +97 -0
  400. package/dist/plugins/oauth-proxy/index.mjs +305 -0
  401. package/dist/plugins/oauth-proxy/index.mjs.map +1 -0
  402. package/dist/plugins/oauth-proxy/utils.mjs +51 -0
  403. package/dist/plugins/oauth-proxy/utils.mjs.map +1 -0
  404. package/dist/plugins/oidc-provider/authorize.mjs +194 -0
  405. package/dist/plugins/oidc-provider/authorize.mjs.map +1 -0
  406. package/dist/plugins/oidc-provider/client.d.mts +12 -0
  407. package/dist/plugins/oidc-provider/client.mjs +11 -0
  408. package/dist/plugins/oidc-provider/client.mjs.map +1 -0
  409. package/dist/plugins/oidc-provider/error.mjs +17 -0
  410. package/dist/plugins/oidc-provider/error.mjs.map +1 -0
  411. package/dist/plugins/oidc-provider/index.d.mts +702 -0
  412. package/dist/plugins/oidc-provider/index.mjs +1093 -0
  413. package/dist/plugins/oidc-provider/index.mjs.map +1 -0
  414. package/dist/plugins/oidc-provider/schema.d.mts +160 -0
  415. package/dist/plugins/oidc-provider/schema.mjs +132 -0
  416. package/dist/plugins/oidc-provider/schema.mjs.map +1 -0
  417. package/dist/plugins/oidc-provider/types.d.mts +517 -0
  418. package/dist/plugins/oidc-provider/utils/prompt.mjs +19 -0
  419. package/dist/plugins/oidc-provider/utils/prompt.mjs.map +1 -0
  420. package/dist/plugins/oidc-provider/utils.mjs +15 -0
  421. package/dist/plugins/oidc-provider/utils.mjs.map +1 -0
  422. package/dist/plugins/one-tap/client.d.mts +174 -0
  423. package/dist/plugins/one-tap/client.mjs +188 -0
  424. package/dist/plugins/one-tap/client.mjs.map +1 -0
  425. package/dist/plugins/one-tap/index.d.mts +83 -0
  426. package/dist/plugins/one-tap/index.mjs +95 -0
  427. package/dist/plugins/one-tap/index.mjs.map +1 -0
  428. package/dist/plugins/one-time-token/client.d.mts +10 -0
  429. package/dist/plugins/one-time-token/client.mjs +11 -0
  430. package/dist/plugins/one-time-token/client.mjs.map +1 -0
  431. package/dist/plugins/one-time-token/index.d.mts +133 -0
  432. package/dist/plugins/one-time-token/index.mjs +82 -0
  433. package/dist/plugins/one-time-token/index.mjs.map +1 -0
  434. package/dist/plugins/one-time-token/utils.mjs +12 -0
  435. package/dist/plugins/one-time-token/utils.mjs.map +1 -0
  436. package/dist/plugins/open-api/generator.d.mts +115 -0
  437. package/dist/plugins/open-api/generator.mjs +315 -0
  438. package/dist/plugins/open-api/generator.mjs.map +1 -0
  439. package/dist/plugins/open-api/index.d.mts +97 -0
  440. package/dist/plugins/open-api/index.mjs +67 -0
  441. package/dist/plugins/open-api/index.mjs.map +1 -0
  442. package/dist/plugins/open-api/logo.mjs +15 -0
  443. package/dist/plugins/open-api/logo.mjs.map +1 -0
  444. package/dist/plugins/organization/access/index.d.mts +2 -0
  445. package/dist/plugins/organization/access/index.mjs +3 -0
  446. package/dist/plugins/organization/access/statement.d.mts +249 -0
  447. package/dist/plugins/organization/access/statement.mjs +81 -0
  448. package/dist/plugins/organization/access/statement.mjs.map +1 -0
  449. package/dist/plugins/organization/adapter.d.mts +792 -0
  450. package/dist/plugins/organization/adapter.mjs +624 -0
  451. package/dist/plugins/organization/adapter.mjs.map +1 -0
  452. package/dist/plugins/organization/call.mjs +19 -0
  453. package/dist/plugins/organization/call.mjs.map +1 -0
  454. package/dist/plugins/organization/client.d.mts +372 -0
  455. package/dist/plugins/organization/client.mjs +95 -0
  456. package/dist/plugins/organization/client.mjs.map +1 -0
  457. package/dist/plugins/organization/error-codes.d.mts +65 -0
  458. package/dist/plugins/organization/error-codes.mjs +66 -0
  459. package/dist/plugins/organization/error-codes.mjs.map +1 -0
  460. package/dist/plugins/organization/has-permission.mjs +35 -0
  461. package/dist/plugins/organization/has-permission.mjs.map +1 -0
  462. package/dist/plugins/organization/index.d.mts +5 -0
  463. package/dist/plugins/organization/index.mjs +4 -0
  464. package/dist/plugins/organization/organization.d.mts +394 -0
  465. package/dist/plugins/organization/organization.mjs +428 -0
  466. package/dist/plugins/organization/organization.mjs.map +1 -0
  467. package/dist/plugins/organization/permission.d.mts +17 -0
  468. package/dist/plugins/organization/permission.mjs +16 -0
  469. package/dist/plugins/organization/permission.mjs.map +1 -0
  470. package/dist/plugins/organization/routes/crud-access-control.d.mts +394 -0
  471. package/dist/plugins/organization/routes/crud-access-control.mjs +678 -0
  472. package/dist/plugins/organization/routes/crud-access-control.mjs.map +1 -0
  473. package/dist/plugins/organization/routes/crud-invites.d.mts +1031 -0
  474. package/dist/plugins/organization/routes/crud-invites.mjs +551 -0
  475. package/dist/plugins/organization/routes/crud-invites.mjs.map +1 -0
  476. package/dist/plugins/organization/routes/crud-members.d.mts +940 -0
  477. package/dist/plugins/organization/routes/crud-members.mjs +466 -0
  478. package/dist/plugins/organization/routes/crud-members.mjs.map +1 -0
  479. package/dist/plugins/organization/routes/crud-org.d.mts +708 -0
  480. package/dist/plugins/organization/routes/crud-org.mjs +423 -0
  481. package/dist/plugins/organization/routes/crud-org.mjs.map +1 -0
  482. package/dist/plugins/organization/routes/crud-team.d.mts +1071 -0
  483. package/dist/plugins/organization/routes/crud-team.mjs +676 -0
  484. package/dist/plugins/organization/routes/crud-team.mjs.map +1 -0
  485. package/dist/plugins/organization/schema.d.mts +376 -0
  486. package/dist/plugins/organization/schema.mjs +68 -0
  487. package/dist/plugins/organization/schema.mjs.map +1 -0
  488. package/dist/plugins/organization/types.d.mts +677 -0
  489. package/dist/plugins/phone-number/client.d.mts +31 -0
  490. package/dist/plugins/phone-number/client.mjs +20 -0
  491. package/dist/plugins/phone-number/client.mjs.map +1 -0
  492. package/dist/plugins/phone-number/error-codes.d.mts +20 -0
  493. package/dist/plugins/phone-number/error-codes.mjs +21 -0
  494. package/dist/plugins/phone-number/error-codes.mjs.map +1 -0
  495. package/dist/plugins/phone-number/index.d.mts +318 -0
  496. package/dist/plugins/phone-number/index.mjs +49 -0
  497. package/dist/plugins/phone-number/index.mjs.map +1 -0
  498. package/dist/plugins/phone-number/routes.mjs +472 -0
  499. package/dist/plugins/phone-number/routes.mjs.map +1 -0
  500. package/dist/plugins/phone-number/schema.d.mts +23 -0
  501. package/dist/plugins/phone-number/schema.mjs +20 -0
  502. package/dist/plugins/phone-number/schema.mjs.map +1 -0
  503. package/dist/plugins/phone-number/types.d.mts +118 -0
  504. package/dist/plugins/two-factor/backup-codes/index.d.mts +279 -0
  505. package/dist/plugins/two-factor/backup-codes/index.mjs +277 -0
  506. package/dist/plugins/two-factor/backup-codes/index.mjs.map +1 -0
  507. package/dist/plugins/two-factor/client.d.mts +55 -0
  508. package/dist/plugins/two-factor/client.mjs +37 -0
  509. package/dist/plugins/two-factor/client.mjs.map +1 -0
  510. package/dist/plugins/two-factor/constant.mjs +8 -0
  511. package/dist/plugins/two-factor/constant.mjs.map +1 -0
  512. package/dist/plugins/two-factor/error-code.d.mts +17 -0
  513. package/dist/plugins/two-factor/error-code.mjs +18 -0
  514. package/dist/plugins/two-factor/error-code.mjs.map +1 -0
  515. package/dist/plugins/two-factor/index.d.mts +670 -0
  516. package/dist/plugins/two-factor/index.mjs +228 -0
  517. package/dist/plugins/two-factor/index.mjs.map +1 -0
  518. package/dist/plugins/two-factor/otp/index.d.mts +216 -0
  519. package/dist/plugins/two-factor/otp/index.mjs +199 -0
  520. package/dist/plugins/two-factor/otp/index.mjs.map +1 -0
  521. package/dist/plugins/two-factor/schema.d.mts +41 -0
  522. package/dist/plugins/two-factor/schema.mjs +36 -0
  523. package/dist/plugins/two-factor/schema.mjs.map +1 -0
  524. package/dist/plugins/two-factor/totp/index.d.mts +210 -0
  525. package/dist/plugins/two-factor/totp/index.mjs +157 -0
  526. package/dist/plugins/two-factor/totp/index.mjs.map +1 -0
  527. package/dist/plugins/two-factor/types.d.mts +73 -0
  528. package/dist/plugins/two-factor/utils.mjs +12 -0
  529. package/dist/plugins/two-factor/utils.mjs.map +1 -0
  530. package/dist/plugins/two-factor/verify-two-factor.mjs +85 -0
  531. package/dist/plugins/two-factor/verify-two-factor.mjs.map +1 -0
  532. package/dist/plugins/username/client.d.mts +26 -0
  533. package/dist/plugins/username/client.mjs +18 -0
  534. package/dist/plugins/username/client.mjs.map +1 -0
  535. package/dist/plugins/username/error-codes.d.mts +16 -0
  536. package/dist/plugins/username/error-codes.mjs +17 -0
  537. package/dist/plugins/username/error-codes.mjs.map +1 -0
  538. package/dist/plugins/username/index.d.mts +251 -0
  539. package/dist/plugins/username/index.mjs +234 -0
  540. package/dist/plugins/username/index.mjs.map +1 -0
  541. package/dist/plugins/username/schema.d.mts +33 -0
  542. package/dist/plugins/username/schema.mjs +26 -0
  543. package/dist/plugins/username/schema.mjs.map +1 -0
  544. package/dist/providers/index.d.mts +1 -0
  545. package/dist/providers/index.mjs +3 -0
  546. package/dist/state.d.mts +42 -0
  547. package/dist/state.mjs +107 -0
  548. package/dist/state.mjs.map +1 -0
  549. package/dist/types/adapter.d.mts +2 -0
  550. package/dist/types/api.d.mts +29 -0
  551. package/dist/types/auth.d.mts +29 -0
  552. package/dist/types/helper.d.mts +10 -0
  553. package/dist/types/index.d.mts +11 -0
  554. package/dist/types/index.mjs +1 -0
  555. package/dist/types/models.d.mts +11 -0
  556. package/dist/types/plugins.d.mts +20 -0
  557. package/dist/utils/boolean.mjs +8 -0
  558. package/dist/utils/boolean.mjs.map +1 -0
  559. package/dist/utils/constants.mjs +6 -0
  560. package/dist/utils/constants.mjs.map +1 -0
  561. package/dist/utils/date.mjs +8 -0
  562. package/dist/utils/date.mjs.map +1 -0
  563. package/dist/utils/get-request-ip.d.mts +7 -0
  564. package/dist/utils/get-request-ip.mjs +23 -0
  565. package/dist/utils/get-request-ip.mjs.map +1 -0
  566. package/dist/utils/hide-metadata.d.mts +7 -0
  567. package/dist/utils/hide-metadata.mjs +6 -0
  568. package/dist/utils/hide-metadata.mjs.map +1 -0
  569. package/dist/utils/index.d.mts +4 -0
  570. package/dist/utils/index.mjs +6 -0
  571. package/dist/utils/is-api-error.d.mts +7 -0
  572. package/dist/utils/is-api-error.mjs +11 -0
  573. package/dist/utils/is-api-error.mjs.map +1 -0
  574. package/dist/utils/is-atom.mjs +8 -0
  575. package/dist/utils/is-atom.mjs.map +1 -0
  576. package/dist/utils/is-promise.mjs +8 -0
  577. package/dist/utils/is-promise.mjs.map +1 -0
  578. package/dist/utils/middleware-response.mjs +9 -0
  579. package/dist/utils/middleware-response.mjs.map +1 -0
  580. package/dist/utils/password.mjs +26 -0
  581. package/dist/utils/password.mjs.map +1 -0
  582. package/dist/utils/plugin-helper.mjs +17 -0
  583. package/dist/utils/plugin-helper.mjs.map +1 -0
  584. package/dist/utils/shim.mjs +24 -0
  585. package/dist/utils/shim.mjs.map +1 -0
  586. package/dist/utils/time.d.mts +49 -0
  587. package/dist/utils/time.mjs +100 -0
  588. package/dist/utils/time.mjs.map +1 -0
  589. package/dist/utils/url.d.mts +8 -0
  590. package/dist/utils/url.mjs +92 -0
  591. package/dist/utils/url.mjs.map +1 -0
  592. package/dist/utils/wildcard.mjs +108 -0
  593. package/dist/utils/wildcard.mjs.map +1 -0
  594. package/package.json +428 -0
@@ -0,0 +1,1251 @@
1
+ import { ApiKey, ApiKeyOptions } from "./types.mjs";
2
+ import { API_KEY_ERROR_CODES } from "./error-codes.mjs";
3
+ import * as _better_auth_core0 from "@better-auth/core";
4
+ import * as _better_auth_core_db0 from "@better-auth/core/db";
5
+ import * as _better_auth_core_env0 from "@better-auth/core/env";
6
+ import * as _better_auth_core_oauth20 from "@better-auth/core/oauth2";
7
+ import * as _better_auth_core_utils_error_codes0 from "@better-auth/core/utils/error-codes";
8
+ import * as better_call0 from "better-call";
9
+ import * as zod from "zod";
10
+ import * as _better_auth_core_db_adapter0 from "@better-auth/core/db/adapter";
11
+ import * as zod_v4_core0 from "zod/v4/core";
12
+
13
+ //#region src/plugins/api-key/index.d.ts
14
+ declare module "@better-auth/core" {
15
+ interface BetterAuthPluginRegistry<AuthOptions, Options> {
16
+ "api-key": {
17
+ creator: typeof apiKey;
18
+ };
19
+ }
20
+ }
21
+ declare const defaultKeyHasher: (key: string) => Promise<string>;
22
+ declare const API_KEY_TABLE_NAME = "apikey";
23
+ declare const apiKey: (options?: ApiKeyOptions | undefined) => {
24
+ id: "api-key";
25
+ $ERROR_CODES: {
26
+ INVALID_METADATA_TYPE: _better_auth_core_utils_error_codes0.RawError<"INVALID_METADATA_TYPE">;
27
+ REFILL_AMOUNT_AND_INTERVAL_REQUIRED: _better_auth_core_utils_error_codes0.RawError<"REFILL_AMOUNT_AND_INTERVAL_REQUIRED">;
28
+ REFILL_INTERVAL_AND_AMOUNT_REQUIRED: _better_auth_core_utils_error_codes0.RawError<"REFILL_INTERVAL_AND_AMOUNT_REQUIRED">;
29
+ USER_BANNED: _better_auth_core_utils_error_codes0.RawError<"USER_BANNED">;
30
+ UNAUTHORIZED_SESSION: _better_auth_core_utils_error_codes0.RawError<"UNAUTHORIZED_SESSION">;
31
+ KEY_NOT_FOUND: _better_auth_core_utils_error_codes0.RawError<"KEY_NOT_FOUND">;
32
+ KEY_DISABLED: _better_auth_core_utils_error_codes0.RawError<"KEY_DISABLED">;
33
+ KEY_EXPIRED: _better_auth_core_utils_error_codes0.RawError<"KEY_EXPIRED">;
34
+ USAGE_EXCEEDED: _better_auth_core_utils_error_codes0.RawError<"USAGE_EXCEEDED">;
35
+ KEY_NOT_RECOVERABLE: _better_auth_core_utils_error_codes0.RawError<"KEY_NOT_RECOVERABLE">;
36
+ EXPIRES_IN_IS_TOO_SMALL: _better_auth_core_utils_error_codes0.RawError<"EXPIRES_IN_IS_TOO_SMALL">;
37
+ EXPIRES_IN_IS_TOO_LARGE: _better_auth_core_utils_error_codes0.RawError<"EXPIRES_IN_IS_TOO_LARGE">;
38
+ INVALID_REMAINING: _better_auth_core_utils_error_codes0.RawError<"INVALID_REMAINING">;
39
+ INVALID_PREFIX_LENGTH: _better_auth_core_utils_error_codes0.RawError<"INVALID_PREFIX_LENGTH">;
40
+ INVALID_NAME_LENGTH: _better_auth_core_utils_error_codes0.RawError<"INVALID_NAME_LENGTH">;
41
+ METADATA_DISABLED: _better_auth_core_utils_error_codes0.RawError<"METADATA_DISABLED">;
42
+ RATE_LIMIT_EXCEEDED: _better_auth_core_utils_error_codes0.RawError<"RATE_LIMIT_EXCEEDED">;
43
+ NO_VALUES_TO_UPDATE: _better_auth_core_utils_error_codes0.RawError<"NO_VALUES_TO_UPDATE">;
44
+ KEY_DISABLED_EXPIRATION: _better_auth_core_utils_error_codes0.RawError<"KEY_DISABLED_EXPIRATION">;
45
+ INVALID_API_KEY: _better_auth_core_utils_error_codes0.RawError<"INVALID_API_KEY">;
46
+ INVALID_USER_ID_FROM_API_KEY: _better_auth_core_utils_error_codes0.RawError<"INVALID_USER_ID_FROM_API_KEY">;
47
+ INVALID_API_KEY_GETTER_RETURN_TYPE: _better_auth_core_utils_error_codes0.RawError<"INVALID_API_KEY_GETTER_RETURN_TYPE">;
48
+ SERVER_ONLY_PROPERTY: _better_auth_core_utils_error_codes0.RawError<"SERVER_ONLY_PROPERTY">;
49
+ FAILED_TO_UPDATE_API_KEY: _better_auth_core_utils_error_codes0.RawError<"FAILED_TO_UPDATE_API_KEY">;
50
+ NAME_REQUIRED: _better_auth_core_utils_error_codes0.RawError<"NAME_REQUIRED">;
51
+ };
52
+ hooks: {
53
+ before: {
54
+ matcher: (ctx: _better_auth_core0.HookEndpointContext) => boolean;
55
+ handler: (inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
56
+ user: {
57
+ id: string;
58
+ createdAt: Date;
59
+ updatedAt: Date;
60
+ email: string;
61
+ emailVerified: boolean;
62
+ name: string;
63
+ image?: string | null | undefined;
64
+ };
65
+ session: {
66
+ id: string;
67
+ token: string;
68
+ userId: string;
69
+ userAgent: string | null;
70
+ ipAddress: string | null;
71
+ createdAt: Date;
72
+ updatedAt: Date;
73
+ expiresAt: Date;
74
+ };
75
+ } | {
76
+ context: better_call0.MiddlewareContext<better_call0.MiddlewareOptions, {
77
+ returned?: unknown | undefined;
78
+ responseHeaders?: Headers | undefined;
79
+ } & _better_auth_core0.PluginContext<_better_auth_core0.BetterAuthOptions> & _better_auth_core0.InfoContext & {
80
+ options: _better_auth_core0.BetterAuthOptions;
81
+ trustedOrigins: string[];
82
+ trustedProviders: string[];
83
+ isTrustedOrigin: (url: string, settings?: {
84
+ allowRelativePaths: boolean;
85
+ }) => boolean;
86
+ oauthConfig: {
87
+ skipStateCookieCheck?: boolean | undefined;
88
+ storeStateStrategy: "database" | "cookie";
89
+ };
90
+ newSession: {
91
+ session: {
92
+ id: string;
93
+ createdAt: Date;
94
+ updatedAt: Date;
95
+ userId: string;
96
+ expiresAt: Date;
97
+ token: string;
98
+ ipAddress?: string | null | undefined;
99
+ userAgent?: string | null | undefined;
100
+ } & Record<string, any>;
101
+ user: {
102
+ id: string;
103
+ createdAt: Date;
104
+ updatedAt: Date;
105
+ email: string;
106
+ emailVerified: boolean;
107
+ name: string;
108
+ image?: string | null | undefined;
109
+ } & Record<string, any>;
110
+ } | null;
111
+ session: {
112
+ session: {
113
+ id: string;
114
+ createdAt: Date;
115
+ updatedAt: Date;
116
+ userId: string;
117
+ expiresAt: Date;
118
+ token: string;
119
+ ipAddress?: string | null | undefined;
120
+ userAgent?: string | null | undefined;
121
+ } & Record<string, any>;
122
+ user: {
123
+ id: string;
124
+ createdAt: Date;
125
+ updatedAt: Date;
126
+ email: string;
127
+ emailVerified: boolean;
128
+ name: string;
129
+ image?: string | null | undefined;
130
+ } & Record<string, any>;
131
+ } | null;
132
+ setNewSession: (session: {
133
+ session: {
134
+ id: string;
135
+ createdAt: Date;
136
+ updatedAt: Date;
137
+ userId: string;
138
+ expiresAt: Date;
139
+ token: string;
140
+ ipAddress?: string | null | undefined;
141
+ userAgent?: string | null | undefined;
142
+ } & Record<string, any>;
143
+ user: {
144
+ id: string;
145
+ createdAt: Date;
146
+ updatedAt: Date;
147
+ email: string;
148
+ emailVerified: boolean;
149
+ name: string;
150
+ image?: string | null | undefined;
151
+ } & Record<string, any>;
152
+ } | null) => void;
153
+ socialProviders: _better_auth_core_oauth20.OAuthProvider[];
154
+ authCookies: _better_auth_core0.BetterAuthCookies;
155
+ logger: ReturnType<typeof _better_auth_core_env0.createLogger>;
156
+ rateLimit: {
157
+ enabled: boolean;
158
+ window: number;
159
+ max: number;
160
+ storage: "memory" | "database" | "secondary-storage";
161
+ } & Omit<_better_auth_core0.BetterAuthRateLimitOptions, "enabled" | "window" | "max" | "storage">;
162
+ adapter: _better_auth_core_db_adapter0.DBAdapter<_better_auth_core0.BetterAuthOptions>;
163
+ internalAdapter: _better_auth_core0.InternalAdapter<_better_auth_core0.BetterAuthOptions>;
164
+ createAuthCookie: (cookieName: string, overrideAttributes?: Partial<better_call0.CookieOptions> | undefined) => _better_auth_core0.BetterAuthCookie;
165
+ secret: string;
166
+ sessionConfig: {
167
+ updateAge: number;
168
+ expiresIn: number;
169
+ freshAge: number;
170
+ cookieRefreshCache: false | {
171
+ enabled: true;
172
+ updateAge: number;
173
+ };
174
+ };
175
+ generateId: (options: {
176
+ model: _better_auth_core_db0.ModelNames;
177
+ size?: number | undefined;
178
+ }) => string | false;
179
+ secondaryStorage: _better_auth_core_db0.SecondaryStorage | undefined;
180
+ password: {
181
+ hash: (password: string) => Promise<string>;
182
+ verify: (data: {
183
+ password: string;
184
+ hash: string;
185
+ }) => Promise<boolean>;
186
+ config: {
187
+ minPasswordLength: number;
188
+ maxPasswordLength: number;
189
+ };
190
+ checkPassword: (userId: string, ctx: _better_auth_core0.GenericEndpointContext<_better_auth_core0.BetterAuthOptions>) => Promise<boolean>;
191
+ };
192
+ tables: _better_auth_core_db0.BetterAuthDBSchema;
193
+ runMigrations: () => Promise<void>;
194
+ publishTelemetry: (event: {
195
+ type: string;
196
+ anonymousId?: string | undefined;
197
+ payload: Record<string, any>;
198
+ }) => Promise<void>;
199
+ skipOriginCheck: boolean | string[];
200
+ skipCSRFCheck: boolean;
201
+ runInBackground: (promise: Promise<unknown>) => void;
202
+ runInBackgroundOrAwait: (promise: Promise<unknown> | void) => _better_auth_core0.Awaitable<unknown>;
203
+ }>;
204
+ }>;
205
+ }[];
206
+ };
207
+ endpoints: {
208
+ /**
209
+ * ### Endpoint
210
+ *
211
+ * POST `/api-key/create`
212
+ *
213
+ * ### API Methods
214
+ *
215
+ * **server:**
216
+ * `auth.api.createApiKey`
217
+ *
218
+ * **client:**
219
+ * `authClient.apiKey.create`
220
+ *
221
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-create)
222
+ */
223
+ createApiKey: better_call0.StrictEndpoint<"/api-key/create", {
224
+ method: "POST";
225
+ body: zod.ZodObject<{
226
+ name: zod.ZodOptional<zod.ZodString>;
227
+ expiresIn: zod.ZodDefault<zod.ZodNullable<zod.ZodOptional<zod.ZodNumber>>>;
228
+ userId: zod.ZodOptional<zod.ZodCoercedString<unknown>>;
229
+ prefix: zod.ZodOptional<zod.ZodString>;
230
+ remaining: zod.ZodDefault<zod.ZodNullable<zod.ZodOptional<zod.ZodNumber>>>;
231
+ metadata: zod.ZodOptional<zod.ZodAny>;
232
+ refillAmount: zod.ZodOptional<zod.ZodNumber>;
233
+ refillInterval: zod.ZodOptional<zod.ZodNumber>;
234
+ rateLimitTimeWindow: zod.ZodOptional<zod.ZodNumber>;
235
+ rateLimitMax: zod.ZodOptional<zod.ZodNumber>;
236
+ rateLimitEnabled: zod.ZodOptional<zod.ZodBoolean>;
237
+ permissions: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodArray<zod.ZodString>>>;
238
+ }, zod_v4_core0.$strip>;
239
+ metadata: {
240
+ openapi: {
241
+ description: string;
242
+ responses: {
243
+ "200": {
244
+ description: string;
245
+ content: {
246
+ "application/json": {
247
+ schema: {
248
+ type: "object";
249
+ properties: {
250
+ id: {
251
+ type: string;
252
+ description: string;
253
+ };
254
+ createdAt: {
255
+ type: string;
256
+ format: string;
257
+ description: string;
258
+ };
259
+ updatedAt: {
260
+ type: string;
261
+ format: string;
262
+ description: string;
263
+ };
264
+ name: {
265
+ type: string;
266
+ nullable: boolean;
267
+ description: string;
268
+ };
269
+ prefix: {
270
+ type: string;
271
+ nullable: boolean;
272
+ description: string;
273
+ };
274
+ start: {
275
+ type: string;
276
+ nullable: boolean;
277
+ description: string;
278
+ };
279
+ key: {
280
+ type: string;
281
+ description: string;
282
+ };
283
+ enabled: {
284
+ type: string;
285
+ description: string;
286
+ };
287
+ expiresAt: {
288
+ type: string;
289
+ format: string;
290
+ nullable: boolean;
291
+ description: string;
292
+ };
293
+ userId: {
294
+ type: string;
295
+ description: string;
296
+ };
297
+ lastRefillAt: {
298
+ type: string;
299
+ format: string;
300
+ nullable: boolean;
301
+ description: string;
302
+ };
303
+ lastRequest: {
304
+ type: string;
305
+ format: string;
306
+ nullable: boolean;
307
+ description: string;
308
+ };
309
+ metadata: {
310
+ type: string;
311
+ nullable: boolean;
312
+ additionalProperties: boolean;
313
+ description: string;
314
+ };
315
+ rateLimitMax: {
316
+ type: string;
317
+ nullable: boolean;
318
+ description: string;
319
+ };
320
+ rateLimitTimeWindow: {
321
+ type: string;
322
+ nullable: boolean;
323
+ description: string;
324
+ };
325
+ remaining: {
326
+ type: string;
327
+ nullable: boolean;
328
+ description: string;
329
+ };
330
+ refillAmount: {
331
+ type: string;
332
+ nullable: boolean;
333
+ description: string;
334
+ };
335
+ refillInterval: {
336
+ type: string;
337
+ nullable: boolean;
338
+ description: string;
339
+ };
340
+ rateLimitEnabled: {
341
+ type: string;
342
+ description: string;
343
+ };
344
+ requestCount: {
345
+ type: string;
346
+ description: string;
347
+ };
348
+ permissions: {
349
+ type: string;
350
+ nullable: boolean;
351
+ additionalProperties: {
352
+ type: string;
353
+ items: {
354
+ type: string;
355
+ };
356
+ };
357
+ description: string;
358
+ };
359
+ };
360
+ required: string[];
361
+ };
362
+ };
363
+ };
364
+ };
365
+ };
366
+ };
367
+ };
368
+ }, {
369
+ key: string;
370
+ metadata: any;
371
+ permissions: any;
372
+ id: string;
373
+ name: string | null;
374
+ start: string | null;
375
+ prefix: string | null;
376
+ userId: string;
377
+ refillInterval: number | null;
378
+ refillAmount: number | null;
379
+ lastRefillAt: Date | null;
380
+ enabled: boolean;
381
+ rateLimitEnabled: boolean;
382
+ rateLimitTimeWindow: number | null;
383
+ rateLimitMax: number | null;
384
+ requestCount: number;
385
+ remaining: number | null;
386
+ lastRequest: Date | null;
387
+ expiresAt: Date | null;
388
+ createdAt: Date;
389
+ updatedAt: Date;
390
+ }>;
391
+ /**
392
+ * ### Endpoint
393
+ *
394
+ * POST `/api-key/verify`
395
+ *
396
+ * ### API Methods
397
+ *
398
+ * **server:**
399
+ * `auth.api.verifyApiKey`
400
+ *
401
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-verify)
402
+ */
403
+ verifyApiKey: better_call0.StrictEndpoint<string, {
404
+ method: "POST";
405
+ body: zod.ZodObject<{
406
+ key: zod.ZodString;
407
+ permissions: zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodArray<zod.ZodString>>>;
408
+ }, zod_v4_core0.$strip>;
409
+ }, {
410
+ valid: boolean;
411
+ error: {
412
+ message: _better_auth_core_utils_error_codes0.RawError<"INVALID_API_KEY">;
413
+ code: "KEY_NOT_FOUND";
414
+ };
415
+ key: null;
416
+ } | {
417
+ valid: boolean;
418
+ error: {
419
+ message: string | undefined;
420
+ code: string;
421
+ cause?: unknown;
422
+ };
423
+ key: null;
424
+ } | {
425
+ valid: boolean;
426
+ error: {
427
+ message: _better_auth_core_utils_error_codes0.RawError<"INVALID_API_KEY">;
428
+ code: "INVALID_API_KEY";
429
+ };
430
+ key: null;
431
+ } | {
432
+ valid: boolean;
433
+ error: null;
434
+ key: Omit<ApiKey, "key"> | null;
435
+ }>;
436
+ /**
437
+ * ### Endpoint
438
+ *
439
+ * GET `/api-key/get`
440
+ *
441
+ * ### API Methods
442
+ *
443
+ * **server:**
444
+ * `auth.api.getApiKey`
445
+ *
446
+ * **client:**
447
+ * `authClient.apiKey.get`
448
+ *
449
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-get)
450
+ */
451
+ getApiKey: better_call0.StrictEndpoint<"/api-key/get", {
452
+ method: "GET";
453
+ query: zod.ZodObject<{
454
+ id: zod.ZodString;
455
+ }, zod_v4_core0.$strip>;
456
+ use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
457
+ session: {
458
+ session: Record<string, any> & {
459
+ id: string;
460
+ createdAt: Date;
461
+ updatedAt: Date;
462
+ userId: string;
463
+ expiresAt: Date;
464
+ token: string;
465
+ ipAddress?: string | null | undefined;
466
+ userAgent?: string | null | undefined;
467
+ };
468
+ user: Record<string, any> & {
469
+ id: string;
470
+ createdAt: Date;
471
+ updatedAt: Date;
472
+ email: string;
473
+ emailVerified: boolean;
474
+ name: string;
475
+ image?: string | null | undefined;
476
+ };
477
+ };
478
+ }>)[];
479
+ metadata: {
480
+ openapi: {
481
+ description: string;
482
+ responses: {
483
+ "200": {
484
+ description: string;
485
+ content: {
486
+ "application/json": {
487
+ schema: {
488
+ type: "object";
489
+ properties: {
490
+ id: {
491
+ type: string;
492
+ description: string;
493
+ };
494
+ name: {
495
+ type: string;
496
+ nullable: boolean;
497
+ description: string;
498
+ };
499
+ start: {
500
+ type: string;
501
+ nullable: boolean;
502
+ description: string;
503
+ };
504
+ prefix: {
505
+ type: string;
506
+ nullable: boolean;
507
+ description: string;
508
+ };
509
+ userId: {
510
+ type: string;
511
+ description: string;
512
+ };
513
+ refillInterval: {
514
+ type: string;
515
+ nullable: boolean;
516
+ description: string;
517
+ };
518
+ refillAmount: {
519
+ type: string;
520
+ nullable: boolean;
521
+ description: string;
522
+ };
523
+ lastRefillAt: {
524
+ type: string;
525
+ format: string;
526
+ nullable: boolean;
527
+ description: string;
528
+ };
529
+ enabled: {
530
+ type: string;
531
+ description: string;
532
+ default: boolean;
533
+ };
534
+ rateLimitEnabled: {
535
+ type: string;
536
+ description: string;
537
+ };
538
+ rateLimitTimeWindow: {
539
+ type: string;
540
+ nullable: boolean;
541
+ description: string;
542
+ };
543
+ rateLimitMax: {
544
+ type: string;
545
+ nullable: boolean;
546
+ description: string;
547
+ };
548
+ requestCount: {
549
+ type: string;
550
+ description: string;
551
+ };
552
+ remaining: {
553
+ type: string;
554
+ nullable: boolean;
555
+ description: string;
556
+ };
557
+ lastRequest: {
558
+ type: string;
559
+ format: string;
560
+ nullable: boolean;
561
+ description: string;
562
+ };
563
+ expiresAt: {
564
+ type: string;
565
+ format: string;
566
+ nullable: boolean;
567
+ description: string;
568
+ };
569
+ createdAt: {
570
+ type: string;
571
+ format: string;
572
+ description: string;
573
+ };
574
+ updatedAt: {
575
+ type: string;
576
+ format: string;
577
+ description: string;
578
+ };
579
+ metadata: {
580
+ type: string;
581
+ nullable: boolean;
582
+ additionalProperties: boolean;
583
+ description: string;
584
+ };
585
+ permissions: {
586
+ type: string;
587
+ nullable: boolean;
588
+ description: string;
589
+ };
590
+ };
591
+ required: string[];
592
+ };
593
+ };
594
+ };
595
+ };
596
+ };
597
+ };
598
+ };
599
+ }, {
600
+ metadata: Record<string, any> | null;
601
+ permissions: {
602
+ [key: string]: string[];
603
+ } | null;
604
+ id: string;
605
+ name: string | null;
606
+ start: string | null;
607
+ prefix: string | null;
608
+ userId: string;
609
+ refillInterval: number | null;
610
+ refillAmount: number | null;
611
+ lastRefillAt: Date | null;
612
+ enabled: boolean;
613
+ rateLimitEnabled: boolean;
614
+ rateLimitTimeWindow: number | null;
615
+ rateLimitMax: number | null;
616
+ requestCount: number;
617
+ remaining: number | null;
618
+ lastRequest: Date | null;
619
+ expiresAt: Date | null;
620
+ createdAt: Date;
621
+ updatedAt: Date;
622
+ }>;
623
+ /**
624
+ * ### Endpoint
625
+ *
626
+ * POST `/api-key/update`
627
+ *
628
+ * ### API Methods
629
+ *
630
+ * **server:**
631
+ * `auth.api.updateApiKey`
632
+ *
633
+ * **client:**
634
+ * `authClient.apiKey.update`
635
+ *
636
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-update)
637
+ */
638
+ updateApiKey: better_call0.StrictEndpoint<"/api-key/update", {
639
+ method: "POST";
640
+ body: zod.ZodObject<{
641
+ keyId: zod.ZodString;
642
+ userId: zod.ZodOptional<zod.ZodCoercedString<unknown>>;
643
+ name: zod.ZodOptional<zod.ZodString>;
644
+ enabled: zod.ZodOptional<zod.ZodBoolean>;
645
+ remaining: zod.ZodOptional<zod.ZodNumber>;
646
+ refillAmount: zod.ZodOptional<zod.ZodNumber>;
647
+ refillInterval: zod.ZodOptional<zod.ZodNumber>;
648
+ metadata: zod.ZodOptional<zod.ZodAny>;
649
+ expiresIn: zod.ZodNullable<zod.ZodOptional<zod.ZodNumber>>;
650
+ rateLimitEnabled: zod.ZodOptional<zod.ZodBoolean>;
651
+ rateLimitTimeWindow: zod.ZodOptional<zod.ZodNumber>;
652
+ rateLimitMax: zod.ZodOptional<zod.ZodNumber>;
653
+ permissions: zod.ZodNullable<zod.ZodOptional<zod.ZodRecord<zod.ZodString, zod.ZodArray<zod.ZodString>>>>;
654
+ }, zod_v4_core0.$strip>;
655
+ metadata: {
656
+ openapi: {
657
+ description: string;
658
+ responses: {
659
+ "200": {
660
+ description: string;
661
+ content: {
662
+ "application/json": {
663
+ schema: {
664
+ type: "object";
665
+ properties: {
666
+ id: {
667
+ type: string;
668
+ description: string;
669
+ };
670
+ name: {
671
+ type: string;
672
+ nullable: boolean;
673
+ description: string;
674
+ };
675
+ start: {
676
+ type: string;
677
+ nullable: boolean;
678
+ description: string;
679
+ };
680
+ prefix: {
681
+ type: string;
682
+ nullable: boolean;
683
+ description: string;
684
+ };
685
+ userId: {
686
+ type: string;
687
+ description: string;
688
+ };
689
+ refillInterval: {
690
+ type: string;
691
+ nullable: boolean;
692
+ description: string;
693
+ };
694
+ refillAmount: {
695
+ type: string;
696
+ nullable: boolean;
697
+ description: string;
698
+ };
699
+ lastRefillAt: {
700
+ type: string;
701
+ format: string;
702
+ nullable: boolean;
703
+ description: string;
704
+ };
705
+ enabled: {
706
+ type: string;
707
+ description: string;
708
+ default: boolean;
709
+ };
710
+ rateLimitEnabled: {
711
+ type: string;
712
+ description: string;
713
+ };
714
+ rateLimitTimeWindow: {
715
+ type: string;
716
+ nullable: boolean;
717
+ description: string;
718
+ };
719
+ rateLimitMax: {
720
+ type: string;
721
+ nullable: boolean;
722
+ description: string;
723
+ };
724
+ requestCount: {
725
+ type: string;
726
+ description: string;
727
+ };
728
+ remaining: {
729
+ type: string;
730
+ nullable: boolean;
731
+ description: string;
732
+ };
733
+ lastRequest: {
734
+ type: string;
735
+ format: string;
736
+ nullable: boolean;
737
+ description: string;
738
+ };
739
+ expiresAt: {
740
+ type: string;
741
+ format: string;
742
+ nullable: boolean;
743
+ description: string;
744
+ };
745
+ createdAt: {
746
+ type: string;
747
+ format: string;
748
+ description: string;
749
+ };
750
+ updatedAt: {
751
+ type: string;
752
+ format: string;
753
+ description: string;
754
+ };
755
+ metadata: {
756
+ type: string;
757
+ nullable: boolean;
758
+ additionalProperties: boolean;
759
+ description: string;
760
+ };
761
+ permissions: {
762
+ type: string;
763
+ nullable: boolean;
764
+ description: string;
765
+ };
766
+ };
767
+ required: string[];
768
+ };
769
+ };
770
+ };
771
+ };
772
+ };
773
+ };
774
+ };
775
+ }, {
776
+ metadata: Record<string, any> | null;
777
+ permissions: {
778
+ [key: string]: string[];
779
+ } | null;
780
+ id: string;
781
+ name: string | null;
782
+ start: string | null;
783
+ prefix: string | null;
784
+ userId: string;
785
+ refillInterval: number | null;
786
+ refillAmount: number | null;
787
+ lastRefillAt: Date | null;
788
+ enabled: boolean;
789
+ rateLimitEnabled: boolean;
790
+ rateLimitTimeWindow: number | null;
791
+ rateLimitMax: number | null;
792
+ requestCount: number;
793
+ remaining: number | null;
794
+ lastRequest: Date | null;
795
+ expiresAt: Date | null;
796
+ createdAt: Date;
797
+ updatedAt: Date;
798
+ }>;
799
+ /**
800
+ * ### Endpoint
801
+ *
802
+ * POST `/api-key/delete`
803
+ *
804
+ * ### API Methods
805
+ *
806
+ * **server:**
807
+ * `auth.api.deleteApiKey`
808
+ *
809
+ * **client:**
810
+ * `authClient.apiKey.delete`
811
+ *
812
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-delete)
813
+ */
814
+ deleteApiKey: better_call0.StrictEndpoint<"/api-key/delete", {
815
+ method: "POST";
816
+ body: zod.ZodObject<{
817
+ keyId: zod.ZodString;
818
+ }, zod_v4_core0.$strip>;
819
+ use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
820
+ session: {
821
+ session: Record<string, any> & {
822
+ id: string;
823
+ createdAt: Date;
824
+ updatedAt: Date;
825
+ userId: string;
826
+ expiresAt: Date;
827
+ token: string;
828
+ ipAddress?: string | null | undefined;
829
+ userAgent?: string | null | undefined;
830
+ };
831
+ user: Record<string, any> & {
832
+ id: string;
833
+ createdAt: Date;
834
+ updatedAt: Date;
835
+ email: string;
836
+ emailVerified: boolean;
837
+ name: string;
838
+ image?: string | null | undefined;
839
+ };
840
+ };
841
+ }>)[];
842
+ metadata: {
843
+ openapi: {
844
+ description: string;
845
+ requestBody: {
846
+ content: {
847
+ "application/json": {
848
+ schema: {
849
+ type: "object";
850
+ properties: {
851
+ keyId: {
852
+ type: string;
853
+ description: string;
854
+ };
855
+ };
856
+ required: string[];
857
+ };
858
+ };
859
+ };
860
+ };
861
+ responses: {
862
+ "200": {
863
+ description: string;
864
+ content: {
865
+ "application/json": {
866
+ schema: {
867
+ type: "object";
868
+ properties: {
869
+ success: {
870
+ type: string;
871
+ description: string;
872
+ };
873
+ };
874
+ required: string[];
875
+ };
876
+ };
877
+ };
878
+ };
879
+ };
880
+ };
881
+ };
882
+ }, {
883
+ success: boolean;
884
+ }>;
885
+ /**
886
+ * ### Endpoint
887
+ *
888
+ * GET `/api-key/list`
889
+ *
890
+ * ### API Methods
891
+ *
892
+ * **server:**
893
+ * `auth.api.listApiKeys`
894
+ *
895
+ * **client:**
896
+ * `authClient.apiKey.list`
897
+ *
898
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-list)
899
+ */
900
+ listApiKeys: better_call0.StrictEndpoint<"/api-key/list", {
901
+ method: "GET";
902
+ use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
903
+ session: {
904
+ session: Record<string, any> & {
905
+ id: string;
906
+ createdAt: Date;
907
+ updatedAt: Date;
908
+ userId: string;
909
+ expiresAt: Date;
910
+ token: string;
911
+ ipAddress?: string | null | undefined;
912
+ userAgent?: string | null | undefined;
913
+ };
914
+ user: Record<string, any> & {
915
+ id: string;
916
+ createdAt: Date;
917
+ updatedAt: Date;
918
+ email: string;
919
+ emailVerified: boolean;
920
+ name: string;
921
+ image?: string | null | undefined;
922
+ };
923
+ };
924
+ }>)[];
925
+ query: zod.ZodOptional<zod.ZodObject<{
926
+ limit: zod.ZodOptional<zod.ZodCoercedNumber<unknown>>;
927
+ offset: zod.ZodOptional<zod.ZodCoercedNumber<unknown>>;
928
+ sortBy: zod.ZodOptional<zod.ZodString>;
929
+ sortDirection: zod.ZodOptional<zod.ZodEnum<{
930
+ asc: "asc";
931
+ desc: "desc";
932
+ }>>;
933
+ }, zod_v4_core0.$strip>>;
934
+ metadata: {
935
+ openapi: {
936
+ description: string;
937
+ responses: {
938
+ "200": {
939
+ description: string;
940
+ content: {
941
+ "application/json": {
942
+ schema: {
943
+ type: "object";
944
+ properties: {
945
+ apiKeys: {
946
+ type: string;
947
+ items: {
948
+ type: string;
949
+ properties: {
950
+ id: {
951
+ type: string;
952
+ description: string;
953
+ };
954
+ name: {
955
+ type: string;
956
+ nullable: boolean;
957
+ description: string;
958
+ };
959
+ start: {
960
+ type: string;
961
+ nullable: boolean;
962
+ description: string;
963
+ };
964
+ prefix: {
965
+ type: string;
966
+ nullable: boolean;
967
+ description: string;
968
+ };
969
+ userId: {
970
+ type: string;
971
+ description: string;
972
+ };
973
+ refillInterval: {
974
+ type: string;
975
+ nullable: boolean;
976
+ description: string;
977
+ };
978
+ refillAmount: {
979
+ type: string;
980
+ nullable: boolean;
981
+ description: string;
982
+ };
983
+ lastRefillAt: {
984
+ type: string;
985
+ format: string;
986
+ nullable: boolean;
987
+ description: string;
988
+ };
989
+ enabled: {
990
+ type: string;
991
+ description: string;
992
+ default: boolean;
993
+ };
994
+ rateLimitEnabled: {
995
+ type: string;
996
+ description: string;
997
+ };
998
+ rateLimitTimeWindow: {
999
+ type: string;
1000
+ nullable: boolean;
1001
+ description: string;
1002
+ };
1003
+ rateLimitMax: {
1004
+ type: string;
1005
+ nullable: boolean;
1006
+ description: string;
1007
+ };
1008
+ requestCount: {
1009
+ type: string;
1010
+ description: string;
1011
+ };
1012
+ remaining: {
1013
+ type: string;
1014
+ nullable: boolean;
1015
+ description: string;
1016
+ };
1017
+ lastRequest: {
1018
+ type: string;
1019
+ format: string;
1020
+ nullable: boolean;
1021
+ description: string;
1022
+ };
1023
+ expiresAt: {
1024
+ type: string;
1025
+ format: string;
1026
+ nullable: boolean;
1027
+ description: string;
1028
+ };
1029
+ createdAt: {
1030
+ type: string;
1031
+ format: string;
1032
+ description: string;
1033
+ };
1034
+ updatedAt: {
1035
+ type: string;
1036
+ format: string;
1037
+ description: string;
1038
+ };
1039
+ metadata: {
1040
+ type: string;
1041
+ nullable: boolean;
1042
+ additionalProperties: boolean;
1043
+ description: string;
1044
+ };
1045
+ permissions: {
1046
+ type: string;
1047
+ nullable: boolean;
1048
+ description: string;
1049
+ };
1050
+ };
1051
+ required: string[];
1052
+ };
1053
+ };
1054
+ total: {
1055
+ type: string;
1056
+ description: string;
1057
+ };
1058
+ limit: {
1059
+ type: string;
1060
+ nullable: boolean;
1061
+ description: string;
1062
+ };
1063
+ offset: {
1064
+ type: string;
1065
+ nullable: boolean;
1066
+ description: string;
1067
+ };
1068
+ };
1069
+ required: string[];
1070
+ };
1071
+ };
1072
+ };
1073
+ };
1074
+ };
1075
+ };
1076
+ };
1077
+ }, {
1078
+ apiKeys: {
1079
+ metadata: Record<string, any> | null;
1080
+ permissions: {
1081
+ [key: string]: string[];
1082
+ } | null;
1083
+ id: string;
1084
+ name: string | null;
1085
+ start: string | null;
1086
+ prefix: string | null;
1087
+ userId: string;
1088
+ refillInterval: number | null;
1089
+ refillAmount: number | null;
1090
+ lastRefillAt: Date | null;
1091
+ enabled: boolean;
1092
+ rateLimitEnabled: boolean;
1093
+ rateLimitTimeWindow: number | null;
1094
+ rateLimitMax: number | null;
1095
+ requestCount: number;
1096
+ remaining: number | null;
1097
+ lastRequest: Date | null;
1098
+ expiresAt: Date | null;
1099
+ createdAt: Date;
1100
+ updatedAt: Date;
1101
+ }[];
1102
+ total: number;
1103
+ limit: number | undefined;
1104
+ offset: number | undefined;
1105
+ }>;
1106
+ /**
1107
+ * ### Endpoint
1108
+ *
1109
+ * POST `/api-key/delete-all-expired-api-keys`
1110
+ *
1111
+ * ### API Methods
1112
+ *
1113
+ * **server:**
1114
+ * `auth.api.deleteAllExpiredApiKeys`
1115
+ *
1116
+ * @see [Read our docs to learn more.](https://better-auth.com/docs/plugins/api-key#api-method-api-key-delete-all-expired-api-keys)
1117
+ */
1118
+ deleteAllExpiredApiKeys: better_call0.StrictEndpoint<string, {
1119
+ method: "POST";
1120
+ }, {
1121
+ success: boolean;
1122
+ error: unknown;
1123
+ }>;
1124
+ };
1125
+ schema: {
1126
+ apikey: {
1127
+ fields: {
1128
+ name: {
1129
+ type: "string";
1130
+ required: false;
1131
+ input: false;
1132
+ };
1133
+ start: {
1134
+ type: "string";
1135
+ required: false;
1136
+ input: false;
1137
+ };
1138
+ prefix: {
1139
+ type: "string";
1140
+ required: false;
1141
+ input: false;
1142
+ };
1143
+ key: {
1144
+ type: "string";
1145
+ required: true;
1146
+ input: false;
1147
+ index: true;
1148
+ };
1149
+ userId: {
1150
+ type: "string";
1151
+ references: {
1152
+ model: string;
1153
+ field: string;
1154
+ onDelete: "cascade";
1155
+ };
1156
+ required: true;
1157
+ input: false;
1158
+ index: true;
1159
+ };
1160
+ refillInterval: {
1161
+ type: "number";
1162
+ required: false;
1163
+ input: false;
1164
+ };
1165
+ refillAmount: {
1166
+ type: "number";
1167
+ required: false;
1168
+ input: false;
1169
+ };
1170
+ lastRefillAt: {
1171
+ type: "date";
1172
+ required: false;
1173
+ input: false;
1174
+ };
1175
+ enabled: {
1176
+ type: "boolean";
1177
+ required: false;
1178
+ input: false;
1179
+ defaultValue: true;
1180
+ };
1181
+ rateLimitEnabled: {
1182
+ type: "boolean";
1183
+ required: false;
1184
+ input: false;
1185
+ defaultValue: true;
1186
+ };
1187
+ rateLimitTimeWindow: {
1188
+ type: "number";
1189
+ required: false;
1190
+ input: false;
1191
+ defaultValue: number;
1192
+ };
1193
+ rateLimitMax: {
1194
+ type: "number";
1195
+ required: false;
1196
+ input: false;
1197
+ defaultValue: number;
1198
+ };
1199
+ requestCount: {
1200
+ type: "number";
1201
+ required: false;
1202
+ input: false;
1203
+ defaultValue: number;
1204
+ };
1205
+ remaining: {
1206
+ type: "number";
1207
+ required: false;
1208
+ input: false;
1209
+ };
1210
+ lastRequest: {
1211
+ type: "date";
1212
+ required: false;
1213
+ input: false;
1214
+ };
1215
+ expiresAt: {
1216
+ type: "date";
1217
+ required: false;
1218
+ input: false;
1219
+ };
1220
+ createdAt: {
1221
+ type: "date";
1222
+ required: true;
1223
+ input: false;
1224
+ };
1225
+ updatedAt: {
1226
+ type: "date";
1227
+ required: true;
1228
+ input: false;
1229
+ };
1230
+ permissions: {
1231
+ type: "string";
1232
+ required: false;
1233
+ input: false;
1234
+ };
1235
+ metadata: {
1236
+ type: "string";
1237
+ required: false;
1238
+ input: true;
1239
+ transform: {
1240
+ input(value: _better_auth_core_db0.DBPrimitive): string;
1241
+ output(value: _better_auth_core_db0.DBPrimitive): any;
1242
+ };
1243
+ };
1244
+ };
1245
+ };
1246
+ };
1247
+ options: ApiKeyOptions | undefined;
1248
+ };
1249
+ //#endregion
1250
+ export { API_KEY_TABLE_NAME, apiKey, defaultKeyHasher };
1251
+ //# sourceMappingURL=index.d.mts.map