@nextsparkjs/core 0.1.0-beta.185 → 0.1.0-beta.187

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 (518) hide show
  1. package/dist/components/app/guards/DeveloperGuard.d.ts.map +1 -1
  2. package/dist/components/app/guards/DeveloperGuard.js +8 -4
  3. package/dist/components/app/guards/SuperAdminGuard.d.ts.map +1 -1
  4. package/dist/components/app/guards/SuperAdminGuard.js +8 -4
  5. package/dist/components/app/layouts/PublicFooter.d.ts.map +1 -1
  6. package/dist/components/app/layouts/PublicFooter.js +2 -2
  7. package/dist/components/app/layouts/PublicNavbar.d.ts.map +1 -1
  8. package/dist/components/app/layouts/PublicNavbar.js +2 -2
  9. package/dist/components/app/misc/ThemeToggle.d.ts.map +1 -1
  10. package/dist/components/app/misc/ThemeToggle.js +4 -1
  11. package/dist/components/auth/DevKeyring.d.ts.map +1 -1
  12. package/dist/components/auth/DevKeyring.js +10 -2
  13. package/dist/components/auth/SessionCookieRefresher.d.ts +21 -0
  14. package/dist/components/auth/SessionCookieRefresher.d.ts.map +1 -0
  15. package/dist/components/auth/SessionCookieRefresher.js +11 -0
  16. package/dist/components/auth/forms/LoginForm.d.ts.map +1 -1
  17. package/dist/components/auth/forms/LoginForm.js +300 -6
  18. package/dist/components/auth/index.d.ts +1 -0
  19. package/dist/components/auth/index.d.ts.map +1 -1
  20. package/dist/components/auth/index.js +2 -0
  21. package/dist/components/billing/InvoicesTable.d.ts.map +1 -1
  22. package/dist/components/billing/InvoicesTable.js +4 -3
  23. package/dist/components/dashboard/block-editor/dynamic-form.d.ts.map +1 -1
  24. package/dist/components/dashboard/layouts/AuthGuard.d.ts.map +1 -1
  25. package/dist/components/dashboard/layouts/AuthGuard.js +2 -2
  26. package/dist/components/dashboard/layouts/DashboardAuthLayout.d.ts.map +1 -1
  27. package/dist/components/dashboard/layouts/DashboardAuthLayout.js +2 -2
  28. package/dist/components/dashboard/layouts/DashboardAuthSkeleton.d.ts +17 -0
  29. package/dist/components/dashboard/layouts/DashboardAuthSkeleton.d.ts.map +1 -0
  30. package/dist/components/dashboard/layouts/DashboardAuthSkeleton.js +52 -0
  31. package/dist/components/dashboard/layouts/Sidebar.d.ts.map +1 -1
  32. package/dist/components/dashboard/layouts/Sidebar.js +2 -3
  33. package/dist/components/dashboard/layouts/TopNavbar.js +2 -2
  34. package/dist/components/dashboard/layouts/index.d.ts +1 -0
  35. package/dist/components/dashboard/layouts/index.d.ts.map +1 -1
  36. package/dist/components/dashboard/layouts/index.js +2 -0
  37. package/dist/components/devtools/api-explorer/ApiExplorer.js +4 -4
  38. package/dist/components/entities/EntityFieldRenderer.d.ts.map +1 -1
  39. package/dist/components/entities/EntityFieldRenderer.js +3 -0
  40. package/dist/components/entities/EntityTable.d.ts.map +1 -1
  41. package/dist/components/entities/EntityTable.js +2 -1
  42. package/dist/components/entities/wrappers/EntityFormWrapper.d.ts.map +1 -1
  43. package/dist/components/entities/wrappers/EntityFormWrapper.js +7 -2
  44. package/dist/components/patterns/pages/PatternEditPage.d.ts +5 -1
  45. package/dist/components/patterns/pages/PatternEditPage.d.ts.map +1 -1
  46. package/dist/components/patterns/pages/PatternEditPage.js +16 -5
  47. package/dist/components/patterns/pages/PatternsCreatePage.d.ts +2 -1
  48. package/dist/components/patterns/pages/PatternsCreatePage.d.ts.map +1 -1
  49. package/dist/components/patterns/pages/PatternsCreatePage.js +17 -5
  50. package/dist/components/ui/combobox.d.ts +8 -1
  51. package/dist/components/ui/combobox.d.ts.map +1 -1
  52. package/dist/components/ui/combobox.js +37 -44
  53. package/dist/components/ui/country-select.d.ts +3 -1
  54. package/dist/components/ui/country-select.d.ts.map +1 -1
  55. package/dist/components/ui/country-select.js +3 -1
  56. package/dist/components/ui/currency-select.d.ts +3 -1
  57. package/dist/components/ui/currency-select.d.ts.map +1 -1
  58. package/dist/components/ui/currency-select.js +3 -1
  59. package/dist/components/ui/sheet.d.ts +5 -0
  60. package/dist/components/ui/sheet.d.ts.map +1 -1
  61. package/dist/components/ui/sheet.js +46 -26
  62. package/dist/components/ui/timezone-select.d.ts +3 -1
  63. package/dist/components/ui/timezone-select.d.ts.map +1 -1
  64. package/dist/components/ui/timezone-select.js +3 -1
  65. package/dist/contexts/TeamContext.d.ts +6 -0
  66. package/dist/contexts/TeamContext.d.ts.map +1 -1
  67. package/dist/contexts/TeamContext.js +8 -1
  68. package/dist/emails/otp-verification.d.ts.map +1 -1
  69. package/dist/emails/reset-password.d.ts.map +1 -1
  70. package/dist/emails/team-invitation.d.ts.map +1 -1
  71. package/dist/emails/team-invitation.js +3 -2
  72. package/dist/emails/verify-email.d.ts.map +1 -1
  73. package/dist/hooks/index.d.ts +1 -0
  74. package/dist/hooks/index.d.ts.map +1 -1
  75. package/dist/hooks/index.js +1 -0
  76. package/dist/hooks/useAuth.d.ts +29 -0
  77. package/dist/hooks/useAuth.d.ts.map +1 -1
  78. package/dist/hooks/useAuth.js +24 -0
  79. package/dist/hooks/useEnsureUserMetadata.d.ts +22 -0
  80. package/dist/hooks/useEnsureUserMetadata.d.ts.map +1 -1
  81. package/dist/hooks/useEnsureUserMetadata.js +18 -5
  82. package/dist/hooks/useSessionCookieRefresh.d.ts +35 -0
  83. package/dist/hooks/useSessionCookieRefresh.d.ts.map +1 -0
  84. package/dist/hooks/useSessionCookieRefresh.js +49 -0
  85. package/dist/lib/api/api-error.d.ts +3 -1
  86. package/dist/lib/api/api-error.d.ts.map +1 -1
  87. package/dist/lib/api/api-error.js +4 -2
  88. package/dist/lib/api/auth/dual-auth.d.ts +38 -3
  89. package/dist/lib/api/auth/dual-auth.d.ts.map +1 -1
  90. package/dist/lib/api/auth/dual-auth.js +42 -7
  91. package/dist/lib/api/auth/permissions.d.ts +7 -2
  92. package/dist/lib/api/auth/permissions.d.ts.map +1 -1
  93. package/dist/lib/api/auth/permissions.js +2 -2
  94. package/dist/lib/api/auth/scope-policy.d.ts +71 -0
  95. package/dist/lib/api/auth/scope-policy.d.ts.map +1 -0
  96. package/dist/lib/api/auth/scope-policy.js +53 -0
  97. package/dist/lib/api/auth.d.ts +15 -0
  98. package/dist/lib/api/auth.d.ts.map +1 -1
  99. package/dist/lib/api/auth.js +17 -4
  100. package/dist/lib/api/entities.js +2 -1
  101. package/dist/lib/api/entity/audit-log.d.ts +35 -0
  102. package/dist/lib/api/entity/audit-log.d.ts.map +1 -0
  103. package/dist/lib/api/entity/audit-log.js +35 -0
  104. package/dist/lib/api/entity/generic-handler.d.ts.map +1 -1
  105. package/dist/lib/api/entity/generic-handler.js +333 -138
  106. package/dist/lib/api/entity-handler.js +2 -2
  107. package/dist/lib/api/helpers.d.ts +29 -4
  108. package/dist/lib/api/helpers.d.ts.map +1 -1
  109. package/dist/lib/api/helpers.js +30 -6
  110. package/dist/lib/api/keys.d.ts +16 -0
  111. package/dist/lib/api/keys.d.ts.map +1 -1
  112. package/dist/lib/api/keys.js +19 -1
  113. package/dist/lib/api/routes/patterns-usages.d.ts.map +1 -1
  114. package/dist/lib/api/routes/patterns-usages.js +3 -11
  115. package/dist/lib/auth/auth-methods.d.ts +52 -0
  116. package/dist/lib/auth/auth-methods.d.ts.map +1 -0
  117. package/dist/lib/auth/auth-methods.js +63 -0
  118. package/dist/lib/auth/registration-guard-plugin.d.ts.map +1 -1
  119. package/dist/lib/auth/registration-helpers.d.ts +9 -0
  120. package/dist/lib/auth/registration-helpers.d.ts.map +1 -1
  121. package/dist/lib/auth/registration-helpers.js +8 -2
  122. package/dist/lib/auth/security-notifications/device-fingerprint.d.ts +52 -0
  123. package/dist/lib/auth/security-notifications/device-fingerprint.d.ts.map +1 -0
  124. package/dist/lib/auth/security-notifications/device-fingerprint.js +42 -0
  125. package/dist/lib/auth/security-notifications/dispatcher.d.ts +37 -0
  126. package/dist/lib/auth/security-notifications/dispatcher.d.ts.map +1 -0
  127. package/dist/lib/auth/security-notifications/dispatcher.js +157 -0
  128. package/dist/lib/auth/security-notifications/index.d.ts +20 -0
  129. package/dist/lib/auth/security-notifications/index.d.ts.map +1 -0
  130. package/dist/lib/auth/security-notifications/index.js +22 -0
  131. package/dist/lib/auth/security-notifications/registry.d.ts +36 -0
  132. package/dist/lib/auth/security-notifications/registry.d.ts.map +1 -0
  133. package/dist/lib/auth/security-notifications/registry.js +26 -0
  134. package/dist/lib/auth/security-notifications/templates/email-changed.d.ts +12 -0
  135. package/dist/lib/auth/security-notifications/templates/email-changed.d.ts.map +1 -0
  136. package/dist/lib/auth/security-notifications/templates/email-changed.js +43 -0
  137. package/dist/lib/auth/security-notifications/templates/new-device-login.d.ts +7 -0
  138. package/dist/lib/auth/security-notifications/templates/new-device-login.d.ts.map +1 -0
  139. package/dist/lib/auth/security-notifications/templates/new-device-login.js +46 -0
  140. package/dist/lib/auth/security-notifications/templates/password-changed.d.ts +7 -0
  141. package/dist/lib/auth/security-notifications/templates/password-changed.d.ts.map +1 -0
  142. package/dist/lib/auth/security-notifications/templates/password-changed.js +35 -0
  143. package/dist/lib/auth/security-notifications/templates/shared.d.ts +36 -0
  144. package/dist/lib/auth/security-notifications/templates/shared.d.ts.map +1 -0
  145. package/dist/lib/auth/security-notifications/templates/shared.js +68 -0
  146. package/dist/lib/auth/security-notifications/types.d.ts +74 -0
  147. package/dist/lib/auth/security-notifications/types.d.ts.map +1 -0
  148. package/dist/lib/auth/session-config.d.ts +37 -0
  149. package/dist/lib/auth/session-config.d.ts.map +1 -0
  150. package/dist/lib/auth/session-config.js +59 -0
  151. package/dist/lib/auth/session-refresh.d.ts +46 -0
  152. package/dist/lib/auth/session-refresh.d.ts.map +1 -0
  153. package/dist/lib/auth/session-refresh.js +11 -0
  154. package/dist/lib/auth-client.d.ts +1639 -0
  155. package/dist/lib/auth-client.d.ts.map +1 -0
  156. package/dist/lib/auth-client.js +13 -1
  157. package/dist/lib/auth.d.ts.map +1 -1
  158. package/dist/lib/auth.js +45 -11
  159. package/dist/lib/billing/gateways/factory.d.ts +8 -3
  160. package/dist/lib/billing/gateways/factory.d.ts.map +1 -1
  161. package/dist/lib/billing/gateways/factory.js +37 -23
  162. package/dist/lib/billing/stripe-webhook.d.ts.map +1 -1
  163. package/dist/lib/billing/stripe-webhook.js +2 -1
  164. package/dist/lib/config/app.config.d.ts.map +1 -1
  165. package/dist/lib/config/app.config.js +71 -0
  166. package/dist/lib/config/config-sync.d.ts +1 -4
  167. package/dist/lib/config/config-sync.d.ts.map +1 -1
  168. package/dist/lib/config/config-sync.js +6 -2
  169. package/dist/lib/config/types.d.ts +130 -0
  170. package/dist/lib/config/types.d.ts.map +1 -1
  171. package/dist/lib/email/templates.d.ts +3 -3
  172. package/dist/lib/email/templates.d.ts.map +1 -1
  173. package/dist/lib/entities/api-generator.js +5 -5
  174. package/dist/lib/entities/entity-hooks.d.ts +9 -1
  175. package/dist/lib/entities/entity-hooks.d.ts.map +1 -1
  176. package/dist/lib/entities/entity-hooks.js +77 -4
  177. package/dist/lib/entities/schema-generator.d.ts.map +1 -1
  178. package/dist/lib/entities/schema-generator.js +20 -4
  179. package/dist/lib/entities/serialization.d.ts +2 -2
  180. package/dist/lib/entities/serialization.d.ts.map +1 -1
  181. package/dist/lib/entities/serialization.js +3 -2
  182. package/dist/lib/entities/types.d.ts +20 -0
  183. package/dist/lib/entities/types.d.ts.map +1 -1
  184. package/dist/lib/locale.d.ts.map +1 -1
  185. package/dist/lib/locale.js +4 -1
  186. package/dist/lib/mcp/audit.d.ts +8 -4
  187. package/dist/lib/mcp/audit.d.ts.map +1 -1
  188. package/dist/lib/plugins/hook-system.d.ts +13 -0
  189. package/dist/lib/plugins/hook-system.d.ts.map +1 -1
  190. package/dist/lib/plugins/hook-system.js +32 -2
  191. package/dist/lib/scheduled-actions/handlers/index.d.ts +1 -0
  192. package/dist/lib/scheduled-actions/handlers/index.d.ts.map +1 -1
  193. package/dist/lib/scheduled-actions/handlers/index.js +3 -1
  194. package/dist/lib/scheduled-actions/handlers/security-notification.d.ts +26 -0
  195. package/dist/lib/scheduled-actions/handlers/security-notification.d.ts.map +1 -0
  196. package/dist/lib/scheduled-actions/handlers/security-notification.js +54 -0
  197. package/dist/lib/selectors/core-selectors.d.ts +12 -0
  198. package/dist/lib/selectors/core-selectors.d.ts.map +1 -1
  199. package/dist/lib/selectors/domains/auth.selectors.d.ts +12 -0
  200. package/dist/lib/selectors/domains/auth.selectors.d.ts.map +1 -1
  201. package/dist/lib/selectors/domains/auth.selectors.js +14 -1
  202. package/dist/lib/selectors/selectors.d.ts +24 -0
  203. package/dist/lib/selectors/selectors.d.ts.map +1 -1
  204. package/dist/lib/services/api-docs.service.d.ts +5 -1
  205. package/dist/lib/services/api-docs.service.d.ts.map +1 -1
  206. package/dist/lib/services/api-presets.service.d.ts +6 -1
  207. package/dist/lib/services/api-presets.service.d.ts.map +1 -1
  208. package/dist/lib/services/feature.service.d.ts +58 -4
  209. package/dist/lib/services/feature.service.d.ts.map +1 -1
  210. package/dist/lib/services/generic-entity.service.d.ts.map +1 -1
  211. package/dist/lib/services/generic-entity.service.js +16 -32
  212. package/dist/lib/services/membership.service.d.ts +10 -2
  213. package/dist/lib/services/membership.service.d.ts.map +1 -1
  214. package/dist/lib/services/membership.service.js +37 -16
  215. package/dist/lib/services/permission.service.d.ts +10 -4
  216. package/dist/lib/services/permission.service.d.ts.map +1 -1
  217. package/dist/lib/services/plugin.service.d.ts +1 -1
  218. package/dist/lib/services/plugin.service.d.ts.map +1 -1
  219. package/dist/lib/services/subscription.service.d.ts.map +1 -1
  220. package/dist/lib/services/subscription.service.js +2 -1
  221. package/dist/lib/services/team-member.service.d.ts +15 -3
  222. package/dist/lib/services/team-member.service.d.ts.map +1 -1
  223. package/dist/lib/services/team-member.service.js +27 -6
  224. package/dist/lib/services/team.service.d.ts.map +1 -1
  225. package/dist/lib/teams/permissions.d.ts +3 -1
  226. package/dist/lib/teams/permissions.d.ts.map +1 -1
  227. package/dist/lib/teams/permissions.js +6 -0
  228. package/dist/lib/teams/schema.d.ts.map +1 -1
  229. package/dist/lib/teams/schema.js +3 -0
  230. package/dist/lib/template-resolver.d.ts +3 -3
  231. package/dist/lib/theme/forced-theme.d.ts +34 -0
  232. package/dist/lib/theme/forced-theme.d.ts.map +1 -0
  233. package/dist/lib/theme/forced-theme.js +27 -0
  234. package/dist/lib/theme/get-default-theme-mode.d.ts +3 -0
  235. package/dist/lib/theme/get-default-theme-mode.d.ts.map +1 -1
  236. package/dist/lib/theme/get-default-theme-mode.js +5 -3
  237. package/dist/lib/utils/cors.d.ts +13 -0
  238. package/dist/lib/utils/cors.d.ts.map +1 -1
  239. package/dist/lib/utils/cors.js +20 -0
  240. package/dist/messages/de/auth.json +25 -2
  241. package/dist/messages/de/index.d.ts +83 -0
  242. package/dist/messages/de/index.d.ts.map +1 -1
  243. package/dist/messages/de/index.js +2 -0
  244. package/dist/messages/de/index.ts +2 -0
  245. package/dist/messages/de/navigation.json +3 -1
  246. package/dist/messages/en/auth.json +25 -2
  247. package/dist/messages/en/index.d.ts +83 -0
  248. package/dist/messages/en/index.d.ts.map +1 -1
  249. package/dist/messages/en/index.js +2 -0
  250. package/dist/messages/en/index.ts +2 -0
  251. package/dist/messages/en/navigation.json +3 -1
  252. package/dist/messages/es/auth.json +25 -2
  253. package/dist/messages/es/index.d.ts +83 -0
  254. package/dist/messages/es/index.d.ts.map +1 -1
  255. package/dist/messages/es/index.js +2 -0
  256. package/dist/messages/es/index.ts +2 -0
  257. package/dist/messages/es/navigation.json +3 -1
  258. package/dist/messages/fr/auth.json +25 -2
  259. package/dist/messages/fr/index.d.ts +83 -0
  260. package/dist/messages/fr/index.d.ts.map +1 -1
  261. package/dist/messages/fr/index.js +2 -0
  262. package/dist/messages/fr/index.ts +2 -0
  263. package/dist/messages/fr/navigation.json +3 -1
  264. package/dist/messages/it/auth.json +25 -2
  265. package/dist/messages/it/index.d.ts +83 -0
  266. package/dist/messages/it/index.d.ts.map +1 -1
  267. package/dist/messages/it/index.js +2 -0
  268. package/dist/messages/it/index.ts +2 -0
  269. package/dist/messages/it/navigation.json +3 -1
  270. package/dist/messages/pt/auth.json +25 -2
  271. package/dist/messages/pt/index.d.ts +83 -0
  272. package/dist/messages/pt/index.d.ts.map +1 -1
  273. package/dist/messages/pt/index.js +2 -0
  274. package/dist/messages/pt/index.ts +2 -0
  275. package/dist/messages/pt/navigation.json +3 -1
  276. package/dist/migrations/005_api_audit_log.sql +2 -1
  277. package/dist/migrations/025_api_audit_log_nullable_api_key.sql +12 -0
  278. package/dist/migrations/026_login_events.sql +91 -0
  279. package/dist/migrations/027_rls_bypass_developer_and_system_admin_team.sql +197 -0
  280. package/dist/nextspark-registries.d.ts +580 -236
  281. package/dist/providers/DashboardProviders.d.ts +12 -3
  282. package/dist/providers/DashboardProviders.d.ts.map +1 -1
  283. package/dist/providers/DashboardProviders.js +6 -2
  284. package/dist/providers/theme-provider.d.ts +19 -2
  285. package/dist/providers/theme-provider.d.ts.map +1 -1
  286. package/dist/providers/theme-provider.js +6 -2
  287. package/dist/templates/app/(auth)/signup/page.tsx +8 -0
  288. package/dist/templates/app/(public)/[...slug]/page.tsx +9 -14
  289. package/dist/templates/app/api/auth/[...all]/route.ts +23 -1
  290. package/dist/templates/app/api/health/route.ts +4 -2
  291. package/dist/templates/app/api/internal/user-metadata/route.ts +5 -3
  292. package/dist/templates/app/api/mcp/route.ts +4 -1
  293. package/dist/templates/app/api/superadmin/subscriptions/route.ts +2 -1
  294. package/dist/templates/app/api/superadmin/teams/[teamId]/route.ts +4 -3
  295. package/dist/templates/app/api/superadmin/users/[userId]/route.ts +10 -3
  296. package/dist/templates/app/api/v1/api-keys/[id]/route.ts +50 -71
  297. package/dist/templates/app/api/v1/api-keys/route.ts +21 -43
  298. package/dist/templates/app/api/v1/auth/signup-with-invite/route.ts +14 -14
  299. package/dist/templates/app/api/v1/billing/cancel/route.ts +7 -6
  300. package/dist/templates/app/api/v1/billing/change-plan/route.ts +5 -4
  301. package/dist/templates/app/api/v1/billing/check-action/route.ts +6 -4
  302. package/dist/templates/app/api/v1/billing/checkout/route.ts +7 -5
  303. package/dist/templates/app/api/v1/billing/plans/route.ts +8 -12
  304. package/dist/templates/app/api/v1/billing/portal/route.ts +7 -5
  305. package/dist/templates/app/api/v1/billing/webhooks/polar/route.ts +1 -1
  306. package/dist/templates/app/api/v1/devtools/blocks/route.ts +5 -4
  307. package/dist/templates/app/api/v1/devtools/features/route.ts +5 -4
  308. package/dist/templates/app/api/v1/devtools/flows/route.ts +5 -4
  309. package/dist/templates/app/api/v1/devtools/scheduled-actions/route.ts +9 -7
  310. package/dist/templates/app/api/v1/devtools/scheduled-actions/run/route.ts +5 -4
  311. package/dist/templates/app/api/v1/devtools/testing/route.ts +5 -4
  312. package/dist/templates/app/api/v1/media/[id]/route.ts +13 -25
  313. package/dist/templates/app/api/v1/media/[id]/tags/route.ts +17 -25
  314. package/dist/templates/app/api/v1/media/check-duplicates/route.ts +5 -7
  315. package/dist/templates/app/api/v1/media/route.ts +5 -9
  316. package/dist/templates/app/api/v1/media/upload/route.ts +9 -21
  317. package/dist/templates/app/api/v1/media-tags/route.ts +9 -13
  318. package/dist/templates/app/api/v1/patterns/[id]/usages/route.ts +11 -19
  319. package/dist/templates/app/api/v1/post-categories/[id]/route.ts +9 -7
  320. package/dist/templates/app/api/v1/post-categories/route.ts +5 -4
  321. package/dist/templates/app/api/v1/team-invitations/[token]/accept/route.ts +16 -18
  322. package/dist/templates/app/api/v1/team-invitations/[token]/decline/route.ts +15 -17
  323. package/dist/templates/app/api/v1/team-invitations/[token]/route.ts +8 -8
  324. package/dist/templates/app/api/v1/team-invitations/route.ts +9 -11
  325. package/dist/templates/app/api/v1/teams/[teamId]/invitations/route.ts +41 -32
  326. package/dist/templates/app/api/v1/teams/[teamId]/invoices/[invoiceNumber]/route.ts +15 -16
  327. package/dist/templates/app/api/v1/teams/[teamId]/invoices/route.ts +14 -15
  328. package/dist/templates/app/api/v1/teams/[teamId]/members/[memberId]/route.ts +32 -36
  329. package/dist/templates/app/api/v1/teams/[teamId]/members/route.ts +33 -33
  330. package/dist/templates/app/api/v1/teams/[teamId]/route.ts +35 -41
  331. package/dist/templates/app/api/v1/teams/[teamId]/subscription/route.ts +5 -3
  332. package/dist/templates/app/api/v1/teams/[teamId]/usage/[limitSlug]/route.ts +10 -6
  333. package/dist/templates/app/api/v1/teams/route.ts +33 -27
  334. package/dist/templates/app/api/v1/teams/switch/route.ts +11 -13
  335. package/dist/templates/app/api/v1/theme/[...path]/route.ts +23 -2
  336. package/dist/templates/app/api/v1/users/[id]/meta/[key]/route.ts +32 -77
  337. package/dist/templates/app/api/v1/users/[id]/route.ts +35 -68
  338. package/dist/templates/app/api/v1/users/route.ts +21 -25
  339. package/dist/templates/app/dashboard/layout.tsx +2 -6
  340. package/dist/templates/app/layout.ppr.tsx +15 -15
  341. package/dist/templates/app/layout.tsx +46 -20
  342. package/dist/templates/contents/themes/starter/config/app.config.ts +19 -0
  343. package/dist/templates/contents/themes/starter/config/theme.config.ts +6 -0
  344. package/dist/templates/contents/themes/starter/styles/globals.css +6 -2
  345. package/dist/templates/proxy.ts +46 -10
  346. package/dist/templates/tsconfig.json +4 -0
  347. package/dist/types/theme.d.ts +9 -0
  348. package/dist/types/theme.d.ts.map +1 -1
  349. package/migrations/005_api_audit_log.sql +2 -1
  350. package/migrations/025_api_audit_log_nullable_api_key.sql +12 -0
  351. package/migrations/026_login_events.sql +91 -0
  352. package/migrations/027_rls_bypass_developer_and_system_admin_team.sql +197 -0
  353. package/package.json +14 -11
  354. package/scripts/build/registry/__tests__/scope-registry.test.mjs +18 -0
  355. package/scripts/build/registry/generators/scope-registry.mjs +9 -2
  356. package/templates/app/(auth)/signup/page.tsx +8 -0
  357. package/templates/app/(public)/[...slug]/page.tsx +9 -14
  358. package/templates/app/api/auth/[...all]/route.ts +23 -1
  359. package/templates/app/api/health/route.ts +4 -2
  360. package/templates/app/api/internal/user-metadata/route.ts +5 -3
  361. package/templates/app/api/mcp/route.ts +4 -1
  362. package/templates/app/api/superadmin/subscriptions/route.ts +2 -1
  363. package/templates/app/api/superadmin/teams/[teamId]/route.ts +4 -3
  364. package/templates/app/api/superadmin/users/[userId]/route.ts +10 -3
  365. package/templates/app/api/v1/api-keys/[id]/route.ts +50 -71
  366. package/templates/app/api/v1/api-keys/route.ts +21 -43
  367. package/templates/app/api/v1/auth/signup-with-invite/route.ts +14 -14
  368. package/templates/app/api/v1/billing/cancel/route.ts +7 -6
  369. package/templates/app/api/v1/billing/change-plan/route.ts +5 -4
  370. package/templates/app/api/v1/billing/check-action/route.ts +6 -4
  371. package/templates/app/api/v1/billing/checkout/route.ts +7 -5
  372. package/templates/app/api/v1/billing/plans/route.ts +8 -12
  373. package/templates/app/api/v1/billing/portal/route.ts +7 -5
  374. package/templates/app/api/v1/billing/webhooks/polar/route.ts +1 -1
  375. package/templates/app/api/v1/devtools/blocks/route.ts +5 -4
  376. package/templates/app/api/v1/devtools/features/route.ts +5 -4
  377. package/templates/app/api/v1/devtools/flows/route.ts +5 -4
  378. package/templates/app/api/v1/devtools/scheduled-actions/route.ts +9 -7
  379. package/templates/app/api/v1/devtools/scheduled-actions/run/route.ts +5 -4
  380. package/templates/app/api/v1/devtools/testing/route.ts +5 -4
  381. package/templates/app/api/v1/media/[id]/route.ts +13 -25
  382. package/templates/app/api/v1/media/[id]/tags/route.ts +17 -25
  383. package/templates/app/api/v1/media/check-duplicates/route.ts +5 -7
  384. package/templates/app/api/v1/media/route.ts +5 -9
  385. package/templates/app/api/v1/media/upload/route.ts +9 -21
  386. package/templates/app/api/v1/media-tags/route.ts +9 -13
  387. package/templates/app/api/v1/patterns/[id]/usages/route.ts +11 -19
  388. package/templates/app/api/v1/post-categories/[id]/route.ts +9 -7
  389. package/templates/app/api/v1/post-categories/route.ts +5 -4
  390. package/templates/app/api/v1/team-invitations/[token]/accept/route.ts +16 -18
  391. package/templates/app/api/v1/team-invitations/[token]/decline/route.ts +15 -17
  392. package/templates/app/api/v1/team-invitations/[token]/route.ts +8 -8
  393. package/templates/app/api/v1/team-invitations/route.ts +9 -11
  394. package/templates/app/api/v1/teams/[teamId]/invitations/route.ts +41 -32
  395. package/templates/app/api/v1/teams/[teamId]/invoices/[invoiceNumber]/route.ts +15 -16
  396. package/templates/app/api/v1/teams/[teamId]/invoices/route.ts +14 -15
  397. package/templates/app/api/v1/teams/[teamId]/members/[memberId]/route.ts +32 -36
  398. package/templates/app/api/v1/teams/[teamId]/members/route.ts +33 -33
  399. package/templates/app/api/v1/teams/[teamId]/route.ts +35 -41
  400. package/templates/app/api/v1/teams/[teamId]/subscription/route.ts +5 -3
  401. package/templates/app/api/v1/teams/[teamId]/usage/[limitSlug]/route.ts +10 -6
  402. package/templates/app/api/v1/teams/route.ts +33 -27
  403. package/templates/app/api/v1/teams/switch/route.ts +11 -13
  404. package/templates/app/api/v1/theme/[...path]/route.ts +23 -2
  405. package/templates/app/api/v1/users/[id]/meta/[key]/route.ts +32 -77
  406. package/templates/app/api/v1/users/[id]/route.ts +35 -68
  407. package/templates/app/api/v1/users/route.ts +21 -25
  408. package/templates/app/dashboard/layout.tsx +2 -6
  409. package/templates/app/layout.ppr.tsx +15 -15
  410. package/templates/app/layout.tsx +46 -20
  411. package/templates/contents/themes/starter/config/app.config.ts +19 -0
  412. package/templates/contents/themes/starter/config/theme.config.ts +6 -0
  413. package/templates/contents/themes/starter/styles/globals.css +6 -2
  414. package/templates/proxy.ts +46 -10
  415. package/templates/tsconfig.json +4 -0
  416. package/tests/jest/__mocks__/@nextsparkjs/registries/permissions-registry.ts +23 -0
  417. package/tests/jest/__mocks__/next-server.js +24 -0
  418. package/dist/components/teams/TeamSwitchModal.d.js +0 -0
  419. package/dist/components/ui/accordion.d.js +0 -0
  420. package/dist/components/ui/avatar.d.js +0 -0
  421. package/dist/components/ui/badge.d.js +0 -0
  422. package/dist/components/ui/button.d.js +0 -0
  423. package/dist/components/ui/card.d.js +0 -0
  424. package/dist/components/ui/dialog.d.js +0 -0
  425. package/dist/components/ui/dropdown-menu.d.js +0 -0
  426. package/dist/components/ui/input.d.js +0 -0
  427. package/dist/components/ui/progress.d.js +0 -0
  428. package/dist/components/ui/scroll-area.d.js +0 -0
  429. package/dist/components/ui/select.d.js +0 -0
  430. package/dist/components/ui/separator.d.js +0 -0
  431. package/dist/components/ui/table.d.js +0 -0
  432. package/dist/components/ui/textarea.d.js +0 -0
  433. package/dist/contexts/TeamContext.d.js +0 -0
  434. package/dist/hooks/useAuth.d.js +0 -0
  435. package/dist/hooks/useLastAuthMethod.d.js +0 -0
  436. package/dist/hooks/useOrigin.d.js +0 -0
  437. package/dist/lib/api/auth/dual-auth.d.js +0 -0
  438. package/dist/lib/api/auth.d.js +0 -0
  439. package/dist/lib/api/cache.d.js +0 -0
  440. package/dist/lib/api/keys.d.js +0 -0
  441. package/dist/lib/auth-client.d.js +0 -0
  442. package/dist/lib/auth-context.d.js +0 -0
  443. package/dist/lib/auth.d.js +0 -0
  444. package/dist/lib/billing/config-types.d.js +0 -0
  445. package/dist/lib/billing/enforcement.d.js +0 -0
  446. package/dist/lib/billing/helpers.d.js +0 -0
  447. package/dist/lib/billing/jobs.d.js +0 -0
  448. package/dist/lib/billing/types.d.js +0 -0
  449. package/dist/lib/blocks/loader.d.js +0 -0
  450. package/dist/lib/config/app.config.d.js +0 -0
  451. package/dist/lib/config/config-loader.d.js +0 -0
  452. package/dist/lib/config/config-sync.d.js +0 -0
  453. package/dist/lib/config/config-types.d.js +0 -0
  454. package/dist/lib/config/config-utils.d.js +0 -0
  455. package/dist/lib/config/dashboard-types.d.js +0 -0
  456. package/dist/lib/config/dashboard.config.d.js +0 -0
  457. package/dist/lib/config/icon-map.d.js +0 -0
  458. package/dist/lib/config/index.d.js +0 -7
  459. package/dist/lib/config/nextspark-types.d.js +0 -0
  460. package/dist/lib/config/roles-merge.d.js +0 -0
  461. package/dist/lib/config/types.d.js +0 -0
  462. package/dist/lib/db.d.js +0 -0
  463. package/dist/lib/email/factory.d.js +0 -0
  464. package/dist/lib/email/index.d.js +0 -3
  465. package/dist/lib/email/providers/console.d.js +0 -0
  466. package/dist/lib/email/providers/resend.d.js +0 -0
  467. package/dist/lib/email/templates.d.js +0 -0
  468. package/dist/lib/email/types.d.js +0 -0
  469. package/dist/lib/entities/types.d.js +0 -0
  470. package/dist/lib/permissions/system.d.js +0 -0
  471. package/dist/lib/permissions/types.d.js +0 -0
  472. package/dist/lib/plugins/hook-system.d.js +0 -0
  473. package/dist/lib/scheduled-actions/cleanup.d.js +0 -0
  474. package/dist/lib/scheduled-actions/index.d.js +0 -19
  475. package/dist/lib/scheduled-actions/initializer.d.js +0 -1
  476. package/dist/lib/scheduled-actions/processor.d.js +0 -0
  477. package/dist/lib/scheduled-actions/registry.d.js +0 -0
  478. package/dist/lib/scheduled-actions/scheduler.d.js +0 -0
  479. package/dist/lib/scheduled-actions/types.d.js +0 -0
  480. package/dist/lib/services/api-routes.service.d.js +0 -0
  481. package/dist/lib/services/entity-type.service.d.js +0 -0
  482. package/dist/lib/services/index.d.js +0 -40
  483. package/dist/lib/services/invoice.service.d.js +0 -0
  484. package/dist/lib/services/membership.service.d.js +0 -0
  485. package/dist/lib/services/meta.service.d.js +0 -0
  486. package/dist/lib/services/middleware.service.d.js +0 -0
  487. package/dist/lib/services/namespace.service.d.js +0 -0
  488. package/dist/lib/services/permission.service.d.js +0 -0
  489. package/dist/lib/services/plan.service.d.js +0 -0
  490. package/dist/lib/services/plugin.service.d.js +0 -0
  491. package/dist/lib/services/route-handler.service.d.js +0 -0
  492. package/dist/lib/services/scope.service.d.js +0 -0
  493. package/dist/lib/services/subscription.service.d.js +0 -0
  494. package/dist/lib/services/team-member.service.d.js +0 -0
  495. package/dist/lib/services/team.service.d.js +0 -0
  496. package/dist/lib/services/theme.service.d.js +0 -0
  497. package/dist/lib/services/usage.service.d.js +0 -0
  498. package/dist/lib/services/user-flags.service.d.js +0 -0
  499. package/dist/lib/services/user.service.d.js +0 -0
  500. package/dist/lib/teams/helpers.d.js +0 -0
  501. package/dist/lib/teams/permissions.d.js +0 -0
  502. package/dist/lib/teams/types.d.js +0 -0
  503. package/dist/lib/utils/config-merge.d.js +0 -0
  504. package/dist/lib/utils/file-logger.d.js +0 -0
  505. package/dist/lib/utils.d.js +0 -0
  506. package/dist/styles/classes.json +0 -1093
  507. package/dist/styles/ui.css +0 -2
  508. package/dist/types/auth.d.js +0 -0
  509. package/dist/types/blocks.d.js +0 -0
  510. package/dist/types/meta.types.d.js +0 -0
  511. package/dist/types/plugin.d.js +0 -0
  512. package/dist/types/testing.types.d.js +0 -0
  513. package/dist/types/theme.d.js +0 -0
  514. package/dist/types/user.types.d.js +0 -0
  515. package/scripts/build/build-ui-css.mjs +0 -351
  516. /package/dist/{components/app/layouts/PublicFooter.d.js → lib/auth/security-notifications/types.js} +0 -0
  517. /package/dist/{components/app/layouts/PublicNavbar.d.js → nextspark-registries.d.js} +0 -0
  518. /package/dist/{components/app/misc/ThemeToggle.d.js → types/use-intl-react-shim.d.js} +0 -0
