@gatwech/auth 1.0.0-beta.18 → 1.0.0-beta.19

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 (224) hide show
  1. package/README.md +8 -14
  2. package/dist/{access-C6O_osEz.mjs → access-CrwEFPHE.mjs} +1 -1
  3. package/dist/{access-DT1f6l5k.mjs → access-bhklJd7m.mjs} +1 -1
  4. package/dist/{adapter-factory-BZ2Qiqpn.mjs → adapter-factory-xbLUJt85.mjs} +2 -2
  5. package/dist/adapters/drizzle-adapter/index.mjs +6 -5
  6. package/dist/adapters/index.d.mts +5 -5
  7. package/dist/adapters/index.mjs +6 -5
  8. package/dist/adapters/kysely-adapter/index.d.mts +1 -1
  9. package/dist/adapters/kysely-adapter/index.mjs +8 -7
  10. package/dist/adapters/memory-adapter/index.d.mts +1 -1
  11. package/dist/adapters/memory-adapter/index.mjs +6 -5
  12. package/dist/adapters/mongodb-adapter/index.mjs +6 -5
  13. package/dist/adapters/prisma-adapter/index.mjs +6 -5
  14. package/dist/adapters/test.mjs +4 -3
  15. package/dist/{admin-Bcq53Nwj.mjs → admin-BzUJL6tr.mjs} +6 -6
  16. package/dist/{anonymous-CRt1imBW.mjs → anonymous-BjlTk4gl.mjs} +5 -5
  17. package/dist/api/index.d.mts +5 -5
  18. package/dist/api/index.mjs +12 -11
  19. package/dist/{api-0pR_I-Nx.mjs → api-Dk8Yj_J5.mjs} +15 -5
  20. package/dist/audit-log-DKsUWR8O.mjs +772 -0
  21. package/dist/{auth-CBUoBX6o.mjs → auth-vfCyIIeV.mjs} +8 -8
  22. package/dist/{bearer-Djf_awfo.mjs → bearer-DvQLM00l.mjs} +2 -2
  23. package/dist/client/index.d.mts +21 -21
  24. package/dist/client/index.mjs +4 -4
  25. package/dist/client/plugins/index.d.mts +53 -45
  26. package/dist/client/plugins/index.mjs +16 -12
  27. package/dist/client/react/index.d.mts +19 -19
  28. package/dist/client/react/index.mjs +2 -2
  29. package/dist/client-4QEb0rUr.mjs +95 -0
  30. package/dist/client-CSOs1YN7.d.mts +14 -0
  31. package/dist/client-DZHNfxuR.d.mts +75 -0
  32. package/dist/client-DzOqXJUm.mjs +15 -0
  33. package/dist/{client-aExCkfwm.mjs → client-xga7yFIX.mjs} +2 -2
  34. package/dist/cookies/index.d.mts +6 -6
  35. package/dist/cookies/index.mjs +2 -2
  36. package/dist/{cookies-cJObLwn1.mjs → cookies-BuvlgcA-.mjs} +1 -1
  37. package/dist/crypto/index.mjs +2 -1
  38. package/dist/{crypto-Bb42eMrH.mjs → crypto-CCyta8xj.mjs} +1 -6
  39. package/dist/{custom-session-L3t7ecsd.mjs → custom-session-DN_-pfi_.mjs} +2 -2
  40. package/dist/db/index.d.mts +5 -5
  41. package/dist/db/index.mjs +9 -8
  42. package/dist/{db-BrstmDhc.mjs → db-7vHnL1XA.mjs} +15 -9
  43. package/dist/{device-authorization-V4s3h4Mj.mjs → device-authorization-BKnNhlsz.mjs} +4 -4
  44. package/dist/{dialect-CeddeGHf.mjs → dialect-HsWUfpYY.mjs} +2 -2
  45. package/dist/{email-otp-BtDHSw14.mjs → email-otp-Dw0DypjQ.mjs} +7 -6
  46. package/dist/{generic-oauth-CL5X27ZI.mjs → generic-oauth-DFj27JY8.mjs} +4 -4
  47. package/dist/{has-permission-BpAr7uCn.mjs → has-permission-Bvg8de8g.mjs} +1 -1
  48. package/dist/{haveibeenpwned-cMpJvmzI.mjs → haveibeenpwned-CzNda7Tn.mjs} +28 -15
  49. package/dist/{client-CNY0tn9g.d.mts → index-BAVzFqII.d.mts} +21 -21
  50. package/dist/{index-DaBcikv9.d.mts → index-BNDRYfTF.d.mts} +2 -2
  51. package/dist/{index-Cxi7TbLE.d.mts → index-BNhJglHC.d.mts} +122 -122
  52. package/dist/{index-BYMI9r_d.d.mts → index-Blmhq6eA.d.mts} +4 -4
  53. package/dist/{index-BHoQlf7a.d.mts → index-CKnPAS5n.d.mts} +178 -178
  54. package/dist/{index-34ONrP8l.d.mts → index-COGe8UJx.d.mts} +11 -11
  55. package/dist/{index-Buhn3hkR.d.mts → index-CP3FNbOZ.d.mts} +8 -8
  56. package/dist/{index-D_k662QG.d.mts → index-CUknVRZp.d.mts} +14 -14
  57. package/dist/{index-DKNNV1kb.d.mts → index-CaqpCfE5.d.mts} +8 -8
  58. package/dist/{index-BBm8nQ9Q.d.mts → index-CgeC2eGC.d.mts} +2 -2
  59. package/dist/{index-DR0xXno9.d.mts → index-CsxtcAO0.d.mts} +1 -1
  60. package/dist/{index-CuFzhoS6.d.mts → index-Cv9iMevV.d.mts} +10 -10
  61. package/dist/{index-C7fQuk-V.d.mts → index-CxlWnL9c.d.mts} +1 -1
  62. package/dist/{index-zjjNBRY2.d.mts → index-DG-X1PK5.d.mts} +6 -6
  63. package/dist/index-DRM35ir1.d.mts +3769 -0
  64. package/dist/{index-BqhKCbPH.d.mts → index-DS-R7st3.d.mts} +6 -6
  65. package/dist/{index-C-u1h_WX.d.mts → index-DXVU0HGr.d.mts} +5 -5
  66. package/dist/{index-DoXZYQpq.d.mts → index-Db8jqUq2.d.mts} +10 -10
  67. package/dist/{index-65G5U5DB-DSdjzreF.d.mts → index-Df0KhQRf-BEa5tdwJ.d.mts} +3 -2
  68. package/dist/{index-B-XKqFvY.d.mts → index-Df4SvZaE.d.mts} +11 -4
  69. package/dist/{index-G6V0Z_Mn.d.mts → index-DyH_CgmX.d.mts} +10 -10
  70. package/dist/{admin-DtfO1PLg.d.mts → index-EABwA_BH.d.mts} +36 -36
  71. package/dist/{index-z0KSvE5i.d.mts → index-QmocqGM-.d.mts} +1 -1
  72. package/dist/{index-DlaMq1nb.d.mts → index-mxEUX2Gs.d.mts} +14 -14
  73. package/dist/{client-BOX93C3d.d.mts → index-xoYsoOiR.d.mts} +52 -52
  74. package/dist/{index-B3n8e37d.d.mts → index-zBdYQGaS.d.mts} +7 -7
  75. package/dist/index.d.mts +5 -5
  76. package/dist/index.mjs +16 -15
  77. package/dist/integrations/next-js.mjs +2 -2
  78. package/dist/integrations/node.d.mts +5 -5
  79. package/dist/integrations/react-start.d.mts +4 -4
  80. package/dist/integrations/react-start.mjs +2 -2
  81. package/dist/{jwt-lHV4QHpD.mjs → jwt-DBN2mu0r.mjs} +4 -4
  82. package/dist/{kysely-adapter-DpzYO8Yf.mjs → kysely-adapter-Bkm1liPW.mjs} +1 -1
  83. package/dist/{magic-link-Bk-ueorR.mjs → magic-link-D9Em1aOR.mjs} +3 -3
  84. package/dist/{multi-session-DRrLKrg9.mjs → multi-session-Dno_8DxC.mjs} +5 -5
  85. package/dist/{oauth-proxy-D1sWh9B_.mjs → oauth-proxy-DW-zt8wv.mjs} +2 -2
  86. package/dist/oauth2/index.d.mts +5 -5
  87. package/dist/oauth2/index.mjs +12 -11
  88. package/dist/{one-tap-DMswkTEc.mjs → one-tap-CodeyQb8.mjs} +2 -2
  89. package/dist/{organization-BArHO_5v.mjs → organization-CkTKs7bx.mjs} +9 -9
  90. package/dist/{passkey-CcD4CnhM.mjs → passkey-JNQTz5a0.mjs} +5 -5
  91. package/dist/{phone-number-rHDIlh-2.mjs → phone-number-Dqz8aeyF.mjs} +4 -4
  92. package/dist/plugins/access/index.d.mts +2 -2
  93. package/dist/plugins/access/index.mjs +1 -1
  94. package/dist/plugins/admin/access/index.d.mts +2 -2
  95. package/dist/plugins/admin/access/index.mjs +2 -2
  96. package/dist/plugins/admin/index.d.mts +7 -8
  97. package/dist/plugins/admin/index.mjs +17 -16
  98. package/dist/plugins/anonymous/index.d.mts +6 -6
  99. package/dist/plugins/anonymous/index.mjs +13 -12
  100. package/dist/plugins/audit-log/client.d.mts +30 -0
  101. package/dist/plugins/audit-log/client.mjs +3 -0
  102. package/dist/plugins/audit-log/index.d.mts +29 -0
  103. package/dist/plugins/audit-log/index.mjs +20 -0
  104. package/dist/plugins/bearer/index.d.mts +1 -1
  105. package/dist/plugins/bearer/index.mjs +3 -3
  106. package/dist/plugins/captcha/index.d.mts +1 -1
  107. package/dist/plugins/captcha/index.mjs +1 -1
  108. package/dist/plugins/custom-session/index.d.mts +6 -6
  109. package/dist/plugins/custom-session/index.mjs +14 -13
  110. package/dist/plugins/device-authorization/index.d.mts +3 -3
  111. package/dist/plugins/device-authorization/index.mjs +13 -12
  112. package/dist/plugins/email-otp/index.d.mts +2 -2
  113. package/dist/plugins/email-otp/index.mjs +14 -13
  114. package/dist/plugins/generic-oauth/index.d.mts +6 -6
  115. package/dist/plugins/generic-oauth/index.mjs +13 -12
  116. package/dist/plugins/haveibeenpwned/index.d.mts +2 -2
  117. package/dist/plugins/haveibeenpwned/index.mjs +14 -13
  118. package/dist/plugins/index.d.mts +29 -139
  119. package/dist/plugins/index.mjs +47 -42
  120. package/dist/plugins/jwt/index.d.mts +6 -6
  121. package/dist/plugins/jwt/index.mjs +13 -12
  122. package/dist/plugins/magic-link/index.d.mts +1 -1
  123. package/dist/plugins/magic-link/index.mjs +13 -12
  124. package/dist/plugins/multi-session/index.d.mts +2 -2
  125. package/dist/plugins/multi-session/index.mjs +13 -12
  126. package/dist/plugins/oauth-proxy/index.d.mts +1 -1
  127. package/dist/plugins/oauth-proxy/index.mjs +13 -12
  128. package/dist/plugins/one-tap/index.d.mts +1 -1
  129. package/dist/plugins/one-tap/index.mjs +13 -12
  130. package/dist/plugins/one-time-token/index.d.mts +6 -6
  131. package/dist/plugins/one-time-token/index.mjs +46 -41
  132. package/dist/plugins/organization/access/index.d.mts +3 -3
  133. package/dist/plugins/organization/access/index.mjs +2 -2
  134. package/dist/plugins/organization/index.d.mts +8 -8
  135. package/dist/plugins/organization/index.mjs +17 -16
  136. package/dist/plugins/passkey/index.d.mts +6 -6
  137. package/dist/plugins/passkey/index.mjs +13 -12
  138. package/dist/plugins/phone-number/index.d.mts +6 -6
  139. package/dist/plugins/phone-number/index.mjs +13 -12
  140. package/dist/plugins/sentinel/client.d.mts +30 -0
  141. package/dist/plugins/sentinel/client.mjs +5 -0
  142. package/dist/plugins/sentinel/index.d.mts +29 -0
  143. package/dist/plugins/sentinel/index.mjs +22 -0
  144. package/dist/plugins/two-factor/index.d.mts +6 -6
  145. package/dist/plugins/two-factor/index.mjs +15 -14
  146. package/dist/plugins/username/index.d.mts +3 -3
  147. package/dist/plugins/username/index.mjs +13 -12
  148. package/dist/{plugins-hFZT3hmK.d.mts → plugins-Dy_FrD4Y.d.mts} +1 -1
  149. package/dist/{plugins-3jfNste3.mjs → plugins-yF8CFUDR.mjs} +11 -8
  150. package/dist/pow-OK01yPG3.mjs +61 -0
  151. package/dist/{proxy-CL9PZXJA.mjs → proxy-C_KXfOhk.mjs} +1 -1
  152. package/dist/random-32E3cU5o.mjs +7 -0
  153. package/dist/registry-CqG_3Qnx.mjs +194 -0
  154. package/dist/sentinel-C-D1IHJo.mjs +1395 -0
  155. package/dist/{session-Dgp133Yt.mjs → session-BB3oqApE.mjs} +2 -2
  156. package/dist/src/adapters/memory-adapter/memory-adapter.d.ts +1 -1
  157. package/dist/src/adapters/prisma-adapter/test/auth.d.ts +1 -1
  158. package/dist/src/adapters/tests/auth-flow.d.ts +3 -3
  159. package/dist/src/adapters/tests/normal.d.ts +1 -1
  160. package/dist/src/adapters/tests/number-id.d.ts +3 -3
  161. package/dist/src/adapters/tests/performance.d.ts +3 -3
  162. package/dist/src/adapters/tests/transactions.d.ts +3 -3
  163. package/dist/src/api/index.d.ts +8 -8
  164. package/dist/src/client/plugins/index.d.ts +2 -0
  165. package/dist/src/plugins/admin/admin.d.ts +2 -2
  166. package/dist/src/plugins/api-key/index.d.ts +2 -2
  167. package/dist/src/plugins/audit-log/client.d.ts +10 -0
  168. package/dist/src/plugins/audit-log/events.d.ts +90 -0
  169. package/dist/src/plugins/audit-log/index.d.ts +614 -0
  170. package/dist/src/plugins/audit-log/registry.d.ts +13 -0
  171. package/dist/src/plugins/audit-log/remote.d.ts +34 -0
  172. package/dist/src/plugins/audit-log/schema.d.ts +50 -0
  173. package/dist/src/plugins/audit-log/types.d.ts +117 -0
  174. package/dist/src/plugins/email-otp/index.d.ts +1 -1
  175. package/dist/src/plugins/haveibeenpwned/index.d.ts +6 -0
  176. package/dist/src/plugins/index.d.ts +2 -0
  177. package/dist/src/plugins/multi-session/index.d.ts +8 -8
  178. package/dist/src/plugins/organization/organization.d.ts +5 -5
  179. package/dist/src/plugins/organization/routes/crud-access-control.d.ts +8 -8
  180. package/dist/src/plugins/organization/routes/crud-invites.d.ts +46 -46
  181. package/dist/src/plugins/organization/routes/crud-members.d.ts +40 -40
  182. package/dist/src/plugins/organization/routes/crud-org.d.ts +36 -36
  183. package/dist/src/plugins/organization/routes/crud-team.d.ts +50 -50
  184. package/dist/src/plugins/sentinel/actions.d.ts +64 -0
  185. package/dist/src/plugins/sentinel/client.d.ts +67 -0
  186. package/dist/src/plugins/sentinel/email.d.ts +22 -0
  187. package/dist/src/plugins/sentinel/geo.d.ts +22 -0
  188. package/dist/src/plugins/sentinel/index.d.ts +326 -0
  189. package/dist/src/plugins/sentinel/intel.d.ts +45 -0
  190. package/dist/src/plugins/sentinel/pow.d.ts +21 -0
  191. package/dist/src/plugins/sentinel/schema.d.ts +110 -0
  192. package/dist/src/plugins/sentinel/store.d.ts +37 -0
  193. package/dist/src/plugins/sentinel/types.d.ts +412 -0
  194. package/dist/src/test-utils/memory-secondary-storage.d.ts +16 -0
  195. package/dist/src/test-utils/password.d.ts +12 -0
  196. package/dist/src/test-utils/test-instance.d.ts +25 -25
  197. package/dist/test-utils/index.d.mts +1048 -1048
  198. package/dist/test-utils/index.mjs +53 -48
  199. package/dist/{two-factor-ClUXxom2.mjs → two-factor-CDVjxx4f.mjs} +6 -5
  200. package/dist/types/index.d.mts +5 -5
  201. package/dist/types/index.mjs +1 -1
  202. package/dist/{username-DiGklOGl.mjs → username-BHNvcvsY.mjs} +3 -3
  203. package/dist/{utils-SOMB4Px5.mjs → utils-B03WRaGi.mjs} +2 -1
  204. package/package.json +36 -3
  205. package/dist/index-CM-CFWwr.d.mts +0 -1919
  206. package/dist/index-DB7t8whN.d.mts +0 -1
  207. /package/dist/{access-BO2g7QVe.mjs → access-BM6jSA5j.mjs} +0 -0
  208. /package/dist/{bun-sqlite-dialect-CeNvMaZz.mjs → bun-sqlite-dialect-CDGusFqF.mjs} +0 -0
  209. /package/dist/{captcha-BqaMxlKC.mjs → captcha-DGP9lCRe.mjs} +0 -0
  210. /package/dist/{client-CygJhqeB.mjs → client-BuveH3MN.mjs} +0 -0
  211. /package/dist/{client-WiN43tAS.mjs → client-cBiytuOL.mjs} +0 -0
  212. /package/dist/{date-Cx2yCiC4.mjs → date-CMr04reD.mjs} +0 -0
  213. /package/dist/{esm-C-QicDNz.mjs → esm-BbvI87Z2.mjs} +0 -0
  214. /package/dist/{get-tables-BQP7YW9c.mjs → get-tables-CKvSyDST.mjs} +0 -0
  215. /package/dist/{helper-tmxW3BHj.d.mts → helper-BgOIGHsu.d.mts} +0 -0
  216. /package/dist/{misc-beA1w3XV.mjs → misc-fKH4d5XQ.mjs} +0 -0
  217. /package/dist/{node-sqlite-dialect-BcKxBQnm.mjs → node-sqlite-dialect-CIOjcg31.mjs} +0 -0
  218. /package/dist/{parser-DcrIEuXE.mjs → parser-D7EkhAjZ.mjs} +0 -0
  219. /package/dist/{password-sVC4nePO.mjs → password-5CdcAVaH.mjs} +0 -0
  220. /package/dist/{permission-DLYUF3cW.mjs → permission-CDDWgA_O.mjs} +0 -0
  221. /package/dist/{plugin-helper-4L-lzsjZ.mjs → plugin-helper-RJJBTOba.mjs} +0 -0
  222. /package/dist/{promise-8rrEHRXd.mjs → promise-D7Oo6_cY.mjs} +0 -0
  223. /package/dist/{types-Bjn15Uy6.mjs → types-DCPpFKUB.mjs} +0 -0
  224. /package/dist/{types-B1OL7hyf.d.mts → types-DNQ9XQrB.d.mts} +0 -0
