@gatwech/auth 1.0.0-beta.18

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 (422) hide show
  1. package/README.md +31 -0
  2. package/dist/access-BO2g7QVe.mjs +45 -0
  3. package/dist/access-C6O_osEz.mjs +79 -0
  4. package/dist/access-DT1f6l5k.mjs +51 -0
  5. package/dist/adapter-factory-BZ2Qiqpn.mjs +640 -0
  6. package/dist/adapters/drizzle-adapter/index.d.mts +47 -0
  7. package/dist/adapters/drizzle-adapter/index.mjs +208 -0
  8. package/dist/adapters/index.d.mts +132 -0
  9. package/dist/adapters/index.mjs +18 -0
  10. package/dist/adapters/kysely-adapter/index.d.mts +47 -0
  11. package/dist/adapters/kysely-adapter/index.mjs +11 -0
  12. package/dist/adapters/memory-adapter/index.d.mts +14 -0
  13. package/dist/adapters/memory-adapter/index.mjs +154 -0
  14. package/dist/adapters/mongodb-adapter/index.d.mts +35 -0
  15. package/dist/adapters/mongodb-adapter/index.mjs +315 -0
  16. package/dist/adapters/prisma-adapter/index.d.mts +34 -0
  17. package/dist/adapters/prisma-adapter/index.mjs +159 -0
  18. package/dist/adapters/test.d.mts +81 -0
  19. package/dist/adapters/test.mjs +793 -0
  20. package/dist/admin-Bcq53Nwj.mjs +743 -0
  21. package/dist/admin-DtfO1PLg.d.mts +1689 -0
  22. package/dist/anonymous-CRt1imBW.mjs +107 -0
  23. package/dist/api/index.d.mts +6 -0
  24. package/dist/api/index.mjs +17 -0
  25. package/dist/api-0pR_I-Nx.mjs +3139 -0
  26. package/dist/auth-CBUoBX6o.mjs +233 -0
  27. package/dist/bearer-Djf_awfo.mjs +63 -0
  28. package/dist/bun-sqlite-dialect-CeNvMaZz.mjs +155 -0
  29. package/dist/captcha-BqaMxlKC.mjs +178 -0
  30. package/dist/chunk-BK_LfMhE.mjs +40 -0
  31. package/dist/client/index.d.mts +186 -0
  32. package/dist/client/index.mjs +7 -0
  33. package/dist/client/plugins/index.d.mts +949 -0
  34. package/dist/client/plugins/index.mjs +539 -0
  35. package/dist/client/react/index.d.mts +179 -0
  36. package/dist/client/react/index.mjs +69 -0
  37. package/dist/client-BOX93C3d.d.mts +1250 -0
  38. package/dist/client-CNY0tn9g.d.mts +628 -0
  39. package/dist/client-CygJhqeB.mjs +29 -0
  40. package/dist/client-WiN43tAS.mjs +17 -0
  41. package/dist/client-aExCkfwm.mjs +30 -0
  42. package/dist/cookies/index.d.mts +7 -0
  43. package/dist/cookies/index.mjs +7 -0
  44. package/dist/cookies-cJObLwn1.mjs +597 -0
  45. package/dist/crypto/index.d.mts +44 -0
  46. package/dist/crypto/index.mjs +4 -0
  47. package/dist/crypto-Bb42eMrH.mjs +70 -0
  48. package/dist/custom-session-L3t7ecsd.mjs +67 -0
  49. package/dist/date-Cx2yCiC4.mjs +115 -0
  50. package/dist/db/index.d.mts +7 -0
  51. package/dist/db/index.mjs +15 -0
  52. package/dist/db-BrstmDhc.mjs +1124 -0
  53. package/dist/device-authorization-V4s3h4Mj.mjs +557 -0
  54. package/dist/dialect-CeddeGHf.mjs +72 -0
  55. package/dist/email-otp-BtDHSw14.mjs +592 -0
  56. package/dist/esm-C-QicDNz.mjs +4090 -0
  57. package/dist/generic-oauth-CL5X27ZI.mjs +445 -0
  58. package/dist/get-request-ip-DSjrEpGo.mjs +27 -0
  59. package/dist/get-tables-BQP7YW9c.mjs +249 -0
  60. package/dist/has-permission-BpAr7uCn.mjs +14 -0
  61. package/dist/haveibeenpwned-cMpJvmzI.mjs +43 -0
  62. package/dist/helper-tmxW3BHj.d.mts +21 -0
  63. package/dist/index-34ONrP8l.d.mts +503 -0
  64. package/dist/index-65G5U5DB-DSdjzreF.d.mts +2543 -0
  65. package/dist/index-B-XKqFvY.d.mts +30 -0
  66. package/dist/index-B3n8e37d.d.mts +165 -0
  67. package/dist/index-BBm8nQ9Q.d.mts +42 -0
  68. package/dist/index-BHoQlf7a.d.mts +7699 -0
  69. package/dist/index-BYMI9r_d.d.mts +257 -0
  70. package/dist/index-BqhKCbPH.d.mts +36 -0
  71. package/dist/index-Buhn3hkR.d.mts +433 -0
  72. package/dist/index-C-u1h_WX.d.mts +174 -0
  73. package/dist/index-C7fQuk-V.d.mts +41 -0
  74. package/dist/index-CM-CFWwr.d.mts +1919 -0
  75. package/dist/index-CuFzhoS6.d.mts +359 -0
  76. package/dist/index-Cxi7TbLE.d.mts +11347 -0
  77. package/dist/index-DB7t8whN.d.mts +1 -0
  78. package/dist/index-DKNNV1kb.d.mts +626 -0
  79. package/dist/index-DR0xXno9.d.mts +113 -0
  80. package/dist/index-D_k662QG.d.mts +833 -0
  81. package/dist/index-DaBcikv9.d.mts +118 -0
  82. package/dist/index-DlaMq1nb.d.mts +955 -0
  83. package/dist/index-DoXZYQpq.d.mts +290 -0
  84. package/dist/index-G6V0Z_Mn.d.mts +125 -0
  85. package/dist/index-z0KSvE5i.d.mts +246 -0
  86. package/dist/index-zjjNBRY2.d.mts +95 -0
  87. package/dist/index.d.mts +12 -0
  88. package/dist/index.mjs +33 -0
  89. package/dist/integrations/next-js.d.mts +21 -0
  90. package/dist/integrations/next-js.mjs +62 -0
  91. package/dist/integrations/node.d.mts +15 -0
  92. package/dist/integrations/node.mjs +15 -0
  93. package/dist/integrations/react-start.d.mts +15 -0
  94. package/dist/integrations/react-start.mjs +46 -0
  95. package/dist/json-D0TBLy4q.mjs +24 -0
  96. package/dist/jwt-CmxZAGe2.mjs +94 -0
  97. package/dist/jwt-lHV4QHpD.mjs +387 -0
  98. package/dist/kysely-adapter-DpzYO8Yf.mjs +181 -0
  99. package/dist/magic-link-Bk-ueorR.mjs +176 -0
  100. package/dist/misc-beA1w3XV.mjs +7 -0
  101. package/dist/multi-session-DRrLKrg9.mjs +144 -0
  102. package/dist/node-sqlite-dialect-BcKxBQnm.mjs +155 -0
  103. package/dist/oauth-proxy-D1sWh9B_.mjs +133 -0
  104. package/dist/oauth2/index.d.mts +60 -0
  105. package/dist/oauth2/index.mjs +19 -0
  106. package/dist/one-tap-DMswkTEc.mjs +113 -0
  107. package/dist/organization-BArHO_5v.mjs +3857 -0
  108. package/dist/parser-DcrIEuXE.mjs +73 -0
  109. package/dist/passkey-CcD4CnhM.mjs +558 -0
  110. package/dist/password-sVC4nePO.mjs +25 -0
  111. package/dist/permission-DLYUF3cW.mjs +15 -0
  112. package/dist/phone-number-rHDIlh-2.mjs +485 -0
  113. package/dist/plugin-helper-4L-lzsjZ.mjs +16 -0
  114. package/dist/plugins/access/index.d.mts +3 -0
  115. package/dist/plugins/access/index.mjs +3 -0
  116. package/dist/plugins/admin/access/index.d.mts +116 -0
  117. package/dist/plugins/admin/access/index.mjs +4 -0
  118. package/dist/plugins/admin/index.d.mts +9 -0
  119. package/dist/plugins/admin/index.mjs +22 -0
  120. package/dist/plugins/anonymous/index.d.mts +7 -0
  121. package/dist/plugins/anonymous/index.mjs +18 -0
  122. package/dist/plugins/bearer/index.d.mts +2 -0
  123. package/dist/plugins/bearer/index.mjs +8 -0
  124. package/dist/plugins/captcha/index.d.mts +2 -0
  125. package/dist/plugins/captcha/index.mjs +4 -0
  126. package/dist/plugins/custom-session/index.d.mts +7 -0
  127. package/dist/plugins/custom-session/index.mjs +19 -0
  128. package/dist/plugins/device-authorization/index.d.mts +4 -0
  129. package/dist/plugins/device-authorization/index.mjs +18 -0
  130. package/dist/plugins/email-otp/index.d.mts +3 -0
  131. package/dist/plugins/email-otp/index.mjs +19 -0
  132. package/dist/plugins/generic-oauth/index.d.mts +7 -0
  133. package/dist/plugins/generic-oauth/index.mjs +18 -0
  134. package/dist/plugins/haveibeenpwned/index.d.mts +2 -0
  135. package/dist/plugins/haveibeenpwned/index.mjs +18 -0
  136. package/dist/plugins/index.d.mts +139 -0
  137. package/dist/plugins/index.mjs +47 -0
  138. package/dist/plugins/jwt/index.d.mts +7 -0
  139. package/dist/plugins/jwt/index.mjs +18 -0
  140. package/dist/plugins/magic-link/index.d.mts +2 -0
  141. package/dist/plugins/magic-link/index.mjs +18 -0
  142. package/dist/plugins/multi-session/index.d.mts +3 -0
  143. package/dist/plugins/multi-session/index.mjs +18 -0
  144. package/dist/plugins/oauth-proxy/index.d.mts +2 -0
  145. package/dist/plugins/oauth-proxy/index.mjs +18 -0
  146. package/dist/plugins/one-tap/index.d.mts +2 -0
  147. package/dist/plugins/one-tap/index.mjs +18 -0
  148. package/dist/plugins/one-time-token/index.d.mts +7 -0
  149. package/dist/plugins/one-time-token/index.mjs +47 -0
  150. package/dist/plugins/organization/access/index.d.mts +4 -0
  151. package/dist/plugins/organization/access/index.mjs +4 -0
  152. package/dist/plugins/organization/index.d.mts +9 -0
  153. package/dist/plugins/organization/index.mjs +22 -0
  154. package/dist/plugins/passkey/index.d.mts +7 -0
  155. package/dist/plugins/passkey/index.mjs +18 -0
  156. package/dist/plugins/phone-number/index.d.mts +7 -0
  157. package/dist/plugins/phone-number/index.mjs +18 -0
  158. package/dist/plugins/two-factor/index.d.mts +7 -0
  159. package/dist/plugins/two-factor/index.mjs +20 -0
  160. package/dist/plugins/username/index.d.mts +4 -0
  161. package/dist/plugins/username/index.mjs +18 -0
  162. package/dist/plugins-3jfNste3.mjs +1544 -0
  163. package/dist/plugins-hFZT3hmK.d.mts +14 -0
  164. package/dist/promise-8rrEHRXd.mjs +23154 -0
  165. package/dist/proxy-CL9PZXJA.mjs +441 -0
  166. package/dist/session-Dgp133Yt.mjs +413 -0
  167. package/dist/social-providers/index.d.mts +1 -0
  168. package/dist/social-providers/index.mjs +3 -0
  169. package/dist/src/adapters/adapter-factory/index.d.ts +10 -0
  170. package/dist/src/adapters/adapter-factory/types.d.ts +124 -0
  171. package/dist/src/adapters/create-test-suite.d.ts +97 -0
  172. package/dist/src/adapters/drizzle-adapter/drizzle-adapter.d.ts +43 -0
  173. package/dist/src/adapters/drizzle-adapter/index.d.ts +1 -0
  174. package/dist/src/adapters/drizzle-adapter/test/generate-schema.d.ts +12 -0
  175. package/dist/src/adapters/index.d.ts +21 -0
  176. package/dist/src/adapters/kysely-adapter/bun-sqlite-dialect.d.ts +58 -0
  177. package/dist/src/adapters/kysely-adapter/dialect.d.ts +13 -0
  178. package/dist/src/adapters/kysely-adapter/index.d.ts +3 -0
  179. package/dist/src/adapters/kysely-adapter/kysely-adapter.d.ts +32 -0
  180. package/dist/src/adapters/kysely-adapter/node-sqlite-dialect.d.ts +58 -0
  181. package/dist/src/adapters/kysely-adapter/types.d.ts +1 -0
  182. package/dist/src/adapters/memory-adapter/index.d.ts +1 -0
  183. package/dist/src/adapters/memory-adapter/memory-adapter.d.ts +9 -0
  184. package/dist/src/adapters/mongodb-adapter/index.d.ts +1 -0
  185. package/dist/src/adapters/mongodb-adapter/mongodb-adapter.d.ts +31 -0
  186. package/dist/src/adapters/prisma-adapter/index.d.ts +1 -0
  187. package/dist/src/adapters/prisma-adapter/prisma-adapter.d.ts +32 -0
  188. package/dist/src/adapters/prisma-adapter/test/auth.d.ts +3 -0
  189. package/dist/src/adapters/prisma-adapter/test/generate-auth-config.d.ts +2 -0
  190. package/dist/src/adapters/prisma-adapter/test/generate-prisma-schema.d.ts +3 -0
  191. package/dist/src/adapters/prisma-adapter/test/get-prisma-client.d.ts +7 -0
  192. package/dist/src/adapters/prisma-adapter/test/push-prisma-schema.d.ts +1 -0
  193. package/dist/src/adapters/test-adapter.d.ts +61 -0
  194. package/dist/src/adapters/test.d.ts +78 -0
  195. package/dist/src/adapters/tests/auth-flow.d.ts +22 -0
  196. package/dist/src/adapters/tests/index.d.ts +5 -0
  197. package/dist/src/adapters/tests/normal.d.ts +87 -0
  198. package/dist/src/adapters/tests/number-id.d.ts +17 -0
  199. package/dist/src/adapters/tests/performance.d.ts +24 -0
  200. package/dist/src/adapters/tests/transactions.d.ts +20 -0
  201. package/dist/src/adapters/utils.d.ts +3 -0
  202. package/dist/src/api/index.d.ts +7150 -0
  203. package/dist/src/api/middlewares/index.d.ts +2 -0
  204. package/dist/src/api/middlewares/oauth.d.ts +15 -0
  205. package/dist/src/api/middlewares/origin-check.d.ts +8 -0
  206. package/dist/src/api/rate-limiter/index.d.ts +13 -0
  207. package/dist/src/api/routes/account.d.ts +623 -0
  208. package/dist/src/api/routes/callback.d.ts +68 -0
  209. package/dist/src/api/routes/email-verification.d.ts +266 -0
  210. package/dist/src/api/routes/error.d.ts +51 -0
  211. package/dist/src/api/routes/index.d.ts +11 -0
  212. package/dist/src/api/routes/ok.d.ts +61 -0
  213. package/dist/src/api/routes/reset-password.d.ts +203 -0
  214. package/dist/src/api/routes/session.d.ts +586 -0
  215. package/dist/src/api/routes/sign-in.d.ts +298 -0
  216. package/dist/src/api/routes/sign-out.d.ts +59 -0
  217. package/dist/src/api/routes/sign-up.d.ts +625 -0
  218. package/dist/src/api/routes/update-user.d.ts +862 -0
  219. package/dist/src/api/to-auth-endpoints.d.ts +3 -0
  220. package/dist/src/auth.d.ts +25 -0
  221. package/dist/src/client/broadcast-channel.d.ts +12 -0
  222. package/dist/src/client/config.d.ts +85 -0
  223. package/dist/src/client/fetch-plugins.d.ts +14 -0
  224. package/dist/src/client/index.d.ts +15 -0
  225. package/dist/src/client/parser.d.ts +12 -0
  226. package/dist/src/client/path-to-object.d.ts +63 -0
  227. package/dist/src/client/plugins/index.d.ts +21 -0
  228. package/dist/src/client/plugins/infer-plugin.d.ts +11 -0
  229. package/dist/src/client/proxy.d.ts +8 -0
  230. package/dist/src/client/query.d.ts +16 -0
  231. package/dist/src/client/react/index.d.ts +130 -0
  232. package/dist/src/client/react/react-store.d.ts +43 -0
  233. package/dist/src/client/session-atom.d.ts +18 -0
  234. package/dist/src/client/session-refresh.d.ts +17 -0
  235. package/dist/src/client/test-plugin.d.ts +147 -0
  236. package/dist/src/client/types.d.ts +49 -0
  237. package/dist/src/client/vanilla.d.ts +124 -0
  238. package/dist/src/cookies/check-cookies.d.ts +4 -0
  239. package/dist/src/cookies/cookie-utils.d.ts +16 -0
  240. package/dist/src/cookies/index.d.ts +56 -0
  241. package/dist/src/cookies/session-store.d.ts +43 -0
  242. package/dist/src/crypto/buffer.d.ts +4 -0
  243. package/dist/src/crypto/index.d.ts +14 -0
  244. package/dist/src/crypto/jwt.d.ts +4 -0
  245. package/dist/src/crypto/password.d.ts +5 -0
  246. package/dist/src/crypto/random.d.ts +1 -0
  247. package/dist/src/db/field.d.ts +97 -0
  248. package/dist/src/db/get-migration.d.ts +18 -0
  249. package/dist/src/db/get-schema.d.ts +6 -0
  250. package/dist/src/db/get-tables.d.ts +3 -0
  251. package/dist/src/db/index.d.ts +10 -0
  252. package/dist/src/db/internal-adapter.d.ts +9 -0
  253. package/dist/src/db/schema.d.ts +76 -0
  254. package/dist/src/db/to-zod.d.ts +31 -0
  255. package/dist/src/db/utils.d.ts +6 -0
  256. package/dist/src/db/with-hooks.d.ts +27 -0
  257. package/dist/src/index.d.ts +14 -0
  258. package/dist/src/init.d.ts +2 -0
  259. package/dist/src/integrations/next-js.d.ts +15 -0
  260. package/dist/src/integrations/node.d.ts +6 -0
  261. package/dist/src/integrations/react-start.d.ts +9 -0
  262. package/dist/src/oauth2/index.d.ts +4 -0
  263. package/dist/src/oauth2/link-account.d.ts +41 -0
  264. package/dist/src/oauth2/state.d.ts +21 -0
  265. package/dist/src/oauth2/utils.d.ts +3 -0
  266. package/dist/src/plugins/access/access.d.ts +25 -0
  267. package/dist/src/plugins/access/index.d.ts +2 -0
  268. package/dist/src/plugins/access/types.d.ts +14 -0
  269. package/dist/src/plugins/additional-fields/client.d.ts +91 -0
  270. package/dist/src/plugins/admin/access/index.d.ts +1 -0
  271. package/dist/src/plugins/admin/access/statement.d.ts +110 -0
  272. package/dist/src/plugins/admin/admin.d.ts +1570 -0
  273. package/dist/src/plugins/admin/client.d.ts +62 -0
  274. package/dist/src/plugins/admin/error-codes.d.ts +21 -0
  275. package/dist/src/plugins/admin/has-permission.d.ts +21 -0
  276. package/dist/src/plugins/admin/index.d.ts +2 -0
  277. package/dist/src/plugins/admin/schema.d.ts +36 -0
  278. package/dist/src/plugins/admin/types.d.ts +77 -0
  279. package/dist/src/plugins/anonymous/client.d.ts +8 -0
  280. package/dist/src/plugins/anonymous/index.d.ts +159 -0
  281. package/dist/src/plugins/api-key/client.d.ts +11 -0
  282. package/dist/src/plugins/api-key/index.d.ts +1431 -0
  283. package/dist/src/plugins/api-key/rate-limit.d.ts +20 -0
  284. package/dist/src/plugins/api-key/routes/create-api-key.d.ts +244 -0
  285. package/dist/src/plugins/api-key/routes/delete-all-expired-api-keys.d.ts +45 -0
  286. package/dist/src/plugins/api-key/routes/delete-api-key.d.ts +112 -0
  287. package/dist/src/plugins/api-key/routes/get-api-key.d.ts +234 -0
  288. package/dist/src/plugins/api-key/routes/index.d.ts +1136 -0
  289. package/dist/src/plugins/api-key/routes/list-api-keys.d.ts +231 -0
  290. package/dist/src/plugins/api-key/routes/update-api-key.d.ts +235 -0
  291. package/dist/src/plugins/api-key/routes/verify-api-key.d.ts +80 -0
  292. package/dist/src/plugins/api-key/schema.d.ts +188 -0
  293. package/dist/src/plugins/api-key/types.d.ts +285 -0
  294. package/dist/src/plugins/bearer/index.d.ts +31 -0
  295. package/dist/src/plugins/captcha/constants.d.ts +9 -0
  296. package/dist/src/plugins/captcha/error-codes.d.ts +9 -0
  297. package/dist/src/plugins/captcha/index.d.ts +7 -0
  298. package/dist/src/plugins/captcha/types.d.ts +23 -0
  299. package/dist/src/plugins/captcha/utils.d.ts +1 -0
  300. package/dist/src/plugins/captcha/verify-handlers/captchafox.d.ts +11 -0
  301. package/dist/src/plugins/captcha/verify-handlers/cloudflare-turnstile.d.ts +10 -0
  302. package/dist/src/plugins/captcha/verify-handlers/google-recaptcha.d.ts +11 -0
  303. package/dist/src/plugins/captcha/verify-handlers/h-captcha.d.ts +11 -0
  304. package/dist/src/plugins/captcha/verify-handlers/index.d.ts +4 -0
  305. package/dist/src/plugins/custom-session/client.d.ts +12 -0
  306. package/dist/src/plugins/custom-session/index.d.ts +89 -0
  307. package/dist/src/plugins/device-authorization/client.d.ts +12 -0
  308. package/dist/src/plugins/device-authorization/index.d.ts +568 -0
  309. package/dist/src/plugins/device-authorization/schema.d.ts +56 -0
  310. package/dist/src/plugins/email-otp/client.d.ts +9 -0
  311. package/dist/src/plugins/email-otp/index.d.ts +826 -0
  312. package/dist/src/plugins/email-otp/utils.d.ts +2 -0
  313. package/dist/src/plugins/generic-oauth/client.d.ts +5 -0
  314. package/dist/src/plugins/generic-oauth/index.d.ts +428 -0
  315. package/dist/src/plugins/haveibeenpwned/index.d.ts +25 -0
  316. package/dist/src/plugins/index.d.ts +28 -0
  317. package/dist/src/plugins/jwt/adapter.d.ts +8 -0
  318. package/dist/src/plugins/jwt/client.d.ts +5 -0
  319. package/dist/src/plugins/jwt/index.d.ts +276 -0
  320. package/dist/src/plugins/jwt/schema.d.ts +18 -0
  321. package/dist/src/plugins/jwt/sign.d.ts +8 -0
  322. package/dist/src/plugins/jwt/types.d.ts +175 -0
  323. package/dist/src/plugins/jwt/utils.d.ts +46 -0
  324. package/dist/src/plugins/last-login-method/client.d.ts +34 -0
  325. package/dist/src/plugins/last-login-method/index.d.ts +103 -0
  326. package/dist/src/plugins/magic-link/client.d.ts +5 -0
  327. package/dist/src/plugins/magic-link/index.d.ts +253 -0
  328. package/dist/src/plugins/magic-link/utils.d.ts +1 -0
  329. package/dist/src/plugins/multi-session/client.d.ts +9 -0
  330. package/dist/src/plugins/multi-session/index.d.ts +284 -0
  331. package/dist/src/plugins/oauth-proxy/index.d.ts +119 -0
  332. package/dist/src/plugins/one-tap/client.d.ts +81 -0
  333. package/dist/src/plugins/one-tap/index.d.ts +114 -0
  334. package/dist/src/plugins/one-time-token/client.d.ts +5 -0
  335. package/dist/src/plugins/one-time-token/index.d.ts +170 -0
  336. package/dist/src/plugins/one-time-token/utils.d.ts +1 -0
  337. package/dist/src/plugins/organization/access/index.d.ts +1 -0
  338. package/dist/src/plugins/organization/access/statement.d.ts +241 -0
  339. package/dist/src/plugins/organization/adapter.d.ts +685 -0
  340. package/dist/src/plugins/organization/call.d.ts +55 -0
  341. package/dist/src/plugins/organization/client.d.ts +344 -0
  342. package/dist/src/plugins/organization/error-codes.d.ts +58 -0
  343. package/dist/src/plugins/organization/has-permission.d.ts +13 -0
  344. package/dist/src/plugins/organization/index.d.ts +4 -0
  345. package/dist/src/plugins/organization/organization.d.ts +412 -0
  346. package/dist/src/plugins/organization/permission.d.ts +27 -0
  347. package/dist/src/plugins/organization/routes/crud-access-control.d.ts +701 -0
  348. package/dist/src/plugins/organization/routes/crud-invites.d.ts +1522 -0
  349. package/dist/src/plugins/organization/routes/crud-members.d.ts +1220 -0
  350. package/dist/src/plugins/organization/routes/crud-org.d.ts +1399 -0
  351. package/dist/src/plugins/organization/routes/crud-team.d.ts +1323 -0
  352. package/dist/src/plugins/organization/schema.d.ts +366 -0
  353. package/dist/src/plugins/organization/types.d.ts +737 -0
  354. package/dist/src/plugins/passkey/client.d.ts +190 -0
  355. package/dist/src/plugins/passkey/error-codes.d.ts +9 -0
  356. package/dist/src/plugins/passkey/index.d.ts +838 -0
  357. package/dist/src/plugins/passkey/schema.d.ts +50 -0
  358. package/dist/src/plugins/passkey/types.d.ts +69 -0
  359. package/dist/src/plugins/passkey/utils.d.ts +2 -0
  360. package/dist/src/plugins/phone-number/client.d.ts +9 -0
  361. package/dist/src/plugins/phone-number/index.d.ts +622 -0
  362. package/dist/src/plugins/phone-number/phone-number-error.d.ts +10 -0
  363. package/dist/src/plugins/two-factor/backup-codes/index.d.ts +387 -0
  364. package/dist/src/plugins/two-factor/client.d.ts +28 -0
  365. package/dist/src/plugins/two-factor/constant.d.ts +2 -0
  366. package/dist/src/plugins/two-factor/error-code.d.ts +11 -0
  367. package/dist/src/plugins/two-factor/index.d.ts +1014 -0
  368. package/dist/src/plugins/two-factor/otp/index.d.ts +282 -0
  369. package/dist/src/plugins/two-factor/schema.d.ts +35 -0
  370. package/dist/src/plugins/two-factor/totp/index.d.ts +298 -0
  371. package/dist/src/plugins/two-factor/types.d.ts +50 -0
  372. package/dist/src/plugins/two-factor/utils.d.ts +1 -0
  373. package/dist/src/plugins/two-factor/verify-two-factor.d.ts +59 -0
  374. package/dist/src/plugins/username/client.d.ts +5 -0
  375. package/dist/src/plugins/username/error-codes.d.ts +10 -0
  376. package/dist/src/plugins/username/index.d.ts +313 -0
  377. package/dist/src/plugins/username/schema.d.ts +27 -0
  378. package/dist/src/social-providers/index.d.ts +1 -0
  379. package/dist/src/test-utils/headers.d.ts +5 -0
  380. package/dist/src/test-utils/index.d.ts +2 -0
  381. package/dist/src/test-utils/test-instance.d.ts +17849 -0
  382. package/dist/src/types/adapter.d.ts +21 -0
  383. package/dist/src/types/api.d.ts +29 -0
  384. package/dist/src/types/helper.d.ts +32 -0
  385. package/dist/src/types/index.d.ts +7 -0
  386. package/dist/src/types/models.d.ts +13 -0
  387. package/dist/src/types/plugins.d.ts +14 -0
  388. package/dist/src/utils/await-object.d.ts +3 -0
  389. package/dist/src/utils/boolean.d.ts +1 -0
  390. package/dist/src/utils/clone.d.ts +1 -0
  391. package/dist/src/utils/constants.d.ts +1 -0
  392. package/dist/src/utils/date.d.ts +1 -0
  393. package/dist/src/utils/ensure-utc.d.ts +1 -0
  394. package/dist/src/utils/get-request-ip.d.ts +2 -0
  395. package/dist/src/utils/hashing.d.ts +6 -0
  396. package/dist/src/utils/hide-metadata.d.ts +3 -0
  397. package/dist/src/utils/id.d.ts +1 -0
  398. package/dist/src/utils/import-util.d.ts +1 -0
  399. package/dist/src/utils/index.d.ts +5 -0
  400. package/dist/src/utils/is-atom.d.ts +2 -0
  401. package/dist/src/utils/is-promise.d.ts +1 -0
  402. package/dist/src/utils/json.d.ts +1 -0
  403. package/dist/src/utils/merger.d.ts +1 -0
  404. package/dist/src/utils/middleware-response.d.ts +8 -0
  405. package/dist/src/utils/misc.d.ts +1 -0
  406. package/dist/src/utils/password.d.ts +6 -0
  407. package/dist/src/utils/plugin-helper.d.ts +5 -0
  408. package/dist/src/utils/shim.d.ts +3 -0
  409. package/dist/src/utils/time.d.ts +4 -0
  410. package/dist/src/utils/url.d.ts +4 -0
  411. package/dist/src/utils/wildcard.d.ts +45 -0
  412. package/dist/test-utils/index.d.mts +17870 -0
  413. package/dist/test-utils/index.mjs +272 -0
  414. package/dist/two-factor-ClUXxom2.mjs +914 -0
  415. package/dist/types/index.d.mts +6 -0
  416. package/dist/types/index.mjs +3 -0
  417. package/dist/types-B1OL7hyf.d.mts +4 -0
  418. package/dist/types-Bjn15Uy6.mjs +1 -0
  419. package/dist/url-VB2gAbTI.mjs +59 -0
  420. package/dist/username-DiGklOGl.mjs +278 -0
  421. package/dist/utils-SOMB4Px5.mjs +132 -0
  422. package/package.json +447 -0
