@vitnode/core 1.2.0-canary.51 → 1.2.0-canary.53

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 (495) hide show
  1. package/config/next.config.ts +3 -3
  2. package/dist/scripts/get-config.d.ts +2 -2
  3. package/dist/scripts/get-config.d.ts.map +1 -1
  4. package/dist/scripts/plugin.d.ts.map +1 -1
  5. package/dist/scripts/prepare-database.d.ts.map +1 -1
  6. package/dist/scripts/prepare-plugins-files.d.ts.map +1 -1
  7. package/dist/scripts/scripts.js +4 -4
  8. package/dist/scripts/shared/file-utils.d.ts.map +1 -1
  9. package/dist/src/api/adapters/email/nodemailer.d.ts +1 -1
  10. package/dist/src/api/adapters/email/nodemailer.js +3 -3
  11. package/dist/src/api/adapters/email/resend.d.ts +1 -1
  12. package/dist/src/api/adapters/email/resend.js +2 -2
  13. package/dist/src/api/adapters/sso/discord.d.ts +1 -1
  14. package/dist/src/api/adapters/sso/discord.d.ts.map +1 -1
  15. package/dist/src/api/adapters/sso/discord.js +21 -21
  16. package/dist/src/api/adapters/sso/facebook.d.ts +1 -1
  17. package/dist/src/api/adapters/sso/facebook.d.ts.map +1 -1
  18. package/dist/src/api/adapters/sso/facebook.js +23 -23
  19. package/dist/src/api/adapters/sso/google.d.ts +1 -1
  20. package/dist/src/api/adapters/sso/google.d.ts.map +1 -1
  21. package/dist/src/api/adapters/sso/google.js +21 -21
  22. package/dist/src/api/config.d.ts +3 -3
  23. package/dist/src/api/config.d.ts.map +1 -1
  24. package/dist/src/api/config.js +11 -11
  25. package/dist/src/api/lib/check-plugin-id.js +8 -8
  26. package/dist/src/api/lib/logger-middleware.d.ts +1 -1
  27. package/dist/src/api/lib/logger-middleware.js +9 -9
  28. package/dist/src/api/lib/module.d.ts +2 -2
  29. package/dist/src/api/lib/plugin.d.ts +2 -2
  30. package/dist/src/api/lib/plugin.d.ts.map +1 -1
  31. package/dist/src/api/lib/route.d.ts +2 -2
  32. package/dist/src/api/lib/route.d.ts.map +1 -1
  33. package/dist/src/api/lib/route.js +1 -1
  34. package/dist/src/api/lib/with-pagination.d.ts +7 -7
  35. package/dist/src/api/lib/with-pagination.d.ts.map +1 -1
  36. package/dist/src/api/lib/with-pagination.js +37 -24
  37. package/dist/src/api/middlewares/captcha.middleware.d.ts +1 -1
  38. package/dist/src/api/middlewares/captcha.middleware.d.ts.map +1 -1
  39. package/dist/src/api/middlewares/captcha.middleware.js +14 -13
  40. package/dist/src/api/middlewares/global.middleware.d.ts +12 -20
  41. package/dist/src/api/middlewares/global.middleware.d.ts.map +1 -1
  42. package/dist/src/api/middlewares/global.middleware.js +29 -28
  43. package/dist/src/api/middlewares/rate-limiter.middleware.d.ts +3 -3
  44. package/dist/src/api/middlewares/rate-limiter.middleware.d.ts.map +1 -1
  45. package/dist/src/api/middlewares/rate-limiter.middleware.js +4 -4
  46. package/dist/src/api/models/device.d.ts +1 -1
  47. package/dist/src/api/models/device.d.ts.map +1 -1
  48. package/dist/src/api/models/device.js +13 -13
  49. package/dist/src/api/models/email.d.ts +27 -11
  50. package/dist/src/api/models/email.d.ts.map +1 -1
  51. package/dist/src/api/models/email.js +35 -22
  52. package/dist/src/api/models/password.d.ts +4 -0
  53. package/dist/src/api/models/password.d.ts.map +1 -1
  54. package/dist/src/api/models/password.js +15 -7
  55. package/dist/src/api/models/session-admin.d.ts +2 -1
  56. package/dist/src/api/models/session-admin.d.ts.map +1 -1
  57. package/dist/src/api/models/session-admin.js +19 -19
  58. package/dist/src/api/models/session.d.ts +2 -1
  59. package/dist/src/api/models/session.d.ts.map +1 -1
  60. package/dist/src/api/models/session.js +17 -17
  61. package/dist/src/api/models/sso.d.ts +1 -1
  62. package/dist/src/api/models/sso.d.ts.map +1 -1
  63. package/dist/src/api/models/sso.js +24 -24
  64. package/dist/src/api/models/user/get-user-by-id.d.ts +2 -1
  65. package/dist/src/api/models/user/get-user-by-id.d.ts.map +1 -1
  66. package/dist/src/api/models/user/get-user-by-id.js +3 -2
  67. package/dist/src/api/models/user/sign-in-with-passwords.d.ts +1 -1
  68. package/dist/src/api/models/user/sign-in-with-passwords.d.ts.map +1 -1
  69. package/dist/src/api/models/user/sign-in-with-passwords.js +1 -1
  70. package/dist/src/api/models/user/sign-up.d.ts +1 -1
  71. package/dist/src/api/models/user/sign-up.d.ts.map +1 -1
  72. package/dist/src/api/models/user/sign-up.js +13 -14
  73. package/dist/src/api/models/user.d.ts +1 -0
  74. package/dist/src/api/models/user.d.ts.map +1 -1
  75. package/dist/src/api/modules/admin/admin.module.d.ts +3 -3
  76. package/dist/src/api/modules/admin/admin.module.js +1 -1
  77. package/dist/src/api/modules/admin/debug/debug.admin.module.d.ts +1 -1
  78. package/dist/src/api/modules/admin/debug/debug.admin.module.js +1 -1
  79. package/dist/src/api/modules/admin/debug/routes/logs.route.d.ts +2 -2
  80. package/dist/src/api/modules/admin/debug/routes/logs.route.js +16 -16
  81. package/dist/src/api/modules/admin/routes/session.route.d.ts +2 -2
  82. package/dist/src/api/modules/admin/routes/session.route.js +7 -7
  83. package/dist/src/api/modules/admin/users/routes/list.route.d.ts +2 -2
  84. package/dist/src/api/modules/admin/users/routes/list.route.js +12 -12
  85. package/dist/src/api/modules/admin/users/routes/users.route.d.ts +2 -2
  86. package/dist/src/api/modules/admin/users/routes/users.route.js +15 -15
  87. package/dist/src/api/modules/admin/users/users.admin.module.d.ts +1 -1
  88. package/dist/src/api/modules/admin/users/users.admin.module.js +1 -1
  89. package/dist/src/api/modules/middleware/middleware.module.d.ts +1 -1
  90. package/dist/src/api/modules/middleware/middleware.module.js +1 -1
  91. package/dist/src/api/modules/middleware/route.d.ts +2 -2
  92. package/dist/src/api/modules/middleware/route.js +12 -12
  93. package/dist/src/api/modules/users/routes/change-password.route.d.ts +52 -0
  94. package/dist/src/api/modules/users/routes/change-password.route.d.ts.map +1 -0
  95. package/dist/src/api/modules/users/routes/change-password.route.js +58 -0
  96. package/dist/src/api/modules/users/routes/reset-passowrd.route.d.ts +42 -0
  97. package/dist/src/api/modules/users/routes/reset-passowrd.route.d.ts.map +1 -0
  98. package/dist/src/api/modules/users/routes/reset-passowrd.route.js +91 -0
  99. package/dist/src/api/modules/users/routes/session.route.d.ts +2 -2
  100. package/dist/src/api/modules/users/routes/session.route.js +6 -6
  101. package/dist/src/api/modules/users/routes/sign-in.route.d.ts +3 -3
  102. package/dist/src/api/modules/users/routes/sign-in.route.js +10 -10
  103. package/dist/src/api/modules/users/routes/sign-out.route.d.ts +2 -2
  104. package/dist/src/api/modules/users/routes/sign-out.route.js +7 -7
  105. package/dist/src/api/modules/users/routes/sign-up.route.d.ts +9 -3
  106. package/dist/src/api/modules/users/routes/sign-up.route.d.ts.map +1 -1
  107. package/dist/src/api/modules/users/routes/sign-up.route.js +18 -12
  108. package/dist/src/api/modules/users/routes/test.route.d.ts +3 -3
  109. package/dist/src/api/modules/users/routes/test.route.d.ts.map +1 -1
  110. package/dist/src/api/modules/users/routes/test.route.js +9 -15
  111. package/dist/src/api/modules/users/sso/routes/callback.route.d.ts +6 -3
  112. package/dist/src/api/modules/users/sso/routes/callback.route.d.ts.map +1 -1
  113. package/dist/src/api/modules/users/sso/routes/callback.route.js +10 -7
  114. package/dist/src/api/modules/users/sso/routes/create-url.route.d.ts +2 -2
  115. package/dist/src/api/modules/users/sso/routes/create-url.route.js +6 -6
  116. package/dist/src/api/modules/users/sso/sso.module.d.ts +6 -3
  117. package/dist/src/api/modules/users/sso/sso.module.d.ts.map +1 -1
  118. package/dist/src/api/modules/users/sso/sso.module.js +1 -1
  119. package/dist/src/api/modules/users/users.module.d.ts +103 -11
  120. package/dist/src/api/modules/users/users.module.d.ts.map +1 -1
  121. package/dist/src/api/modules/users/users.module.js +6 -2
  122. package/dist/src/app/login/page.d.ts +1 -1
  123. package/dist/src/app/login/page.js +2 -2
  124. package/dist/src/app/login/reset-password/page.d.ts +9 -0
  125. package/dist/src/app/login/reset-password/page.d.ts.map +1 -0
  126. package/dist/src/app/login/reset-password/page.js +18 -0
  127. package/dist/src/app/register/page.d.ts +1 -1
  128. package/dist/src/app/register/page.js +2 -2
  129. package/dist/src/app_admin/core/debug/page.d.ts +1 -1
  130. package/dist/src/app_admin/core/debug/page.js +8 -8
  131. package/dist/src/app_admin/core/users/page.d.ts +2 -2
  132. package/dist/src/app_admin/core/users/page.d.ts.map +1 -1
  133. package/dist/src/app_admin/core/users/page.js +7 -7
  134. package/dist/src/components/avatar.d.ts +1 -1
  135. package/dist/src/components/avatar.js +1 -1
  136. package/dist/src/components/confirm-action/confirm-action-alert-dialog.d.ts +2 -2
  137. package/dist/src/components/confirm-action/confirm-action-alert-dialog.js +5 -5
  138. package/dist/src/components/confirm-action/content.d.ts.map +1 -1
  139. package/dist/src/components/confirm-action/content.js +3 -4
  140. package/dist/src/components/date-format.js +8 -8
  141. package/dist/src/components/form/auto-form.d.ts +17 -16
  142. package/dist/src/components/form/auto-form.d.ts.map +1 -1
  143. package/dist/src/components/form/auto-form.js +15 -13
  144. package/dist/src/components/form/common/desc.js +1 -1
  145. package/dist/src/components/form/common/label.d.ts +4 -2
  146. package/dist/src/components/form/common/label.d.ts.map +1 -1
  147. package/dist/src/components/form/common/label.js +14 -4
  148. package/dist/src/components/form/fields/checkbox.d.ts +3 -3
  149. package/dist/src/components/form/fields/checkbox.d.ts.map +1 -1
  150. package/dist/src/components/form/fields/checkbox.js +2 -1
  151. package/dist/src/components/form/fields/combobox-async.d.ts +4 -4
  152. package/dist/src/components/form/fields/combobox-async.d.ts.map +1 -1
  153. package/dist/src/components/form/fields/combobox-async.js +31 -24
  154. package/dist/src/components/form/fields/combobox.d.ts +4 -4
  155. package/dist/src/components/form/fields/combobox.d.ts.map +1 -1
  156. package/dist/src/components/form/fields/combobox.js +8 -8
  157. package/dist/src/components/form/fields/input.d.ts +3 -3
  158. package/dist/src/components/form/fields/input.d.ts.map +1 -1
  159. package/dist/src/components/form/fields/input.js +4 -3
  160. package/dist/src/components/form/fields/radio-group.d.ts +4 -4
  161. package/dist/src/components/form/fields/radio-group.d.ts.map +1 -1
  162. package/dist/src/components/form/fields/radio-group.js +2 -2
  163. package/dist/src/components/form/fields/select.d.ts +4 -4
  164. package/dist/src/components/form/fields/select.d.ts.map +1 -1
  165. package/dist/src/components/form/fields/select.js +4 -4
  166. package/dist/src/components/form/fields/switch.d.ts +3 -3
  167. package/dist/src/components/form/fields/switch.d.ts.map +1 -1
  168. package/dist/src/components/form/fields/switch.js +2 -1
  169. package/dist/src/components/form/fields/textarea.d.ts +4 -4
  170. package/dist/src/components/form/fields/textarea.d.ts.map +1 -1
  171. package/dist/src/components/form/fields/textarea.js +3 -3
  172. package/dist/src/components/i18n-provider.d.ts +2 -2
  173. package/dist/src/components/i18n-provider.js +3 -3
  174. package/dist/src/components/logo-vitnode.d.ts.map +1 -1
  175. package/dist/src/components/logo-vitnode.js +8 -2
  176. package/dist/src/components/switchers/langs/language-swietcher.d.ts +1 -1
  177. package/dist/src/components/switchers/langs/language-swietcher.d.ts.map +1 -1
  178. package/dist/src/components/switchers/langs/language-swietcher.js +3 -3
  179. package/dist/src/components/switchers/themes/theme-switcher.js +4 -4
  180. package/dist/src/components/table/content.d.ts +1 -1
  181. package/dist/src/components/table/content.d.ts.map +1 -1
  182. package/dist/src/components/table/content.js +5 -5
  183. package/dist/src/components/table/data-table.d.ts +7 -7
  184. package/dist/src/components/table/data-table.d.ts.map +1 -1
  185. package/dist/src/components/table/data-table.js +22 -15
  186. package/dist/src/components/table/order-table-head.d.ts +4 -4
  187. package/dist/src/components/table/order-table-head.d.ts.map +1 -1
  188. package/dist/src/components/table/order-table-head.js +20 -9
  189. package/dist/src/components/table/pagination.js +19 -19
  190. package/dist/src/components/ui/accordion.d.ts +2 -2
  191. package/dist/src/components/ui/accordion.d.ts.map +1 -1
  192. package/dist/src/components/ui/accordion.js +4 -5
  193. package/dist/src/components/ui/alert-dialog.d.ts +7 -7
  194. package/dist/src/components/ui/alert-dialog.d.ts.map +1 -1
  195. package/dist/src/components/ui/alert-dialog.js +13 -14
  196. package/dist/src/components/ui/alert.d.ts +6 -6
  197. package/dist/src/components/ui/alert.d.ts.map +1 -1
  198. package/dist/src/components/ui/alert.js +6 -7
  199. package/dist/src/components/ui/badge.d.ts +4 -4
  200. package/dist/src/components/ui/badge.d.ts.map +1 -1
  201. package/dist/src/components/ui/badge.js +7 -8
  202. package/dist/src/components/ui/button-client.d.ts +1 -1
  203. package/dist/src/components/ui/button-client.js +9 -9
  204. package/dist/src/components/ui/button.d.ts +9 -9
  205. package/dist/src/components/ui/button.d.ts.map +1 -1
  206. package/dist/src/components/ui/button.js +14 -15
  207. package/dist/src/components/ui/card.d.ts +8 -8
  208. package/dist/src/components/ui/card.d.ts.map +1 -1
  209. package/dist/src/components/ui/card.js +7 -8
  210. package/dist/src/components/ui/checkbox.d.ts +2 -2
  211. package/dist/src/components/ui/checkbox.d.ts.map +1 -1
  212. package/dist/src/components/ui/checkbox.js +2 -3
  213. package/dist/src/components/ui/collapsible.d.ts +1 -1
  214. package/dist/src/components/ui/collapsible.js +1 -1
  215. package/dist/src/components/ui/command.d.ts +4 -4
  216. package/dist/src/components/ui/command.d.ts.map +1 -1
  217. package/dist/src/components/ui/command.js +9 -10
  218. package/dist/src/components/ui/context-menu.d.ts +4 -4
  219. package/dist/src/components/ui/context-menu.d.ts.map +1 -1
  220. package/dist/src/components/ui/context-menu.js +7 -8
  221. package/dist/src/components/ui/dialog.d.ts +6 -6
  222. package/dist/src/components/ui/dialog.d.ts.map +1 -1
  223. package/dist/src/components/ui/dialog.js +16 -16
  224. package/dist/src/components/ui/drawer.d.ts +4 -4
  225. package/dist/src/components/ui/drawer.d.ts.map +1 -1
  226. package/dist/src/components/ui/drawer.js +7 -8
  227. package/dist/src/components/ui/dropdown-menu.d.ts +4 -4
  228. package/dist/src/components/ui/dropdown-menu.d.ts.map +1 -1
  229. package/dist/src/components/ui/dropdown-menu.js +8 -9
  230. package/dist/src/components/ui/form.d.ts +10 -10
  231. package/dist/src/components/ui/form.d.ts.map +1 -1
  232. package/dist/src/components/ui/form.js +15 -15
  233. package/dist/src/components/ui/header-content.js +1 -1
  234. package/dist/src/components/ui/hover-card.d.ts +2 -2
  235. package/dist/src/components/ui/hover-card.d.ts.map +1 -1
  236. package/dist/src/components/ui/hover-card.js +3 -4
  237. package/dist/src/components/ui/input-otp.d.ts +5 -5
  238. package/dist/src/components/ui/input-otp.d.ts.map +1 -1
  239. package/dist/src/components/ui/input-otp.js +6 -7
  240. package/dist/src/components/ui/input.d.ts +2 -2
  241. package/dist/src/components/ui/input.d.ts.map +1 -1
  242. package/dist/src/components/ui/input.js +1 -2
  243. package/dist/src/components/ui/label.d.ts +2 -2
  244. package/dist/src/components/ui/label.d.ts.map +1 -1
  245. package/dist/src/components/ui/label.js +2 -3
  246. package/dist/src/components/ui/loader.js +3 -3
  247. package/dist/src/components/ui/menubar.d.ts +4 -4
  248. package/dist/src/components/ui/menubar.d.ts.map +1 -1
  249. package/dist/src/components/ui/menubar.js +11 -12
  250. package/dist/src/components/ui/navigation-menu.d.ts +2 -2
  251. package/dist/src/components/ui/navigation-menu.d.ts.map +1 -1
  252. package/dist/src/components/ui/navigation-menu.js +10 -11
  253. package/dist/src/components/ui/popover.d.ts +3 -3
  254. package/dist/src/components/ui/popover.d.ts.map +1 -1
  255. package/dist/src/components/ui/popover.js +4 -4
  256. package/dist/src/components/ui/progress.d.ts +2 -2
  257. package/dist/src/components/ui/progress.d.ts.map +1 -1
  258. package/dist/src/components/ui/progress.js +2 -3
  259. package/dist/src/components/ui/radio-group.d.ts +2 -2
  260. package/dist/src/components/ui/radio-group.d.ts.map +1 -1
  261. package/dist/src/components/ui/radio-group.js +3 -4
  262. package/dist/src/components/ui/select.d.ts +3 -3
  263. package/dist/src/components/ui/select.d.ts.map +1 -1
  264. package/dist/src/components/ui/select.js +9 -10
  265. package/dist/src/components/ui/separator.d.ts +2 -2
  266. package/dist/src/components/ui/separator.d.ts.map +1 -1
  267. package/dist/src/components/ui/separator.js +3 -4
  268. package/dist/src/components/ui/sheet.d.ts +5 -5
  269. package/dist/src/components/ui/sheet.d.ts.map +1 -1
  270. package/dist/src/components/ui/sheet.js +8 -9
  271. package/dist/src/components/ui/sidebar.d.ts +31 -31
  272. package/dist/src/components/ui/sidebar.d.ts.map +1 -1
  273. package/dist/src/components/ui/sidebar.js +67 -69
  274. package/dist/src/components/ui/skeleton.d.ts +1 -1
  275. package/dist/src/components/ui/skeleton.js +1 -1
  276. package/dist/src/components/ui/slider.d.ts +2 -2
  277. package/dist/src/components/ui/slider.d.ts.map +1 -1
  278. package/dist/src/components/ui/slider.js +16 -8
  279. package/dist/src/components/ui/sonner.d.ts +1 -1
  280. package/dist/src/components/ui/sonner.d.ts.map +1 -1
  281. package/dist/src/components/ui/sonner.js +6 -6
  282. package/dist/src/components/ui/switch.d.ts +2 -2
  283. package/dist/src/components/ui/switch.d.ts.map +1 -1
  284. package/dist/src/components/ui/switch.js +3 -4
  285. package/dist/src/components/ui/table.d.ts +9 -9
  286. package/dist/src/components/ui/table.d.ts.map +1 -1
  287. package/dist/src/components/ui/table.js +8 -9
  288. package/dist/src/components/ui/tabs.d.ts +2 -2
  289. package/dist/src/components/ui/tabs.d.ts.map +1 -1
  290. package/dist/src/components/ui/tabs.js +4 -5
  291. package/dist/src/components/ui/textarea.d.ts +2 -2
  292. package/dist/src/components/ui/textarea.d.ts.map +1 -1
  293. package/dist/src/components/ui/textarea.js +1 -2
  294. package/dist/src/components/ui/toggle-group.d.ts +4 -4
  295. package/dist/src/components/ui/toggle-group.d.ts.map +1 -1
  296. package/dist/src/components/ui/toggle-group.js +6 -6
  297. package/dist/src/components/ui/toggle.d.ts +3 -3
  298. package/dist/src/components/ui/toggle.d.ts.map +1 -1
  299. package/dist/src/components/ui/toggle.js +8 -9
  300. package/dist/src/components/ui/tooltip.d.ts +3 -3
  301. package/dist/src/components/ui/tooltip.d.ts.map +1 -1
  302. package/dist/src/components/ui/tooltip.js +8 -10
  303. package/dist/src/config.js +2 -2
  304. package/dist/src/database/admins.js +10 -10
  305. package/dist/src/database/languages.js +7 -7
  306. package/dist/src/database/logs.js +9 -9
  307. package/dist/src/database/moderators.js +5 -5
  308. package/dist/src/database/roles.js +1 -1
  309. package/dist/src/database/sessions.js +6 -6
  310. package/dist/src/database/users.d.ts +21 -2
  311. package/dist/src/database/users.d.ts.map +1 -1
  312. package/dist/src/database/users.js +18 -15
  313. package/dist/src/drizzle.config.d.ts +2 -2
  314. package/dist/src/drizzle.config.d.ts.map +1 -1
  315. package/dist/src/drizzle.config.js +19 -12
  316. package/dist/src/emails/default-template.d.ts +34 -22
  317. package/dist/src/emails/default-template.d.ts.map +1 -1
  318. package/dist/src/emails/default-template.js +61 -66
  319. package/dist/src/emails/reset-password.d.ts +56 -0
  320. package/dist/src/emails/reset-password.d.ts.map +1 -0
  321. package/dist/src/emails/reset-password.js +132 -0
  322. package/dist/src/emails/ui/button.d.ts +9 -0
  323. package/dist/src/emails/ui/button.d.ts.map +1 -0
  324. package/dist/src/emails/ui/button.js +36 -0
  325. package/dist/src/emails/ui/card.d.ts +8 -0
  326. package/dist/src/emails/ui/card.d.ts.map +1 -0
  327. package/dist/src/emails/ui/card.js +39 -0
  328. package/dist/src/hooks/use-before-unload.js +3 -3
  329. package/dist/src/hooks/use-captcha.d.ts +2 -2
  330. package/dist/src/hooks/use-captcha.d.ts.map +1 -1
  331. package/dist/src/hooks/use-captcha.js +64 -40
  332. package/dist/src/hooks/use-mobile.d.ts.map +1 -1
  333. package/dist/src/hooks/use-mobile.js +3 -4
  334. package/dist/src/lib/api/get-middleware-api.js +4 -4
  335. package/dist/src/lib/api/get-session-admin-api.js +5 -5
  336. package/dist/src/lib/api/get-session-api.js +4 -4
  337. package/dist/src/lib/colors.js +28 -19
  338. package/dist/src/lib/colors.test.js +60 -60
  339. package/dist/src/lib/config.js +3 -3
  340. package/dist/src/lib/fetcher/cookie-from-string-to-object.d.ts.map +1 -1
  341. package/dist/src/lib/fetcher/cookie-from-string-to-object.js +1 -1
  342. package/dist/src/lib/fetcher/cookie-from-string-to-object.test.js +27 -27
  343. package/dist/src/lib/fetcher/core.d.ts +5 -5
  344. package/dist/src/lib/fetcher/core.d.ts.map +1 -1
  345. package/dist/src/lib/fetcher/core.js +16 -10
  346. package/dist/src/lib/fetcher/helpers-server.d.ts +1 -1
  347. package/dist/src/lib/fetcher/helpers-server.js +1 -1
  348. package/dist/src/lib/fetcher/helpers.test.js +17 -17
  349. package/dist/src/lib/fetcher/types.d.ts +26 -26
  350. package/dist/src/lib/fetcher/types.d.ts.map +1 -1
  351. package/dist/src/lib/fetcher-client.d.ts +4 -4
  352. package/dist/src/lib/fetcher-client.d.ts.map +1 -1
  353. package/dist/src/lib/fetcher-client.js +3 -3
  354. package/dist/src/lib/fetcher.d.ts +5 -5
  355. package/dist/src/lib/fetcher.d.ts.map +1 -1
  356. package/dist/src/lib/fetcher.js +4 -4
  357. package/dist/src/lib/helpers/auto-form.d.ts +3 -3
  358. package/dist/src/lib/helpers/auto-form.d.ts.map +1 -1
  359. package/dist/src/lib/helpers/auto-form.js +16 -15
  360. package/dist/src/lib/helpers/auto-form.test.js +129 -129
  361. package/dist/src/lib/navigation.d.ts +2 -2
  362. package/dist/src/lib/navigation.d.ts.map +1 -1
  363. package/dist/src/lib/plugin.d.ts +3 -3
  364. package/dist/src/lib/special-characters.js +1 -1
  365. package/dist/src/lib/special-characters.test.js +36 -36
  366. package/dist/src/lib/utils.d.ts +1 -1
  367. package/dist/src/tests/setup.d.ts +1 -1
  368. package/dist/src/views/admin/layouts/admin-layout.d.ts +1 -1
  369. package/dist/src/views/admin/layouts/admin-layout.d.ts.map +1 -1
  370. package/dist/src/views/admin/layouts/admin-layout.js +4 -8
  371. package/dist/src/views/admin/layouts/sidebar/nav/item.d.ts.map +1 -1
  372. package/dist/src/views/admin/layouts/sidebar/nav/item.js +11 -12
  373. package/dist/src/views/admin/layouts/sidebar/nav/nav.d.ts +1 -1
  374. package/dist/src/views/admin/layouts/sidebar/nav/nav.js +11 -11
  375. package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts +1 -1
  376. package/dist/src/views/admin/layouts/sidebar/sidebar.d.ts.map +1 -1
  377. package/dist/src/views/admin/layouts/sidebar/sidebar.js +1 -2
  378. package/dist/src/views/admin/layouts/sidebar/sign-out.js +1 -1
  379. package/dist/src/views/admin/layouts/user-bar/client.js +5 -5
  380. package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts +1 -1
  381. package/dist/src/views/admin/layouts/user-bar/user-bar.d.ts.map +1 -1
  382. package/dist/src/views/admin/layouts/user-bar/user-bar.js +1 -1
  383. package/dist/src/views/admin/sign-in/sign-in-admin-view.js +3 -2
  384. package/dist/src/views/admin/views/core/dashboard/dashboard-admin-view.js +3 -3
  385. package/dist/src/views/admin/views/core/debug/actions/clear-cache/clear-cache.js +10 -10
  386. package/dist/src/views/admin/views/core/debug/actions/clear-cache/mutation-api.js +2 -2
  387. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts +1 -1
  388. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.d.ts.map +1 -1
  389. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/content.js +15 -15
  390. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.d.ts +1 -1
  391. package/dist/src/views/admin/views/core/debug/system-logs/actions/more/more.js +7 -7
  392. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.d.ts.map +1 -1
  393. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-status.js +7 -1
  394. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.d.ts +1 -1
  395. package/dist/src/views/admin/views/core/debug/system-logs/badges/badge-type-log.js +3 -3
  396. package/dist/src/views/admin/views/core/debug/system-logs/system-logs-view.js +25 -25
  397. package/dist/src/views/admin/views/core/test.js +43 -43
  398. package/dist/src/views/admin/views/core/users/users-admin-view.d.ts.map +1 -1
  399. package/dist/src/views/admin/views/core/users/users-admin-view.js +13 -14
  400. package/dist/src/views/auth/password-reset/change-password-form/form.d.ts +5 -0
  401. package/dist/src/views/auth/password-reset/change-password-form/form.d.ts.map +1 -0
  402. package/dist/src/views/auth/password-reset/change-password-form/form.js +48 -0
  403. package/dist/src/views/auth/password-reset/change-password-form/mutation-api.d.ts +6 -0
  404. package/dist/src/views/auth/password-reset/change-password-form/mutation-api.d.ts.map +1 -0
  405. package/dist/src/views/auth/password-reset/change-password-form/mutation-api.js +22 -0
  406. package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts +11 -0
  407. package/dist/src/views/auth/password-reset/change-password-form/use-form.d.ts.map +1 -0
  408. package/dist/src/views/auth/password-reset/change-password-form/use-form.js +36 -0
  409. package/dist/src/views/auth/password-reset/form/form.d.ts +6 -0
  410. package/dist/src/views/auth/password-reset/form/form.d.ts.map +1 -0
  411. package/dist/src/views/auth/password-reset/form/form.js +104 -0
  412. package/dist/src/views/auth/password-reset/form/mutation-api.d.ts +7 -0
  413. package/dist/src/views/auth/password-reset/form/mutation-api.d.ts.map +1 -0
  414. package/dist/src/views/auth/password-reset/form/mutation-api.js +21 -0
  415. package/dist/src/views/auth/password-reset/form/use-form.d.ts +12 -0
  416. package/dist/src/views/auth/password-reset/form/use-form.d.ts.map +1 -0
  417. package/dist/src/views/auth/password-reset/form/use-form.js +33 -0
  418. package/dist/src/views/auth/password-reset/password-reset-view.d.ts +7 -0
  419. package/dist/src/views/auth/password-reset/password-reset-view.d.ts.map +1 -0
  420. package/dist/src/views/auth/password-reset/password-reset-view.js +37 -0
  421. package/dist/src/views/auth/sign-in/form/form.d.ts +2 -1
  422. package/dist/src/views/auth/sign-in/form/form.d.ts.map +1 -1
  423. package/dist/src/views/auth/sign-in/form/form.js +15 -10
  424. package/dist/src/views/auth/sign-in/form/mutation-api.d.ts +2 -2
  425. package/dist/src/views/auth/sign-in/form/mutation-api.d.ts.map +1 -1
  426. package/dist/src/views/auth/sign-in/form/mutation-api.js +10 -10
  427. package/dist/src/views/auth/sign-in/form/use-form.d.ts +2 -2
  428. package/dist/src/views/auth/sign-in/form/use-form.js +11 -11
  429. package/dist/src/views/auth/sign-in/sign-in-view.d.ts.map +1 -1
  430. package/dist/src/views/auth/sign-in/sign-in-view.js +13 -7
  431. package/dist/src/views/auth/{components → sign-up/components}/password-input.d.ts +3 -3
  432. package/dist/src/views/auth/sign-up/components/password-input.d.ts.map +1 -0
  433. package/dist/src/views/auth/{components → sign-up/components}/password-input.js +13 -14
  434. package/dist/src/views/auth/sign-up/email-confirmation-view.js +4 -4
  435. package/dist/src/views/auth/sign-up/form/form.d.ts +2 -2
  436. package/dist/src/views/auth/sign-up/form/form.d.ts.map +1 -1
  437. package/dist/src/views/auth/sign-up/form/form.js +20 -33
  438. package/dist/src/views/auth/sign-up/form/mutation-api.d.ts +3 -3
  439. package/dist/src/views/auth/sign-up/form/mutation-api.d.ts.map +1 -1
  440. package/dist/src/views/auth/sign-up/form/mutation-api.js +6 -6
  441. package/dist/src/views/auth/sign-up/form/use-form.d.ts +3 -8
  442. package/dist/src/views/auth/sign-up/form/use-form.d.ts.map +1 -1
  443. package/dist/src/views/auth/sign-up/form/use-form.js +27 -24
  444. package/dist/src/views/auth/sign-up/sign-up-view.js +6 -6
  445. package/dist/src/views/auth/sign-up/wrapper.d.ts +1 -1
  446. package/dist/src/views/auth/sign-up/wrapper.d.ts.map +1 -1
  447. package/dist/src/views/auth/sign-up/wrapper.js +5 -8
  448. package/dist/src/views/auth/sso/buttons/client.js +4 -4
  449. package/dist/src/views/auth/sso/buttons/mutation-api.js +5 -5
  450. package/dist/src/views/auth/sso/buttons/sso-buttons.js +2 -2
  451. package/dist/src/views/auth/sso/callback/callback-sso-view.d.ts.map +1 -1
  452. package/dist/src/views/auth/sso/callback/callback-sso-view.js +21 -7
  453. package/dist/src/views/auth/sso/callback/client/client.d.ts +3 -1
  454. package/dist/src/views/auth/sso/callback/client/client.d.ts.map +1 -1
  455. package/dist/src/views/auth/sso/callback/client/client.js +36 -7
  456. package/dist/src/views/auth/sso/callback/client/mutation-api.d.ts.map +1 -1
  457. package/dist/src/views/auth/sso/callback/client/mutation-api.js +11 -6
  458. package/dist/src/views/error/back-button.js +1 -1
  459. package/dist/src/views/error/error-view.d.ts +5 -3
  460. package/dist/src/views/error/error-view.d.ts.map +1 -1
  461. package/dist/src/views/error/error-view.js +25 -23
  462. package/dist/src/views/error/global-error-view.d.ts +3 -3
  463. package/dist/src/views/error/global-error-view.d.ts.map +1 -1
  464. package/dist/src/views/error/global-error-view.js +36 -44
  465. package/dist/src/views/layouts/provider.d.ts +4 -4
  466. package/dist/src/views/layouts/provider.d.ts.map +1 -1
  467. package/dist/src/views/layouts/provider.js +3 -3
  468. package/dist/src/views/layouts/root-layout.d.ts +3 -3
  469. package/dist/src/views/layouts/root-layout.d.ts.map +1 -1
  470. package/dist/src/views/layouts/root-layout.js +1 -2
  471. package/dist/src/views/layouts/theme/header/header.d.ts +2 -2
  472. package/dist/src/views/layouts/theme/header/header.d.ts.map +1 -1
  473. package/dist/src/views/layouts/theme/header/header.js +1 -1
  474. package/dist/src/views/layouts/theme/header/user/auth/client.d.ts +1 -1
  475. package/dist/src/views/layouts/theme/header/user/auth/client.d.ts.map +1 -1
  476. package/dist/src/views/layouts/theme/header/user/auth/client.js +4 -4
  477. package/dist/src/views/layouts/theme/header/user/auth/log-out-mutation-api.js +8 -8
  478. package/dist/src/views/layouts/theme/header/user/user.js +4 -4
  479. package/dist/src/views/layouts/theme/layout.d.ts +2 -2
  480. package/dist/src/views/layouts/theme/layout.js +1 -1
  481. package/dist/src/vitnode.config.d.ts +16 -13
  482. package/dist/src/vitnode.config.d.ts.map +1 -1
  483. package/dist/src/vitnode.config.js +3 -2
  484. package/dist/tsconfig.tsbuildinfo +1 -1
  485. package/package.json +44 -46
  486. package/src/app/login/page.tsx +5 -5
  487. package/src/app/login/reset-password/page.tsx +27 -0
  488. package/src/app/login/sso/[providerId]/page.tsx +1 -1
  489. package/src/app/register/page.tsx +5 -5
  490. package/src/app_admin/core/debug/page.tsx +14 -14
  491. package/src/app_admin/core/page.tsx +1 -1
  492. package/src/app_admin/core/test/page.tsx +1 -1
  493. package/src/app_admin/core/users/page.tsx +12 -13
  494. package/src/locales/en.json +42 -2
  495. package/dist/src/views/auth/components/password-input.d.ts.map +0 -1
