@ozdao/martyrs 0.2.484 → 0.2.486

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/{Media-2NvSR0vE.js → Media-CXQSPHt2.js} +1 -1
  2. package/dist/{Media-EYG9WPI4.cjs → Media-DhpD64nT.cjs} +1 -1
  3. package/dist/_virtual/index.cjs +4 -4
  4. package/dist/_virtual/index.js +4 -4
  5. package/dist/_virtual/index2.cjs +4 -4
  6. package/dist/_virtual/index2.js +4 -4
  7. package/dist/auth.server.cjs +2 -23
  8. package/dist/auth.server.js +1 -22
  9. package/dist/globals.crud-BQG1Lm0A.js +90 -0
  10. package/dist/globals.crud-Dv7UXbRM.cjs +89 -0
  11. package/dist/globals.server.cjs +3 -322
  12. package/dist/globals.server.js +1 -303
  13. package/dist/globals.websocket-DzvdIBf6.js +306 -0
  14. package/dist/globals.websocket-k6_B1T7k.cjs +322 -0
  15. package/dist/{main-BT1yoKH2.js → main-Cfh5138F.js} +2102 -1993
  16. package/dist/main-DKJqboZy.cjs +11 -0
  17. package/dist/martyrs/src/components/Button/{Button.vue2.cjs → Button.vue.cjs} +2 -2
  18. package/dist/martyrs/src/components/Button/{Button.vue2.js.map → Button.vue.cjs.map} +1 -1
  19. package/dist/martyrs/src/components/Button/{Button.vue2.js → Button.vue.js} +2 -2
  20. package/dist/martyrs/src/components/Button/Button.vue.js.map +1 -0
  21. package/dist/martyrs/src/components/{DatePicker → Calendar}/Calendar.vue.cjs +1 -1
  22. package/dist/martyrs/src/components/Calendar/Calendar.vue.cjs.map +1 -0
  23. package/dist/martyrs/src/components/{DatePicker → Calendar}/Calendar.vue.js +1 -1
  24. package/dist/martyrs/src/components/Calendar/Calendar.vue.js.map +1 -0
  25. package/dist/martyrs/src/components/Dropdown/{Dropdown.vue2.cjs → Dropdown.vue.cjs} +2 -2
  26. package/dist/martyrs/src/components/Dropdown/{Dropdown.vue2.js.map → Dropdown.vue.cjs.map} +1 -1
  27. package/dist/martyrs/src/components/Dropdown/{Dropdown.vue2.js → Dropdown.vue.js} +2 -2
  28. package/dist/martyrs/src/components/Dropdown/Dropdown.vue.js.map +1 -0
  29. package/dist/martyrs/src/components/Feed/Feed.vue.cjs +2 -2
  30. package/dist/martyrs/src/components/Feed/Feed.vue.cjs.map +1 -1
  31. package/dist/martyrs/src/components/Feed/Feed.vue.js +2 -2
  32. package/dist/martyrs/src/components/Feed/Feed.vue.js.map +1 -1
  33. package/dist/martyrs/src/components/Field/Field.vue.cjs +13 -7
  34. package/dist/martyrs/src/components/Field/Field.vue.cjs.map +1 -1
  35. package/dist/martyrs/src/components/Field/Field.vue.js +14 -8
  36. package/dist/martyrs/src/components/Field/Field.vue.js.map +1 -1
  37. package/dist/martyrs/src/components/FieldTags/FieldTags.vue.cjs +1 -1
  38. package/dist/martyrs/src/components/FieldTags/FieldTags.vue.js +1 -1
  39. package/dist/martyrs/src/components/Popup/{Popup.vue2.cjs → Popup.vue.cjs} +2 -2
  40. package/dist/martyrs/src/components/Popup/{Popup.vue2.js.map → Popup.vue.cjs.map} +1 -1
  41. package/dist/martyrs/src/components/Popup/{Popup.vue2.js → Popup.vue.js} +2 -2
  42. package/dist/martyrs/src/components/Popup/Popup.vue.js.map +1 -0
  43. package/dist/martyrs/src/modules/auth/auth.client.cjs +3 -0
  44. package/dist/martyrs/src/modules/auth/auth.client.cjs.map +1 -1
  45. package/dist/martyrs/src/modules/auth/auth.client.js +3 -0
  46. package/dist/martyrs/src/modules/auth/auth.client.js.map +1 -1
  47. package/dist/martyrs/src/modules/auth/locales/en.cjs +79 -0
  48. package/dist/martyrs/src/modules/auth/locales/en.cjs.map +1 -0
  49. package/dist/martyrs/src/modules/auth/locales/en.js +79 -0
  50. package/dist/martyrs/src/modules/auth/locales/en.js.map +1 -0
  51. package/dist/martyrs/src/modules/auth/locales/index.cjs +10 -0
  52. package/dist/martyrs/src/modules/auth/locales/index.cjs.map +1 -0
  53. package/dist/martyrs/src/modules/auth/locales/index.js +10 -0
  54. package/dist/martyrs/src/modules/auth/locales/index.js.map +1 -0
  55. package/dist/martyrs/src/modules/auth/locales/ru.cjs +79 -0
  56. package/dist/martyrs/src/modules/auth/locales/ru.cjs.map +1 -0
  57. package/dist/martyrs/src/modules/auth/locales/ru.js +79 -0
  58. package/dist/martyrs/src/modules/auth/locales/ru.js.map +1 -0
  59. package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.cjs +0 -9
  60. package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.cjs.map +1 -1
  61. package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.js +2 -11
  62. package/dist/martyrs/src/modules/auth/views/components/layouts/Auth.vue.js.map +1 -1
  63. package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.cjs +4 -6
  64. package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.cjs.map +1 -1
  65. package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js +4 -6
  66. package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js.map +1 -1
  67. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +7 -9
  68. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.cjs.map +1 -1
  69. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +7 -9
  70. package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js.map +1 -1
  71. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.cjs +1 -1
  72. package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
  73. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +2 -2
  74. package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +2 -2
  75. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.cjs +1 -1
  76. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEdit.vue.js +1 -1
  77. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.cjs +1 -1
  78. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditAccount.vue.js +1 -1
  79. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.cjs +1 -1
  80. package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
  81. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +11 -13
  82. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.cjs.map +1 -1
  83. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +11 -13
  84. package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js.map +1 -1
  85. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.cjs +12 -14
  86. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.cjs.map +1 -1
  87. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +12 -14
  88. package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js.map +1 -1
  89. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.cjs +11 -13
  90. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.cjs.map +1 -1
  91. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +11 -13
  92. package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js.map +1 -1
  93. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.cjs +1 -1
  94. package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +1 -1
  95. package/dist/martyrs/src/modules/auth/views/components/sections/SliderFeatures.vue.cjs +5 -47
  96. package/dist/martyrs/src/modules/auth/views/components/sections/SliderFeatures.vue.cjs.map +1 -1
  97. package/dist/martyrs/src/modules/auth/views/components/sections/SliderFeatures.vue.js +5 -47
  98. package/dist/martyrs/src/modules/auth/views/components/sections/SliderFeatures.vue.js.map +1 -1
  99. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.cjs +2 -2
  100. package/dist/martyrs/src/modules/community/components/pages/BlogPost.vue.js +2 -2
  101. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.cjs +3 -3
  102. package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  103. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  104. package/dist/martyrs/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  105. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  106. package/dist/martyrs/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  107. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +2 -2
  108. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs.map +1 -1
  109. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  110. package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js.map +1 -1
  111. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.cjs +2 -2
  112. package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  113. package/dist/martyrs/src/modules/events/components/pages/Events.vue.cjs +1 -1
  114. package/dist/martyrs/src/modules/events/components/pages/Events.vue.js +1 -1
  115. package/dist/martyrs/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  116. package/dist/martyrs/src/modules/gallery/components/pages/Gallery.vue.js +1 -1
  117. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +2 -2
  118. package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  119. package/dist/martyrs/src/modules/globals/globals.client.cjs +1 -0
  120. package/dist/martyrs/src/modules/globals/globals.client.cjs.map +1 -1
  121. package/dist/martyrs/src/modules/globals/globals.client.js +1 -0
  122. package/dist/martyrs/src/modules/globals/globals.client.js.map +1 -1
  123. package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.cjs +1 -1
  124. package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.js +1 -1
  125. package/dist/martyrs/src/modules/globals/views/components/blocks/AlertDialog.vue.cjs +1 -1
  126. package/dist/martyrs/src/modules/globals/views/components/blocks/AlertDialog.vue.js +1 -1
  127. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +2 -2
  128. package/dist/martyrs/src/modules/globals/views/components/blocks/CardHeader.vue.js +2 -2
  129. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupAuth.vue.cjs +2 -2
  130. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupAuth.vue.js +2 -2
  131. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs +3 -3
  132. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.cjs.map +1 -1
  133. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js +3 -3
  134. package/dist/martyrs/src/modules/globals/views/components/blocks/PopupDateSelector.vue.js.map +1 -1
  135. package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +2 -2
  136. package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +2 -2
  137. package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.cjs +1 -1
  138. package/dist/martyrs/src/modules/globals/views/components/partials/Header.vue.js +1 -1
  139. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.cjs +1 -1
  140. package/dist/martyrs/src/modules/globals/views/components/partials/Navigation.vue.js +1 -1
  141. package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.cjs +1 -1
  142. package/dist/martyrs/src/modules/globals/views/components/partials/NavigationBar.vue.js +1 -1
  143. package/dist/martyrs/src/modules/globals/views/components/sections/Filters.vue2.cjs +1 -1
  144. package/dist/martyrs/src/modules/globals/views/components/sections/Filters.vue2.js +1 -1
  145. package/dist/martyrs/src/modules/globals/views/utils/axios-instance.cjs.map +1 -1
  146. package/dist/martyrs/src/modules/globals/views/utils/axios-instance.js.map +1 -1
  147. package/dist/martyrs/src/modules/icons/actions/IconShow.vue.cjs +49 -0
  148. package/dist/martyrs/src/modules/icons/actions/IconShow.vue.cjs.map +1 -0
  149. package/dist/martyrs/src/modules/icons/actions/IconShow.vue.js +49 -0
  150. package/dist/martyrs/src/modules/icons/actions/IconShow.vue.js.map +1 -0
  151. package/dist/martyrs/src/modules/icons/navigation/IconHeart.vue.cjs +34 -0
  152. package/dist/martyrs/src/modules/icons/navigation/IconHeart.vue.cjs.map +1 -0
  153. package/dist/martyrs/src/modules/icons/navigation/IconHeart.vue.js +34 -0
  154. package/dist/martyrs/src/modules/icons/navigation/IconHeart.vue.js.map +1 -0
  155. package/dist/martyrs/src/modules/icons/pages/IconsPage.vue.cjs +115 -122
  156. package/dist/martyrs/src/modules/icons/pages/IconsPage.vue.cjs.map +1 -1
  157. package/dist/martyrs/src/modules/icons/pages/IconsPage.vue.js +163 -170
  158. package/dist/martyrs/src/modules/icons/pages/IconsPage.vue.js.map +1 -1
  159. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.cjs +87 -0
  160. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.cjs.map +1 -0
  161. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +87 -0
  162. package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js.map +1 -0
  163. package/dist/martyrs/src/modules/music/components/cards/ArtistCard.vue.cjs +83 -0
  164. package/dist/martyrs/src/modules/music/components/cards/ArtistCard.vue.cjs.map +1 -0
  165. package/dist/martyrs/src/modules/music/components/cards/ArtistCard.vue.js +83 -0
  166. package/dist/martyrs/src/modules/music/components/cards/ArtistCard.vue.js.map +1 -0
  167. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.cjs +83 -0
  168. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.cjs.map +1 -0
  169. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +83 -0
  170. package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js.map +1 -0
  171. package/dist/martyrs/src/modules/music/components/cards/TrackCard.vue.cjs +68 -0
  172. package/dist/martyrs/src/modules/music/components/cards/TrackCard.vue.cjs.map +1 -0
  173. package/dist/martyrs/src/modules/music/components/cards/TrackCard.vue.js +68 -0
  174. package/dist/martyrs/src/modules/music/components/cards/TrackCard.vue.js.map +1 -0
  175. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.cjs +174 -0
  176. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.cjs.map +1 -0
  177. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +174 -0
  178. package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js.map +1 -0
  179. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.cjs +80 -0
  180. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.cjs.map +1 -0
  181. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +80 -0
  182. package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js.map +1 -0
  183. package/dist/martyrs/src/modules/music/components/forms/UploadForm.vue.cjs +328 -0
  184. package/dist/martyrs/src/modules/music/components/forms/UploadForm.vue.cjs.map +1 -0
  185. package/dist/martyrs/src/modules/music/components/forms/UploadForm.vue.js +328 -0
  186. package/dist/martyrs/src/modules/music/components/forms/UploadForm.vue.js.map +1 -0
  187. package/dist/martyrs/src/modules/music/components/layouts/MusicLayout.vue.cjs +115 -0
  188. package/dist/martyrs/src/modules/music/components/layouts/MusicLayout.vue.cjs.map +1 -0
  189. package/dist/martyrs/src/modules/music/components/layouts/MusicLayout.vue.js +115 -0
  190. package/dist/martyrs/src/modules/music/components/layouts/MusicLayout.vue.js.map +1 -0
  191. package/dist/martyrs/src/modules/music/components/lists/AlbumList.vue.cjs +44 -0
  192. package/dist/martyrs/src/modules/music/components/lists/AlbumList.vue.cjs.map +1 -0
  193. package/dist/martyrs/src/modules/music/components/lists/AlbumList.vue.js +44 -0
  194. package/dist/martyrs/src/modules/music/components/lists/AlbumList.vue.js.map +1 -0
  195. package/dist/martyrs/src/modules/music/components/lists/ArtistList.vue.cjs +305 -0
  196. package/dist/martyrs/src/modules/music/components/lists/ArtistList.vue.cjs.map +1 -0
  197. package/dist/martyrs/src/modules/music/components/lists/ArtistList.vue.js +305 -0
  198. package/dist/martyrs/src/modules/music/components/lists/ArtistList.vue.js.map +1 -0
  199. package/dist/martyrs/src/modules/music/components/lists/PlaylistList.vue.cjs +44 -0
  200. package/dist/martyrs/src/modules/music/components/lists/PlaylistList.vue.cjs.map +1 -0
  201. package/dist/martyrs/src/modules/music/components/lists/PlaylistList.vue.js +44 -0
  202. package/dist/martyrs/src/modules/music/components/lists/PlaylistList.vue.js.map +1 -0
  203. package/dist/martyrs/src/modules/music/components/lists/TrackList.vue.cjs +199 -0
  204. package/dist/martyrs/src/modules/music/components/lists/TrackList.vue.cjs.map +1 -0
  205. package/dist/martyrs/src/modules/music/components/lists/TrackList.vue.js +199 -0
  206. package/dist/martyrs/src/modules/music/components/lists/TrackList.vue.js.map +1 -0
  207. package/dist/martyrs/src/modules/music/components/pages/AlbumDetail.vue.cjs +290 -0
  208. package/dist/martyrs/src/modules/music/components/pages/AlbumDetail.vue.cjs.map +1 -0
  209. package/dist/martyrs/src/modules/music/components/pages/AlbumDetail.vue.js +290 -0
  210. package/dist/martyrs/src/modules/music/components/pages/AlbumDetail.vue.js.map +1 -0
  211. package/dist/martyrs/src/modules/music/components/pages/ArtistDetail.vue.cjs +467 -0
  212. package/dist/martyrs/src/modules/music/components/pages/ArtistDetail.vue.cjs.map +1 -0
  213. package/dist/martyrs/src/modules/music/components/pages/ArtistDetail.vue.js +467 -0
  214. package/dist/martyrs/src/modules/music/components/pages/ArtistDetail.vue.js.map +1 -0
  215. package/dist/martyrs/src/modules/music/components/pages/ArtistForm.vue.cjs +382 -0
  216. package/dist/martyrs/src/modules/music/components/pages/ArtistForm.vue.cjs.map +1 -0
  217. package/dist/martyrs/src/modules/music/components/pages/ArtistForm.vue.js +382 -0
  218. package/dist/martyrs/src/modules/music/components/pages/ArtistForm.vue.js.map +1 -0
  219. package/dist/martyrs/src/modules/music/components/pages/ArtistManager.vue.cjs +303 -0
  220. package/dist/martyrs/src/modules/music/components/pages/ArtistManager.vue.cjs.map +1 -0
  221. package/dist/martyrs/src/modules/music/components/pages/ArtistManager.vue.js +303 -0
  222. package/dist/martyrs/src/modules/music/components/pages/ArtistManager.vue.js.map +1 -0
  223. package/dist/martyrs/src/modules/music/components/pages/MusicHome.vue.cjs +221 -0
  224. package/dist/martyrs/src/modules/music/components/pages/MusicHome.vue.cjs.map +1 -0
  225. package/dist/martyrs/src/modules/music/components/pages/MusicHome.vue.js +221 -0
  226. package/dist/martyrs/src/modules/music/components/pages/MusicHome.vue.js.map +1 -0
  227. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.cjs +200 -0
  228. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.cjs.map +1 -0
  229. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +200 -0
  230. package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js.map +1 -0
  231. package/dist/martyrs/src/modules/music/components/pages/MusicUpload.vue.cjs +50 -0
  232. package/dist/martyrs/src/modules/music/components/pages/MusicUpload.vue.cjs.map +1 -0
  233. package/dist/martyrs/src/modules/music/components/pages/MusicUpload.vue.js +50 -0
  234. package/dist/martyrs/src/modules/music/components/pages/MusicUpload.vue.js.map +1 -0
  235. package/dist/martyrs/src/modules/music/components/pages/PlaylistDetail.vue.cjs +556 -0
  236. package/dist/martyrs/src/modules/music/components/pages/PlaylistDetail.vue.cjs.map +1 -0
  237. package/dist/martyrs/src/modules/music/components/pages/PlaylistDetail.vue.js +556 -0
  238. package/dist/martyrs/src/modules/music/components/pages/PlaylistDetail.vue.js.map +1 -0
  239. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.cjs +449 -0
  240. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.cjs.map +1 -0
  241. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +449 -0
  242. package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js.map +1 -0
  243. package/dist/martyrs/src/modules/music/components/pages/TrackDetail.vue.cjs +87 -0
  244. package/dist/martyrs/src/modules/music/components/pages/TrackDetail.vue.cjs.map +1 -0
  245. package/dist/martyrs/src/modules/music/components/pages/TrackDetail.vue.js +87 -0
  246. package/dist/martyrs/src/modules/music/components/pages/TrackDetail.vue.js.map +1 -0
  247. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.cjs +227 -0
  248. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.cjs.map +1 -0
  249. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +227 -0
  250. package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js.map +1 -0
  251. package/dist/martyrs/src/modules/music/components/player/TrackProgress.vue.cjs +85 -0
  252. package/dist/martyrs/src/modules/music/components/player/TrackProgress.vue.cjs.map +1 -0
  253. package/dist/martyrs/src/modules/music/components/player/TrackProgress.vue.js +85 -0
  254. package/dist/martyrs/src/modules/music/components/player/TrackProgress.vue.js.map +1 -0
  255. package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.cjs +71 -0
  256. package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.cjs.map +1 -0
  257. package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +71 -0
  258. package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js.map +1 -0
  259. package/dist/martyrs/src/modules/music/music.client.cjs +137 -0
  260. package/dist/martyrs/src/modules/music/music.client.cjs.map +1 -0
  261. package/dist/martyrs/src/modules/music/music.client.js +137 -0
  262. package/dist/martyrs/src/modules/music/music.client.js.map +1 -0
  263. package/dist/martyrs/src/modules/music/router/music.cjs +99 -0
  264. package/dist/martyrs/src/modules/music/router/music.cjs.map +1 -0
  265. package/dist/martyrs/src/modules/music/router/music.js +99 -0
  266. package/dist/martyrs/src/modules/music/router/music.js.map +1 -0
  267. package/dist/martyrs/src/modules/music/store/albums.cjs +167 -0
  268. package/dist/martyrs/src/modules/music/store/albums.cjs.map +1 -0
  269. package/dist/martyrs/src/modules/music/store/albums.js +167 -0
  270. package/dist/martyrs/src/modules/music/store/albums.js.map +1 -0
  271. package/dist/martyrs/src/modules/music/store/artists.cjs +154 -0
  272. package/dist/martyrs/src/modules/music/store/artists.cjs.map +1 -0
  273. package/dist/martyrs/src/modules/music/store/artists.js +154 -0
  274. package/dist/martyrs/src/modules/music/store/artists.js.map +1 -0
  275. package/dist/martyrs/src/modules/music/store/player.cjs +297 -0
  276. package/dist/martyrs/src/modules/music/store/player.cjs.map +1 -0
  277. package/dist/martyrs/src/modules/music/store/player.js +297 -0
  278. package/dist/martyrs/src/modules/music/store/player.js.map +1 -0
  279. package/dist/martyrs/src/modules/music/store/playlists.cjs +174 -0
  280. package/dist/martyrs/src/modules/music/store/playlists.cjs.map +1 -0
  281. package/dist/martyrs/src/modules/music/store/playlists.js +174 -0
  282. package/dist/martyrs/src/modules/music/store/playlists.js.map +1 -0
  283. package/dist/martyrs/src/modules/music/store/search.cjs +109 -0
  284. package/dist/martyrs/src/modules/music/store/search.cjs.map +1 -0
  285. package/dist/martyrs/src/modules/music/store/search.js +109 -0
  286. package/dist/martyrs/src/modules/music/store/search.js.map +1 -0
  287. package/dist/martyrs/src/modules/music/store/tracks.cjs +180 -0
  288. package/dist/martyrs/src/modules/music/store/tracks.cjs.map +1 -0
  289. package/dist/martyrs/src/modules/music/store/tracks.js +180 -0
  290. package/dist/martyrs/src/modules/music/store/tracks.js.map +1 -0
  291. package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.cjs +1 -1
  292. package/dist/martyrs/src/modules/notifications/components/elements/NotificationBadge.vue.js +1 -1
  293. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +2 -2
  294. package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +2 -2
  295. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
  296. package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
  297. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +2 -2
  298. package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  299. package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  300. package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  301. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs +2 -2
  302. package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +2 -2
  303. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  304. package/dist/martyrs/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  305. package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +2 -2
  306. package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  307. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  308. package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +1 -1
  309. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +2 -2
  310. package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  311. package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.cjs +1 -1
  312. package/dist/martyrs/src/modules/organizations/components/sections/DetailsTabSection.vue.js +1 -1
  313. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +2 -2
  314. package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  315. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  316. package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  317. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  318. package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
  319. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
  320. package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
  321. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
  322. package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  323. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +2 -2
  324. package/dist/martyrs/src/modules/pages/views/components/partials/SidebarPages.vue.js +2 -2
  325. package/dist/martyrs/src/modules/products/components/blocks/ProductImages.vue.cjs +1 -1
  326. package/dist/martyrs/src/modules/products/components/blocks/ProductImages.vue.js +1 -1
  327. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  328. package/dist/martyrs/src/modules/products/components/pages/Categories.vue.js +1 -1
  329. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +3 -3
  330. package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +3 -3
  331. package/dist/martyrs/src/modules/products/components/pages/LeftoverEdit.vue.cjs +3 -3
  332. package/dist/martyrs/src/modules/products/components/pages/LeftoverEdit.vue.js +3 -3
  333. package/dist/martyrs/src/modules/products/components/pages/Leftovers.vue.cjs +2 -2
  334. package/dist/martyrs/src/modules/products/components/pages/Leftovers.vue.js +2 -2
  335. package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +2 -2
  336. package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
  337. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +2 -2
  338. package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
  339. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  340. package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  341. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.cjs +2 -2
  342. package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +2 -2
  343. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.cjs +2 -2
  344. package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +2 -2
  345. package/dist/martyrs/src/modules/products/components/sections/EditIngredients.vue.cjs +1 -1
  346. package/dist/martyrs/src/modules/products/components/sections/EditIngredients.vue.js +1 -1
  347. package/dist/martyrs/src/modules/products/components/sections/EditRecommended.vue.cjs +1 -1
  348. package/dist/martyrs/src/modules/products/components/sections/EditRecommended.vue.js +1 -1
  349. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.cjs +2 -2
  350. package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +2 -2
  351. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.cjs +1 -1
  352. package/dist/martyrs/src/modules/products/components/sections/ProductConfigurator.vue.js +1 -1
  353. package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.cjs +1 -1
  354. package/dist/martyrs/src/modules/products/components/sections/ProductsRecommended.vue.js +1 -1
  355. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  356. package/dist/martyrs/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  357. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.cjs +1 -1
  358. package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
  359. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.cjs +2 -2
  360. package/dist/martyrs/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  361. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  362. package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  363. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.cjs +1 -1
  364. package/dist/martyrs/src/modules/spots/components/pages/Map.vue.js +1 -1
  365. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +2 -2
  366. package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +2 -2
  367. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs +2 -2
  368. package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +2 -2
  369. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.cjs +3 -3
  370. package/dist/martyrs/src/modules/wallet/views/components/pages/Wallet.vue.js +3 -3
  371. package/dist/martyrs.cjs.js +1 -1
  372. package/dist/martyrs.css +1 -1
  373. package/dist/martyrs.es.js +38 -36
  374. package/dist/music.server.cjs +1407 -0
  375. package/dist/music.server.js +1407 -0
  376. package/dist/orders.server.cjs +3 -88
  377. package/dist/orders.server.js +2 -87
  378. package/dist/socials.schema-BOZV82Mp.js +25 -0
  379. package/dist/socials.schema-CtpSF9dE.cjs +24 -0
  380. package/dist/style.css +250 -97
  381. package/package.json +1 -1
  382. package/src/.martyrs/filemap.json +2 -2
  383. package/src/components/Feed/Feed.vue +1 -1
  384. package/src/components/Field/Field.vue +42 -27
  385. package/src/components/index.js +2 -0
  386. package/src/main.js +6 -0
  387. package/src/modules/auth/auth.client.js +7 -0
  388. package/src/modules/auth/locales/en.js +76 -0
  389. package/src/modules/auth/locales/index.js +7 -0
  390. package/src/modules/auth/locales/ru.js +76 -0
  391. package/src/modules/auth/views/components/layouts/Auth.vue +2 -44
  392. package/src/modules/auth/views/components/pages/EnterCode.vue +5 -7
  393. package/src/modules/auth/views/components/pages/EnterPassword.vue +7 -10
  394. package/src/modules/auth/views/components/pages/ResetPassword.vue +9 -12
  395. package/src/modules/auth/views/components/pages/SignIn.vue +12 -15
  396. package/src/modules/auth/views/components/pages/SignUp.vue +9 -12
  397. package/src/modules/auth/views/components/sections/SliderFeatures.vue +11 -48
  398. package/src/modules/events/components/pages/EditEvent.vue +1 -1
  399. package/src/modules/globals/globals.client.js +1 -0
  400. package/src/modules/globals/views/components/blocks/PopupDateSelector.vue +1 -1
  401. package/src/modules/globals/views/utils/axios-instance.js +15 -1
  402. package/src/modules/icons/actions/IconShow.vue +23 -0
  403. package/src/modules/icons/pages/IconsPage.vue +114 -120
  404. package/src/modules/products/components/pages/Product.vue +1 -1
  405. package/dist/main-rF15sgss.cjs +0 -11
  406. package/dist/martyrs/src/components/Button/Button.vue2.cjs.map +0 -1
  407. package/dist/martyrs/src/components/DatePicker/Calendar.vue.cjs.map +0 -1
  408. package/dist/martyrs/src/components/DatePicker/Calendar.vue.js.map +0 -1
  409. package/dist/martyrs/src/components/Dropdown/Dropdown.vue2.cjs.map +0 -1
  410. package/dist/martyrs/src/components/Popup/Popup.vue2.cjs.map +0 -1
  411. package/dist/martyrs/src/modules/auth/views/localization/EnterCode.json.cjs +0 -9
  412. package/dist/martyrs/src/modules/auth/views/localization/EnterCode.json.cjs.map +0 -1
  413. package/dist/martyrs/src/modules/auth/views/localization/EnterCode.json.js +0 -9
  414. package/dist/martyrs/src/modules/auth/views/localization/EnterCode.json.js.map +0 -1
  415. package/dist/martyrs/src/modules/auth/views/localization/EnterPassword.json.cjs +0 -9
  416. package/dist/martyrs/src/modules/auth/views/localization/EnterPassword.json.cjs.map +0 -1
  417. package/dist/martyrs/src/modules/auth/views/localization/EnterPassword.json.js +0 -9
  418. package/dist/martyrs/src/modules/auth/views/localization/EnterPassword.json.js.map +0 -1
  419. package/dist/martyrs/src/modules/auth/views/localization/ResetPassword.json.cjs +0 -9
  420. package/dist/martyrs/src/modules/auth/views/localization/ResetPassword.json.cjs.map +0 -1
  421. package/dist/martyrs/src/modules/auth/views/localization/ResetPassword.json.js +0 -9
  422. package/dist/martyrs/src/modules/auth/views/localization/ResetPassword.json.js.map +0 -1
  423. package/dist/martyrs/src/modules/auth/views/localization/SignIn.json.cjs +0 -9
  424. package/dist/martyrs/src/modules/auth/views/localization/SignIn.json.cjs.map +0 -1
  425. package/dist/martyrs/src/modules/auth/views/localization/SignIn.json.js +0 -9
  426. package/dist/martyrs/src/modules/auth/views/localization/SignIn.json.js.map +0 -1
  427. package/dist/martyrs/src/modules/auth/views/localization/SignUp.json.cjs +0 -9
  428. package/dist/martyrs/src/modules/auth/views/localization/SignUp.json.cjs.map +0 -1
  429. package/dist/martyrs/src/modules/auth/views/localization/SignUp.json.js +0 -9
  430. package/dist/martyrs/src/modules/auth/views/localization/SignUp.json.js.map +0 -1
  431. package/src/modules/auth/views/localization/EnterCode.json +0 -16
  432. package/src/modules/auth/views/localization/EnterPassword.json +0 -22
  433. package/src/modules/auth/views/localization/ResetPassword.json +0 -26
  434. package/src/modules/auth/views/localization/SignIn.json +0 -34
  435. package/src/modules/auth/views/localization/SignUp.json +0 -28
  436. /package/src/components/{DatePicker → Calendar}/Calendar.vue +0 -0