@@ -1,12 +1,12 @@
1
- import { t as generateId } from "./utils-SOMB4Px5.mjs";
1
+ import { t as generateId } from "./utils-B03WRaGi.mjs";
2
2
  import { r as getOrigin, t as getBaseURL } from "./url-VB2gAbTI.mjs";
3
- import { a as getEndpoints, n as checkEndpointConflicts, s as router } from "./api-0pR_I-Nx.mjs";
4
- import { a as verifyPassword, i as hashPassword } from "./crypto-Bb42eMrH.mjs";
5
- import { i as getCookies, t as createCookieGetter } from "./cookies-cJObLwn1.mjs";
6
- import { a as createInternalAdapter, r as getAdapter, s as getMigrations } from "./db-BrstmDhc.mjs";
7
- import { n as getKyselyDatabaseType } from "./dialect-CeddeGHf.mjs";
8
- import { t as getAuthTables } from "./get-tables-BQP7YW9c.mjs";
9
- import { t as checkPassword } from "./password-sVC4nePO.mjs";
3
+ import { a as getEndpoints, n as checkEndpointConflicts, s as router } from "./api-Dk8Yj_J5.mjs";
4
+ import { i as verifyPassword, r as hashPassword } from "./crypto-CCyta8xj.mjs";
5
+ import { i as getCookies, t as createCookieGetter } from "./cookies-BuvlgcA-.mjs";
6
+ import { a as createInternalAdapter, r as getAdapter, s as getMigrations } from "./db-7vHnL1XA.mjs";
7
+ import { n as getKyselyDatabaseType } from "./dialect-HsWUfpYY.mjs";
8
+ import { t as getAuthTables } from "./get-tables-CKvSyDST.mjs";
9
+ import { t as checkPassword } from "./password-5CdcAVaH.mjs";
10
10
  import { runWithAdapter } from "@gatwech/core/context";
