hazo_auth 1.4.2 → 1.6.1

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 (354) hide show
  1. package/README.md +65 -19
  2. package/SETUP_CHECKLIST.md +779 -0
  3. package/dist/app/api/hazo_auth/change_password/route.d.ts +8 -0
  4. package/dist/app/api/hazo_auth/change_password/route.d.ts.map +1 -0
  5. package/dist/app/api/hazo_auth/change_password/route.js +98 -0
  6. package/dist/app/api/hazo_auth/forgot_password/route.d.ts +8 -0
  7. package/dist/app/api/hazo_auth/forgot_password/route.d.ts.map +1 -0
  8. package/dist/app/api/hazo_auth/forgot_password/route.js +78 -0
  9. package/dist/app/api/hazo_auth/get_auth/route.d.ts +10 -0
  10. package/dist/app/api/hazo_auth/get_auth/route.d.ts.map +1 -0
  11. package/dist/app/api/hazo_auth/get_auth/route.js +63 -0
  12. package/dist/app/api/hazo_auth/invalidate_cache/route.d.ts +14 -0
  13. package/dist/app/api/hazo_auth/invalidate_cache/route.d.ts.map +1 -0
  14. package/dist/app/api/hazo_auth/invalidate_cache/route.js +96 -0
  15. package/dist/app/api/hazo_auth/library_photo/[category]/[filename]/route.d.ts +9 -0
  16. package/dist/app/api/hazo_auth/library_photo/[category]/[filename]/route.d.ts.map +1 -0
  17. package/dist/app/api/hazo_auth/library_photo/[category]/[filename]/route.js +82 -0
  18. package/dist/app/api/hazo_auth/library_photos/route.d.ts +22 -0
  19. package/dist/app/api/hazo_auth/library_photos/route.d.ts.map +1 -0
  20. package/dist/app/api/hazo_auth/library_photos/route.js +80 -0
  21. package/dist/app/api/hazo_auth/login/route.d.ts +12 -0
  22. package/dist/app/api/hazo_auth/login/route.d.ts.map +1 -0
  23. package/dist/app/api/hazo_auth/login/route.js +140 -0
  24. package/dist/app/api/hazo_auth/logout/route.d.ts +8 -0
  25. package/dist/app/api/hazo_auth/logout/route.d.ts.map +1 -0
  26. package/dist/app/api/hazo_auth/logout/route.js +71 -0
  27. package/dist/app/api/hazo_auth/me/route.d.ts +3 -0
  28. package/dist/app/api/hazo_auth/me/route.d.ts.map +1 -0
  29. package/dist/app/api/hazo_auth/me/route.js +34 -0
  30. package/dist/app/api/hazo_auth/profile_picture/[filename]/route.d.ts +7 -0
  31. package/dist/app/api/hazo_auth/profile_picture/[filename]/route.d.ts.map +1 -0
  32. package/dist/app/api/hazo_auth/profile_picture/[filename]/route.js +43 -0
  33. package/dist/app/api/hazo_auth/register/route.d.ts +9 -0
  34. package/dist/app/api/hazo_auth/register/route.d.ts.map +1 -0
  35. package/dist/app/api/hazo_auth/register/route.js +80 -0
  36. package/dist/app/api/hazo_auth/remove_profile_picture/route.d.ts +8 -0
  37. package/dist/app/api/hazo_auth/remove_profile_picture/route.d.ts.map +1 -0
  38. package/dist/app/api/hazo_auth/remove_profile_picture/route.js +64 -0
  39. package/dist/app/api/hazo_auth/resend_verification/route.d.ts +8 -0
  40. package/dist/app/api/hazo_auth/resend_verification/route.d.ts.map +1 -0
  41. package/dist/app/api/hazo_auth/resend_verification/route.js +79 -0
  42. package/dist/app/api/hazo_auth/reset_password/route.d.ts +8 -0
  43. package/dist/app/api/hazo_auth/reset_password/route.d.ts.map +1 -0
  44. package/dist/app/api/hazo_auth/reset_password/route.js +76 -0
  45. package/dist/app/api/hazo_auth/update_user/route.d.ts +9 -0
  46. package/dist/app/api/hazo_auth/update_user/route.d.ts.map +1 -0
  47. package/dist/app/api/hazo_auth/update_user/route.js +95 -0
  48. package/dist/app/api/hazo_auth/upload_profile_picture/route.d.ts +9 -0
  49. package/dist/app/api/hazo_auth/upload_profile_picture/route.d.ts.map +1 -0
  50. package/dist/app/api/hazo_auth/upload_profile_picture/route.js +204 -0
  51. package/dist/app/api/hazo_auth/validate_reset_token/route.d.ts +6 -0
  52. package/dist/app/api/hazo_auth/validate_reset_token/route.d.ts.map +1 -0
  53. package/dist/app/api/hazo_auth/validate_reset_token/route.js +58 -0
  54. package/dist/app/api/hazo_auth/verify_email/route.d.ts +11 -0
  55. package/dist/app/api/hazo_auth/verify_email/route.d.ts.map +1 -0
  56. package/dist/app/api/hazo_auth/verify_email/route.js +63 -0
  57. package/dist/cli/generate.d.ts +7 -0
  58. package/dist/cli/generate.d.ts.map +1 -0
  59. package/dist/cli/generate.js +184 -0
  60. package/dist/cli/index.d.ts +3 -0
  61. package/dist/cli/index.d.ts.map +1 -0
  62. package/dist/cli/index.js +173 -0
  63. package/dist/cli/init.d.ts +2 -0
  64. package/dist/cli/init.d.ts.map +1 -0
  65. package/dist/cli/init.js +201 -0
  66. package/dist/cli/validate.d.ts +15 -0
  67. package/dist/cli/validate.d.ts.map +1 -0
  68. package/dist/cli/validate.js +509 -0
  69. package/dist/components/ui/card.d.ts +9 -0
  70. package/dist/components/ui/card.d.ts.map +1 -0
  71. package/dist/components/ui/card.js +45 -0
  72. package/dist/hooks/use-mobile.d.ts.map +1 -1
  73. package/dist/hooks/use-mobile.js +17 -3
  74. package/dist/lib/services/profile_picture_service.d.ts +34 -2
  75. package/dist/lib/services/profile_picture_service.d.ts.map +1 -1
  76. package/dist/lib/services/profile_picture_service.js +157 -15
  77. package/dist/page_components/forgot_password.d.ts +19 -0
  78. package/dist/page_components/forgot_password.d.ts.map +1 -0
  79. package/dist/page_components/forgot_password.js +36 -0
  80. package/dist/page_components/index.d.ts +7 -0
  81. package/dist/page_components/index.d.ts.map +1 -0
  82. package/dist/page_components/index.js +9 -0
  83. package/dist/page_components/login.d.ts +26 -0
  84. package/dist/page_components/login.d.ts.map +1 -0
  85. package/dist/page_components/login.js +40 -0
  86. package/dist/page_components/my_settings.d.ts +64 -0
  87. package/dist/page_components/my_settings.d.ts.map +1 -0
  88. package/dist/page_components/my_settings.js +67 -0
  89. package/dist/page_components/register.d.ts +25 -0
  90. package/dist/page_components/register.d.ts.map +1 -0
  91. package/dist/page_components/register.js +43 -0
  92. package/dist/page_components/reset_password.d.ts +25 -0
  93. package/dist/page_components/reset_password.d.ts.map +1 -0
  94. package/dist/page_components/reset_password.js +43 -0
  95. package/dist/page_components/verify_email.d.ts +21 -0
  96. package/dist/page_components/verify_email.d.ts.map +1 -0
  97. package/dist/page_components/verify_email.js +36 -0
  98. package/dist/server/routes/change_password.d.ts +2 -0
  99. package/dist/server/routes/change_password.d.ts.map +1 -0
  100. package/dist/server/routes/change_password.js +2 -0
  101. package/dist/server/routes/forgot_password.d.ts +2 -0
  102. package/dist/server/routes/forgot_password.d.ts.map +1 -0
  103. package/dist/server/routes/forgot_password.js +2 -0
  104. package/dist/server/routes/get_auth.d.ts +2 -0
  105. package/dist/server/routes/get_auth.d.ts.map +1 -0
  106. package/dist/server/routes/get_auth.js +2 -0
  107. package/dist/server/routes/index.d.ts +19 -0
  108. package/dist/server/routes/index.d.ts.map +1 -0
  109. package/dist/server/routes/index.js +25 -0
  110. package/dist/server/routes/invalidate_cache.d.ts +2 -0
  111. package/dist/server/routes/invalidate_cache.d.ts.map +1 -0
  112. package/dist/server/routes/invalidate_cache.js +2 -0
  113. package/dist/server/routes/library_photo.d.ts +2 -0
  114. package/dist/server/routes/library_photo.d.ts.map +1 -0
  115. package/dist/server/routes/library_photo.js +3 -0
  116. package/dist/server/routes/library_photos.d.ts +2 -0
  117. package/dist/server/routes/library_photos.d.ts.map +1 -0
  118. package/dist/server/routes/library_photos.js +2 -0
  119. package/dist/server/routes/login.d.ts +2 -0
  120. package/dist/server/routes/login.d.ts.map +1 -0
  121. package/dist/server/routes/login.js +2 -0
  122. package/dist/server/routes/logout.d.ts +2 -0
  123. package/dist/server/routes/logout.d.ts.map +1 -0
  124. package/dist/server/routes/logout.js +2 -0
  125. package/dist/server/routes/me.d.ts +2 -0
  126. package/dist/server/routes/me.d.ts.map +1 -0
  127. package/dist/server/routes/me.js +2 -0
  128. package/dist/server/routes/profile_picture_filename.d.ts +2 -0
  129. package/dist/server/routes/profile_picture_filename.d.ts.map +1 -0
  130. package/dist/server/routes/profile_picture_filename.js +3 -0
  131. package/dist/server/routes/register.d.ts +2 -0
  132. package/dist/server/routes/register.d.ts.map +1 -0
  133. package/dist/server/routes/register.js +2 -0
  134. package/dist/server/routes/remove_profile_picture.d.ts +2 -0
  135. package/dist/server/routes/remove_profile_picture.d.ts.map +1 -0
  136. package/dist/server/routes/remove_profile_picture.js +2 -0
  137. package/dist/server/routes/resend_verification.d.ts +2 -0
  138. package/dist/server/routes/resend_verification.d.ts.map +1 -0
  139. package/dist/server/routes/resend_verification.js +2 -0
  140. package/dist/server/routes/reset_password.d.ts +2 -0
  141. package/dist/server/routes/reset_password.d.ts.map +1 -0
  142. package/dist/server/routes/reset_password.js +2 -0
  143. package/dist/server/routes/update_user.d.ts +2 -0
  144. package/dist/server/routes/update_user.d.ts.map +1 -0
  145. package/dist/server/routes/update_user.js +2 -0
  146. package/dist/server/routes/upload_profile_picture.d.ts +2 -0
  147. package/dist/server/routes/upload_profile_picture.d.ts.map +1 -0
  148. package/dist/server/routes/upload_profile_picture.js +2 -0
  149. package/dist/server/routes/validate_reset_token.d.ts +2 -0
  150. package/dist/server/routes/validate_reset_token.d.ts.map +1 -0
  151. package/dist/server/routes/validate_reset_token.js +2 -0
  152. package/dist/server/routes/verify_email.d.ts +2 -0
  153. package/dist/server/routes/verify_email.d.ts.map +1 -0
  154. package/dist/server/routes/verify_email.js +2 -0
  155. package/package.json +40 -17
  156. package/components.json +0 -22
  157. package/instrumentation.ts +0 -32
  158. package/migrations/001_add_token_type_to_refresh_tokens.sql +0 -14
  159. package/migrations/002_add_name_to_hazo_users.sql +0 -7
  160. package/migrations/003_add_url_on_logon_to_hazo_users.sql +0 -8
  161. package/next.config.mjs +0 -67
  162. package/postcss.config.mjs +0 -8
  163. package/public/file.svg +0 -1
  164. package/public/globe.svg +0 -1
  165. package/public/next.svg +0 -1
  166. package/public/vercel.svg +0 -1
  167. package/public/window.svg +0 -1
  168. package/scripts/apply_migration.ts +0 -118
  169. package/scripts/init_users.ts +0 -378
  170. package/src/app/api/hazo_auth/auth/upload_profile_picture/route.ts +0 -268
  171. package/src/app/api/hazo_auth/change_password/route.ts +0 -132
  172. package/src/app/api/hazo_auth/forgot_password/route.ts +0 -107
  173. package/src/app/api/hazo_auth/get_auth/route.ts +0 -89
  174. package/src/app/api/hazo_auth/invalidate_cache/route.ts +0 -139
  175. package/src/app/api/hazo_auth/library_photos/route.ts +0 -73
  176. package/src/app/api/hazo_auth/login/route.ts +0 -181
  177. package/src/app/api/hazo_auth/logout/route.ts +0 -89
  178. package/src/app/api/hazo_auth/me/route.ts +0 -47
  179. package/src/app/api/hazo_auth/profile_picture/[filename]/route.ts +0 -67
  180. package/src/app/api/hazo_auth/register/route.ts +0 -109
  181. package/src/app/api/hazo_auth/remove_profile_picture/route.ts +0 -86
  182. package/src/app/api/hazo_auth/resend_verification/route.ts +0 -108
  183. package/src/app/api/hazo_auth/reset_password/route.ts +0 -107
  184. package/src/app/api/hazo_auth/update_user/route.ts +0 -126
  185. package/src/app/api/hazo_auth/upload_profile_picture/route.ts +0 -268
  186. package/src/app/api/hazo_auth/user_management/permissions/route.ts +0 -367
  187. package/src/app/api/hazo_auth/user_management/roles/route.ts +0 -442
  188. package/src/app/api/hazo_auth/user_management/users/roles/route.ts +0 -367
  189. package/src/app/api/hazo_auth/user_management/users/route.ts +0 -239
  190. package/src/app/api/hazo_auth/validate_reset_token/route.ts +0 -83
  191. package/src/app/api/hazo_auth/verify_email/route.ts +0 -88
  192. package/src/app/api/migrations/apply/route.ts +0 -91
  193. package/src/app/favicon.ico +0 -0
  194. package/src/app/fonts/GeistMonoVF.woff +0 -0
  195. package/src/app/fonts/GeistVF.woff +0 -0
  196. package/src/app/globals.css +0 -89
  197. package/src/app/hazo_auth/forgot_password/forgot_password_page_client.tsx +0 -60
  198. package/src/app/hazo_auth/forgot_password/page.tsx +0 -24
  199. package/src/app/hazo_auth/login/login_page_client.tsx +0 -86
  200. package/src/app/hazo_auth/login/page.tsx +0 -38
  201. package/src/app/hazo_auth/my_settings/my_settings_page_client.tsx +0 -120
  202. package/src/app/hazo_auth/my_settings/page.tsx +0 -40
  203. package/src/app/hazo_auth/register/page.tsx +0 -36
  204. package/src/app/hazo_auth/register/register_page_client.tsx +0 -81
  205. package/src/app/hazo_auth/reset_password/page.tsx +0 -29
  206. package/src/app/hazo_auth/reset_password/reset_password_page_client.tsx +0 -81
  207. package/src/app/hazo_auth/user_management/page.tsx +0 -14
  208. package/src/app/hazo_auth/user_management/user_management_page_client.tsx +0 -16
  209. package/src/app/hazo_auth/verify_email/page.tsx +0 -24
  210. package/src/app/hazo_auth/verify_email/verify_email_page_client.tsx +0 -60
  211. package/src/app/hazo_connect/api/sqlite/data/route.ts +0 -203
  212. package/src/app/hazo_connect/api/sqlite/schema/route.ts +0 -45
  213. package/src/app/hazo_connect/api/sqlite/tables/route.ts +0 -36
  214. package/src/app/hazo_connect/sqlite_admin/page.tsx +0 -51
  215. package/src/app/hazo_connect/sqlite_admin/sqlite-admin-client.tsx +0 -984
  216. package/src/app/layout.tsx +0 -43
  217. package/src/app/page.tsx +0 -170
  218. package/src/components/index.ts +0 -7
  219. package/src/components/layouts/email_verification/config/email_verification_field_config.ts +0 -86
  220. package/src/components/layouts/email_verification/hooks/use_email_verification.ts +0 -297
  221. package/src/components/layouts/email_verification/index.tsx +0 -297
  222. package/src/components/layouts/forgot_password/config/forgot_password_field_config.ts +0 -58
  223. package/src/components/layouts/forgot_password/hooks/use_forgot_password_form.ts +0 -179
  224. package/src/components/layouts/forgot_password/index.tsx +0 -168
  225. package/src/components/layouts/index.ts +0 -26
  226. package/src/components/layouts/login/config/login_field_config.ts +0 -67
  227. package/src/components/layouts/login/hooks/use_login_form.ts +0 -286
  228. package/src/components/layouts/login/index.tsx +0 -252
  229. package/src/components/layouts/my_settings/components/editable_field.tsx +0 -177
  230. package/src/components/layouts/my_settings/components/password_change_dialog.tsx +0 -301
  231. package/src/components/layouts/my_settings/components/profile_picture_dialog.tsx +0 -385
  232. package/src/components/layouts/my_settings/components/profile_picture_display.tsx +0 -66
  233. package/src/components/layouts/my_settings/components/profile_picture_gravatar_tab.tsx +0 -143
  234. package/src/components/layouts/my_settings/components/profile_picture_library_tab.tsx +0 -311
  235. package/src/components/layouts/my_settings/components/profile_picture_upload_tab.tsx +0 -341
  236. package/src/components/layouts/my_settings/config/my_settings_field_config.ts +0 -61
  237. package/src/components/layouts/my_settings/hooks/use_my_settings.ts +0 -458
  238. package/src/components/layouts/my_settings/index.tsx +0 -351
  239. package/src/components/layouts/register/config/register_field_config.ts +0 -101
  240. package/src/components/layouts/register/hooks/use_register_form.ts +0 -275
  241. package/src/components/layouts/register/index.tsx +0 -226
  242. package/src/components/layouts/reset_password/config/reset_password_field_config.ts +0 -86
  243. package/src/components/layouts/reset_password/hooks/use_reset_password_form.ts +0 -276
  244. package/src/components/layouts/reset_password/index.tsx +0 -294
  245. package/src/components/layouts/shared/components/already_logged_in_guard.tsx +0 -95
  246. package/src/components/layouts/shared/components/auth_page_shell.tsx +0 -36
  247. package/src/components/layouts/shared/components/field_error_message.tsx +0 -29
  248. package/src/components/layouts/shared/components/form_action_buttons.tsx +0 -64
  249. package/src/components/layouts/shared/components/form_field_wrapper.tsx +0 -44
  250. package/src/components/layouts/shared/components/form_header.tsx +0 -36
  251. package/src/components/layouts/shared/components/logout_button.tsx +0 -76
  252. package/src/components/layouts/shared/components/password_field.tsx +0 -72
  253. package/src/components/layouts/shared/components/profile_pic_menu.tsx +0 -321
  254. package/src/components/layouts/shared/components/profile_pic_menu_wrapper.tsx +0 -40
  255. package/src/components/layouts/shared/components/sidebar_layout_wrapper.tsx +0 -214
  256. package/src/components/layouts/shared/components/standalone_layout_wrapper.tsx +0 -53
  257. package/src/components/layouts/shared/components/two_column_auth_layout.tsx +0 -44
  258. package/src/components/layouts/shared/components/unauthorized_guard.tsx +0 -78
  259. package/src/components/layouts/shared/components/visual_panel.tsx +0 -41
  260. package/src/components/layouts/shared/config/layout_customization.ts +0 -95
  261. package/src/components/layouts/shared/data/layout_data_client.ts +0 -19
  262. package/src/components/layouts/shared/hooks/use_auth_status.ts +0 -103
  263. package/src/components/layouts/shared/hooks/use_hazo_auth.ts +0 -158
  264. package/src/components/layouts/shared/index.ts +0 -34
  265. package/src/components/layouts/shared/utils/ip_address.ts +0 -37
  266. package/src/components/layouts/shared/utils/validation.ts +0 -66
  267. package/src/components/layouts/user_management/components/roles_matrix.tsx +0 -607
  268. package/src/components/layouts/user_management/index.tsx +0 -1295
  269. package/src/components/ui/alert-dialog.tsx +0 -141
  270. package/src/components/ui/avatar.tsx +0 -50
  271. package/src/components/ui/button.tsx +0 -57
  272. package/src/components/ui/checkbox.tsx +0 -30
  273. package/src/components/ui/dialog.tsx +0 -122
  274. package/src/components/ui/dropdown-menu.tsx +0 -201
  275. package/src/components/ui/hazo_ui_tooltip.tsx +0 -67
  276. package/src/components/ui/index.ts +0 -22
  277. package/src/components/ui/input.tsx +0 -22
  278. package/src/components/ui/label.tsx +0 -26
  279. package/src/components/ui/separator.tsx +0 -31
  280. package/src/components/ui/sheet.tsx +0 -139
  281. package/src/components/ui/sidebar.tsx +0 -773
  282. package/src/components/ui/skeleton.tsx +0 -15
  283. package/src/components/ui/sonner.tsx +0 -31
  284. package/src/components/ui/switch.tsx +0 -29
  285. package/src/components/ui/table.tsx +0 -120
  286. package/src/components/ui/tabs.tsx +0 -55
  287. package/src/components/ui/tooltip.tsx +0 -32
  288. package/src/components/ui/vertical-tabs.tsx +0 -59
  289. package/src/hooks/use-mobile.tsx +0 -19
  290. package/src/index.ts +0 -7
  291. package/src/lib/already_logged_in_config.server.ts +0 -46
  292. package/src/lib/app_logger.ts +0 -24
  293. package/src/lib/auth/auth_cache.ts +0 -220
  294. package/src/lib/auth/auth_rate_limiter.ts +0 -121
  295. package/src/lib/auth/auth_types.ts +0 -65
  296. package/src/lib/auth/auth_utils.server.ts +0 -196
  297. package/src/lib/auth/hazo_get_auth.server.ts +0 -333
  298. package/src/lib/auth/index.ts +0 -23
  299. package/src/lib/auth/server_auth.ts +0 -88
  300. package/src/lib/auth_utility_config.server.ts +0 -136
  301. package/src/lib/config/config_loader.server.ts +0 -164
  302. package/src/lib/email_verification_config.server.ts +0 -32
  303. package/src/lib/file_types_config.server.ts +0 -25
  304. package/src/lib/forgot_password_config.server.ts +0 -32
  305. package/src/lib/hazo_connect_instance.server.ts +0 -101
  306. package/src/lib/hazo_connect_setup.server.ts +0 -194
  307. package/src/lib/hazo_connect_setup.ts +0 -54
  308. package/src/lib/index.ts +0 -44
  309. package/src/lib/login_config.server.ts +0 -71
  310. package/src/lib/messages_config.server.ts +0 -45
  311. package/src/lib/migrations/apply_migration.ts +0 -105
  312. package/src/lib/my_settings_config.server.ts +0 -135
  313. package/src/lib/password_requirements_config.server.ts +0 -39
  314. package/src/lib/profile_pic_menu_config.server.ts +0 -138
  315. package/src/lib/profile_picture_config.server.ts +0 -56
  316. package/src/lib/register_config.server.ts +0 -73
  317. package/src/lib/reset_password_config.server.ts +0 -75
  318. package/src/lib/services/email_service.ts +0 -581
  319. package/src/lib/services/email_verification_service.ts +0 -270
  320. package/src/lib/services/index.ts +0 -15
  321. package/src/lib/services/login_service.ts +0 -134
  322. package/src/lib/services/password_change_service.ts +0 -154
  323. package/src/lib/services/password_reset_service.ts +0 -405
  324. package/src/lib/services/profile_picture_remove_service.ts +0 -120
  325. package/src/lib/services/profile_picture_service.ts +0 -215
  326. package/src/lib/services/profile_picture_source_mapper.ts +0 -62
  327. package/src/lib/services/registration_service.ts +0 -184
  328. package/src/lib/services/token_service.ts +0 -240
  329. package/src/lib/services/user_profiles_service.ts +0 -143
  330. package/src/lib/services/user_update_service.ts +0 -141
  331. package/src/lib/ui_shell_config.server.ts +0 -73
  332. package/src/lib/ui_sizes_config.server.ts +0 -37
  333. package/src/lib/user_fields_config.server.ts +0 -31
  334. package/src/lib/user_management_config.server.ts +0 -39
  335. package/src/lib/utils/api_route_helpers.ts +0 -60
  336. package/src/lib/utils/error_sanitizer.ts +0 -75
  337. package/src/lib/utils.ts +0 -11
  338. package/src/middleware.ts +0 -94
  339. package/src/routes/index.ts +0 -34
  340. package/src/server/config/config_loader.ts +0 -496
  341. package/src/server/index.ts +0 -38
  342. package/src/server/logging/logger_service.ts +0 -56
  343. package/src/server/routes/root_router.ts +0 -16
  344. package/src/server/server.ts +0 -28
  345. package/src/server/types/app_types.ts +0 -74
  346. package/src/server/types/express.d.ts +0 -16
  347. package/src/stories/email_verification_layout.stories.tsx +0 -137
  348. package/src/stories/forgot_password_layout.stories.tsx +0 -85
  349. package/src/stories/login_layout.stories.tsx +0 -85
  350. package/src/stories/project_overview.stories.tsx +0 -33
  351. package/src/stories/register_layout.stories.tsx +0 -107
  352. package/tailwind.config.ts +0 -77
  353. package/tsconfig.build.json +0 -36
  354. package/tsconfig.json +0 -28