@@ -1,307 +1,5 @@
1
1
  import { A as ABAC } from "./abac-Cf_9lCSh.js";
2
- import * as cookie from "cookie";
3
- import jwt from "jsonwebtoken";
4
- import uWS from "uWebSockets.js";
5
- class WebSocketManager {
6
- constructor() {
7
- this.app = uWS.App();
8
- this.modules = /* @__PURE__ */ new Map();
9
- this.userConnections = /* @__PURE__ */ new Map();
10
- this.rpcMethods = /* @__PURE__ */ new Map();
11
- this.app.ws("/api/ws", {
12
- maxPayloadLength: 16 * 1024 * 1024,
13
- idleTimeout: 120,
14
- compression: uWS.SHARED_COMPRESSOR,
15
- maxBackpressure: 1024 * 1024,
16
- // Обработчик аутентификации и апгрейда соединения
17
- upgrade: (res, req, context) => {
18
- let userId = null;
19
- const headers = {};
20
- req.forEach((key, value) => {
21
- headers[key.toLowerCase()] = value;
22
- });
23
- const secWebSocketKey = headers["sec-websocket-key"] || "";
24
- const secWebSocketProtocol = headers["sec-websocket-protocol"] || "";
25
- const secWebSocketExtensions = headers["sec-websocket-extensions"] || "";
26
- try {
27
- if (headers.cookie) {
28
- const cookies = cookie.parse(headers.cookie);
29
- if (cookies.user) {
30
- const token = JSON.parse(decodeURIComponent(cookies.user));
31
- const decoded = jwt.verify(token.accessToken, process.env.SECRET_KEY);
32
- userId = decoded._id;
33
- }
34
- }
35
- } catch (err) {
36
- console.error("Invalid token:", err);
37
- }
38
- if (process.env.REQUIRE_AUTH === "true" && !userId) {
39
- res.writeStatus("401 Unauthorized").end("Authentication required");
40
- return;
41
- }
42
- const userData = { userId };
43
- res.upgrade(userData, secWebSocketKey, secWebSocketProtocol, secWebSocketExtensions, context);
44
- },
45
- // Обработчик открытия соединения
46
- open: (ws) => {
47
- ws.userId = ws.getUserData().userId;
48
- ws.subscriptions = /* @__PURE__ */ new Set();
49
- if (ws.userId) {
50
- this._trackUserConnection(ws.userId, ws);
51
- }
52
- },
53
- // Обработчик входящих сообщений
54
- message: async (ws, message, isBinary) => {
55
- if (!isBinary) {
56
- try {
57
- const msgStr = new TextDecoder().decode(message);
58
- const msg = JSON.parse(msgStr);
59
- if (msg.type === "subscribe" && msg.module && this.modules.has(msg.module)) {
60
- ws.subscriptions.add(msg.module);
61
- return;
62
- } else if (msg.type === "unsubscribe" && msg.module) {
63
- ws.subscriptions.delete(msg.module);
64
- return;
65
- }
66
- if (msg.type === "rpc") {
67
- await this._handleRpcCall(ws, msg);
68
- return;
69
- }
70
- const moduleName = msg.module;
71
- if (moduleName && this.modules.has(moduleName)) {
72
- const handler = this.modules.get(moduleName);
73
- Promise.resolve(handler(ws, msg)).catch((err) => {
74
- console.error(`Error in handler for module ${moduleName}:`, err);
75
- });
76
- }
77
- } catch (err) {
78
- console.error("Invalid message or handler error:", err);
79
- if (err instanceof Error) {
80
- try {
81
- ws.send(
82
- JSON.stringify({
83
- type: "error",
84
- error: {
85
- message: err.message,
86
- code: err.code || "INTERNAL_ERROR"
87
- }
88
- }),
89
- false
90
- );
91
- } catch (sendErr) {
92
- console.error("Error sending error response:", sendErr);
93
- }
94
- }
95
- }
96
- }
97
- },
98
- // Обработчик закрытия соединения
99
- close: (ws, code, message) => {
100
- const userId = ws.userId;
101
- if (userId && this.userConnections.has(userId)) {
102
- this.userConnections.get(userId).delete(ws);
103
- if (this.userConnections.get(userId).size === 0) {
104
- this.userConnections.delete(userId);
105
- }
106
- }
107
- if (ws.subscriptions && typeof ws.subscriptions.clear === "function") {
108
- ws.subscriptions.clear();
109
- }
110
- }
111
- });
112
- this.listenSocket = null;
113
- }
114
- // Метод для запуска сервера
115
- listen(port, callback) {
116
- this.app.listen(port, (listenSocket) => {
117
- if (listenSocket) {
118
- this.listenSocket = listenSocket;
119
- if (callback) callback(null, this.app);
120
- } else {
121
- if (callback) callback(new Error("Failed to listen"), null);
122
- }
123
- });
124
- return this;
125
- }
126
- _trackUserConnection(userId, ws) {
127
- if (!this.userConnections.has(userId)) {
128
- this.userConnections.set(userId, /* @__PURE__ */ new Set());
129
- }
130
- this.userConnections.get(userId).add(ws);
131
- }
132
- registerModule(moduleName, handler) {
133
- this.modules.set(moduleName, handler);
134
- }
135
- // Добавляем методы для регистрации RPC
136
- registerRpcMethod(moduleName, methodName, handler, options = {}) {
137
- const fullMethodName = `${moduleName}.${methodName}`;
138
- if (!this.rpcMethods.has(moduleName)) {
139
- this.rpcMethods.set(moduleName, /* @__PURE__ */ new Map());
140
- }
141
- this.rpcMethods.get(moduleName).set(methodName, {
142
- handler,
143
- options: {
144
- requireAuth: options.requireAuth !== false,
145
- // По умолчанию true
146
- validateParams: options.validateParams || null,
147
- rateLimit: options.rateLimit || null,
148
- ...options
149
- }
150
- });
151
- console.log(`RPC method registered: ${fullMethodName}`);
152
- return this;
153
- }
154
- // Метод для регистрации группы RPC методов из модуля
155
- registerRpcMethods(moduleName, methodsMap) {
156
- for (const [methodName, config] of Object.entries(methodsMap)) {
157
- const handler = typeof config === "function" ? config : config.handler;
158
- const options = typeof config === "function" ? {} : config.options || {};
159
- this.registerRpcMethod(moduleName, methodName, handler, options);
160
- }
161
- return this;
162
- }
163
- // Обработчик RPC вызовов
164
- async _handleRpcCall(ws, message) {
165
- const { module, method, params, id } = message;
166
- if (!this.rpcMethods.has(module) || !this.rpcMethods.get(module).has(method)) {
167
- this._sendRpcResponse(ws, id, null, {
168
- code: -32601,
169
- message: `Method ${module}.${method} not found`
170
- });
171
- return;
172
- }
173
- const { handler, options } = this.rpcMethods.get(module).get(method);
174
- if (options.requireAuth && !ws.userId) {
175
- this._sendRpcResponse(ws, id, null, {
176
- code: -32e3,
177
- message: "Authentication required"
178
- });
179
- return;
180
- }
181
- if (options.validateParams && !options.validateParams(params)) {
182
- this._sendRpcResponse(ws, id, null, {
183
- code: -32602,
184
- message: "Invalid params"
185
- });
186
- return;
187
- }
188
- try {
189
- const context = {
190
- userId: ws.userId,
191
- ws,
192
- sendResponse: (result2) => this._sendRpcResponse(ws, id, result2),
193
- sendError: (error) => this._sendRpcResponse(ws, id, null, error)
194
- };
195
- const result = await handler.call(context, params, context);
196
- if (!context.responseSent) {
197
- this._sendRpcResponse(ws, id, result);
198
- }
199
- } catch (error) {
200
- console.error(`Error executing RPC method ${module}.${method}:`, error);
201
- this._sendRpcResponse(ws, id, null, {
202
- code: -32603,
203
- message: error.message || "Internal error"
204
- });
205
- }
206
- }
207
- // Отправка ответа на RPC запрос
208
- _sendRpcResponse(ws, id, result, error = null) {
209
- if (ws.context?.responseSent) return;
210
- if (ws.context) ws.context.responseSent = true;
211
- const response = {
212
- type: "rpc_response",
213
- id
214
- };
215
- if (error) {
216
- response.error = {
217
- code: error.code || -32603,
218
- message: error.message || "Internal error",
219
- data: error.data
220
- };
221
- } else {
222
- response.result = result;
223
- }
224
- try {
225
- ws.send(JSON.stringify(response), false);
226
- } catch (err) {
227
- console.error("Error sending RPC response:", err);
228
- }
229
- }
230
- sendToUserInModule(moduleName, userId, data) {
231
- const userIdStr = userId.toString();
232
- const sockets = this.userConnections.get(userIdStr);
233
- if (!sockets) {
234
- console.log(`No sockets found for user ${userIdStr}`);
235
- return false;
236
- }
237
- let sent = false;
238
- const message = JSON.stringify(data);
239
- for (const ws of sockets) {
240
- if (ws.subscriptions.has(moduleName)) {
241
- try {
242
- const ok = ws.send(message, false);
243
- if (!ok) {
244
- console.warn("WebSocket backpressure exceeded for user:", userIdStr);
245
- } else {
246
- sent = true;
247
- }
248
- } catch (err) {
249
- console.warn("Failed to send message to user:", userIdStr, err);
250
- }
251
- }
252
- }
253
- return sent;
254
- }
255
- broadcastToModule(moduleName, data) {
256
- const message = JSON.stringify(data);
257
- let failedSends = 0;
258
- for (const sockets of this.userConnections.values()) {
259
- for (const ws of sockets) {
260
- if (ws.subscriptions.has(moduleName)) {
261
- try {
262
- const ok = ws.send(message, false);
263
- if (!ok) {
264
- failedSends++;
265
- }
266
- } catch (err) {
267
- failedSends++;
268
- console.warn("Failed to broadcast message:", err);
269
- }
270
- }
271
- }
272
- }
273
- if (failedSends > 0) {
274
- console.warn(`Failed to send broadcast to ${failedSends} connections due to backpressure or closed sockets`);
275
- }
276
- return true;
277
- }
278
- broadcastToModuleWithFilter(moduleName, filterFn, data) {
279
- const message = JSON.stringify(data);
280
- let failedSends = 0;
281
- for (const sockets of this.userConnections.values()) {
282
- for (const ws of sockets) {
283
- if (!ws.subscriptions.has(moduleName)) continue;
284
- if (!filterFn(ws)) continue;
285
- try {
286
- const ok = ws.send(message, false);
287
- if (!ok) {
288
- failedSends++;
289
- }
290
- } catch (err) {
291
- failedSends++;
292
- console.warn("Failed to send filtered broadcast:", err);
293
- }
294
- }
295
- }
296
- if (failedSends > 0) {
297
- console.warn(`Failed to send filtered broadcast to ${failedSends} connections due to backpressure or closed sockets`);
298
- }
299
- return true;
300
- }
301
- getServer() {
302
- return this.app;
303
- }
304
- }
2
+ import { W as WebSocketManager } from "./globals.websocket-DzvdIBf6.js";
305
3
  const initGlobalsPolicies = function initializeDefaultPolicies(abacAccessControl) {
306
4
  abacAccessControl.registerGlobalPolicy("AdminModeratorAccessPolicy", async (context) => {
307
5
  const { user, req } = context;
@@ -0,0 +1,306 @@
1
+ import * as cookie from "cookie";
2
+ import jwt from "jsonwebtoken";
3
+ import uWS from "uWebSockets.js";
4
+ class WebSocketManager {
5
+ constructor() {
6
+ this.app = uWS.App();
7
+ this.modules = /* @__PURE__ */ new Map();
8
+ this.userConnections = /* @__PURE__ */ new Map();
9
+ this.rpcMethods = /* @__PURE__ */ new Map();
10
+ this.app.ws("/api/ws", {
11
+ maxPayloadLength: 16 * 1024 * 1024,
12
+ idleTimeout: 120,
13
+ compression: uWS.SHARED_COMPRESSOR,
14
+ maxBackpressure: 1024 * 1024,
15
+ // Обработчик аутентификации и апгрейда соединения
16
+ upgrade: (res, req, context) => {
17
+ let userId = null;
18
+ const headers = {};
19
+ req.forEach((key, value) => {
20
+ headers[key.toLowerCase()] = value;
21
+ });
22
+ const secWebSocketKey = headers["sec-websocket-key"] || "";
23
+ const secWebSocketProtocol = headers["sec-websocket-protocol"] || "";
24
+ const secWebSocketExtensions = headers["sec-websocket-extensions"] || "";
25
+ try {
26
+ if (headers.cookie) {
27
+ const cookies = cookie.parse(headers.cookie);
28
+ if (cookies.user) {
29
+ const token = JSON.parse(decodeURIComponent(cookies.user));
30
+ const decoded = jwt.verify(token.accessToken, process.env.SECRET_KEY);
31
+ userId = decoded._id;
32
+ }
33
+ }
34
+ } catch (err) {
35
+ console.error("Invalid token:", err);
36
+ }
37
+ if (process.env.REQUIRE_AUTH === "true" && !userId) {
38
+ res.writeStatus("401 Unauthorized").end("Authentication required");
39
+ return;
40
+ }
41
+ const userData = { userId };
42
+ res.upgrade(userData, secWebSocketKey, secWebSocketProtocol, secWebSocketExtensions, context);
43
+ },
44
+ // Обработчик открытия соединения
45
+ open: (ws) => {
46
+ ws.userId = ws.getUserData().userId;
47
+ ws.subscriptions = /* @__PURE__ */ new Set();
48
+ if (ws.userId) {
49
+ this._trackUserConnection(ws.userId, ws);
50
+ }
51
+ },
52
+ // Обработчик входящих сообщений
53
+ message: async (ws, message, isBinary) => {
54
+ if (!isBinary) {
55
+ try {
56
+ const msgStr = new TextDecoder().decode(message);
57
+ const msg = JSON.parse(msgStr);
58
+ if (msg.type === "subscribe" && msg.module && this.modules.has(msg.module)) {
59
+ ws.subscriptions.add(msg.module);
60
+ return;
61
+ } else if (msg.type === "unsubscribe" && msg.module) {
62
+ ws.subscriptions.delete(msg.module);
63
+ return;
64
+ }
65
+ if (msg.type === "rpc") {
66
+ await this._handleRpcCall(ws, msg);
67
+ return;
68
+ }
69
+ const moduleName = msg.module;
70
+ if (moduleName && this.modules.has(moduleName)) {
71
+ const handler = this.modules.get(moduleName);
72
+ Promise.resolve(handler(ws, msg)).catch((err) => {
73
+ console.error(`Error in handler for module ${moduleName}:`, err);
74
+ });
75
+ }
76
+ } catch (err) {
77
+ console.error("Invalid message or handler error:", err);
78
+ if (err instanceof Error) {
79
+ try {
80
+ ws.send(
81
+ JSON.stringify({
82
+ type: "error",
83
+ error: {
84
+ message: err.message,
85
+ code: err.code || "INTERNAL_ERROR"
86
+ }
87
+ }),
88
+ false
89
+ );
90
+ } catch (sendErr) {
91
+ console.error("Error sending error response:", sendErr);
92
+ }
93
+ }
94
+ }
95
+ }
96
+ },
97
+ // Обработчик закрытия соединения
98
+ close: (ws, code, message) => {
99
+ const userId = ws.userId;
100
+ if (userId && this.userConnections.has(userId)) {
101
+ this.userConnections.get(userId).delete(ws);
102
+ if (this.userConnections.get(userId).size === 0) {
103
+ this.userConnections.delete(userId);
104
+ }
105
+ }
106
+ if (ws.subscriptions && typeof ws.subscriptions.clear === "function") {
107
+ ws.subscriptions.clear();
108
+ }
109
+ }
110
+ });
111
+ this.listenSocket = null;
112
+ }
113
+ // Метод для запуска сервера
114
+ listen(port, callback) {
115
+ this.app.listen(port, (listenSocket) => {
116
+ if (listenSocket) {
117
+ this.listenSocket = listenSocket;
118
+ if (callback) callback(null, this.app);
119
+ } else {
120
+ if (callback) callback(new Error("Failed to listen"), null);
121
+ }
122
+ });
123
+ return this;
124
+ }
125
+ _trackUserConnection(userId, ws) {
126
+ if (!this.userConnections.has(userId)) {
127
+ this.userConnections.set(userId, /* @__PURE__ */ new Set());
128
+ }
129
+ this.userConnections.get(userId).add(ws);
130
+ }
131
+ registerModule(moduleName, handler) {
132
+ this.modules.set(moduleName, handler);
133
+ }
134
+ // Добавляем методы для регистрации RPC
135
+ registerRpcMethod(moduleName, methodName, handler, options = {}) {
136
+ const fullMethodName = `${moduleName}.${methodName}`;
137
+ if (!this.rpcMethods.has(moduleName)) {
138
+ this.rpcMethods.set(moduleName, /* @__PURE__ */ new Map());
139
+ }
140
+ this.rpcMethods.get(moduleName).set(methodName, {
141
+ handler,
142
+ options: {
143
+ requireAuth: options.requireAuth !== false,
144
+ // По умолчанию true
145
+ validateParams: options.validateParams || null,
146
+ rateLimit: options.rateLimit || null,
147
+ ...options
148
+ }
149
+ });
150
+ console.log(`RPC method registered: ${fullMethodName}`);
151
+ return this;
152
+ }
153
+ // Метод для регистрации группы RPC методов из модуля
154
+ registerRpcMethods(moduleName, methodsMap) {
155
+ for (const [methodName, config] of Object.entries(methodsMap)) {
156
+ const handler = typeof config === "function" ? config : config.handler;
157
+ const options = typeof config === "function" ? {} : config.options || {};
158
+ this.registerRpcMethod(moduleName, methodName, handler, options);
159
+ }
160
+ return this;
161
+ }
162
+ // Обработчик RPC вызовов
163
+ async _handleRpcCall(ws, message) {
164
+ const { module, method, params, id } = message;
165
+ if (!this.rpcMethods.has(module) || !this.rpcMethods.get(module).has(method)) {
166
+ this._sendRpcResponse(ws, id, null, {
167
+ code: -32601,
168
+ message: `Method ${module}.${method} not found`
169
+ });
170
+ return;
171
+ }
172
+ const { handler, options } = this.rpcMethods.get(module).get(method);
173
+ if (options.requireAuth && !ws.userId) {
174
+ this._sendRpcResponse(ws, id, null, {
175
+ code: -32e3,
176
+ message: "Authentication required"
177
+ });
178
+ return;
179
+ }
180
+ if (options.validateParams && !options.validateParams(params)) {
181
+ this._sendRpcResponse(ws, id, null, {
182
+ code: -32602,
183
+ message: "Invalid params"
184
+ });
185
+ return;
186
+ }
187
+ try {
188
+ const context = {
189
+ userId: ws.userId,
190
+ ws,
191
+ sendResponse: (result2) => this._sendRpcResponse(ws, id, result2),
192
+ sendError: (error) => this._sendRpcResponse(ws, id, null, error)
193
+ };
194
+ const result = await handler.call(context, params, context);
195
+ if (!context.responseSent) {
196
+ this._sendRpcResponse(ws, id, result);
197
+ }
198
+ } catch (error) {
199
+ console.error(`Error executing RPC method ${module}.${method}:`, error);
200
+ this._sendRpcResponse(ws, id, null, {
201
+ code: -32603,
202
+ message: error.message || "Internal error"
203
+ });
204
+ }
205
+ }
206
+ // Отправка ответа на RPC запрос
207
+ _sendRpcResponse(ws, id, result, error = null) {
208
+ if (ws.context?.responseSent) return;
209
+ if (ws.context) ws.context.responseSent = true;
210
+ const response = {
211
+ type: "rpc_response",
212
+ id
213
+ };
214
+ if (error) {
215
+ response.error = {
216
+ code: error.code || -32603,
217
+ message: error.message || "Internal error",
218
+ data: error.data
219
+ };
220
+ } else {
221
+ response.result = result;
222
+ }
223
+ try {
224
+ ws.send(JSON.stringify(response), false);
225
+ } catch (err) {
226
+ console.error("Error sending RPC response:", err);
227
+ }
228
+ }
229
+ sendToUserInModule(moduleName, userId, data) {
230
+ const userIdStr = userId.toString();
231
+ const sockets = this.userConnections.get(userIdStr);
232
+ if (!sockets) {
233
+ console.log(`No sockets found for user ${userIdStr}`);
234
+ return false;
235
+ }
236
+ let sent = false;
237
+ const message = JSON.stringify(data);
238
+ for (const ws of sockets) {
239
+ if (ws.subscriptions.has(moduleName)) {
240
+ try {
241
+ const ok = ws.send(message, false);
242
+ if (!ok) {
243
+ console.warn("WebSocket backpressure exceeded for user:", userIdStr);
244
+ } else {
245
+ sent = true;
246
+ }
247
+ } catch (err) {
248
+ console.warn("Failed to send message to user:", userIdStr, err);
249
+ }
250
+ }
251
+ }
252
+ return sent;
253
+ }
254
+ broadcastToModule(moduleName, data) {
255
+ const message = JSON.stringify(data);
256
+ let failedSends = 0;
257
+ for (const sockets of this.userConnections.values()) {
258
+ for (const ws of sockets) {
259
+ if (ws.subscriptions.has(moduleName)) {
260
+ try {
261
+ const ok = ws.send(message, false);
262
+ if (!ok) {
263
+ failedSends++;
264
+ }
265
+ } catch (err) {
266
+ failedSends++;
267
+ console.warn("Failed to broadcast message:", err);
268
+ }
269
+ }
270
+ }
271
+ }
272
+ if (failedSends > 0) {
273
+ console.warn(`Failed to send broadcast to ${failedSends} connections due to backpressure or closed sockets`);
274
+ }
275
+ return true;
276
+ }
277
+ broadcastToModuleWithFilter(moduleName, filterFn, data) {
278
+ const message = JSON.stringify(data);
279
+ let failedSends = 0;
280
+ for (const sockets of this.userConnections.values()) {
281
+ for (const ws of sockets) {
282
+ if (!ws.subscriptions.has(moduleName)) continue;
283
+ if (!filterFn(ws)) continue;
284
+ try {
285
+ const ok = ws.send(message, false);
286
+ if (!ok) {
287
+ failedSends++;
288
+ }
289
+ } catch (err) {
290
+ failedSends++;
291
+ console.warn("Failed to send filtered broadcast:", err);
292
+ }
293
+ }
294
+ }
295
+ if (failedSends > 0) {
296
+ console.warn(`Failed to send filtered broadcast to ${failedSends} connections due to backpressure or closed sockets`);
297
+ }
298
+ return true;
299
+ }
300
+ getServer() {
301
+ return this.app;
302
+ }
303
+ }
304
+ export {
305
+ WebSocketManager as W
306
+ };