11
11
  import { createLogger, env, isProduction, isTest } from "@gatwech/core/env";
12
12
  import { BASE_ERROR_CODES, PayvoAuthError } from "@gatwech/core/error";
@@ -1,4 +1,4 @@
1
- import { l as parseSetCookieHeader } from "./cookies-cJObLwn1.mjs";
1
+ import { l as parseSetCookieHeader } from "./cookies-BuvlgcA-.mjs";
2
2
  import { serializeSignedCookie } from "better-call";
3
3
  import { createAuthMiddleware } from "@gatwech/core/api";
4
4
  import { createHMAC } from "@gatwech/utils/hmac";
@@ -26,7 +26,7 @@ const bearer = (options) => {
26
26
  }
27
27
  try {
28
28
  const decodedToken = decodeURIComponent(signedToken);
29
- if (!await createHMAC("SHA-256", "base64urlnopad").verify(c.context.secret, decodedToken.split(".")[0], decodedToken.split(".")[1])) return;
29
+ if (!await createHMAC("SHA-256", "base64").verify(c.context.secret, decodedToken.split(".")[0], decodedToken.split(".")[1])) return;
30
30
  } catch (e) {
31
31
  return;
32
32
  }
@@ -1,13 +1,13 @@
1
- import { d as PrettifyDeep, h as UnionToIntersection } from "../helper-tmxW3BHj.mjs";
2
- import { B as InferPluginsFromClient, F as ClientStore, G as PayvoAuthClientPlugin, H as InferUserFromClient, I as InferActions, K as SessionQueryParams, L as InferAdditionalFromClient, M as AtomListener, N as ClientAtomListener, P as ClientOptions, R as InferClientAPI, U as IsSignal, V as InferSessionFromClient, W as PayvoAuthClientOptions, q as Store, z as InferErrorCodes } from "../index-Cxi7TbLE.mjs";
3
- import "../types-B1OL7hyf.mjs";
4
- import "../index-65G5U5DB-DSdjzreF.mjs";
5
- import "../plugins-hFZT3hmK.mjs";
1
+ import { d as PrettifyDeep, h as UnionToIntersection } from "../helper-BgOIGHsu.mjs";
2
+ import { B as InferPluginsFromClient, F as ClientStore, G as PayvoAuthClientPlugin, H as InferUserFromClient, I as InferActions, K as SessionQueryParams, L as InferAdditionalFromClient, M as AtomListener, N as ClientAtomListener, P as ClientOptions, R as InferClientAPI, U as IsSignal, V as InferSessionFromClient, W as PayvoAuthClientOptions, q as Store, z as InferErrorCodes } from "../index-BNhJglHC.mjs";
3
+ import "../types-DNQ9XQrB.mjs";
4
+ import "../index-Df0KhQRf-BEa5tdwJ.mjs";
5
+ import "../plugins-Dy_FrD4Y.mjs";
6
6
  import { PayvoAuthClientOptions as PayvoAuthClientOptions$1, PayvoAuthClientPlugin as PayvoAuthClientPlugin$1, PayvoAuthOptions, PayvoAuthPlugin } from "@gatwech/core";