@@ -0,0 +1,509 @@
1
+ // file_description: validation logic for hazo_auth setup verification
2
+ // This module contains all the validation checks that can be run via CLI or programmatically
3
+ import * as fs from "fs";
4
+ import * as path from "path";
5
+ // section: constants
6
+ const REQUIRED_CONFIG_FILES = [
7
+ "hazo_auth_config.ini",
8
+ "hazo_notify_config.ini",
9
+ ];
10
+ const REQUIRED_ENV_VARS = [
11
+ { name: "JWT_SECRET", required: true, description: "JWT signing secret" },
12
+ { name: "ZEPTOMAIL_API_KEY", required: false, description: "Email API key (required for email)" },
13
+ { name: "HAZO_CONNECT_POSTGREST_API_KEY", required: false, description: "PostgREST API key (if using PostgreSQL)" },
14
+ ];
15
+ const REQUIRED_API_ROUTES = [
16
+ { path: "api/hazo_auth/login", method: "POST" },
17
+ { path: "api/hazo_auth/register", method: "POST" },
18
+ { path: "api/hazo_auth/logout", method: "POST" },
19
+ { path: "api/hazo_auth/me", method: "GET" },
20
+ { path: "api/hazo_auth/forgot_password", method: "POST" },
21
+ { path: "api/hazo_auth/reset_password", method: "POST" },
22
+ { path: "api/hazo_auth/verify_email", method: "GET" },
23
+ { path: "api/hazo_auth/resend_verification", method: "POST" },
24
+ { path: "api/hazo_auth/update_user", method: "PATCH" },
25
+ { path: "api/hazo_auth/change_password", method: "POST" },
26
+ { path: "api/hazo_auth/upload_profile_picture", method: "POST" },
27
+ { path: "api/hazo_auth/remove_profile_picture", method: "DELETE" },
28
+ { path: "api/hazo_auth/library_photos", method: "GET" },
29
+ { path: "api/hazo_auth/get_auth", method: "POST" },
30
+ { path: "api/hazo_auth/validate_reset_token", method: "POST" },
31
+ { path: "api/hazo_auth/profile_picture/[filename]", method: "GET" },
32
+ ];
33
+ // section: helpers
34
+ function get_project_root() {
35
+ return process.cwd();
36
+ }
37
+ function file_exists(filepath) {
38
+ try {
39
+ return fs.existsSync(filepath);
40
+ }
41
+ catch (_a) {
42
+ return false;
43
+ }
44
+ }
45
+ function read_ini_file(filepath) {
46
+ try {
47
+ const content = fs.readFileSync(filepath, "utf-8");
48
+ const result = {};
49
+ let current_section = "";
50
+ for (const line of content.split("\n")) {
51
+ const trimmed = line.trim();
52
+ if (trimmed.startsWith("#") || trimmed.startsWith(";") || !trimmed) {
53
+ continue;
54
+ }
55
+ const section_match = trimmed.match(/^\[(.+)\]$/);
56
+ if (section_match) {
57
+ current_section = section_match[1];
58
+ result[current_section] = result[current_section] || {};
59
+ continue;
60
+ }
61
+ const kv_match = trimmed.match(/^([^=]+)=(.*)$/);
62
+ if (kv_match && current_section) {
63
+ const key = kv_match[1].trim();
64
+ const value = kv_match[2].trim();
65
+ result[current_section][key] = value;
66
+ }
67
+ }
68
+ return result;
69
+ }
70
+ catch (_a) {
71
+ return null;
72
+ }
73
+ }
74
+ function print_status(status) {
75
+ switch (status) {
76
+ case "pass":
77
+ return "\x1b[32m[PASS]\x1b[0m";
78
+ case "fail":
79
+ return "\x1b[31m[FAIL]\x1b[0m";
80
+ case "warn":
81
+ return "\x1b[33m[WARN]\x1b[0m";
82
+ }
83
+ }
84
+ function print_result(result) {
85
+ console.log(`${print_status(result.status)} ${result.name}`);
86
+ if (result.message && (result.status === "fail" || result.status === "warn")) {
87
+ console.log(` → ${result.message}`);
88
+ }
89
+ }
90
+ // section: check_functions
91
+ function check_config_files(project_root) {
92
+ const results = [];
93
+ for (const config_file of REQUIRED_CONFIG_FILES) {
94
+ const filepath = path.join(project_root, config_file);
95
+ const exists = file_exists(filepath);
96
+ results.push({
97
+ name: `Config file: ${config_file}`,
98
+ status: exists ? "pass" : "fail",
99
+ message: exists ? "" : `File not found. Run: cp node_modules/hazo_auth/${config_file.replace(".ini", ".example.ini")} ./${config_file}`,
100
+ });
101
+ }
102
+ return results;
103
+ }
104
+ function check_config_values(project_root) {
105
+ var _a, _b, _c, _d, _e, _f;
106
+ const results = [];
107
+ const hazo_config_path = path.join(project_root, "hazo_auth_config.ini");
108
+ const hazo_config = read_ini_file(hazo_config_path);
109
+ if (hazo_config) {
110
+ const db_type = (_a = hazo_config["hazo_connect"]) === null || _a === void 0 ? void 0 : _a["type"];
111
+ if (db_type) {
112
+ results.push({
113
+ name: "Database type configured",
114
+ status: "pass",
115
+ message: `Using: ${db_type}`,
116
+ });
117
+ if (db_type === "sqlite") {
118
+ const sqlite_path = (_b = hazo_config["hazo_connect"]) === null || _b === void 0 ? void 0 : _b["sqlite_path"];
119
+ if (sqlite_path) {
120
+ results.push({
121
+ name: "SQLite path configured",
122
+ status: "pass",
123
+ message: sqlite_path,
124
+ });
125
+ }
126
+ else {
127
+ results.push({
128
+ name: "SQLite path configured",
129
+ status: "fail",
130
+ message: "sqlite_path not set in [hazo_connect] section",
131
+ });
132
+ }
133
+ }
134
+ else if (db_type === "postgrest") {
135
+ const postgrest_url = (_c = hazo_config["hazo_connect"]) === null || _c === void 0 ? void 0 : _c["postgrest_url"];
136
+ if (postgrest_url) {
137
+ results.push({
138
+ name: "PostgREST URL configured",
139
+ status: "pass",
140
+ message: postgrest_url,
141
+ });
142
+ }
143
+ else {
144
+ results.push({
145
+ name: "PostgREST URL configured",
146
+ status: "fail",
147
+ message: "postgrest_url not set in [hazo_connect] section",
148
+ });
149
+ }
150
+ }
151
+ }
152
+ else {
153
+ results.push({
154
+ name: "Database type configured",
155
+ status: "fail",
156
+ message: "type not set in [hazo_connect] section",
157
+ });
158
+ }
159
+ const layout_mode = (_d = hazo_config["hazo_auth__ui_shell"]) === null || _d === void 0 ? void 0 : _d["layout_mode"];
160
+ if (layout_mode === "standalone") {
161
+ results.push({
162
+ name: "UI shell mode",
163
+ status: "pass",
164
+ message: "standalone (recommended for consuming projects)",
165
+ });
166
+ }
167
+ else if (layout_mode === "test_sidebar") {
168
+ results.push({
169
+ name: "UI shell mode",
170
+ status: "warn",
171
+ message: "test_sidebar - consider changing to 'standalone' for consuming projects",
172
+ });
173
+ }
174
+ else {
175
+ results.push({
176
+ name: "UI shell mode",
177
+ status: "warn",
178
+ message: "Not set - defaults to test_sidebar. Consider setting to 'standalone'",
179
+ });
180
+ }
181
+ }
182
+ const notify_config_path = path.join(project_root, "hazo_notify_config.ini");
183
+ const notify_config = read_ini_file(notify_config_path);
184
+ if (notify_config) {
185
+ const from_email = (_e = notify_config["emailer"]) === null || _e === void 0 ? void 0 : _e["from_email"];
186
+ const from_name = (_f = notify_config["emailer"]) === null || _f === void 0 ? void 0 : _f["from_name"];
187
+ if (from_email && !from_email.includes("example.com")) {
188
+ results.push({
189
+ name: "Email from_email configured",
190
+ status: "pass",
191
+ message: from_email,
192
+ });
193
+ }
194
+ else {
195
+ results.push({
196
+ name: "Email from_email configured",
197
+ status: "warn",
198
+ message: from_email ? "Using example.com - update to your domain" : "Not set",
199
+ });
200
+ }
201
+ if (from_name && from_name !== "Your App Name") {
202
+ results.push({
203
+ name: "Email from_name configured",
204
+ status: "pass",
205
+ message: from_name,
206
+ });
207
+ }
208
+ else {
209
+ results.push({
210
+ name: "Email from_name configured",
211
+ status: "warn",
212
+ message: "Using default - update to your app name",
213
+ });
214
+ }
215
+ }
216
+ return results;
217
+ }
218
+ function check_env_vars() {
219
+ const results = [];
220
+ for (const env_var of REQUIRED_ENV_VARS) {
221
+ const value = process.env[env_var.name];
222
+ const has_value = value && value.length > 0;
223
+ if (env_var.required) {
224
+ results.push({
225
+ name: `Environment: ${env_var.name}`,
226
+ status: has_value ? "pass" : "fail",
227
+ message: has_value ? "Set" : `Not set - ${env_var.description}`,
228
+ });
229
+ }
230
+ else {
231
+ results.push({
232
+ name: `Environment: ${env_var.name}`,
233
+ status: has_value ? "pass" : "warn",
234
+ message: has_value ? "Set" : `Not set - ${env_var.description}`,
235
+ });
236
+ }
237
+ }
238
+ return results;
239
+ }
240
+ function check_api_routes(project_root) {
241
+ const results = [];
242
+ const possible_app_dirs = [
243
+ path.join(project_root, "app"),
244
+ path.join(project_root, "src", "app"),
245
+ ];
246
+ let app_dir = null;
247
+ for (const dir of possible_app_dirs) {
248
+ if (file_exists(dir)) {
249
+ app_dir = dir;
250
+ break;
251
+ }
252
+ }
253
+ if (!app_dir) {
254
+ results.push({
255
+ name: "App directory",
256
+ status: "fail",
257
+ message: "Could not find app/ or src/app/ directory",
258
+ });
259
+ return results;
260
+ }
261
+ results.push({
262
+ name: "App directory",
263
+ status: "pass",
264
+ message: app_dir.replace(project_root, "."),
265
+ });
266
+ let routes_found = 0;
267
+ let routes_missing = 0;
268
+ for (const route of REQUIRED_API_ROUTES) {
269
+ const route_path = path.join(app_dir, route.path, "route.ts");
270
+ const route_path_js = path.join(app_dir, route.path, "route.js");
271
+ const exists = file_exists(route_path) || file_exists(route_path_js);
272
+ if (exists) {
273
+ routes_found++;
274
+ }
275
+ else {
276
+ routes_missing++;
277
+ results.push({
278
+ name: `Route: /${route.path}`,
279
+ status: "fail",
280
+ message: `Missing - create ${route.path}/route.ts with export { ${route.method} } from "hazo_auth/server/routes/..."`,
281
+ });
282
+ }
283
+ }
284
+ if (routes_missing === 0) {
285
+ results.push({
286
+ name: `API Routes (${routes_found}/${REQUIRED_API_ROUTES.length})`,
287
+ status: "pass",
288
+ message: "All routes present",
289
+ });
290
+ }
291
+ else {
292
+ results.unshift({
293
+ name: `API Routes (${routes_found}/${REQUIRED_API_ROUTES.length})`,
294
+ status: "fail",
295
+ message: `${routes_missing} routes missing - run: npx hazo_auth generate-routes`,
296
+ });
297
+ }
298
+ return results;
299
+ }
300
+ function check_profile_pictures(project_root) {
301
+ const results = [];
302
+ const library_path = path.join(project_root, "public", "profile_pictures", "library");
303
+ const uploads_path = path.join(project_root, "public", "profile_pictures", "uploads");
304
+ if (file_exists(library_path)) {
305
+ try {
306
+ const files = fs.readdirSync(library_path);
307
+ const image_files = files.filter(f => /\.(jpg|jpeg|png|gif|webp)$/i.test(f));
308
+ if (image_files.length > 0) {
309
+ results.push({
310
+ name: "Profile picture library",
311
+ status: "pass",
312
+ message: `${image_files.length} images available`,
313
+ });
314
+ }
315
+ else {
316
+ results.push({
317
+ name: "Profile picture library",
318
+ status: "warn",
319
+ message: "Directory exists but no images found",
320
+ });
321
+ }
322
+ }
323
+ catch (_a) {
324
+ results.push({
325
+ name: "Profile picture library",
326
+ status: "warn",
327
+ message: "Could not read directory",
328
+ });
329
+ }
330
+ }
331
+ else {
332
+ results.push({
333
+ name: "Profile picture library",
334
+ status: "warn",
335
+ message: "Not found - copy from node_modules/hazo_auth/public/profile_pictures/library/",
336
+ });
337
+ }
338
+ if (file_exists(uploads_path)) {
339
+ results.push({
340
+ name: "Profile picture uploads directory",
341
+ status: "pass",
342
+ message: "Exists",
343
+ });
344
+ }
345
+ else {
346
+ results.push({
347
+ name: "Profile picture uploads directory",
348
+ status: "warn",
349
+ message: "Not found - will be created on first upload",
350
+ });
351
+ }
352
+ return results;
353
+ }
354
+ function check_database(project_root) {
355
+ var _a, _b, _c;
356
+ const results = [];
357
+ const hazo_config_path = path.join(project_root, "hazo_auth_config.ini");
358
+ const hazo_config = read_ini_file(hazo_config_path);
359
+ if (!hazo_config) {
360
+ results.push({
361
+ name: "Database check",
362
+ status: "fail",
363
+ message: "Could not read hazo_auth_config.ini",
364
+ });
365
+ return results;
366
+ }
367
+ const db_type = (_a = hazo_config["hazo_connect"]) === null || _a === void 0 ? void 0 : _a["type"];
368
+ if (db_type === "sqlite") {
369
+ const sqlite_path = (_b = hazo_config["hazo_connect"]) === null || _b === void 0 ? void 0 : _b["sqlite_path"];
370
+ if (sqlite_path) {
371
+ const full_path = path.isAbsolute(sqlite_path)
372
+ ? sqlite_path
373
+ : path.join(project_root, sqlite_path);
374
+ if (file_exists(full_path)) {
375
+ results.push({
376
+ name: "SQLite database file",
377
+ status: "pass",
378
+ message: full_path.replace(project_root, "."),
379
+ });
380
+ try {
381
+ const stats = fs.statSync(full_path);
382
+ if (stats.size > 0) {
383
+ results.push({
384
+ name: "SQLite database readable",
385
+ status: "pass",
386
+ message: `File size: ${(stats.size / 1024).toFixed(2)} KB`,
387
+ });
388
+ }
389
+ else {
390
+ results.push({
391
+ name: "SQLite database readable",
392
+ status: "warn",
393
+ message: "Database file is empty - tables may need to be created",
394
+ });
395
+ }
396
+ }
397
+ catch (_d) {
398
+ results.push({
399
+ name: "SQLite database readable",
400
+ status: "fail",
401
+ message: "Could not read database file",
402
+ });
403
+ }
404
+ }
405
+ else {
406
+ const parent_dir = path.dirname(full_path);
407
+ if (file_exists(parent_dir)) {
408
+ results.push({
409
+ name: "SQLite database file",
410
+ status: "warn",
411
+ message: "File not found - will be created on first use",
412
+ });
413
+ }
414
+ else {
415
+ results.push({
416
+ name: "SQLite database file",
417
+ status: "fail",
418
+ message: `Parent directory not found: ${parent_dir}. Create it with: mkdir -p ${parent_dir}`,
419
+ });
420
+ }
421
+ }
422
+ }
423
+ }
424
+ else if (db_type === "postgrest") {
425
+ const postgrest_url = (_c = hazo_config["hazo_connect"]) === null || _c === void 0 ? void 0 : _c["postgrest_url"];
426
+ if (postgrest_url) {
427
+ results.push({
428
+ name: "PostgREST connection",
429
+ status: "pass",
430
+ message: `URL configured: ${postgrest_url}`,
431
+ });
432
+ results.push({
433
+ name: "PostgREST tables",
434
+ status: "warn",
435
+ message: "Cannot verify tables remotely - ensure all hazo_* tables exist in PostgreSQL",
436
+ });
437
+ }
438
+ else {
439
+ results.push({
440
+ name: "PostgREST connection",
441
+ status: "fail",
442
+ message: "postgrest_url not configured",
443
+ });
444
+ }
445
+ }
446
+ return results;
447
+ }
448
+ // section: main
449
+ export function run_validation() {
450
+ const project_root = get_project_root();
451
+ const all_results = [];
452
+ console.log("\n\x1b[1m🐸 hazo_auth Setup Validation\x1b[0m");
453
+ console.log("=".repeat(50));
454
+ console.log(`Project root: ${project_root}\n`);
455
+ console.log("\x1b[1m📁 Configuration Files\x1b[0m");
456
+ const config_results = check_config_files(project_root);
457
+ config_results.forEach(print_result);
458
+ all_results.push(...config_results);
459
+ console.log();
460
+ console.log("\x1b[1m⚙️ Configuration Values\x1b[0m");
461
+ const value_results = check_config_values(project_root);
462
+ value_results.forEach(print_result);
463
+ all_results.push(...value_results);
464
+ console.log();
465
+ console.log("\x1b[1m🔐 Environment Variables\x1b[0m");
466
+ const env_results = check_env_vars();
467
+ env_results.forEach(print_result);
468
+ all_results.push(...env_results);
469
+ console.log();
470
+ console.log("\x1b[1m🗄️ Database\x1b[0m");
471
+ const db_results = check_database(project_root);
472
+ db_results.forEach(print_result);
473
+ all_results.push(...db_results);
474
+ console.log();
475
+ console.log("\x1b[1m🛤️ API Routes\x1b[0m");
476
+ const route_results = check_api_routes(project_root);
477
+ route_results.forEach(print_result);
478
+ all_results.push(...route_results);
479
+ console.log();
480
+ console.log("\x1b[1m🖼️ Profile Pictures\x1b[0m");
481
+ const pic_results = check_profile_pictures(project_root);
482
+ pic_results.forEach(print_result);
483
+ all_results.push(...pic_results);
484
+ console.log();
485
+ const summary = {
486
+ passed: all_results.filter(r => r.status === "pass").length,
487
+ failed: all_results.filter(r => r.status === "fail").length,
488
+ warnings: all_results.filter(r => r.status === "warn").length,
489
+ results: all_results,
490
+ };
491
+ console.log("=".repeat(50));
492
+ console.log("\x1b[1mSummary:\x1b[0m");
493
+ console.log(` \x1b[32m✓ Passed: ${summary.passed}\x1b[0m`);
494
+ console.log(` \x1b[31m✗ Failed: ${summary.failed}\x1b[0m`);
495
+ console.log(` \x1b[33m⚠ Warnings: ${summary.warnings}\x1b[0m`);
496
+ console.log();
497
+ if (summary.failed === 0 && summary.warnings === 0) {
498
+ console.log("\x1b[32m🦊 All checks passed! hazo_auth is ready to use.\x1b[0m\n");
499
+ }
500
+ else if (summary.failed === 0) {
501
+ console.log("\x1b[33m🦊 Setup complete with warnings. Review the warnings above.\x1b[0m\n");
502
+ }
503
+ else {
504
+ console.log("\x1b[31m🦊 Setup incomplete. Please fix the failed checks above.\x1b[0m\n");
505
+ console.log("For detailed setup instructions, see:");
506
+ console.log(" https://github.com/your-repo/hazo_auth/blob/main/SETUP_CHECKLIST.md\n");
507
+ }
508
+ return summary;
509
+ }
@@ -0,0 +1,9 @@
1
+ import * as React from "react";
2
+ declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
3
+ declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
4
+ declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
5
+ declare const CardDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
6
+ declare const CardContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
7
+ declare const CardFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
8
+ export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
9
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../src/components/ui/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,QAAA,MAAM,IAAI,6GAYR,CAAA;AAGF,QAAA,MAAM,UAAU,6GASd,CAAA;AAGF,QAAA,MAAM,SAAS,6GASb,CAAA;AAGF,QAAA,MAAM,eAAe,6GASnB,CAAA;AAGF,QAAA,MAAM,WAAW,6GAKf,CAAA;AAGF,QAAA,MAAM,UAAU,6GASd,CAAA;AAGF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,CAAA"}
@@ -0,0 +1,45 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ import * as React from "react";
14
+ import { cn } from "../../lib/utils";
15
+ const Card = React.forwardRef((_a, ref) => {
16
+ var { className } = _a, props = __rest(_a, ["className"]);
17
+ return (_jsx("div", Object.assign({ ref: ref, className: cn("rounded-xl border bg-card text-card-foreground shadow", className) }, props)));
18
+ });
19
+ Card.displayName = "Card";
20
+ const CardHeader = React.forwardRef((_a, ref) => {
21
+ var { className } = _a, props = __rest(_a, ["className"]);
22
+ return (_jsx("div", Object.assign({ ref: ref, className: cn("flex flex-col space-y-1.5 p-6", className) }, props)));
23
+ });
24
+ CardHeader.displayName = "CardHeader";
25
+ const CardTitle = React.forwardRef((_a, ref) => {
26
+ var { className } = _a, props = __rest(_a, ["className"]);
27
+ return (_jsx("div", Object.assign({ ref: ref, className: cn("font-semibold leading-none tracking-tight", className) }, props)));
28
+ });
29
+ CardTitle.displayName = "CardTitle";
30
+ const CardDescription = React.forwardRef((_a, ref) => {
31
+ var { className } = _a, props = __rest(_a, ["className"]);
32
+ return (_jsx("div", Object.assign({ ref: ref, className: cn("text-sm text-muted-foreground", className) }, props)));
33
+ });
34
+ CardDescription.displayName = "CardDescription";
35
+ const CardContent = React.forwardRef((_a, ref) => {
36
+ var { className } = _a, props = __rest(_a, ["className"]);
37
+ return (_jsx("div", Object.assign({ ref: ref, className: cn("p-6 pt-0", className) }, props)));
38
+ });
39
+ CardContent.displayName = "CardContent";
40
+ const CardFooter = React.forwardRef((_a, ref) => {
41
+ var { className } = _a, props = __rest(_a, ["className"]);
42
+ return (_jsx("div", Object.assign({ ref: ref, className: cn("flex items-center p-6 pt-0", className) }, props)));
43
+ });
44
+ CardFooter.displayName = "CardFooter";
45
+ export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardContent };
@@ -1 +1 @@
1
- {"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mobile.tsx"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,YAc1B"}
1
+ {"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mobile.tsx"],"names":[],"mappings":"AAOA,wBAAgB,WAAW,YA8B1B"}
@@ -1,15 +1,29 @@
1
+ // file_description: hydration-safe hook to detect mobile viewport
2
+ // This hook prevents hydration mismatches by returning a consistent value
3
+ // during SSR and initial client render, only updating after hydration completes.
1
4
  import * as React from "react";
