@eventmodelers/node-kit 0.0.2

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 (546) hide show
  1. package/README.md +66 -0
  2. package/package.json +36 -0
  3. package/src/cli.js +176 -0
  4. package/templates/.claude/skills/connect/SKILL.md +169 -0
  5. package/templates/.claude/skills/load-slice/SKILL.md +86 -0
  6. package/templates/realtime-agent/node_modules/.package-lock.json +107 -0
  7. package/templates/realtime-agent/node_modules/@supabase/auth-js/LICENSE +21 -0
  8. package/templates/realtime-agent/node_modules/@supabase/auth-js/README.md +190 -0
  9. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.d.ts +4 -0
  10. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.d.ts.map +1 -0
  11. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.js +7 -0
  12. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.js.map +1 -0
  13. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.d.ts +4 -0
  14. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.d.ts.map +1 -0
  15. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.js +7 -0
  16. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.js.map +1 -0
  17. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.d.ts +716 -0
  18. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.d.ts.map +1 -0
  19. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.js +1108 -0
  20. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.js.map +1 -0
  21. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.d.ts +2473 -0
  22. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.d.ts.map +1 -0
  23. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js +5217 -0
  24. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js.map +1 -0
  25. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.d.ts +9 -0
  26. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.d.ts.map +1 -0
  27. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.js +20 -0
  28. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.js.map +1 -0
  29. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.d.ts +76 -0
  30. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.d.ts.map +1 -0
  31. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.js +269 -0
  32. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.js.map +1 -0
  33. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.d.ts +26 -0
  34. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.d.ts.map +1 -0
  35. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.js +31 -0
  36. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.js.map +1 -0
  37. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.d.ts +7 -0
  38. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.d.ts.map +1 -0
  39. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.js +3 -0
  40. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.js.map +1 -0
  41. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.d.ts +258 -0
  42. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.d.ts.map +1 -0
  43. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.js +290 -0
  44. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.js.map +1 -0
  45. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.d.ts +54 -0
  46. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.d.ts.map +1 -0
  47. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.js +200 -0
  48. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.js.map +1 -0
  49. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.d.ts +94 -0
  50. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.d.ts.map +1 -0
  51. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.js +406 -0
  52. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.js.map +1 -0
  53. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.d.ts +9 -0
  54. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.d.ts.map +1 -0
  55. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.js +21 -0
  56. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.js.map +1 -0
  57. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.d.ts +107 -0
  58. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.d.ts.map +1 -0
  59. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.js +349 -0
  60. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.js.map +1 -0
  61. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.d.ts +5 -0
  62. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.d.ts.map +1 -0
  63. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.js +29 -0
  64. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.js.map +1 -0
  65. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.d.ts +2498 -0
  66. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.d.ts.map +1 -0
  67. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.js +23 -0
  68. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.js.map +1 -0
  69. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.d.ts +2 -0
  70. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.d.ts.map +1 -0
  71. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.js +11 -0
  72. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.js.map +1 -0
  73. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.d.ts +96 -0
  74. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.d.ts.map +1 -0
  75. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.js +66 -0
  76. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.js.map +1 -0
  77. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.d.ts +160 -0
  78. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.d.ts.map +1 -0
  79. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.js +4 -0
  80. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.js.map +1 -0
  81. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.d.ts +284 -0
  82. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.d.ts.map +1 -0
  83. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.d.ts +583 -0
  84. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.d.ts.map +1 -0
  85. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.js +4 -0
  86. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.js.map +1 -0
  87. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.d.ts +85 -0
  88. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.d.ts.map +1 -0
  89. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.js +272 -0
  90. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.js.map +1 -0
  91. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.js +707 -0
  92. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.js.map +1 -0
  93. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.d.ts +4 -0
  94. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.d.ts.map +1 -0
  95. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.js +4 -0
  96. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.js.map +1 -0
  97. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.d.ts +4 -0
  98. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.d.ts.map +1 -0
  99. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.js +4 -0
  100. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.js.map +1 -0
  101. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.d.ts +716 -0
  102. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.d.ts.map +1 -0
  103. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js +1105 -0
  104. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js.map +1 -0
  105. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.d.ts +2473 -0
  106. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.d.ts.map +1 -0
  107. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js +5214 -0
  108. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js.map +1 -0
  109. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.d.ts +9 -0
  110. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.d.ts.map +1 -0
  111. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.js +9 -0
  112. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.js.map +1 -0
  113. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.d.ts +76 -0
  114. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.d.ts.map +1 -0
  115. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.js +257 -0
  116. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.js.map +1 -0
  117. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.d.ts +26 -0
  118. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.d.ts.map +1 -0
  119. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.js +28 -0
  120. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.js.map +1 -0
  121. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.d.ts +7 -0
  122. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.d.ts.map +1 -0
  123. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.js +2 -0
  124. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.js.map +1 -0
  125. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.d.ts +258 -0
  126. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.d.ts.map +1 -0
  127. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.js +267 -0
  128. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.js.map +1 -0
  129. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.d.ts +54 -0
  130. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.d.ts.map +1 -0
  131. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.js +190 -0
  132. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.js.map +1 -0
  133. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.d.ts +94 -0
  134. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.d.ts.map +1 -0
  135. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.js +378 -0
  136. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.js.map +1 -0
  137. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.d.ts +9 -0
  138. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.d.ts.map +1 -0
  139. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.js +18 -0
  140. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.js.map +1 -0
  141. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.d.ts +107 -0
  142. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.d.ts.map +1 -0
  143. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.js +341 -0
  144. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.js.map +1 -0
  145. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.d.ts +5 -0
  146. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.d.ts.map +1 -0
  147. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.js +26 -0
  148. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.js.map +1 -0
  149. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.d.ts +2498 -0
  150. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.d.ts.map +1 -0
  151. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.js +20 -0
  152. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.js.map +1 -0
  153. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.d.ts +2 -0
  154. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.d.ts.map +1 -0
  155. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.js +8 -0
  156. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.js.map +1 -0
  157. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.d.ts +96 -0
  158. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.d.ts.map +1 -0
  159. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.js +60 -0
  160. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.js.map +1 -0
  161. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.d.ts +160 -0
  162. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.d.ts.map +1 -0
  163. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.js +3 -0
  164. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.js.map +1 -0
  165. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.d.ts +284 -0
  166. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.d.ts.map +1 -0
  167. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.d.ts +583 -0
  168. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.d.ts.map +1 -0
  169. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.js +3 -0
  170. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.js.map +1 -0
  171. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.d.ts +85 -0
  172. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.d.ts.map +1 -0
  173. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.js +264 -0
  174. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.js.map +1 -0
  175. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.js +689 -0
  176. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.js.map +1 -0
  177. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/tsconfig.module.tsbuildinfo +1 -0
  178. package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/tsconfig.tsbuildinfo +1 -0
  179. package/templates/realtime-agent/node_modules/@supabase/auth-js/package.json +44 -0
  180. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/AuthAdminApi.ts +5 -0
  181. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/AuthClient.ts +5 -0
  182. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/GoTrueAdminApi.ts +1267 -0
  183. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/GoTrueClient.ts +6360 -0
  184. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/index.ts +13 -0
  185. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/base64url.ts +308 -0
  186. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/constants.ts +34 -0
  187. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/error-codes.ts +90 -0
  188. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/errors.ts +359 -0
  189. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/fetch.ts +320 -0
  190. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/helpers.ts +476 -0
  191. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/local-storage.ts +21 -0
  192. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/locks.ts +420 -0
  193. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/polyfills.ts +23 -0
  194. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/types.ts +2917 -0
  195. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/version.ts +7 -0
  196. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/web3/ethereum.ts +184 -0
  197. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/web3/solana.ts +186 -0
  198. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.dom.ts +636 -0
  199. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.errors.ts +329 -0
  200. package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.ts +946 -0
  201. package/templates/realtime-agent/node_modules/@supabase/functions-js/README.md +134 -0
  202. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.d.ts +177 -0
  203. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.d.ts.map +1 -0
  204. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.js +309 -0
  205. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.js.map +1 -0
  206. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.d.ts +3 -0
  207. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.d.ts.map +1 -0
  208. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.js +11 -0
  209. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.js.map +1 -0
  210. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.d.ts +3 -0
  211. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.d.ts.map +1 -0
  212. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.js +12 -0
  213. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.js.map +1 -0
  214. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.d.ts +122 -0
  215. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.d.ts.map +1 -0
  216. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.js +98 -0
  217. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.js.map +1 -0
  218. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.d.ts +2 -0
  219. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.d.ts.map +1 -0
  220. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.js +11 -0
  221. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.js.map +1 -0
  222. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.d.ts +177 -0
  223. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.d.ts.map +1 -0
  224. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.js +305 -0
  225. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.js.map +1 -0
  226. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.d.ts +3 -0
  227. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.d.ts.map +1 -0
  228. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.js +7 -0
  229. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.js.map +1 -0
  230. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.d.ts +3 -0
  231. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.d.ts.map +1 -0
  232. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.js +3 -0
  233. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.js.map +1 -0
  234. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.d.ts +122 -0
  235. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.d.ts.map +1 -0
  236. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.js +91 -0
  237. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.js.map +1 -0
  238. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.d.ts +2 -0
  239. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.d.ts.map +1 -0
  240. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.js +8 -0
  241. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.js.map +1 -0
  242. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/tsconfig.module.tsbuildinfo +1 -0
  243. package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/tsconfig.tsbuildinfo +1 -0
  244. package/templates/realtime-agent/node_modules/@supabase/functions-js/package.json +52 -0
  245. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/FunctionsClient.ts +335 -0
  246. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/edge-runtime.d.ts +214 -0
  247. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/helper.ts +8 -0
  248. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/index.ts +10 -0
  249. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/types.ts +146 -0
  250. package/templates/realtime-agent/node_modules/@supabase/functions-js/src/version.ts +7 -0
  251. package/templates/realtime-agent/node_modules/@supabase/phoenix/LICENSE.md +22 -0
  252. package/templates/realtime-agent/node_modules/@supabase/phoenix/README.md +121 -0
  253. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/ajax.js +116 -0
  254. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/channel.js +331 -0
  255. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/constants.js +35 -0
  256. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/index.js +212 -0
  257. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/longpoll.js +192 -0
  258. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/presence.js +208 -0
  259. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/push.js +134 -0
  260. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/serializer.js +133 -0
  261. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/socket.js +756 -0
  262. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/timer.js +48 -0
  263. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/types.js +184 -0
  264. package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/utils.js +16 -0
  265. package/templates/realtime-agent/node_modules/@supabase/phoenix/package.json +58 -0
  266. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/favicon.ico +0 -0
  267. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix-orange.png +0 -0
  268. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.cjs.js +1825 -0
  269. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.cjs.js.map +7 -0
  270. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.js +1847 -0
  271. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.min.js +2 -0
  272. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.mjs +1802 -0
  273. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.mjs.map +7 -0
  274. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.png +0 -0
  275. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/ajax.d.ts +10 -0
  276. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/ajax.d.ts.map +1 -0
  277. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/channel.d.ts +167 -0
  278. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/channel.d.ts.map +1 -0
  279. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/constants.d.ts +36 -0
  280. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/constants.d.ts.map +1 -0
  281. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/index.d.ts +10 -0
  282. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/index.d.ts.map +1 -0
  283. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/longpoll.d.ts +29 -0
  284. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/longpoll.d.ts.map +1 -0
  285. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/presence.d.ts +107 -0
  286. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/presence.d.ts.map +1 -0
  287. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/push.d.ts +70 -0
  288. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/push.d.ts.map +1 -0
  289. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/serializer.d.ts +74 -0
  290. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/serializer.d.ts.map +1 -0
  291. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/socket.d.ts +291 -0
  292. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/socket.d.ts.map +1 -0
  293. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/timer.d.ts +36 -0
  294. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/timer.d.ts.map +1 -0
  295. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/types.d.ts +280 -0
  296. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/types.d.ts.map +1 -0
  297. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/utils.d.ts +2 -0
  298. package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/utils.d.ts.map +1 -0
  299. package/templates/realtime-agent/node_modules/@supabase/phoenix/tsconfig.json +20 -0
  300. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/README.md +213 -0
  301. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.cjs +5025 -0
  302. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.cjs.map +1 -0
  303. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.cts +3828 -0
  304. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.cts.map +1 -0
  305. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.mts +3828 -0
  306. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.mts.map +1 -0
  307. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.mjs +5017 -0
  308. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.mjs.map +1 -0
  309. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/package.json +69 -0
  310. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestBuilder.ts +688 -0
  311. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestClient.ts +447 -0
  312. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestError.ts +41 -0
  313. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestFilterBuilder.ts +2137 -0
  314. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestQueryBuilder.ts +1703 -0
  315. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestTransformBuilder.ts +981 -0
  316. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/constants.ts +2 -0
  317. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/index.ts +34 -0
  318. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/parser.ts +476 -0
  319. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/result.ts +550 -0
  320. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/types.ts +129 -0
  321. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/utils.ts +704 -0
  322. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/common/common.ts +83 -0
  323. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/common/rpc.ts +148 -0
  324. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/feature-flags.ts +17 -0
  325. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/types.ts +161 -0
  326. package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/version.ts +7 -0
  327. package/templates/realtime-agent/node_modules/@supabase/realtime-js/README.md +326 -0
  328. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.d.ts +442 -0
  329. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.d.ts.map +1 -0
  330. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.js +719 -0
  331. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.js.map +1 -0
  332. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.d.ts +275 -0
  333. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.d.ts.map +1 -0
  334. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js +697 -0
  335. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js.map +1 -0
  336. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.d.ts +62 -0
  337. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.d.ts.map +1 -0
  338. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.js +43 -0
  339. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.js.map +1 -0
  340. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.d.ts +6 -0
  341. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.d.ts.map +1 -0
  342. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.js +18 -0
  343. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.js.map +1 -0
  344. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.d.ts +43 -0
  345. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.d.ts.map +1 -0
  346. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.js +43 -0
  347. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.js.map +1 -0
  348. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.d.ts +10 -0
  349. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.d.ts.map +1 -0
  350. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.js +29 -0
  351. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.js.map +1 -0
  352. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.d.ts +33 -0
  353. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.d.ts.map +1 -0
  354. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.js +155 -0
  355. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.js.map +1 -0
  356. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.d.ts +109 -0
  357. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.d.ts.map +1 -0
  358. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.js +241 -0
  359. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.js.map +1 -0
  360. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.d.ts +2 -0
  361. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.d.ts.map +1 -0
  362. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.js +11 -0
  363. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.js.map +1 -0
  364. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.d.ts +82 -0
  365. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.d.ts.map +1 -0
  366. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.js +130 -0
  367. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.js.map +1 -0
  368. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.d.ts +32 -0
  369. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.d.ts.map +1 -0
  370. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.js +103 -0
  371. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.js.map +1 -0
  372. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.d.ts +53 -0
  373. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.d.ts.map +1 -0
  374. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.js +93 -0
  375. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.js.map +1 -0
  376. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.d.ts +38 -0
  377. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.d.ts.map +1 -0
  378. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.js +114 -0
  379. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.js.map +1 -0
  380. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.d.ts +5 -0
  381. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.d.ts.map +1 -0
  382. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.js +3 -0
  383. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.js.map +1 -0
  384. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.d.ts +442 -0
  385. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.d.ts.map +1 -0
  386. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.js +714 -0
  387. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.js.map +1 -0
  388. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.d.ts +275 -0
  389. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.d.ts.map +1 -0
  390. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.js +693 -0
  391. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.js.map +1 -0
  392. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts +62 -0
  393. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts.map +1 -0
  394. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js +38 -0
  395. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js.map +1 -0
  396. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.d.ts +6 -0
  397. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.d.ts.map +1 -0
  398. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.js +6 -0
  399. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.js.map +1 -0
  400. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.d.ts +43 -0
  401. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.d.ts.map +1 -0
  402. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.js +40 -0
  403. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.js.map +1 -0
  404. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.d.ts +10 -0
  405. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.d.ts.map +1 -0
  406. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.js +26 -0
  407. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.js.map +1 -0
  408. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.d.ts +33 -0
  409. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.d.ts.map +1 -0
  410. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.js +152 -0
  411. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.js.map +1 -0
  412. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.d.ts +109 -0
  413. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.d.ts.map +1 -0
  414. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.js +229 -0
  415. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.js.map +1 -0
  416. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.d.ts +2 -0
  417. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.d.ts.map +1 -0
  418. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.js +8 -0
  419. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.js.map +1 -0
  420. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.d.ts +82 -0
  421. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.d.ts.map +1 -0
  422. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js +126 -0
  423. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js.map +1 -0
  424. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.d.ts +32 -0
  425. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.d.ts.map +1 -0
  426. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.js +100 -0
  427. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.js.map +1 -0
  428. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.d.ts +53 -0
  429. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.d.ts.map +1 -0
  430. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.js +90 -0
  431. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.js.map +1 -0
  432. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.d.ts +38 -0
  433. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.d.ts.map +1 -0
  434. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.js +111 -0
  435. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.js.map +1 -0
  436. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.d.ts +5 -0
  437. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.d.ts.map +1 -0
  438. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.js +2 -0
  439. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.js.map +1 -0
  440. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/tsconfig.module.tsbuildinfo +1 -0
  441. package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/tsconfig.tsbuildinfo +1 -0
  442. package/templates/realtime-agent/node_modules/@supabase/realtime-js/package.json +58 -0
  443. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimeChannel.ts +1118 -0
  444. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimeClient.ts +868 -0
  445. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimePresence.ts +71 -0
  446. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/index.ts +53 -0
  447. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/constants.ts +62 -0
  448. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/normalizeChannelError.ts +30 -0
  449. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/serializer.ts +203 -0
  450. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/transformers.ts +270 -0
  451. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/version.ts +7 -0
  452. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/websocket-factory.ts +204 -0
  453. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/channelAdapter.ts +149 -0
  454. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/presenceAdapter.ts +116 -0
  455. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/socketAdapter.ts +168 -0
  456. package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/types.ts +32 -0
  457. package/templates/realtime-agent/node_modules/@supabase/storage-js/README.md +1262 -0
  458. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.cjs +2995 -0
  459. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.cjs.map +1 -0
  460. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.cts +2956 -0
  461. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.cts.map +1 -0
  462. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.mts +2956 -0
  463. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.mts.map +1 -0
  464. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.mjs +2979 -0
  465. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.mjs.map +1 -0
  466. package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/umd/supabase.js +1 -0
  467. package/templates/realtime-agent/node_modules/@supabase/storage-js/package.json +62 -0
  468. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/StorageClient.ts +98 -0
  469. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/index.ts +19 -0
  470. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/BaseApiClient.ts +104 -0
  471. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/errors.ts +160 -0
  472. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/fetch.ts +303 -0
  473. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/headers.ts +43 -0
  474. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/helpers.ts +146 -0
  475. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/constants.ts +4 -0
  476. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/types.ts +654 -0
  477. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/version.ts +7 -0
  478. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/BlobDownloadBuilder.ts +62 -0
  479. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageAnalyticsClient.ts +420 -0
  480. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageBucketApi.ts +414 -0
  481. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageFileApi.ts +1423 -0
  482. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageVectorsClient.ts +644 -0
  483. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StreamDownloadBuilder.ts +39 -0
  484. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorBucketApi.ts +73 -0
  485. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorDataApi.ts +98 -0
  486. package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorIndexApi.ts +90 -0
  487. package/templates/realtime-agent/node_modules/@supabase/supabase-js/README.md +238 -0
  488. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.cjs +89 -0
  489. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.cjs.map +1 -0
  490. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.cts +58 -0
  491. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.cts.map +1 -0
  492. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.mts +58 -0
  493. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.mts.map +1 -0
  494. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.mjs +88 -0
  495. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.mjs.map +1 -0
  496. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.cjs +660 -0
  497. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.cjs.map +1 -0
  498. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.cts +616 -0
  499. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.cts.map +1 -0
  500. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.mts +616 -0
  501. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.mts.map +1 -0
  502. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.mjs +607 -0
  503. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.mjs.map +1 -0
  504. package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/umd/supabase.js +24 -0
  505. package/templates/realtime-agent/node_modules/@supabase/supabase-js/package.json +122 -0
  506. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/SupabaseClient.ts +625 -0
  507. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/cors.ts +84 -0
  508. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/index.ts +106 -0
  509. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/SupabaseAuthClient.ts +8 -0
  510. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/constants.ts +35 -0
  511. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/fetch.ts +36 -0
  512. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/helpers.ts +98 -0
  513. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/rest/types/common/common.ts +93 -0
  514. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/rest/types/common/rpc.ts +158 -0
  515. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/types.ts +196 -0
  516. package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/version.ts +7 -0
  517. package/templates/realtime-agent/node_modules/iceberg-js/LICENSE +21 -0
  518. package/templates/realtime-agent/node_modules/iceberg-js/README.md +439 -0
  519. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.cjs +596 -0
  520. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.cjs.map +1 -0
  521. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.d.cts +547 -0
  522. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.d.ts +547 -0
  523. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.mjs +587 -0
  524. package/templates/realtime-agent/node_modules/iceberg-js/dist/index.mjs.map +1 -0
  525. package/templates/realtime-agent/node_modules/iceberg-js/package.json +77 -0
  526. package/templates/realtime-agent/node_modules/tslib/CopyrightNotice.txt +15 -0
  527. package/templates/realtime-agent/node_modules/tslib/LICENSE.txt +12 -0
  528. package/templates/realtime-agent/node_modules/tslib/README.md +164 -0
  529. package/templates/realtime-agent/node_modules/tslib/SECURITY.md +41 -0
  530. package/templates/realtime-agent/node_modules/tslib/modules/index.d.ts +38 -0
  531. package/templates/realtime-agent/node_modules/tslib/modules/index.js +70 -0
  532. package/templates/realtime-agent/node_modules/tslib/modules/package.json +3 -0
  533. package/templates/realtime-agent/node_modules/tslib/package.json +47 -0
  534. package/templates/realtime-agent/node_modules/tslib/tslib.d.ts +460 -0
  535. package/templates/realtime-agent/node_modules/tslib/tslib.es6.html +1 -0
  536. package/templates/realtime-agent/node_modules/tslib/tslib.es6.js +402 -0
  537. package/templates/realtime-agent/node_modules/tslib/tslib.es6.mjs +401 -0
  538. package/templates/realtime-agent/node_modules/tslib/tslib.html +1 -0
  539. package/templates/realtime-agent/node_modules/tslib/tslib.js +484 -0
  540. package/templates/realtime-agent/package-lock.json +114 -0
  541. package/templates/realtime-agent/package.json +11 -0
  542. package/templates/realtime-agent/src/index.js +152 -0
  543. package/templates/root/AGENT.md +37 -0
  544. package/templates/root/model.md +1 -0
  545. package/templates/root/prompt.md +91 -0
  546. package/templates/root/ralph.sh +47 -0
