@ozdao/martyrs 0.2.584 → 0.2.586

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 (436) hide show
  1. package/dist/auth.server.js +161 -96
  2. package/dist/{authJwt-J1csaMWA.js → authJwt-DKbMMjw0.js} +33 -0
  3. package/dist/builder.js +2 -0
  4. package/dist/chats.server.js +2 -2
  5. package/dist/community.server.js +1 -1
  6. package/dist/core.server.js +191 -2
  7. package/dist/{core.websocket-C2FxNmZ1.js → core.websocket-Cl76z2wT.js} +41 -5
  8. package/dist/{crud-q1ye5IhV.js → crud-DpOXTZep.js} +1 -1
  9. package/dist/events.server.js +2 -2
  10. package/dist/files.server.js +1 -1
  11. package/dist/gallery.server.js +1 -1
  12. package/dist/index-kvBwwb0w.js +427 -0
  13. package/dist/inventory.server.js +2 -2
  14. package/dist/{mailing-DuEFRsa3.js → mailing-DT7nbNjZ.js} +16 -3
  15. package/dist/{main-fmp55tJF.js → main-BIf-WirR.js} +864 -865
  16. package/dist/marketplace.server.js +1 -1
  17. package/dist/martyrs/dist/{main-fmp55tJF.js → main-BIf-WirR.js} +193 -38
  18. package/dist/martyrs/dist/main-BIf-WirR.js.map +1 -0
  19. package/dist/martyrs/dist/{web-BDuQSQKS.js → web-O7lXcjg0.js} +2 -2
  20. package/dist/martyrs/dist/{web-BDuQSQKS.js.map → web-O7lXcjg0.js.map} +1 -1
  21. package/dist/martyrs/src/components/Button/{Button.vue2.js → Button.vue.js} +8 -7
  22. package/dist/martyrs/src/components/Button/Button.vue.js.map +1 -0
  23. package/dist/martyrs/src/components/EditImages/{EditImages.vue2.js → EditImages.vue.js} +2 -2
  24. package/dist/martyrs/src/components/EditImages/EditImages.vue.js.map +1 -0
  25. package/dist/martyrs/src/components/Feed/Feed.vue.js +1 -1
  26. package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
  27. package/dist/martyrs/src/components/Loader/Loader.vue.js +1 -1
  28. package/dist/martyrs/src/components/Loader/Loader.vue.js.map +1 -1
  29. package/dist/martyrs/src/components/Spoiler/{Spoiler.vue2.js → Spoiler.vue.js} +2 -2
  30. package/dist/martyrs/src/components/Spoiler/Spoiler.vue.js.map +1 -0
  31. package/dist/martyrs/src/components/Tab/{Tab.vue.js → Tab.vue2.js} +2 -2
  32. package/dist/martyrs/src/components/Tab/Tab.vue2.js.map +1 -0
  33. package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js +17 -22
  34. package/dist/martyrs/src/components/Tooltip/Tooltip.vue2.js.map +1 -1
  35. package/dist/martyrs/src/modules/auth/auth.client.js +18 -24
  36. package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
  37. package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js +178 -0
  38. package/dist/martyrs/src/modules/auth/views/components/blocks/OtpDialog.vue.js.map +1 -0
  39. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +2 -2
  40. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +104 -77
  41. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js.map +1 -1
  42. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileBlogposts.vue.js +1 -1
  43. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +198 -14
  44. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js.map +1 -1
  45. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
  46. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +71 -30
  47. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js.map +1 -1
  48. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +3 -3
  49. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
  50. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +87 -31
  51. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js.map +1 -1
  52. package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js +100 -0
  53. package/dist/martyrs/src/modules/auth/views/plugins/otp.plugin.js.map +1 -0
  54. package/dist/martyrs/src/modules/auth/views/router/auth.router.js +2 -31
  55. package/dist/martyrs/src/modules/auth/views/router/auth.router.js.map +1 -1
  56. package/dist/martyrs/src/modules/auth/views/router/users.router.js +0 -14
  57. package/dist/martyrs/src/modules/auth/views/router/users.router.js.map +1 -1
  58. package/dist/martyrs/src/modules/auth/views/store/auth.js +1 -56
  59. package/dist/martyrs/src/modules/auth/views/store/auth.js.map +1 -1
  60. package/dist/martyrs/src/modules/auth/views/store/users.js +5 -1
  61. package/dist/martyrs/src/modules/auth/views/store/users.js.map +1 -1
  62. package/dist/martyrs/src/modules/backoffice/backoffice.client.js +3 -15
  63. package/dist/martyrs/src/modules/backoffice/backoffice.client.js.map +1 -1
  64. package/dist/martyrs/src/modules/backoffice/configs/navigation.backoffice.config.js +99 -0
  65. package/dist/martyrs/src/modules/backoffice/configs/navigation.backoffice.config.js.map +1 -0
  66. package/dist/martyrs/src/modules/backoffice/{backoffice.router.js → router/backoffice.router.js} +9 -7
  67. package/dist/martyrs/src/modules/backoffice/router/backoffice.router.js.map +1 -0
  68. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +7 -1
  69. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js.map +1 -1
  70. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +1 -1
  71. package/dist/martyrs/src/modules/core/core.client.js.map +1 -1
  72. package/dist/martyrs/src/modules/core/views/classes/core.app.js +5 -1
  73. package/dist/martyrs/src/modules/core/views/classes/core.app.js.map +1 -1
  74. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js +0 -1
  75. package/dist/martyrs/src/modules/core/views/components/blocks/CardHeader.vue.js.map +1 -1
  76. package/dist/martyrs/src/modules/core/views/components/blocks/PopupAuth.vue.js +1 -1
  77. package/dist/martyrs/src/modules/core/views/components/blocks/PopupDateSelector.vue.js +1 -1
  78. package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js +74 -0
  79. package/dist/martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue.js.map +1 -0
  80. package/dist/martyrs/src/modules/core/views/components/layouts/App.vue.js.map +1 -1
  81. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js +77 -67
  82. package/dist/martyrs/src/modules/core/views/components/layouts/Client.vue.js.map +1 -1
  83. package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js +76 -7
  84. package/dist/martyrs/src/modules/core/views/components/pages/404.vue.js.map +1 -1
  85. package/dist/martyrs/src/modules/core/views/components/partials/Header.vue.js +1 -1
  86. package/dist/martyrs/src/modules/core/views/components/partials/Navigation.vue.js +1 -1
  87. package/dist/martyrs/src/modules/core/views/components/partials/NavigationBar.vue.js +1 -1
  88. package/dist/martyrs/src/modules/core/views/components/sections/{Filters.vue2.js → Filters.vue.js} +2 -2
  89. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue.js.map +1 -0
  90. package/dist/martyrs/src/modules/core/views/components/sections/SectionPageTitle.vue.js +1 -1
  91. package/dist/martyrs/src/modules/core/views/store/core.store.js +1 -0
  92. package/dist/martyrs/src/modules/core/views/store/core.store.js.map +1 -1
  93. package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js +2 -1
  94. package/dist/martyrs/src/modules/core/views/utils/vue-app-renderer.js.map +1 -1
  95. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  96. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  97. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  98. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  99. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +2 -1
  100. package/dist/martyrs/src/modules/events/components/pages/Event.vue.js.map +1 -1
  101. package/dist/martyrs/src/modules/events/components/pages/EventsBackoffice.vue.js +1 -1
  102. package/dist/martyrs/src/modules/events/components/sections/EditTickets.vue.js +1 -1
  103. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  104. package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +1 -1
  105. package/dist/martyrs/src/modules/inventory/components/forms/ColumnSettingsMenu.vue.js +1 -1
  106. package/dist/martyrs/src/modules/inventory/components/forms/HistoryView.vue.js +1 -1
  107. package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +1 -1
  108. package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
  109. package/dist/martyrs/src/modules/landing/components/sections/SectionGuide.vue.js +1 -1
  110. package/dist/martyrs/src/modules/marketplace/views/components/pages/Marketplace.vue.js +1 -1
  111. package/dist/martyrs/src/modules/music/components/blocks/ActionButtons.vue.js +1 -1
  112. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +1 -1
  113. package/dist/martyrs/src/modules/music/components/cards/ArtistCardSmall.vue.js +1 -1
  114. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +1 -1
  115. package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +1 -1
  116. package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +1 -1
  117. package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +1 -1
  118. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +1 -1
  119. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +1 -1
  120. package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +1 -1
  121. package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +1 -1
  122. package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +1 -1
  123. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +1 -1
  124. package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +1 -1
  125. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +1 -1
  126. package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +1 -1
  127. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js +0 -1
  128. package/dist/martyrs/src/modules/music/components/pages/TrackCreate.vue.js.map +1 -1
  129. package/dist/martyrs/src/modules/music/components/player/FullscreenPlayer.vue.js +1 -1
  130. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +1 -1
  131. package/dist/martyrs/src/modules/music/components/player/PlayerControls.vue.js +1 -1
  132. package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +1 -1
  133. package/dist/martyrs/src/modules/notifications/components/sections/NotificationPreferences.vue.js +1 -1
  134. package/dist/martyrs/src/modules/orders/components/forms/FormApplicationDetails.vue.js +1 -1
  135. package/dist/martyrs/src/modules/orders/components/forms/FormCustomerDetails.vue.js +1 -1
  136. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js +1 -2
  137. package/dist/martyrs/src/modules/orders/components/forms/FormSelectCustomer.vue.js.map +1 -1
  138. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  139. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
  140. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  141. package/dist/martyrs/src/modules/orders/components/pages/Orders.vue.js +1 -1
  142. package/dist/martyrs/src/modules/orders/components/sections/ApplicationDetails.vue.js +1 -1
  143. package/dist/martyrs/src/modules/orders/components/sections/CustomerDetails.vue.js +1 -1
  144. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  145. package/dist/martyrs/src/modules/organizations/components/blocks/CardDepartment.vue.js +1 -1
  146. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  147. package/dist/martyrs/src/modules/organizations/components/forms/AddExistingMembersForm.vue.js +1 -1
  148. package/dist/martyrs/src/modules/organizations/components/forms/DepartmentForm.vue.js +2 -2
  149. package/dist/martyrs/src/modules/organizations/components/forms/InviteForm.vue.js +1 -1
  150. package/dist/martyrs/src/modules/organizations/components/pages/Department.vue.js +1 -1
  151. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +4 -3
  152. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js.map +1 -1
  153. package/dist/martyrs/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  154. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -2
  155. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js.map +1 -1
  156. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  157. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -2
  158. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js.map +1 -1
  159. package/dist/martyrs/src/modules/pages/pages.router.js +7 -5
  160. package/dist/martyrs/src/modules/pages/pages.router.js.map +1 -1
  161. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +0 -1
  162. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js.map +1 -1
  163. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  164. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
  165. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +0 -1
  166. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js.map +1 -1
  167. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  168. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -2
  169. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
  170. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
  171. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js +4 -4
  172. package/dist/martyrs/src/modules/products/components/pages/Products.vue.js.map +1 -1
  173. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
  174. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +1 -1
  175. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +2 -2
  176. package/dist/martyrs/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  177. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
  178. package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
  179. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +2 -2
  180. package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +2 -2
  181. package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +1 -1
  182. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
  183. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  184. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  185. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
  186. package/dist/martyrs/src/modules/spots/components/pages/Spot.vue.js +1 -1
  187. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
  188. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +1 -1
  189. package/dist/martyrs.css +1 -1
  190. package/dist/martyrs.es.js +1 -1
  191. package/dist/music.server.js +1 -1
  192. package/dist/notifications.server.js +1 -1
  193. package/dist/orders.server.js +7 -6
  194. package/dist/organizations.server.js +2 -2
  195. package/dist/products.server.js +2 -2
  196. package/dist/profile.schema-C31Lynn3.js +21 -0
  197. package/dist/rents.server.js +1 -1
  198. package/dist/sessions.service-COcwjd0f.js +86 -0
  199. package/dist/style.css +183 -108
  200. package/dist/{tickets.controller-B7r0mK-5.js → tickets.controller-DdF85W-i.js} +1 -1
  201. package/dist/visitors.service-B1dhhuSo.js +83 -0
  202. package/dist/wallet.server.js +2 -2
  203. package/dist/{web-BDuQSQKS.js → web-O7lXcjg0.js} +1 -1
  204. package/package.json +5 -1
  205. package/src/builder/modes/ssr.rspack.dev.js +2 -0
  206. package/src/cli/commands/create.js +106 -0
  207. package/src/cli/index.js +25 -0
  208. package/src/cli/templates/app/.env.development.mustache +14 -0
  209. package/src/cli/templates/app/.env.production.mustache +14 -0
  210. package/src/cli/templates/app/Dockerfile +36 -0
  211. package/src/cli/templates/app/babel.config.js +14 -0
  212. package/src/cli/templates/app/env.js +3 -0
  213. package/src/cli/templates/app/index.js +46 -0
  214. package/src/cli/templates/app/mongodb.config.js +18 -0
  215. package/src/cli/templates/app/package.json.mustache +65 -0
  216. package/src/cli/templates/app/src/client.js +22 -0
  217. package/src/cli/templates/app/src/components/pages/Index.vue +11 -0
  218. package/src/cli/templates/app/src/configs/global.config.js.mustache +40 -0
  219. package/src/cli/templates/app/src/localization/extensions.js +2 -0
  220. package/src/cli/templates/app/src/localization/index.js +44 -0
  221. package/src/cli/templates/app/src/localization/overrides.js +2 -0
  222. package/src/cli/templates/app/src/localization/translations.js +10 -0
  223. package/src/cli/templates/app/src/models/index.js +9 -0
  224. package/src/cli/templates/app/src/router/index.js +48 -0
  225. package/src/cli/templates/app/src/scss/theme.scss +18 -0
  226. package/src/cli/templates/app/src/server.js +68 -0
  227. package/src/cli/templates/app/src/store/index.js +9 -0
  228. package/src/cli/templates/docker-compose.yaml.mustache +47 -0
  229. package/src/cli/templates/nginx/Dockerfile +5 -0
  230. package/src/cli/templates/nginx/default.conf.mustache +55 -0
  231. package/src/cli/templates/public/favicon/.gitkeep +0 -0
  232. package/src/cli/templates/start-dev.sh.mustache +131 -0
  233. package/src/cli/templates/start-prod.sh.mustache +12 -0
  234. package/src/components/Button/Button.vue +61 -15
  235. package/src/components/Loader/Loader.vue +1 -1
  236. package/src/components/Tooltip/Tooltip.vue +31 -23
  237. package/src/modules/TASKS.MD +30 -1
  238. package/src/modules/auth/CLAUDE.md +381 -0
  239. package/src/modules/auth/FIXES.md +0 -38
  240. package/src/modules/auth/auth.client.js +4 -6
  241. package/src/modules/auth/auth.server.js +4 -15
  242. package/src/modules/auth/controllers/middlewares/authJwt.js +59 -17
  243. package/src/modules/auth/controllers/middlewares/index.js +4 -1
  244. package/src/modules/auth/controllers/middlewares/otp.middleware.js +166 -0
  245. package/src/modules/auth/controllers/middlewares/verifySignUp.js +0 -1
  246. package/src/modules/auth/controllers/middlewares/verifyUser.js +58 -11
  247. package/src/modules/auth/controllers/routes/auth.routes.js +48 -6
  248. package/src/modules/auth/controllers/routes/users.routes.js +29 -8
  249. package/src/modules/auth/controllers/services/auth.service.js +62 -12
  250. package/src/modules/auth/controllers/services/otp.service.js +109 -0
  251. package/src/modules/auth/controllers/services/users.service.js +46 -6
  252. package/src/modules/auth/models/otp.model.js +20 -0
  253. package/src/modules/auth/views/components/blocks/OtpDialog.vue +168 -0
  254. package/src/modules/auth/views/components/pages/Profile.vue +51 -18
  255. package/src/modules/auth/views/components/pages/ProfileEditAccount.vue +199 -45
  256. package/src/modules/auth/views/components/pages/ResetPassword.vue +170 -132
  257. package/src/modules/auth/views/components/pages/SignIn.vue +2 -1
  258. package/src/modules/auth/views/components/pages/SignUp.vue +203 -147
  259. package/src/modules/auth/views/plugins/otp.plugin.js +104 -0
  260. package/src/modules/auth/views/router/auth.router.js +1 -24
  261. package/src/modules/auth/views/router/users.router.js +1 -12
  262. package/src/modules/auth/views/store/auth.js +0 -68
  263. package/src/modules/auth/views/store/users.js +6 -2
  264. package/src/modules/backoffice/backoffice.client.js +1 -25
  265. package/src/modules/backoffice/configs/navigation.backoffice.config.js +99 -0
  266. package/src/modules/backoffice/router/backoffice.router.js +8 -7
  267. package/src/modules/community/components/pages/BlogPost.vue +9 -1
  268. package/src/modules/core/controllers/classes/core.websocket.js +57 -6
  269. package/src/modules/core/controllers/middlewares/visitor.logger.js +49 -0
  270. package/src/modules/core/controllers/services/requests.service.js +53 -0
  271. package/src/modules/core/controllers/services/sessions.service.js +98 -0
  272. package/src/modules/core/controllers/services/visitors.service.js +102 -0
  273. package/src/modules/core/controllers/utils/mailing.js +16 -3
  274. package/src/modules/core/core.client.js +1 -0
  275. package/src/modules/core/core.server.js +45 -3
  276. package/src/modules/core/models/request.model.js +30 -0
  277. package/src/modules/core/models/session.model.js +43 -0
  278. package/src/modules/core/models/visitor.model.js +28 -0
  279. package/src/modules/core/views/classes/core.app.js +8 -3
  280. package/src/modules/core/views/components/elements/OnlineIndicator.vue +115 -0
  281. package/src/modules/core/views/components/layouts/App.vue +2 -2
  282. package/src/modules/core/views/components/layouts/Client.vue +444 -479
  283. package/src/modules/core/views/components/pages/404.vue +55 -3
  284. package/src/modules/core/views/store/core.store.js +1 -0
  285. package/src/modules/core/views/utils/vue-app-renderer.js +9 -1
  286. package/src/modules/orders/controllers/orders.controller.js +3 -3
  287. package/src/modules/pages/pages.router.js +4 -2
  288. package/src/modules/pages/views/router/pages.backoffice.router.js +4 -3
  289. package/src/modules/products/components/pages/Products.vue +1 -1
  290. package/dist/_virtual/alignment-pattern.js +0 -5
  291. package/dist/_virtual/alignment-pattern.js.map +0 -1
  292. package/dist/_virtual/browser.js +0 -8
  293. package/dist/_virtual/browser.js.map +0 -1
  294. package/dist/_virtual/browser2.js +0 -5
  295. package/dist/_virtual/browser2.js.map +0 -1
  296. package/dist/_virtual/canvas.js +0 -5
  297. package/dist/_virtual/canvas.js.map +0 -1
  298. package/dist/_virtual/dijkstra.js +0 -5
  299. package/dist/_virtual/dijkstra.js.map +0 -1
  300. package/dist/_virtual/error-correction-code.js +0 -5
  301. package/dist/_virtual/error-correction-code.js.map +0 -1
  302. package/dist/_virtual/error-correction-level.js +0 -5
  303. package/dist/_virtual/error-correction-level.js.map +0 -1
  304. package/dist/_virtual/finder-pattern.js +0 -5
  305. package/dist/_virtual/finder-pattern.js.map +0 -1
  306. package/dist/_virtual/format-info.js +0 -5
  307. package/dist/_virtual/format-info.js.map +0 -1
  308. package/dist/_virtual/galois-field.js +0 -5
  309. package/dist/_virtual/galois-field.js.map +0 -1
  310. package/dist/_virtual/mask-pattern.js +0 -5
  311. package/dist/_virtual/mask-pattern.js.map +0 -1
  312. package/dist/_virtual/mode.js +0 -5
  313. package/dist/_virtual/mode.js.map +0 -1
  314. package/dist/_virtual/polynomial.js +0 -5
  315. package/dist/_virtual/polynomial.js.map +0 -1
  316. package/dist/_virtual/qrcode.js +0 -5
  317. package/dist/_virtual/qrcode.js.map +0 -1
  318. package/dist/_virtual/regex.js +0 -5
  319. package/dist/_virtual/regex.js.map +0 -1
  320. package/dist/_virtual/segments.js +0 -5
  321. package/dist/_virtual/segments.js.map +0 -1
  322. package/dist/_virtual/svg-tag.js +0 -5
  323. package/dist/_virtual/svg-tag.js.map +0 -1
  324. package/dist/_virtual/utils.js +0 -5
  325. package/dist/_virtual/utils.js.map +0 -1
  326. package/dist/_virtual/utils2.js +0 -5
  327. package/dist/_virtual/utils2.js.map +0 -1
  328. package/dist/_virtual/version-check.js +0 -5
  329. package/dist/_virtual/version-check.js.map +0 -1
  330. package/dist/_virtual/version.js +0 -5
  331. package/dist/_virtual/version.js.map +0 -1
  332. package/dist/index-_Edcmck_.js +0 -170
  333. package/dist/martyrs/dist/main-fmp55tJF.js.map +0 -1
  334. package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +0 -1336
  335. package/dist/martyrs/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js.map +0 -1
  336. package/dist/martyrs/src/components/Button/Button.vue2.js.map +0 -1
  337. package/dist/martyrs/src/components/EditImages/EditImages.vue2.js.map +0 -1
  338. package/dist/martyrs/src/components/Spoiler/Spoiler.vue2.js.map +0 -1
  339. package/dist/martyrs/src/components/Tab/Tab.vue.js.map +0 -1
  340. package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js +0 -166
  341. package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js.map +0 -1
  342. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +0 -118
  343. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js.map +0 -1
  344. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +0 -360
  345. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js.map +0 -1
  346. package/dist/martyrs/src/modules/auth/views/store/twofa.js +0 -40
  347. package/dist/martyrs/src/modules/auth/views/store/twofa.js.map +0 -1
  348. package/dist/martyrs/src/modules/backoffice/backoffice.router.js.map +0 -1
  349. package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js +0 -150
  350. package/dist/martyrs/src/modules/backoffice/components/partials/Sidebar.vue.js.map +0 -1
  351. package/dist/martyrs/src/modules/core/views/components/sections/Filters.vue2.js.map +0 -1
  352. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js +0 -43
  353. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardBalanceReplenished.vue.js.map +0 -1
  354. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +0 -47
  355. package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js.map +0 -1
  356. package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js +0 -29
  357. package/dist/martyrs/src/modules/wallet/views/components/blocks/CashDeposit.vue.js.map +0 -1
  358. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +0 -89
  359. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js.map +0 -1
  360. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js +0 -136
  361. package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDepositProcessing.vue.js.map +0 -1
  362. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +0 -238
  363. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js.map +0 -1
  364. package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js +0 -9
  365. package/dist/martyrs/src/modules/wallet/views/localization/wallet.json.js.map +0 -1
  366. package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js +0 -134
  367. package/dist/martyrs/src/modules/wallet/views/store/wallet.store.js.map +0 -1
  368. package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js +0 -106
  369. package/dist/node_modules/.pnpm/dijkstrajs@1.0.3/node_modules/dijkstrajs/dijkstra.js.map +0 -1
  370. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js +0 -79
  371. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/browser.js.map +0 -1
  372. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js +0 -14
  373. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/can-promise.js.map +0 -1
  374. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js +0 -43
  375. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alignment-pattern.js.map +0 -1
  376. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js +0 -85
  377. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/alphanumeric-data.js.map +0 -1
  378. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js +0 -40
  379. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-buffer.js.map +0 -1
  380. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js +0 -34
  381. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/bit-matrix.js.map +0 -1
  382. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js +0 -36
  383. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/byte-data.js.map +0 -1
  384. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js +0 -367
  385. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-code.js.map +0 -1
  386. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js +0 -52
  387. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/error-correction-level.js.map +0 -1
  388. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js +0 -25
  389. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/finder-pattern.js.map +0 -1
  390. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js +0 -24
  391. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/format-info.js.map +0 -1
  392. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js +0 -38
  393. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/galois-field.js.map +0 -1
  394. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js +0 -46
  395. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/kanji-data.js.map +0 -1
  396. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js +0 -149
  397. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mask-pattern.js.map +0 -1
  398. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js +0 -90
  399. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/mode.js.map +0 -1
  400. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js +0 -41
  401. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/numeric-data.js.map +0 -1
  402. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js +0 -44
  403. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/polynomial.js.map +0 -1
  404. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js +0 -279
  405. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/qrcode.js.map +0 -1
  406. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js +0 -38
  407. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/reed-solomon-encoder.js.map +0 -1
  408. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js +0 -33
  409. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/regex.js.map +0 -1
  410. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js +0 -201
  411. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/segments.js.map +0 -1
  412. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js +0 -84
  413. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/utils.js.map +0 -1
  414. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js +0 -14
  415. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version-check.js.map +0 -1
  416. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js +0 -107
  417. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/core/version.js.map +0 -1
  418. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js +0 -61
  419. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/canvas.js.map +0 -1
  420. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js +0 -64
  421. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/svg-tag.js.map +0 -1
  422. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js +0 -87
  423. package/dist/node_modules/.pnpm/qrcode@1.5.4/node_modules/qrcode/lib/renderer/utils.js.map +0 -1
  424. package/dist/profile.schema-CjLOfG7b.js +0 -92
  425. package/src/modules/auth/controllers/middlewares/visitor.logger.js +0 -75
  426. package/src/modules/auth/controllers/routes/twofa.routes.js +0 -8
  427. package/src/modules/auth/controllers/services/twofa.service.js +0 -30
  428. package/src/modules/auth/models/request.model.js +0 -14
  429. package/src/modules/auth/models/visitor.model.js +0 -11
  430. package/src/modules/auth/views/components/pages/EnterCode.vue +0 -204
  431. package/src/modules/auth/views/components/pages/EnterPassword.vue +0 -123
  432. package/src/modules/auth/views/components/sections/ProfileEditCredentials.vue +0 -329
  433. package/src/modules/auth/views/store/twofa.js +0 -70
  434. package/src/modules/auth//320/220/320/240/320/245/320/230/320/242/320/225/320/232/320/242/320/243/320/240/320/220.md +0 -445
  435. package/src/modules/backoffice/backoffice.router.js +0 -69
  436. package/src/modules/backoffice/components/partials/Sidebar.vue +0 -165