2
5
  const MOBILE_BREAKPOINT = 768;
3
6
  export function useIsMobile() {
4
- const [isMobile, setIsMobile] = React.useState(undefined);
7
+ // Track whether component has mounted (hydration complete)
8
+ const [isMounted, setIsMounted] = React.useState(false);
9
+ const [isMobile, setIsMobile] = React.useState(false);
5
10
  React.useEffect(() => {
11
+ // Mark as mounted after hydration
12
+ setIsMounted(true);
13
+ // Now safe to read window dimensions
6
14
  const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
7
15
  const onChange = () => {
8
16
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
9
17
  };
10
- mql.addEventListener("change", onChange);
18
+ // Set initial value
11
19
  setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
20
+ mql.addEventListener("change", onChange);
12
21
  return () => mql.removeEventListener("change", onChange);
13
22
  }, []);
14
- return !!isMobile;
23
+ // Return false during SSR and initial hydration to prevent mismatch
24
+ // Only return actual mobile state after component has mounted
25
+ if (!isMounted) {
26
+ return false;
27
+ }
28
+ return isMobile;
15
29
  }
@@ -5,6 +5,14 @@ export type DefaultProfilePictureResult = {
5
5
  profile_picture_url: string;
6
6
  profile_source: ProfilePictureSource;
7
7
  };