@@ -0,0 +1,1639 @@
1
+ export declare const authClient: import("better-auth/react").ReactAuthClient<{
2
+ baseURL: string;
3
+ plugins: ({
4
+ id: "additional-fields-client";
5
+ version: string;
6
+ $InferServerPlugin: {
7
+ id: "additional-fields";
8
+ version: string;
9
+ schema: {
10
+ user: {
11
+ fields: {};
12
+ };
13
+ session: {
14
+ fields: {};
15
+ };
16
+ };
17
+ };
18
+ } | {
19
+ id: "email-otp";
20
+ version: string;
21
+ $InferServerPlugin: ReturnType<(options: import("better-auth/plugins").EmailOTPOptions) => {
22
+ id: "email-otp";
23
+ version: string;
24
+ init(ctx: import("better-auth").AuthContext): {
25
+ options: {
26
+ emailVerification: {
27
+ sendVerificationEmail(data: {
28
+ user: import("better-auth").User;
29
+ url: string;
30
+ token: string;
31
+ }, request: Request | undefined): Promise<void>;
32
+ };
33
+ };
34
+ } | undefined;
35
+ endpoints: {
36
+ sendVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/send-verification-otp", {
37
+ method: "POST";
38
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>[];
39
+ body: import("zod").ZodObject<{
40
+ email: import("zod").ZodString;
41
+ type: import("zod").ZodEnum<{
42
+ "sign-in": "sign-in";
43
+ "change-email": "change-email";
44
+ "email-verification": "email-verification";
45
+ "forget-password": "forget-password";
46
+ }>;
47
+ }, import("zod/v4/core").$strip>;
48
+ metadata: {
49
+ openapi: {
50
+ operationId: string;
51
+ description: string;
52
+ responses: {
53
+ 200: {
54
+ description: string;
55
+ content: {
56
+ "application/json": {
57
+ schema: {
58
+ type: "object";
59
+ properties: {
60
+ success: {
61
+ type: string;
62
+ };
63
+ };
64
+ };
65
+ };
66
+ };
67
+ };
68
+ };
69
+ };
70
+ };
71
+ }, {
72
+ success: boolean;
73
+ }>;
74
+ createVerificationOTP: import("better-auth").StrictEndpoint<string, {
75
+ method: "POST";
76
+ body: import("zod").ZodObject<{
77
+ email: import("zod").ZodString;
78
+ type: import("zod").ZodEnum<{
79
+ "sign-in": "sign-in";
80
+ "change-email": "change-email";
81
+ "email-verification": "email-verification";
82
+ "forget-password": "forget-password";
83
+ }>;
84
+ }, import("zod/v4/core").$strip>;
85
+ metadata: {
86
+ openapi: {
87
+ operationId: string;
88
+ description: string;
89
+ responses: {
90
+ 200: {
91
+ description: string;
92
+ content: {
93
+ "application/json": {
94
+ schema: {
95
+ type: "string";
96
+ };
97
+ };
98
+ };
99
+ };
100
+ };
101
+ };
102
+ };
103
+ }, string>;
104
+ getVerificationOTP: import("better-auth").StrictEndpoint<string, {
105
+ method: "GET";
106
+ query: import("zod").ZodObject<{
107
+ email: import("zod").ZodString;
108
+ type: import("zod").ZodEnum<{
109
+ "sign-in": "sign-in";
110
+ "change-email": "change-email";
111
+ "email-verification": "email-verification";
112
+ "forget-password": "forget-password";
113
+ }>;
114
+ }, import("zod/v4/core").$strip>;
115
+ metadata: {
116
+ openapi: {
117
+ operationId: string;
118
+ description: string;
119
+ responses: {
120
+ "200": {
121
+ description: string;
122
+ content: {
123
+ "application/json": {
124
+ schema: {
125
+ type: "object";
126
+ properties: {
127
+ otp: {
128
+ type: string;
129
+ nullable: boolean;
130
+ description: string;
131
+ };
132
+ };
133
+ required: string[];
134
+ };
135
+ };
136
+ };
137
+ };
138
+ };
139
+ };
140
+ };
141
+ }, {
142
+ otp: null;
143
+ } | {
144
+ otp: string;
145
+ }>;
146
+ checkVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/check-verification-otp", {
147
+ method: "POST";
148
+ body: import("zod").ZodObject<{
149
+ email: import("zod").ZodString;
150
+ type: import("zod").ZodEnum<{
151
+ "sign-in": "sign-in";
152
+ "change-email": "change-email";
153
+ "email-verification": "email-verification";
154
+ "forget-password": "forget-password";
155
+ }>;
156
+ otp: import("zod").ZodString;
157
+ }, import("zod/v4/core").$strip>;
158
+ metadata: {
159
+ openapi: {
160
+ operationId: string;
161
+ description: string;
162
+ responses: {
163
+ 200: {
164
+ description: string;
165
+ content: {
166
+ "application/json": {
167
+ schema: {
168
+ type: "object";
169
+ properties: {
170
+ success: {
171
+ type: string;
172
+ };
173
+ };
174
+ };
175
+ };
176
+ };
177
+ };
178
+ };
179
+ };
180
+ };
181
+ }, {
182
+ success: boolean;
183
+ }>;
184
+ verifyEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/verify-email", {
185
+ method: "POST";
186
+ body: import("zod").ZodObject<{
187
+ email: import("zod").ZodString;
188
+ otp: import("zod").ZodString;
189
+ }, import("zod/v4/core").$strip>;
190
+ metadata: {
191
+ openapi: {
192
+ description: string;
193
+ responses: {
194
+ 200: {
195
+ description: string;
196
+ content: {
197
+ "application/json": {
198
+ schema: {
199
+ type: "object";
200
+ properties: {
201
+ status: {
202
+ type: string;
203
+ description: string;
204
+ enum: boolean[];
205
+ };
206
+ token: {
207
+ type: string;
208
+ nullable: boolean;
209
+ description: string;
210
+ };
211
+ user: {
212
+ $ref: string;
213
+ };
214
+ };
215
+ required: string[];
216
+ };
217
+ };
218
+ };
219
+ };
220
+ };
221
+ };
222
+ };
223
+ }, {
224
+ status: boolean;
225
+ token: string;
226
+ user: {
227
+ id: string;
228
+ createdAt: Date;
229
+ updatedAt: Date;
230
+ email: string;
231
+ emailVerified: boolean;
232
+ name: string;
233
+ image?: string | null | undefined;
234
+ } & Record<string, any>;
235
+ } | {
236
+ status: boolean;
237
+ token: null;
238
+ user: {
239
+ id: string;
240
+ createdAt: Date;
241
+ updatedAt: Date;
242
+ email: string;
243
+ emailVerified: boolean;
244
+ name: string;
245
+ image?: string | null | undefined;
246
+ } & Record<string, any>;
247
+ }>;
248
+ signInEmailOTP: import("better-auth").StrictEndpoint<"/sign-in/email-otp", {
249
+ method: "POST";
250
+ body: import("zod").ZodIntersection<import("zod").ZodObject<{
251
+ email: import("zod").ZodString;
252
+ otp: import("zod").ZodString;
253
+ name: import("zod").ZodOptional<import("zod").ZodString>;
254
+ image: import("zod").ZodOptional<import("zod").ZodString>;
255
+ }, import("zod/v4/core").$strip>, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
256
+ metadata: {
257
+ openapi: {
258
+ operationId: string;
259
+ description: string;
260
+ responses: {
261
+ 200: {
262
+ description: string;
263
+ content: {
264
+ "application/json": {
265
+ schema: {
266
+ type: "object";
267
+ properties: {
268
+ token: {
269
+ type: string;
270
+ description: string;
271
+ };
272
+ user: {
273
+ $ref: string;
274
+ };
275
+ };
276
+ required: string[];
277
+ };
278
+ };
279
+ };
280
+ };
281
+ };
282
+ };
283
+ };
284
+ }, {
285
+ token: string;
286
+ user: {
287
+ id: string;
288
+ createdAt: Date;
289
+ updatedAt: Date;
290
+ email: string;
291
+ emailVerified: boolean;
292
+ name: string;
293
+ image?: string | null | undefined;
294
+ };
295
+ }>;
296
+ requestPasswordResetEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-password-reset", {
297
+ method: "POST";
298
+ body: import("zod").ZodObject<{
299
+ email: import("zod").ZodString;
300
+ }, import("zod/v4/core").$strip>;
301
+ metadata: {
302
+ openapi: {
303
+ operationId: string;
304
+ description: string;
305
+ responses: {
306
+ 200: {
307
+ description: string;
308
+ content: {
309
+ "application/json": {
310
+ schema: {
311
+ type: "object";
312
+ properties: {
313
+ success: {
314
+ type: string;
315
+ description: string;
316
+ };
317
+ };
318
+ };
319
+ };
320
+ };
321
+ };
322
+ };
323
+ };
324
+ };
325
+ }, {
326
+ success: boolean;
327
+ }>;
328
+ forgetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/forget-password/email-otp", {
329
+ method: "POST";
330
+ body: import("zod").ZodObject<{
331
+ email: import("zod").ZodString;
332
+ }, import("zod/v4/core").$strip>;
333
+ metadata: {
334
+ openapi: {
335
+ operationId: string;
336
+ description: string;
337
+ responses: {
338
+ 200: {
339
+ description: string;
340
+ content: {
341
+ "application/json": {
342
+ schema: {
343
+ type: "object";
344
+ properties: {
345
+ success: {
346
+ type: string;
347
+ description: string;
348
+ };
349
+ };
350
+ };
351
+ };
352
+ };
353
+ };
354
+ };
355
+ };
356
+ };
357
+ }, {
358
+ success: boolean;
359
+ }>;
360
+ resetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/reset-password", {
361
+ method: "POST";
362
+ body: import("zod").ZodObject<{
363
+ email: import("zod").ZodString;
364
+ otp: import("zod").ZodString;
365
+ password: import("zod").ZodString;
366
+ }, import("zod/v4/core").$strip>;
367
+ metadata: {
368
+ openapi: {
369
+ operationId: string;
370
+ description: string;
371
+ responses: {
372
+ 200: {
373
+ description: string;
374
+ content: {
375
+ "application/json": {
376
+ schema: {
377
+ type: "object";
378
+ properties: {
379
+ success: {
380
+ type: string;
381
+ };
382
+ };
383
+ };
384
+ };
385
+ };
386
+ };
387
+ };
388
+ };
389
+ };
390
+ }, {
391
+ success: boolean;
392
+ }>;
393
+ requestEmailChangeEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-email-change", {
394
+ method: "POST";
395
+ body: import("zod").ZodObject<{
396
+ newEmail: import("zod").ZodString;
397
+ otp: import("zod").ZodOptional<import("zod").ZodString>;
398
+ }, import("zod/v4/core").$strip>;
399
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
400
+ session: {
401
+ session: Record<string, any> & {
402
+ id: string;
403
+ createdAt: Date;
404
+ updatedAt: Date;
405
+ userId: string;
406
+ expiresAt: Date;
407
+ token: string;
408
+ ipAddress?: string | null | undefined;
409
+ userAgent?: string | null | undefined;
410
+ };
411
+ user: Record<string, any> & {
412
+ id: string;
413
+ createdAt: Date;
414
+ updatedAt: Date;
415
+ email: string;
416
+ emailVerified: boolean;
417
+ name: string;
418
+ image?: string | null | undefined;
419
+ };
420
+ };
421
+ }>>[];
422
+ metadata: {
423
+ openapi: {
424
+ operationId: string;
425
+ description: string;
426
+ responses: {
427
+ 200: {
428
+ description: string;
429
+ content: {
430
+ "application/json": {
431
+ schema: {
432
+ type: "object";
433
+ properties: {
434
+ success: {
435
+ type: string;
436
+ };
437
+ };
438
+ };
439
+ };
440
+ };
441
+ };
442
+ };
443
+ };
444
+ };
445
+ }, {
446
+ success: boolean;
447
+ }>;
448
+ changeEmailEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/change-email", {
449
+ method: "POST";
450
+ body: import("zod").ZodObject<{
451
+ newEmail: import("zod").ZodString;
452
+ otp: import("zod").ZodString;
453
+ }, import("zod/v4/core").$strip>;
454
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
455
+ session: {
456
+ session: Record<string, any> & {
457
+ id: string;
458
+ createdAt: Date;
459
+ updatedAt: Date;
460
+ userId: string;
461
+ expiresAt: Date;
462
+ token: string;
463
+ ipAddress?: string | null | undefined;
464
+ userAgent?: string | null | undefined;
465
+ };
466
+ user: Record<string, any> & {
467
+ id: string;
468
+ createdAt: Date;
469
+ updatedAt: Date;
470
+ email: string;
471
+ emailVerified: boolean;
472
+ name: string;
473
+ image?: string | null | undefined;
474
+ };
475
+ };
476
+ }>>[];
477
+ metadata: {
478
+ openapi: {
479
+ operationId: string;
480
+ description: string;
481
+ responses: {
482
+ 200: {
483
+ description: string;
484
+ content: {
485
+ "application/json": {
486
+ schema: {
487
+ type: "object";
488
+ properties: {
489
+ success: {
490
+ type: string;
491
+ };
492
+ };
493
+ };
494
+ };
495
+ };
496
+ };
497
+ };
498
+ };
499
+ };
500
+ }, {
501
+ success: boolean;
502
+ }>;
503
+ };
504
+ hooks: {
505
+ after: {
506
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
507
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
508
+ }[];
509
+ };
510
+ rateLimit: ({
511
+ pathMatcher(path: string): path is "/email-otp/send-verification-otp";
512
+ window: number;
513
+ max: number;
514
+ } | {
515
+ pathMatcher(path: string): path is "/email-otp/check-verification-otp";
516
+ window: number;
517
+ max: number;
518
+ } | {
519
+ pathMatcher(path: string): path is "/email-otp/verify-email";
520
+ window: number;
521
+ max: number;
522
+ } | {
523
+ pathMatcher(path: string): path is "/sign-in/email-otp";
524
+ window: number;
525
+ max: number;
526
+ } | {
527
+ pathMatcher(path: string): path is "/email-otp/request-password-reset";
528
+ window: number;
529
+ max: number;
530
+ } | {
531
+ pathMatcher(path: string): path is "/email-otp/reset-password";
532
+ window: number;
533
+ max: number;
534
+ } | {
535
+ pathMatcher(path: string): path is "/forget-password/email-otp";
536
+ window: number;
537
+ max: number;
538
+ } | {
539
+ pathMatcher(path: string): path is "/email-otp/request-email-change";
540
+ window: number;
541
+ max: number;
542
+ } | {
543
+ pathMatcher(path: string): path is "/email-otp/change-email";
544
+ window: number;
545
+ max: number;
546
+ })[];
547
+ options: import("better-auth/plugins").EmailOTPOptions;
548
+ $ERROR_CODES: {
549
+ OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
550
+ INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
551
+ TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
552
+ };
553
+ }>;
554
+ atomListeners: {
555
+ matcher: (path: string) => path is "/email-otp/verify-email" | "/sign-in/email-otp" | "/email-otp/request-email-change";
556
+ signal: "$sessionSignal";
557
+ }[];
558
+ $ERROR_CODES: {
559
+ OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
560
+ INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
561
+ TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
562
+ };
563
+ })[];
564
+ }>;
565
+ export declare const signIn: {
566
+ emailOtp: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
567
+ email: string;
568
+ otp: string;
569
+ name?: string;
570
+ image?: string;
571
+ } & Record<string, any>> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
572
+ email: string;
573
+ otp: string;
574
+ name?: string;
575
+ image?: string;
576
+ } & Record<string, any> & {
577
+ fetchOptions?: FetchOptions;
578
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<Omit<{
579
+ token: string;
580
+ user: {
581
+ id: string;
582
+ createdAt: Date;
583
+ updatedAt: Date;
584
+ email: string;
585
+ emailVerified: boolean;
586
+ name: string;
587
+ image?: string | null | undefined;
588
+ };
589
+ }, "user"> & {
590
+ user: import("better-auth").StripEmptyObjects<{
591
+ id: string;
592
+ createdAt: Date;
593
+ updatedAt: Date;
594
+ emailVerified: boolean;
595
+ name: string;
596
+ email?: string;
597
+ image?: string;
598
+ } & {} & {}>;
599
+ }, {
600
+ code?: string | undefined;
601
+ message?: string | undefined;
602
+ }, FetchOptions["throw"] extends true ? true : false>>;
603
+ } & {
604
+ social: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
605
+ provider: "google" | (string & {}) | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
606
+ callbackURL?: string;
607
+ newUserCallbackURL?: string;
608
+ errorCallbackURL?: string;
609
+ disableRedirect?: boolean;
610
+ idToken?: {
611
+ token: string;
612
+ nonce?: string;
613
+ accessToken?: string;
614
+ refreshToken?: string;
615
+ expiresAt?: number;
616
+ user?: {
617
+ name?: {
618
+ firstName?: string;
619
+ lastName?: string;
620
+ };
621
+ email?: string;
622
+ };
623
+ };
624
+ scopes?: string[];
625
+ requestSignUp?: boolean;
626
+ loginHint?: string;
627
+ additionalData?: Record<string, any>;
628
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
629
+ provider: "google" | (string & {}) | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
630
+ callbackURL?: string;
631
+ newUserCallbackURL?: string;
632
+ errorCallbackURL?: string;
633
+ disableRedirect?: boolean;
634
+ idToken?: {
635
+ token: string;
636
+ nonce?: string;
637
+ accessToken?: string;
638
+ refreshToken?: string;
639
+ expiresAt?: number;
640
+ user?: {
641
+ name?: {
642
+ firstName?: string;
643
+ lastName?: string;
644
+ };
645
+ email?: string;
646
+ };
647
+ };
648
+ scopes?: string[];
649
+ requestSignUp?: boolean;
650
+ loginHint?: string;
651
+ additionalData?: Record<string, any>;
652
+ } & {
653
+ fetchOptions?: FetchOptions;
654
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<{
655
+ redirect: boolean;
656
+ url: string;
657
+ } | (Omit<{
658
+ redirect: boolean;
659
+ token: string;
660
+ url: undefined;
661
+ user: {
662
+ id: string;
663
+ createdAt: Date;
664
+ updatedAt: Date;
665
+ email: string;
666
+ emailVerified: boolean;
667
+ name: string;
668
+ image?: string | null | undefined;
669
+ };
670
+ }, "user"> & {
671
+ user: import("better-auth").StripEmptyObjects<{
672
+ id: string;
673
+ createdAt: Date;
674
+ updatedAt: Date;
675
+ emailVerified: boolean;
676
+ name: string;
677
+ email?: string;
678
+ image?: string;
679
+ } & {} & {}>;
680
+ }), {
681
+ code?: string | undefined;
682
+ message?: string | undefined;
683
+ }, FetchOptions["throw"] extends true ? true : false>>;
684
+ } & {
685
+ email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
686
+ email: string;
687
+ password: string;
688
+ callbackURL?: string | undefined;
689
+ rememberMe?: boolean | undefined;
690
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
691
+ email: string;
692
+ password: string;
693
+ callbackURL?: string | undefined;
694
+ rememberMe?: boolean | undefined;
695
+ } & {
696
+ fetchOptions?: FetchOptions;
697
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<Omit<{
698
+ redirect: boolean;
699
+ token: string;
700
+ url?: string | undefined;
701
+ user: {
702
+ id: string;
703
+ createdAt: Date;
704
+ updatedAt: Date;
705
+ email: string;
706
+ emailVerified: boolean;
707
+ name: string;
708
+ image?: string | null | undefined;
709
+ };
710
+ }, "user"> & {
711
+ user: import("better-auth").StripEmptyObjects<{
712
+ id: string;
713
+ createdAt: Date;
714
+ updatedAt: Date;
715
+ emailVerified: boolean;
716
+ name: string;
717
+ email?: string;
718
+ image?: string;
719
+ } & {} & {}>;
720
+ }, {
721
+ code?: string | undefined;
722
+ message?: string | undefined;
723
+ }, FetchOptions["throw"] extends true ? true : false>>;
724
+ }, signUp: {
725
+ email: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
726
+ name: string;
727
+ email: string;
728
+ password: string;
729
+ image?: string | undefined;
730
+ callbackURL?: string | undefined;
731
+ rememberMe?: boolean | undefined;
732
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<import("node_modules/better-auth/dist/client/path-to-object.mjs").InferSignUpEmailCtx<{
733
+ baseURL: string;
734
+ plugins: ({
735
+ id: "additional-fields-client";
736
+ version: string;
737
+ $InferServerPlugin: {
738
+ id: "additional-fields";
739
+ version: string;
740
+ schema: {
741
+ user: {
742
+ fields: {};
743
+ };
744
+ session: {
745
+ fields: {};
746
+ };
747
+ };
748
+ };
749
+ } | {
750
+ id: "email-otp";
751
+ version: string;
752
+ $InferServerPlugin: ReturnType<(options: import("better-auth/plugins").EmailOTPOptions) => {
753
+ id: "email-otp";
754
+ version: string;
755
+ init(ctx: import("better-auth").AuthContext): {
756
+ options: {
757
+ emailVerification: {
758
+ sendVerificationEmail(data: {
759
+ user: {
760
+ id: string;
761
+ createdAt: Date;
762
+ updatedAt: Date;
763
+ emailVerified: boolean;
764
+ name: string;
765
+ email?: string;
766
+ image?: string;
767
+ };
768
+ url: string;
769
+ token: string;
770
+ }, request: Request | undefined): Promise<void>;
771
+ };
772
+ };
773
+ } | undefined;
774
+ endpoints: {
775
+ sendVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/send-verification-otp", {
776
+ method: "POST";
777
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>[];
778
+ body: import("zod").ZodObject<{
779
+ email: import("zod").ZodString;
780
+ type: import("zod").ZodEnum<{
781
+ "sign-in": "sign-in";
782
+ "change-email": "change-email";
783
+ "email-verification": "email-verification";
784
+ "forget-password": "forget-password";
785
+ }>;
786
+ }, import("zod/v4/core").$strip>;
787
+ metadata: {
788
+ openapi: {
789
+ operationId: string;
790
+ description: string;
791
+ responses: {
792
+ 200: {
793
+ description: string;
794
+ content: {
795
+ "application/json": {
796
+ schema: {
797
+ type: "object";
798
+ properties: {
799
+ success: {
800
+ type: string;
801
+ };
802
+ };
803
+ };
804
+ };
805
+ };
806
+ };
807
+ };
808
+ };
809
+ };
810
+ }, {
811
+ success: boolean;
812
+ }>;
813
+ createVerificationOTP: import("better-auth").StrictEndpoint<string, {
814
+ method: "POST";
815
+ body: import("zod").ZodObject<{
816
+ email: import("zod").ZodString;
817
+ type: import("zod").ZodEnum<{
818
+ "sign-in": "sign-in";
819
+ "change-email": "change-email";
820
+ "email-verification": "email-verification";
821
+ "forget-password": "forget-password";
822
+ }>;
823
+ }, import("zod/v4/core").$strip>;
824
+ metadata: {
825
+ openapi: {
826
+ operationId: string;
827
+ description: string;
828
+ responses: {
829
+ 200: {
830
+ description: string;
831
+ content: {
832
+ "application/json": {
833
+ schema: {
834
+ type: "string";
835
+ };
836
+ };
837
+ };
838
+ };
839
+ };
840
+ };
841
+ };
842
+ }, string>;
843
+ getVerificationOTP: import("better-auth").StrictEndpoint<string, {
844
+ method: "GET";
845
+ query: import("zod").ZodObject<{
846
+ email: import("zod").ZodString;
847
+ type: import("zod").ZodEnum<{
848
+ "sign-in": "sign-in";
849
+ "change-email": "change-email";
850
+ "email-verification": "email-verification";
851
+ "forget-password": "forget-password";
852
+ }>;
853
+ }, import("zod/v4/core").$strip>;
854
+ metadata: {
855
+ openapi: {
856
+ operationId: string;
857
+ description: string;
858
+ responses: {
859
+ "200": {
860
+ description: string;
861
+ content: {
862
+ "application/json": {
863
+ schema: {
864
+ type: "object";
865
+ properties: {
866
+ otp: {
867
+ type: string;
868
+ nullable: boolean;
869
+ description: string;
870
+ };
871
+ };
872
+ required: string[];
873
+ };
874
+ };
875
+ };
876
+ };
877
+ };
878
+ };
879
+ };
880
+ }, {
881
+ otp: null;
882
+ } | {
883
+ otp: string;
884
+ }>;
885
+ checkVerificationOTP: import("better-auth").StrictEndpoint<"/email-otp/check-verification-otp", {
886
+ method: "POST";
887
+ body: import("zod").ZodObject<{
888
+ email: import("zod").ZodString;
889
+ type: import("zod").ZodEnum<{
890
+ "sign-in": "sign-in";
891
+ "change-email": "change-email";
892
+ "email-verification": "email-verification";
893
+ "forget-password": "forget-password";
894
+ }>;
895
+ otp: import("zod").ZodString;
896
+ }, import("zod/v4/core").$strip>;
897
+ metadata: {
898
+ openapi: {
899
+ operationId: string;
900
+ description: string;
901
+ responses: {
902
+ 200: {
903
+ description: string;
904
+ content: {
905
+ "application/json": {
906
+ schema: {
907
+ type: "object";
908
+ properties: {
909
+ success: {
910
+ type: string;
911
+ };
912
+ };
913
+ };
914
+ };
915
+ };
916
+ };
917
+ };
918
+ };
919
+ };
920
+ }, {
921
+ success: boolean;
922
+ }>;
923
+ verifyEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/verify-email", {
924
+ method: "POST";
925
+ body: import("zod").ZodObject<{
926
+ email: import("zod").ZodString;
927
+ otp: import("zod").ZodString;
928
+ }, import("zod/v4/core").$strip>;
929
+ metadata: {
930
+ openapi: {
931
+ description: string;
932
+ responses: {
933
+ 200: {
934
+ description: string;
935
+ content: {
936
+ "application/json": {
937
+ schema: {
938
+ type: "object";
939
+ properties: {
940
+ status: {
941
+ type: string;
942
+ description: string;
943
+ enum: boolean[];
944
+ };
945
+ token: {
946
+ type: string;
947
+ nullable: boolean;
948
+ description: string;
949
+ };
950
+ user: {
951
+ $ref: string;
952
+ };
953
+ };
954
+ required: string[];
955
+ };
956
+ };
957
+ };
958
+ };
959
+ };
960
+ };
961
+ };
962
+ }, {
963
+ status: boolean;
964
+ token: string;
965
+ user: {
966
+ id: string;
967
+ createdAt: Date;
968
+ updatedAt: Date;
969
+ email: string;
970
+ emailVerified: boolean;
971
+ name: string;
972
+ image?: string | null | undefined;
973
+ } & Record<string, any>;
974
+ } | {
975
+ status: boolean;
976
+ token: null;
977
+ user: {
978
+ id: string;
979
+ createdAt: Date;
980
+ updatedAt: Date;
981
+ email: string;
982
+ emailVerified: boolean;
983
+ name: string;
984
+ image?: string | null | undefined;
985
+ } & Record<string, any>;
986
+ }>;
987
+ signInEmailOTP: import("better-auth").StrictEndpoint<"/sign-in/email-otp", {
988
+ method: "POST";
989
+ body: import("zod").ZodIntersection<import("zod").ZodObject<{
990
+ email: import("zod").ZodString;
991
+ otp: import("zod").ZodString;
992
+ name: import("zod").ZodOptional<import("zod").ZodString>;
993
+ image: import("zod").ZodOptional<import("zod").ZodString>;
994
+ }, import("zod/v4/core").$strip>, import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodAny>>;
995
+ metadata: {
996
+ openapi: {
997
+ operationId: string;
998
+ description: string;
999
+ responses: {
1000
+ 200: {
1001
+ description: string;
1002
+ content: {
1003
+ "application/json": {
1004
+ schema: {
1005
+ type: "object";
1006
+ properties: {
1007
+ token: {
1008
+ type: string;
1009
+ description: string;
1010
+ };
1011
+ user: {
1012
+ $ref: string;
1013
+ };
1014
+ };
1015
+ required: string[];
1016
+ };
1017
+ };
1018
+ };
1019
+ };
1020
+ };
1021
+ };
1022
+ };
1023
+ }, {
1024
+ token: string;
1025
+ user: {
1026
+ id: string;
1027
+ createdAt: Date;
1028
+ updatedAt: Date;
1029
+ email: string;
1030
+ emailVerified: boolean;
1031
+ name: string;
1032
+ image?: string | null | undefined;
1033
+ };
1034
+ }>;
1035
+ requestPasswordResetEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-password-reset", {
1036
+ method: "POST";
1037
+ body: import("zod").ZodObject<{
1038
+ email: import("zod").ZodString;
1039
+ }, import("zod/v4/core").$strip>;
1040
+ metadata: {
1041
+ openapi: {
1042
+ operationId: string;
1043
+ description: string;
1044
+ responses: {
1045
+ 200: {
1046
+ description: string;
1047
+ content: {
1048
+ "application/json": {
1049
+ schema: {
1050
+ type: "object";
1051
+ properties: {
1052
+ success: {
1053
+ type: string;
1054
+ description: string;
1055
+ };
1056
+ };
1057
+ };
1058
+ };
1059
+ };
1060
+ };
1061
+ };
1062
+ };
1063
+ };
1064
+ }, {
1065
+ success: boolean;
1066
+ }>;
1067
+ forgetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/forget-password/email-otp", {
1068
+ method: "POST";
1069
+ body: import("zod").ZodObject<{
1070
+ email: import("zod").ZodString;
1071
+ }, import("zod/v4/core").$strip>;
1072
+ metadata: {
1073
+ openapi: {
1074
+ operationId: string;
1075
+ description: string;
1076
+ responses: {
1077
+ 200: {
1078
+ description: string;
1079
+ content: {
1080
+ "application/json": {
1081
+ schema: {
1082
+ type: "object";
1083
+ properties: {
1084
+ success: {
1085
+ type: string;
1086
+ description: string;
1087
+ };
1088
+ };
1089
+ };
1090
+ };
1091
+ };
1092
+ };
1093
+ };
1094
+ };
1095
+ };
1096
+ }, {
1097
+ success: boolean;
1098
+ }>;
1099
+ resetPasswordEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/reset-password", {
1100
+ method: "POST";
1101
+ body: import("zod").ZodObject<{
1102
+ email: import("zod").ZodString;
1103
+ otp: import("zod").ZodString;
1104
+ password: import("zod").ZodString;
1105
+ }, import("zod/v4/core").$strip>;
1106
+ metadata: {
1107
+ openapi: {
1108
+ operationId: string;
1109
+ description: string;
1110
+ responses: {
1111
+ 200: {
1112
+ description: string;
1113
+ content: {
1114
+ "application/json": {
1115
+ schema: {
1116
+ type: "object";
1117
+ properties: {
1118
+ success: {
1119
+ type: string;
1120
+ };
1121
+ };
1122
+ };
1123
+ };
1124
+ };
1125
+ };
1126
+ };
1127
+ };
1128
+ };
1129
+ }, {
1130
+ success: boolean;
1131
+ }>;
1132
+ requestEmailChangeEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/request-email-change", {
1133
+ method: "POST";
1134
+ body: import("zod").ZodObject<{
1135
+ newEmail: import("zod").ZodString;
1136
+ otp: import("zod").ZodOptional<import("zod").ZodString>;
1137
+ }, import("zod/v4/core").$strip>;
1138
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1139
+ session: {
1140
+ session: Record<string, any> & {
1141
+ id: string;
1142
+ createdAt: Date;
1143
+ updatedAt: Date;
1144
+ userId: string;
1145
+ expiresAt: Date;
1146
+ token: string;
1147
+ ipAddress?: string | null | undefined;
1148
+ userAgent?: string | null | undefined;
1149
+ };
1150
+ user: Record<string, any> & {
1151
+ id: string;
1152
+ createdAt: Date;
1153
+ updatedAt: Date;
1154
+ email: string;
1155
+ emailVerified: boolean;
1156
+ name: string;
1157
+ image?: string | null | undefined;
1158
+ };
1159
+ };
1160
+ }>>[];
1161
+ metadata: {
1162
+ openapi: {
1163
+ operationId: string;
1164
+ description: string;
1165
+ responses: {
1166
+ 200: {
1167
+ description: string;
1168
+ content: {
1169
+ "application/json": {
1170
+ schema: {
1171
+ type: "object";
1172
+ properties: {
1173
+ success: {
1174
+ type: string;
1175
+ };
1176
+ };
1177
+ };
1178
+ };
1179
+ };
1180
+ };
1181
+ };
1182
+ };
1183
+ };
1184
+ }, {
1185
+ success: boolean;
1186
+ }>;
1187
+ changeEmailEmailOTP: import("better-auth").StrictEndpoint<"/email-otp/change-email", {
1188
+ method: "POST";
1189
+ body: import("zod").ZodObject<{
1190
+ newEmail: import("zod").ZodString;
1191
+ otp: import("zod").ZodString;
1192
+ }, import("zod/v4/core").$strip>;
1193
+ use: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<{
1194
+ session: {
1195
+ session: Record<string, any> & {
1196
+ id: string;
1197
+ createdAt: Date;
1198
+ updatedAt: Date;
1199
+ userId: string;
1200
+ expiresAt: Date;
1201
+ token: string;
1202
+ ipAddress?: string | null | undefined;
1203
+ userAgent?: string | null | undefined;
1204
+ };
1205
+ user: Record<string, any> & {
1206
+ id: string;
1207
+ createdAt: Date;
1208
+ updatedAt: Date;
1209
+ email: string;
1210
+ emailVerified: boolean;
1211
+ name: string;
1212
+ image?: string | null | undefined;
1213
+ };
1214
+ };
1215
+ }>>[];
1216
+ metadata: {
1217
+ openapi: {
1218
+ operationId: string;
1219
+ description: string;
1220
+ responses: {
1221
+ 200: {
1222
+ description: string;
1223
+ content: {
1224
+ "application/json": {
1225
+ schema: {
1226
+ type: "object";
1227
+ properties: {
1228
+ success: {
1229
+ type: string;
1230
+ };
1231
+ };
1232
+ };
1233
+ };
1234
+ };
1235
+ };
1236
+ };
1237
+ };
1238
+ };
1239
+ }, {
1240
+ success: boolean;
1241
+ }>;
1242
+ };
1243
+ hooks: {
1244
+ after: {
1245
+ matcher(context: import("better-auth").HookEndpointContext): boolean;
1246
+ handler: import("better-auth").Middleware<import("better-auth").MiddlewareOptions, (inputContext: import("better-auth").MiddlewareInputContext<import("better-auth").MiddlewareOptions>) => Promise<void>>;
1247
+ }[];
1248
+ };
1249
+ rateLimit: ({
1250
+ pathMatcher(path: string): path is "/email-otp/send-verification-otp";
1251
+ window: number;
1252
+ max: number;
1253
+ } | {
1254
+ pathMatcher(path: string): path is "/email-otp/check-verification-otp";
1255
+ window: number;
1256
+ max: number;
1257
+ } | {
1258
+ pathMatcher(path: string): path is "/email-otp/verify-email";
1259
+ window: number;
1260
+ max: number;
1261
+ } | {
1262
+ pathMatcher(path: string): path is "/sign-in/email-otp";
1263
+ window: number;
1264
+ max: number;
1265
+ } | {
1266
+ pathMatcher(path: string): path is "/email-otp/request-password-reset";
1267
+ window: number;
1268
+ max: number;
1269
+ } | {
1270
+ pathMatcher(path: string): path is "/email-otp/reset-password";
1271
+ window: number;
1272
+ max: number;
1273
+ } | {
1274
+ pathMatcher(path: string): path is "/forget-password/email-otp";
1275
+ window: number;
1276
+ max: number;
1277
+ } | {
1278
+ pathMatcher(path: string): path is "/email-otp/request-email-change";
1279
+ window: number;
1280
+ max: number;
1281
+ } | {
1282
+ pathMatcher(path: string): path is "/email-otp/change-email";
1283
+ window: number;
1284
+ max: number;
1285
+ })[];
1286
+ options: import("better-auth/plugins").EmailOTPOptions;
1287
+ $ERROR_CODES: {
1288
+ OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
1289
+ INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
1290
+ TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
1291
+ };
1292
+ }>;
1293
+ atomListeners: {
1294
+ matcher: (path: string) => path is "/email-otp/verify-email" | "/sign-in/email-otp" | "/email-otp/request-email-change";
1295
+ signal: "$sessionSignal";
1296
+ }[];
1297
+ $ERROR_CODES: {
1298
+ OTP_EXPIRED: import("better-auth").RawError<"OTP_EXPIRED">;
1299
+ INVALID_OTP: import("better-auth").RawError<"INVALID_OTP">;
1300
+ TOO_MANY_ATTEMPTS: import("better-auth").RawError<"TOO_MANY_ATTEMPTS">;
1301
+ };
1302
+ })[];
1303
+ }, FetchOptions>>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<(Omit<{
1304
+ token: null;
1305
+ user: {
1306
+ id: string;
1307
+ createdAt: Date;
1308
+ updatedAt: Date;
1309
+ email: string;
1310
+ emailVerified: boolean;
1311
+ name: string;
1312
+ image?: string | null | undefined;
1313
+ };
1314
+ }, "user"> & {
1315
+ user: import("better-auth").StripEmptyObjects<{
1316
+ id: string;
1317
+ createdAt: Date;
1318
+ updatedAt: Date;
1319
+ emailVerified: boolean;
1320
+ name: string;
1321
+ email?: string;
1322
+ image?: string;
1323
+ } & {} & {}>;
1324
+ }) | (Omit<{
1325
+ token: string;
1326
+ user: {
1327
+ id: string;
1328
+ createdAt: Date;
1329
+ updatedAt: Date;
1330
+ email: string;
1331
+ emailVerified: boolean;
1332
+ name: string;
1333
+ image?: string | null | undefined;
1334
+ };
1335
+ }, "user"> & {
1336
+ user: import("better-auth").StripEmptyObjects<{
1337
+ id: string;
1338
+ createdAt: Date;
1339
+ updatedAt: Date;
1340
+ emailVerified: boolean;
1341
+ name: string;
1342
+ email?: string;
1343
+ image?: string;
1344
+ } & {} & {}>;
1345
+ }), {
1346
+ code?: string | undefined;
1347
+ message?: string | undefined;
1348
+ }, FetchOptions["throw"] extends true ? true : false>>;
1349
+ }, signOut: <FetchOptions extends import("better-auth").ClientFetchOption<undefined, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0?: import("better-auth").Prettify<undefined>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<{
1350
+ success: boolean;
1351
+ }, {
1352
+ code?: string | undefined;
1353
+ message?: string | undefined;
1354
+ }, FetchOptions["throw"] extends true ? true : false>>, useSession: () => {
1355
+ data: {
1356
+ user: import("better-auth").StripEmptyObjects<{
1357
+ id: string;
1358
+ createdAt: Date;
1359
+ updatedAt: Date;
1360
+ emailVerified: boolean;
1361
+ name: string;
1362
+ email?: string;
1363
+ image?: string;
1364
+ } & {} & {}>;
1365
+ session: import("better-auth").StripEmptyObjects<{
1366
+ id: string;
1367
+ createdAt: Date;
1368
+ updatedAt: Date;
1369
+ userId: string;
1370
+ expiresAt: Date;
1371
+ token: string;
1372
+ ipAddress?: string;
1373
+ userAgent?: string;
1374
+ } & {} & {}>;
1375
+ };
1376
+ isPending: boolean;
1377
+ isRefetching: boolean;
1378
+ error: import("better-auth/react").BetterFetchError | null;
1379
+ refetch: (queryParams?: {
1380
+ query?: import("better-auth").SessionQueryParams;
1381
+ } | undefined) => Promise<void>;
1382
+ }, requestPasswordReset: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1383
+ email: string;
1384
+ redirectTo?: string;
1385
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
1386
+ email: string;
1387
+ redirectTo?: string;
1388
+ } & {
1389
+ fetchOptions?: FetchOptions;
1390
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<{
1391
+ status: boolean;
1392
+ message: string;
1393
+ }, {
1394
+ code?: string | undefined;
1395
+ message?: string | undefined;
1396
+ }, FetchOptions["throw"] extends true ? true : false>>, resetPassword: (<FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1397
+ newPassword: string;
1398
+ token?: string;
1399
+ }> & Record<string, any>, Partial<{
1400
+ token?: string;
1401
+ }> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
1402
+ newPassword: string;
1403
+ token?: string;
1404
+ } & {
1405
+ fetchOptions?: FetchOptions;
1406
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<{
1407
+ status: boolean;
1408
+ }, {
1409
+ code?: string | undefined;
1410
+ message?: string | undefined;
1411
+ }, FetchOptions["throw"] extends true ? true : false>>) & {
1412
+ ":token": <FetchOptions extends import("better-auth").ClientFetchOption<undefined, Partial<{
1413
+ callbackURL: string;
1414
+ }> & Record<string, any>, {
1415
+ token: string;
1416
+ }>>(data_0?: import("better-auth").Prettify<undefined>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<never, {
1417
+ code?: string | undefined;
1418
+ message?: string | undefined;
1419
+ }, FetchOptions["throw"] extends true ? true : false>>;
1420
+ }, verifyEmail: <FetchOptions extends import("better-auth").ClientFetchOption<undefined, Partial<{
1421
+ token: string;
1422
+ callbackURL?: string;
1423
+ }> & Record<string, any>, Record<string, string>>>(data_0?: import("better-auth").Prettify<undefined>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<NonNullable<void | {
1424
+ status: boolean;
1425
+ }>, {
1426
+ code?: string | undefined;
1427
+ message?: string | undefined;
1428
+ }, FetchOptions["throw"] extends true ? true : false>>, sendVerificationEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1429
+ email: string;
1430
+ callbackURL?: string;
1431
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
1432
+ email: string;
1433
+ callbackURL?: string;
1434
+ } & {
1435
+ fetchOptions?: FetchOptions;
1436
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<{
1437
+ status: boolean;
1438
+ }, {
1439
+ code?: string | undefined;
1440
+ message?: string | undefined;
1441
+ }, FetchOptions["throw"] extends true ? true : false>>, emailOtp: {
1442
+ sendVerificationOtp: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1443
+ email: string;
1444
+ type: "sign-in" | "email-verification" | "forget-password" | "change-email";
1445
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
1446
+ email: string;
1447
+ type: "sign-in" | "email-verification" | "forget-password" | "change-email";
1448
+ } & {
1449
+ fetchOptions?: FetchOptions;
1450
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<{
1451
+ success: boolean;
1452
+ }, {
1453
+ code?: string | undefined;
1454
+ message?: string | undefined;
1455
+ }, FetchOptions["throw"] extends true ? true : false>>;
1456
+ } & {
1457
+ checkVerificationOtp: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1458
+ email: string;
1459
+ type: "sign-in" | "email-verification" | "forget-password" | "change-email";
1460
+ otp: string;
1461
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
1462
+ email: string;
1463
+ type: "sign-in" | "email-verification" | "forget-password" | "change-email";
1464
+ otp: string;
1465
+ } & {
1466
+ fetchOptions?: FetchOptions;
1467
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<{
1468
+ success: boolean;
1469
+ }, {
1470
+ code?: string | undefined;
1471
+ message?: string | undefined;
1472
+ }, FetchOptions["throw"] extends true ? true : false>>;
1473
+ } & {
1474
+ verifyEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1475
+ email: string;
1476
+ otp: string;
1477
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
1478
+ email: string;
1479
+ otp: string;
1480
+ } & {
1481
+ fetchOptions?: FetchOptions;
1482
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<(Omit<{
1483
+ status: boolean;
1484
+ token: string;
1485
+ user: {
1486
+ id: string;
1487
+ createdAt: Date;
1488
+ updatedAt: Date;
1489
+ email: string;
1490
+ emailVerified: boolean;
1491
+ name: string;
1492
+ image?: string | null | undefined;
1493
+ } & Record<string, any>;
1494
+ }, "user"> & {
1495
+ user: import("better-auth").StripEmptyObjects<{
1496
+ id: string;
1497
+ createdAt: Date;
1498
+ updatedAt: Date;
1499
+ emailVerified: boolean;
1500
+ name: string;
1501
+ email?: string;
1502
+ image?: string;
1503
+ } & {} & {}>;
1504
+ }) | (Omit<{
1505
+ status: boolean;
1506
+ token: null;
1507
+ user: {
1508
+ id: string;
1509
+ createdAt: Date;
1510
+ updatedAt: Date;
1511
+ email: string;
1512
+ emailVerified: boolean;
1513
+ name: string;
1514
+ image?: string | null | undefined;
1515
+ } & Record<string, any>;
1516
+ }, "user"> & {
1517
+ user: import("better-auth").StripEmptyObjects<{
1518
+ id: string;
1519
+ createdAt: Date;
1520
+ updatedAt: Date;
1521
+ emailVerified: boolean;
1522
+ name: string;
1523
+ email?: string;
1524
+ image?: string;
1525
+ } & {} & {}>;
1526
+ }), {
1527
+ code?: string | undefined;
1528
+ message?: string | undefined;
1529
+ }, FetchOptions["throw"] extends true ? true : false>>;
1530
+ } & {
1531
+ requestPasswordReset: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1532
+ email: string;
1533
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
1534
+ email: string;
1535
+ } & {
1536
+ fetchOptions?: FetchOptions;
1537
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<{
1538
+ success: boolean;
1539
+ }, {
1540
+ code?: string | undefined;
1541
+ message?: string | undefined;
1542
+ }, FetchOptions["throw"] extends true ? true : false>>;
1543
+ } & {
1544
+ resetPassword: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1545
+ email: string;
1546
+ otp: string;
1547
+ password: string;
1548
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
1549
+ email: string;
1550
+ otp: string;
1551
+ password: string;
1552
+ } & {
1553
+ fetchOptions?: FetchOptions;
1554
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<{
1555
+ success: boolean;
1556
+ }, {
1557
+ code?: string | undefined;
1558
+ message?: string | undefined;
1559
+ }, FetchOptions["throw"] extends true ? true : false>>;
1560
+ } & {
1561
+ requestEmailChange: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1562
+ newEmail: string;
1563
+ otp?: string;
1564
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
1565
+ newEmail: string;
1566
+ otp?: string;
1567
+ } & {
1568
+ fetchOptions?: FetchOptions;
1569
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<{
1570
+ success: boolean;
1571
+ }, {
1572
+ code?: string | undefined;
1573
+ message?: string | undefined;
1574
+ }, FetchOptions["throw"] extends true ? true : false>>;
1575
+ } & {
1576
+ changeEmail: <FetchOptions extends import("better-auth").ClientFetchOption<Partial<{
1577
+ newEmail: string;
1578
+ otp: string;
1579
+ }> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, string>>>(data_0: import("better-auth").Prettify<{
1580
+ newEmail: string;
1581
+ otp: string;
1582
+ } & {
1583
+ fetchOptions?: FetchOptions;
1584
+ }>, data_1?: FetchOptions) => Promise<import("better-auth/react").BetterFetchResponse<{
1585
+ success: boolean;
1586
+ }, {
1587
+ code?: string | undefined;
1588
+ message?: string | undefined;
1589
+ }, FetchOptions["throw"] extends true ? true : false>>;
1590
+ };
1591
+ /**
1592
+ * Force a REAL session-cookie refresh from the browser.
1593
+ *
1594
+ * Better Auth renews a session (rolling `updateAge`) whenever `getSession` is
1595
+ * called — but the re-issued cookie only reaches the browser when the call runs
1596
+ * in a context that can write cookies (Route Handler / Server Action). Session
1597
+ * reads during Server Component render use `disableRefresh`, so an app that is
1598
+ * only ever opened through server-rendered pages (typical for an installed PWA)
1599
+ * would never get its cookie renewed.
1600
+ *
1601
+ * This helper hits Better Auth's own `GET /api/auth/get-session` endpoint —
1602
+ * served by the `app/api/auth/[...all]` Route Handler, where `Set-Cookie`
1603
+ * works — bypassing the cookie cache so the check reaches the database and the
1604
+ * renewal is applied when due. Wire it with `useSessionCookieRefresh()` /
1605
+ * `<SessionCookieRefresher />` (app open, tab visible again, back online).
1606
+ */
1607
+ export declare function refreshSessionCookie(): Promise<{
1608
+ data: {
1609
+ user: import("better-auth").StripEmptyObjects<{
1610
+ id: string;
1611
+ createdAt: Date;
1612
+ updatedAt: Date;
1613
+ emailVerified: boolean;
1614
+ name: string;
1615
+ email?: string;
1616
+ image?: string;
1617
+ } & {} & {}>;
1618
+ session: import("better-auth").StripEmptyObjects<{
1619
+ id: string;
1620
+ createdAt: Date;
1621
+ updatedAt: Date;
1622
+ userId: string;
1623
+ expiresAt: Date;
1624
+ token: string;
1625
+ ipAddress?: string;
1626
+ userAgent?: string;
1627
+ } & {} & {}>;
1628
+ };
1629
+ error: null;
1630
+ } | {
1631
+ data: null;
1632
+ error: {
1633
+ code?: string | undefined;
1634
+ message?: string | undefined;
1635
+ status: number;
1636
+ statusText: string;
1637
+ };
1638
+ }>;
1639
+ //# sourceMappingURL=auth-client.d.ts.map