@@ -2,14 +2,17 @@ import addMembersQuantity from '@martyrs/src/modules/organizations/controllers/u
2
2
  import addUserStatusFields from '@martyrs/src/modules/organizations/controllers/utils/addUserStatusFields.js';
3
3
  import { Types } from 'mongoose';
4
4
  const ObjectId = { Types }.Types.ObjectId;
5
+
5
6
  const controllerFactory = db => {
6
7
  const User = db.user;
8
+
7
9
  const read = async (req, res) => {
8
10
  let query = [];
9
11
  let match = {};
10
12
  let skip = parseInt(req.query.skip) || 0;
11
13
  let limit = parseInt(req.query.limit) || 10;
12
14
  let matchConditions = [];
15
+
13
16
  // Модифицированная проверка _id
14
17
  if (req.query._id) {
15
18
  // Проверяем, является ли _id валидным ObjectId
@@ -21,7 +24,9 @@ const controllerFactory = db => {
21
24
  matchConditions.push({ username: req.query._id });
22
25
  }
23
26
  }
27
+
24
28
  let search = req.query.search;
29
+
25
30
  if (search) {
26
31
  let regexPattern = '';
27
32
  // Экранирование специальных символов в строке поиска
@@ -47,7 +52,9 @@ const controllerFactory = db => {
47
52
  ],
48
53
  });
49
54
  }
