@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,1522 @@
1
+ import { z } from "zod";
2
+ import { type InferAdditionalFieldsFromPluginOptions } from "../../../db";
3
+ import { type InferOrganizationRolesFromOption } from "../schema";
4
+ import { type OrganizationOptions } from "../types";
5
+ export declare const createInvitation: <O extends OrganizationOptions>(option: O) => {
6
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(...inputCtx: import("better-call").HasRequiredKeys<import("better-call").InputContext<"/organization/invite-member", {
7
+ method: "POST";
8
+ use: (((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
9
+ orgOptions: OrganizationOptions;
10
+ roles: typeof import("..").defaultRoles & {
11
+ [key: string]: import("../../access").Role<{}>;
12
+ };
13
+ getSession: (context: import("packages/core/dist/index-65G5U5DB.mjs").f) => Promise<{
14
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
15
+ activeTeamId?: string | undefined;
16
+ activeOrganizationId?: string | undefined;
17
+ };
18
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
19
+ }>;
20
+ }>) | ((inputContext: import("better-call").MiddlewareInputContext<{
21
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
22
+ session: {
23
+ session: Record<string, any> & {
24
+ id: string;
25
+ createdAt: Date;
26
+ updatedAt: Date;
27
+ userId: string;
28
+ expiresAt: Date;
29
+ token: string;
30
+ ipAddress?: string | null | undefined;
31
+ userAgent?: string | null | undefined;
32
+ };
33
+ user: Record<string, any> & {
34
+ id: string;
35
+ createdAt: Date;
36
+ updatedAt: Date;
37
+ email: string;
38
+ emailVerified: boolean;
39
+ name: string;
40
+ image?: string | null | undefined;
41
+ };
42
+ };
43
+ }>)[];
44
+ }>) => Promise<{
45
+ session: {
46
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
47
+ activeTeamId?: string | undefined;
48
+ activeOrganizationId?: string | undefined;
49
+ };
50
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
51
+ };
52
+ }>))[];
53
+ body: z.ZodObject<{
54
+ email: z.ZodString;
55
+ role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
56
+ organizationId: z.ZodOptional<z.ZodString>;
57
+ resend: z.ZodOptional<z.ZodBoolean>;
58
+ teamId: z.ZodUnion<readonly [z.ZodOptional<z.ZodString>, z.ZodOptional<z.ZodArray<z.ZodString>>]>;
59
+ }, z.core.$strip>;
60
+ metadata: {
61
+ $Infer: {
62
+ body: {
63
+ /**
64
+ * The email address of the user
65
+ * to invite
66
+ */
67
+ email: string;
68
+ /**
69
+ * The role to assign to the user
70
+ */
71
+ role: InferOrganizationRolesFromOption<O> | InferOrganizationRolesFromOption<O>[];
72
+ /**
73
+ * The organization ID to invite
74
+ * the user to
75
+ */
76
+ organizationId?: string | undefined;
77
+ /**
78
+ * Resend the invitation email, if
79
+ * the user is already invited
80
+ */
81
+ resend?: boolean | undefined;
82
+ } & (O extends {
83
+ teams: {
84
+ enabled: true;
85
+ };
86
+ } ? {
87
+ /**
88
+ * The team the user is
89
+ * being invited to.
90
+ */
91
+ teamId?: (string | string[]) | undefined;
92
+ } : {}) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false>;
93
+ };
94
+ openapi: {
95
+ description: string;
96
+ responses: {
97
+ "200": {
98
+ description: string;
99
+ content: {
100
+ "application/json": {
101
+ schema: {
102
+ type: "object";
103
+ properties: {
104
+ id: {
105
+ type: string;
106
+ };
107
+ email: {
108
+ type: string;
109
+ };
110
+ role: {
111
+ type: string;
112
+ };
113
+ organizationId: {
114
+ type: string;
115
+ };
116
+ inviterId: {
117
+ type: string;
118
+ };
119
+ status: {
120
+ type: string;
121
+ };
122
+ expiresAt: {
123
+ type: string;
124
+ };
125
+ createdAt: {
126
+ type: string;
127
+ };
128
+ };
129
+ required: string[];
130
+ };
131
+ };
132
+ };
133
+ };
134
+ };
135
+ };
136
+ };
137
+ } & {
138
+ use: any[];
139
+ }>> extends true ? [import("better-call").InferBodyInput<{
140
+ method: "POST";
141
+ use: (((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
142
+ orgOptions: OrganizationOptions;
143
+ roles: typeof import("..").defaultRoles & {
144
+ [key: string]: import("../../access").Role<{}>;
145
+ };
146
+ getSession: (context: import("packages/core/dist/index-65G5U5DB.mjs").f) => Promise<{
147
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
148
+ activeTeamId?: string | undefined;
149
+ activeOrganizationId?: string | undefined;
150
+ };
151
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
152
+ }>;
153
+ }>) | ((inputContext: import("better-call").MiddlewareInputContext<{
154
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
155
+ session: {
156
+ session: Record<string, any> & {
157
+ id: string;
158
+ createdAt: Date;
159
+ updatedAt: Date;
160
+ userId: string;
161
+ expiresAt: Date;
162
+ token: string;
163
+ ipAddress?: string | null | undefined;
164
+ userAgent?: string | null | undefined;
165
+ };
166
+ user: Record<string, any> & {
167
+ id: string;
168
+ createdAt: Date;
169
+ updatedAt: Date;
170
+ email: string;
171
+ emailVerified: boolean;
172
+ name: string;
173
+ image?: string | null | undefined;
174
+ };
175
+ };
176
+ }>)[];
177
+ }>) => Promise<{
178
+ session: {
179
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
180
+ activeTeamId?: string | undefined;
181
+ activeOrganizationId?: string | undefined;
182
+ };
183
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
184
+ };
185
+ }>))[];
186
+ body: z.ZodObject<{
187
+ email: z.ZodString;
188
+ role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
189
+ organizationId: z.ZodOptional<z.ZodString>;
190
+ resend: z.ZodOptional<z.ZodBoolean>;
191
+ teamId: z.ZodUnion<readonly [z.ZodOptional<z.ZodString>, z.ZodOptional<z.ZodArray<z.ZodString>>]>;
192
+ }, z.core.$strip>;
193
+ metadata: {
194
+ $Infer: {
195
+ body: {
196
+ /**
197
+ * The email address of the user
198
+ * to invite
199
+ */
200
+ email: string;
201
+ /**
202
+ * The role to assign to the user
203
+ */
204
+ role: InferOrganizationRolesFromOption<O> | InferOrganizationRolesFromOption<O>[];
205
+ /**
206
+ * The organization ID to invite
207
+ * the user to
208
+ */
209
+ organizationId?: string | undefined;
210
+ /**
211
+ * Resend the invitation email, if
212
+ * the user is already invited
213
+ */
214
+ resend?: boolean | undefined;
215
+ } & (O extends {
216
+ teams: {
217
+ enabled: true;
218
+ };
219
+ } ? {
220
+ /**
221
+ * The team the user is
222
+ * being invited to.
223
+ */
224
+ teamId?: (string | string[]) | undefined;
225
+ } : {}) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false>;
226
+ };
227
+ openapi: {
228
+ description: string;
229
+ responses: {
230
+ "200": {
231
+ description: string;
232
+ content: {
233
+ "application/json": {
234
+ schema: {
235
+ type: "object";
236
+ properties: {
237
+ id: {
238
+ type: string;
239
+ };
240
+ email: {
241
+ type: string;
242
+ };
243
+ role: {
244
+ type: string;
245
+ };
246
+ organizationId: {
247
+ type: string;
248
+ };
249
+ inviterId: {
250
+ type: string;
251
+ };
252
+ status: {
253
+ type: string;
254
+ };
255
+ expiresAt: {
256
+ type: string;
257
+ };
258
+ createdAt: {
259
+ type: string;
260
+ };
261
+ };
262
+ required: string[];
263
+ };
264
+ };
265
+ };
266
+ };
267
+ };
268
+ };
269
+ };
270
+ } & {
271
+ use: any[];
272
+ }, {
273
+ /**
274
+ * The email address of the user
275
+ * to invite
276
+ */
277
+ email: string;
278
+ /**
279
+ * The role to assign to the user
280
+ */
281
+ role: InferOrganizationRolesFromOption<O> | InferOrganizationRolesFromOption<O>[];
282
+ /**
283
+ * The organization ID to invite
284
+ * the user to
285
+ */
286
+ organizationId?: string | undefined;
287
+ /**
288
+ * Resend the invitation email, if
289
+ * the user is already invited
290
+ */
291
+ resend?: boolean | undefined;
292
+ } & (O extends {
293
+ teams: {
294
+ enabled: true;
295
+ };
296
+ } ? {
297
+ /**
298
+ * The team the user is
299
+ * being invited to.
300
+ */
301
+ teamId?: (string | string[]) | undefined;
302
+ } : {}) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false>> & {
303
+ method?: "POST" | undefined;
304
+ } & {
305
+ query?: Record<string, any> | undefined;
306
+ } & {
307
+ params?: Record<string, any>;
308
+ } & {
309
+ request?: Request;
310
+ } & {
311
+ headers?: HeadersInit;
312
+ } & {
313
+ asResponse?: boolean;
314
+ returnHeaders?: boolean;
315
+ use?: import("better-call").Middleware[];
316
+ path?: string;
317
+ } & {
318
+ asResponse?: AsResponse | undefined;
319
+ returnHeaders?: ReturnHeaders | undefined;
320
+ }] : [((import("better-call").InferBodyInput<{
321
+ method: "POST";
322
+ use: (((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
323
+ orgOptions: OrganizationOptions;
324
+ roles: typeof import("..").defaultRoles & {
325
+ [key: string]: import("../../access").Role<{}>;
326
+ };
327
+ getSession: (context: import("packages/core/dist/index-65G5U5DB.mjs").f) => Promise<{
328
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
329
+ activeTeamId?: string | undefined;
330
+ activeOrganizationId?: string | undefined;
331
+ };
332
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
333
+ }>;
334
+ }>) | ((inputContext: import("better-call").MiddlewareInputContext<{
335
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
336
+ session: {
337
+ session: Record<string, any> & {
338
+ id: string;
339
+ createdAt: Date;
340
+ updatedAt: Date;
341
+ userId: string;
342
+ expiresAt: Date;
343
+ token: string;
344
+ ipAddress?: string | null | undefined;
345
+ userAgent?: string | null | undefined;
346
+ };
347
+ user: Record<string, any> & {
348
+ id: string;
349
+ createdAt: Date;
350
+ updatedAt: Date;
351
+ email: string;
352
+ emailVerified: boolean;
353
+ name: string;
354
+ image?: string | null | undefined;
355
+ };
356
+ };
357
+ }>)[];
358
+ }>) => Promise<{
359
+ session: {
360
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
361
+ activeTeamId?: string | undefined;
362
+ activeOrganizationId?: string | undefined;
363
+ };
364
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
365
+ };
366
+ }>))[];
367
+ body: z.ZodObject<{
368
+ email: z.ZodString;
369
+ role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
370
+ organizationId: z.ZodOptional<z.ZodString>;
371
+ resend: z.ZodOptional<z.ZodBoolean>;
372
+ teamId: z.ZodUnion<readonly [z.ZodOptional<z.ZodString>, z.ZodOptional<z.ZodArray<z.ZodString>>]>;
373
+ }, z.core.$strip>;
374
+ metadata: {
375
+ $Infer: {
376
+ body: {
377
+ /**
378
+ * The email address of the user
379
+ * to invite
380
+ */
381
+ email: string;
382
+ /**
383
+ * The role to assign to the user
384
+ */
385
+ role: InferOrganizationRolesFromOption<O> | InferOrganizationRolesFromOption<O>[];
386
+ /**
387
+ * The organization ID to invite
388
+ * the user to
389
+ */
390
+ organizationId?: string | undefined;
391
+ /**
392
+ * Resend the invitation email, if
393
+ * the user is already invited
394
+ */
395
+ resend?: boolean | undefined;
396
+ } & (O extends {
397
+ teams: {
398
+ enabled: true;
399
+ };
400
+ } ? {
401
+ /**
402
+ * The team the user is
403
+ * being invited to.
404
+ */
405
+ teamId?: (string | string[]) | undefined;
406
+ } : {}) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false>;
407
+ };
408
+ openapi: {
409
+ description: string;
410
+ responses: {
411
+ "200": {
412
+ description: string;
413
+ content: {
414
+ "application/json": {
415
+ schema: {
416
+ type: "object";
417
+ properties: {
418
+ id: {
419
+ type: string;
420
+ };
421
+ email: {
422
+ type: string;
423
+ };
424
+ role: {
425
+ type: string;
426
+ };
427
+ organizationId: {
428
+ type: string;
429
+ };
430
+ inviterId: {
431
+ type: string;
432
+ };
433
+ status: {
434
+ type: string;
435
+ };
436
+ expiresAt: {
437
+ type: string;
438
+ };
439
+ createdAt: {
440
+ type: string;
441
+ };
442
+ };
443
+ required: string[];
444
+ };
445
+ };
446
+ };
447
+ };
448
+ };
449
+ };
450
+ };
451
+ } & {
452
+ use: any[];
453
+ }, {
454
+ /**
455
+ * The email address of the user
456
+ * to invite
457
+ */
458
+ email: string;
459
+ /**
460
+ * The role to assign to the user
461
+ */
462
+ role: InferOrganizationRolesFromOption<O> | InferOrganizationRolesFromOption<O>[];
463
+ /**
464
+ * The organization ID to invite
465
+ * the user to
466
+ */
467
+ organizationId?: string | undefined;
468
+ /**
469
+ * Resend the invitation email, if
470
+ * the user is already invited
471
+ */
472
+ resend?: boolean | undefined;
473
+ } & (O extends {
474
+ teams: {
475
+ enabled: true;
476
+ };
477
+ } ? {
478
+ /**
479
+ * The team the user is
480
+ * being invited to.
481
+ */
482
+ teamId?: (string | string[]) | undefined;
483
+ } : {}) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false>> & {
484
+ method?: "POST" | undefined;
485
+ } & {
486
+ query?: Record<string, any> | undefined;
487
+ } & {
488
+ params?: Record<string, any>;
489
+ } & {
490
+ request?: Request;
491
+ } & {
492
+ headers?: HeadersInit;
493
+ } & {
494
+ asResponse?: boolean;
495
+ returnHeaders?: boolean;
496
+ use?: import("better-call").Middleware[];
497
+ path?: string;
498
+ } & {
499
+ asResponse?: AsResponse | undefined;
500
+ returnHeaders?: ReturnHeaders | undefined;
501
+ }) | undefined)?]): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
502
+ headers: Headers;
503
+ response: (O["teams"] extends {
504
+ enabled: true;
505
+ } ? {
506
+ id: string;
507
+ organizationId: string;
508
+ email: string;
509
+ role: InferOrganizationRolesFromOption<O>;
510
+ status: import("..").InvitationStatus;
511
+ inviterId: string;
512
+ expiresAt: Date;
513
+ createdAt: Date;
514
+ teamId?: string | undefined;
515
+ } : {
516
+ id: string;
517
+ organizationId: string;
518
+ email: string;
519
+ role: InferOrganizationRolesFromOption<O>;
520
+ status: import("..").InvitationStatus;
521
+ inviterId: string;
522
+ expiresAt: Date;
523
+ createdAt: Date;
524
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T ? { [K in keyof T]: T[K]; } : never;
525
+ } : (O["teams"] extends {
526
+ enabled: true;
527
+ } ? {
528
+ id: string;
529
+ organizationId: string;
530
+ email: string;
531
+ role: InferOrganizationRolesFromOption<O>;
532
+ status: import("..").InvitationStatus;
533
+ inviterId: string;
534
+ expiresAt: Date;
535
+ createdAt: Date;
536
+ teamId?: string | undefined;
537
+ } : {
538
+ id: string;
539
+ organizationId: string;
540
+ email: string;
541
+ role: InferOrganizationRolesFromOption<O>;
542
+ status: import("..").InvitationStatus;
543
+ inviterId: string;
544
+ expiresAt: Date;
545
+ createdAt: Date;
546
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never>;
547
+ options: {
548
+ method: "POST";
549
+ use: (((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
550
+ orgOptions: OrganizationOptions;
551
+ roles: typeof import("..").defaultRoles & {
552
+ [key: string]: import("../../access").Role<{}>;
553
+ };
554
+ getSession: (context: import("packages/core/dist/index-65G5U5DB.mjs").f) => Promise<{
555
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
556
+ activeTeamId?: string | undefined;
557
+ activeOrganizationId?: string | undefined;
558
+ };
559
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
560
+ }>;
561
+ }>) | ((inputContext: import("better-call").MiddlewareInputContext<{
562
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
563
+ session: {
564
+ session: Record<string, any> & {
565
+ id: string;
566
+ createdAt: Date;
567
+ updatedAt: Date;
568
+ userId: string;
569
+ expiresAt: Date;
570
+ token: string;
571
+ ipAddress?: string | null | undefined;
572
+ userAgent?: string | null | undefined;
573
+ };
574
+ user: Record<string, any> & {
575
+ id: string;
576
+ createdAt: Date;
577
+ updatedAt: Date;
578
+ email: string;
579
+ emailVerified: boolean;
580
+ name: string;
581
+ image?: string | null | undefined;
582
+ };
583
+ };
584
+ }>)[];
585
+ }>) => Promise<{
586
+ session: {
587
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
588
+ activeTeamId?: string | undefined;
589
+ activeOrganizationId?: string | undefined;
590
+ };
591
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
592
+ };
593
+ }>))[];
594
+ body: z.ZodObject<{
595
+ email: z.ZodString;
596
+ role: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
597
+ organizationId: z.ZodOptional<z.ZodString>;
598
+ resend: z.ZodOptional<z.ZodBoolean>;
599
+ teamId: z.ZodUnion<readonly [z.ZodOptional<z.ZodString>, z.ZodOptional<z.ZodArray<z.ZodString>>]>;
600
+ }, z.core.$strip>;
601
+ metadata: {
602
+ $Infer: {
603
+ body: {
604
+ /**
605
+ * The email address of the user
606
+ * to invite
607
+ */
608
+ email: string;
609
+ /**
610
+ * The role to assign to the user
611
+ */
612
+ role: InferOrganizationRolesFromOption<O> | InferOrganizationRolesFromOption<O>[];
613
+ /**
614
+ * The organization ID to invite
615
+ * the user to
616
+ */
617
+ organizationId?: string | undefined;
618
+ /**
619
+ * Resend the invitation email, if
620
+ * the user is already invited
621
+ */
622
+ resend?: boolean | undefined;
623
+ } & (O extends {
624
+ teams: {
625
+ enabled: true;
626
+ };
627
+ } ? {
628
+ /**
629
+ * The team the user is
630
+ * being invited to.
631
+ */
632
+ teamId?: (string | string[]) | undefined;
633
+ } : {}) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false>;
634
+ };
635
+ openapi: {
636
+ description: string;
637
+ responses: {
638
+ "200": {
639
+ description: string;
640
+ content: {
641
+ "application/json": {
642
+ schema: {
643
+ type: "object";
644
+ properties: {
645
+ id: {
646
+ type: string;
647
+ };
648
+ email: {
649
+ type: string;
650
+ };
651
+ role: {
652
+ type: string;
653
+ };
654
+ organizationId: {
655
+ type: string;
656
+ };
657
+ inviterId: {
658
+ type: string;
659
+ };
660
+ status: {
661
+ type: string;
662
+ };
663
+ expiresAt: {
664
+ type: string;
665
+ };
666
+ createdAt: {
667
+ type: string;
668
+ };
669
+ };
670
+ required: string[];
671
+ };
672
+ };
673
+ };
674
+ };
675
+ };
676
+ };
677
+ };
678
+ } & {
679
+ use: any[];
680
+ };
681
+ path: "/organization/invite-member";
682
+ };
683
+ export declare const acceptInvitation: <O extends OrganizationOptions>(options: O) => {
684
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
685
+ body: {
686
+ invitationId: string;
687
+ };
688
+ } & {
689
+ method?: "POST" | undefined;
690
+ } & {
691
+ query?: Record<string, any> | undefined;
692
+ } & {
693
+ params?: Record<string, any>;
694
+ } & {
695
+ request?: Request;
696
+ } & {
697
+ headers?: HeadersInit;
698
+ } & {
699
+ asResponse?: boolean;
700
+ returnHeaders?: boolean;
701
+ use?: import("better-call").Middleware[];
702
+ path?: string;
703
+ } & {
704
+ asResponse?: AsResponse | undefined;
705
+ returnHeaders?: ReturnHeaders | undefined;
706
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
707
+ headers: Headers;
708
+ response: {
709
+ invitation: (O["teams"] extends {
710
+ enabled: true;
711
+ } ? {
712
+ id: string;
713
+ organizationId: string;
714
+ email: string;
715
+ role: InferOrganizationRolesFromOption<O>;
716
+ status: import("..").InvitationStatus;
717
+ inviterId: string;
718
+ expiresAt: Date;
719
+ createdAt: Date;
720
+ teamId?: string | undefined;
721
+ } : {
722
+ id: string;
723
+ organizationId: string;
724
+ email: string;
725
+ role: InferOrganizationRolesFromOption<O>;
726
+ status: import("..").InvitationStatus;
727
+ inviterId: string;
728
+ expiresAt: Date;
729
+ createdAt: Date;
730
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T ? { [K in keyof T]: T[K]; } : never;
731
+ member: {
732
+ id: string;
733
+ organizationId: string;
734
+ userId: string;
735
+ role: string;
736
+ createdAt: Date;
737
+ } & InferAdditionalFieldsFromPluginOptions<"member", O, false>;
738
+ } | null;
739
+ } : {
740
+ invitation: (O["teams"] extends {
741
+ enabled: true;
742
+ } ? {
743
+ id: string;
744
+ organizationId: string;
745
+ email: string;
746
+ role: InferOrganizationRolesFromOption<O>;
747
+ status: import("..").InvitationStatus;
748
+ inviterId: string;
749
+ expiresAt: Date;
750
+ createdAt: Date;
751
+ teamId?: string | undefined;
752
+ } : {
753
+ id: string;
754
+ organizationId: string;
755
+ email: string;
756
+ role: InferOrganizationRolesFromOption<O>;
757
+ status: import("..").InvitationStatus;
758
+ inviterId: string;
759
+ expiresAt: Date;
760
+ createdAt: Date;
761
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never;
762
+ member: {
763
+ id: string;
764
+ organizationId: string;
765
+ userId: string;
766
+ role: string;
767
+ createdAt: Date;
768
+ } & InferAdditionalFieldsFromPluginOptions<"member", O, false>;
769
+ } | null>;
770
+ options: {
771
+ method: "POST";
772
+ body: z.ZodObject<{
773
+ invitationId: z.ZodString;
774
+ }, z.core.$strip>;
775
+ use: (((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
776
+ orgOptions: OrganizationOptions;
777
+ roles: typeof import("..").defaultRoles & {
778
+ [key: string]: import("../../access").Role<{}>;
779
+ };
780
+ getSession: (context: import("packages/core/dist/index-65G5U5DB.mjs").f) => Promise<{
781
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
782
+ activeTeamId?: string | undefined;
783
+ activeOrganizationId?: string | undefined;
784
+ };
785
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
786
+ }>;
787
+ }>) | ((inputContext: import("better-call").MiddlewareInputContext<{
788
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
789
+ session: {
790
+ session: Record<string, any> & {
791
+ id: string;
792
+ createdAt: Date;
793
+ updatedAt: Date;
794
+ userId: string;
795
+ expiresAt: Date;
796
+ token: string;
797
+ ipAddress?: string | null | undefined;
798
+ userAgent?: string | null | undefined;
799
+ };
800
+ user: Record<string, any> & {
801
+ id: string;
802
+ createdAt: Date;
803
+ updatedAt: Date;
804
+ email: string;
805
+ emailVerified: boolean;
806
+ name: string;
807
+ image?: string | null | undefined;
808
+ };
809
+ };
810
+ }>)[];
811
+ }>) => Promise<{
812
+ session: {
813
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
814
+ activeTeamId?: string | undefined;
815
+ activeOrganizationId?: string | undefined;
816
+ };
817
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
818
+ };
819
+ }>))[];
820
+ metadata: {
821
+ openapi: {
822
+ description: string;
823
+ responses: {
824
+ "200": {
825
+ description: string;
826
+ content: {
827
+ "application/json": {
828
+ schema: {
829
+ type: "object";
830
+ properties: {
831
+ invitation: {
832
+ type: string;
833
+ };
834
+ member: {
835
+ type: string;
836
+ };
837
+ };
838
+ };
839
+ };
840
+ };
841
+ };
842
+ };
843
+ };
844
+ };
845
+ } & {
846
+ use: any[];
847
+ };
848
+ path: "/organization/accept-invitation";
849
+ };
850
+ export declare const rejectInvitation: <O extends OrganizationOptions>(options: O) => {
851
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
852
+ body: {
853
+ invitationId: string;
854
+ };
855
+ } & {
856
+ method?: "POST" | undefined;
857
+ } & {
858
+ query?: Record<string, any> | undefined;
859
+ } & {
860
+ params?: Record<string, any>;
861
+ } & {
862
+ request?: Request;
863
+ } & {
864
+ headers?: HeadersInit;
865
+ } & {
866
+ asResponse?: boolean;
867
+ returnHeaders?: boolean;
868
+ use?: import("better-call").Middleware[];
869
+ path?: string;
870
+ } & {
871
+ asResponse?: AsResponse | undefined;
872
+ returnHeaders?: ReturnHeaders | undefined;
873
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
874
+ headers: Headers;
875
+ response: {
876
+ invitation: {
877
+ id: string;
878
+ organizationId: string;
879
+ email: string;
880
+ role: "member" | "admin" | "owner";
881
+ status: import("..").InvitationStatus;
882
+ inviterId: string;
883
+ expiresAt: Date;
884
+ createdAt: Date;
885
+ } | null;
886
+ member: null;
887
+ };
888
+ } : {
889
+ invitation: {
890
+ id: string;
891
+ organizationId: string;
892
+ email: string;
893
+ role: "member" | "admin" | "owner";
894
+ status: import("..").InvitationStatus;
895
+ inviterId: string;
896
+ expiresAt: Date;
897
+ createdAt: Date;
898
+ } | null;
899
+ member: null;
900
+ }>;
901
+ options: {
902
+ method: "POST";
903
+ body: z.ZodObject<{
904
+ invitationId: z.ZodString;
905
+ }, z.core.$strip>;
906
+ use: (((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
907
+ orgOptions: OrganizationOptions;
908
+ roles: typeof import("..").defaultRoles & {
909
+ [key: string]: import("../../access").Role<{}>;
910
+ };
911
+ getSession: (context: import("packages/core/dist/index-65G5U5DB.mjs").f) => Promise<{
912
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
913
+ activeTeamId?: string | undefined;
914
+ activeOrganizationId?: string | undefined;
915
+ };
916
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
917
+ }>;
918
+ }>) | ((inputContext: import("better-call").MiddlewareInputContext<{
919
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
920
+ session: {
921
+ session: Record<string, any> & {
922
+ id: string;
923
+ createdAt: Date;
924
+ updatedAt: Date;
925
+ userId: string;
926
+ expiresAt: Date;
927
+ token: string;
928
+ ipAddress?: string | null | undefined;
929
+ userAgent?: string | null | undefined;
930
+ };
931
+ user: Record<string, any> & {
932
+ id: string;
933
+ createdAt: Date;
934
+ updatedAt: Date;
935
+ email: string;
936
+ emailVerified: boolean;
937
+ name: string;
938
+ image?: string | null | undefined;
939
+ };
940
+ };
941
+ }>)[];
942
+ }>) => Promise<{
943
+ session: {
944
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
945
+ activeTeamId?: string | undefined;
946
+ activeOrganizationId?: string | undefined;
947
+ };
948
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
949
+ };
950
+ }>))[];
951
+ metadata: {
952
+ openapi: {
953
+ description: string;
954
+ responses: {
955
+ "200": {
956
+ description: string;
957
+ content: {
958
+ "application/json": {
959
+ schema: {
960
+ type: "object";
961
+ properties: {
962
+ invitation: {
963
+ type: string;
964
+ };
965
+ member: {
966
+ type: string;
967
+ };
968
+ };
969
+ };
970
+ };
971
+ };
972
+ };
973
+ };
974
+ };
975
+ };
976
+ } & {
977
+ use: any[];
978
+ };
979
+ path: "/organization/reject-invitation";
980
+ };
981
+ export declare const cancelInvitation: <O extends OrganizationOptions>(options: O) => {
982
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
983
+ body: {
984
+ invitationId: string;
985
+ };
986
+ } & {
987
+ method?: "POST" | undefined;
988
+ } & {
989
+ query?: Record<string, any> | undefined;
990
+ } & {
991
+ params?: Record<string, any>;
992
+ } & {
993
+ request?: Request;
994
+ } & {
995
+ headers?: HeadersInit;
996
+ } & {
997
+ asResponse?: boolean;
998
+ returnHeaders?: boolean;
999
+ use?: import("better-call").Middleware[];
1000
+ path?: string;
1001
+ } & {
1002
+ asResponse?: AsResponse | undefined;
1003
+ returnHeaders?: ReturnHeaders | undefined;
1004
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1005
+ headers: Headers;
1006
+ response: ((O["teams"] extends {
1007
+ enabled: true;
1008
+ } ? {
1009
+ id: string;
1010
+ organizationId: string;
1011
+ email: string;
1012
+ role: InferOrganizationRolesFromOption<O>;
1013
+ status: import("..").InvitationStatus;
1014
+ inviterId: string;
1015
+ expiresAt: Date;
1016
+ createdAt: Date;
1017
+ teamId?: string | undefined;
1018
+ } : {
1019
+ id: string;
1020
+ organizationId: string;
1021
+ email: string;
1022
+ role: InferOrganizationRolesFromOption<O>;
1023
+ status: import("..").InvitationStatus;
1024
+ inviterId: string;
1025
+ expiresAt: Date;
1026
+ createdAt: Date;
1027
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T ? { [K in keyof T]: T[K]; } : never) | null;
1028
+ } : ((O["teams"] extends {
1029
+ enabled: true;
1030
+ } ? {
1031
+ id: string;
1032
+ organizationId: string;
1033
+ email: string;
1034
+ role: InferOrganizationRolesFromOption<O>;
1035
+ status: import("..").InvitationStatus;
1036
+ inviterId: string;
1037
+ expiresAt: Date;
1038
+ createdAt: Date;
1039
+ teamId?: string | undefined;
1040
+ } : {
1041
+ id: string;
1042
+ organizationId: string;
1043
+ email: string;
1044
+ role: InferOrganizationRolesFromOption<O>;
1045
+ status: import("..").InvitationStatus;
1046
+ inviterId: string;
1047
+ expiresAt: Date;
1048
+ createdAt: Date;
1049
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never) | null>;
1050
+ options: {
1051
+ method: "POST";
1052
+ body: z.ZodObject<{
1053
+ invitationId: z.ZodString;
1054
+ }, z.core.$strip>;
1055
+ use: (((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1056
+ orgOptions: OrganizationOptions;
1057
+ roles: typeof import("..").defaultRoles & {
1058
+ [key: string]: import("../../access").Role<{}>;
1059
+ };
1060
+ getSession: (context: import("packages/core/dist/index-65G5U5DB.mjs").f) => Promise<{
1061
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
1062
+ activeTeamId?: string | undefined;
1063
+ activeOrganizationId?: string | undefined;
1064
+ };
1065
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
1066
+ }>;
1067
+ }>) | ((inputContext: import("better-call").MiddlewareInputContext<{
1068
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1069
+ session: {
1070
+ session: Record<string, any> & {
1071
+ id: string;
1072
+ createdAt: Date;
1073
+ updatedAt: Date;
1074
+ userId: string;
1075
+ expiresAt: Date;
1076
+ token: string;
1077
+ ipAddress?: string | null | undefined;
1078
+ userAgent?: string | null | undefined;
1079
+ };
1080
+ user: Record<string, any> & {
1081
+ id: string;
1082
+ createdAt: Date;
1083
+ updatedAt: Date;
1084
+ email: string;
1085
+ emailVerified: boolean;
1086
+ name: string;
1087
+ image?: string | null | undefined;
1088
+ };
1089
+ };
1090
+ }>)[];
1091
+ }>) => Promise<{
1092
+ session: {
1093
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
1094
+ activeTeamId?: string | undefined;
1095
+ activeOrganizationId?: string | undefined;
1096
+ };
1097
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
1098
+ };
1099
+ }>))[];
1100
+ openapi: {
1101
+ description: string;
1102
+ responses: {
1103
+ "200": {
1104
+ description: string;
1105
+ content: {
1106
+ "application/json": {
1107
+ schema: {
1108
+ type: string;
1109
+ properties: {
1110
+ invitation: {
1111
+ type: string;
1112
+ };
1113
+ };
1114
+ };
1115
+ };
1116
+ };
1117
+ };
1118
+ };
1119
+ };
1120
+ } & {
1121
+ use: any[];
1122
+ };
1123
+ path: "/organization/cancel-invitation";
1124
+ };
1125
+ export declare const getInvitation: <O extends OrganizationOptions>(options: O) => {
1126
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
1127
+ body?: undefined;
1128
+ } & {
1129
+ method?: "GET" | undefined;
1130
+ } & {
1131
+ query: {
1132
+ id: string;
1133
+ };
1134
+ } & {
1135
+ params?: Record<string, any>;
1136
+ } & {
1137
+ request?: Request;
1138
+ } & {
1139
+ headers: HeadersInit;
1140
+ } & {
1141
+ asResponse?: boolean;
1142
+ returnHeaders?: boolean;
1143
+ use?: import("better-call").Middleware[];
1144
+ path?: string;
1145
+ } & {
1146
+ asResponse?: AsResponse | undefined;
1147
+ returnHeaders?: ReturnHeaders | undefined;
1148
+ }): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1149
+ headers: Headers;
1150
+ response: ((O["teams"] extends {
1151
+ enabled: true;
1152
+ } ? {
1153
+ id: string;
1154
+ organizationId: string;
1155
+ email: string;
1156
+ role: InferOrganizationRolesFromOption<O>;
1157
+ status: import("..").InvitationStatus;
1158
+ inviterId: string;
1159
+ expiresAt: Date;
1160
+ createdAt: Date;
1161
+ teamId?: string | undefined;
1162
+ } : {
1163
+ id: string;
1164
+ organizationId: string;
1165
+ email: string;
1166
+ role: InferOrganizationRolesFromOption<O>;
1167
+ status: import("..").InvitationStatus;
1168
+ inviterId: string;
1169
+ expiresAt: Date;
1170
+ createdAt: Date;
1171
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T ? { [K in keyof T]: T[K]; } : never) & {
1172
+ organizationName: ({
1173
+ id: string;
1174
+ name: string;
1175
+ slug: string;
1176
+ createdAt: Date;
1177
+ logo?: string | null | undefined;
1178
+ metadata?: any;
1179
+ } & InferAdditionalFieldsFromPluginOptions<"organization", O, false>)["name"];
1180
+ organizationSlug: ({
1181
+ id: string;
1182
+ name: string;
1183
+ slug: string;
1184
+ createdAt: Date;
1185
+ logo?: string | null | undefined;
1186
+ metadata?: any;
1187
+ } & InferAdditionalFieldsFromPluginOptions<"organization", O, false>)["slug"];
1188
+ inviterEmail: string;
1189
+ };
1190
+ } : ((O["teams"] extends {
1191
+ enabled: true;
1192
+ } ? {
1193
+ id: string;
1194
+ organizationId: string;
1195
+ email: string;
1196
+ role: InferOrganizationRolesFromOption<O>;
1197
+ status: import("..").InvitationStatus;
1198
+ inviterId: string;
1199
+ expiresAt: Date;
1200
+ createdAt: Date;
1201
+ teamId?: string | undefined;
1202
+ } : {
1203
+ id: string;
1204
+ organizationId: string;
1205
+ email: string;
1206
+ role: InferOrganizationRolesFromOption<O>;
1207
+ status: import("..").InvitationStatus;
1208
+ inviterId: string;
1209
+ expiresAt: Date;
1210
+ createdAt: Date;
1211
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never) & {
1212
+ organizationName: ({
1213
+ id: string;
1214
+ name: string;
1215
+ slug: string;
1216
+ createdAt: Date;
1217
+ logo?: string | null | undefined;
1218
+ metadata?: any;
1219
+ } & InferAdditionalFieldsFromPluginOptions<"organization", O, false>)["name"];
1220
+ organizationSlug: ({
1221
+ id: string;
1222
+ name: string;
1223
+ slug: string;
1224
+ createdAt: Date;
1225
+ logo?: string | null | undefined;
1226
+ metadata?: any;
1227
+ } & InferAdditionalFieldsFromPluginOptions<"organization", O, false>)["slug"];
1228
+ inviterEmail: string;
1229
+ }>;
1230
+ options: {
1231
+ method: "GET";
1232
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1233
+ orgOptions: OrganizationOptions;
1234
+ roles: typeof import("..").defaultRoles & {
1235
+ [key: string]: import("../../access").Role<{}>;
1236
+ };
1237
+ getSession: (context: import("packages/core/dist/index-65G5U5DB.mjs").f) => Promise<{
1238
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
1239
+ activeTeamId?: string | undefined;
1240
+ activeOrganizationId?: string | undefined;
1241
+ };
1242
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
1243
+ }>;
1244
+ }>)[];
1245
+ requireHeaders: true;
1246
+ query: z.ZodObject<{
1247
+ id: z.ZodString;
1248
+ }, z.core.$strip>;
1249
+ metadata: {
1250
+ openapi: {
1251
+ description: string;
1252
+ responses: {
1253
+ "200": {
1254
+ description: string;
1255
+ content: {
1256
+ "application/json": {
1257
+ schema: {
1258
+ type: "object";
1259
+ properties: {
1260
+ id: {
1261
+ type: string;
1262
+ };
1263
+ email: {
1264
+ type: string;
1265
+ };
1266
+ role: {
1267
+ type: string;
1268
+ };
1269
+ organizationId: {
1270
+ type: string;
1271
+ };
1272
+ inviterId: {
1273
+ type: string;
1274
+ };
1275
+ status: {
1276
+ type: string;
1277
+ };
1278
+ expiresAt: {
1279
+ type: string;
1280
+ };
1281
+ organizationName: {
1282
+ type: string;
1283
+ };
1284
+ organizationSlug: {
1285
+ type: string;
1286
+ };
1287
+ inviterEmail: {
1288
+ type: string;
1289
+ };
1290
+ };
1291
+ required: string[];
1292
+ };
1293
+ };
1294
+ };
1295
+ };
1296
+ };
1297
+ };
1298
+ };
1299
+ } & {
1300
+ use: any[];
1301
+ };
1302
+ path: "/organization/get-invitation";
1303
+ };
1304
+ export declare const listInvitations: <O extends OrganizationOptions>(options: O) => {
1305
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
1306
+ body?: undefined;
1307
+ } & {
1308
+ method?: "GET" | undefined;
1309
+ } & {
1310
+ query?: {
1311
+ organizationId?: string | undefined;
1312
+ } | undefined;
1313
+ } & {
1314
+ params?: Record<string, any>;
1315
+ } & {
1316
+ request?: Request;
1317
+ } & {
1318
+ headers?: HeadersInit;
1319
+ } & {
1320
+ asResponse?: boolean;
1321
+ returnHeaders?: boolean;
1322
+ use?: import("better-call").Middleware[];
1323
+ path?: string;
1324
+ } & {
1325
+ asResponse?: AsResponse | undefined;
1326
+ returnHeaders?: ReturnHeaders | undefined;
1327
+ }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1328
+ headers: Headers;
1329
+ response: ((O["teams"] extends {
1330
+ enabled: true;
1331
+ } ? {
1332
+ id: string;
1333
+ organizationId: string;
1334
+ email: string;
1335
+ role: InferOrganizationRolesFromOption<O>;
1336
+ status: import("..").InvitationStatus;
1337
+ inviterId: string;
1338
+ expiresAt: Date;
1339
+ createdAt: Date;
1340
+ teamId?: string | undefined;
1341
+ } : {
1342
+ id: string;
1343
+ organizationId: string;
1344
+ email: string;
1345
+ role: InferOrganizationRolesFromOption<O>;
1346
+ status: import("..").InvitationStatus;
1347
+ inviterId: string;
1348
+ expiresAt: Date;
1349
+ createdAt: Date;
1350
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T ? { [K in keyof T]: T[K]; } : never)[];
1351
+ } : ((O["teams"] extends {
1352
+ enabled: true;
1353
+ } ? {
1354
+ id: string;
1355
+ organizationId: string;
1356
+ email: string;
1357
+ role: InferOrganizationRolesFromOption<O>;
1358
+ status: import("..").InvitationStatus;
1359
+ inviterId: string;
1360
+ expiresAt: Date;
1361
+ createdAt: Date;
1362
+ teamId?: string | undefined;
1363
+ } : {
1364
+ id: string;
1365
+ organizationId: string;
1366
+ email: string;
1367
+ role: InferOrganizationRolesFromOption<O>;
1368
+ status: import("..").InvitationStatus;
1369
+ inviterId: string;
1370
+ expiresAt: Date;
1371
+ createdAt: Date;
1372
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never)[]>;
1373
+ options: {
1374
+ method: "GET";
1375
+ use: (((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1376
+ orgOptions: OrganizationOptions;
1377
+ roles: typeof import("..").defaultRoles & {
1378
+ [key: string]: import("../../access").Role<{}>;
1379
+ };
1380
+ getSession: (context: import("packages/core/dist/index-65G5U5DB.mjs").f) => Promise<{
1381
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
1382
+ activeTeamId?: string | undefined;
1383
+ activeOrganizationId?: string | undefined;
1384
+ };
1385
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
1386
+ }>;
1387
+ }>) | ((inputContext: import("better-call").MiddlewareInputContext<{
1388
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1389
+ session: {
1390
+ session: Record<string, any> & {
1391
+ id: string;
1392
+ createdAt: Date;
1393
+ updatedAt: Date;
1394
+ userId: string;
1395
+ expiresAt: Date;
1396
+ token: string;
1397
+ ipAddress?: string | null | undefined;
1398
+ userAgent?: string | null | undefined;
1399
+ };
1400
+ user: Record<string, any> & {
1401
+ id: string;
1402
+ createdAt: Date;
1403
+ updatedAt: Date;
1404
+ email: string;
1405
+ emailVerified: boolean;
1406
+ name: string;
1407
+ image?: string | null | undefined;
1408
+ };
1409
+ };
1410
+ }>)[];
1411
+ }>) => Promise<{
1412
+ session: {
1413
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
1414
+ activeTeamId?: string | undefined;
1415
+ activeOrganizationId?: string | undefined;
1416
+ };
1417
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
1418
+ };
1419
+ }>))[];
1420
+ query: z.ZodOptional<z.ZodObject<{
1421
+ organizationId: z.ZodOptional<z.ZodString>;
1422
+ }, z.core.$strip>>;
1423
+ } & {
1424
+ use: any[];
1425
+ };
1426
+ path: "/organization/list-invitations";
1427
+ };
1428
+ /**
1429
+ * List all invitations a user has received
1430
+ */
1431
+ export declare const listUserInvitations: <O extends OrganizationOptions>(options: O) => {
1432
+ <AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
1433
+ body?: undefined;
1434
+ } & {
1435
+ method?: "GET" | undefined;
1436
+ } & {
1437
+ query?: {
1438
+ email?: string | undefined;
1439
+ } | undefined;
1440
+ } & {
1441
+ params?: Record<string, any>;
1442
+ } & {
1443
+ request?: Request;
1444
+ } & {
1445
+ headers?: HeadersInit;
1446
+ } & {
1447
+ asResponse?: boolean;
1448
+ returnHeaders?: boolean;
1449
+ use?: import("better-call").Middleware[];
1450
+ path?: string;
1451
+ } & {
1452
+ asResponse?: AsResponse | undefined;
1453
+ returnHeaders?: ReturnHeaders | undefined;
1454
+ }) | undefined): Promise<[AsResponse] extends [true] ? Response : [ReturnHeaders] extends [true] ? {
1455
+ headers: Headers;
1456
+ response: ((O["teams"] extends {
1457
+ enabled: true;
1458
+ } ? {
1459
+ id: string;
1460
+ organizationId: string;
1461
+ email: string;
1462
+ role: InferOrganizationRolesFromOption<O>;
1463
+ status: import("..").InvitationStatus;
1464
+ inviterId: string;
1465
+ expiresAt: Date;
1466
+ createdAt: Date;
1467
+ teamId?: string | undefined;
1468
+ } : {
1469
+ id: string;
1470
+ organizationId: string;
1471
+ email: string;
1472
+ role: InferOrganizationRolesFromOption<O>;
1473
+ status: import("..").InvitationStatus;
1474
+ inviterId: string;
1475
+ expiresAt: Date;
1476
+ createdAt: Date;
1477
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T ? { [K in keyof T]: T[K]; } : never)[];
1478
+ } : ((O["teams"] extends {
1479
+ enabled: true;
1480
+ } ? {
1481
+ id: string;
1482
+ organizationId: string;
1483
+ email: string;
1484
+ role: InferOrganizationRolesFromOption<O>;
1485
+ status: import("..").InvitationStatus;
1486
+ inviterId: string;
1487
+ expiresAt: Date;
1488
+ createdAt: Date;
1489
+ teamId?: string | undefined;
1490
+ } : {
1491
+ id: string;
1492
+ organizationId: string;
1493
+ email: string;
1494
+ role: InferOrganizationRolesFromOption<O>;
1495
+ status: import("..").InvitationStatus;
1496
+ inviterId: string;
1497
+ expiresAt: Date;
1498
+ createdAt: Date;
1499
+ }) & InferAdditionalFieldsFromPluginOptions<"invitation", O, false> extends infer T_1 ? { [K in keyof T_1]: T_1[K]; } : never)[]>;
1500
+ options: {
1501
+ method: "GET";
1502
+ use: ((inputContext: import("better-call").MiddlewareInputContext<import("better-call").MiddlewareOptions>) => Promise<{
1503
+ orgOptions: OrganizationOptions;
1504
+ roles: typeof import("..").defaultRoles & {
1505
+ [key: string]: import("../../access").Role<{}>;
1506
+ };
1507
+ getSession: (context: import("packages/core/dist/index-65G5U5DB.mjs").f) => Promise<{
1508
+ session: import("packages/core/dist/index-65G5U5DB.mjs").bt & {
1509
+ activeTeamId?: string | undefined;
1510
+ activeOrganizationId?: string | undefined;
1511
+ };
1512
+ user: import("packages/core/dist/index-65G5U5DB.mjs")._t;
1513
+ }>;
1514
+ }>)[];
1515
+ query: z.ZodOptional<z.ZodObject<{
1516
+ email: z.ZodOptional<z.ZodString>;
1517
+ }, z.core.$strip>>;
1518
+ } & {
1519
+ use: any[];
1520
+ };
1521
+ path: "/organization/list-user-invitations";
1522
+ };