@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,949 @@
1
+ import { a as LiteralNumber, c as OmitId, d as PrettifyDeep, f as Primitive, g as WithoutEmpty, h as UnionToIntersection, i as HasRequiredKeys, l as PreserveJSDoc, m as StripEmptyObjects, n as DeepPartial, o as LiteralString, p as RequiredKeysOf, r as Expand, s as LiteralUnion, t as Awaitable, u as Prettify } from "../../helper-tmxW3BHj.mjs";
2
+ import { K as SessionQueryParams, Y as Auth, g as User$1, h as Session$1, i as PayvoAuthPlugin$1, mn as InferAdditionalFieldsFromPluginOptions, r as PayvoAuthOptions$1 } from "../../index-Cxi7TbLE.mjs";
3
+ import "../../types-B1OL7hyf.mjs";
4
+ import "../../index-65G5U5DB-DSdjzreF.mjs";
5
+ import "../../plugins-hFZT3hmK.mjs";
6
+ import { a as Role, i as AccessControl, o as Statements } from "../../index-C7fQuk-V.mjs";
7
+ import { t as admin } from "../../admin-DtfO1PLg.mjs";
8
+ import { r as anonymous } from "../../index-B3n8e37d.mjs";
9
+ import { r as apiKey } from "../../index-CM-CFWwr.mjs";
10
+ import { t as deviceAuthorizationClient } from "../../client-CNY0tn9g.mjs";
11
+ import { n as emailOTP } from "../../index-D_k662QG.mjs";
12
+ import { n as genericOAuth } from "../../index-Buhn3hkR.mjs";
13
+ import { t as jwt } from "../../index-34ONrP8l.mjs";
14
+ import { t as magicLink } from "../../index-BYMI9r_d.mjs";
15
+ import { t as multiSession } from "../../index-DoXZYQpq.mjs";
16
+ import { t as oneTimeToken } from "../../index-C-u1h_WX.mjs";
17
+ import "../../index-z0KSvE5i.mjs";
18
+ import { F as OrganizationOptions, S as Team, b as OrganizationRole, c as InferMember, f as InferTeam, g as Member, l as InferOrganization, p as Invitation, r as OrganizationPlugin, s as InferInvitation, v as Organization, w as TeamMember } from "../../index-BHoQlf7a.mjs";
19
+ import { r as phoneNumber } from "../../index-DKNNV1kb.mjs";
20
+ import { t as twoFactorClient } from "../../client-BOX93C3d.mjs";
21
+ import { n as Passkey, t as passkey } from "../../index-DlaMq1nb.mjs";
22
+ import { n as username } from "../../index-CuFzhoS6.mjs";
23
+ import * as _gatwech_core33 from "@gatwech/core";
24
+ import { ClientStore, PayvoAuthOptions } from "@gatwech/core";
25
+ import { DBFieldAttribute } from "@gatwech/core/db";
26
+ import * as _better_fetch_fetch34 from "@better-fetch/fetch";
27
+ import { BetterFetch, BetterFetchOption } from "@better-fetch/fetch";
28
+ import * as nanostores1 from "nanostores";
29
+ import { atom } from "nanostores";
30
+
31
+ //#region src/plugins/additional-fields/client.d.ts
32
+ declare const inferAdditionalFields: <T$1, S$1 extends {
33
+ user?: {
34
+ [key: string]: DBFieldAttribute;
35
+ } | undefined;
36
+ session?: {
37
+ [key: string]: DBFieldAttribute;
38
+ } | undefined;
39
+ } = {}>(schema?: S$1 | undefined) => {
40
+ id: "additional-fields-client";
41
+ $InferServerPlugin: ((T$1 extends PayvoAuthOptions$1 ? T$1 : T$1 extends {
42
+ options: PayvoAuthOptions$1;
43
+ } ? T$1["options"] : never) extends never ? S$1 extends {
44
+ user?: {
45
+ [key: string]: DBFieldAttribute;
46
+ } | undefined;
47
+ session?: {
48
+ [key: string]: DBFieldAttribute;
49
+ } | undefined;
50
+ } ? {
51
+ id: "additional-fields-client";
52
+ schema: {
53
+ user: {
54
+ fields: S$1["user"] extends object ? S$1["user"] : {};
55
+ };
56
+ session: {
57
+ fields: S$1["session"] extends object ? S$1["session"] : {};
58
+ };
59
+ };
60
+ } : never : (T$1 extends PayvoAuthOptions$1 ? T$1 : T$1 extends {
61
+ options: PayvoAuthOptions$1;
62
+ } ? T$1["options"] : never) extends PayvoAuthOptions$1 ? {
63
+ id: "additional-fields";
64
+ schema: {
65
+ user: {
66
+ fields: (T$1 extends PayvoAuthOptions$1 ? T$1 : T$1 extends {
67
+ options: PayvoAuthOptions$1;
68
+ } ? T$1["options"] : never)["user"] extends {
69
+ additionalFields: infer U;
70
+ } ? U : {};
71
+ };
72
+ session: {
73
+ fields: (T$1 extends PayvoAuthOptions$1 ? T$1 : T$1 extends {
74
+ options: PayvoAuthOptions$1;
75
+ } ? T$1["options"] : never)["session"] extends {
76
+ additionalFields: infer U;
77
+ } ? U : {};
78
+ };
79
+ };
80
+ } : never) extends PayvoAuthPlugin$1 ? (T$1 extends PayvoAuthOptions$1 ? T$1 : T$1 extends {
81
+ options: PayvoAuthOptions$1;
82
+ } ? T$1["options"] : never) extends never ? S$1 extends {
83
+ user?: {
84
+ [key: string]: DBFieldAttribute;
85
+ } | undefined;
86
+ session?: {
87
+ [key: string]: DBFieldAttribute;
88
+ } | undefined;
89
+ } ? {
90
+ id: "additional-fields-client";
91
+ schema: {
92
+ user: {
93
+ fields: S$1["user"] extends object ? S$1["user"] : {};
94
+ };
95
+ session: {
96
+ fields: S$1["session"] extends object ? S$1["session"] : {};
97
+ };
98
+ };
99
+ } : never : (T$1 extends PayvoAuthOptions$1 ? T$1 : T$1 extends {
100
+ options: PayvoAuthOptions$1;
101
+ } ? T$1["options"] : never) extends PayvoAuthOptions$1 ? {
102
+ id: "additional-fields";
103
+ schema: {
104
+ user: {
105
+ fields: (T$1 extends PayvoAuthOptions$1 ? T$1 : T$1 extends {
106
+ options: PayvoAuthOptions$1;
107
+ } ? T$1["options"] : never)["user"] extends {
108
+ additionalFields: infer U;
109
+ } ? U : {};
110
+ };
111
+ session: {
112
+ fields: (T$1 extends PayvoAuthOptions$1 ? T$1 : T$1 extends {
113
+ options: PayvoAuthOptions$1;
114
+ } ? T$1["options"] : never)["session"] extends {
115
+ additionalFields: infer U;
116
+ } ? U : {};
117
+ };
118
+ };
119
+ } : never : undefined;
120
+ };
121
+ //#endregion
122
+ //#region src/plugins/admin/client.d.ts
123
+ interface AdminClientOptions {
124
+ ac?: AccessControl | undefined;
125
+ roles?: { [key in string]: Role } | undefined;
126
+ }
127
+ declare const adminClient: <O$1 extends AdminClientOptions>(options?: O$1 | undefined) => {
128
+ id: "admin-client";
129
+ $InferServerPlugin: ReturnType<typeof admin<{
130
+ ac: O$1["ac"] extends AccessControl ? O$1["ac"] : AccessControl<{
131
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
132
+ readonly session: readonly ["list", "revoke", "delete"];
133
+ }>;
134
+ roles: O$1["roles"] extends Record<string, Role> ? O$1["roles"] : {
135
+ admin: Role;
136
+ user: Role;
137
+ };
138
+ }>>;
139
+ getActions: () => {
140
+ admin: {
141
+ checkRolePermission: <R extends (O$1 extends {
142
+ roles: any;
143
+ } ? keyof O$1["roles"] : "admin" | "user")>(data: ({
144
+ /**
145
+ * @deprecated Use `permissions` instead
146
+ */
147
+ permission: { [key in keyof (O$1["ac"] extends AccessControl<infer S extends Statements> ? S : {
148
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
149
+ readonly session: readonly ["list", "revoke", "delete"];
150
+ })]?: ((O$1["ac"] extends AccessControl<infer S extends Statements> ? S : {
151
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
152
+ readonly session: readonly ["list", "revoke", "delete"];
153
+ })[key] extends readonly unknown[] ? (O$1["ac"] extends AccessControl<infer S extends Statements> ? S : {
154
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
155
+ readonly session: readonly ["list", "revoke", "delete"];
156
+ })[key][number] : never)[] | undefined };
157
+ permissions?: never | undefined;
158
+ } | {
159
+ permissions: { [key in keyof (O$1["ac"] extends AccessControl<infer S extends Statements> ? S : {
160
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
161
+ readonly session: readonly ["list", "revoke", "delete"];
162
+ })]?: ((O$1["ac"] extends AccessControl<infer S extends Statements> ? S : {
163
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
164
+ readonly session: readonly ["list", "revoke", "delete"];
165
+ })[key] extends readonly unknown[] ? (O$1["ac"] extends AccessControl<infer S extends Statements> ? S : {
166
+ readonly user: readonly ["create", "list", "set-role", "ban", "impersonate", "delete", "set-password", "get", "update"];
167
+ readonly session: readonly ["list", "revoke", "delete"];
168
+ })[key][number] : never)[] | undefined };
169
+ permission?: never | undefined;
170
+ }) & {
171
+ role: R;
172
+ }) => boolean;
173
+ };
174
+ };
175
+ pathMethods: {
176
+ "/admin/list-users": "GET";
177
+ "/admin/stop-impersonating": "POST";
178
+ };
179
+ };
180
+ //#endregion
181
+ //#region src/plugins/anonymous/client.d.ts
182
+ declare const anonymousClient: () => {
183
+ id: "anonymous";
184
+ $InferServerPlugin: ReturnType<typeof anonymous>;
185
+ pathMethods: {
186
+ "/sign-in/anonymous": "POST";
187
+ };
188
+ };
189
+ //#endregion
190
+ //#region src/plugins/api-key/client.d.ts
191
+ declare const apiKeyClient: () => {
192
+ id: "api-key";
193
+ $InferServerPlugin: ReturnType<typeof apiKey>;
194
+ pathMethods: {
195
+ "/api-key/create": "POST";
196
+ "/api-key/delete": "POST";
197
+ "/api-key/delete-all-expired-api-keys": "POST";
198
+ };
199
+ };
200
+ type ApiKeyClientPlugin = ReturnType<typeof apiKeyClient>;
201
+ //#endregion
202
+ //#region src/plugins/custom-session/client.d.ts
203
+ declare const customSessionClient: <A extends Auth | {
204
+ options: PayvoAuthOptions$1;
205
+ }>() => {
206
+ id: "infer-server-plugin";
207
+ $InferServerPlugin: (A extends {
208
+ options: infer O;
209
+ } ? O : A)["plugins"] extends (infer P)[] ? P extends {
210
+ id: "custom-session";
211
+ } ? P : never : never;
212
+ };
213
+ //#endregion
214
+ //#region src/plugins/email-otp/client.d.ts
215
+ declare const emailOTPClient: () => {
216
+ id: "email-otp";
217
+ $InferServerPlugin: ReturnType<typeof emailOTP>;
218
+ atomListeners: {
219
+ matcher: (path: string) => path is "/email-otp/verify-email";
220
+ signal: "$sessionSignal";
221
+ }[];
222
+ };
223
+ //#endregion
224
+ //#region src/plugins/generic-oauth/client.d.ts
225
+ declare const genericOAuthClient: () => {
226
+ id: "generic-oauth-client";
227
+ $InferServerPlugin: ReturnType<typeof genericOAuth>;
228
+ };
229
+ //#endregion
230
+ //#region src/plugins/jwt/client.d.ts
231
+ declare const jwtClient: () => {
232
+ id: "payvo-auth-client";
233
+ $InferServerPlugin: ReturnType<typeof jwt>;
234
+ };
235
+ //#endregion
236
+ //#region src/plugins/last-login-method/client.d.ts
237
+ /**
238
+ * Configuration for the client-side last login method plugin
239
+ */
240
+ interface LastLoginMethodClientConfig {
241
+ /**
242
+ * Name of the cookie to read the last login method from
243
+ * @default "payvo-auth.last_used_login_method"
244
+ */
245
+ cookieName?: string | undefined;
246
+ }
247
+ /**
248
+ * Client-side plugin to retrieve the last used login method
249
+ */
250
+ declare const lastLoginMethodClient: (config?: LastLoginMethodClientConfig) => {
251
+ id: "last-login-method-client";
252
+ getActions(): {
253
+ /**
254
+ * Get the last used login method from cookies
255
+ * @returns The last used login method or null if not found
256
+ */
257
+ getLastUsedLoginMethod: () => string | null;
258
+ /**
259
+ * Clear the last used login method cookie
260
+ * This sets the cookie with an expiration date in the past
261
+ */
262
+ clearLastUsedLoginMethod: () => void;
263
+ /**
264
+ * Check if a specific login method was the last used
265
+ * @param method The method to check
266
+ * @returns True if the method was the last used, false otherwise
267
+ */
268
+ isLastUsedLoginMethod: (method: string) => boolean;
269
+ };
270
+ };
271
+ //#endregion
272
+ //#region src/plugins/magic-link/client.d.ts
273
+ declare const magicLinkClient: () => {
274
+ id: "magic-link";
275
+ $InferServerPlugin: ReturnType<typeof magicLink>;
276
+ };
277
+ //#endregion
278
+ //#region src/plugins/multi-session/client.d.ts
279
+ declare const multiSessionClient: () => {
280
+ id: "multi-session";
281
+ $InferServerPlugin: ReturnType<typeof multiSession>;
282
+ atomListeners: {
283
+ matcher(path: string): path is "/multi-session/set-active";
284
+ signal: "$sessionSignal";
285
+ }[];
286
+ };
287
+ //#endregion
288
+ //#region src/plugins/one-tap/client.d.ts
289
+ declare global {
290
+ interface Window {
291
+ google?: {
292
+ accounts: {
293
+ id: {
294
+ initialize: (config: any) => void;
295
+ prompt: (callback?: (notification: any) => void) => void;
296
+ };
297
+ };
298
+ } | undefined;
299
+ googleScriptInitialized?: boolean | undefined;
300
+ }
301
+ }
302
+ interface GoogleOneTapOptions {
303
+ /**
304
+ * Google client ID
305
+ */
306
+ clientId: string;
307
+ /**
308
+ * Auto select the account if the user is already signed in
309
+ */
310
+ autoSelect?: boolean | undefined;
311
+ /**
312
+ * Cancel the flow when the user taps outside the prompt
313
+ */
314
+ cancelOnTapOutside?: boolean | undefined;
315
+ /**
316
+ * The mode to use for the Google One Tap flow
317
+ *
318
+ * popup: Use a popup window
319
+ * redirect: Redirect the user to the Google One Tap flow
320
+ *
321
+ * @default "popup"
322
+ */
323
+ uxMode?: ("popup" | "redirect") | undefined;
324
+ /**
325
+ * The context to use for the Google One Tap flow. See https://developers.google.com/identity/gsi/web/reference/js-reference
326
+ *
327
+ * @default "signin"
328
+ */
329
+ context?: ("signin" | "signup" | "use") | undefined;
330
+ /**
331
+ * Additional configuration options to pass to the Google One Tap API.
332
+ */
333
+ additionalOptions?: Record<string, any> | undefined;
334
+ /**
335
+ * Configuration options for the prompt and exponential backoff behavior.
336
+ */
337
+ promptOptions?: {
338
+ /**
339
+ * Base delay (in milliseconds) for exponential backoff.
340
+ * @default 1000
341
+ */
342
+ baseDelay?: number;
343
+ /**
344
+ * Maximum number of prompt attempts before calling onPromptNotification.
345
+ * @default 5
346
+ */
347
+ maxAttempts?: number;
348
+ } | undefined;
349
+ }
350
+ interface GoogleOneTapActionOptions extends Omit<GoogleOneTapOptions, "clientId" | "promptOptions"> {
351
+ fetchOptions?: BetterFetchOption | undefined;
352
+ /**
353
+ * Callback URL.
354
+ */
355
+ callbackURL?: string | undefined;
356
+ /**
357
+ * Optional callback that receives the prompt notification if (or when) the prompt is dismissed or skipped.
358
+ * This lets you render an alternative UI (e.g. a Google Sign-In button) to restart the process.
359
+ */
360
+ onPromptNotification?: ((notification: any) => void) | undefined;
361
+ }
362
+ declare const oneTapClient: (options: GoogleOneTapOptions) => {
363
+ id: "one-tap";
364
+ getActions: ($fetch: _better_fetch_fetch34.BetterFetch, _: _gatwech_core33.ClientStore) => {
365
+ oneTap: (opts?: GoogleOneTapActionOptions | undefined, fetchOptions?: BetterFetchOption | undefined) => Promise<void>;
366
+ };
367
+ getAtoms($fetch: _better_fetch_fetch34.BetterFetch): {};
368
+ };
369
+ //#endregion
370
+ //#region src/plugins/one-time-token/client.d.ts
371
+ declare const oneTimeTokenClient: () => {
372
+ id: "one-time-token";
373
+ $InferServerPlugin: ReturnType<typeof oneTimeToken>;
374
+ };
375
+ //#endregion
376
+ //#region src/plugins/organization/permission.d.ts
377
+ type PermissionExclusive = {
378
+ /**
379
+ * @deprecated Use `permissions` instead
380
+ */
381
+ permission: {
382
+ [key: string]: string[];
383
+ };
384
+ permissions?: never | undefined;
385
+ } | {
386
+ permissions: {
387
+ [key: string]: string[];
388
+ };
389
+ permission?: never | undefined;
390
+ };
391
+ type HasPermissionBaseInput = {
392
+ role: string;
393
+ options: OrganizationOptions;
394
+ allowCreatorAllPermissions?: boolean | undefined;
395
+ } & PermissionExclusive;
396
+ //#endregion
397
+ //#region src/plugins/organization/client.d.ts
398
+ /**
399
+ * Using the same `hasPermissionFn` function, but without the need for a `ctx` parameter or the `organizationId` parameter.
400
+ */
401
+ declare const clientSideHasPermission: (input: HasPermissionBaseInput) => boolean;
402
+ interface OrganizationClientOptions {
403
+ ac?: AccessControl | undefined;
404
+ roles?: { [key in string]: Role } | undefined;
405
+ teams?: {
406
+ enabled: boolean;
407
+ } | undefined;
408
+ schema?: {
409
+ organization?: {
410
+ additionalFields?: {
411
+ [key: string]: DBFieldAttribute;
412
+ };
413
+ };
414
+ member?: {
415
+ additionalFields?: {
416
+ [key: string]: DBFieldAttribute;
417
+ };
418
+ };
419
+ invitation?: {
420
+ additionalFields?: {
421
+ [key: string]: DBFieldAttribute;
422
+ };
423
+ };
424
+ team?: {
425
+ additionalFields?: {
426
+ [key: string]: DBFieldAttribute;
427
+ };
428
+ };
429
+ organizationRole?: {
430
+ additionalFields?: {
431
+ [key: string]: DBFieldAttribute;
432
+ };
433
+ };
434
+ } | undefined;
435
+ dynamicAccessControl?: {
436
+ enabled: boolean;
437
+ } | undefined;
438
+ }
439
+ declare const organizationClient: <CO extends OrganizationClientOptions>(options?: CO | undefined) => {
440
+ id: "organization";
441
+ $InferServerPlugin: OrganizationPlugin<{
442
+ ac: CO["ac"] extends AccessControl ? CO["ac"] : AccessControl<{
443
+ readonly organization: readonly ["update", "delete"];
444
+ readonly member: readonly ["create", "update", "delete"];
445
+ readonly invitation: readonly ["create", "cancel"];
446
+ readonly team: readonly ["create", "update", "delete"];
447
+ readonly ac: readonly ["create", "read", "update", "delete"];
448
+ }>;
449
+ roles: CO["roles"] extends Record<string, Role> ? CO["roles"] : {
450
+ admin: Role;
451
+ member: Role;
452
+ owner: Role;
453
+ };
454
+ teams: {
455
+ enabled: CO["teams"] extends {
456
+ enabled: true;
457
+ } ? true : false;
458
+ };
459
+ schema: CO["schema"];
460
+ dynamicAccessControl: {
461
+ enabled: CO["dynamicAccessControl"] extends {
462
+ enabled: true;
463
+ } ? true : false;
464
+ };
465
+ }>;
466
+ getActions: ($fetch: _better_fetch_fetch34.BetterFetch, _$store: _gatwech_core33.ClientStore, co: _gatwech_core33.PayvoAuthClientOptions | undefined) => {
467
+ $Infer: {
468
+ ActiveOrganization: CO["teams"] extends {
469
+ enabled: true;
470
+ } ? {
471
+ members: InferMember<CO, false>[];
472
+ invitations: InferInvitation<CO>[];
473
+ teams: InferTeam<CO, false>[];
474
+ } & ({
475
+ id: string;
476
+ name: string;
477
+ slug: string;
478
+ createdAt: Date;
479
+ logo?: string | null | undefined;
480
+ metadata?: any;
481
+ } & InferAdditionalFieldsFromPluginOptions<"organization", CO, false> extends infer T ? { [K in keyof T]: T[K] } : never) : {
482
+ members: InferMember<CO, false>[];
483
+ invitations: InferInvitation<CO, false>[];
484
+ } & ({
485
+ id: string;
486
+ name: string;
487
+ slug: string;
488
+ createdAt: Date;
489
+ logo?: string | null | undefined;
490
+ metadata?: any;
491
+ } & InferAdditionalFieldsFromPluginOptions<"organization", CO, false> extends infer T_1 ? { [K in keyof T_1]: T_1[K] } : never);
492
+ Organization: InferOrganization<CO, false>;
493
+ Invitation: InferInvitation<CO, false>;
494
+ Member: InferMember<CO, false>;
495
+ Team: InferTeam<CO, false>;
496
+ };
497
+ organization: {
498
+ checkRolePermission: <R extends (CO extends {
499
+ roles: any;
500
+ } ? keyof CO["roles"] : "admin" | "member" | "owner")>(data: ({
501
+ /**
502
+ * @deprecated Use `permissions` instead
503
+ */
504
+ permission: { [key in keyof (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
505
+ readonly organization: readonly ["update", "delete"];
506
+ readonly member: readonly ["create", "update", "delete"];
507
+ readonly invitation: readonly ["create", "cancel"];
508
+ readonly team: readonly ["create", "update", "delete"];
509
+ readonly ac: readonly ["create", "read", "update", "delete"];
510
+ })]?: ((CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
511
+ readonly organization: readonly ["update", "delete"];
512
+ readonly member: readonly ["create", "update", "delete"];
513
+ readonly invitation: readonly ["create", "cancel"];
514
+ readonly team: readonly ["create", "update", "delete"];
515
+ readonly ac: readonly ["create", "read", "update", "delete"];
516
+ })[key] extends readonly unknown[] ? (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
517
+ readonly organization: readonly ["update", "delete"];
518
+ readonly member: readonly ["create", "update", "delete"];
519
+ readonly invitation: readonly ["create", "cancel"];
520
+ readonly team: readonly ["create", "update", "delete"];
521
+ readonly ac: readonly ["create", "read", "update", "delete"];
522
+ })[key][number] : never)[] | undefined };
523
+ permissions?: never | undefined;
524
+ } | {
525
+ permissions: { [key in keyof (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
526
+ readonly organization: readonly ["update", "delete"];
527
+ readonly member: readonly ["create", "update", "delete"];
528
+ readonly invitation: readonly ["create", "cancel"];
529
+ readonly team: readonly ["create", "update", "delete"];
530
+ readonly ac: readonly ["create", "read", "update", "delete"];
531
+ })]?: ((CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
532
+ readonly organization: readonly ["update", "delete"];
533
+ readonly member: readonly ["create", "update", "delete"];
534
+ readonly invitation: readonly ["create", "cancel"];
535
+ readonly team: readonly ["create", "update", "delete"];
536
+ readonly ac: readonly ["create", "read", "update", "delete"];
537
+ })[key] extends readonly unknown[] ? (CO["ac"] extends AccessControl<infer S extends Statements> ? S : {
538
+ readonly organization: readonly ["update", "delete"];
539
+ readonly member: readonly ["create", "update", "delete"];
540
+ readonly invitation: readonly ["create", "cancel"];
541
+ readonly team: readonly ["create", "update", "delete"];
542
+ readonly ac: readonly ["create", "read", "update", "delete"];
543
+ })[key][number] : never)[] | undefined };
544
+ permission?: never | undefined;
545
+ }) & {
546
+ role: R;
547
+ }) => boolean;
548
+ };
549
+ };
550
+ getAtoms: ($fetch: _better_fetch_fetch34.BetterFetch) => {
551
+ $listOrg: nanostores1.PreinitializedWritableAtom<boolean> & object;
552
+ $activeOrgSignal: nanostores1.PreinitializedWritableAtom<boolean> & object;
553
+ $activeMemberSignal: nanostores1.PreinitializedWritableAtom<boolean> & object;
554
+ $activeMemberRoleSignal: nanostores1.PreinitializedWritableAtom<boolean> & object;
555
+ activeOrganization: nanostores1.PreinitializedWritableAtom<{
556
+ data: Prettify<({
557
+ id: string;
558
+ name: string;
559
+ slug: string;
560
+ createdAt: Date;
561
+ logo?: string | null | undefined;
562
+ metadata?: any;
563
+ } & InferAdditionalFieldsFromPluginOptions<"organization", CO, false> extends infer T ? { [K in keyof T]: T[K] } : never) & {
564
+ members: InferMember<CO, false>[];
565
+ invitations: InferInvitation<CO, false>[];
566
+ }> | null;
567
+ error: null | _better_fetch_fetch34.BetterFetchError;
568
+ isPending: boolean;
569
+ isRefetching: boolean;
570
+ refetch: (queryParams?: {
571
+ query?: SessionQueryParams;
572
+ } | undefined) => void;
573
+ }> & object;
574
+ listOrganizations: nanostores1.PreinitializedWritableAtom<{
575
+ data: ({
576
+ id: string;
577
+ name: string;
578
+ slug: string;
579
+ createdAt: Date;
580
+ logo?: string | null | undefined;
581
+ metadata?: any;
582
+ } & InferAdditionalFieldsFromPluginOptions<"organization", CO, false> extends infer T_1 ? { [K in keyof T_1]: T_1[K] } : never)[] | null;
583
+ error: null | _better_fetch_fetch34.BetterFetchError;
584
+ isPending: boolean;
585
+ isRefetching: boolean;
586
+ refetch: (queryParams?: {
587
+ query?: SessionQueryParams;
588
+ } | undefined) => void;
589
+ }> & object;
590
+ activeMember: nanostores1.PreinitializedWritableAtom<{
591
+ data: {
592
+ id: string;
593
+ organizationId: string;
594
+ userId: string;
595
+ role: string;
596
+ createdAt: Date;
597
+ } | null;
598
+ error: null | _better_fetch_fetch34.BetterFetchError;
599
+ isPending: boolean;
600
+ isRefetching: boolean;
601
+ refetch: (queryParams?: {
602
+ query?: SessionQueryParams;
603
+ } | undefined) => void;
604
+ }> & object;
605
+ activeMemberRole: nanostores1.PreinitializedWritableAtom<{
606
+ data: {
607
+ role: string;
608
+ } | null;
609
+ error: null | _better_fetch_fetch34.BetterFetchError;
610
+ isPending: boolean;
611
+ isRefetching: boolean;
612
+ refetch: (queryParams?: {
613
+ query?: SessionQueryParams;
614
+ } | undefined) => void;
615
+ }> & object;
616
+ };
617
+ pathMethods: {
618
+ "/organization/get-full-organization": "GET";
619
+ "/organization/list-user-teams": "GET";
620
+ };
621
+ atomListeners: ({
622
+ matcher(path: string): path is "/organization/create" | "/organization/update" | "/organization/delete";
623
+ signal: "$listOrg";
624
+ } | {
625
+ matcher(path: string): boolean;
626
+ signal: "$activeOrgSignal";
627
+ } | {
628
+ matcher(path: string): boolean;
629
+ signal: "$sessionSignal";
630
+ } | {
631
+ matcher(path: string): boolean;
632
+ signal: "$activeMemberSignal";
633
+ } | {
634
+ matcher(path: string): boolean;
635
+ signal: "$activeMemberRoleSignal";
636
+ })[];
637
+ };
638
+ declare const inferOrgAdditionalFields: <O$1 extends {
639
+ options: PayvoAuthOptions$1;
640
+ }, S$1 extends OrganizationOptions["schema"] = undefined>(schema?: S$1 | undefined) => undefined extends S$1 ? O$1 extends Object ? O$1 extends {
641
+ session?: {
642
+ fields?: {
643
+ activeOrganizationId?: string;
644
+ activeTeamId?: string;
645
+ };
646
+ };
647
+ organization?: {
648
+ modelName?: string;
649
+ fields?: { [key in keyof Omit<Organization, "id">]?: string };
650
+ additionalFields?: { [key in string]: DBFieldAttribute };
651
+ };
652
+ member?: {
653
+ modelName?: string;
654
+ fields?: { [key in keyof Omit<Member, "id">]?: string };
655
+ additionalFields?: { [key in string]: DBFieldAttribute };
656
+ };
657
+ invitation?: {
658
+ modelName?: string;
659
+ fields?: { [key in keyof Omit<Invitation, "id">]?: string };
660
+ additionalFields?: { [key in string]: DBFieldAttribute };
661
+ };
662
+ team?: {
663
+ modelName?: string;
664
+ fields?: { [key in keyof Omit<Team, "id">]?: string };
665
+ additionalFields?: { [key in string]: DBFieldAttribute };
666
+ };
667
+ teamMember?: {
668
+ modelName?: string;
669
+ fields?: { [key in keyof Omit<TeamMember, "id">]?: string };
670
+ };
671
+ organizationRole?: {
672
+ modelName?: string;
673
+ fields?: { [key in keyof Omit<OrganizationRole, "id">]?: string };
674
+ additionalFields?: { [key in string]: DBFieldAttribute };
675
+ };
676
+ } ? O$1 : ((O$1 extends {
677
+ options: any;
678
+ } ? O$1 : {
679
+ options: {
680
+ plugins: [];
681
+ };
682
+ })["options"]["plugins"][number] extends infer T ? T extends (O$1 extends {
683
+ options: any;
684
+ } ? O$1 : {
685
+ options: {
686
+ plugins: [];
687
+ };
688
+ })["options"]["plugins"][number] ? T extends {
689
+ id: "organization";
690
+ } ? T : never : never : never) extends {
691
+ options: {
692
+ schema: infer S_1;
693
+ };
694
+ } ? S_1 extends {
695
+ session?: {
696
+ fields?: {
697
+ activeOrganizationId?: string;
698
+ activeTeamId?: string;
699
+ };
700
+ };
701
+ organization?: {
702
+ modelName?: string;
703
+ fields?: { [key in keyof Omit<Organization, "id">]?: string };
704
+ additionalFields?: { [key in string]: DBFieldAttribute };
705
+ };
706
+ member?: {
707
+ modelName?: string;
708
+ fields?: { [key in keyof Omit<Member, "id">]?: string };
709
+ additionalFields?: { [key in string]: DBFieldAttribute };
710
+ };
711
+ invitation?: {
712
+ modelName?: string;
713
+ fields?: { [key in keyof Omit<Invitation, "id">]?: string };
714
+ additionalFields?: { [key in string]: DBFieldAttribute };
715
+ };
716
+ team?: {
717
+ modelName?: string;
718
+ fields?: { [key in keyof Omit<Team, "id">]?: string };
719
+ additionalFields?: { [key in string]: DBFieldAttribute };
720
+ };
721
+ teamMember?: {
722
+ modelName?: string;
723
+ fields?: { [key in keyof Omit<TeamMember, "id">]?: string };
724
+ };
725
+ organizationRole?: {
726
+ modelName?: string;
727
+ fields?: { [key in keyof Omit<OrganizationRole, "id">]?: string };
728
+ additionalFields?: { [key in string]: DBFieldAttribute };
729
+ };
730
+ } | undefined ? S_1 : undefined : undefined : undefined : S$1;
731
+ //#endregion
732
+ //#region src/plugins/phone-number/client.d.ts
733
+ declare const phoneNumberClient: () => {
734
+ id: "phoneNumber";
735
+ $InferServerPlugin: ReturnType<typeof phoneNumber>;
736
+ atomListeners: {
737
+ matcher(path: string): path is "/phone-number/verify" | "/phone-number/update";
738
+ signal: "$sessionSignal";
739
+ }[];
740
+ };
741
+ //#endregion
742
+ //#region src/plugins/passkey/client.d.ts
743
+ declare const getPasskeyActions: ($fetch: BetterFetch, {
744
+ $listPasskeys,
745
+ $store
746
+ }: {
747
+ $listPasskeys: ReturnType<typeof atom<any>>;
748
+ $store: ClientStore;
749
+ }) => {
750
+ signIn: {
751
+ /**
752
+ * Sign in with a registered passkey
753
+ */
754
+ passkey: (opts?: {
755
+ autoFill?: boolean;
756
+ fetchOptions?: BetterFetchOption;
757
+ } | undefined, options?: BetterFetchOption | undefined) => Promise<{
758
+ data: null;
759
+ error: {
760
+ message?: string | undefined;
761
+ status: number;
762
+ statusText: string;
763
+ };
764
+ } | {
765
+ data: {
766
+ session: Session$1;
767
+ user: User$1;
768
+ };
769
+ error: null;
770
+ } | {
771
+ data: null;
772
+ error: {
773
+ code: string;
774
+ message: string;
775
+ status: number;
776
+ statusText: string;
777
+ };
778
+ }>;
779
+ };
780
+ passkey: {
781
+ /**
782
+ * Add a passkey to the user account
783
+ */
784
+ addPasskey: (opts?: {
785
+ fetchOptions?: BetterFetchOption;
786
+ /**
787
+ * The name of the passkey. This is used to
788
+ * identify the passkey in the UI.
789
+ */
790
+ name?: string;
791
+ /**
792
+ * The type of attachment for the passkey. Defaults to both
793
+ * platform and cross-platform allowed, with platform preferred.
794
+ */
795
+ authenticatorAttachment?: "platform" | "cross-platform";
796
+ /**
797
+ * Try to silently create a passkey with the password manager that the user just signed
798
+ * in with.
799
+ * @default false
800
+ */
801
+ useAutoRegister?: boolean;
802
+ } | undefined, fetchOpts?: BetterFetchOption | undefined) => Promise<{
803
+ data: null;
804
+ error: {
805
+ message?: string | undefined;
806
+ status: number;
807
+ statusText: string;
808
+ };
809
+ } | {
810
+ data: null;
811
+ error: {
812
+ code: string;
813
+ message: string;
814
+ status: number;
815
+ statusText: string;
816
+ };
817
+ } | undefined>;
818
+ };
819
+ /**
820
+ * Inferred Internal Types
821
+ */
822
+ $Infer: {
823
+ Passkey: Passkey;
824
+ };
825
+ };
826
+ declare const passkeyClient: () => {
827
+ id: "passkey";
828
+ $InferServerPlugin: ReturnType<typeof passkey>;
829
+ getActions: ($fetch: BetterFetch, $store: ClientStore) => {
830
+ signIn: {
831
+ /**
832
+ * Sign in with a registered passkey
833
+ */
834
+ passkey: (opts?: {
835
+ autoFill?: boolean;
836
+ fetchOptions?: BetterFetchOption;
837
+ } | undefined, options?: BetterFetchOption | undefined) => Promise<{
838
+ data: null;
839
+ error: {
840
+ message?: string | undefined;
841
+ status: number;
842
+ statusText: string;
843
+ };
844
+ } | {
845
+ data: {
846
+ session: Session$1;
847
+ user: User$1;
848
+ };
849
+ error: null;
850
+ } | {
851
+ data: null;
852
+ error: {
853
+ code: string;
854
+ message: string;
855
+ status: number;
856
+ statusText: string;
857
+ };
858
+ }>;
859
+ };
860
+ passkey: {
861
+ /**
862
+ * Add a passkey to the user account
863
+ */
864
+ addPasskey: (opts?: {
865
+ fetchOptions?: BetterFetchOption;
866
+ /**
867
+ * The name of the passkey. This is used to
868
+ * identify the passkey in the UI.
869
+ */
870
+ name?: string;
871
+ /**
872
+ * The type of attachment for the passkey. Defaults to both
873
+ * platform and cross-platform allowed, with platform preferred.
874
+ */
875
+ authenticatorAttachment?: "platform" | "cross-platform";
876
+ /**
877
+ * Try to silently create a passkey with the password manager that the user just signed
878
+ * in with.
879
+ * @default false
880
+ */
881
+ useAutoRegister?: boolean;
882
+ } | undefined, fetchOpts?: BetterFetchOption | undefined) => Promise<{
883
+ data: null;
884
+ error: {
885
+ message?: string | undefined;
886
+ status: number;
887
+ statusText: string;
888
+ };
889
+ } | {
890
+ data: null;
891
+ error: {
892
+ code: string;
893
+ message: string;
894
+ status: number;
895
+ statusText: string;
896
+ };
897
+ } | undefined>;
898
+ };
899
+ /**
900
+ * Inferred Internal Types
901
+ */
902
+ $Infer: {
903
+ Passkey: Passkey;
904
+ };
905
+ };
906
+ getAtoms($fetch: BetterFetch): {
907
+ listPasskeys: nanostores1.PreinitializedWritableAtom<{
908
+ data: Passkey[] | null;
909
+ error: null | _better_fetch_fetch34.BetterFetchError;
910
+ isPending: boolean;
911
+ isRefetching: boolean;
912
+ refetch: (queryParams?: {
913
+ query?: SessionQueryParams;
914
+ } | undefined) => void;
915
+ }> & object;
916
+ $listPasskeys: nanostores1.PreinitializedWritableAtom<any> & object;
917
+ };
918
+ pathMethods: {
919
+ "/passkey/register": "POST";
920
+ "/passkey/authenticate": "POST";
921
+ };
922
+ atomListeners: ({
923
+ matcher(path: string): path is "/sign-out" | "/passkey/verify-registration" | "/passkey/delete-passkey" | "/passkey/update-passkey";
924
+ signal: "$listPasskeys";
925
+ } | {
926
+ matcher: (path: string) => path is "/passkey/verify-authentication";
927
+ signal: "$sessionSignal";
928
+ })[];
929
+ };
930
+ //#endregion
931
+ //#region src/plugins/username/client.d.ts
932
+ declare const usernameClient: () => {
933
+ id: "username";
934
+ $InferServerPlugin: ReturnType<typeof username>;
935
+ };
936
+ //#endregion
937
+ //#region src/client/plugins/infer-plugin.d.ts
938
+ declare const InferServerPlugin: <AuthOrOption extends PayvoAuthOptions | {
939
+ options: PayvoAuthOptions;
940
+ }, ID extends string>() => {
941
+ id: "infer-server-plugin";
942
+ $InferServerPlugin: (AuthOrOption extends {
943
+ options: infer O;
944
+ } ? O : AuthOrOption)["plugins"] extends (infer P)[] ? P extends {
945
+ id: ID;
946
+ } ? P : never : never;
947
+ };
948
+ //#endregion
949
+ export { ApiKeyClientPlugin, Awaitable, DeepPartial, Expand, GoogleOneTapActionOptions, GoogleOneTapOptions, HasRequiredKeys, InferServerPlugin, LastLoginMethodClientConfig, LiteralNumber, LiteralString, LiteralUnion, OmitId, PreserveJSDoc, Prettify, PrettifyDeep, Primitive, RequiredKeysOf, StripEmptyObjects, UnionToIntersection, WithoutEmpty, adminClient, anonymousClient, apiKeyClient, clientSideHasPermission, customSessionClient, deviceAuthorizationClient, emailOTPClient, genericOAuthClient, getPasskeyActions, inferAdditionalFields, inferOrgAdditionalFields, jwtClient, lastLoginMethodClient, magicLinkClient, multiSessionClient, oneTapClient, oneTimeTokenClient, organizationClient, passkeyClient, phoneNumberClient, twoFactorClient, usernameClient };