7
7
  import { BASE_ERROR_CODES } from "@gatwech/core/error";
8
- import * as _better_fetch_fetch17 from "@better-fetch/fetch";
8
+ import * as _better_fetch_fetch36 from "@better-fetch/fetch";
9
9
  import { BetterFetch, BetterFetchError, BetterFetchOption } from "@better-fetch/fetch";
10
- import * as nanostores0 from "nanostores";
10
+ import * as nanostores2 from "nanostores";
11
11
  import { Atom, PreinitializedWritableAtom, WritableAtom } from "nanostores";
12
12
  export * from "@better-fetch/fetch";
13
13
  export * from "nanostores";
@@ -79,27 +79,27 @@ declare function createAuthClient<Option extends PayvoAuthClientOptions$1>(optio
79
79
  error: BetterFetchError | null;
80
80
  isPending: boolean;
81
81
  }>;
82
- $fetch: _better_fetch_fetch17.BetterFetch<{
83
- plugins: (_better_fetch_fetch17.BetterFetchPlugin | {
82
+ $fetch: _better_fetch_fetch36.BetterFetch<{
83
+ plugins: (_better_fetch_fetch36.BetterFetchPlugin | {
84
84
  id: string;
85
85
  name: string;
86
86
  hooks: {
87
- onSuccess(context: _better_fetch_fetch17.SuccessContext<any>): void;
87
+ onSuccess(context: _better_fetch_fetch36.SuccessContext<any>): void;
88
88
  };
89
89
  } | {
90
90
  id: string;
91
91
  name: string;
92
92
  hooks: {
93
- onRequest<T extends Record<string, any>>(context: _better_fetch_fetch17.RequestContext<T>): void;
93
+ onRequest<T extends Record<string, any>>(context: _better_fetch_fetch36.RequestContext<T>): void;
94
94
  };
95
95
  } | {
96
96
  id: string;
97
97
  name: string;
98
98
  hooks: {
99
- onSuccess: ((context: _better_fetch_fetch17.SuccessContext<any>) => Promise<void> | void) | undefined;
100
- onError: ((context: _better_fetch_fetch17.ErrorContext) => Promise<void> | void) | undefined;
101
- onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch17.RequestContext<T>) => Promise<_better_fetch_fetch17.RequestContext | void> | _better_fetch_fetch17.RequestContext | void) | undefined;
102
- onResponse: ((context: _better_fetch_fetch17.ResponseContext) => Promise<Response | void | _better_fetch_fetch17.ResponseContext> | Response | _better_fetch_fetch17.ResponseContext | void) | undefined;
99
+ onSuccess: ((context: _better_fetch_fetch36.SuccessContext<any>) => Promise<void> | void) | undefined;
100
+ onError: ((context: _better_fetch_fetch36.ErrorContext) => Promise<void> | void) | undefined;
101
+ onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch36.RequestContext<T>) => Promise<_better_fetch_fetch36.RequestContext | void> | _better_fetch_fetch36.RequestContext | void) | undefined;
102
+ onResponse: ((context: _better_fetch_fetch36.ResponseContext) => Promise<Response | void | _better_fetch_fetch36.ResponseContext> | Response | _better_fetch_fetch36.ResponseContext | void) | undefined;
103
103
  };
104
104
  })[];
105
105
  method: string;