@@ -0,0 +1,56 @@
1
+ import { type DefaultTemplateEmailProps } from "./default-template";
2
+ interface ResetPasswordEmailTemplateProps extends DefaultTemplateEmailProps {
3
+ expiryDate: Date;
4
+ resetUrl: string;
5
+ userIpAddress?: string;
6
+ }
7
+ declare function ResetPasswordEmailTemplate({ i18n, resetUrl, expiryDate, userIpAddress, user, ...props }: ResetPasswordEmailTemplateProps): import("react/jsx-runtime").JSX.Element;
8
+ declare namespace ResetPasswordEmailTemplate {
9
+ var PreviewProps: {
10
+ resetUrl: string;
11
+ expiryDate: Date;
12
+ userIpAddress: string;
13
+ user: {
14
+ id: number;
15
+ name: string;
16
+ email: string;
17
+ language: string;
18
+ nameCode: string;
19
+ };
20
+ i18n: {
21
+ messages: {
22
+ core: {
23
+ auth: {
24
+ reset_password: {
25
+ email: {
26
+ subject: string;
27
+ greeting: string;
28
+ intro: string;
29
+ button: string;
30
+ instructions: string;
31
+ no_action: string;
32
+ security_note: string;
33
+ help: string;
34
+ expire_time: string;
35
+ };
36
+ };
37
+ };
38
+ };
39
+ };
40
+ locale: string;
41
+ };
42
+ children: string;
43
+ templateProps: {
44
+ metadata: {
45
+ title: string;
46
+ shortTitle: string;
47
+ url: string;
48
+ };
49
+ logo: {
50
+ src: string;
51
+ };
52
+ };
53
+ };
54
+ }
55
+ export default ResetPasswordEmailTemplate;
56
+ //# sourceMappingURL=reset-password.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reset-password.d.ts","sourceRoot":"","sources":["../../../src/emails/reset-password.tsx"],"names":[],"mappings":"AAGA,OAA6B,EAC3B,KAAK,yBAAyB,EAC/B,MAAM,oBAAoB,CAAC;AAW5B,UAAU,+BAAgC,SAAQ,yBAAyB;IACzE,UAAU,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AA0CD,iBAAwB,0BAA0B,CAAC,EACjD,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,aAAa,EACb,IAAI,EACJ,GAAG,KAAK,EACT,EAAE,+BAA+B,2CAgFjC;kBAvFuB,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAA1B,0BAA0B"}
@@ -0,0 +1,132 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Hr, Link, Section, Text } from "@react-email/components";
3
+ import { createTranslator } from "use-intl";
4
+ import DefaultTemplateEmail from "./default-template.js";
5
+ import { EmailButton } from "./ui/button.js";
6
+ import { EmailCard, EmailCardContent, EmailCardDescription, EmailCardFooter, EmailCardHeader, EmailCardTitle } from "./ui/card.js";
7
+ ResetPasswordEmailTemplate.PreviewProps = {
8
+ ...DefaultTemplateEmail.PreviewProps,
9
+ resetUrl: "https://example.com/reset-password?token=abc123",
10
+ expiryDate: new Date(Date.now() + 30 * 60 * 1000),
11
+ userIpAddress: "192.168.1.1",
12
+ user: {
13
+ id: 1,
14
+ name: "John Doe",
15
+ email: "john@example.com",
16
+ language: "en",
17
+ nameCode: "john-doe"
18
+ },
19
+ i18n: {
20
+ ...DefaultTemplateEmail.PreviewProps.i18n,
21
+ messages: {
22
+ core: {
23
+ auth: {
24
+ reset_password: {
25
+ email: {
26
+ subject: "Reset your password",
27
+ greeting: "Hello {name}!",
28
+ intro: "We received a request to reset your password for your account.",
29
+ button: "Reset Password",
30
+ instructions: "Click the button above to reset your password. This link will expire in 30 minutes for security reasons.",
31
+ no_action: "If you didn't request a password reset, you can safely ignore this email. Your password will remain unchanged.",
32
+ security_note: "For your security, this request was made from IP address: {ip}",
33
+ help: "If you're having trouble with the button above, copy and paste the URL below into your web browser:",
34
+ expire_time: "This link will expire on {date}"
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ };
42
+ export default function ResetPasswordEmailTemplate({ i18n, resetUrl, expiryDate, userIpAddress, user, ...props }) {
43
+ const t = createTranslator(i18n);
44
+ const userName = user?.name ?? "there";
45
+ return /*#__PURE__*/ _jsxs(DefaultTemplateEmail, {
46
+ i18n: i18n,
47
+ templateProps: {
48
+ ...props.templateProps,
49
+ previewText: t("core.auth.reset_password.email.subject")
50
+ },
51
+ user: user,
52
+ children: [
53
+ /*#__PURE__*/ _jsxs(EmailCard, {
54
+ children: [
55
+ /*#__PURE__*/ _jsxs(EmailCardHeader, {
56
+ children: [
57
+ /*#__PURE__*/ _jsx(EmailCardTitle, {
58
+ children: t("core.auth.reset_password.email.greeting", {
59
+ name: userName
60
+ })
61
+ }),
62
+ /*#__PURE__*/ _jsx(EmailCardDescription, {
63
+ children: t("core.auth.reset_password.email.intro")
64
+ })
65
+ ]
66
+ }),
67
+ /*#__PURE__*/ _jsxs(EmailCardContent, {
68
+ children: [
69
+ /*#__PURE__*/ _jsx(Section, {
70
+ className: "text-center",
71
+ children: /*#__PURE__*/ _jsx(EmailButton, {
72
+ className: "min-w-[200px]",
73
+ href: resetUrl,
74
+ size: "lg",
75
+ children: t("core.auth.reset_password.email.button")
76
+ })
77
+ }),
78
+ /*#__PURE__*/ _jsx(Text, {
79
+ className: "text-muted-foreground mt-6 text-sm leading-relaxed",
80
+ children: t("core.auth.reset_password.email.instructions")
81
+ }),
82
+ /*#__PURE__*/ _jsx(Text, {
83
+ className: "text-muted-foreground mt-4 text-sm leading-relaxed",
84
+ children: t("core.auth.reset_password.email.expire_time", {
85
+ date: expiryDate.toLocaleString(i18n.locale, {
86
+ year: "numeric",
87
+ month: "long",
88
+ day: "numeric",
89
+ hour: "2-digit",
90
+ minute: "2-digit",
91
+ timeZoneName: "short"
92
+ })
93
+ })
94
+ })
95
+ ]
96
+ }),
97
+ /*#__PURE__*/ _jsxs(EmailCardFooter, {
98
+ children: [
99
+ /*#__PURE__*/ _jsx(Hr, {
100
+ className: "border-border my-4 w-full border-t border-solid"
101
+ }),
102
+ /*#__PURE__*/ _jsx(Text, {
103
+ className: "text-muted-foreground m-0 text-sm leading-relaxed",
104
+ children: t("core.auth.reset_password.email.no_action")
105
+ }),
106
+ userIpAddress && /*#__PURE__*/ _jsx(Text, {
107
+ className: "text-muted-foreground mt-4 text-xs",
108
+ children: t("core.auth.reset_password.email.security_note", {
109
+ ip: userIpAddress
110
+ })
111
+ })
112
+ ]
113
+ })
114
+ ]
115
+ }),
116
+ /*#__PURE__*/ _jsxs(Section, {
117
+ className: "mt-6",
118
+ children: [
119
+ /*#__PURE__*/ _jsx(Text, {
120
+ className: "text-muted-foreground text-sm",
121
+ children: t("core.auth.reset_password.email.help")
122
+ }),
123
+ /*#__PURE__*/ _jsx(Link, {
124
+ className: "text-primary break-all text-sm underline",
125
+ href: resetUrl,
126
+ children: resetUrl
127
+ })
128
+ ]
129
+ })
130
+ ]
131
+ });
132
+ }
@@ -0,0 +1,9 @@
1
+ import { Button as ButtonReactEmail } from "@react-email/components";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "link" | "secondary" | "destructive" | "default" | "destructiveGhost" | "outline" | "ghost" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ export declare const EmailButton: ({ className, variant, size, ...props }: React.ComponentProps<typeof ButtonReactEmail> & VariantProps<typeof buttonVariants>) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../src/emails/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,cAAc;;;8EAwBnB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,wCAKzB,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,GAC9C,YAAY,CAAC,OAAO,cAAc,CAAC,4CAOpC,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button as ButtonReactEmail } from "@react-email/components";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../../lib/utils.js";
5
+ const buttonVariants = cva("cursor-pointer whitespace-nowrap rounded-md text-sm font-medium outline-none transition-all", {
6
+ variants: {
7
+ variant: {
8
+ default: "bg-primary text-primary-foreground shadow-xs",
9
+ destructive: "bg-destructive text-white shadow-xs",
10
+ destructiveGhost: "text-destructive",
11
+ outline: "border bg-background shadow-xs",
12
+ secondary: "bg-secondary text-secondary-foreground shadow-xs",
13
+ ghost: "",
14
+ link: "text-primary underline-offset-4"
15
+ },
16
+ size: {
17
+ default: "px-4 py-2",
18
+ sm: "rounded-md gap-1.5 px-3 py-1.5",
19
+ lg: "rounded-md px-6 py-2.5"
20
+ }
21
+ },
22
+ defaultVariants: {
23
+ variant: "default",
24
+ size: "default"
25
+ }
26
+ });
27
+ export const EmailButton = ({ className, variant, size, ...props })=>{
28
+ return /*#__PURE__*/ _jsx(ButtonReactEmail, {
29
+ className: cn(buttonVariants({
30
+ variant,
31
+ size,
32
+ className
33
+ })),
34
+ ...props
35
+ });
36
+ };
@@ -0,0 +1,8 @@
1
+ import { Section, Text } from "@react-email/components";
2
+ export declare const EmailCard: ({ className, ...props }: React.ComponentProps<typeof Section>) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const EmailCardHeader: ({ className, ...props }: React.ComponentProps<typeof Section>) => import("react/jsx-runtime").JSX.Element;
4
+ export declare const EmailCardTitle: ({ className, ...props }: React.ComponentProps<typeof Text>) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const EmailCardDescription: ({ className, ...props }: React.ComponentProps<typeof Text>) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const EmailCardContent: ({ className, ...props }: React.ComponentProps<typeof Section>) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const EmailCardFooter: ({ className, ...props }: React.ComponentProps<typeof Section>) => import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/emails/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAIxD,eAAO,MAAM,SAAS,GAAI,yBAGvB,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,4CAUtC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,yBAG7B,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,4CAEtC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,yBAG5B,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,4CAOnC,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,yBAGlC,KAAK,CAAC,cAAc,CAAC,OAAO,IAAI,CAAC,4CAOnC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,yBAG9B,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,4CAEtC,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,yBAG7B,KAAK,CAAC,cAAc,CAAC,OAAO,OAAO,CAAC,4CAEtC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Section, Text } from "@react-email/components";
3
+ import { cn } from "../../lib/utils.js";
4
+ export const EmailCard = ({ className, ...props })=>{
5
+ return /*#__PURE__*/ _jsx(Section, {
6
+ className: cn("bg-card text-card-foreground border-border rounded-xl border border-solid py-6 shadow-sm", className),
7
+ ...props
8
+ });
9
+ };
10
+ export const EmailCardHeader = ({ className, ...props })=>{
11
+ return /*#__PURE__*/ _jsx(Section, {
12
+ className: cn("mb-6 px-6", className),
13
+ ...props
14
+ });
15
+ };
16
+ export const EmailCardTitle = ({ className, ...props })=>{
17
+ return /*#__PURE__*/ _jsx(Text, {
18
+ className: cn("text-xl font-semibold leading-[0]", className),
19
+ ...props
20
+ });
21
+ };
22
+ export const EmailCardDescription = ({ className, ...props })=>{
23
+ return /*#__PURE__*/ _jsx(Text, {
24
+ className: cn("text-muted-foreground m-0 text-sm", className),
25
+ ...props
26
+ });
27
+ };
28
+ export const EmailCardContent = ({ className, ...props })=>{
29
+ return /*#__PURE__*/ _jsx(Section, {
30
+ className: cn("px-6", className),
31
+ ...props
32
+ });
33
+ };
34
+ export const EmailCardFooter = ({ className, ...props })=>{
35
+ return /*#__PURE__*/ _jsx(Section, {
36
+ className: cn("mt-6 px-6", className),
37
+ ...props
38
+ });
39
+ };
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  export const useBeforeUnload = (enabled = true, message)=>{
3
3
  const handler = React.useCallback((event)=>{
4
- const finalEnabled = typeof enabled === 'function' ? enabled() : true;
4
+ const finalEnabled = typeof enabled === "function" ? enabled() : true;
5
5
  if (!finalEnabled) {
6
6
  return;
7
7
  }
@@ -19,9 +19,9 @@ export const useBeforeUnload = (enabled = true, message)=>{
19
19
  if (!enabled) {
20
20
  return;
21
21
  }
22
- window.addEventListener('beforeunload', handler);
22
+ window.addEventListener("beforeunload", handler);
23
23
  return ()=>{
24
- window.removeEventListener('beforeunload', handler);
24
+ window.removeEventListener("beforeunload", handler);
25
25
  };
26
26
  }, [
27
27
  enabled,
@@ -1,5 +1,5 @@
1
- import type { z } from 'zod';
2
- import type { routeMiddlewareSchema } from '../api/modules/middleware/route';
1
+ import type { z } from "zod";
2
+ import type { routeMiddlewareSchema } from "../api/modules/middleware/route";
3
3
  export declare const useCaptcha: (captcha: z.infer<typeof routeMiddlewareSchema>["captcha"]) => {
4
4
  isReady: boolean;
5
5
  onReset: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"use-captcha.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-captcha.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAO7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,eAAO,MAAM,UAAU,GACrB,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC,SAAS,CAAC;;;oBA0E9B,OAAO,CAAC,MAAM,CAAC;CAkC3C,CAAC"}
1
+ {"version":3,"file":"use-captcha.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-captcha.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAI7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,eAAO,MAAM,UAAU,GACrB,SAAS,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC,SAAS,CAAC;;;oBA4G9B,OAAO,CAAC,MAAM,CAAC;CA4B3C,CAAC"}
@@ -1,86 +1,110 @@
1
- import { useLocale, useTranslations } from "next-intl";
1
+ /** biome-ignore-all lint/suspicious/noConsole: <no needed> */ import { useLocale, useTranslations } from "next-intl";
2
2
  import { useTheme } from "next-themes";
3
3
  import React from "react";
4
4
  import { toast } from "sonner";
5
+ import { usePathname } from "../lib/navigation.js";
5
6
  export const useCaptcha = (captcha)=>{
6
- const t = useTranslations('core.global.errors');
7
+ const t = useTranslations("core.global.errors");
7
8
  const locale = useLocale();
8
9
  const { resolvedTheme } = useTheme();
9
10
  const [isReady, setIsReady] = React.useState(false);
10
- const [token, setToken] = React.useState('');
11
+ const [token, setToken] = React.useState("");
12
+ const pathname = usePathname();
11
13
  const handleLoaded = ()=>{
12
14
  if (!captcha) return;
13
- const elementId = 'vitnode_captcha';
14
- if (captcha.type === 'cloudflare_turnstile') {
15
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
16
- // @ts-ignore
15
+ const elementId = "vitnode_captcha";
16
+ if (captcha.type === "cloudflare_turnstile") {
17
+ // @ts-expect-error
17
18
  window.turnstile.render(`#${elementId}`, {
18
19
  sitekey: captcha.siteKey,
19
20
  theme: resolvedTheme,
20
21
  language: locale,
21
22
  callback: (token)=>{
22
23
  setToken(token);
24
+ // ✅ Set isReady to true ONLY when the token is received
25
+ setIsReady(true);
26
+ },
27
+ // Optional: Add more callbacks for a better user experience
28
+ "expired-callback": ()=>{
29
+ onReset();
23
30
  }
24
31
  });
32
+ } else {
33
+ // For reCAPTCHA, the script being loaded means it's ready.
34
+ setIsReady(true);
25
35
  }
26
- setIsReady(true);
27
36
  };
28
37
  const handleError = ()=>{
29
- toast.error(t('title'), {
30
- description: t('captcha_internal_error')
38
+ toast.error(t("title"), {
39
+ description: t("captcha_internal_error")
31
40
  });
32
41
  };
42
+ // biome-ignore lint/correctness/useExhaustiveDependencies: <needed>
33
43
  React.useEffect(()=>{
34
- if (!captcha) return;
44
+ if (!captcha) {
45
+ // If no captcha is required, consider it "ready"
46
+ setIsReady(true);
47
+ return;
48
+ }
49
+ // Reset state on captcha type change
50
+ setIsReady(false);
51
+ setToken("");
35
52
  const googleCaptchaDomain = `https://www.google.com/recaptcha/api.js?hl=${locale}`;
36
- // Load script
37
- const script = document.createElement('script');
38
- if (captcha.type === 'cloudflare_turnstile') {
39
- script.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js';
40
- } else if (captcha.type === 'recaptcha_v3') {
53
+ const script = document.createElement("script");
54
+ if (captcha.type === "cloudflare_turnstile") {
55
+ script.src = "https://challenges.cloudflare.com/turnstile/v0/api.js";
56
+ } else if (captcha.type === "recaptcha_v3") {
41
57
  script.src = `${googleCaptchaDomain}&render=${captcha.siteKey}`;
42
58
  }
43
59
  if (!script.src) return;
60
+ script.async = true;
61
+ script.defer = true;
44
62
  document.body.appendChild(script);
45
- script.addEventListener('load', handleLoaded);
46
- script.addEventListener('error', handleError);
63
+ script.addEventListener("load", handleLoaded);
64
+ script.addEventListener("error", handleError);
47
65
  return ()=>{
48
- script.removeEventListener('load', handleLoaded);
49
- script.removeEventListener('error', handleError);
50
- document.body.removeChild(script);
66
+ script.removeEventListener("load", handleLoaded);
67
+ script.removeEventListener("error", handleError);
68
+ if (document.body.contains(script)) {
69
+ document.body.removeChild(script);
70
+ }
71
+ // Clean up the captcha widget if it exists
72
+ const widget = document.getElementById("vitnode_captcha");
73
+ if (widget) {
74
+ widget.innerHTML = "";
75
+ }
51
76
  };
52
- // eslint-disable-next-line react-compiler/react-compiler
53
- // eslint-disable-next-line react-hooks/exhaustive-deps
54
- }, []);
77
+ }, [
78
+ pathname,
79
+ locale,
80
+ captcha?.type,
81
+ captcha?.siteKey
82
+ ]);
55
83
  const onReset = ()=>{
56
84
  if (!captcha) return;
57
- if (captcha.type === 'cloudflare_turnstile') {
58
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
59
- // @ts-ignore
85
+ if (captcha.type === "cloudflare_turnstile" && window.turnstile) {
86
+ // @ts-expect-error
60
87
  window.turnstile.reset();
61
88
  }
62
- setToken('');
89
+ setToken("");
90
+ setIsReady(false);
63
91
  };
64
92
  const getToken = async ()=>{
65
- if (!captcha) return '';
66
- if (captcha.type === 'recaptcha_v3') {
67
- // Captcha
68
- return new Promise((resolve)=>{
69
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
70
- // @ts-ignore
93
+ if (!captcha) return "";
94
+ if (captcha.type === "recaptcha_v3") {
95
+ return await new Promise((resolve)=>{
96
+ // @ts-expect-error
71
97
  window.grecaptcha.ready(async ()=>{
72
98
  try {
73
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
74
- // @ts-ignore
99
+ // @ts-expect-error
75
100
  const token = await window.grecaptcha.execute(captcha.siteKey, {
76
- action: 'submit'
101
+ action: "submit"
77
102
  });
78
103
  resolve(token);
79
104
  } catch (error) {
80
- // eslint-disable-next-line no-console
81
- console.error('Captcha error', error);
105
+ console.error("Captcha error", error);
106
+ resolve("");
82
107
  }
83
- resolve('');
84
108
  });
85
109
  });
86
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,YAkB1B"}
1
+ {"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,YAiB1B"}
@@ -1,4 +1,4 @@
1
- import * as React from "react";
1
+ import React from "react";
2
2
  const MOBILE_BREAKPOINT = 768;
3
3
  export function useIsMobile() {
4
4
  const [isMobile, setIsMobile] = React.useState(undefined);
@@ -7,10 +7,9 @@ export function useIsMobile() {
7
7
  const onChange = ()=>{
8
8
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
9
9
  };
10
- mql.addEventListener('change', onChange);
11
- // eslint-disable-next-line @eslint-react/hooks-extra/no-direct-set-state-in-use-effect
10
+ mql.addEventListener("change", onChange);
12
11
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
13
- return ()=>mql.removeEventListener('change', onChange);
12
+ return ()=>mql.removeEventListener("change", onChange);
14
13
  }, []);
15
14
  return !!isMobile;
16
15
  }
@@ -2,11 +2,11 @@ import { middlewareModule } from "../../api/modules/middleware/middleware.module
2
2
  import { fetcher } from "../fetcher.js";
3
3
  export const getMiddlewareApi = async ()=>{
4
4
  const res = await fetcher(middlewareModule, {
5
- path: '/',
6
- method: 'get',
7
- module: 'middleware',
5
+ path: "/",
6
+ method: "get",
7
+ module: "middleware",
8
8
  options: {
9
- cache: 'force-cache'
9
+ cache: "force-cache"
10
10
  }
11
11
  });
12
12
  return await res.json();
@@ -3,15 +3,15 @@ import { fetcher } from "../fetcher.js";
3
3
  import { redirect } from "../navigation.js";
4
4
  export const getSessionAdminApi = async ()=>{
5
5
  const res = await fetcher(adminModule, {
6
- path: '/session',
7
- method: 'get',
8
- module: 'admin',
6
+ path: "/session",
7
+ method: "get",
8
+ module: "admin",
9
9
  options: {
10
- cache: 'force-cache'
10
+ cache: "force-cache"
11
11
  }
12
12
  });
13
13
  if (res.status !== 200) {
14
- await redirect('/admin');
14
+ await redirect("/admin");
15
15
  return;
16
16
  }
17
17
  const data = await res.json();
@@ -2,11 +2,11 @@ import { usersModule } from "../../api/modules/users/users.module.js";
2
2
  import { fetcher } from "../fetcher.js";
3
3
  export const getSessionApi = async ()=>{
4
4
  const res = await fetcher(usersModule, {
5
- path: '/session',
6
- method: 'get',
7
- module: 'users',
5
+ path: "/session",
6
+ method: "get",
7
+ module: "users",
8
8
  options: {
9
- cache: 'force-cache'
9
+ cache: "force-cache"
10
10
  }
11
11
  });
12
12
  const data = await res.json();