better-auth 1.7.0-beta.2 → 1.7.0-beta.4

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 (282) hide show
  1. package/README.md +14 -15
  2. package/dist/_virtual/_rolldown/runtime.mjs +10 -1
  3. package/dist/api/index.d.mts +18 -48
  4. package/dist/api/routes/account.d.mts +4 -23
  5. package/dist/api/routes/account.mjs +102 -75
  6. package/dist/api/routes/callback.mjs +42 -20
  7. package/dist/api/routes/email-verification.d.mts +1 -0
  8. package/dist/api/routes/email-verification.mjs +6 -5
  9. package/dist/api/routes/error.mjs +1 -1
  10. package/dist/api/routes/password.mjs +1 -1
  11. package/dist/api/routes/session.mjs +15 -10
  12. package/dist/api/routes/sign-in.d.mts +3 -1
  13. package/dist/api/routes/sign-in.mjs +13 -15
  14. package/dist/api/routes/sign-up.d.mts +1 -0
  15. package/dist/api/routes/sign-up.mjs +10 -8
  16. package/dist/api/routes/update-user.mjs +8 -8
  17. package/dist/api/to-auth-endpoints.mjs +7 -1
  18. package/dist/auth/base.mjs +30 -27
  19. package/dist/client/config.mjs +8 -1
  20. package/dist/client/fetch-plugins.mjs +2 -1
  21. package/dist/client/index.d.mts +2 -2
  22. package/dist/client/lynx/index.d.mts +13 -0
  23. package/dist/client/lynx/index.mjs +2 -1
  24. package/dist/client/parser.mjs +0 -1
  25. package/dist/client/plugins/index.d.mts +4 -17
  26. package/dist/client/plugins/index.mjs +1 -4
  27. package/dist/client/proxy.mjs +2 -1
  28. package/dist/client/react/index.d.mts +13 -0
  29. package/dist/client/react/index.mjs +2 -1
  30. package/dist/client/session-atom.mjs +12 -1
  31. package/dist/client/solid/index.d.mts +13 -0
  32. package/dist/client/solid/index.mjs +3 -2
  33. package/dist/client/svelte/index.d.mts +13 -0
  34. package/dist/client/svelte/index.mjs +2 -1
  35. package/dist/client/vanilla.d.mts +13 -0
  36. package/dist/client/vanilla.mjs +2 -1
  37. package/dist/client/vue/index.d.mts +13 -0
  38. package/dist/client/vue/index.mjs +2 -1
  39. package/dist/context/create-context.mjs +10 -14
  40. package/dist/context/helpers.mjs +3 -2
  41. package/dist/cookies/cookie-utils.d.mts +33 -1
  42. package/dist/cookies/cookie-utils.mjs +95 -14
  43. package/dist/cookies/index.d.mts +2 -3
  44. package/dist/cookies/index.mjs +39 -11
  45. package/dist/cookies/session-store.mjs +4 -23
  46. package/dist/db/get-migration.mjs +4 -4
  47. package/dist/db/index.d.mts +2 -2
  48. package/dist/db/index.mjs +3 -2
  49. package/dist/db/internal-adapter.mjs +129 -27
  50. package/dist/db/schema.d.mts +14 -1
  51. package/dist/db/schema.mjs +26 -1
  52. package/dist/db/with-hooks.d.mts +1 -0
  53. package/dist/db/with-hooks.mjs +58 -1
  54. package/dist/index.d.mts +2 -2
  55. package/dist/index.mjs +2 -2
  56. package/dist/integrations/cookie-plugin-guard.mjs +18 -0
  57. package/dist/integrations/next-js.mjs +6 -0
  58. package/dist/integrations/svelte-kit.mjs +6 -0
  59. package/dist/integrations/tanstack-start-solid.mjs +6 -0
  60. package/dist/integrations/tanstack-start.mjs +6 -0
  61. package/dist/node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/index.mjs +32 -0
  62. package/dist/node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/linux.mjs +55 -0
  63. package/dist/node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/macos.mjs +26 -0
  64. package/dist/node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/termux.mjs +39 -0
  65. package/dist/node_modules/.pnpm/clipboardy@4.0.0/node_modules/clipboardy/lib/windows.mjs +19 -0
  66. package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/chunks/prompt.mjs +845 -0
  67. package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/core.mjs +386 -0
  68. package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/index.mjs +320 -0
  69. package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DRwqZj3T.mjs +62 -0
  70. package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/shared/consola.DXBYu-KD.mjs +190 -0
  71. package/dist/node_modules/.pnpm/consola@3.4.2/node_modules/consola/dist/utils.mjs +2 -0
  72. package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.mjs +29 -0
  73. package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/enoent.mjs +42 -0
  74. package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.mjs +67 -0
  75. package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.mjs +23 -0
  76. package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.mjs +22 -0
  77. package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.mjs +36 -0
  78. package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/adapters/node.d.mts +292 -0
  79. package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/adapters/node.mjs +127 -0
  80. package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/index.d.mts +145 -0
  81. package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/shared/crossws.BQXMA5bH.d.mts +298 -0
  82. package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/shared/crossws.By9qWDAI.mjs +9 -0
  83. package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/shared/crossws.CipVM6lf.mjs +3549 -0
  84. package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/shared/crossws.D9ehKjSh.mjs +66 -0
  85. package/dist/node_modules/.pnpm/crossws@0.3.5/node_modules/crossws/dist/shared/crossws.DfCzGthR.mjs +227 -0
  86. package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/index.mjs +224 -0
  87. package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/command.mjs +52 -0
  88. package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/error.mjs +54 -0
  89. package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/kill.mjs +62 -0
  90. package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/pipe.mjs +26 -0
  91. package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/promise.mjs +32 -0
  92. package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stdio.mjs +19 -0
  93. package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/stream.mjs +98 -0
  94. package/dist/node_modules/.pnpm/execa@8.0.1/node_modules/execa/lib/verbose.mjs +15 -0
  95. package/dist/node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.d.mts +15 -0
  96. package/dist/node_modules/.pnpm/get-port-please@3.2.0/node_modules/get-port-please/dist/index.mjs +220 -0
  97. package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array-buffer.mjs +54 -0
  98. package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/array.mjs +2 -0
  99. package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/buffer.mjs +14 -0
  100. package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/contents.mjs +76 -0
  101. package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/index.mjs +6 -0
  102. package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/string.mjs +35 -0
  103. package/dist/node_modules/.pnpm/get-stream@8.0.1/node_modules/get-stream/source/utils.mjs +10 -0
  104. package/dist/node_modules/.pnpm/http-shutdown@1.2.2/node_modules/http-shutdown/index.mjs +76 -0
  105. package/dist/node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/core.mjs +274 -0
  106. package/dist/node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/main.mjs +44 -0
  107. package/dist/node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/realtime.mjs +15 -0
  108. package/dist/node_modules/.pnpm/human-signals@5.0.0/node_modules/human-signals/build/src/signals.mjs +23 -0
  109. package/dist/node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.mjs +24 -0
  110. package/dist/node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.mjs +18 -0
  111. package/dist/node_modules/.pnpm/is-stream@3.0.0/node_modules/is-stream/index.mjs +9 -0
  112. package/dist/node_modules/.pnpm/is-wsl@3.1.1/node_modules/is-wsl/index.mjs +20 -0
  113. package/dist/node_modules/.pnpm/is64bit@2.0.0/node_modules/is64bit/index.mjs +13 -0
  114. package/dist/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.mjs +47 -0
  115. package/dist/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.mjs +33 -0
  116. package/dist/node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.mjs +33 -0
  117. package/dist/node_modules/.pnpm/listhen@1.9.0/node_modules/listhen/dist/chunks/xdg-open.mjs +1070 -0
  118. package/dist/node_modules/.pnpm/listhen@1.9.0/node_modules/listhen/dist/index.mjs +619 -0
  119. package/dist/node_modules/.pnpm/listhen@1.9.0/node_modules/listhen/dist/shared/listhen.1c46e31d.d.mts +83 -0
  120. package/dist/node_modules/.pnpm/merge-stream@2.0.0/node_modules/merge-stream/index.mjs +38 -0
  121. package/dist/node_modules/.pnpm/mimic-fn@4.0.0/node_modules/mimic-fn/index.mjs +38 -0
  122. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/aes.mjs +597 -0
  123. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/aesCipherSuites.mjs +195 -0
  124. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/asn1-validator.mjs +76 -0
  125. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/asn1.mjs +967 -0
  126. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/baseN.mjs +137 -0
  127. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/cipher.mjs +186 -0
  128. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/cipherModes.mjs +597 -0
  129. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/des.mjs +1187 -0
  130. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/ed25519.mjs +1029 -0
  131. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/forge.mjs +15 -0
  132. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/hmac.mjs +107 -0
  133. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/index.mjs +66 -0
  134. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/jsbn.mjs +1334 -0
  135. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/kem.mjs +146 -0
  136. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/log.mjs +241 -0
  137. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md.all.mjs +24 -0
  138. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md.mjs +18 -0
  139. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/md5.mjs +324 -0
  140. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/mgf.mjs +20 -0
  141. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/mgf1.mjs +44 -0
  142. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/oids.mjs +154 -0
  143. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pbe.mjs +815 -0
  144. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pbkdf2.mjs +125 -0
  145. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pem.mjs +175 -0
  146. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs1.mjs +200 -0
  147. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs12.mjs +724 -0
  148. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs7.mjs +642 -0
  149. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pkcs7asn1.mjs +405 -0
  150. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pki.mjs +101 -0
  151. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/prime.mjs +193 -0
  152. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/prng.mjs +290 -0
  153. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/pss.mjs +141 -0
  154. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/random.mjs +141 -0
  155. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/rc2.mjs +538 -0
  156. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/rsa.mjs +1309 -0
  157. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha1.mjs +230 -0
  158. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha256.mjs +267 -0
  159. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha512.mjs +413 -0
  160. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/ssh.mjs +194 -0
  161. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/tls.mjs +3655 -0
  162. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/util.mjs +2117 -0
  163. package/dist/node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/x509.mjs +2168 -0
  164. package/dist/node_modules/.pnpm/npm-run-path@5.3.0/node_modules/npm-run-path/index.mjs +34 -0
  165. package/dist/node_modules/.pnpm/onetime@6.0.0/node_modules/onetime/index.mjs +26 -0
  166. package/dist/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.mjs +14 -0
  167. package/dist/node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.mjs +8 -0
  168. package/dist/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.mjs +176 -0
  169. package/dist/node_modules/.pnpm/shebang-command@2.0.0/node_modules/shebang-command/index.mjs +17 -0
  170. package/dist/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex/index.mjs +8 -0
  171. package/dist/node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.mjs +169 -0
  172. package/dist/node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.mjs +33 -0
  173. package/dist/node_modules/.pnpm/std-env@3.10.0/node_modules/std-env/dist/index.mjs +171 -0
  174. package/dist/node_modules/.pnpm/strip-final-newline@3.0.0/node_modules/strip-final-newline/index.mjs +10 -0
  175. package/dist/node_modules/.pnpm/system-architecture@0.1.0/node_modules/system-architecture/index.mjs +16 -0
  176. package/dist/node_modules/.pnpm/uncrypto@0.1.3/node_modules/uncrypto/dist/crypto.node.mjs +7 -0
  177. package/dist/node_modules/.pnpm/untun@0.1.3/node_modules/untun/dist/chunks/index.mjs +154 -0
  178. package/dist/node_modules/.pnpm/untun@0.1.3/node_modules/untun/dist/index.mjs +34 -0
  179. package/dist/node_modules/.pnpm/uqr@0.1.2/node_modules/uqr/dist/index.mjs +896 -0
  180. package/dist/node_modules/.pnpm/which@2.0.2/node_modules/which/which.mjs +76 -0
  181. package/dist/oauth2/errors.mjs +27 -0
  182. package/dist/oauth2/index.d.mts +2 -2
  183. package/dist/oauth2/index.mjs +3 -3
  184. package/dist/oauth2/link-account.d.mts +27 -1
  185. package/dist/oauth2/link-account.mjs +30 -5
  186. package/dist/oauth2/state.mjs +8 -2
  187. package/dist/{package.mjs → packages/better-auth/package.mjs} +1 -1
  188. package/dist/plugins/access/access.d.mts +3 -15
  189. package/dist/plugins/access/access.mjs +11 -6
  190. package/dist/plugins/access/index.d.mts +2 -2
  191. package/dist/plugins/access/types.d.mts +11 -4
  192. package/dist/plugins/admin/access/statement.d.mts +29 -93
  193. package/dist/plugins/admin/admin.mjs +0 -4
  194. package/dist/plugins/admin/client.d.mts +6 -1
  195. package/dist/plugins/admin/client.mjs +5 -0
  196. package/dist/plugins/admin/routes.mjs +3 -2
  197. package/dist/plugins/anonymous/client.d.mts +1 -0
  198. package/dist/plugins/anonymous/error-codes.d.mts +1 -0
  199. package/dist/plugins/anonymous/error-codes.mjs +1 -0
  200. package/dist/plugins/anonymous/index.d.mts +1 -0
  201. package/dist/plugins/anonymous/index.mjs +16 -2
  202. package/dist/plugins/bearer/index.mjs +5 -12
  203. package/dist/plugins/captcha/index.mjs +14 -1
  204. package/dist/plugins/device-authorization/error-codes.mjs +1 -0
  205. package/dist/plugins/device-authorization/index.d.mts +1 -0
  206. package/dist/plugins/device-authorization/routes.mjs +34 -3
  207. package/dist/plugins/email-otp/routes.mjs +4 -4
  208. package/dist/plugins/generic-oauth/error-codes.mjs +0 -1
  209. package/dist/plugins/generic-oauth/index.d.mts +2 -4
  210. package/dist/plugins/generic-oauth/index.mjs +23 -17
  211. package/dist/plugins/generic-oauth/providers/auth0.mjs +1 -0
  212. package/dist/plugins/generic-oauth/providers/gumroad.mjs +1 -0
  213. package/dist/plugins/generic-oauth/providers/hubspot.mjs +1 -0
  214. package/dist/plugins/generic-oauth/providers/keycloak.mjs +1 -0
  215. package/dist/plugins/generic-oauth/providers/line.mjs +1 -0
  216. package/dist/plugins/generic-oauth/providers/microsoft-entra-id.mjs +1 -0
  217. package/dist/plugins/generic-oauth/providers/okta.mjs +1 -0
  218. package/dist/plugins/generic-oauth/providers/patreon.mjs +1 -0
  219. package/dist/plugins/generic-oauth/providers/slack.mjs +1 -0
  220. package/dist/plugins/generic-oauth/types.d.mts +30 -8
  221. package/dist/plugins/index.d.mts +2 -2
  222. package/dist/plugins/jwt/utils.d.mts +1 -1
  223. package/dist/plugins/last-login-method/client.mjs +2 -2
  224. package/dist/plugins/magic-link/index.d.mts +8 -1
  225. package/dist/plugins/magic-link/index.mjs +4 -17
  226. package/dist/plugins/mcp/authorize.mjs +8 -2
  227. package/dist/plugins/mcp/index.mjs +75 -35
  228. package/dist/plugins/multi-session/index.mjs +2 -2
  229. package/dist/plugins/oauth-proxy/index.mjs +45 -32
  230. package/dist/plugins/oauth-proxy/utils.mjs +3 -10
  231. package/dist/plugins/oidc-provider/authorize.mjs +8 -2
  232. package/dist/plugins/oidc-provider/index.mjs +65 -38
  233. package/dist/plugins/one-tap/client.mjs +9 -2
  234. package/dist/plugins/one-tap/index.mjs +19 -36
  235. package/dist/plugins/open-api/generator.mjs +25 -5
  236. package/dist/plugins/organization/access/statement.d.mts +68 -201
  237. package/dist/plugins/organization/adapter.d.mts +1 -1
  238. package/dist/plugins/organization/adapter.mjs +65 -58
  239. package/dist/plugins/organization/client.d.mts +3 -1
  240. package/dist/plugins/organization/client.mjs +1 -1
  241. package/dist/plugins/organization/error-codes.d.mts +2 -0
  242. package/dist/plugins/organization/error-codes.mjs +3 -1
  243. package/dist/plugins/organization/routes/crud-access-control.d.mts +2 -2
  244. package/dist/plugins/organization/routes/crud-invites.d.mts +8 -1
  245. package/dist/plugins/organization/routes/crud-invites.mjs +8 -3
  246. package/dist/plugins/organization/routes/crud-org.d.mts +4 -4
  247. package/dist/plugins/organization/routes/crud-org.mjs +2 -2
  248. package/dist/plugins/organization/routes/crud-team.mjs +7 -2
  249. package/dist/plugins/organization/schema.d.mts +1 -1
  250. package/dist/plugins/organization/types.d.mts +15 -5
  251. package/dist/plugins/phone-number/routes.mjs +1 -1
  252. package/dist/plugins/siwe/client.d.mts +4 -0
  253. package/dist/plugins/siwe/client.mjs +5 -1
  254. package/dist/plugins/siwe/index.d.mts +13 -2
  255. package/dist/plugins/siwe/index.mjs +179 -165
  256. package/dist/plugins/two-factor/backup-codes/index.d.mts +4 -3
  257. package/dist/plugins/two-factor/client.mjs +2 -1
  258. package/dist/plugins/two-factor/index.mjs +3 -2
  259. package/dist/plugins/username/client.d.mts +1 -0
  260. package/dist/plugins/username/error-codes.d.mts +1 -0
  261. package/dist/plugins/username/error-codes.mjs +2 -1
  262. package/dist/plugins/username/index.d.mts +43 -2
  263. package/dist/plugins/username/index.mjs +73 -6
  264. package/dist/state.d.mts +2 -2
  265. package/dist/state.mjs +18 -4
  266. package/dist/test-utils/headers.mjs +2 -7
  267. package/dist/test-utils/http-test-instance.d.mts +397 -0
  268. package/dist/test-utils/http-test-instance.mjs +54 -0
  269. package/dist/test-utils/index.d.mts +2 -1
  270. package/dist/test-utils/index.mjs +2 -1
  271. package/dist/test-utils/test-instance.d.mts +4110 -224
  272. package/dist/test-utils/test-instance.mjs +11 -2
  273. package/dist/types/auth.d.mts +4 -0
  274. package/dist/utils/index.d.mts +1 -1
  275. package/dist/utils/url.d.mts +2 -1
  276. package/dist/utils/url.mjs +9 -3
  277. package/dist/version.mjs +1 -1
  278. package/package.json +14 -14
  279. package/dist/oauth2/error-codes.d.mts +0 -20
  280. package/dist/plugins/generic-oauth/client.d.mts +0 -32
  281. package/dist/plugins/generic-oauth/client.mjs +0 -19
  282. package/dist/plugins/generic-oauth/error-codes.d.mts +0 -10