8
+ export type LibraryPhotosResult = {
9
+ photos: string[];
10
+ total: number;
11
+ page: number;
12
+ page_size: number;
13
+ has_more: boolean;
14
+ source: "project" | "node_modules";
15
+ };
8
16
  /**
9
17
  * Generates Gravatar URL from email address
10
18
  * @param email - User's email address
@@ -18,11 +26,35 @@ export declare function get_gravatar_url(email: string, size?: number): string;
18
26
  */
19
27
  export declare function get_library_categories(): string[];
20
28
  /**
21
- * Gets photos in a specific library category
29
+ * Gets photos in a specific library category with pagination support
30
+ * @param category - Category name
31
+ * @param page - Page number (1-indexed, default 1)
32
+ * @param page_size - Number of photos per page (default 20, max 100)
33
+ * @returns Object with photos array and pagination info
34
+ */
35
+ export declare function get_library_photos_paginated(category: string, page?: number, page_size?: number): LibraryPhotosResult;
36
+ /**
37
+ * Gets photos in a specific library category (legacy non-paginated version)
22
38
  * @param category - Category name
23
- * @returns Array of photo URLs (relative to public directory)
39
+ * @returns Array of photo URLs (relative to public directory or API route)
24
40
  */
25
41
  export declare function get_library_photos(category: string): string[];