@@ -0,0 +1,1136 @@
1
+ import type { AuthContext } from "@gatwech/core";
2
+ import type { apiKeySchema } from "../schema";
3
+ import type { ApiKey, ApiKeyOptions } from "../types";
4
+ export type PredefinedApiKeyOptions = ApiKeyOptions & Required<Pick<ApiKeyOptions, "apiKeyHeaders" | "defaultKeyLength" | "keyExpiration" | "rateLimit" | "maximumPrefixLength" | "minimumPrefixLength" | "maximumNameLength" | "disableKeyHashing" | "minimumNameLength" | "requireName" | "enableMetadata" | "enableSessionForAPIKeys" | "startingCharactersConfig">> & {
5
+ keyExpiration: Required<ApiKeyOptions["keyExpiration"]>;
6
+ startingCharactersConfig: Required<ApiKeyOptions["startingCharactersConfig"]>;
7
+ };
8
+ export declare function deleteAllExpiredApiKeys(ctx: AuthContext, byPassLastCheckTime?: boolean): Promise<void>;
9
+ export declare function createApiKeyRoutes({ keyGenerator, opts, schema, }: {
10
+ keyGenerator: (options: {
11
+ length: number;
12
+ prefix: string | undefined;
13
+ }) => Promise<string> | string;
14
+ opts: PredefinedApiKeyOptions;
15
+ schema: ReturnType<typeof apiKeySchema>;
16
+ }): {
17
+ createApiKey: {
18
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
19
+ body: {
20
+ name?: string | undefined;
21
+ expiresIn?: number | null | undefined;
22
+ userId?: unknown;
23
+ prefix?: string | undefined;
24
+ remaining?: number | null | undefined;
25
+ metadata?: any;
26
+ refillAmount?: number | undefined;
27
+ refillInterval?: number | undefined;
28
+ rateLimitTimeWindow?: number | undefined;
29
+ rateLimitMax?: number | undefined;
30
+ rateLimitEnabled?: boolean | undefined;
31
+ permissions?: Record<string, string[]> | undefined;
32
+ };
33
+ } & {
34
+ method?: "POST" | undefined;
35
+ } & {
36
+ query?: Record<string, any> | undefined;
37
+ } & {
38
+ params?: Record<string, any>;
39
+ } & {
40
+ request?: Request;
41
+ } & {
42
+ headers?: HeadersInit;
43
+ } & {
44
+ asResponse?: boolean;
45
+ returnHeaders?: boolean;
46
+ use?: import("better-call").Middleware[];
47
+ path?: string;
48
+ } & {
49
+ asResponse?: AsResponse | undefined;
50
+ returnHeaders?: ReturnHeaders | undefined;
51
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
52
+ headers: Headers;
53
+ response: {
54
+ key: string;
55
+ metadata: any;
56
+ permissions: any;
57
+ id: string;
58
+ name: string | null;
59
+ start: string | null;
60
+ prefix: string | null;
61
+ userId: string;
62
+ refillInterval: number | null;
63
+ refillAmount: number | null;
64
+ lastRefillAt: Date | null;
65
+ enabled: boolean;
66
+ rateLimitEnabled: boolean;
67
+ rateLimitTimeWindow: number | null;
68
+ rateLimitMax: number | null;
69
+ requestCount: number;
70
+ remaining: number | null;
71
+ lastRequest: Date | null;
72
+ expiresAt: Date | null;
73
+ createdAt: Date;
74
+ updatedAt: Date;
75
+ };
76
+ } : {
77
+ key: string;
78
+ metadata: any;
79
+ permissions: any;
80
+ id: string;
81
+ name: string | null;
82
+ start: string | null;
83
+ prefix: string | null;
84
+ userId: string;
85
+ refillInterval: number | null;
86
+ refillAmount: number | null;
87
+ lastRefillAt: Date | null;
88
+ enabled: boolean;
89
+ rateLimitEnabled: boolean;
90
+ rateLimitTimeWindow: number | null;
91
+ rateLimitMax: number | null;
92
+ requestCount: number;
93
+ remaining: number | null;
94
+ lastRequest: Date | null;
95
+ expiresAt: Date | null;
96
+ createdAt: Date;
97
+ updatedAt: Date;
98
+ }>;
99
+ options: {
100
+ method: "POST";
101
+ body: import("zod").ZodObject<{
102
+ name: import("zod").ZodOptional<import("zod").ZodString>;
103
+ expiresIn: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
104
+ userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
105
+ prefix: import("zod").ZodOptional<import("zod").ZodString>;
106
+ remaining: import("zod").ZodDefault<import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>>;
107
+ metadata: import("zod").ZodOptional<import("zod").ZodAny>;
108
+ refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
109
+ refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
110
+ rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
111
+ rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
112
+ rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
113
+ permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
114
+ }, import("zod/v4/core").$strip>;
115
+ metadata: {
116
+ openapi: {
117
+ description: string;
118
+ responses: {
119
+ "200": {
120
+ description: string;
121
+ content: {
122
+ "application/json": {
123
+ schema: {
124
+ type: "object";
125
+ properties: {
126
+ id: {
127
+ type: string;
128
+ description: string;
129
+ };
130
+ createdAt: {
131
+ type: string;
132
+ format: string;
133
+ description: string;
134
+ };
135
+ updatedAt: {
136
+ type: string;
137
+ format: string;
138
+ description: string;
139
+ };
140
+ name: {
141
+ type: string;
142
+ nullable: boolean;
143
+ description: string;
144
+ };
145
+ prefix: {
146
+ type: string;
147
+ nullable: boolean;
148
+ description: string;
149
+ };
150
+ start: {
151
+ type: string;
152
+ nullable: boolean;
153
+ description: string;
154
+ };
155
+ key: {
156
+ type: string;
157
+ description: string;
158
+ };
159
+ enabled: {
160
+ type: string;
161
+ description: string;
162
+ };
163
+ expiresAt: {
164
+ type: string;
165
+ format: string;
166
+ nullable: boolean;
167
+ description: string;
168
+ };
169
+ userId: {
170
+ type: string;
171
+ description: string;
172
+ };
173
+ lastRefillAt: {
174
+ type: string;
175
+ format: string;
176
+ nullable: boolean;
177
+ description: string;
178
+ };
179
+ lastRequest: {
180
+ type: string;
181
+ format: string;
182
+ nullable: boolean;
183
+ description: string;
184
+ };
185
+ metadata: {
186
+ type: string;
187
+ nullable: boolean;
188
+ additionalProperties: boolean;
189
+ description: string;
190
+ };
191
+ rateLimitMax: {
192
+ type: string;
193
+ nullable: boolean;
194
+ description: string;
195
+ };
196
+ rateLimitTimeWindow: {
197
+ type: string;
198
+ nullable: boolean;
199
+ description: string;
200
+ };
201
+ remaining: {
202
+ type: string;
203
+ nullable: boolean;
204
+ description: string;
205
+ };
206
+ refillAmount: {
207
+ type: string;
208
+ nullable: boolean;
209
+ description: string;
210
+ };
211
+ refillInterval: {
212
+ type: string;
213
+ nullable: boolean;
214
+ description: string;
215
+ };
216
+ rateLimitEnabled: {
217
+ type: string;
218
+ description: string;
219
+ };
220
+ requestCount: {
221
+ type: string;
222
+ description: string;
223
+ };
224
+ permissions: {
225
+ type: string;
226
+ nullable: boolean;
227
+ additionalProperties: {
228
+ type: string;
229
+ items: {
230
+ type: string;
231
+ };
232
+ };
233
+ description: string;
234
+ };
235
+ };
236
+ required: string[];
237
+ };
238
+ };
239
+ };
240
+ };
241
+ };
242
+ };
243
+ };
244
+ } & {
245
+ use: any[];
246
+ };
247
+ path: "/api-key/create";
248
+ };
249
+ verifyApiKey: {
250
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
251
+ body: {
252
+ key: string;
253
+ permissions?: Record<string, string[]> | undefined;
254
+ };
255
+ } & {
256
+ method?: "POST" | undefined;
257
+ } & {
258
+ query?: Record<string, any> | undefined;
259
+ } & {
260
+ params?: Record<string, any>;
261
+ } & {
262
+ request?: Request;
263
+ } & {
264
+ headers?: HeadersInit;
265
+ } & {
266
+ asResponse?: boolean;
267
+ returnHeaders?: boolean;
268
+ use?: import("better-call").Middleware[];
269
+ path?: string;
270
+ } & {
271
+ asResponse?: AsResponse | undefined;
272
+ returnHeaders?: ReturnHeaders | undefined;
273
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
274
+ headers: Headers;
275
+ response: {
276
+ valid: boolean;
277
+ error: {
278
+ message: string | undefined;
279
+ code: string;
280
+ };
281
+ key: null;
282
+ } | {
283
+ valid: boolean;
284
+ error: null;
285
+ key: Omit<ApiKey, "key"> | null;
286
+ };
287
+ } : {
288
+ valid: boolean;
289
+ error: {
290
+ message: string | undefined;
291
+ code: string;
292
+ };
293
+ key: null;
294
+ } | {
295
+ valid: boolean;
296
+ error: null;
297
+ key: Omit<ApiKey, "key"> | null;
298
+ }>;
299
+ options: {
300
+ method: "POST";
301
+ body: import("zod").ZodObject<{
302
+ key: import("zod").ZodString;
303
+ permissions: import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>;
304
+ }, import("zod/v4/core").$strip>;
305
+ metadata: {
306
+ SERVER_ONLY: true;
307
+ };
308
+ } & {
309
+ use: any[];
310
+ };
311
+ path: "/api-key/verify";
312
+ };
313
+ getApiKey: {
314
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
315
+ body?: undefined;
316
+ } & {
317
+ method?: "GET" | undefined;
318
+ } & {
319
+ query: {
320
+ id: string;
321
+ };
322
+ } & {
323
+ params?: Record<string, any>;
324
+ } & {
325
+ request?: Request;
326
+ } & {
327
+ headers?: HeadersInit;
328
+ } & {
329
+ asResponse?: boolean;
330
+ returnHeaders?: boolean;
331
+ use?: import("better-call").Middleware[];
332
+ path?: string;
333
+ } & {
334
+ asResponse?: AsResponse | undefined;
335
+ returnHeaders?: ReturnHeaders | undefined;
336
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
337
+ headers: Headers;
338
+ response: {
339
+ permissions: {
340
+ [key: string]: string[];
341
+ } | null;
342
+ id: string;
343
+ name: string | null;
344
+ start: string | null;
345
+ prefix: string | null;
346
+ userId: string;
347
+ refillInterval: number | null;
348
+ refillAmount: number | null;
349
+ lastRefillAt: Date | null;
350
+ enabled: boolean;
351
+ rateLimitEnabled: boolean;
352
+ rateLimitTimeWindow: number | null;
353
+ rateLimitMax: number | null;
354
+ requestCount: number;
355
+ remaining: number | null;
356
+ lastRequest: Date | null;
357
+ expiresAt: Date | null;
358
+ createdAt: Date;
359
+ updatedAt: Date;
360
+ metadata: Record<string, any> | null;
361
+ };
362
+ } : {
363
+ permissions: {
364
+ [key: string]: string[];
365
+ } | null;
366
+ id: string;
367
+ name: string | null;
368
+ start: string | null;
369
+ prefix: string | null;
370
+ userId: string;
371
+ refillInterval: number | null;
372
+ refillAmount: number | null;
373
+ lastRefillAt: Date | null;
374
+ enabled: boolean;
375
+ rateLimitEnabled: boolean;
376
+ rateLimitTimeWindow: number | null;
377
+ rateLimitMax: number | null;
378
+ requestCount: number;
379
+ remaining: number | null;
380
+ lastRequest: Date | null;
381
+ expiresAt: Date | null;
382
+ createdAt: Date;
383
+ updatedAt: Date;
384
+ metadata: Record<string, any> | null;
385
+ }>;
386
+ options: {
387
+ method: "GET";
388
+ query: import("zod").ZodObject<{
389
+ id: import("zod").ZodString;
390
+ }, import("zod/v4/core").$strip>;
391
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
392
+ session: {
393
+ session: Record<string, any> & {
394
+ id: string;
395
+ createdAt: Date;
396
+ updatedAt: Date;
397
+ userId: string;
398
+ expiresAt: Date;
399
+ token: string;
400
+ ipAddress?: string | null | undefined;
401
+ userAgent?: string | null | undefined;
402
+ };
403
+ user: Record<string, any> & {
404
+ id: string;
405
+ createdAt: Date;
406
+ updatedAt: Date;
407
+ email: string;
408
+ emailVerified: boolean;
409
+ name: string;
410
+ image?: string | null | undefined;
411
+ };
412
+ };
413
+ }>)[];
414
+ metadata: {
415
+ openapi: {
416
+ description: string;
417
+ responses: {
418
+ "200": {
419
+ description: string;
420
+ content: {
421
+ "application/json": {
422
+ schema: {
423
+ type: "object";
424
+ properties: {
425
+ id: {
426
+ type: string;
427
+ description: string;
428
+ };
429
+ name: {
430
+ type: string;
431
+ nullable: boolean;
432
+ description: string;
433
+ };
434
+ start: {
435
+ type: string;
436
+ nullable: boolean;
437
+ description: string;
438
+ };
439
+ prefix: {
440
+ type: string;
441
+ nullable: boolean;
442
+ description: string;
443
+ };
444
+ userId: {
445
+ type: string;
446
+ description: string;
447
+ };
448
+ refillInterval: {
449
+ type: string;
450
+ nullable: boolean;
451
+ description: string;
452
+ };
453
+ refillAmount: {
454
+ type: string;
455
+ nullable: boolean;
456
+ description: string;
457
+ };
458
+ lastRefillAt: {
459
+ type: string;
460
+ format: string;
461
+ nullable: boolean;
462
+ description: string;
463
+ };
464
+ enabled: {
465
+ type: string;
466
+ description: string;
467
+ default: boolean;
468
+ };
469
+ rateLimitEnabled: {
470
+ type: string;
471
+ description: string;
472
+ };
473
+ rateLimitTimeWindow: {
474
+ type: string;
475
+ nullable: boolean;
476
+ description: string;
477
+ };
478
+ rateLimitMax: {
479
+ type: string;
480
+ nullable: boolean;
481
+ description: string;
482
+ };
483
+ requestCount: {
484
+ type: string;
485
+ description: string;
486
+ };
487
+ remaining: {
488
+ type: string;
489
+ nullable: boolean;
490
+ description: string;
491
+ };
492
+ lastRequest: {
493
+ type: string;
494
+ format: string;
495
+ nullable: boolean;
496
+ description: string;
497
+ };
498
+ expiresAt: {
499
+ type: string;
500
+ format: string;
501
+ nullable: boolean;
502
+ description: string;
503
+ };
504
+ createdAt: {
505
+ type: string;
506
+ format: string;
507
+ description: string;
508
+ };
509
+ updatedAt: {
510
+ type: string;
511
+ format: string;
512
+ description: string;
513
+ };
514
+ metadata: {
515
+ type: string;
516
+ nullable: boolean;
517
+ additionalProperties: boolean;
518
+ description: string;
519
+ };
520
+ permissions: {
521
+ type: string;
522
+ nullable: boolean;
523
+ description: string;
524
+ };
525
+ };
526
+ required: string[];
527
+ };
528
+ };
529
+ };
530
+ };
531
+ };
532
+ };
533
+ };
534
+ } & {
535
+ use: any[];
536
+ };
537
+ path: "/api-key/get";
538
+ };
539
+ updateApiKey: {
540
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
541
+ body: {
542
+ keyId: string;
543
+ userId?: unknown;
544
+ name?: string | undefined;
545
+ enabled?: boolean | undefined;
546
+ remaining?: number | undefined;
547
+ refillAmount?: number | undefined;
548
+ refillInterval?: number | undefined;
549
+ metadata?: any;
550
+ expiresIn?: number | null | undefined;
551
+ rateLimitEnabled?: boolean | undefined;
552
+ rateLimitTimeWindow?: number | undefined;
553
+ rateLimitMax?: number | undefined;
554
+ permissions?: Record<string, string[]> | null | undefined;
555
+ };
556
+ } & {
557
+ method?: "POST" | undefined;
558
+ } & {
559
+ query?: Record<string, any> | undefined;
560
+ } & {
561
+ params?: Record<string, any>;
562
+ } & {
563
+ request?: Request;
564
+ } & {
565
+ headers?: HeadersInit;
566
+ } & {
567
+ asResponse?: boolean;
568
+ returnHeaders?: boolean;
569
+ use?: import("better-call").Middleware[];
570
+ path?: string;
571
+ } & {
572
+ asResponse?: AsResponse | undefined;
573
+ returnHeaders?: ReturnHeaders | undefined;
574
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
575
+ headers: Headers;
576
+ response: {
577
+ permissions: {
578
+ [key: string]: string[];
579
+ } | null;
580
+ id: string;
581
+ name: string | null;
582
+ start: string | null;
583
+ prefix: string | null;
584
+ userId: string;
585
+ refillInterval: number | null;
586
+ refillAmount: number | null;
587
+ lastRefillAt: Date | null;
588
+ enabled: boolean;
589
+ rateLimitEnabled: boolean;
590
+ rateLimitTimeWindow: number | null;
591
+ rateLimitMax: number | null;
592
+ requestCount: number;
593
+ remaining: number | null;
594
+ lastRequest: Date | null;
595
+ expiresAt: Date | null;
596
+ createdAt: Date;
597
+ updatedAt: Date;
598
+ metadata: Record<string, any> | null;
599
+ };
600
+ } : {
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
+ metadata: Record<string, any> | null;
623
+ }>;
624
+ options: {
625
+ method: "POST";
626
+ body: import("zod").ZodObject<{
627
+ keyId: import("zod").ZodString;
628
+ userId: import("zod").ZodOptional<import("zod").ZodCoercedString<unknown>>;
629
+ name: import("zod").ZodOptional<import("zod").ZodString>;
630
+ enabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
631
+ remaining: import("zod").ZodOptional<import("zod").ZodNumber>;
632
+ refillAmount: import("zod").ZodOptional<import("zod").ZodNumber>;
633
+ refillInterval: import("zod").ZodOptional<import("zod").ZodNumber>;
634
+ metadata: import("zod").ZodOptional<import("zod").ZodAny>;
635
+ expiresIn: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodNumber>>;
636
+ rateLimitEnabled: import("zod").ZodOptional<import("zod").ZodBoolean>;
637
+ rateLimitTimeWindow: import("zod").ZodOptional<import("zod").ZodNumber>;
638
+ rateLimitMax: import("zod").ZodOptional<import("zod").ZodNumber>;
639
+ permissions: import("zod").ZodNullable<import("zod").ZodOptional<import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString>>>>;
640
+ }, import("zod/v4/core").$strip>;
641
+ metadata: {
642
+ openapi: {
643
+ description: string;
644
+ responses: {
645
+ "200": {
646
+ description: string;
647
+ content: {
648
+ "application/json": {
649
+ schema: {
650
+ type: "object";
651
+ properties: {
652
+ id: {
653
+ type: string;
654
+ description: string;
655
+ };
656
+ name: {
657
+ type: string;
658
+ nullable: boolean;
659
+ description: string;
660
+ };
661
+ start: {
662
+ type: string;
663
+ nullable: boolean;
664
+ description: string;
665
+ };
666
+ prefix: {
667
+ type: string;
668
+ nullable: boolean;
669
+ description: string;
670
+ };
671
+ userId: {
672
+ type: string;
673
+ description: string;
674
+ };
675
+ refillInterval: {
676
+ type: string;
677
+ nullable: boolean;
678
+ description: string;
679
+ };
680
+ refillAmount: {
681
+ type: string;
682
+ nullable: boolean;
683
+ description: string;
684
+ };
685
+ lastRefillAt: {
686
+ type: string;
687
+ format: string;
688
+ nullable: boolean;
689
+ description: string;
690
+ };
691
+ enabled: {
692
+ type: string;
693
+ description: string;
694
+ default: boolean;
695
+ };
696
+ rateLimitEnabled: {
697
+ type: string;
698
+ description: string;
699
+ };
700
+ rateLimitTimeWindow: {
701
+ type: string;
702
+ nullable: boolean;
703
+ description: string;
704
+ };
705
+ rateLimitMax: {
706
+ type: string;
707
+ nullable: boolean;
708
+ description: string;
709
+ };
710
+ requestCount: {
711
+ type: string;
712
+ description: string;
713
+ };
714
+ remaining: {
715
+ type: string;
716
+ nullable: boolean;
717
+ description: string;
718
+ };
719
+ lastRequest: {
720
+ type: string;
721
+ format: string;
722
+ nullable: boolean;
723
+ description: string;
724
+ };
725
+ expiresAt: {
726
+ type: string;
727
+ format: string;
728
+ nullable: boolean;
729
+ description: string;
730
+ };
731
+ createdAt: {
732
+ type: string;
733
+ format: string;
734
+ description: string;
735
+ };
736
+ updatedAt: {
737
+ type: string;
738
+ format: string;
739
+ description: string;
740
+ };
741
+ metadata: {
742
+ type: string;
743
+ nullable: boolean;
744
+ additionalProperties: boolean;
745
+ description: string;
746
+ };
747
+ permissions: {
748
+ type: string;
749
+ nullable: boolean;
750
+ description: string;
751
+ };
752
+ };
753
+ required: string[];
754
+ };
755
+ };
756
+ };
757
+ };
758
+ };
759
+ };
760
+ };
761
+ } & {
762
+ use: any[];
763
+ };
764
+ path: "/api-key/update";
765
+ };
766
+ deleteApiKey: {
767
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
768
+ body: {
769
+ keyId: string;
770
+ };
771
+ } & {
772
+ method?: "POST" | undefined;
773
+ } & {
774
+ query?: Record<string, any> | undefined;
775
+ } & {
776
+ params?: Record<string, any>;
777
+ } & {
778
+ request?: Request;
779
+ } & {
780
+ headers?: HeadersInit;
781
+ } & {
782
+ asResponse?: boolean;
783
+ returnHeaders?: boolean;
784
+ use?: import("better-call").Middleware[];
785
+ path?: string;
786
+ } & {
787
+ asResponse?: AsResponse | undefined;
788
+ returnHeaders?: ReturnHeaders | undefined;
789
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
790
+ headers: Headers;
791
+ response: {
792
+ success: boolean;
793
+ };
794
+ } : {
795
+ success: boolean;
796
+ }>;
797
+ options: {
798
+ method: "POST";
799
+ body: import("zod").ZodObject<{
800
+ keyId: import("zod").ZodString;
801
+ }, import("zod/v4/core").$strip>;
802
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
803
+ session: {
804
+ session: Record<string, any> & {
805
+ id: string;
806
+ createdAt: Date;
807
+ updatedAt: Date;
808
+ userId: string;
809
+ expiresAt: Date;
810
+ token: string;
811
+ ipAddress?: string | null | undefined;
812
+ userAgent?: string | null | undefined;
813
+ };
814
+ user: Record<string, any> & {
815
+ id: string;
816
+ createdAt: Date;
817
+ updatedAt: Date;
818
+ email: string;
819
+ emailVerified: boolean;
820
+ name: string;
821
+ image?: string | null | undefined;
822
+ };
823
+ };
824
+ }>)[];
825
+ metadata: {
826
+ openapi: {
827
+ description: string;
828
+ requestBody: {
829
+ content: {
830
+ "application/json": {
831
+ schema: {
832
+ type: "object";
833
+ properties: {
834
+ keyId: {
835
+ type: string;
836
+ description: string;
837
+ };
838
+ };
839
+ required: string[];
840
+ };
841
+ };
842
+ };
843
+ };
844
+ responses: {
845
+ "200": {
846
+ description: string;
847
+ content: {
848
+ "application/json": {
849
+ schema: {
850
+ type: "object";
851
+ properties: {
852
+ success: {
853
+ type: string;
854
+ description: string;
855
+ };
856
+ };
857
+ required: string[];
858
+ };
859
+ };
860
+ };
861
+ };
862
+ };
863
+ };
864
+ };
865
+ } & {
866
+ use: any[];
867
+ };
868
+ path: "/api-key/delete";
869
+ };
870
+ listApiKeys: {
871
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
872
+ body?: undefined;
873
+ } & {
874
+ method?: "GET" | undefined;
875
+ } & {
876
+ query?: Record<string, any> | undefined;
877
+ } & {
878
+ params?: Record<string, any>;
879
+ } & {
880
+ request?: Request;
881
+ } & {
882
+ headers?: HeadersInit;
883
+ } & {
884
+ asResponse?: boolean;
885
+ returnHeaders?: boolean;
886
+ use?: import("better-call").Middleware[];
887
+ path?: string;
888
+ } & {
889
+ asResponse?: AsResponse | undefined;
890
+ returnHeaders?: ReturnHeaders | undefined;
891
+ }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
892
+ headers: Headers;
893
+ response: {
894
+ permissions: {
895
+ [key: string]: string[];
896
+ } | null;
897
+ id: string;
898
+ name: string | null;
899
+ start: string | null;
900
+ prefix: string | null;
901
+ userId: string;
902
+ refillInterval: number | null;
903
+ refillAmount: number | null;
904
+ lastRefillAt: Date | null;
905
+ enabled: boolean;
906
+ rateLimitEnabled: boolean;
907
+ rateLimitTimeWindow: number | null;
908
+ rateLimitMax: number | null;
909
+ requestCount: number;
910
+ remaining: number | null;
911
+ lastRequest: Date | null;
912
+ expiresAt: Date | null;
913
+ createdAt: Date;
914
+ updatedAt: Date;
915
+ metadata: Record<string, any> | null;
916
+ }[];
917
+ } : {
918
+ permissions: {
919
+ [key: string]: string[];
920
+ } | null;
921
+ id: string;
922
+ name: string | null;
923
+ start: string | null;
924
+ prefix: string | null;
925
+ userId: string;
926
+ refillInterval: number | null;
927
+ refillAmount: number | null;
928
+ lastRefillAt: Date | null;
929
+ enabled: boolean;
930
+ rateLimitEnabled: boolean;
931
+ rateLimitTimeWindow: number | null;
932
+ rateLimitMax: number | null;
933
+ requestCount: number;
934
+ remaining: number | null;
935
+ lastRequest: Date | null;
936
+ expiresAt: Date | null;
937
+ createdAt: Date;
938
+ updatedAt: Date;
939
+ metadata: Record<string, any> | null;
940
+ }[]>;
941
+ options: {
942
+ method: "GET";
943
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
944
+ session: {
945
+ session: Record<string, any> & {
946
+ id: string;
947
+ createdAt: Date;
948
+ updatedAt: Date;
949
+ userId: string;
950
+ expiresAt: Date;
951
+ token: string;
952
+ ipAddress?: string | null | undefined;
953
+ userAgent?: string | null | undefined;
954
+ };
955
+ user: Record<string, any> & {
956
+ id: string;
957
+ createdAt: Date;
958
+ updatedAt: Date;
959
+ email: string;
960
+ emailVerified: boolean;
961
+ name: string;
962
+ image?: string | null | undefined;
963
+ };
964
+ };
965
+ }>)[];
966
+ metadata: {
967
+ openapi: {
968
+ description: string;
969
+ responses: {
970
+ "200": {
971
+ description: string;
972
+ content: {
973
+ "application/json": {
974
+ schema: {
975
+ type: "array";
976
+ items: {
977
+ type: string;
978
+ properties: {
979
+ id: {
980
+ type: string;
981
+ description: string;
982
+ };
983
+ name: {
984
+ type: string;
985
+ nullable: boolean;
986
+ description: string;
987
+ };
988
+ start: {
989
+ type: string;
990
+ nullable: boolean;
991
+ description: string;
992
+ };
993
+ prefix: {
994
+ type: string;
995
+ nullable: boolean;
996
+ description: string;
997
+ };
998
+ userId: {
999
+ type: string;
1000
+ description: string;
1001
+ };
1002
+ refillInterval: {
1003
+ type: string;
1004
+ nullable: boolean;
1005
+ description: string;
1006
+ };
1007
+ refillAmount: {
1008
+ type: string;
1009
+ nullable: boolean;
1010
+ description: string;
1011
+ };
1012
+ lastRefillAt: {
1013
+ type: string;
1014
+ format: string;
1015
+ nullable: boolean;
1016
+ description: string;
1017
+ };
1018
+ enabled: {
1019
+ type: string;
1020
+ description: string;
1021
+ default: boolean;
1022
+ };
1023
+ rateLimitEnabled: {
1024
+ type: string;
1025
+ description: string;
1026
+ };
1027
+ rateLimitTimeWindow: {
1028
+ type: string;
1029
+ nullable: boolean;
1030
+ description: string;
1031
+ };
1032
+ rateLimitMax: {
1033
+ type: string;
1034
+ nullable: boolean;
1035
+ description: string;
1036
+ };
1037
+ requestCount: {
1038
+ type: string;
1039
+ description: string;
1040
+ };
1041
+ remaining: {
1042
+ type: string;
1043
+ nullable: boolean;
1044
+ description: string;
1045
+ };
1046
+ lastRequest: {
1047
+ type: string;
1048
+ format: string;
1049
+ nullable: boolean;
1050
+ description: string;
1051
+ };
1052
+ expiresAt: {
1053
+ type: string;
1054
+ format: string;
1055
+ nullable: boolean;
1056
+ description: string;
1057
+ };
1058
+ createdAt: {
1059
+ type: string;
1060
+ format: string;
1061
+ description: string;
1062
+ };
1063
+ updatedAt: {
1064
+ type: string;
1065
+ format: string;
1066
+ description: string;
1067
+ };
1068
+ metadata: {
1069
+ type: string;
1070
+ nullable: boolean;
1071
+ additionalProperties: boolean;
1072
+ description: string;
1073
+ };
1074
+ permissions: {
1075
+ type: string;
1076
+ nullable: boolean;
1077
+ description: string;
1078
+ };
1079
+ };
1080
+ required: string[];
1081
+ };
1082
+ };
1083
+ };
1084
+ };
1085
+ };
1086
+ };
1087
+ };
1088
+ };
1089
+ } & {
1090
+ use: any[];
1091
+ };
1092
+ path: "/api-key/list";
1093
+ };
1094
+ deleteAllExpiredApiKeys: {
1095
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
1096
+ body?: undefined;
1097
+ } & {
1098
+ method?: "POST" | undefined;
1099
+ } & {
1100
+ query?: Record<string, any> | undefined;
1101
+ } & {
1102
+ params?: Record<string, any>;
1103
+ } & {
1104
+ request?: Request;
1105
+ } & {
1106
+ headers?: HeadersInit;
1107
+ } & {
1108
+ asResponse?: boolean;
1109
+ returnHeaders?: boolean;
1110
+ use?: import("better-call").Middleware[];
1111
+ path?: string;
1112
+ } & {
1113
+ asResponse?: AsResponse | undefined;
1114
+ returnHeaders?: ReturnHeaders | undefined;
1115
+ }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1116
+ headers: Headers;
1117
+ response: {
1118
+ success: boolean;
1119
+ error: unknown;
1120
+ };
1121
+ } : {
1122
+ success: boolean;
1123
+ error: unknown;
1124
+ }>;
1125
+ options: {
1126
+ method: "POST";
1127
+ metadata: {
1128
+ SERVER_ONLY: true;
1129
+ client: boolean;
1130
+ };
1131
+ } & {
1132
+ use: any[];
1133
+ };
1134
+ path: "/api-key/delete-all-expired-api-keys";
1135
+ };
1136
+ };