@@ -119,12 +119,12 @@ declare function createAuthClient<Option extends PayvoAuthClientOptions$1>(optio
119
119
  referrerPolicy?: ReferrerPolicy | undefined;
120
120
  signal?: (AbortSignal | null) | undefined;
121
121
  window?: null | undefined;
122
- onRetry?: ((response: _better_fetch_fetch17.ResponseContext) => Promise<void> | void) | undefined;
122
+ onRetry?: ((response: _better_fetch_fetch36.ResponseContext) => Promise<void> | void) | undefined;
123
123
  hookOptions?: {
124
124
  cloneResponse?: boolean;
125
125
  } | undefined;
126
126
  timeout?: number | undefined;
127
- customFetchImpl: _better_fetch_fetch17.FetchEsque;
127
+ customFetchImpl: _better_fetch_fetch36.FetchEsque;
128
128
  baseURL: string;
129
129
  throw?: boolean | undefined;
130
130
  auth?: ({
@@ -144,16 +144,16 @@ declare function createAuthClient<Option extends PayvoAuthClientOptions$1>(optio
144
144
  params?: any;
145
145
  duplex?: "full" | "half" | undefined;
146
146
  jsonParser: (text: string) => Promise<any> | any;
147
- retry?: _better_fetch_fetch17.RetryOptions | undefined;
147
+ retry?: _better_fetch_fetch36.RetryOptions | undefined;
148
148
  retryAttempt?: number | undefined;
149
- output?: (_better_fetch_fetch17.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
150
- errorSchema?: _better_fetch_fetch17.StandardSchemaV1 | undefined;
149
+ output?: (_better_fetch_fetch36.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
150
+ errorSchema?: _better_fetch_fetch36.StandardSchemaV1 | undefined;
151
151
  disableValidation?: boolean | undefined;
152
152
  }, unknown, unknown, {}>;
153
153
  $store: {
154
154
  notify: (signal?: (Omit<string, "$sessionSignal"> | "$sessionSignal") | undefined) => void;
155
155
  listen: (signal: Omit<string, "$sessionSignal"> | "$sessionSignal", listener: (value: boolean, oldValue?: boolean | undefined) => void) => void;
156
- atoms: Record<string, nanostores0.WritableAtom<any>>;
156
+ atoms: Record<string, nanostores2.WritableAtom<any>>;
157
157
  };
158
158
  $Infer: {
159
159
  Session: NonNullable<InferClientAPI<Option> extends {
@@ -1,7 +1,7 @@
1
1
  import "../url-VB2gAbTI.mjs";
2
- import "../misc-beA1w3XV.mjs";
3
- import { a as createBroadcastChannel, i as useAuthQuery, r as createSessionRefreshManager } from "../proxy-CL9PZXJA.mjs";
4
- import "../parser-DcrIEuXE.mjs";
5
- import { n as InferPlugin, r as createAuthClient, t as InferAuth } from "../client-aExCkfwm.mjs";
2
+ import "../misc-fKH4d5XQ.mjs";
3
+ import { a as createBroadcastChannel, i as useAuthQuery, r as createSessionRefreshManager } from "../proxy-C_KXfOhk.mjs";
4
+ import "../parser-D7EkhAjZ.mjs";
5
+ import { n as InferPlugin, r as createAuthClient, t as InferAuth } from "../client-xga7yFIX.mjs";
6
6
 
7
7
  export { InferAuth, InferPlugin, createAuthClient, createBroadcastChannel, createSessionRefreshManager, useAuthQuery };
@@ -1,31 +1,39 @@
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";
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-BgOIGHsu.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-BNhJglHC.mjs";
3
+ import "../../types-DNQ9XQrB.mjs";
4
+ import "../../index-Df0KhQRf-BEa5tdwJ.mjs";
5
+ import "../../plugins-Dy_FrD4Y.mjs";
6
+ import { a as Role, i as AccessControl, o as Statements } from "../../index-CxlWnL9c.mjs";
7
+ import { t as admin } from "../../index-EABwA_BH.mjs";
8
+ import { r as anonymous } from "../../index-zBdYQGaS.mjs";
9
+ import { L as apiKey } from "../../index-DRM35ir1.mjs";
10
+ import "../../index-DS-R7st3.mjs";
11
+ import "../../index-CgeC2eGC.mjs";
12
+ import "../../index-DG-X1PK5.mjs";
13
+ import { i as deviceAuthorizationClient } from "../../index-BAVzFqII.mjs";
14
+ import { n as emailOTP } from "../../index-CUknVRZp.mjs";
15
+ import { n as genericOAuth } from "../../index-CP3FNbOZ.mjs";
16
+ import "../../index-Df4SvZaE.mjs";
17
+ import { t as jwt } from "../../index-COGe8UJx.mjs";
18
+ import { t as magicLink } from "../../index-Blmhq6eA.mjs";
19
+ import { t as multiSession } from "../../index-Db8jqUq2.mjs";
20
+ import "../../index-DyH_CgmX.mjs";
21
+ import "../../index-BNDRYfTF.mjs";
22
+ import { t as oneTimeToken } from "../../index-DXVU0HGr.mjs";
23
+ import "../../index-QmocqGM-.mjs";
24
+ 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-CKnPAS5n.mjs";
25
+ import { r as phoneNumber } from "../../index-CaqpCfE5.mjs";
26
+ import { n as twoFactorClient } from "../../index-xoYsoOiR.mjs";
27
+ import { n as Passkey, t as passkey } from "../../index-mxEUX2Gs.mjs";
28
+ import { n as username } from "../../index-Cv9iMevV.mjs";
29
+ import { t as auditLogClient } from "../../client-CSOs1YN7.mjs";
30
+ import { t as sentinelClient } from "../../client-DZHNfxuR.mjs";
31
+ import * as _gatwech_core58 from "@gatwech/core";
24
32
  import { ClientStore, PayvoAuthOptions } from "@gatwech/core";
25
33
  import { DBFieldAttribute } from "@gatwech/core/db";
26
- import * as _better_fetch_fetch34 from "@better-fetch/fetch";
34
+ import * as _better_fetch_fetch53 from "@better-fetch/fetch";
27
35
  import { BetterFetch, BetterFetchOption } from "@better-fetch/fetch";
28
- import * as nanostores1 from "nanostores";
36
+ import * as nanostores3 from "nanostores";
29
37
  import { atom } from "nanostores";
30
38
 
31
39
  //#region src/plugins/additional-fields/client.d.ts
@@ -361,10 +369,10 @@ interface GoogleOneTapActionOptions extends Omit<GoogleOneTapOptions, "clientId"
361
369
  }
362
370
  declare const oneTapClient: (options: GoogleOneTapOptions) => {
363
371
  id: "one-tap";
364
- getActions: ($fetch: _better_fetch_fetch34.BetterFetch, _: _gatwech_core33.ClientStore) => {
372
+ getActions: ($fetch: _better_fetch_fetch53.BetterFetch, _: _gatwech_core58.ClientStore) => {
365
373
  oneTap: (opts?: GoogleOneTapActionOptions | undefined, fetchOptions?: BetterFetchOption | undefined) => Promise<void>;
366
374
  };
367
- getAtoms($fetch: _better_fetch_fetch34.BetterFetch): {};
375
+ getAtoms($fetch: _better_fetch_fetch53.BetterFetch): {};
368
376
  };
369
377
  //#endregion
370
378
  //#region src/plugins/one-time-token/client.d.ts
@@ -463,7 +471,7 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
463
471
  } ? true : false;
464
472
  };
465
473
  }>;
466
- getActions: ($fetch: _better_fetch_fetch34.BetterFetch, _$store: _gatwech_core33.ClientStore, co: _gatwech_core33.PayvoAuthClientOptions | undefined) => {
474
+ getActions: ($fetch: _better_fetch_fetch53.BetterFetch, _$store: _gatwech_core58.ClientStore, co: _gatwech_core58.PayvoAuthClientOptions | undefined) => {
467
475
  $Infer: {
468
476
  ActiveOrganization: CO["teams"] extends {
469
477
  enabled: true;
@@ -547,12 +555,12 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
547
555
  }) => boolean;
548
556
  };
549
557
  };
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<{
558
+ getAtoms: ($fetch: _better_fetch_fetch53.BetterFetch) => {
559
+ $listOrg: nanostores3.PreinitializedWritableAtom<boolean> & object;
560
+ $activeOrgSignal: nanostores3.PreinitializedWritableAtom<boolean> & object;
561
+ $activeMemberSignal: nanostores3.PreinitializedWritableAtom<boolean> & object;
562
+ $activeMemberRoleSignal: nanostores3.PreinitializedWritableAtom<boolean> & object;
563
+ activeOrganization: nanostores3.PreinitializedWritableAtom<{
556
564
  data: Prettify<({
557
565
  id: string;
558
566
  name: string;
@@ -564,14 +572,14 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
564
572
  members: InferMember<CO, false>[];
565
573
  invitations: InferInvitation<CO, false>[];
566
574
  }> | null;
567
- error: null | _better_fetch_fetch34.BetterFetchError;
575
+ error: null | _better_fetch_fetch53.BetterFetchError;
568
576
  isPending: boolean;
569
577
  isRefetching: boolean;
570
578
  refetch: (queryParams?: {
571
579
  query?: SessionQueryParams;
572
580
  } | undefined) => void;
573
581
  }> & object;
574
- listOrganizations: nanostores1.PreinitializedWritableAtom<{
582
+ listOrganizations: nanostores3.PreinitializedWritableAtom<{
575
583
  data: ({
576
584
  id: string;
577
585
  name: string;
@@ -580,14 +588,14 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
580
588
  logo?: string | null | undefined;
581
589
  metadata?: any;
582
590
  } & 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;
591
+ error: null | _better_fetch_fetch53.BetterFetchError;
584
592
  isPending: boolean;
585
593
  isRefetching: boolean;
586
594
  refetch: (queryParams?: {
587
595
  query?: SessionQueryParams;
588
596
  } | undefined) => void;
589
597
  }> & object;
590
- activeMember: nanostores1.PreinitializedWritableAtom<{
598
+ activeMember: nanostores3.PreinitializedWritableAtom<{
591
599
  data: {
592
600
  id: string;
593
601
  organizationId: string;
@@ -595,18 +603,18 @@ declare const organizationClient: <CO extends OrganizationClientOptions>(options
595
603
  role: string;
596
604
  createdAt: Date;
597
605
  } | null;
598
- error: null | _better_fetch_fetch34.BetterFetchError;
606
+ error: null | _better_fetch_fetch53.BetterFetchError;
599
607
  isPending: boolean;
600
608
  isRefetching: boolean;
601
609
  refetch: (queryParams?: {
602
610
  query?: SessionQueryParams;
603
611
  } | undefined) => void;
604
612
  }> & object;
605
- activeMemberRole: nanostores1.PreinitializedWritableAtom<{
613
+ activeMemberRole: nanostores3.PreinitializedWritableAtom<{
606
614
  data: {
607
615
  role: string;
608
616
  } | null;
609
- error: null | _better_fetch_fetch34.BetterFetchError;
617
+ error: null | _better_fetch_fetch53.BetterFetchError;
610
618
  isPending: boolean;
611
619
  isRefetching: boolean;
612
620
  refetch: (queryParams?: {
@@ -904,16 +912,16 @@ declare const passkeyClient: () => {
904
912
  };
905
913
  };
906
914
  getAtoms($fetch: BetterFetch): {
907
- listPasskeys: nanostores1.PreinitializedWritableAtom<{
915
+ listPasskeys: nanostores3.PreinitializedWritableAtom<{
908
916
  data: Passkey[] | null;
909
- error: null | _better_fetch_fetch34.BetterFetchError;
917
+ error: null | _better_fetch_fetch53.BetterFetchError;
910
918
  isPending: boolean;
911
919
  isRefetching: boolean;
912
920
  refetch: (queryParams?: {
913
921
  query?: SessionQueryParams;
914
922
  } | undefined) => void;
915
923
  }> & object;
916
- $listPasskeys: nanostores1.PreinitializedWritableAtom<any> & object;
924
+ $listPasskeys: nanostores3.PreinitializedWritableAtom<any> & object;
917
925
  };
918
926
  pathMethods: {
919
927
  "/passkey/register": "POST";
@@ -946,4 +954,4 @@ declare const InferServerPlugin: <AuthOrOption extends PayvoAuthOptions | {
946
954
  } ? P : never : never;
947
955
  };
948
956
  //#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 };
957
+ 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, auditLogClient, clientSideHasPermission, customSessionClient, deviceAuthorizationClient, emailOTPClient, genericOAuthClient, getPasskeyActions, inferAdditionalFields, inferOrgAdditionalFields, jwtClient, lastLoginMethodClient, magicLinkClient, multiSessionClient, oneTapClient, oneTimeTokenClient, organizationClient, passkeyClient, phoneNumberClient, sentinelClient, twoFactorClient, usernameClient };
@@ -1,15 +1,19 @@
1
1
  import "../../url-VB2gAbTI.mjs";
2
- import "../../misc-beA1w3XV.mjs";
3
- import { i as useAuthQuery } from "../../proxy-CL9PZXJA.mjs";
4
- import "../../parser-DcrIEuXE.mjs";
5
- import "../../client-aExCkfwm.mjs";
6
- import "../../access-BO2g7QVe.mjs";
7
- import { a as userAc, t as adminAc$1 } from "../../access-DT1f6l5k.mjs";
8
- import { t as hasPermission } from "../../has-permission-BpAr7uCn.mjs";
9
- import { t as deviceAuthorizationClient } from "../../client-WiN43tAS.mjs";
10
- import { a as memberAc, o as ownerAc, r as defaultRoles, t as adminAc } from "../../access-C6O_osEz.mjs";
11
- import { n as hasPermissionFn } from "../../permission-DLYUF3cW.mjs";
12
- import { t as twoFactorClient } from "../../client-CygJhqeB.mjs";
2
+ import "../../random-32E3cU5o.mjs";
3
+ import "../../misc-fKH4d5XQ.mjs";
4
+ import { i as useAuthQuery } from "../../proxy-C_KXfOhk.mjs";
5
+ import "../../parser-D7EkhAjZ.mjs";
6
+ import "../../client-xga7yFIX.mjs";
7
+ import "../../access-BM6jSA5j.mjs";
8
+ import { a as userAc, t as adminAc$1 } from "../../access-bhklJd7m.mjs";
9
+ import { t as hasPermission } from "../../has-permission-Bvg8de8g.mjs";
10
+ import { t as deviceAuthorizationClient } from "../../client-cBiytuOL.mjs";
11
+ import { a as memberAc, o as ownerAc, r as defaultRoles, t as adminAc } from "../../access-CrwEFPHE.mjs";
12
+ import { n as hasPermissionFn } from "../../permission-CDDWgA_O.mjs";
13
+ import "../../pow-OK01yPG3.mjs";
14
+ import { t as twoFactorClient } from "../../client-BuveH3MN.mjs";
15
+ import { t as auditLogClient } from "../../client-DzOqXJUm.mjs";
16
+ import { t as sentinelClient } from "../../client-4QEb0rUr.mjs";
13
17
  import { atom } from "nanostores";
14
18
  import { WebAuthnError, startAuthentication, startRegistration } from "@simplewebauthn/browser";
15
19
 
@@ -536,4 +540,4 @@ const InferServerPlugin = () => {
536
540
  };
537
541
 
538
542
  //#endregion
539
- export { InferServerPlugin, adminClient, anonymousClient, apiKeyClient, clientSideHasPermission, customSessionClient, deviceAuthorizationClient, emailOTPClient, genericOAuthClient, getPasskeyActions, inferAdditionalFields, inferOrgAdditionalFields, jwtClient, lastLoginMethodClient, magicLinkClient, multiSessionClient, oneTapClient, oneTimeTokenClient, organizationClient, passkeyClient, phoneNumberClient, twoFactorClient, usernameClient };
543
+ export { InferServerPlugin, adminClient, anonymousClient, apiKeyClient, auditLogClient, clientSideHasPermission, customSessionClient, deviceAuthorizationClient, emailOTPClient, genericOAuthClient, getPasskeyActions, inferAdditionalFields, inferOrgAdditionalFields, jwtClient, lastLoginMethodClient, magicLinkClient, multiSessionClient, oneTapClient, oneTimeTokenClient, organizationClient, passkeyClient, phoneNumberClient, sentinelClient, twoFactorClient, usernameClient };
@@ -1,11 +1,11 @@
1
- import { d as PrettifyDeep, h as UnionToIntersection } from "../../helper-tmxW3BHj.mjs";
2
- import { I as InferActions, K as SessionQueryParams, R as InferClientAPI, U as IsSignal, z as InferErrorCodes } from "../../index-Cxi7TbLE.mjs";
3
- import "../../types-B1OL7hyf.mjs";
4
- import "../../index-65G5U5DB-DSdjzreF.mjs";
5
- import "../../plugins-hFZT3hmK.mjs";
1
+ import { d as PrettifyDeep, h as UnionToIntersection } from "../../helper-BgOIGHsu.mjs";
2
+ import { I as InferActions, K as SessionQueryParams, R as InferClientAPI, U as IsSignal, z as InferErrorCodes } from "../../index-BNhJglHC.mjs";
3
+ import "../../types-DNQ9XQrB.mjs";
4
+ import "../../index-Df0KhQRf-BEa5tdwJ.mjs";
5
+ import "../../plugins-Dy_FrD4Y.mjs";
6
6
  import { PayvoAuthClientOptions, PayvoAuthClientPlugin } from "@gatwech/core";
7
7
  import { BASE_ERROR_CODES } from "@gatwech/core/error";
8
- import * as _better_fetch_fetch0 from "@better-fetch/fetch";
8
+ import * as _better_fetch_fetch2 from "@better-fetch/fetch";
9
9
  import { BetterFetchError } from "@better-fetch/fetch";
10
10
  import * as nanostores0 from "nanostores";
11
11
  import { Store, StoreValue } from "nanostores";
@@ -97,27 +97,27 @@ declare function createAuthClient<Option extends PayvoAuthClientOptions>(options
97
97
  error: null;
98
98
  } ? S : Res : never>;
99
99
  };
100
- $fetch: _better_fetch_fetch0.BetterFetch<{
101
- plugins: (_better_fetch_fetch0.BetterFetchPlugin | {
100
+ $fetch: _better_fetch_fetch2.BetterFetch<{
101
+ plugins: (_better_fetch_fetch2.BetterFetchPlugin | {
102
102
  id: string;
103
103
  name: string;
104
104
  hooks: {
105
- onSuccess(context: _better_fetch_fetch0.SuccessContext<any>): void;
105
+ onSuccess(context: _better_fetch_fetch2.SuccessContext<any>): void;
106
106
  };
107
107
  } | {
108
108
  id: string;
109
109
  name: string;
110
110
  hooks: {
111
- onRequest<T extends Record<string, any>>(context: _better_fetch_fetch0.RequestContext<T>): void;
111
+ onRequest<T extends Record<string, any>>(context: _better_fetch_fetch2.RequestContext<T>): void;
112
112
  };
113
113
  } | {
114
114
  id: string;
115
115
  name: string;
116
116
  hooks: {
117
- onSuccess: ((context: _better_fetch_fetch0.SuccessContext<any>) => Promise<void> | void) | undefined;
118
- onError: ((context: _better_fetch_fetch0.ErrorContext) => Promise<void> | void) | undefined;
119
- onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch0.RequestContext<T>) => Promise<_better_fetch_fetch0.RequestContext | void> | _better_fetch_fetch0.RequestContext | void) | undefined;
120
- onResponse: ((context: _better_fetch_fetch0.ResponseContext) => Promise<Response | void | _better_fetch_fetch0.ResponseContext> | Response | _better_fetch_fetch0.ResponseContext | void) | undefined;
117
+ onSuccess: ((context: _better_fetch_fetch2.SuccessContext<any>) => Promise<void> | void) | undefined;
118
+ onError: ((context: _better_fetch_fetch2.ErrorContext) => Promise<void> | void) | undefined;
119
+ onRequest: (<T extends Record<string, any>>(context: _better_fetch_fetch2.RequestContext<T>) => Promise<_better_fetch_fetch2.RequestContext | void> | _better_fetch_fetch2.RequestContext | void) | undefined;
120
+ onResponse: ((context: _better_fetch_fetch2.ResponseContext) => Promise<Response | void | _better_fetch_fetch2.ResponseContext> | Response | _better_fetch_fetch2.ResponseContext | void) | undefined;
121
121
  };
122
122
  })[];
123
123
  method: string;
@@ -137,12 +137,12 @@ declare function createAuthClient<Option extends PayvoAuthClientOptions>(options
137
137
  referrerPolicy?: ReferrerPolicy | undefined;
138
138
  signal?: (AbortSignal | null) | undefined;
139
139
  window?: null | undefined;
140
- onRetry?: ((response: _better_fetch_fetch0.ResponseContext) => Promise<void> | void) | undefined;
140
+ onRetry?: ((response: _better_fetch_fetch2.ResponseContext) => Promise<void> | void) | undefined;
141
141
  hookOptions?: {
142
142
  cloneResponse?: boolean;
143
143
  } | undefined;
144
144
  timeout?: number | undefined;
145
- customFetchImpl: _better_fetch_fetch0.FetchEsque;
145
+ customFetchImpl: _better_fetch_fetch2.FetchEsque;
146
146
  baseURL: string;
147
147
  throw?: boolean | undefined;
148
148
  auth?: ({
@@ -162,10 +162,10 @@ declare function createAuthClient<Option extends PayvoAuthClientOptions>(options
162
162
  params?: any;
163
163
  duplex?: "full" | "half" | undefined;
164
164
  jsonParser: (text: string) => Promise<any> | any;
165
- retry?: _better_fetch_fetch0.RetryOptions | undefined;
165
+ retry?: _better_fetch_fetch2.RetryOptions | undefined;
166
166
  retryAttempt?: number | undefined;
167
- output?: (_better_fetch_fetch0.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
168
- errorSchema?: _better_fetch_fetch0.StandardSchemaV1 | undefined;
167
+ output?: (_better_fetch_fetch2.StandardSchemaV1 | typeof Blob | typeof File) | undefined;
168
+ errorSchema?: _better_fetch_fetch2.StandardSchemaV1 | undefined;
169
169
  disableValidation?: boolean | undefined;
170
170
  }, unknown, unknown, {}>;
171
171
  $store: {
@@ -1,6 +1,6 @@
1
1
  import "../../url-VB2gAbTI.mjs";
2
- import { n as getClientConfig, t as createDynamicPathProxy } from "../../proxy-CL9PZXJA.mjs";
3
- import "../../parser-DcrIEuXE.mjs";
2
+ import { n as getClientConfig, t as createDynamicPathProxy } from "../../proxy-C_KXfOhk.mjs";
3
+ import "../../parser-D7EkhAjZ.mjs";
4
4
  import { listenKeys } from "nanostores";
5
5
  import { useCallback, useRef, useSyncExternalStore } from "react";
6
6
 
@@ -0,0 +1,95 @@
1
+ import { t as generateRandomString } from "./random-32E3cU5o.mjs";
2
+ import { n as POW_REASON_HEADER, o as parsePowHeader, r as POW_SOLUTION_HEADER, s as solveChallenge, t as POW_CHALLENGE_HEADER } from "./pow-OK01yPG3.mjs";
3
+ import { betterFetch } from "@better-fetch/fetch";
4
+
5
+ //#region src/plugins/sentinel/client.ts
6
+ const VISITOR_ID_STORAGE_KEY = "payvo-auth.visitor_id";
7
+ /** A random id kept for the lifetime of the browser storage */
8
+ function storedVisitorId() {
9
+ try {
10
+ const storage = globalThis.localStorage;
11
+ const existing = storage?.getItem(VISITOR_ID_STORAGE_KEY);
12
+ if (existing) return existing;
13
+ const created = generateRandomString(32, "a-z", "0-9");
14
+ storage?.setItem(VISITOR_ID_STORAGE_KEY, created);
15
+ return created;
16
+ } catch {
17
+ return generateRandomString(32, "a-z", "0-9");
18
+ }
19
+ }
20
+ const sentinelClient = (options) => {
21
+ const autoSolveChallenge = options?.autoSolveChallenge ?? true;
22
+ const timeout = options?.identifyOptions?.timeout ?? 1e3;
23
+ const retry = {
24
+ attempts: options?.identifyOptions?.retry?.attempts ?? 2,
25
+ baseDelay: options?.identifyOptions?.retry?.baseDelay ?? 400,
26
+ maxDelay: options?.identifyOptions?.retry?.maxDelay ?? 600
27
+ };
28
+ let visitorId;
29
+ async function identify(fingerprint) {
30
+ const identifyUrl = options?.identifyUrl?.replace(/\/+$/, "");
31
+ if (!identifyUrl) return fingerprint;
32
+ for (let attempt = 0; attempt <= retry.attempts; attempt++) {
33
+ if (attempt > 0) {
34
+ const delay = Math.min(retry.baseDelay * 2 ** (attempt - 1), retry.maxDelay);
35
+ await new Promise((resolve) => setTimeout(resolve, delay));
36
+ }
37
+ const { data } = await betterFetch(`${identifyUrl}/v1/identify`, {
38
+ method: "POST",
39
+ headers: options?.identifyOptions?.headers,
40
+ body: {
41
+ fingerprint,
42
+ userAgent: globalThis.navigator?.userAgent ?? null
43
+ },
44
+ timeout
45
+ }).catch(() => ({ data: null }));
46
+ if (data?.visitorId) return data.visitorId;
47
+ }
48
+ return fingerprint;
49
+ }
50
+ function getVisitorId() {
51
+ visitorId ??= (async () => {
52
+ return identify(options?.getFingerprint ? await options.getFingerprint() : storedVisitorId());
53
+ })();
54
+ return visitorId;
55
+ }
56
+ return {
57
+ id: "sentinel",
58
+ $InferServerPlugin: {},
59
+ fetchPlugins: [{
60
+ id: "sentinel",
61
+ name: "sentinel",
62
+ hooks: {
63
+ async onRequest(context) {
64
+ context.headers.set("x-visitor-id", await getVisitorId());
65
+ return context;
66
+ },
67
+ async onResponse({ response, request }) {
68
+ if (response.status !== 423) return;
69
+ const challenge = parsePowHeader(response.headers.get(POW_CHALLENGE_HEADER));
70
+ if (!challenge) return;
71
+ options?.onChallengeReceived?.(response.headers.get(POW_REASON_HEADER) ?? "unknown");
72
+ if (!autoSolveChallenge) return;
73
+ try {
74
+ const startedAt = Date.now();
75
+ const solution = await solveChallenge(challenge.nonce, Number(challenge.value));
76
+ options?.onChallengeSolved?.(Date.now() - startedAt);
77
+ const headers = new Headers(request.headers);
78
+ headers.set(POW_SOLUTION_HEADER, `${challenge.nonce}:${solution}`);
79
+ const retried = await (request.customFetchImpl ?? fetch)(request.url, {
80
+ ...request,
81
+ headers
82
+ });
83
+ if (retried.status === 423 && retried.headers.has(POW_CHALLENGE_HEADER)) options?.onChallengeFailed?.(/* @__PURE__ */ new Error("The challenge solution was rejected"));
84
+ return retried;
85
+ } catch (e) {
86
+ options?.onChallengeFailed?.(e instanceof Error ? e : new Error(String(e)));
87
+ }
88
+ }
89
+ }
90
+ }]
91
+ };
92
+ };
93
+
94
+ //#endregion
95
+ export { sentinelClient as t };
@@ -0,0 +1,14 @@
1
+ import { n as auditLog } from "./index-DRM35ir1.mjs";
2
+
3
+ //#region src/plugins/audit-log/client.d.ts
4
+ declare const auditLogClient: () => {
5
+ id: "audit-log";
6
+ $InferServerPlugin: ReturnType<typeof auditLog>;
7
+ pathMethods: {
8
+ "/audit-log/get-audit-logs": "GET";
9
+ "/audit-log/get-all-audit-logs": "GET";
10
+ "/audit-log/get-event-types": "GET";
11
+ };
12
+ };
13
+ //#endregion
14
+ export { auditLogClient as t };