42
+ /**
43
+ * Gets the physical file path for a library photo (used for serving from node_modules)
44
+ * @param category - Category name
45
+ * @param filename - Photo filename
46
+ * @returns Full file path or null if not found
47
+ */
48
+ export declare function get_library_photo_path(category: string, filename: string): string | null;
49
+ /**
50
+ * Gets the source of library photos (for diagnostic purposes)
51
+ * @returns Source type or null if no library found
52
+ */
53
+ export declare function get_library_source(): "project" | "node_modules" | null;
54
+ /**
55
+ * Clears the library path cache (useful for testing or after copying files)
56
+ */
57
+ export declare function clear_library_cache(): void;
26
58
  /**
27
59
  * Gets default profile picture based on configuration priority
28
60
  * @param user_email - User's email address
@@ -1 +1 @@
1
- {"version":3,"file":"profile_picture_service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/profile_picture_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AASvD,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAGnG,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D,MAAM,MAAM,2BAA2B,GAAG;IACxC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,oBAAoB,CAAC;CACtC,CAAC;AAGF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAOrE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAyBjD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAiC7D;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,2BAA2B,GAAG,IAAI,CA2DpC;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,MAAM,EAC3B,cAAc,EAAE,oBAAoB,GACnC,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAsB/C"}
1
+ {"version":3,"file":"profile_picture_service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/profile_picture_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AASvD,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAGnG,MAAM,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAE1D,MAAM,MAAM,2BAA2B,GAAG;IACxC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,oBAAoB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,SAAS,GAAG,cAAc,CAAC;CACpC,CAAC;AA2DF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAOrE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,EAAE,CAyBjD;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,MAAU,EAChB,SAAS,GAAE,MAAW,GACrB,mBAAmB,CA6FrB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAI7D;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAcxF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,SAAS,GAAG,cAAc,GAAG,IAAI,CAGtE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAG1C;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,SAAS,CAAC,EAAE,MAAM,GACjB,2BAA2B,GAAG,IAAI,CA2DpC;AAED;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,MAAM,EAC3B,cAAc,EAAE,oBAAoB,GACnC,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAsB/C"}