55
+
50
56
  if (matchConditions.length > 0) query.push({ $match: { $and: matchConditions } });
57
+
51
58
  query.push({
52
59
  $lookup: {
53
60
  from: 'orders',
@@ -74,6 +81,14 @@ const controllerFactory = db => {
74
81
  });
75
82
  query.push(addMembersQuantity());
76
83
  if (req.query.user) query.push(addUserStatusFields(req.query.user));
84
+ // Исключаем sensitive поля
85
+ query.push({
86
+ $project: {
87
+ password: 0,
88
+ refreshToken: 0,
89
+ __v: 0
90
+ }
91
+ });
77
92
  query.push({
78
93
  $skip: skip,
79
94
  });
@@ -102,14 +117,17 @@ const controllerFactory = db => {
102
117
  if (!user) {
103
118
  return res.status(404).send({ errorCode: 'USER_NOT_CREATED', message: 'User is not created.' });
104
119
  }
105
- res.status(200).send(user);
120
+ const { password, refreshToken, __v, ...safeUser } = user.toObject();
121
+ res.status(200).send(safeUser);
106
122
  } catch (err) {
107
123
  return res.status(500).send({ errorCode: 'INTERNAL_SERVER_ERROR', message: err });
108
124
  }
109
125
  };
110
126
  const update = async (req, res) => {
111
127
  try {
112
- const user = await User.findOneAndUpdate({ _id: req.params._id }, req.body, { new: true });
128
+ // Исключаем email и phone из обновления для них отдельные роуты
129
+ const { email, phone, ...safeData } = req.body;
130
+ const user = await User.findOneAndUpdate({ _id: req.params._id }, safeData, { new: true }).select('-password -refreshToken -__v');
113
131
  if (!user) {
114
132
  return res.status(404).send({ errorCode: 'UPDATE_FAILED', message: 'Something wrong when updating user.' });
115
133
  }
@@ -118,11 +136,32 @@ const controllerFactory = db => {
118
136
  return res.status(500).send({ errorCode: 'INTERNAL_SERVER_ERROR', message: err });
119
137
  }
120
138
  };
121
- const remove = async (req, res) => {
139
+
140
+ const updateEmail = async (req, res) => {
141
+ try {
142
+ const user = await User.findOneAndUpdate(
143
+ { _id: req.params._id },
144
+ { email: req.body.email },
145
+ { new: true }
146
+ ).select('-password -refreshToken -__v');
147
+ if (!user) {
148
+ return res.status(404).send({ errorCode: 'UPDATE_FAILED', message: 'Something wrong when updating email.' });
149
+ }
150
+ res.status(200).send(user);
151
+ } catch (err) {
152
+ return res.status(500).send({ errorCode: 'INTERNAL_SERVER_ERROR', message: err });
153
+ }
154
+ };
155
+
156
+ const updatePhone = async (req, res) => {
122
157
  try {
123
- const user = await User.findOneAndDelete({ phone: req.params.phone });
158
+ const user = await User.findOneAndUpdate(
159
+ { _id: req.params._id },
160
+ { phone: req.body.phone },
161
+ { new: true }
162
+ ).select('-password -refreshToken -__v');
124
163
  if (!user) {
125
- return res.status(404).send({ errorCode: 'DELETION_FAILED', message: 'User is not deleted.' });
164
+ return res.status(404).send({ errorCode: 'UPDATE_FAILED', message: 'Something wrong when updating phone.' });
126
165
  }
127
166
  res.status(200).send(user);
128
167
  } catch (err) {
@@ -133,7 +172,8 @@ const controllerFactory = db => {
133
172
  read,
134
173
  create,
135
174
  update,
136
- remove,
175
+ updateEmail,
176
+ updatePhone,
137
177
  };
138
178
  };
139
179
  export default controllerFactory;
@@ -0,0 +1,20 @@
1
+ export default db => {
2
+ const OtpSchema = new db.mongoose.Schema({
3
+ challengeId: { type: String, required: true, unique: true },
4
+ identifier: { type: String, required: true },
5
+ target: { type: db.mongoose.Schema.Types.ObjectId, ref: 'User', default: null },
6
+ code: { type: String, required: true },
7
+ type: { type: String, enum: ['email', 'phone'], required: true },
8
+ purpose: { type: String, required: true },
9
+ attempts: { type: Number, default: 0 },
10
+ verifiedAt: { type: Date, default: null },
11
+ invalidatedAt: { type: Date, default: null },
12
+ createdAt: { type: Date, default: Date.now, expires: 600 },
13
+ });
14
+
15
+ OtpSchema.index({ identifier: 1, purpose: 1 });
16
+ OtpSchema.index({ target: 1, purpose: 1 }, { sparse: true });
17
+ // challengeId index created by unique: true
18
+
19
+ return db.mongoose.model('Otp', OtpSchema);
20
+ };
@@ -0,0 +1,168 @@
1
+ <template>
2
+ <Popup
3
+ :isPopupOpen="otpState.visible"
4
+ @close-popup="cancelOtp"
5
+ class="bg-white w-min-20r w-max-30r w-max-100 radius-medium pd-medium"
6
+ >
7
+ <!-- Single mode -->
8
+ <section v-if="otpState.mode !== 'dual'" class="t-center">
9
+ <h3 class="mn-b-medium">
10
+ {{ otpState.challenge?.type === 'email' ? 'Verify Email' : 'Verify Phone' }}
11
+ </h3>
12
+
13
+ <p class="mn-b-big t-transp">
14
+ {{ otpState.challenge?.type === 'email'
15
+ ? 'Enter the code sent to your email'
16
+ : 'Enter the code sent to your phone' }}
17
+ </p>
18
+
19
+ <p class="mn-b-small t-transp">{{ otpState.challenge?.identifier }}</p>
20
+
21
+ <div class="pos-relative mn-b-big cursor-text" @click="focusInput(0)">
22
+ <input
23
+ ref="inputRefs"
24
+ v-model="code"
25
+ type="text"
26
+ inputmode="numeric"
27
+ pattern="[0-9]*"
28
+ maxlength="4"
29
+ class="pos-absolute inset-0 w-100 h-100 opacity-0 z-1"
30
+ @input="onInput"
31
+ @keydown="onKeydown"
32
+ autocomplete="one-time-code"
33
+ >
34
+ <div class="d-flex flex-h-center gap-small">
35
+ <div
36
+ v-for="i in 4"
37
+ :key="i"
38
+ class="w-[60px] h-[60px] d-flex flex-center text-[28px] fw-medium bg-light radius-small br-1px ease-cubic"
39
+ :class="code.length === i - 1 ? 'br-main' : 'br-grey'"
40
+ >
41
+ {{ code[i - 1] || '' }}
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </section>
46
+
47
+ <!-- Dual mode -->
48
+ <section v-else class="t-center">
49
+ <h3 class="mn-b-medium">Verify Change</h3>
50
+
51
+ <div v-for="(challenge, idx) in otpState.challenges" :key="idx" class="mn-b-big">
52
+ <p class="mn-b-thin t-transp">
53
+ {{ challenge.label === 'old' ? 'Current' : 'New' }}
54
+ </p>
55
+ <p class="mn-b-small">{{ challenge.identifier }}</p>
56
+
57
+ <div class="pos-relative cursor-text" @click="focusDualInput(idx)">
58
+ <input
59
+ :ref="el => dualInputRefs[idx] = el"
60
+ v-model="dualCodes[idx]"
61
+ type="text"
62
+ inputmode="numeric"
63
+ pattern="[0-9]*"
64
+ maxlength="4"
65
+ class="pos-absolute inset-0 w-100 h-100 opacity-0 z-1"
66
+ @input="onDualInput(idx)"
67
+ @keydown="onKeydown"
68
+ autocomplete="one-time-code"
69
+ >
70
+ <div class="d-flex flex-h-center gap-small">
71
+ <div
72
+ v-for="i in 4"
73
+ :key="i"
74
+ class="w-[48px] h-[48px] d-flex flex-center text-[24px] fw-medium bg-light radius-small br-1px ease-cubic"
75
+ :class="dualCodes[idx].length === i - 1 ? 'br-main' : 'br-grey'"
76
+ >
77
+ {{ dualCodes[idx][i - 1] || '' }}
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </div>
82
+
83
+ <Button
84
+ @click="submitDual"
85
+ :disabled="!bothComplete"
86
+ class="w-100"
87
+ >
88
+ Confirm
89
+ </Button>
90
+ </section>
91
+ </Popup>
92
+ </template>
93
+
94
+ <script setup>
95
+ import { ref, computed, watch } from 'vue'
96
+ import Popup from '@martyrs/src/components/Popup/Popup.vue'
97
+ import { Button } from '@ozdao/martyrs'
98
+
99
+ const props = defineProps({
100
+ otpState: { type: Object, required: true },
101
+ closeOtp: { type: Function, required: true },
102
+ closeDualOtp: { type: Function, required: true },
103
+ cancelOtp: { type: Function, required: true }
104
+ })
105
+
106
+ const inputRefs = ref(null)
107
+ const dualInputRefs = ref([null, null])
108
+ const code = ref('')
109
+ const dualCodes = ref(['', ''])
110
+
111
+ const bothComplete = computed(() =>
112
+ dualCodes.value[0].length === 4 && dualCodes.value[1].length === 4
113
+ )
114
+
115
+ watch(() => props.otpState.visible, (visible) => {
116
+ if (visible) {
117
+ code.value = ''
118
+ dualCodes.value = ['', '']
119
+ setTimeout(() => {
120
+ if (props.otpState.mode === 'dual') {
121
+ dualInputRefs.value[0]?.focus()
122
+ } else {
123
+ inputRefs.value?.focus()
124
+ }
125
+ }, 100)
126
+ }
127
+ })
128
+
129
+ function focusInput() {
130
+ inputRefs.value?.focus()
131
+ }
132
+
133
+ function focusDualInput(idx) {
134
+ dualInputRefs.value[idx]?.focus()
135
+ }
136
+
137
+ function onKeydown(e) {
138
+ if (!/^\d$/.test(e.key) && !['Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Tab'].includes(e.key) && !e.ctrlKey && !e.metaKey) {
139
+ e.preventDefault()
140
+ }
141
+ }
142
+
143
+ function onInput() {
144
+ code.value = code.value.replace(/\D/g, '').slice(0, 4)
145
+
146
+ if (code.value.length === 4) {
147
+ props.closeOtp(code.value)
148
+ }
149
+ }
150
+
151
+ function onDualInput(idx) {
152
+ dualCodes.value[idx] = dualCodes.value[idx].replace(/\D/g, '').slice(0, 4)
153
+
154
+ // Auto-focus next input when current is complete
155
+ if (dualCodes.value[idx].length === 4 && idx === 0) {
156
+ dualInputRefs.value[1]?.focus()
157
+ }
158
+
159
+ // Auto-submit when both are complete
160
+ if (bothComplete.value) {
161
+ submitDual()
162
+ }
163
+ }
164
+
165
+ function submitDual() {
166
+ props.closeDualOtp([dualCodes.value[0], dualCodes.value[1]])
167
+ }
168
+ </script>
@@ -1,6 +1,5 @@
1
1
  <template>
2
2
  <div
3
- v-if="show"
4
3
  class="for-transition bg-white w-100"
5
4
  >
6
5
  <div
@@ -78,20 +77,24 @@
78
77
  class="cursor-pointer pos-absolute pos-t-regular pos-r-regular i-medium t-transp"
79
78
  />
80
79
 
81
- <img loading="lazy"
82
- v-if="users.state.current.profile.photo && users.state.current.profile.photo.length > 0"
83
- :src="(FILE_SERVER_URL || '') + users.state.current.profile.photo"
84
- class="radius-extra bg-white mn-b-small object-fit-cover i-extra"
85
- />
86
-
87
- <PlaceholderUserpic
88
- v-else
89
- class="radius-medium mn-b-small i-extra"
90
- />
80
+ <div class="pos-relative mn-b-small">
81
+ <img loading="lazy"
82
+ v-if="users.state.current.profile.photo && users.state.current.profile.photo.length > 0"
83
+ :src="(FILE_SERVER_URL || '') + users.state.current.profile.photo"
84
+ class="radius-extra bg-white object-fit-cover i-extra"
85
+ />
86
+ <PlaceholderUserpic
87
+ v-else
88
+ class="radius-medium i-extra"
89
+ />
90
+ <OnlineIndicator
91
+ v-if="users.state.current._id"
92
+ :userId="users.state.current._id"
93
+ class="pos-absolute pos-r-0 pos-b-0"
94
+ />
95
+ </div>
91
96
 
92
- <h3
93
- class="mn-b-thin"
94
- >
97
+ <h3 class="mn-b-thin">
95
98
  {{users.state.current.profile.name ? users.state.current.profile.name : 'Anonymous' }}
96
99
  </h3>
97
100
 
@@ -258,8 +261,9 @@ import IconOrders from '@martyrs/src/modules/icons/entities/IconOrders.vue'
258
261
  import IconEdit from '@martyrs/src/modules/icons/navigation/IconEdit.vue'
259
262
 
260
263
  import PlaceholderUserpic from '@martyrs/src/modules/icons/placeholders/PlaceholderUserpic.vue'
264
+ import OnlineIndicator from '@martyrs/src/modules/core/views/components/elements/OnlineIndicator.vue'
261
265
  // Import libs
262
- import { computed, watch, onMounted, ref, onBeforeMount, inject } from 'vue'
266
+ import { computed, watch, onMounted, onServerPrefetch, ref, onBeforeMount, inject } from 'vue'
263
267
  import { useRoute, useRouter } from 'vue-router'
264
268
 
265
269
  // Import state
@@ -267,13 +271,14 @@ import * as auth from '@martyrs/src/modules/auth/views/store/auth.js'
267
271
  import * as users from '@martyrs/src/modules/auth/views/store/users.js'
268
272
  import membershipsStore from '@martyrs/src/modules/organizations/store/memberships.store.js'
269
273
  import { useGlobalMixins } from '@martyrs/src/modules/core/views/mixins/mixins.js'
274
+ import { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'
270
275
  // Accessing router
271
276
  const route = useRoute()
272
277
  const router = useRouter()
273
278
  // Get organization _id from cookie
274
279
  const show = ref(false)
275
280
 
276
- const store = inject('store')
281
+ const store = useStore()
277
282
  const { isModuleInstalled } = useGlobalMixins()
278
283
 
279
284
  const modules = {
@@ -310,9 +315,37 @@ const modules = {
310
315
  }
311
316
 
312
317
 
318
+ // Функция загрузки данных пользователя
319
+ async function fetchUser() {
320
+ try {
321
+ const result = await users.actions.read({ _id: route.params._id, user: auth.state.user?._id });
322
+ // Если пользователь не найден - устанавливаем 404
323
+ if (!result || result.length === 0 || !users.state.current?._id) {
324
+ store.core.state.notFound = true;
325
+ return false;
326
+ }
327
+ return true;
328
+ } catch (error) {
329
+ console.error('Error fetching user:', error);
330
+ store.core.state.notFound = true;
331
+ return false;
332
+ }
333
+ }
334
+
335
+ // SSR: загружаем данные на сервере для SEO
336
+ onServerPrefetch(async () => {
337
+ console.log('[SSR-404] Profile onServerPrefetch, route._id:', route.params._id);
338
+ await fetchUser();
339
+ console.log('[SSR-404] Profile fetchUser completed');
340
+ });
341
+
342
+ // Client: загружаем данные если еще не загружены (после гидратации)
313
343
  onMounted(async () => {
314
- await users.actions.read({ _id: route.params._id, user: auth.state.user._id });
315
- show.value = true
344
+ // Если данные уже загружены на сервере (SSR) - не загружаем повторно
345
+ if (!users.state.current?._id || users.state.current._id !== route.params._id) {
346
+ await fetchUser();
347
+ }
348
+ show.value = true;
316
349
  })
317
350
 
318
351
  const handleMembershipUpdate = ({ membership, status, target }, statusName, statusNumber) => {
@@ -1,28 +1,132 @@
1
1
  <template>
2
2
  <div class="for-transition w-100">
3
- <ProfileEditCredentials class="bg-white mn-b-thin"/>
3
+ <!-- Phone and Email -->
4
+ <div class="bg-white mn-b-thin">
5
+ <h3 class="mn-b-small">Phone and Email</h3>
4
6
 
5
- <div class="bg-white mn-b-thin ">
7
+ <!-- Phone -->
8
+ <div class="mn-b-semi">
9
+ <Field
10
+ v-if="users.state.current.phone && !isEditingPhone"
11
+ v-model:field="users.state.current.phone"
12
+ label="Phone"
13
+ class="mn-b-thin bg-light pd-medium radius-small"
14
+ disabled
15
+ />
16
+ <FieldPhone
17
+ v-else
18
+ @change="(val) => newPhone = val"
19
+ :dropdownOptions="{
20
+ showDialCodeInSelection: true,
21
+ showFlags: true,
22
+ showDialCodeInList: true
23
+ }"
24
+ :validCharactersOnly="true"
25
+ mode="national"
26
+ :inputOptions="{ placeholder: 'Enter phone number', type: 'tel' }"
27
+ class="bg-light h-4r pd-small radius-small mn-b-thin"
28
+ />
29
+ <Button
30
+ v-if="users.state.current.phone && !isEditingPhone"
31
+ :submit="() => isEditingPhone = true"
32
+ class="mn-b-thin t-black bg-light w-100"
33
+ >
34
+ Change Phone
35
+ </Button>
36
+ <div v-else-if="!users.state.current.phone" class="flex gap-1">
37
+ <Button
38
+ :submit="() => savePhone()"
39
+ class="mn-b-thin bg-main w-100"
40
+ >
41
+ Save Phone
42
+ </Button>
43
+ </div>
44
+ <div v-else class="flex gap-2">
45
+ <Button
46
+ :submit="() => savePhone()"
47
+ class="mn-b-thin bg-main flex-child-1"
48
+ >
49
+ Save Phone
50
+ </Button>
51
+ <Button
52
+ :submit="() => { isEditingPhone = false; newPhone = '' }"
53
+ class="mn-b-thin bg-red t-white flex-child-1"
54
+ >
55
+ Cancel
56
+ </Button>
57
+ </div>
58
+ </div>
59
+
60
+ <!-- Email -->
61
+ <div class="mn-b-semi">
62
+ <Field
63
+ v-if="users.state.current.email && !isEditingEmail"
64
+ v-model:field="users.state.current.email"
65
+ label="Email"
66
+ class="mn-b-thin bg-light pd-medium radius-small"
67
+ disabled
68
+ />
69
+ <Field
70
+ v-else
71
+ v-model:field="newEmail"
72
+ label="Email"
73
+ placeholder="Enter email"
74
+ class="mn-b-thin bg-light pd-medium radius-small"
75
+ />
76
+ <Button
77
+ v-if="users.state.current.email && !isEditingEmail"
78
+ :submit="() => isEditingEmail = true"
79
+ class="mn-b-thin t-black bg-light w-100"
80
+ >
81
+ Change Email
82
+ </Button>
83
+ <div v-else-if="!users.state.current.email" class="flex gap-1">
84
+ <Button
85
+ :submit="() => saveEmail()"
86
+ class="mn-b-thin bg-main w-100"
87
+ >
88
+ Save Email
89
+ </Button>
90
+ </div>
91
+ <div v-else class="flex gap-2">
92
+ <Button
93
+ :submit="() => saveEmail()"
94
+ class="mn-b-thin bg-main flex-child-1"
95
+ >
96
+ Save Email
97
+ </Button>
98
+ <Button
99
+ :submit="() => { isEditingEmail = false; newEmail = '' }"
100
+ class="mn-b-thin bg-red t-white flex-child-1"
101
+ >
102
+ Cancel
103
+ </Button>
104
+ </div>
105
+ </div>
106
+ </div>
107
+
108
+ <!-- Settings -->
109
+ <div class="bg-white mn-b-thin">
6
110
  <h3 class="mn-b-small">Settings</h3>
7
111
  <Checkbox
8
112
  :label="'Darkmode'"
9
113
  :radio="core.state.theme.mode === 'dark'"
10
- @update:radio="event => core.actions.toggleTheme()"
114
+ @update:radio="() => core.actions.toggleTheme()"
11
115
  class="w-100 bg-light t-black pd-medium radius-small"
12
116
  />
13
117
  </div>
14
118
 
15
- <Button
16
- :submit="onSubmit"
17
- :callback="redirectTo"
119
+ <Button
120
+ :submit="onSubmit"
121
+ :callback="redirectTo"
18
122
  class="mn-b-thin bg-main w-100"
19
- >
123
+ >
20
124
  Save
21
125
  </Button>
22
126
 
23
127
  <Button
24
- :submit="onSubmitDelete"
25
- :callback="() => router.push({name: 'Sign In'})"
128
+ :submit="onSubmitDelete"
129
+ :callback="() => router.push({ name: 'Sign In' })"
26
130
  class="mn-b-thin w-100 bg-red t-white"
27
131
  >
28
132
  Delete Account
@@ -31,42 +135,92 @@
31
135
  </template>
32
136
 
33
137
  <script setup>
34
- import Checkbox from '@martyrs/src/components/Checkbox/Checkbox.vue'
35
- import Button from '@martyrs/src/components/Button/Button.vue'
36
- import ProfileEditCredentials from '@martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue'
37
-
38
- import { useRouter } from 'vue-router'
39
-
40
- import * as auth from '@martyrs/src/modules/auth/views/store/auth.js'
41
- import * as users from '@martyrs/src/modules/auth/views/store/users.js'
42
- import { useStore } from '@martyrs/src/modules/core/views/store/core.store.js'
43
-
44
- const store = useStore()
45
- const core = store.core
46
- const router = useRouter()
47
-
48
- defineProps({
49
- userData: {
50
- type: Object,
51
- required: true
52
- }
53
- })
54
-
55
- async function onSubmit() {
56
- await users.actions.update(users.state.current)
138
+ import Checkbox from '@martyrs/src/components/Checkbox/Checkbox.vue'
139
+ import Button from '@martyrs/src/components/Button/Button.vue'
140
+ import Field from '@martyrs/src/components/Field/Field.vue'
141
+ import FieldPhone from '@martyrs/src/components/FieldPhone/FieldPhone.vue'
142
+
143
+ import { ref } from 'vue'
144
+ import { useRouter } from 'vue-router'
145
+
146
+ import * as auth from '@martyrs/src/modules/auth/views/store/auth.js'
147
+ import * as users from '@martyrs/src/modules/auth/views/store/users.js'
148
+ import { useStore, setError } from '@martyrs/src/modules/core/views/store/core.store.js'
149
+ import { withOtp } from '@martyrs/src/modules/auth/views/plugins/otp.plugin.js'
150
+ import $axios from '@martyrs/src/modules/core/views/utils/axios-instance.js'
151
+
152
+ const store = useStore()
153
+ const core = store.core
154
+ const router = useRouter()
155
+
156
+ const isEditingPhone = ref(false)
157
+ const isEditingEmail = ref(false)
158
+ const newPhone = ref('')
159
+ const newEmail = ref('')
160
+
161
+ defineProps({
162
+ userData: {
163
+ type: Object,
164
+ required: true
57
165
  }
58
-
59
- async function onSubmitDelete() {
60
- const confirmation = window.confirm("Are you sure you want to delete your account? Restoration will be possible only with the help of an administrator.")
61
-
62
- if (!confirmation) return
63
-
64
- users.state.current.status = 'removed'
65
- await users.actions.update(users.state.current)
66
- auth.actions.logout()
166
+ })
167
+
168
+ async function savePhone() {
169
+ if (!newPhone.value) return
170
+
171
+ try {
172
+ const result = await withOtp(
173
+ (data) => $axios.put(`/api/users/${users.state.current._id}/phone`, data),
174
+ { phone: newPhone.value }
175
+ )
176
+
177
+ if (result.data) {
178
+ users.state.current.phone = result.data.phone
179
+ }
180
+
181
+ isEditingPhone.value = false
182
+ newPhone.value = ''
183
+ } catch (error) {
184
+ console.log('savePhone catch:', error)
185
+ setError(error)
67
186
  }
68
-
69
- function redirectTo() {
70
- router.back()
187
+ }
188
+
189
+ async function saveEmail() {
190
+ if (!newEmail.value) return
191
+
192
+ try {
193
+ const result = await withOtp(
194
+ (data) => $axios.put(`/api/users/${users.state.current._id}/email`, data),
195
+ { email: newEmail.value }
196
+ )
197
+
198
+ if (result.data) {
199
+ users.state.current.email = result.data.email
200
+ }
201
+
202
+ isEditingEmail.value = false
203
+ newEmail.value = ''
204
+ } catch (error) {
205
+ setError(error)
71
206
  }
72
- </script>
207
+ }
208
+
209
+ async function onSubmit() {
210
+ await users.actions.update(users.state.current)
211
+ }
212
+
213
+ async function onSubmitDelete() {
214
+ const confirmation = window.confirm("Are you sure you want to delete your account? Restoration will be possible only with the help of an administrator.")
215
+
216
+ if (!confirmation) return
217
+
218
+ users.state.current.status = 'removed'
219
+ await users.actions.update(users.state.current)
220
+ auth.actions.logout()
221
+ }
222
+
223
+ function redirectTo() {
224
+ router.back()
225
+ }
226
+ </script>