@@ -0,0 +1,2498 @@
1
+ import { AuthError } from './errors';
2
+ import { Fetch } from './fetch';
3
+ import { EIP1193Provider, EthereumSignInInput, Hex } from './web3/ethereum';
4
+ import type { SolanaSignInInput, SolanaSignInOutput } from './web3/solana';
5
+ import { ServerCredentialCreationOptions, ServerCredentialRequestOptions, WebAuthnApi, WebAuthnError } from './webauthn';
6
+ import type { RegistrationResponseJSON, AuthenticationResponseJSON, ServerCredentialResponse } from './webauthn';
7
+ import { AuthenticationCredential, PublicKeyCredentialCreationOptionsFuture, PublicKeyCredentialRequestOptionsFuture, RegistrationCredential } from './webauthn.dom';
8
+ /** One of the providers supported by GoTrue. Use the `custom:` prefix for custom OIDC providers (e.g. `custom:my-oidc-provider`). */
9
+ export type Provider = 'apple' | 'azure' | 'bitbucket' | 'discord' | 'facebook' | 'figma' | 'github' | 'gitlab' | 'google' | 'kakao' | 'keycloak' | 'linkedin' | 'linkedin_oidc' | 'notion' | 'slack' | 'slack_oidc' | 'spotify' | 'twitch'
10
+ /** Uses OAuth 1.0a */
11
+ | 'twitter'
12
+ /** Uses OAuth 2.0 */
13
+ | 'x' | 'workos' | 'zoom' | 'fly' | `custom:${string}`;
14
+ export type AuthChangeEventMFA = 'MFA_CHALLENGE_VERIFIED';
15
+ export type AuthChangeEvent = 'INITIAL_SESSION' | 'PASSWORD_RECOVERY' | 'SIGNED_IN' | 'SIGNED_OUT' | 'TOKEN_REFRESHED' | 'USER_UPDATED' | AuthChangeEventMFA;
16
+ /**
17
+ * Provide your own global lock implementation instead of the default
18
+ * implementation. The function should acquire a lock for the duration of the
19
+ * `fn` async function, such that no other client instances will be able to
20
+ * hold it at the same time.
21
+ *
22
+ * @experimental
23
+ *
24
+ * @param name Name of the lock to be acquired.
25
+ * @param acquireTimeout If negative, no timeout should occur. If positive it
26
+ * should throw an Error with an `isAcquireTimeout`
27
+ * property set to true if the operation fails to be
28
+ * acquired after this much time (ms).
29
+ * @param fn The operation to execute when the lock is acquired.
30
+ */
31
+ export type LockFunc = <R>(name: string, acquireTimeout: number, fn: () => Promise<R>) => Promise<R>;
32
+ export type GoTrueClientOptions = {
33
+ url?: string;
34
+ headers?: {
35
+ [key: string]: string;
36
+ };
37
+ storageKey?: string;
38
+ /**
39
+ * Set to "true" if you want to automatically detect OAuth grants in the URL and sign in the user.
40
+ * Set to "false" to disable automatic detection.
41
+ * Set to a function to provide custom logic for determining if a URL contains a Supabase auth callback.
42
+ * The function receives the current URL and parsed parameters, and should return true if the URL
43
+ * should be processed as a Supabase auth callback, or false to ignore it.
44
+ *
45
+ * This is useful when your app uses other OAuth providers (e.g., Facebook Login) that also return
46
+ * access_token in the URL fragment, which would otherwise be incorrectly intercepted by Supabase Auth.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * detectSessionInUrl: (url, params) => {
51
+ * // Ignore Facebook OAuth redirects
52
+ * if (url.pathname === '/facebook/redirect') return false
53
+ * // Use default detection for other URLs
54
+ * return Boolean(params.access_token || params.error_description)
55
+ * }
56
+ * ```
57
+ */
58
+ detectSessionInUrl?: boolean | ((url: URL, params: {
59
+ [parameter: string]: string;
60
+ }) => boolean);
61
+ autoRefreshToken?: boolean;
62
+ persistSession?: boolean;
63
+ storage?: SupportedStorage;
64
+ /**
65
+ * Stores the user object in a separate storage location from the rest of the session data. When non-null, `storage` will only store a JSON object containing the access and refresh token and some adjacent metadata, while `userStorage` will only contain the user object under the key `storageKey + '-user'`.
66
+ *
67
+ * When this option is set and cookie storage is used, `getSession()` and other functions that load a session from the cookie store might not return back a user. It's very important to always use `getUser()` to fetch a user object in those scenarios.
68
+ *
69
+ * @experimental
70
+ */
71
+ userStorage?: SupportedStorage;
72
+ fetch?: Fetch;
73
+ flowType?: AuthFlowType;
74
+ debug?: boolean | ((message: string, ...args: any[]) => void);
75
+ /**
76
+ * Provide your own locking mechanism based on the environment. By default,
77
+ * `navigatorLock` (Web Locks API) is used in browser environments when
78
+ * `persistSession` is true. Falls back to an in-process lock for non-browser
79
+ * environments (e.g. React Native).
80
+ *
81
+ * @experimental
82
+ */
83
+ lock?: LockFunc;
84
+ /**
85
+ * Set to "true" if there is a custom authorization header set globally.
86
+ * @experimental
87
+ */
88
+ hasCustomAuthorizationHeader?: boolean;
89
+ /**
90
+ * If there is an error with the query, throwOnError will reject the promise by
91
+ * throwing the error instead of returning it as part of a successful response.
92
+ */
93
+ throwOnError?: boolean;
94
+ /**
95
+ * The maximum time in milliseconds to wait for acquiring a cross-tab synchronization lock.
96
+ *
97
+ * When multiple browser tabs or windows use the auth client simultaneously, they coordinate
98
+ * via the Web Locks API to prevent race conditions during session refresh and other operations.
99
+ * This timeout controls how long to wait before attempting lock recovery.
100
+ *
101
+ * - **Positive value**: Wait up to this many milliseconds. If the lock is still held, attempt
102
+ * automatic recovery by stealing it (the previous holder is evicted, its callback continues
103
+ * to completion without exclusive access). This recovers from orphaned locks caused by
104
+ * React Strict Mode double-mount, storage API hangs, or aborted operations.
105
+ * - **Zero (0)**: Fail immediately if the lock is unavailable; throws `LockAcquireTimeoutError`
106
+ * (check `error.isAcquireTimeout === true`).
107
+ * - **Negative value**: Wait indefinitely — can cause permanent deadlocks if the lock is orphaned.
108
+ *
109
+ * @default 5000
110
+ *
111
+ * @example
112
+ * ```ts
113
+ * const client = createClient(url, key, {
114
+ * auth: {
115
+ * lockAcquireTimeout: 5000, // 5 seconds, then steal orphaned lock
116
+ * },
117
+ * })
118
+ * ```
119
+ */
120
+ lockAcquireTimeout?: number;
121
+ /**
122
+ * If true, skips automatic initialization in constructor. Useful for SSR
123
+ * contexts where initialization timing must be controlled to prevent race
124
+ * conditions with HTTP response generation.
125
+ *
126
+ * @default false
127
+ */
128
+ skipAutoInitialize?: boolean;
129
+ /**
130
+ * Opt-in flags for experimental features. These APIs may change without
131
+ * notice and are disabled by default.
132
+ *
133
+ * @experimental
134
+ */
135
+ experimental?: ExperimentalFeatureFlags;
136
+ };
137
+ export type ExperimentalFeatureFlags = {
138
+ /**
139
+ * Enables passkey support:
140
+ * - `auth.signInWithPasskey()`, `auth.registerPasskey()`
141
+ * - `auth.passkey.*`
142
+ * - `auth.admin.passkey.*`
143
+ *
144
+ * Defaults to `false`. Calling any passkey method while this flag is
145
+ * disabled throws a descriptive error at call time.
146
+ */
147
+ passkey?: boolean;
148
+ };
149
+ declare const WeakPasswordReasons: readonly ["length", "characters", "pwned"];
150
+ export type WeakPasswordReasons = (typeof WeakPasswordReasons)[number];
151
+ export type WeakPassword = {
152
+ reasons: WeakPasswordReasons[];
153
+ message: string;
154
+ };
155
+ /**
156
+ * Resolve mapped types and show the derived keys and their types when hovering in
157
+ * VS Code, instead of just showing the names those mapped types are defined with.
158
+ */
159
+ export type Prettify<T> = T extends Function ? T : {
160
+ [K in keyof T]: T[K];
161
+ };
162
+ /**
163
+ * A stricter version of TypeScript's Omit that only allows omitting keys that actually exist.
164
+ * This prevents typos and ensures type safety at compile time.
165
+ * Unlike regular Omit, this will error if you try to omit a non-existent key.
166
+ */
167
+ export type StrictOmit<T, K extends keyof T> = Omit<T, K>;
168
+ /**
169
+ * a shared result type that encapsulates errors instead of throwing them, allows you to optionally specify the ErrorType
170
+ */
171
+ export type RequestResult<T, ErrorType extends Error = AuthError> = {
172
+ data: T;
173
+ error: null;
174
+ } | {
175
+ data: null;
176
+ error: Error extends AuthError ? AuthError : ErrorType;
177
+ };
178
+ /**
179
+ * similar to RequestResult except it allows you to destructure the possible shape of the success response
180
+ * {@see RequestResult}
181
+ */
182
+ export type RequestResultSafeDestructure<T> = {
183
+ data: T;
184
+ error: null;
185
+ } | {
186
+ data: T extends object ? {
187
+ [K in keyof T]: null;
188
+ } : null;
189
+ error: AuthError;
190
+ };
191
+ export type AuthResponse = RequestResultSafeDestructure<{
192
+ user: User | null;
193
+ session: Session | null;
194
+ }>;
195
+ export type AuthResponsePassword = RequestResultSafeDestructure<{
196
+ user: User | null;
197
+ session: Session | null;
198
+ weak_password?: WeakPassword | null;
199
+ }>;
200
+ /**
201
+ * AuthOtpResponse is returned when OTP is used.
202
+ *
203
+ * {@see AuthResponse}
204
+ */
205
+ export type AuthOtpResponse = RequestResultSafeDestructure<{
206
+ user: null;
207
+ session: null;
208
+ messageId?: string | null;
209
+ }>;
210
+ export type AuthTokenResponse = RequestResultSafeDestructure<{
211
+ user: User;
212
+ session: Session;
213
+ }>;
214
+ export type AuthTokenResponsePassword = RequestResultSafeDestructure<{
215
+ user: User;
216
+ session: Session;
217
+ weakPassword?: WeakPassword;
218
+ }>;
219
+ export type OAuthResponse = {
220
+ data: {
221
+ provider: Provider;
222
+ url: string;
223
+ };
224
+ error: null;
225
+ } | {
226
+ data: {
227
+ provider: Provider;
228
+ url: null;
229
+ };
230
+ error: AuthError;
231
+ };
232
+ export type SSOResponse = RequestResult<{
233
+ /**
234
+ * URL to open in a browser which will complete the sign-in flow by
235
+ * taking the user to the identity provider's authentication flow.
236
+ *
237
+ * On browsers you can set the URL to `window.location.href` to take
238
+ * the user to the authentication flow.
239
+ */
240
+ url: string;
241
+ }>;
242
+ export type UserResponse = RequestResultSafeDestructure<{
243
+ user: User;
244
+ }>;
245
+ export interface Session {
246
+ /**
247
+ * The oauth provider token. If present, this can be used to make external API requests to the oauth provider used.
248
+ */
249
+ provider_token?: string | null;
250
+ /**
251
+ * The oauth provider refresh token. If present, this can be used to refresh the provider_token via the oauth provider's API.
252
+ * Not all oauth providers return a provider refresh token. If the provider_refresh_token is missing, please refer to the oauth provider's documentation for information on how to obtain the provider refresh token.
253
+ */
254
+ provider_refresh_token?: string | null;
255
+ /**
256
+ * The access token jwt. It is recommended to set the JWT_EXPIRY to a shorter expiry value.
257
+ */
258
+ access_token: string;
259
+ /**
260
+ * A one-time used refresh token that never expires.
261
+ */
262
+ refresh_token: string;
263
+ /**
264
+ * The number of seconds until the token expires (since it was issued). Returned when a login is confirmed.
265
+ */
266
+ expires_in: number;
267
+ /**
268
+ * A timestamp of when the token will expire. Returned when a login is confirmed.
269
+ */
270
+ expires_at?: number;
271
+ token_type: 'bearer';
272
+ /**
273
+ * When using a separate user storage, accessing properties of this object will throw an error.
274
+ */
275
+ user: User;
276
+ }
277
+ declare const AMRMethods: readonly ["password", "otp", "oauth", "totp", "mfa/totp", "mfa/phone", "mfa/webauthn", "anonymous", "sso/saml", "magiclink", "web3", "oauth_provider/authorization_code"];
278
+ export type AMRMethod = (typeof AMRMethods)[number] | (string & {});
279
+ /**
280
+ * An authentication method reference (AMR) entry.
281
+ *
282
+ * An entry designates what method was used by the user to verify their
283
+ * identity and at what time.
284
+ *
285
+ * Note: Custom access token hooks can return AMR claims as either:
286
+ * - An array of AMREntry objects (detailed format with timestamps)
287
+ * - An array of strings (RFC-8176 compliant format)
288
+ *
289
+ * @see {@link GoTrueMFAApi#getAuthenticatorAssuranceLevel}.
290
+ */
291
+ export interface AMREntry {
292
+ /** Authentication method name. */
293
+ method: AMRMethod;
294
+ /**
295
+ * Timestamp when the method was successfully used. Represents number of
296
+ * seconds since 1st January 1970 (UNIX epoch) in UTC.
297
+ */
298
+ timestamp: number;
299
+ }
300
+ export interface UserIdentity {
301
+ id: string;
302
+ user_id: string;
303
+ identity_data?: {
304
+ [key: string]: any;
305
+ };
306
+ identity_id: string;
307
+ provider: string;
308
+ created_at?: string;
309
+ last_sign_in_at?: string;
310
+ updated_at?: string;
311
+ }
312
+ declare const FactorTypes: readonly ["totp", "phone", "webauthn"];
313
+ /**
314
+ * Type of factor. `totp` and `phone` supported with this version
315
+ */
316
+ export type FactorType = (typeof FactorTypes)[number];
317
+ declare const FactorVerificationStatuses: readonly ["verified", "unverified"];
318
+ /**
319
+ * The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`
320
+ */
321
+ type FactorVerificationStatus = (typeof FactorVerificationStatuses)[number];
322
+ /**
323
+ * A MFA factor.
324
+ *
325
+ * @see {@link GoTrueMFAApi#enroll}
326
+ * @see {@link GoTrueMFAApi#listFactors}
327
+ * @see {@link GoTrueMFAAdminApi#listFactors}
328
+ */
329
+ export type Factor<Type extends FactorType = FactorType, Status extends FactorVerificationStatus = (typeof FactorVerificationStatuses)[number]> = {
330
+ /** ID of the factor. */
331
+ id: string;
332
+ /** Friendly name of the factor, useful to disambiguate between multiple factors. */
333
+ friendly_name?: string;
334
+ /**
335
+ * Type of factor. `totp` and `phone` supported with this version
336
+ */
337
+ factor_type: Type;
338
+ /**
339
+ * The verification status of the factor, default is `unverified` after `.enroll()`, then `verified` after the user verifies it with `.verify()`
340
+ */
341
+ status: Status;
342
+ created_at: string;
343
+ updated_at: string;
344
+ last_challenged_at?: string;
345
+ };
346
+ export interface UserAppMetadata {
347
+ /**
348
+ * The first provider that the user used to sign up with.
349
+ */
350
+ provider?: string;
351
+ /**
352
+ * A list of all providers that the user has linked to their account.
353
+ */
354
+ providers?: string[];
355
+ [key: string]: any;
356
+ }
357
+ export interface UserMetadata {
358
+ [key: string]: any;
359
+ }
360
+ export interface User {
361
+ id: string;
362
+ app_metadata: UserAppMetadata;
363
+ user_metadata: UserMetadata;
364
+ aud: string;
365
+ confirmation_sent_at?: string;
366
+ recovery_sent_at?: string;
367
+ email_change_sent_at?: string;
368
+ new_email?: string;
369
+ new_phone?: string;
370
+ invited_at?: string;
371
+ action_link?: string;
372
+ email?: string;
373
+ phone?: string;
374
+ created_at: string;
375
+ confirmed_at?: string;
376
+ email_confirmed_at?: string;
377
+ phone_confirmed_at?: string;
378
+ last_sign_in_at?: string;
379
+ role?: string;
380
+ updated_at?: string;
381
+ identities?: UserIdentity[];
382
+ is_anonymous?: boolean;
383
+ is_sso_user?: boolean;
384
+ factors?: (Factor<FactorType, 'verified'> | Factor<FactorType, 'unverified'>)[];
385
+ deleted_at?: string;
386
+ banned_until?: string;
387
+ }
388
+ export interface UserAttributes {
389
+ /**
390
+ * The user's current password
391
+ *
392
+ * This is only ever present when the user is resetting
393
+ * their password and GOTRUE_SECURITY_UPDATE_PASSWORD_REQUIRE_CURRENT_PASSWORD is true.
394
+ *
395
+ */
396
+ current_password?: string;
397
+ /**
398
+ * The user's email.
399
+ */
400
+ email?: string;
401
+ /**
402
+ * The user's phone.
403
+ */
404
+ phone?: string;
405
+ /**
406
+ * The user's password.
407
+ */
408
+ password?: string;
409
+ /**
410
+ * The nonce sent for reauthentication if the user's password is to be updated.
411
+ *
412
+ * Call reauthenticate() to obtain the nonce first.
413
+ */
414
+ nonce?: string;
415
+ /**
416
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
417
+ *
418
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
419
+ *
420
+ */
421
+ data?: object;
422
+ }
423
+ export interface AdminUserAttributes extends Omit<UserAttributes, 'data'> {
424
+ /**
425
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
426
+ *
427
+ *
428
+ * The `user_metadata` should be a JSON object that includes user-specific info, such as their first and last name.
429
+ *
430
+ * Note: When using the GoTrueAdminApi and wanting to modify a user's metadata,
431
+ * this attribute is used instead of UserAttributes data.
432
+ *
433
+ */
434
+ user_metadata?: object;
435
+ /**
436
+ * A custom data object to store the user's application specific metadata. This maps to the `auth.users.app_metadata` column.
437
+ *
438
+ * Only a service role can modify.
439
+ *
440
+ * The `app_metadata` should be a JSON object that includes app-specific info, such as identity providers, roles, and other
441
+ * access control information.
442
+ */
443
+ app_metadata?: object;
444
+ /**
445
+ * Sets the user's email as confirmed when true, or unconfirmed when false.
446
+ *
447
+ * Only a service role can modify.
448
+ */
449
+ email_confirm?: boolean;
450
+ /**
451
+ * Sets the user's phone as confirmed when true, or unconfirmed when false.
452
+ *
453
+ * Only a service role can modify.
454
+ */
455
+ phone_confirm?: boolean;
456
+ /**
457
+ * Determines how long a user is banned for.
458
+ *
459
+ * The format for the ban duration follows a strict sequence of decimal numbers with a unit suffix.
460
+ * Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
461
+ *
462
+ * For example, some possible durations include: '300ms', '2h45m'.
463
+ *
464
+ * Setting the ban duration to 'none' lifts the ban on the user.
465
+ */
466
+ ban_duration?: string | 'none';
467
+ /**
468
+ * The `role` claim set in the user's access token JWT.
469
+ *
470
+ * When a user signs up, this role is set to `authenticated` by default. You should only modify the `role` if you need to provision several levels of admin access that have different permissions on individual columns in your database.
471
+ *
472
+ * Setting this role to `service_role` is not recommended as it grants the user admin privileges.
473
+ */
474
+ role?: string;
475
+ /**
476
+ * The `password_hash` for the user's password.
477
+ *
478
+ * Allows you to specify a password hash for the user. This is useful for migrating a user's password hash from another service.
479
+ *
480
+ * Supports bcrypt, scrypt (firebase), and argon2 password hashes.
481
+ */
482
+ password_hash?: string;
483
+ /**
484
+ * The `id` for the user.
485
+ *
486
+ * Allows you to overwrite the default `id` set for the user.
487
+ */
488
+ id?: string;
489
+ }
490
+ export interface Subscription {
491
+ /**
492
+ * A unique identifier for this subscription, set by the client.
493
+ * This is an internal identifier used for managing callbacks and should not be
494
+ * relied upon by application code. Use the unsubscribe() method to remove listeners.
495
+ */
496
+ id: string | symbol;
497
+ /**
498
+ * The function to call every time there is an event. eg: (eventName) => {}
499
+ */
500
+ callback: (event: AuthChangeEvent, session: Session | null) => void;
501
+ /**
502
+ * Call this to remove the listener.
503
+ */
504
+ unsubscribe: () => void;
505
+ }
506
+ export type SignInAnonymouslyCredentials = {
507
+ options?: {
508
+ /**
509
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
510
+ *
511
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
512
+ */
513
+ data?: object;
514
+ /** Verification token received when the user completes the captcha on the site. */
515
+ captchaToken?: string;
516
+ };
517
+ };
518
+ export type SignUpWithPasswordCredentials = PasswordCredentialsBase & {
519
+ options?: {
520
+ emailRedirectTo?: string;
521
+ data?: object;
522
+ captchaToken?: string;
523
+ channel?: 'sms' | 'whatsapp';
524
+ };
525
+ };
526
+ type PasswordCredentialsBase = {
527
+ email: string;
528
+ password: string;
529
+ } | {
530
+ phone: string;
531
+ password: string;
532
+ };
533
+ export type SignInWithPasswordCredentials = PasswordCredentialsBase & {
534
+ options?: {
535
+ captchaToken?: string;
536
+ };
537
+ };
538
+ export type SignInWithPasswordlessCredentials = {
539
+ /** The user's email address. */
540
+ email: string;
541
+ options?: {
542
+ /** The redirect url embedded in the email link */
543
+ emailRedirectTo?: string;
544
+ /** If set to false, this method will not create a new user. Defaults to true. */
545
+ shouldCreateUser?: boolean;
546
+ /**
547
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
548
+ *
549
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
550
+ */
551
+ data?: object;
552
+ /** Verification token received when the user completes the captcha on the site. */
553
+ captchaToken?: string;
554
+ };
555
+ } | {
556
+ /** The user's phone number. */
557
+ phone: string;
558
+ options?: {
559
+ /** If set to false, this method will not create a new user. Defaults to true. */
560
+ shouldCreateUser?: boolean;
561
+ /**
562
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
563
+ *
564
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
565
+ */
566
+ data?: object;
567
+ /** Verification token received when the user completes the captcha on the site. */
568
+ captchaToken?: string;
569
+ /** Messaging channel to use (e.g. whatsapp or sms) */
570
+ channel?: 'sms' | 'whatsapp';
571
+ };
572
+ };
573
+ export type AuthFlowType = 'implicit' | 'pkce' | (string & {});
574
+ export type SignInWithOAuthCredentials = {
575
+ /** One of the providers supported by GoTrue. */
576
+ provider: Provider;
577
+ options?: {
578
+ /** A URL to send the user to after they are confirmed. */
579
+ redirectTo?: string;
580
+ /** A space-separated list of scopes granted to the OAuth application. */
581
+ scopes?: string;
582
+ /** An object of query params */
583
+ queryParams?: {
584
+ [key: string]: string;
585
+ };
586
+ /** If set to true does not immediately redirect the current browser context to visit the OAuth authorization page for the provider. */
587
+ skipBrowserRedirect?: boolean;
588
+ };
589
+ };
590
+ export type SignInWithIdTokenCredentials = {
591
+ /** Provider name or OIDC `iss` value identifying which provider should be used to verify the provided token. Supported names: `google`, `apple`, `azure`, `facebook`, `kakao`. Use the `custom:` prefix for custom OIDC providers (e.g. `custom:my-oidc-provider`). */
592
+ provider: 'google' | 'apple' | 'azure' | 'facebook' | 'kakao' | `custom:${string}` | (string & {});
593
+ /** OIDC ID token issued by the specified provider. The `iss` claim in the ID token must match the supplied provider. Some ID tokens contain an `at_hash` which require that you provide an `access_token` value to be accepted properly. If the token contains a `nonce` claim you must supply the nonce used to obtain the ID token. */
594
+ token: string;
595
+ /** If the ID token contains an `at_hash` claim, then the hash of this value is compared to the value in the ID token. */
596
+ access_token?: string;
597
+ /** If the ID token contains a `nonce` claim, then the hash of this value is compared to the value in the ID token. */
598
+ nonce?: string;
599
+ options?: {
600
+ /** Verification token received when the user completes the captcha on the site. */
601
+ captchaToken?: string;
602
+ };
603
+ };
604
+ export type SolanaWallet = {
605
+ signIn?: (...inputs: SolanaSignInInput[]) => Promise<SolanaSignInOutput | SolanaSignInOutput[]>;
606
+ publicKey?: {
607
+ toBase58: () => string;
608
+ } | null;
609
+ signMessage?: (message: Uint8Array, encoding?: 'utf8' | string) => Promise<Uint8Array> | undefined;
610
+ };
611
+ export type SolanaWeb3Credentials = {
612
+ chain: 'solana';
613
+ /** Wallet interface to use. If not specified will default to `window.solana`. */
614
+ wallet?: SolanaWallet;
615
+ /** Optional statement to include in the Sign in with Solana message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!** */
616
+ statement?: string;
617
+ options?: {
618
+ /** URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page. */
619
+ url?: string;
620
+ /** Verification token received when the user completes the captcha on the site. */
621
+ captchaToken?: string;
622
+ signInWithSolana?: Partial<Omit<SolanaSignInInput, 'version' | 'chain' | 'domain' | 'uri' | 'statement'>>;
623
+ };
624
+ } | {
625
+ chain: 'solana';
626
+ /** Sign in with Solana compatible message. Must include `Issued At`, `URI` and `Version`. */
627
+ message: string;
628
+ /** Ed25519 signature of the message. */
629
+ signature: Uint8Array;
630
+ options?: {
631
+ /** Verification token received when the user completes the captcha on the site. */
632
+ captchaToken?: string;
633
+ };
634
+ };
635
+ export type EthereumWallet = EIP1193Provider;
636
+ export type EthereumWeb3Credentials = {
637
+ chain: 'ethereum';
638
+ /** Wallet interface to use. If not specified will default to `window.ethereum`. */
639
+ wallet?: EthereumWallet;
640
+ /** Optional statement to include in the Sign in with Ethereum message. Must not include new line characters. Most wallets like Phantom **require specifying a statement!** */
641
+ statement?: string;
642
+ options?: {
643
+ /** URL to use with the wallet interface. Some wallets do not allow signing a message for URLs different from the current page. */
644
+ url?: string;
645
+ /** Verification token received when the user completes the captcha on the site. */
646
+ captchaToken?: string;
647
+ signInWithEthereum?: Partial<Omit<EthereumSignInInput, 'version' | 'domain' | 'uri' | 'statement'>>;
648
+ };
649
+ } | {
650
+ chain: 'ethereum';
651
+ /** Sign in with Ethereum compatible message. Must include `Issued At`, `URI` and `Version`. */
652
+ message: string;
653
+ /** Ethereum curve (secp256k1) signature of the message. */
654
+ signature: Hex;
655
+ options?: {
656
+ /** Verification token received when the user completes the captcha on the site. */
657
+ captchaToken?: string;
658
+ };
659
+ };
660
+ export type Web3Credentials = SolanaWeb3Credentials | EthereumWeb3Credentials;
661
+ export type VerifyOtpParams = VerifyMobileOtpParams | VerifyEmailOtpParams | VerifyTokenHashParams;
662
+ export interface VerifyMobileOtpParams {
663
+ /** The user's phone number. */
664
+ phone: string;
665
+ /** The otp sent to the user's phone number. */
666
+ token: string;
667
+ /** The user's verification type. */
668
+ type: MobileOtpType;
669
+ options?: {
670
+ /** A URL to send the user to after they are confirmed. */
671
+ redirectTo?: string;
672
+ /**
673
+ * Verification token received when the user completes the captcha on the site.
674
+ *
675
+ * @deprecated
676
+ */
677
+ captchaToken?: string;
678
+ };
679
+ }
680
+ export interface VerifyEmailOtpParams {
681
+ /** The user's email address. */
682
+ email: string;
683
+ /** The otp sent to the user's email address. */
684
+ token: string;
685
+ /** The user's verification type. */
686
+ type: EmailOtpType;
687
+ options?: {
688
+ /** A URL to send the user to after they are confirmed. */
689
+ redirectTo?: string;
690
+ /** Verification token received when the user completes the captcha on the site.
691
+ *
692
+ * @deprecated
693
+ */
694
+ captchaToken?: string;
695
+ };
696
+ }
697
+ export interface VerifyTokenHashParams {
698
+ /** The token hash used in an email link */
699
+ token_hash: string;
700
+ /** The user's verification type. */
701
+ type: EmailOtpType;
702
+ }
703
+ export type MobileOtpType = 'sms' | 'phone_change' | (string & {});
704
+ export type EmailOtpType = 'signup' | 'invite' | 'magiclink' | 'recovery' | 'email_change' | 'email' | (string & {});
705
+ export type ResendParams = {
706
+ type: Extract<EmailOtpType, 'signup' | 'email_change'>;
707
+ email: string;
708
+ options?: {
709
+ /** A URL to send the user to after they have signed-in. */
710
+ emailRedirectTo?: string;
711
+ /** Verification token received when the user completes the captcha on the site. */
712
+ captchaToken?: string;
713
+ };
714
+ } | {
715
+ type: Extract<MobileOtpType, 'sms' | 'phone_change'>;
716
+ phone: string;
717
+ options?: {
718
+ /** Verification token received when the user completes the captcha on the site. */
719
+ captchaToken?: string;
720
+ };
721
+ };
722
+ export type SignInWithSSO = {
723
+ /** UUID of the SSO provider to invoke single-sign on to. */
724
+ providerId: string;
725
+ options?: {
726
+ /** A URL to send the user to after they have signed-in. */
727
+ redirectTo?: string;
728
+ /** Verification token received when the user completes the captcha on the site. */
729
+ captchaToken?: string;
730
+ /**
731
+ * If set to true, the redirect will not happen on the client side.
732
+ * This parameter is used when you wish to handle the redirect yourself.
733
+ * Defaults to false.
734
+ */
735
+ skipBrowserRedirect?: boolean;
736
+ };
737
+ } | {
738
+ /** Domain name of the organization for which to invoke single-sign on. */
739
+ domain: string;
740
+ options?: {
741
+ /** A URL to send the user to after they have signed-in. */
742
+ redirectTo?: string;
743
+ /** Verification token received when the user completes the captcha on the site. */
744
+ captchaToken?: string;
745
+ /**
746
+ * If set to true, the redirect will not happen on the client side.
747
+ * This parameter is used when you wish to handle the redirect yourself.
748
+ * Defaults to false.
749
+ */
750
+ skipBrowserRedirect?: boolean;
751
+ };
752
+ };
753
+ export type GenerateSignupLinkParams = {
754
+ type: 'signup';
755
+ email: string;
756
+ password: string;
757
+ options?: Pick<GenerateLinkOptions, 'data' | 'redirectTo'>;
758
+ };
759
+ export type GenerateInviteOrMagiclinkParams = {
760
+ type: 'invite' | 'magiclink';
761
+ /** The user's email */
762
+ email: string;
763
+ options?: Pick<GenerateLinkOptions, 'data' | 'redirectTo'>;
764
+ };
765
+ export type GenerateRecoveryLinkParams = {
766
+ type: 'recovery';
767
+ /** The user's email */
768
+ email: string;
769
+ options?: Pick<GenerateLinkOptions, 'redirectTo'>;
770
+ };
771
+ export type GenerateEmailChangeLinkParams = {
772
+ type: 'email_change_current' | 'email_change_new';
773
+ /** The user's email */
774
+ email: string;
775
+ /**
776
+ * The user's new email. Only required if type is 'email_change_current' or 'email_change_new'.
777
+ */
778
+ newEmail: string;
779
+ options?: Pick<GenerateLinkOptions, 'redirectTo'>;
780
+ };
781
+ export interface GenerateLinkOptions {
782
+ /**
783
+ * A custom data object to store the user's metadata. This maps to the `auth.users.raw_user_meta_data` column.
784
+ *
785
+ * The `data` should be a JSON object that includes user-specific info, such as their first and last name.
786
+ */
787
+ data?: object;
788
+ /** The URL which will be appended to the email link generated. */
789
+ redirectTo?: string;
790
+ }
791
+ export type GenerateLinkParams = GenerateSignupLinkParams | GenerateInviteOrMagiclinkParams | GenerateRecoveryLinkParams | GenerateEmailChangeLinkParams;
792
+ export type GenerateLinkResponse = RequestResultSafeDestructure<{
793
+ properties: GenerateLinkProperties;
794
+ user: User;
795
+ }>;
796
+ /** The properties related to the email link generated */
797
+ export type GenerateLinkProperties = {
798
+ /**
799
+ * The email link to send to the user.
800
+ * The action_link follows the following format: auth/v1/verify?type={verification_type}&token={hashed_token}&redirect_to={redirect_to}
801
+ * */
802
+ action_link: string;
803
+ /**
804
+ * The raw email OTP.
805
+ * You should send this in the email if you want your users to verify using an OTP instead of the action link.
806
+ * */
807
+ email_otp: string;
808
+ /**
809
+ * The hashed token appended to the action link.
810
+ * */
811
+ hashed_token: string;
812
+ /** The URL appended to the action link. */
813
+ redirect_to: string;
814
+ /** The verification type that the email link is associated to. */
815
+ verification_type: GenerateLinkType;
816
+ };
817
+ export type GenerateLinkType = 'signup' | 'invite' | 'magiclink' | 'recovery' | 'email_change_current' | 'email_change_new';
818
+ export type MFAEnrollParams = MFAEnrollTOTPParams | MFAEnrollPhoneParams | MFAEnrollWebauthnParams;
819
+ export type MFAUnenrollParams = {
820
+ /** ID of the factor being unenrolled. */
821
+ factorId: string;
822
+ };
823
+ type MFAVerifyParamsBase = {
824
+ /** ID of the factor being verified. Returned in enroll(). */
825
+ factorId: string;
826
+ /** ID of the challenge being verified. Returned in challenge(). */
827
+ challengeId: string;
828
+ };
829
+ type MFAVerifyTOTPParamFields = {
830
+ /** Verification code provided by the user. */
831
+ code: string;
832
+ };
833
+ export type MFAVerifyTOTPParams = MFAVerifyParamsBase & MFAVerifyTOTPParamFields;
834
+ type MFAVerifyPhoneParamFields = MFAVerifyTOTPParamFields;
835
+ export type MFAVerifyPhoneParams = MFAVerifyParamsBase & MFAVerifyPhoneParamFields;
836
+ type MFAVerifyWebauthnParamFieldsBase = {
837
+ /** Relying party ID */
838
+ rpId: string;
839
+ /** Relying party origins */
840
+ rpOrigins?: string[];
841
+ };
842
+ type MFAVerifyWebauthnCredentialParamFields<T extends 'create' | 'request' = 'create' | 'request'> = {
843
+ /** Operation type */
844
+ type: T;
845
+ /** Creation response from the authenticator (for enrollment/unverified factors) */
846
+ credential_response: T extends 'create' ? RegistrationCredential : AuthenticationCredential;
847
+ };
848
+ /**
849
+ * WebAuthn-specific fields for MFA verification.
850
+ * Supports both credential creation (registration) and request (authentication) flows.
851
+ * @template T - Type of WebAuthn operation: 'create' for registration, 'request' for authentication
852
+ */
853
+ export type MFAVerifyWebauthnParamFields<T extends 'create' | 'request' = 'create' | 'request'> = {
854
+ webauthn: MFAVerifyWebauthnParamFieldsBase & MFAVerifyWebauthnCredentialParamFields<T>;
855
+ };
856
+ /**
857
+ * Parameters for WebAuthn MFA verification.
858
+ * Used to verify WebAuthn credentials after challenge.
859
+ * @template T - Type of WebAuthn operation: 'create' for registration, 'request' for authentication
860
+ * @see {@link https://w3c.github.io/webauthn/#sctn-verifying-assertion W3C WebAuthn Spec - Verifying an Authentication Assertion}
861
+ */
862
+ export type MFAVerifyWebauthnParams<T extends 'create' | 'request' = 'create' | 'request'> = MFAVerifyParamsBase & MFAVerifyWebauthnParamFields<T>;
863
+ export type MFAVerifyParams = MFAVerifyTOTPParams | MFAVerifyPhoneParams | MFAVerifyWebauthnParams;
864
+ type MFAChallengeParamsBase = {
865
+ /** ID of the factor to be challenged. Returned in enroll(). */
866
+ factorId: string;
867
+ };
868
+ declare const MFATOTPChannels: readonly ["sms", "whatsapp"];
869
+ export type MFATOTPChannel = (typeof MFATOTPChannels)[number];
870
+ export type MFAChallengeTOTPParams = MFAChallengeParamsBase;
871
+ type MFAChallengePhoneParamFields<Channel extends MFATOTPChannel = MFATOTPChannel> = {
872
+ /** Messaging channel to use (e.g. whatsapp or sms). Only relevant for phone factors */
873
+ channel: Channel;
874
+ };
875
+ export type MFAChallengePhoneParams = MFAChallengeParamsBase & MFAChallengePhoneParamFields;
876
+ /** WebAuthn parameters for WebAuthn factor challenge */
877
+ type MFAChallengeWebauthnParamFields = {
878
+ webauthn: {
879
+ /** Relying party ID */
880
+ rpId: string;
881
+ /** Relying party origins*/
882
+ rpOrigins?: string[];
883
+ };
884
+ };
885
+ /**
886
+ * Parameters for initiating a WebAuthn MFA challenge.
887
+ * Includes Relying Party information needed for WebAuthn ceremonies.
888
+ * @see {@link https://w3c.github.io/webauthn/#sctn-rp-operations W3C WebAuthn Spec - Relying Party Operations}
889
+ */
890
+ export type MFAChallengeWebauthnParams = MFAChallengeParamsBase & MFAChallengeWebauthnParamFields;
891
+ export type MFAChallengeParams = MFAChallengeTOTPParams | MFAChallengePhoneParams | MFAChallengeWebauthnParams;
892
+ type MFAChallengeAndVerifyParamsBase = Omit<MFAVerifyParamsBase, 'challengeId'>;
893
+ type MFAChallengeAndVerifyTOTPParamFields = MFAVerifyTOTPParamFields;
894
+ type MFAChallengeAndVerifyTOTPParams = MFAChallengeAndVerifyParamsBase & MFAChallengeAndVerifyTOTPParamFields;
895
+ export type MFAChallengeAndVerifyParams = MFAChallengeAndVerifyTOTPParams;
896
+ /**
897
+ * Data returned after successful MFA verification.
898
+ * Contains new session tokens and updated user information.
899
+ */
900
+ export type AuthMFAVerifyResponseData = {
901
+ /** New access token (JWT) after successful verification. */
902
+ access_token: string;
903
+ /** Type of token, always `bearer`. */
904
+ token_type: 'bearer';
905
+ /** Number of seconds in which the access token will expire. */
906
+ expires_in: number;
907
+ /** Refresh token you can use to obtain new access tokens when expired. */
908
+ refresh_token: string;
909
+ /** Updated user profile. */
910
+ user: User;
911
+ };
912
+ /**
913
+ * Response type for MFA verification operations.
914
+ * Returns session tokens on successful verification.
915
+ */
916
+ export type AuthMFAVerifyResponse = RequestResult<AuthMFAVerifyResponseData>;
917
+ export type AuthMFAEnrollResponse = AuthMFAEnrollTOTPResponse | AuthMFAEnrollPhoneResponse | AuthMFAEnrollWebauthnResponse;
918
+ export type AuthMFAUnenrollResponse = RequestResult<{
919
+ /** ID of the factor that was successfully unenrolled. */
920
+ id: string;
921
+ }>;
922
+ type AuthMFAChallengeResponseBase<T extends FactorType> = {
923
+ /** ID of the newly created challenge. */
924
+ id: string;
925
+ /** Factor Type which generated the challenge */
926
+ type: T;
927
+ /** Timestamp in UNIX seconds when this challenge will no longer be usable. */
928
+ expires_at: number;
929
+ };
930
+ type AuthMFAChallengeTOTPResponseFields = {};
931
+ export type AuthMFAChallengeTOTPResponse = RequestResult<AuthMFAChallengeResponseBase<'totp'> & AuthMFAChallengeTOTPResponseFields>;
932
+ type AuthMFAChallengePhoneResponseFields = {};
933
+ export type AuthMFAChallengePhoneResponse = RequestResult<AuthMFAChallengeResponseBase<'phone'> & AuthMFAChallengePhoneResponseFields>;
934
+ type AuthMFAChallengeWebauthnResponseFields = {
935
+ webauthn: {
936
+ type: 'create';
937
+ credential_options: {
938
+ publicKey: PublicKeyCredentialCreationOptionsFuture;
939
+ };
940
+ } | {
941
+ type: 'request';
942
+ credential_options: {
943
+ publicKey: PublicKeyCredentialRequestOptionsFuture;
944
+ };
945
+ };
946
+ };
947
+ /**
948
+ * Response type for WebAuthn MFA challenge.
949
+ * Contains credential creation or request options from the server.
950
+ * @see {@link https://w3c.github.io/webauthn/#sctn-credential-creation W3C WebAuthn Spec - Credential Creation}
951
+ */
952
+ export type AuthMFAChallengeWebauthnResponse = RequestResult<AuthMFAChallengeResponseBase<'webauthn'> & AuthMFAChallengeWebauthnResponseFields>;
953
+ type AuthMFAChallengeWebauthnResponseFieldsJSON = {
954
+ webauthn: {
955
+ type: 'create';
956
+ credential_options: {
957
+ publicKey: ServerCredentialCreationOptions;
958
+ };
959
+ } | {
960
+ type: 'request';
961
+ credential_options: {
962
+ publicKey: ServerCredentialRequestOptions;
963
+ };
964
+ };
965
+ };
966
+ /**
967
+ * JSON-serializable version of WebAuthn challenge response.
968
+ * Used for server communication with base64url-encoded binary fields.
969
+ */
970
+ export type AuthMFAChallengeWebauthnResponseDataJSON = AuthMFAChallengeResponseBase<'webauthn'> & AuthMFAChallengeWebauthnResponseFieldsJSON;
971
+ /**
972
+ * Server response type for WebAuthn MFA challenge.
973
+ * Contains JSON-formatted WebAuthn options ready for browser API.
974
+ */
975
+ export type AuthMFAChallengeWebauthnServerResponse = RequestResult<AuthMFAChallengeWebauthnResponseDataJSON>;
976
+ export type AuthMFAChallengeResponse = AuthMFAChallengeTOTPResponse | AuthMFAChallengePhoneResponse | AuthMFAChallengeWebauthnResponse;
977
+ /** response of ListFactors, which should contain all the types of factors that are available, this ensures we always include all */
978
+ export type AuthMFAListFactorsResponse<T extends typeof FactorTypes = typeof FactorTypes> = RequestResult<{
979
+ /** All available factors (verified and unverified). */
980
+ all: Factor[];
981
+ } & {
982
+ [K in T[number]]: Factor<K, 'verified'>[];
983
+ }>;
984
+ export type AuthenticatorAssuranceLevels = 'aal1' | 'aal2' | (string & {});
985
+ export type AuthMFAGetAuthenticatorAssuranceLevelResponse = RequestResult<{
986
+ /** Current AAL level of the session. */
987
+ currentLevel: AuthenticatorAssuranceLevels | null;
988
+ /**
989
+ * Next possible AAL level for the session. If the next level is higher
990
+ * than the current one, the user should go through MFA.
991
+ *
992
+ * @see {@link GoTrueMFAApi#challenge}
993
+ */
994
+ nextLevel: AuthenticatorAssuranceLevels | null;
995
+ /**
996
+ * A list of all authentication methods attached to this session. Use
997
+ * the information here to detect the last time a user verified a
998
+ * factor, for example if implementing a step-up scenario.
999
+ *
1000
+ * Supports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]).
1001
+ * - String format: ['password', 'otp'] - RFC-8176 compliant
1002
+ * - Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps
1003
+ */
1004
+ currentAuthenticationMethods: AMREntry[] | string[];
1005
+ }>;
1006
+ /**
1007
+ * Contains the full multi-factor authentication API.
1008
+ *
1009
+ */
1010
+ export interface GoTrueMFAApi {
1011
+ /**
1012
+ * Starts the enrollment process for a new Multi-Factor Authentication (MFA)
1013
+ * factor. This method creates a new `unverified` factor.
1014
+ * To verify a factor, present the QR code or secret to the user and ask them to add it to their
1015
+ * authenticator app.
1016
+ * The user has to enter the code from their authenticator app to verify it.
1017
+ *
1018
+ * Upon verifying a factor, all other sessions are logged out and the current session's authenticator level is promoted to `aal2`.
1019
+ *
1020
+ * @category Auth
1021
+ * @subcategory Auth MFA
1022
+ *
1023
+ * @remarks
1024
+ * - Use `totp` or `phone` as the `factorType` and use the returned `id` to create a challenge.
1025
+ * - To create a challenge, see [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge).
1026
+ * - To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).
1027
+ * - To create and verify a TOTP challenge in a single step, see [`mfa.challengeAndVerify()`](/docs/reference/javascript/auth-mfa-challengeandverify).
1028
+ * - To generate a QR code for the `totp` secret in Next.js, you can do the following:
1029
+ * ```html
1030
+ * <Image src={data.totp.qr_code} alt={data.totp.uri} layout="fill"></Image>
1031
+ * ```
1032
+ * - The `challenge` and `verify` steps are separated when using Phone factors as the user will need time to receive and input the code obtained from the SMS in challenge.
1033
+ *
1034
+ * @example Enroll a time-based, one-time password (TOTP) factor
1035
+ * ```js
1036
+ * const { data, error } = await supabase.auth.mfa.enroll({
1037
+ * factorType: 'totp',
1038
+ * friendlyName: 'your_friendly_name'
1039
+ * })
1040
+ *
1041
+ * // Use the id to create a challenge.
1042
+ * // The challenge can be verified by entering the code generated from the authenticator app.
1043
+ * // The code will be generated upon scanning the qr_code or entering the secret into the authenticator app.
1044
+ * const { id, type, totp: { qr_code, secret, uri }, friendly_name } = data
1045
+ * const challenge = await supabase.auth.mfa.challenge({ factorId: id });
1046
+ * ```
1047
+ *
1048
+ * @exampleResponse Enroll a time-based, one-time password (TOTP) factor
1049
+ * ```json
1050
+ * {
1051
+ * data: {
1052
+ * id: '<ID>',
1053
+ * type: 'totp'
1054
+ * totp: {
1055
+ * qr_code: '<QR_CODE_AS_SVG_DATA>',
1056
+ * secret: '<SECRET>',
1057
+ * uri: '<URI>',
1058
+ * }
1059
+ * friendly_name?: 'Important app'
1060
+ * },
1061
+ * error: null
1062
+ * }
1063
+ * ```
1064
+ *
1065
+ * @example Enroll a Phone Factor
1066
+ * ```js
1067
+ * const { data, error } = await supabase.auth.mfa.enroll({
1068
+ * factorType: 'phone',
1069
+ * friendlyName: 'your_friendly_name',
1070
+ * phone: '+12345678',
1071
+ * })
1072
+ *
1073
+ * // Use the id to create a challenge and send an SMS with a code to the user.
1074
+ * const { id, type, friendly_name, phone } = data
1075
+ *
1076
+ * const challenge = await supabase.auth.mfa.challenge({ factorId: id });
1077
+ * ```
1078
+ *
1079
+ * @exampleResponse Enroll a Phone Factor
1080
+ * ```json
1081
+ * {
1082
+ * data: {
1083
+ * id: '<ID>',
1084
+ * type: 'phone',
1085
+ * friendly_name?: 'Important app',
1086
+ * phone: '+5787123456'
1087
+ * },
1088
+ * error: null
1089
+ * }
1090
+ * ```
1091
+ */
1092
+ enroll(params: MFAEnrollTOTPParams): Promise<AuthMFAEnrollTOTPResponse>;
1093
+ enroll(params: MFAEnrollPhoneParams): Promise<AuthMFAEnrollPhoneResponse>;
1094
+ enroll(params: MFAEnrollWebauthnParams): Promise<AuthMFAEnrollWebauthnResponse>;
1095
+ enroll(params: MFAEnrollParams): Promise<AuthMFAEnrollResponse>;
1096
+ /**
1097
+ * Prepares a challenge used to verify that a user has access to a MFA
1098
+ * factor.
1099
+ *
1100
+ * @category Auth
1101
+ * @subcategory Auth MFA
1102
+ *
1103
+ * @remarks
1104
+ * - An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before creating a challenge.
1105
+ * - To verify a challenge, see [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify).
1106
+ * - A phone factor sends a code to the user upon challenge. The channel defaults to `sms` unless otherwise specified.
1107
+ *
1108
+ * @example Create a challenge for a factor
1109
+ * ```js
1110
+ * const { data, error } = await supabase.auth.mfa.challenge({
1111
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225'
1112
+ * })
1113
+ * ```
1114
+ *
1115
+ * @exampleResponse Create a challenge for a factor
1116
+ * ```json
1117
+ * {
1118
+ * data: {
1119
+ * id: '<ID>',
1120
+ * type: 'totp',
1121
+ * expires_at: 1700000000
1122
+ * },
1123
+ * error: null
1124
+ * }
1125
+ * ```
1126
+ *
1127
+ * @example Create a challenge for a phone factor
1128
+ * ```js
1129
+ * const { data, error } = await supabase.auth.mfa.challenge({
1130
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1131
+ * })
1132
+ * ```
1133
+ *
1134
+ * @exampleResponse Create a challenge for a phone factor
1135
+ * ```json
1136
+ * {
1137
+ * data: {
1138
+ * id: '<ID>',
1139
+ * type: 'phone',
1140
+ * expires_at: 1700000000
1141
+ * },
1142
+ * error: null
1143
+ * }
1144
+ * ```
1145
+ *
1146
+ * @example Create a challenge for a phone factor (WhatsApp)
1147
+ * ```js
1148
+ * const { data, error } = await supabase.auth.mfa.challenge({
1149
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1150
+ * channel: 'whatsapp',
1151
+ * })
1152
+ * ```
1153
+ *
1154
+ * @exampleResponse Create a challenge for a phone factor (WhatsApp)
1155
+ * ```json
1156
+ * {
1157
+ * data: {
1158
+ * id: '<ID>',
1159
+ * expires_at: 1700000000
1160
+ * },
1161
+ * error: null
1162
+ * }
1163
+ * ```
1164
+ */
1165
+ challenge(params: MFAChallengeTOTPParams): Promise<Prettify<AuthMFAChallengeTOTPResponse>>;
1166
+ challenge(params: MFAChallengePhoneParams): Promise<Prettify<AuthMFAChallengePhoneResponse>>;
1167
+ challenge(params: MFAChallengeWebauthnParams): Promise<Prettify<AuthMFAChallengeWebauthnResponse>>;
1168
+ challenge(params: MFAChallengeParams): Promise<AuthMFAChallengeResponse>;
1169
+ /**
1170
+ * Verifies a code against a challenge. The verification code is
1171
+ * provided by the user by entering a code seen in their authenticator app.
1172
+ *
1173
+ * @category Auth
1174
+ * @subcategory Auth MFA
1175
+ *
1176
+ * @remarks
1177
+ * - To verify a challenge, please [create a challenge](/docs/reference/javascript/auth-mfa-challenge) first.
1178
+ *
1179
+ * @example Verify a challenge for a factor
1180
+ * ```js
1181
+ * const { data, error } = await supabase.auth.mfa.verify({
1182
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1183
+ * challengeId: '4034ae6f-a8ce-4fb5-8ee5-69a5863a7c15',
1184
+ * code: '123456'
1185
+ * })
1186
+ * ```
1187
+ *
1188
+ * @exampleResponse Verify a challenge for a factor
1189
+ * ```json
1190
+ * {
1191
+ * data: {
1192
+ * access_token: '<ACCESS_TOKEN>',
1193
+ * token_type: 'Bearer',
1194
+ * expires_in: 3600,
1195
+ * refresh_token: '<REFRESH_TOKEN>',
1196
+ * user: {
1197
+ * id: '11111111-1111-1111-1111-111111111111',
1198
+ * aud: 'authenticated',
1199
+ * role: 'authenticated',
1200
+ * email: 'example@email.com',
1201
+ * email_confirmed_at: '2024-01-01T00:00:00Z',
1202
+ * phone: '',
1203
+ * confirmation_sent_at: '2024-01-01T00:00:00Z',
1204
+ * confirmed_at: '2024-01-01T00:00:00Z',
1205
+ * last_sign_in_at: '2024-01-01T00:00:00Z',
1206
+ * app_metadata: {
1207
+ * provider: 'email',
1208
+ * providers: [
1209
+ * "email",
1210
+ * ]
1211
+ * },
1212
+ * user_metadata: {},
1213
+ * identities: [
1214
+ * {
1215
+ * "identity_id": "22222222-2222-2222-2222-222222222222",
1216
+ * "id": "11111111-1111-1111-1111-111111111111",
1217
+ * "user_id": "11111111-1111-1111-1111-111111111111",
1218
+ * "identity_data": {
1219
+ * "email": "example@email.com",
1220
+ * "email_verified": true,
1221
+ * "phone_verified": false,
1222
+ * "sub": "11111111-1111-1111-1111-111111111111"
1223
+ * },
1224
+ * "provider": "email",
1225
+ * "last_sign_in_at": "2024-01-01T00:00:00Z",
1226
+ * "created_at": "2024-01-01T00:00:00Z",
1227
+ * "updated_at": "2024-01-01T00:00:00Z",
1228
+ * "email": "email@example.com"
1229
+ * },
1230
+ * ],
1231
+ * created_at: '2024-01-01T00:00:00Z',
1232
+ * updated_at: '2024-01-01T00:00:00Z',
1233
+ * is_anonymous: false,
1234
+ * factors: [
1235
+ * "id": '<ID>',
1236
+ * "friendly_name": 'Important Auth App',
1237
+ * "factor_type": 'totp',
1238
+ * "status": 'verified',
1239
+ * "created_at": "2024-01-01T00:00:00Z",
1240
+ * "updated_at": "2024-01-01T00:00:00Z"
1241
+ * ]
1242
+ * }
1243
+ * }
1244
+ * error: null
1245
+ * }
1246
+ * ```
1247
+ */
1248
+ verify(params: MFAVerifyTOTPParams): Promise<AuthMFAVerifyResponse>;
1249
+ verify(params: MFAVerifyPhoneParams): Promise<AuthMFAVerifyResponse>;
1250
+ verify(params: MFAVerifyWebauthnParams): Promise<AuthMFAVerifyResponse>;
1251
+ verify(params: MFAVerifyParams): Promise<AuthMFAVerifyResponse>;
1252
+ /**
1253
+ * Unenroll removes a MFA factor.
1254
+ * A user has to have an `aal2` authenticator level in order to unenroll a `verified` factor.
1255
+ *
1256
+ * @category Auth
1257
+ * @subcategory Auth MFA
1258
+ *
1259
+ * @example Unenroll a factor
1260
+ * ```js
1261
+ * const { data, error } = await supabase.auth.mfa.unenroll({
1262
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1263
+ * })
1264
+ * ```
1265
+ *
1266
+ * @exampleResponse Unenroll a factor
1267
+ * ```json
1268
+ * {
1269
+ * data: {
1270
+ * id: '<FACTOR_ID>'
1271
+ * },
1272
+ * error: null
1273
+ * }
1274
+ * ```
1275
+ */
1276
+ unenroll(params: MFAUnenrollParams): Promise<AuthMFAUnenrollResponse>;
1277
+ /**
1278
+ * Helper method which creates a challenge and immediately uses the given code to verify against it thereafter. The verification code is
1279
+ * provided by the user by entering a code seen in their authenticator app.
1280
+ *
1281
+ * @category Auth
1282
+ * @subcategory Auth MFA
1283
+ *
1284
+ * @remarks
1285
+ * - Intended for use with only TOTP factors.
1286
+ * - An [enrolled factor](/docs/reference/javascript/auth-mfa-enroll) is required before invoking `challengeAndVerify()`.
1287
+ * - Executes [`mfa.challenge()`](/docs/reference/javascript/auth-mfa-challenge) and [`mfa.verify()`](/docs/reference/javascript/auth-mfa-verify) in a single step.
1288
+ *
1289
+ * @example Create and verify a challenge for a factor
1290
+ * ```js
1291
+ * const { data, error } = await supabase.auth.mfa.challengeAndVerify({
1292
+ * factorId: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1293
+ * code: '123456'
1294
+ * })
1295
+ * ```
1296
+ *
1297
+ * @exampleResponse Create and verify a challenge for a factor
1298
+ * ```json
1299
+ * {
1300
+ * data: {
1301
+ * access_token: '<ACCESS_TOKEN>',
1302
+ * token_type: 'Bearer',
1303
+ * expires_in: 3600,
1304
+ * refresh_token: '<REFRESH_TOKEN>',
1305
+ * user: {
1306
+ * id: '11111111-1111-1111-1111-111111111111',
1307
+ * aud: 'authenticated',
1308
+ * role: 'authenticated',
1309
+ * email: 'example@email.com',
1310
+ * email_confirmed_at: '2024-01-01T00:00:00Z',
1311
+ * phone: '',
1312
+ * confirmation_sent_at: '2024-01-01T00:00:00Z',
1313
+ * confirmed_at: '2024-01-01T00:00:00Z',
1314
+ * last_sign_in_at: '2024-01-01T00:00:00Z',
1315
+ * app_metadata: {
1316
+ * provider: 'email',
1317
+ * providers: [
1318
+ * "email",
1319
+ * ]
1320
+ * },
1321
+ * user_metadata: {},
1322
+ * identities: [
1323
+ * {
1324
+ * "identity_id": "22222222-2222-2222-2222-222222222222",
1325
+ * "id": "11111111-1111-1111-1111-111111111111",
1326
+ * "user_id": "11111111-1111-1111-1111-111111111111",
1327
+ * "identity_data": {
1328
+ * "email": "example@email.com",
1329
+ * "email_verified": true,
1330
+ * "phone_verified": false,
1331
+ * "sub": "11111111-1111-1111-1111-111111111111"
1332
+ * },
1333
+ * "provider": "email",
1334
+ * "last_sign_in_at": "2024-01-01T00:00:00Z",
1335
+ * "created_at": "2024-01-01T00:00:00Z",
1336
+ * "updated_at": "2024-01-01T00:00:00Z",
1337
+ * "email": "email@example.com"
1338
+ * },
1339
+ * ],
1340
+ * created_at: '2024-01-01T00:00:00Z',
1341
+ * updated_at: '2024-01-01T00:00:00Z',
1342
+ * is_anonymous: false,
1343
+ * factors: [
1344
+ * "id": '<ID>',
1345
+ * "friendly_name": 'Important Auth App',
1346
+ * "factor_type": 'totp',
1347
+ * "status": 'verified',
1348
+ * "created_at": "2024-01-01T00:00:00Z",
1349
+ * "updated_at": "2024-01-01T00:00:00Z"
1350
+ * ]
1351
+ * }
1352
+ * }
1353
+ * error: null
1354
+ * }
1355
+ * ```
1356
+ */
1357
+ challengeAndVerify(params: MFAChallengeAndVerifyParams): Promise<AuthMFAVerifyResponse>;
1358
+ /**
1359
+ * Returns the list of MFA factors enabled for this user.
1360
+ *
1361
+ * @see {@link GoTrueMFAApi#enroll}
1362
+ * @see {@link GoTrueMFAApi#getAuthenticatorAssuranceLevel}
1363
+ * @see {@link GoTrueClient#getUser}
1364
+ *
1365
+ *
1366
+ * @category Auth
1367
+ * @subcategory Auth MFA
1368
+ */
1369
+ listFactors(): Promise<AuthMFAListFactorsResponse>;
1370
+ /**
1371
+ * Returns the Authenticator Assurance Level (AAL) for the active session.
1372
+ *
1373
+ * - `aal1` (or `null`) means that the user's identity has been verified only
1374
+ * with a conventional login (email+password, OTP, magic link, social login,
1375
+ * etc.).
1376
+ * - `aal2` means that the user's identity has been verified both with a conventional login and at least one MFA factor.
1377
+ *
1378
+ * When called without a JWT parameter, this method is fairly quick (microseconds)
1379
+ * and rarely uses the network. When a JWT is provided (useful in server-side
1380
+ * environments like Edge Functions where no session is stored), this method
1381
+ * will make a network request to validate the user and fetch their MFA factors.
1382
+ *
1383
+ * @param jwt Takes in an optional access token JWT. If no JWT is provided, the JWT from the current session is used.
1384
+ *
1385
+ * @category Auth
1386
+ * @subcategory Auth MFA
1387
+ *
1388
+ * @remarks
1389
+ * - Authenticator Assurance Level (AAL) is the measure of the strength of an authentication mechanism.
1390
+ * - In Supabase, having an AAL of `aal1` refers to having the 1st factor of authentication such as an email and password or OAuth sign-in while `aal2` refers to the 2nd factor of authentication such as a time-based, one-time-password (TOTP) or Phone factor.
1391
+ * - If the user has a verified factor, the `nextLevel` field will return `aal2`, else, it will return `aal1`.
1392
+ * - An optional `jwt` parameter can be passed to check the AAL level of a specific JWT instead of the current session.
1393
+ *
1394
+ * @example Get the AAL details of a session
1395
+ * ```js
1396
+ * const { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel()
1397
+ * const { currentLevel, nextLevel, currentAuthenticationMethods } = data
1398
+ * ```
1399
+ *
1400
+ * @exampleResponse Get the AAL details of a session
1401
+ * ```json
1402
+ * {
1403
+ * data: {
1404
+ * currentLevel: 'aal1',
1405
+ * nextLevel: 'aal2',
1406
+ * currentAuthenticationMethods: [
1407
+ * {
1408
+ * method: 'password',
1409
+ * timestamp: 1700000000
1410
+ * }
1411
+ * ]
1412
+ * }
1413
+ * error: null
1414
+ * }
1415
+ * ```
1416
+ *
1417
+ * @example Get the AAL details for a specific JWT
1418
+ * ```js
1419
+ * const { data, error } = await supabase.auth.mfa.getAuthenticatorAssuranceLevel(jwt)
1420
+ * ```
1421
+ */
1422
+ getAuthenticatorAssuranceLevel(jwt?: string): Promise<AuthMFAGetAuthenticatorAssuranceLevelResponse>;
1423
+ webauthn: WebAuthnApi;
1424
+ }
1425
+ /**
1426
+ * @expermental
1427
+ */
1428
+ export type AuthMFAAdminDeleteFactorResponse = RequestResult<{
1429
+ /** ID of the factor that was successfully deleted. */
1430
+ id: string;
1431
+ }>;
1432
+ /**
1433
+ * @expermental
1434
+ */
1435
+ export type AuthMFAAdminDeleteFactorParams = {
1436
+ /** ID of the MFA factor to delete. */
1437
+ id: string;
1438
+ /** ID of the user whose factor is being deleted. */
1439
+ userId: string;
1440
+ };
1441
+ /**
1442
+ * @expermental
1443
+ */
1444
+ export type AuthMFAAdminListFactorsResponse = RequestResult<{
1445
+ /** All factors attached to the user. */
1446
+ factors: Factor[];
1447
+ }>;
1448
+ /**
1449
+ * @expermental
1450
+ */
1451
+ export type AuthMFAAdminListFactorsParams = {
1452
+ /** ID of the user. */
1453
+ userId: string;
1454
+ };
1455
+ /**
1456
+ * Contains the full multi-factor authentication administration API.
1457
+ *
1458
+ * @expermental
1459
+ */
1460
+ export interface GoTrueAdminMFAApi {
1461
+ /**
1462
+ * Lists all factors associated to a user.
1463
+ *
1464
+ *
1465
+ * @category Auth
1466
+ * @subcategory Auth Admin
1467
+ *
1468
+ * @example List all factors for a user
1469
+ * ```js
1470
+ * const { data, error } = await supabase.auth.admin.mfa.listFactors()
1471
+ * ```
1472
+ *
1473
+ * @exampleResponse List all factors for a user
1474
+ * ```json
1475
+ * {
1476
+ * data: {
1477
+ * factors: Factor[
1478
+ * {
1479
+ * id: '<ID>',
1480
+ * friendly_name: 'Auth App Factor',
1481
+ * factor_type: 'totp',
1482
+ * status: 'verified',
1483
+ * created_at: '2024-01-01T00:00:00Z',
1484
+ * updated_at: '2024-01-01T00:00:00Z'
1485
+ * }
1486
+ * ]
1487
+ * },
1488
+ * error: null
1489
+ * }
1490
+ * ```
1491
+ */
1492
+ listFactors(params: AuthMFAAdminListFactorsParams): Promise<AuthMFAAdminListFactorsResponse>;
1493
+ /**
1494
+ * Deletes a factor on a user. This will log the user out of all active
1495
+ * sessions if the deleted factor was verified.
1496
+ *
1497
+ * @see {@link GoTrueMFAApi#unenroll}
1498
+ *
1499
+ * @expermental
1500
+ *
1501
+ * @category Auth
1502
+ * @subcategory Auth Admin
1503
+ *
1504
+ * @example Delete a factor for a user
1505
+ * ```js
1506
+ * const { data, error } = await supabase.auth.admin.mfa.deleteFactor({
1507
+ * id: '34e770dd-9ff9-416c-87fa-43b31d7ef225',
1508
+ * userId: 'a89baba7-b1b7-440f-b4bb-91026967f66b',
1509
+ * })
1510
+ * ```
1511
+ *
1512
+ * @exampleResponse Delete a factor for a user
1513
+ * ```json
1514
+ * {
1515
+ * data: {
1516
+ * id: '34e770dd-9ff9-416c-87fa-43b31d7ef225'
1517
+ * },
1518
+ * error: null
1519
+ * }
1520
+ * ```
1521
+ */
1522
+ deleteFactor(params: AuthMFAAdminDeleteFactorParams): Promise<AuthMFAAdminDeleteFactorResponse>;
1523
+ }
1524
+ type AnyFunction = (...args: any[]) => any;
1525
+ type MaybePromisify<T> = T | Promise<T>;
1526
+ type PromisifyMethods<T> = {
1527
+ [K in keyof T]: T[K] extends AnyFunction ? (...args: Parameters<T[K]>) => MaybePromisify<ReturnType<T[K]>> : T[K];
1528
+ };
1529
+ export type SupportedStorage = PromisifyMethods<Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>> & {
1530
+ /**
1531
+ * If set to `true` signals to the library that the storage medium is used
1532
+ * on a server and the values may not be authentic, such as reading from
1533
+ * request cookies. Implementations should not set this to true if the client
1534
+ * is used on a server that reads storage information from authenticated
1535
+ * sources, such as a secure database or file.
1536
+ */
1537
+ isServer?: boolean;
1538
+ };
1539
+ export type InitializeResult = {
1540
+ error: AuthError | null;
1541
+ };
1542
+ export type CallRefreshTokenResult = RequestResult<Session>;
1543
+ export type Pagination = {
1544
+ [key: string]: any;
1545
+ nextPage: number | null;
1546
+ lastPage: number;
1547
+ total: number;
1548
+ };
1549
+ export type PageParams = {
1550
+ /** The page number */
1551
+ page?: number;
1552
+ /** Number of items returned per page */
1553
+ perPage?: number;
1554
+ };
1555
+ export type SignOut = {
1556
+ /**
1557
+ * Determines which sessions should be
1558
+ * logged out. Global means all
1559
+ * sessions by this account. Local
1560
+ * means only this session. Others
1561
+ * means all other sessions except the
1562
+ * current one. When using others,
1563
+ * there is no sign-out event fired on
1564
+ * the current session!
1565
+ */
1566
+ scope?: 'global' | 'local' | 'others';
1567
+ };
1568
+ type MFAEnrollParamsBase<T extends FactorType> = {
1569
+ /** The type of factor being enrolled. */
1570
+ factorType: T;
1571
+ /** Human readable name assigned to the factor. */
1572
+ friendlyName?: string;
1573
+ };
1574
+ type MFAEnrollTOTPParamFields = {
1575
+ /** Domain which the user is enrolled with. */
1576
+ issuer?: string;
1577
+ };
1578
+ export type MFAEnrollTOTPParams = MFAEnrollParamsBase<'totp'> & MFAEnrollTOTPParamFields;
1579
+ type MFAEnrollPhoneParamFields = {
1580
+ /** Phone number associated with a factor. Number should conform to E.164 format */
1581
+ phone: string;
1582
+ };
1583
+ export type MFAEnrollPhoneParams = MFAEnrollParamsBase<'phone'> & MFAEnrollPhoneParamFields;
1584
+ type MFAEnrollWebauthnFields = {};
1585
+ /**
1586
+ * Parameters for enrolling a WebAuthn factor.
1587
+ * Creates an unverified WebAuthn factor that must be verified with a credential.
1588
+ * @see {@link https://w3c.github.io/webauthn/#sctn-registering-a-new-credential W3C WebAuthn Spec - Registering a New Credential}
1589
+ */
1590
+ export type MFAEnrollWebauthnParams = MFAEnrollParamsBase<'webauthn'> & MFAEnrollWebauthnFields;
1591
+ type AuthMFAEnrollResponseBase<T extends FactorType> = {
1592
+ /** ID of the factor that was just enrolled (in an unverified state). */
1593
+ id: string;
1594
+ /** Type of MFA factor.*/
1595
+ type: T;
1596
+ /** Friendly name of the factor, useful for distinguishing between factors **/
1597
+ friendly_name?: string;
1598
+ };
1599
+ type AuthMFAEnrollTOTPResponseFields = {
1600
+ /** TOTP enrollment information. */
1601
+ totp: {
1602
+ /** Contains a QR code encoding the authenticator URI. You can
1603
+ * convert it to a URL by prepending `data:image/svg+xml;utf-8,` to
1604
+ * the value. Avoid logging this value to the console. */
1605
+ qr_code: string;
1606
+ /** The TOTP secret (also encoded in the QR code). Show this secret
1607
+ * in a password-style field to the user, in case they are unable to
1608
+ * scan the QR code. Avoid logging this value to the console. */
1609
+ secret: string;
1610
+ /** The authenticator URI encoded within the QR code, should you need
1611
+ * to use it. Avoid loggin this value to the console. */
1612
+ uri: string;
1613
+ };
1614
+ };
1615
+ export type AuthMFAEnrollTOTPResponse = RequestResult<AuthMFAEnrollResponseBase<'totp'> & AuthMFAEnrollTOTPResponseFields>;
1616
+ type AuthMFAEnrollPhoneResponseFields = {
1617
+ /** Phone number of the MFA factor in E.164 format. Used to send messages */
1618
+ phone: string;
1619
+ };
1620
+ export type AuthMFAEnrollPhoneResponse = RequestResult<AuthMFAEnrollResponseBase<'phone'> & AuthMFAEnrollPhoneResponseFields>;
1621
+ type AuthMFAEnrollWebauthnFields = {};
1622
+ /**
1623
+ * Response type for WebAuthn factor enrollment.
1624
+ * Returns the enrolled factor ID and metadata.
1625
+ * @see {@link https://w3c.github.io/webauthn/#sctn-registering-a-new-credential W3C WebAuthn Spec - Registering a New Credential}
1626
+ */
1627
+ export type AuthMFAEnrollWebauthnResponse = RequestResult<AuthMFAEnrollResponseBase<'webauthn'> & AuthMFAEnrollWebauthnFields>;
1628
+ export type JwtHeader = {
1629
+ alg: 'RS256' | 'ES256' | 'HS256' | (string & {});
1630
+ kid: string;
1631
+ typ: string;
1632
+ };
1633
+ export type RequiredClaims = {
1634
+ iss: string;
1635
+ sub: string;
1636
+ aud: string | string[];
1637
+ exp: number;
1638
+ iat: number;
1639
+ role: string;
1640
+ aal: AuthenticatorAssuranceLevels;
1641
+ session_id: string;
1642
+ };
1643
+ /**
1644
+ * JWT Payload containing claims for Supabase authentication tokens.
1645
+ *
1646
+ * Required claims (iss, aud, exp, iat, sub, role, aal, session_id) are inherited from RequiredClaims.
1647
+ * All other claims are optional as they can be customized via Custom Access Token Hooks.
1648
+ *
1649
+ * @see https://supabase.com/docs/guides/auth/jwt-fields
1650
+ */
1651
+ export interface JwtPayload extends RequiredClaims {
1652
+ email?: string;
1653
+ phone?: string;
1654
+ is_anonymous?: boolean;
1655
+ jti?: string;
1656
+ nbf?: number;
1657
+ app_metadata?: UserAppMetadata;
1658
+ user_metadata?: UserMetadata;
1659
+ /**
1660
+ * Authentication Method References.
1661
+ * Supports both RFC-8176 compliant format (string[]) and detailed format (AMREntry[]).
1662
+ * - String format: ['password', 'otp'] - RFC-8176 compliant
1663
+ * - Object format: [{ method: 'password', timestamp: 1234567890 }] - includes timestamps
1664
+ */
1665
+ amr?: AMREntry[] | string[];
1666
+ ref?: string;
1667
+ [key: string]: any;
1668
+ }
1669
+ export interface JWK {
1670
+ kty: 'RSA' | 'EC' | 'oct' | (string & {});
1671
+ key_ops: string[];
1672
+ alg?: string;
1673
+ kid?: string;
1674
+ [key: string]: any;
1675
+ }
1676
+ export declare const SIGN_OUT_SCOPES: readonly ["global", "local", "others"];
1677
+ export type SignOutScope = (typeof SIGN_OUT_SCOPES)[number];
1678
+ /**
1679
+ * OAuth client grant types supported by the OAuth 2.1 server.
1680
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1681
+ */
1682
+ export type OAuthClientGrantType = 'authorization_code' | 'refresh_token' | (string & {});
1683
+ /**
1684
+ * OAuth client response types supported by the OAuth 2.1 server.
1685
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1686
+ */
1687
+ export type OAuthClientResponseType = 'code';
1688
+ /**
1689
+ * OAuth client type indicating whether the client can keep credentials confidential.
1690
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1691
+ */
1692
+ export type OAuthClientType = 'public' | 'confidential';
1693
+ /**
1694
+ * OAuth client registration type.
1695
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1696
+ */
1697
+ export type OAuthClientRegistrationType = 'dynamic' | 'manual';
1698
+ /**
1699
+ * OAuth client token endpoint authentication method.
1700
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1701
+ */
1702
+ export type OAuthClientTokenEndpointAuthMethod = 'none' | 'client_secret_basic' | 'client_secret_post';
1703
+ /**
1704
+ * OAuth client object returned from the OAuth 2.1 server.
1705
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1706
+ */
1707
+ export type OAuthClient = {
1708
+ /** Unique identifier for the OAuth client */
1709
+ client_id: string;
1710
+ /** Human-readable name of the OAuth client */
1711
+ client_name: string;
1712
+ /** Client secret (only returned on registration and regeneration) */
1713
+ client_secret?: string;
1714
+ /** Type of OAuth client */
1715
+ client_type: OAuthClientType;
1716
+ /** Token endpoint authentication method */
1717
+ token_endpoint_auth_method: OAuthClientTokenEndpointAuthMethod;
1718
+ /** Registration type of the client */
1719
+ registration_type: OAuthClientRegistrationType;
1720
+ /** URI of the OAuth client */
1721
+ client_uri?: string;
1722
+ /** URI of the OAuth client's logo */
1723
+ logo_uri?: string;
1724
+ /** Array of allowed redirect URIs */
1725
+ redirect_uris: string[];
1726
+ /** Array of allowed grant types */
1727
+ grant_types: OAuthClientGrantType[];
1728
+ /** Array of allowed response types */
1729
+ response_types: OAuthClientResponseType[];
1730
+ /** Scope of the OAuth client */
1731
+ scope?: string;
1732
+ /** Timestamp when the client was created */
1733
+ created_at: string;
1734
+ /** Timestamp when the client was last updated */
1735
+ updated_at: string;
1736
+ };
1737
+ /**
1738
+ * Parameters for creating a new OAuth client.
1739
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1740
+ */
1741
+ export type CreateOAuthClientParams = {
1742
+ /** Human-readable name of the OAuth client */
1743
+ client_name: string;
1744
+ /** URI of the OAuth client */
1745
+ client_uri?: string;
1746
+ /** Array of allowed redirect URIs */
1747
+ redirect_uris: string[];
1748
+ /** Array of allowed grant types (optional, defaults to authorization_code and refresh_token) */
1749
+ grant_types?: OAuthClientGrantType[];
1750
+ /** Array of allowed response types (optional, defaults to code) */
1751
+ response_types?: OAuthClientResponseType[];
1752
+ /** Scope of the OAuth client */
1753
+ scope?: string;
1754
+ /** Token endpoint authentication method (defaults to server default if not specified) */
1755
+ token_endpoint_auth_method?: OAuthClientTokenEndpointAuthMethod;
1756
+ };
1757
+ /**
1758
+ * Parameters for updating an existing OAuth client.
1759
+ * All fields are optional. Only provided fields will be updated.
1760
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1761
+ */
1762
+ export type UpdateOAuthClientParams = {
1763
+ /** Human-readable name of the OAuth client */
1764
+ client_name?: string;
1765
+ /** URI of the OAuth client */
1766
+ client_uri?: string;
1767
+ /** URI of the OAuth client's logo */
1768
+ logo_uri?: string;
1769
+ /** Array of allowed redirect URIs */
1770
+ redirect_uris?: string[];
1771
+ /** Array of allowed grant types */
1772
+ grant_types?: OAuthClientGrantType[];
1773
+ /** Token endpoint authentication method */
1774
+ token_endpoint_auth_method?: OAuthClientTokenEndpointAuthMethod;
1775
+ };
1776
+ /**
1777
+ * Response type for OAuth client operations.
1778
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1779
+ */
1780
+ export type OAuthClientResponse = RequestResult<OAuthClient>;
1781
+ /**
1782
+ * Response type for listing OAuth clients.
1783
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1784
+ */
1785
+ export type OAuthClientListResponse = {
1786
+ data: {
1787
+ clients: OAuthClient[];
1788
+ aud: string;
1789
+ } & Pagination;
1790
+ error: null;
1791
+ } | {
1792
+ data: {
1793
+ clients: [];
1794
+ };
1795
+ error: AuthError;
1796
+ };
1797
+ /**
1798
+ * Contains all OAuth client administration methods.
1799
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1800
+ */
1801
+ export interface GoTrueAdminOAuthApi {
1802
+ /**
1803
+ * Lists all OAuth clients with optional pagination.
1804
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1805
+ *
1806
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1807
+ *
1808
+ * @category Auth
1809
+ * @subcategory OAuth Admin
1810
+ */
1811
+ listClients(params?: PageParams): Promise<OAuthClientListResponse>;
1812
+ /**
1813
+ * Creates a new OAuth client.
1814
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1815
+ *
1816
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1817
+ *
1818
+ * @category Auth
1819
+ * @subcategory OAuth Admin
1820
+ */
1821
+ createClient(params: CreateOAuthClientParams): Promise<OAuthClientResponse>;
1822
+ /**
1823
+ * Gets details of a specific OAuth client.
1824
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1825
+ *
1826
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1827
+ *
1828
+ * @category Auth
1829
+ * @subcategory OAuth Admin
1830
+ */
1831
+ getClient(clientId: string): Promise<OAuthClientResponse>;
1832
+ /**
1833
+ * Updates an existing OAuth client.
1834
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1835
+ *
1836
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1837
+ *
1838
+ * @category Auth
1839
+ * @subcategory OAuth Admin
1840
+ */
1841
+ updateClient(clientId: string, params: UpdateOAuthClientParams): Promise<OAuthClientResponse>;
1842
+ /**
1843
+ * Deletes an OAuth client.
1844
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1845
+ *
1846
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1847
+ *
1848
+ * @category Auth
1849
+ * @subcategory OAuth Admin
1850
+ */
1851
+ deleteClient(clientId: string): Promise<{
1852
+ data: null;
1853
+ error: AuthError | null;
1854
+ }>;
1855
+ /**
1856
+ * Regenerates the secret for an OAuth client.
1857
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
1858
+ *
1859
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
1860
+ *
1861
+ * @category Auth
1862
+ * @subcategory OAuth Admin
1863
+ */
1864
+ regenerateClientSecret(clientId: string): Promise<OAuthClientResponse>;
1865
+ }
1866
+ /**
1867
+ * Type of custom identity provider.
1868
+ */
1869
+ export type CustomProviderType = 'oauth2' | 'oidc';
1870
+ /**
1871
+ * OIDC discovery document fields.
1872
+ * Populated when the server successfully fetches and validates the
1873
+ * provider's OpenID Connect discovery document.
1874
+ */
1875
+ export type OIDCDiscoveryDocument = {
1876
+ /** The issuer identifier */
1877
+ issuer: string;
1878
+ /** URL of the authorization endpoint */
1879
+ authorization_endpoint: string;
1880
+ /** URL of the token endpoint */
1881
+ token_endpoint: string;
1882
+ /** URL of the JSON Web Key Set */
1883
+ jwks_uri: string;
1884
+ /** URL of the userinfo endpoint */
1885
+ userinfo_endpoint?: string;
1886
+ /** URL of the revocation endpoint */
1887
+ revocation_endpoint?: string;
1888
+ /** List of supported scopes */
1889
+ supported_scopes?: string[];
1890
+ /** List of supported response types */
1891
+ supported_response_types?: string[];
1892
+ /** List of supported subject types */
1893
+ supported_subject_types?: string[];
1894
+ /** List of supported ID token signing algorithms */
1895
+ supported_id_token_signing_algs?: string[];
1896
+ };
1897
+ /**
1898
+ * Custom OAuth/OIDC provider object returned from the admin API.
1899
+ */
1900
+ export type CustomOAuthProvider = {
1901
+ /** Unique identifier (UUID) */
1902
+ id: string;
1903
+ /** Provider type */
1904
+ provider_type: CustomProviderType;
1905
+ /** Provider identifier (e.g. `custom:mycompany`) */
1906
+ identifier: string;
1907
+ /** Human-readable name */
1908
+ name: string;
1909
+ /** OAuth client ID */
1910
+ client_id: string;
1911
+ /** Additional client IDs accepted during token validation */
1912
+ acceptable_client_ids?: string[];
1913
+ /** OAuth scopes requested during authorization */
1914
+ scopes?: string[];
1915
+ /** Whether PKCE is enabled */
1916
+ pkce_enabled?: boolean;
1917
+ /** Mapping of provider attributes to Supabase user attributes */
1918
+ attribute_mapping?: Record<string, any>;
1919
+ /** Additional parameters sent with the authorization request */
1920
+ authorization_params?: Record<string, string>;
1921
+ /** Whether the provider is enabled */
1922
+ enabled?: boolean;
1923
+ /** Whether email is optional for this provider */
1924
+ email_optional?: boolean;
1925
+ /** OIDC issuer URL */
1926
+ issuer?: string;
1927
+ /** OIDC discovery URL */
1928
+ discovery_url?: string;
1929
+ /** Whether to skip nonce check (OIDC) */
1930
+ skip_nonce_check?: boolean;
1931
+ /** OAuth2 authorization URL */
1932
+ authorization_url?: string;
1933
+ /** OAuth2 token URL */
1934
+ token_url?: string;
1935
+ /** OAuth2 userinfo URL */
1936
+ userinfo_url?: string;
1937
+ /** JWKS URI for token verification */
1938
+ jwks_uri?: string;
1939
+ /** OIDC discovery document (OIDC providers only) */
1940
+ discovery_document?: OIDCDiscoveryDocument | null;
1941
+ /** Timestamp when the provider was created */
1942
+ created_at: string;
1943
+ /** Timestamp when the provider was last updated */
1944
+ updated_at: string;
1945
+ };
1946
+ /**
1947
+ * Parameters for creating a new custom provider.
1948
+ */
1949
+ export type CreateCustomProviderParams = {
1950
+ /** Provider type */
1951
+ provider_type: CustomProviderType;
1952
+ /** Provider identifier (e.g. `custom:mycompany`) */
1953
+ identifier: string;
1954
+ /** Human-readable name */
1955
+ name: string;
1956
+ /** OAuth client ID */
1957
+ client_id: string;
1958
+ /** OAuth client secret (write-only, not returned in responses) */
1959
+ client_secret: string;
1960
+ /** Additional client IDs accepted during token validation */
1961
+ acceptable_client_ids?: string[];
1962
+ /** OAuth scopes requested during authorization */
1963
+ scopes?: string[];
1964
+ /** Whether PKCE is enabled */
1965
+ pkce_enabled?: boolean;
1966
+ /** Mapping of provider attributes to Supabase user attributes */
1967
+ attribute_mapping?: Record<string, any>;
1968
+ /** Additional parameters sent with the authorization request */
1969
+ authorization_params?: Record<string, string>;
1970
+ /** Whether the provider is enabled */
1971
+ enabled?: boolean;
1972
+ /** Whether email is optional for this provider */
1973
+ email_optional?: boolean;
1974
+ /** OIDC issuer URL */
1975
+ issuer?: string;
1976
+ /** OIDC discovery URL */
1977
+ discovery_url?: string;
1978
+ /** Whether to skip nonce check (OIDC) */
1979
+ skip_nonce_check?: boolean;
1980
+ /** OAuth2 authorization URL */
1981
+ authorization_url?: string;
1982
+ /** OAuth2 token URL */
1983
+ token_url?: string;
1984
+ /** OAuth2 userinfo URL */
1985
+ userinfo_url?: string;
1986
+ /** JWKS URI for token verification */
1987
+ jwks_uri?: string;
1988
+ };
1989
+ /**
1990
+ * Parameters for updating an existing custom provider.
1991
+ * All fields are optional. Only provided fields will be updated.
1992
+ * `provider_type` and `identifier` are immutable and cannot be changed.
1993
+ */
1994
+ export type UpdateCustomProviderParams = {
1995
+ /** Human-readable name */
1996
+ name?: string;
1997
+ /** OAuth client ID */
1998
+ client_id?: string;
1999
+ /** OAuth client secret (write-only, not returned in responses) */
2000
+ client_secret?: string;
2001
+ /** Additional client IDs accepted during token validation */
2002
+ acceptable_client_ids?: string[];
2003
+ /** OAuth scopes requested during authorization */
2004
+ scopes?: string[];
2005
+ /** Whether PKCE is enabled */
2006
+ pkce_enabled?: boolean;
2007
+ /** Mapping of provider attributes to Supabase user attributes */
2008
+ attribute_mapping?: Record<string, any>;
2009
+ /** Additional parameters sent with the authorization request */
2010
+ authorization_params?: Record<string, string>;
2011
+ /** Whether the provider is enabled */
2012
+ enabled?: boolean;
2013
+ /** Whether email is optional for this provider */
2014
+ email_optional?: boolean;
2015
+ /** OIDC issuer URL */
2016
+ issuer?: string;
2017
+ /** OIDC discovery URL */
2018
+ discovery_url?: string;
2019
+ /** Whether to skip nonce check (OIDC) */
2020
+ skip_nonce_check?: boolean;
2021
+ /** OAuth2 authorization URL */
2022
+ authorization_url?: string;
2023
+ /** OAuth2 token URL */
2024
+ token_url?: string;
2025
+ /** OAuth2 userinfo URL */
2026
+ userinfo_url?: string;
2027
+ /** JWKS URI for token verification */
2028
+ jwks_uri?: string;
2029
+ };
2030
+ /**
2031
+ * Parameters for listing custom providers.
2032
+ */
2033
+ export type ListCustomProvidersParams = {
2034
+ /** Filter by provider type */
2035
+ type?: CustomProviderType;
2036
+ };
2037
+ /**
2038
+ * Response type for custom provider operations.
2039
+ */
2040
+ export type CustomProviderResponse = RequestResult<CustomOAuthProvider>;
2041
+ /**
2042
+ * Response type for listing custom providers.
2043
+ */
2044
+ export type CustomProviderListResponse = {
2045
+ data: {
2046
+ providers: CustomOAuthProvider[];
2047
+ };
2048
+ error: null;
2049
+ } | {
2050
+ data: {
2051
+ providers: [];
2052
+ };
2053
+ error: AuthError;
2054
+ };
2055
+ /**
2056
+ * Contains all custom OIDC/OAuth provider administration methods.
2057
+ */
2058
+ export interface GoTrueAdminCustomProvidersApi {
2059
+ /**
2060
+ * Lists all custom providers with optional type filter.
2061
+ *
2062
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2063
+ *
2064
+ * @category Auth
2065
+ * @subcategory Auth Admin
2066
+ */
2067
+ listProviders(params?: ListCustomProvidersParams): Promise<CustomProviderListResponse>;
2068
+ /**
2069
+ * Creates a new custom OIDC/OAuth provider.
2070
+ *
2071
+ * For OIDC providers, the server fetches and validates the OpenID Connect discovery document
2072
+ * from the issuer's well-known endpoint (or the provided `discovery_url`) at creation time.
2073
+ * This may return a validation error (`error_code: "validation_failed"`) if the discovery
2074
+ * document is unreachable, not valid JSON, missing required fields, or if the issuer
2075
+ * in the document does not match the expected issuer.
2076
+ *
2077
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2078
+ *
2079
+ * @category Auth
2080
+ * @subcategory Auth Admin
2081
+ */
2082
+ createProvider(params: CreateCustomProviderParams): Promise<CustomProviderResponse>;
2083
+ /**
2084
+ * Gets details of a specific custom provider by identifier.
2085
+ *
2086
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2087
+ *
2088
+ * @category Auth
2089
+ * @subcategory Auth Admin
2090
+ */
2091
+ getProvider(identifier: string): Promise<CustomProviderResponse>;
2092
+ /**
2093
+ * Updates an existing custom provider.
2094
+ *
2095
+ * When `issuer` or `discovery_url` is changed on an OIDC provider, the server re-fetches and
2096
+ * validates the discovery document before persisting. This may return a validation error
2097
+ * (`error_code: "validation_failed"`) if the discovery document is unreachable, invalid, or
2098
+ * the issuer does not match.
2099
+ *
2100
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2101
+ *
2102
+ * @category Auth
2103
+ * @subcategory Auth Admin
2104
+ */
2105
+ updateProvider(identifier: string, params: UpdateCustomProviderParams): Promise<CustomProviderResponse>;
2106
+ /**
2107
+ * Deletes a custom provider.
2108
+ *
2109
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2110
+ *
2111
+ * @category Auth
2112
+ * @subcategory Auth Admin
2113
+ */
2114
+ deleteProvider(identifier: string): Promise<{
2115
+ data: null;
2116
+ error: AuthError | null;
2117
+ }>;
2118
+ }
2119
+ /**
2120
+ * OAuth client details in an authorization request.
2121
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2122
+ */
2123
+ export type OAuthAuthorizationClient = {
2124
+ /** Unique identifier for the OAuth client (UUID) */
2125
+ id: string;
2126
+ /** Human-readable name of the OAuth client */
2127
+ name: string;
2128
+ /** URI of the OAuth client's website */
2129
+ uri: string;
2130
+ /** URI of the OAuth client's logo */
2131
+ logo_uri: string;
2132
+ };
2133
+ /**
2134
+ * OAuth authorization details when user needs to provide consent.
2135
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2136
+ *
2137
+ * This response includes all information needed to display a consent page:
2138
+ * client details, user info, requested scopes, and where the user will be redirected.
2139
+ *
2140
+ * Note: `redirect_uri` is the base URI (e.g., "https://app.com/callback") without
2141
+ * query parameters. After consent, you'll receive a complete `redirect_url` with
2142
+ * the authorization code and state parameters appended.
2143
+ */
2144
+ export type OAuthAuthorizationDetails = {
2145
+ /** The authorization ID used to approve or deny the request */
2146
+ authorization_id: string;
2147
+ /** The OAuth client's registered redirect URI (base URI without query parameters) */
2148
+ redirect_uri: string;
2149
+ /** OAuth client requesting authorization */
2150
+ client: OAuthAuthorizationClient;
2151
+ /** User object associated with the authorization */
2152
+ user: {
2153
+ /** User ID (UUID) */
2154
+ id: string;
2155
+ /** User email */
2156
+ email: string;
2157
+ };
2158
+ /** Space-separated list of requested scopes (e.g., "openid profile email") */
2159
+ scope: string;
2160
+ };
2161
+ /**
2162
+ * OAuth redirect response when user has already consented or after consent decision.
2163
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2164
+ *
2165
+ * This response is returned in three scenarios:
2166
+ * 1. User already consented to these scopes (auto-approved)
2167
+ * 2. User just approved the authorization request
2168
+ * 3. User just denied the authorization request
2169
+ *
2170
+ * The `redirect_url` is a complete URL ready for redirecting the user back to the
2171
+ * OAuth client, including authorization code (on success) or error (on denial) in
2172
+ * query parameters, along with the state parameter if one was provided.
2173
+ */
2174
+ export type OAuthRedirect = {
2175
+ /** Complete redirect URL with authorization code and state parameters (e.g., "https://app.com/callback?code=xxx&state=yyy") */
2176
+ redirect_url: string;
2177
+ };
2178
+ /**
2179
+ * Response type for getting OAuth authorization details.
2180
+ * Returns either full authorization details (if consent needed) or redirect URL (if already consented).
2181
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2182
+ *
2183
+ * @example
2184
+ * ```typescript
2185
+ * const { data, error } = await supabase.auth.oauth.getAuthorizationDetails(authorizationId)
2186
+ *
2187
+ * if (error) {
2188
+ * console.error('Error:', error)
2189
+ * } else if ('authorization_id' in data) {
2190
+ * // User needs to provide consent - show consent page
2191
+ * console.log('Client:', data.client.name)
2192
+ * console.log('Scopes:', data.scope)
2193
+ * console.log('Redirect URI:', data.redirect_uri)
2194
+ * } else {
2195
+ * // User already consented - redirect immediately
2196
+ * window.location.href = data.redirect_url
2197
+ * }
2198
+ * ```
2199
+ */
2200
+ export type AuthOAuthAuthorizationDetailsResponse = RequestResult<OAuthAuthorizationDetails | OAuthRedirect>;
2201
+ /**
2202
+ * Response type for OAuth consent decision (approve/deny).
2203
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2204
+ */
2205
+ export type AuthOAuthConsentResponse = RequestResult<OAuthRedirect>;
2206
+ /**
2207
+ * An OAuth grant representing a user's authorization of an OAuth client.
2208
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2209
+ */
2210
+ export type OAuthGrant = {
2211
+ /** OAuth client information */
2212
+ client: OAuthAuthorizationClient;
2213
+ /** Array of scopes granted to this client */
2214
+ scopes: string[];
2215
+ /** Timestamp when the grant was created (ISO 8601 date-time) */
2216
+ granted_at: string;
2217
+ };
2218
+ /**
2219
+ * Response type for listing user's OAuth grants.
2220
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2221
+ */
2222
+ export type AuthOAuthGrantsResponse = RequestResult<OAuthGrant[]>;
2223
+ /**
2224
+ * Response type for revoking an OAuth grant.
2225
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2226
+ */
2227
+ export type AuthOAuthRevokeGrantResponse = RequestResult<{}>;
2228
+ /**
2229
+ * Contains all OAuth 2.1 authorization server user-facing methods.
2230
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2231
+ *
2232
+ * These methods are used to implement the consent page.
2233
+ */
2234
+ export interface AuthOAuthServerApi {
2235
+ /**
2236
+ * Retrieves details about an OAuth authorization request.
2237
+ * Used to display consent information to the user.
2238
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2239
+ *
2240
+ * This method returns one of two response types:
2241
+ * - `OAuthAuthorizationDetails`: User needs to consent - show consent page with client info
2242
+ * - `OAuthRedirect`: User already consented - redirect immediately to the OAuth client
2243
+ *
2244
+ * Use type narrowing to distinguish between the responses:
2245
+ * ```typescript
2246
+ * if ('authorization_id' in data) {
2247
+ * // Show consent page
2248
+ * } else {
2249
+ * // Redirect to data.redirect_url
2250
+ * }
2251
+ * ```
2252
+ *
2253
+ * @param authorizationId - The authorization ID from the authorization request
2254
+ * @returns Authorization details or redirect URL depending on consent status
2255
+ *
2256
+ * @category Auth
2257
+ * @subcategory OAuth Server
2258
+ */
2259
+ getAuthorizationDetails(authorizationId: string): Promise<AuthOAuthAuthorizationDetailsResponse>;
2260
+ /**
2261
+ * Approves an OAuth authorization request.
2262
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2263
+ *
2264
+ * After approval, the user's consent is stored and an authorization code is generated.
2265
+ * The response contains a complete redirect URL with the authorization code and state.
2266
+ *
2267
+ * @param authorizationId - The authorization ID to approve
2268
+ * @param options - Optional parameters
2269
+ * @param options.skipBrowserRedirect - If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling).
2270
+ * @returns Redirect URL to send the user back to the OAuth client with authorization code
2271
+ *
2272
+ * @category Auth
2273
+ * @subcategory OAuth Server
2274
+ */
2275
+ approveAuthorization(authorizationId: string, options?: {
2276
+ skipBrowserRedirect?: boolean;
2277
+ }): Promise<AuthOAuthConsentResponse>;
2278
+ /**
2279
+ * Denies an OAuth authorization request.
2280
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2281
+ *
2282
+ * After denial, the response contains a redirect URL with an OAuth error
2283
+ * (access_denied) to inform the OAuth client that the user rejected the request.
2284
+ *
2285
+ * @param authorizationId - The authorization ID to deny
2286
+ * @param options - Optional parameters
2287
+ * @param options.skipBrowserRedirect - If false (default), automatically redirects the browser to the OAuth client. If true, returns the redirect_url without automatic redirect (useful for custom handling).
2288
+ * @returns Redirect URL to send the user back to the OAuth client with error information
2289
+ *
2290
+ * @category Auth
2291
+ * @subcategory OAuth Server
2292
+ */
2293
+ denyAuthorization(authorizationId: string, options?: {
2294
+ skipBrowserRedirect?: boolean;
2295
+ }): Promise<AuthOAuthConsentResponse>;
2296
+ /**
2297
+ * Lists all OAuth grants that the authenticated user has authorized.
2298
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2299
+ *
2300
+ * @returns Response with array of OAuth grants with client information and granted scopes
2301
+ *
2302
+ * @category Auth
2303
+ * @subcategory OAuth Server
2304
+ */
2305
+ listGrants(): Promise<AuthOAuthGrantsResponse>;
2306
+ /**
2307
+ * Revokes a user's OAuth grant for a specific client.
2308
+ * Only relevant when the OAuth 2.1 server is enabled in Supabase Auth.
2309
+ *
2310
+ * Revocation marks consent as revoked, deletes active sessions for that OAuth client,
2311
+ * and invalidates associated refresh tokens.
2312
+ *
2313
+ * @param options - Revocation options
2314
+ * @param options.clientId - The OAuth client identifier (UUID) to revoke access for
2315
+ * @returns Empty response on successful revocation
2316
+ *
2317
+ * @category Auth
2318
+ * @subcategory OAuth Server
2319
+ */
2320
+ revokeGrant(options: {
2321
+ clientId: string;
2322
+ }): Promise<AuthOAuthRevokeGrantResponse>;
2323
+ }
2324
+ /** Response from POST /passkeys/registration/options */
2325
+ export type PasskeyRegistrationOptionsResponse = {
2326
+ challenge_id: string;
2327
+ options: ServerCredentialCreationOptions;
2328
+ expires_at: number;
2329
+ };
2330
+ /** Request body for POST /passkeys/registration/verify */
2331
+ export type PasskeyRegistrationVerifyParams = {
2332
+ challenge_id: string;
2333
+ credential: RegistrationResponseJSON;
2334
+ };
2335
+ /** Response from POST /passkeys/registration/verify */
2336
+ export type PasskeyMetadata = {
2337
+ id: string;
2338
+ friendly_name?: string;
2339
+ created_at: string;
2340
+ };
2341
+ /** Response from POST /passkeys/authentication/options */
2342
+ export type PasskeyAuthenticationOptionsResponse = {
2343
+ challenge_id: string;
2344
+ options: ServerCredentialRequestOptions;
2345
+ expires_at: number;
2346
+ };
2347
+ /** Request body for POST /passkeys/authentication/verify */
2348
+ export type PasskeyAuthenticationVerifyParams = {
2349
+ challenge_id: string;
2350
+ credential: AuthenticationResponseJSON;
2351
+ };
2352
+ /** Item in the passkeys list (GET /passkeys/ and admin list) */
2353
+ export type PasskeyListItem = {
2354
+ id: string;
2355
+ friendly_name?: string;
2356
+ created_at: string;
2357
+ last_used_at?: string;
2358
+ };
2359
+ export type SignInWithPasskeyCredentials = {
2360
+ options?: {
2361
+ captchaToken?: string;
2362
+ signal?: AbortSignal;
2363
+ };
2364
+ };
2365
+ export type RegisterPasskeyCredentials = {
2366
+ options?: {
2367
+ signal?: AbortSignal;
2368
+ };
2369
+ };
2370
+ export type VerifyPasskeyRegistrationParams = {
2371
+ /** Challenge ID from startRegistration */
2372
+ challengeId: string;
2373
+ /** Serialized credential from navigator.credentials.create() */
2374
+ credential: ServerCredentialResponse;
2375
+ };
2376
+ export type StartPasskeyAuthenticationParams = {
2377
+ options?: {
2378
+ captchaToken?: string;
2379
+ };
2380
+ };
2381
+ export type VerifyPasskeyAuthenticationParams = {
2382
+ /** Challenge ID from startAuthentication */
2383
+ challengeId: string;
2384
+ /** Serialized credential from navigator.credentials.get() */
2385
+ credential: ServerCredentialResponse;
2386
+ };
2387
+ export type PasskeyUpdateParams = {
2388
+ /** UUID of the passkey to update */
2389
+ passkeyId: string;
2390
+ /** New friendly name (max 120 chars) */
2391
+ friendlyName: string;
2392
+ };
2393
+ export type PasskeyDeleteParams = {
2394
+ /** UUID of the passkey to delete */
2395
+ passkeyId: string;
2396
+ };
2397
+ export type AuthPasskeyRegistrationOptionsResponse = RequestResult<PasskeyRegistrationOptionsResponse>;
2398
+ export type AuthPasskeyRegistrationVerifyResponse = RequestResult<PasskeyMetadata, WebAuthnError | AuthError>;
2399
+ export type AuthPasskeyAuthenticationOptionsResponse = RequestResult<PasskeyAuthenticationOptionsResponse>;
2400
+ export type AuthPasskeyAuthenticationVerifyResponse = RequestResult<{
2401
+ session: Session | null;
2402
+ user: User | null;
2403
+ }, WebAuthnError | AuthError>;
2404
+ export type AuthPasskeyListResponse = RequestResult<PasskeyListItem[]>;
2405
+ export type AuthPasskeyUpdateResponse = RequestResult<PasskeyListItem>;
2406
+ export type AuthPasskeyDeleteResponse = RequestResult<null>;
2407
+ export type AuthPasskeyAdminListParams = {
2408
+ userId: string;
2409
+ };
2410
+ export type AuthPasskeyAdminDeleteParams = {
2411
+ userId: string;
2412
+ passkeyId: string;
2413
+ };
2414
+ /**
2415
+ * Lower-level two-step API and management methods for passkeys.
2416
+ * Access via `supabase.auth.passkey`.
2417
+ */
2418
+ export interface AuthPasskeyApi {
2419
+ /**
2420
+ * Starts the passkey registration ceremony. Fetches a registration challenge
2421
+ * and credential creation options from the server. Used as the first step of
2422
+ * a two-step registration flow when the caller wants to handle
2423
+ * `navigator.credentials.create()` themselves.
2424
+ *
2425
+ * @category Auth
2426
+ * @subcategory Auth Passkey
2427
+ */
2428
+ startRegistration(): Promise<AuthPasskeyRegistrationOptionsResponse>;
2429
+ /**
2430
+ * Verifies a passkey registration credential against a previously issued
2431
+ * challenge. Used as the second step of a two-step registration flow.
2432
+ *
2433
+ * @category Auth
2434
+ * @subcategory Auth Passkey
2435
+ */
2436
+ verifyRegistration(params: VerifyPasskeyRegistrationParams): Promise<AuthPasskeyRegistrationVerifyResponse>;
2437
+ /**
2438
+ * Starts the passkey authentication ceremony. Fetches an authentication
2439
+ * challenge and credential request options from the server. Used as the
2440
+ * first step of a two-step sign-in flow when the caller wants to handle
2441
+ * `navigator.credentials.get()` themselves.
2442
+ *
2443
+ * @category Auth
2444
+ * @subcategory Auth Passkey
2445
+ */
2446
+ startAuthentication(params?: StartPasskeyAuthenticationParams): Promise<AuthPasskeyAuthenticationOptionsResponse>;
2447
+ /**
2448
+ * Verifies a passkey authentication credential against a previously issued
2449
+ * challenge. Used as the second step of a two-step sign-in flow.
2450
+ *
2451
+ * @category Auth
2452
+ * @subcategory Auth Passkey
2453
+ */
2454
+ verifyAuthentication(params: VerifyPasskeyAuthenticationParams): Promise<AuthPasskeyAuthenticationVerifyResponse>;
2455
+ /**
2456
+ * Lists all passkeys registered for the currently signed-in user.
2457
+ *
2458
+ * @category Auth
2459
+ * @subcategory Auth Passkey
2460
+ */
2461
+ list(): Promise<AuthPasskeyListResponse>;
2462
+ /**
2463
+ * Updates a passkey's friendly name.
2464
+ *
2465
+ * @category Auth
2466
+ * @subcategory Auth Passkey
2467
+ */
2468
+ update(params: PasskeyUpdateParams): Promise<AuthPasskeyUpdateResponse>;
2469
+ /**
2470
+ * Deletes a passkey for the currently signed-in user.
2471
+ *
2472
+ * @category Auth
2473
+ * @subcategory Auth Passkey
2474
+ */
2475
+ delete(params: PasskeyDeleteParams): Promise<AuthPasskeyDeleteResponse>;
2476
+ }
2477
+ export interface GoTrueAdminPasskeyApi {
2478
+ /**
2479
+ * Lists all passkeys registered for a specific user.
2480
+ *
2481
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2482
+ *
2483
+ * @category Auth
2484
+ * @subcategory Passkey Admin
2485
+ */
2486
+ listPasskeys(params: AuthPasskeyAdminListParams): Promise<AuthPasskeyListResponse>;
2487
+ /**
2488
+ * Deletes a specific passkey for a specific user.
2489
+ *
2490
+ * This function should only be called on a server. Never expose your `service_role` key in the browser.
2491
+ *
2492
+ * @category Auth
2493
+ * @subcategory Passkey Admin
2494
+ */
2495
+ deletePasskey(params: AuthPasskeyAdminDeleteParams): Promise<AuthPasskeyDeleteResponse>;
2496
+ }
2497
+ export {};
2498
+ //# sourceMappingURL=types.d.ts.map