@@ -0,0 +1,230 @@
1
+ import { __commonJSMin } from "../../../../../../_virtual/_rolldown/runtime.mjs";
2
+ import { require_forge } from "./forge.mjs";
3
+ import { require_util } from "./util.mjs";
4
+ import { require_md } from "./md.mjs";
5
+ //#region ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha1.js
6
+ var require_sha1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7
+ /**
8
+ * Secure Hash Algorithm with 160-bit digest (SHA-1) implementation.
9
+ *
10
+ * @author Dave Longley
11
+ *
12
+ * Copyright (c) 2010-2015 Digital Bazaar, Inc.
13
+ */
14
+ var forge = require_forge();
15
+ require_md();
16
+ require_util();
17
+ var sha1 = module.exports = forge.sha1 = forge.sha1 || {};
18
+ forge.md.sha1 = forge.md.algorithms.sha1 = sha1;
19
+ /**
20
+ * Creates a SHA-1 message digest object.
21
+ *
22
+ * @return a message digest object.
23
+ */
24
+ sha1.create = function() {
25
+ if (!_initialized) _init();
26
+ var _state = null;
27
+ var _input = forge.util.createBuffer();
28
+ var _w = new Array(80);
29
+ var md = {
30
+ algorithm: "sha1",
31
+ blockLength: 64,
32
+ digestLength: 20,
33
+ messageLength: 0,
34
+ fullMessageLength: null,
35
+ messageLengthSize: 8
36
+ };
37
+ /**
38
+ * Starts the digest.
39
+ *
40
+ * @return this digest object.
41
+ */
42
+ md.start = function() {
43
+ md.messageLength = 0;
44
+ md.fullMessageLength = md.messageLength64 = [];
45
+ var int32s = md.messageLengthSize / 4;
46
+ for (var i = 0; i < int32s; ++i) md.fullMessageLength.push(0);
47
+ _input = forge.util.createBuffer();
48
+ _state = {
49
+ h0: 1732584193,
50
+ h1: 4023233417,
51
+ h2: 2562383102,
52
+ h3: 271733878,
53
+ h4: 3285377520
54
+ };
55
+ return md;
56
+ };
57
+ md.start();
58
+ /**
59
+ * Updates the digest with the given message input. The given input can
60
+ * treated as raw input (no encoding will be applied) or an encoding of
61
+ * 'utf8' maybe given to encode the input using UTF-8.
62
+ *
63
+ * @param msg the message input to update with.
64
+ * @param encoding the encoding to use (default: 'raw', other: 'utf8').
65
+ *
66
+ * @return this digest object.
67
+ */
68
+ md.update = function(msg, encoding) {
69
+ if (encoding === "utf8") msg = forge.util.encodeUtf8(msg);
70
+ var len = msg.length;
71
+ md.messageLength += len;
72
+ len = [len / 4294967296 >>> 0, len >>> 0];
73
+ for (var i = md.fullMessageLength.length - 1; i >= 0; --i) {
74
+ md.fullMessageLength[i] += len[1];
75
+ len[1] = len[0] + (md.fullMessageLength[i] / 4294967296 >>> 0);
76
+ md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0;
77
+ len[0] = len[1] / 4294967296 >>> 0;
78
+ }
79
+ _input.putBytes(msg);
80
+ _update(_state, _w, _input);
81
+ if (_input.read > 2048 || _input.length() === 0) _input.compact();
82
+ return md;
83
+ };
84
+ /**
85
+ * Produces the digest.
86
+ *
87
+ * @return a byte buffer containing the digest value.
88
+ */
89
+ md.digest = function() {
90
+ var finalBlock = forge.util.createBuffer();
91
+ finalBlock.putBytes(_input.bytes());
92
+ var overflow = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize & md.blockLength - 1;
93
+ finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow));
94
+ var next, carry;
95
+ var bits = md.fullMessageLength[0] * 8;
96
+ for (var i = 0; i < md.fullMessageLength.length - 1; ++i) {
97
+ next = md.fullMessageLength[i + 1] * 8;
98
+ carry = next / 4294967296 >>> 0;
99
+ bits += carry;
100
+ finalBlock.putInt32(bits >>> 0);
101
+ bits = next >>> 0;
102
+ }
103
+ finalBlock.putInt32(bits);
104
+ var s2 = {
105
+ h0: _state.h0,
106
+ h1: _state.h1,
107
+ h2: _state.h2,
108
+ h3: _state.h3,
109
+ h4: _state.h4
110
+ };
111
+ _update(s2, _w, finalBlock);
112
+ var rval = forge.util.createBuffer();
113
+ rval.putInt32(s2.h0);
114
+ rval.putInt32(s2.h1);
115
+ rval.putInt32(s2.h2);
116
+ rval.putInt32(s2.h3);
117
+ rval.putInt32(s2.h4);
118
+ return rval;
119
+ };
120
+ return md;
121
+ };
122
+ var _padding = null;
123
+ var _initialized = false;
124
+ /**
125
+ * Initializes the constant tables.
126
+ */
127
+ function _init() {
128
+ _padding = String.fromCharCode(128);
129
+ _padding += forge.util.fillString(String.fromCharCode(0), 64);
130
+ _initialized = true;
131
+ }
132
+ /**
133
+ * Updates a SHA-1 state with the given byte buffer.
134
+ *
135
+ * @param s the SHA-1 state to update.
136
+ * @param w the array to use to store words.
137
+ * @param bytes the byte buffer to update with.
138
+ */
139
+ function _update(s, w, bytes) {
140
+ var t, a, b, c, d, e, f, i;
141
+ var len = bytes.length();
142
+ while (len >= 64) {
143
+ a = s.h0;
144
+ b = s.h1;
145
+ c = s.h2;
146
+ d = s.h3;
147
+ e = s.h4;
148
+ for (i = 0; i < 16; ++i) {
149
+ t = bytes.getInt32();
150
+ w[i] = t;
151
+ f = d ^ b & (c ^ d);
152
+ t = (a << 5 | a >>> 27) + f + e + 1518500249 + t;
153
+ e = d;
154
+ d = c;
155
+ c = (b << 30 | b >>> 2) >>> 0;
156
+ b = a;
157
+ a = t;
158
+ }
159
+ for (; i < 20; ++i) {
160
+ t = w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16];
161
+ t = t << 1 | t >>> 31;
162
+ w[i] = t;
163
+ f = d ^ b & (c ^ d);
164
+ t = (a << 5 | a >>> 27) + f + e + 1518500249 + t;
165
+ e = d;
166
+ d = c;
167
+ c = (b << 30 | b >>> 2) >>> 0;
168
+ b = a;
169
+ a = t;
170
+ }
171
+ for (; i < 32; ++i) {
172
+ t = w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16];
173
+ t = t << 1 | t >>> 31;
174
+ w[i] = t;
175
+ f = b ^ c ^ d;
176
+ t = (a << 5 | a >>> 27) + f + e + 1859775393 + t;
177
+ e = d;
178
+ d = c;
179
+ c = (b << 30 | b >>> 2) >>> 0;
180
+ b = a;
181
+ a = t;
182
+ }
183
+ for (; i < 40; ++i) {
184
+ t = w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32];
185
+ t = t << 2 | t >>> 30;
186
+ w[i] = t;
187
+ f = b ^ c ^ d;
188
+ t = (a << 5 | a >>> 27) + f + e + 1859775393 + t;
189
+ e = d;
190
+ d = c;
191
+ c = (b << 30 | b >>> 2) >>> 0;
192
+ b = a;
193
+ a = t;
194
+ }
195
+ for (; i < 60; ++i) {
196
+ t = w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32];
197
+ t = t << 2 | t >>> 30;
198
+ w[i] = t;
199
+ f = b & c | d & (b ^ c);
200
+ t = (a << 5 | a >>> 27) + f + e + 2400959708 + t;
201
+ e = d;
202
+ d = c;
203
+ c = (b << 30 | b >>> 2) >>> 0;
204
+ b = a;
205
+ a = t;
206
+ }
207
+ for (; i < 80; ++i) {
208
+ t = w[i - 6] ^ w[i - 16] ^ w[i - 28] ^ w[i - 32];
209
+ t = t << 2 | t >>> 30;
210
+ w[i] = t;
211
+ f = b ^ c ^ d;
212
+ t = (a << 5 | a >>> 27) + f + e + 3395469782 + t;
213
+ e = d;
214
+ d = c;
215
+ c = (b << 30 | b >>> 2) >>> 0;
216
+ b = a;
217
+ a = t;
218
+ }
219
+ s.h0 = s.h0 + a | 0;
220
+ s.h1 = s.h1 + b | 0;
221
+ s.h2 = s.h2 + c | 0;
222
+ s.h3 = s.h3 + d | 0;
223
+ s.h4 = s.h4 + e | 0;
224
+ len -= 64;
225
+ }
226
+ }
227
+ }));
228
+ //#endregion
229
+ export default require_sha1();
230
+ export { require_sha1 };
@@ -0,0 +1,267 @@
1
+ import { __commonJSMin } from "../../../../../../_virtual/_rolldown/runtime.mjs";
2
+ import { require_forge } from "./forge.mjs";
3
+ import { require_util } from "./util.mjs";
4
+ import { require_md } from "./md.mjs";
5
+ //#region ../../node_modules/.pnpm/node-forge@1.4.0/node_modules/node-forge/lib/sha256.js
6
+ var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
7
+ /**
8
+ * Secure Hash Algorithm with 256-bit digest (SHA-256) implementation.
9
+ *
10
+ * See FIPS 180-2 for details.
11
+ *
12
+ * @author Dave Longley
13
+ *
14
+ * Copyright (c) 2010-2015 Digital Bazaar, Inc.
15
+ */
16
+ var forge = require_forge();
17
+ require_md();
18
+ require_util();
19
+ var sha256 = module.exports = forge.sha256 = forge.sha256 || {};
20
+ forge.md.sha256 = forge.md.algorithms.sha256 = sha256;
21
+ /**
22
+ * Creates a SHA-256 message digest object.
23
+ *
24
+ * @return a message digest object.
25
+ */
26
+ sha256.create = function() {
27
+ if (!_initialized) _init();
28
+ var _state = null;
29
+ var _input = forge.util.createBuffer();
30
+ var _w = new Array(64);
31
+ var md = {
32
+ algorithm: "sha256",
33
+ blockLength: 64,
34
+ digestLength: 32,
35
+ messageLength: 0,
36
+ fullMessageLength: null,
37
+ messageLengthSize: 8
38
+ };
39
+ /**
40
+ * Starts the digest.
41
+ *
42
+ * @return this digest object.
43
+ */
44
+ md.start = function() {
45
+ md.messageLength = 0;
46
+ md.fullMessageLength = md.messageLength64 = [];
47
+ var int32s = md.messageLengthSize / 4;
48
+ for (var i = 0; i < int32s; ++i) md.fullMessageLength.push(0);
49
+ _input = forge.util.createBuffer();
50
+ _state = {
51
+ h0: 1779033703,
52
+ h1: 3144134277,
53
+ h2: 1013904242,
54
+ h3: 2773480762,
55
+ h4: 1359893119,
56
+ h5: 2600822924,
57
+ h6: 528734635,
58
+ h7: 1541459225
59
+ };
60
+ return md;
61
+ };
62
+ md.start();
63
+ /**
64
+ * Updates the digest with the given message input. The given input can
65
+ * treated as raw input (no encoding will be applied) or an encoding of
66
+ * 'utf8' maybe given to encode the input using UTF-8.
67
+ *
68
+ * @param msg the message input to update with.
69
+ * @param encoding the encoding to use (default: 'raw', other: 'utf8').
70
+ *
71
+ * @return this digest object.
72
+ */
73
+ md.update = function(msg, encoding) {
74
+ if (encoding === "utf8") msg = forge.util.encodeUtf8(msg);
75
+ var len = msg.length;
76
+ md.messageLength += len;
77
+ len = [len / 4294967296 >>> 0, len >>> 0];
78
+ for (var i = md.fullMessageLength.length - 1; i >= 0; --i) {
79
+ md.fullMessageLength[i] += len[1];
80
+ len[1] = len[0] + (md.fullMessageLength[i] / 4294967296 >>> 0);
81
+ md.fullMessageLength[i] = md.fullMessageLength[i] >>> 0;
82
+ len[0] = len[1] / 4294967296 >>> 0;
83
+ }
84
+ _input.putBytes(msg);
85
+ _update(_state, _w, _input);
86
+ if (_input.read > 2048 || _input.length() === 0) _input.compact();
87
+ return md;
88
+ };
89
+ /**
90
+ * Produces the digest.
91
+ *
92
+ * @return a byte buffer containing the digest value.
93
+ */
94
+ md.digest = function() {
95
+ var finalBlock = forge.util.createBuffer();
96
+ finalBlock.putBytes(_input.bytes());
97
+ var overflow = md.fullMessageLength[md.fullMessageLength.length - 1] + md.messageLengthSize & md.blockLength - 1;
98
+ finalBlock.putBytes(_padding.substr(0, md.blockLength - overflow));
99
+ var next, carry;
100
+ var bits = md.fullMessageLength[0] * 8;
101
+ for (var i = 0; i < md.fullMessageLength.length - 1; ++i) {
102
+ next = md.fullMessageLength[i + 1] * 8;
103
+ carry = next / 4294967296 >>> 0;
104
+ bits += carry;
105
+ finalBlock.putInt32(bits >>> 0);
106
+ bits = next >>> 0;
107
+ }
108
+ finalBlock.putInt32(bits);
109
+ var s2 = {
110
+ h0: _state.h0,
111
+ h1: _state.h1,
112
+ h2: _state.h2,
113
+ h3: _state.h3,
114
+ h4: _state.h4,
115
+ h5: _state.h5,
116
+ h6: _state.h6,
117
+ h7: _state.h7
118
+ };
119
+ _update(s2, _w, finalBlock);
120
+ var rval = forge.util.createBuffer();
121
+ rval.putInt32(s2.h0);
122
+ rval.putInt32(s2.h1);
123
+ rval.putInt32(s2.h2);
124
+ rval.putInt32(s2.h3);
125
+ rval.putInt32(s2.h4);
126
+ rval.putInt32(s2.h5);
127
+ rval.putInt32(s2.h6);
128
+ rval.putInt32(s2.h7);
129
+ return rval;
130
+ };
131
+ return md;
132
+ };
133
+ var _padding = null;
134
+ var _initialized = false;
135
+ var _k = null;
136
+ /**
137
+ * Initializes the constant tables.
138
+ */
139
+ function _init() {
140
+ _padding = String.fromCharCode(128);
141
+ _padding += forge.util.fillString(String.fromCharCode(0), 64);
142
+ _k = [
143
+ 1116352408,
144
+ 1899447441,
145
+ 3049323471,
146
+ 3921009573,
147
+ 961987163,
148
+ 1508970993,
149
+ 2453635748,
150
+ 2870763221,
151
+ 3624381080,
152
+ 310598401,
153
+ 607225278,
154
+ 1426881987,
155
+ 1925078388,
156
+ 2162078206,
157
+ 2614888103,
158
+ 3248222580,
159
+ 3835390401,
160
+ 4022224774,
161
+ 264347078,
162
+ 604807628,
163
+ 770255983,
164
+ 1249150122,
165
+ 1555081692,
166
+ 1996064986,
167
+ 2554220882,
168
+ 2821834349,
169
+ 2952996808,
170
+ 3210313671,
171
+ 3336571891,
172
+ 3584528711,
173
+ 113926993,
174
+ 338241895,
175
+ 666307205,
176
+ 773529912,
177
+ 1294757372,
178
+ 1396182291,
179
+ 1695183700,
180
+ 1986661051,
181
+ 2177026350,
182
+ 2456956037,
183
+ 2730485921,
184
+ 2820302411,
185
+ 3259730800,
186
+ 3345764771,
187
+ 3516065817,
188
+ 3600352804,
189
+ 4094571909,
190
+ 275423344,
191
+ 430227734,
192
+ 506948616,
193
+ 659060556,
194
+ 883997877,
195
+ 958139571,
196
+ 1322822218,
197
+ 1537002063,
198
+ 1747873779,
199
+ 1955562222,
200
+ 2024104815,
201
+ 2227730452,
202
+ 2361852424,
203
+ 2428436474,
204
+ 2756734187,
205
+ 3204031479,
206
+ 3329325298
207
+ ];
208
+ _initialized = true;
209
+ }
210
+ /**
211
+ * Updates a SHA-256 state with the given byte buffer.
212
+ *
213
+ * @param s the SHA-256 state to update.
214
+ * @param w the array to use to store words.
215
+ * @param bytes the byte buffer to update with.
216
+ */
217
+ function _update(s, w, bytes) {
218
+ var t1, t2, s0, s1, ch, maj, i, a, b, c, d, e, f, g, h;
219
+ var len = bytes.length();
220
+ while (len >= 64) {
221
+ for (i = 0; i < 16; ++i) w[i] = bytes.getInt32();
222
+ for (; i < 64; ++i) {
223
+ t1 = w[i - 2];
224
+ t1 = (t1 >>> 17 | t1 << 15) ^ (t1 >>> 19 | t1 << 13) ^ t1 >>> 10;
225
+ t2 = w[i - 15];
226
+ t2 = (t2 >>> 7 | t2 << 25) ^ (t2 >>> 18 | t2 << 14) ^ t2 >>> 3;
227
+ w[i] = t1 + w[i - 7] + t2 + w[i - 16] | 0;
228
+ }
229
+ a = s.h0;
230
+ b = s.h1;
231
+ c = s.h2;
232
+ d = s.h3;
233
+ e = s.h4;
234
+ f = s.h5;
235
+ g = s.h6;
236
+ h = s.h7;
237
+ for (i = 0; i < 64; ++i) {
238
+ s1 = (e >>> 6 | e << 26) ^ (e >>> 11 | e << 21) ^ (e >>> 25 | e << 7);
239
+ ch = g ^ e & (f ^ g);
240
+ s0 = (a >>> 2 | a << 30) ^ (a >>> 13 | a << 19) ^ (a >>> 22 | a << 10);
241
+ maj = a & b | c & (a ^ b);
242
+ t1 = h + s1 + ch + _k[i] + w[i];
243
+ t2 = s0 + maj;
244
+ h = g;
245
+ g = f;
246
+ f = e;
247
+ e = d + t1 >>> 0;
248
+ d = c;
249
+ c = b;
250
+ b = a;
251
+ a = t1 + t2 >>> 0;
252
+ }
253
+ s.h0 = s.h0 + a | 0;
254
+ s.h1 = s.h1 + b | 0;
255
+ s.h2 = s.h2 + c | 0;
256
+ s.h3 = s.h3 + d | 0;
257
+ s.h4 = s.h4 + e | 0;
258
+ s.h5 = s.h5 + f | 0;
259
+ s.h6 = s.h6 + g | 0;
260
+ s.h7 = s.h7 + h | 0;
261
+ len -= 64;
262
+ }
263
+ }
264
+ }));
265
+ //#endregion
266
+ export default require_sha256();
267
+ export { require_sha256 };