@ozdao/martyrs 0.2.492 → 0.2.494
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.
- package/dist/_virtual/index.cjs +4 -4
- package/dist/_virtual/index.js +4 -4
- package/dist/_virtual/index2.cjs +4 -4
- package/dist/_virtual/index2.js +4 -4
- package/dist/builder.cjs +53 -90
- package/dist/builder.js +54 -91
- package/dist/{crud-B-kQw3Z5.cjs → crud-JN_LFj01.cjs} +3 -0
- package/dist/{crud-Cwx5VlSm.js → crud-sE7GLPbj.js} +3 -0
- package/dist/globals.server.cjs +322 -3
- package/dist/globals.server.js +303 -1
- package/dist/{globals.verifier-D68mHEBl.cjs → globals.verifier-C0zj_LLo.cjs} +8 -1
- package/dist/{globals.verifier-CWFz5Gh2.js → globals.verifier-DFqKQ7hK.js} +8 -1
- package/dist/inventory.server.cjs +2 -2
- package/dist/inventory.server.js +2 -2
- package/dist/{main-SZQ1QjeP.js → main-CJm5myDI.js} +631 -607
- package/dist/{main-MzmGbSxs.cjs → main-DTaE01lg.cjs} +6 -6
- package/dist/martyrs/src/components/Calendar/Calendar.vue2.cjs +1 -1
- package/dist/martyrs/src/components/Calendar/Calendar.vue2.cjs.map +1 -1
- package/dist/martyrs/src/components/Calendar/Calendar.vue2.js +1 -1
- package/dist/martyrs/src/components/Calendar/Calendar.vue2.js.map +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.cjs +33 -7
- package/dist/martyrs/src/components/Feed/Feed.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/Feed/Feed.vue.js +33 -7
- package/dist/martyrs/src/components/Feed/Feed.vue.js.map +1 -1
- package/dist/martyrs/src/components/Field/{Field.vue2.cjs → Field.vue.cjs} +2 -2
- package/dist/martyrs/src/components/Field/{Field.vue2.js.map → Field.vue.cjs.map} +1 -1
- package/dist/martyrs/src/components/Field/{Field.vue2.js → Field.vue.js} +2 -2
- package/dist/martyrs/src/components/Field/Field.vue.js.map +1 -0
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/martyrs/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue.cjs +1 -1
- package/dist/martyrs/src/components/FieldTags/FieldTags.vue.js +1 -1
- package/dist/martyrs/src/components/Menu/{Menu.vue.cjs → Menu.vue2.cjs} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue2.cjs.map +1 -0
- package/dist/martyrs/src/components/Menu/{Menu.vue.js → Menu.vue2.js} +2 -2
- package/dist/martyrs/src/components/Menu/Menu.vue2.js.map +1 -0
- package/dist/martyrs/src/components/Menu/MenuItem.vue.js +2 -2
- package/dist/martyrs/src/components/Menu/MenuItem.vue.js.map +1 -1
- package/dist/martyrs/src/components/PhotoViewer/PhotoViewer.vue.js +4 -4
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterCode.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/EnterPassword.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Invite.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.cjs +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/Profile.vue.js +2 -2
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ProfileEditProfile.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/ResetPassword.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignIn.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/pages/SignUp.vue.js +1 -1
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.cjs +1 -1
- package/dist/martyrs/src/modules/auth/views/components/sections/ProfileEditCredentials.vue.js +1 -1
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.cjs +2 -2
- package/dist/martyrs/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
- package/dist/martyrs/src/modules/constructor/components/elements/Card.vue.cjs +1 -1
- package/dist/martyrs/src/modules/constructor/components/elements/Card.vue.js +1 -1
- package/dist/martyrs/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/martyrs/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEvent.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.cjs +1 -1
- package/dist/martyrs/src/modules/events/components/pages/Event.vue.js +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/martyrs/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/classes/globals.i18n.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/martyrs/src/modules/globals/views/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs +5 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js +5 -1
- package/dist/martyrs/src/modules/globals/views/components/layouts/Client.vue.js.map +1 -1
- package/dist/martyrs/src/modules/icons/entities/IconTime.vue.cjs +2 -2
- package/dist/martyrs/src/modules/icons/entities/IconTime.vue.js +2 -2
- package/dist/martyrs/src/modules/icons/navigation/IconChevronLeft.vue.cjs +2 -2
- package/dist/martyrs/src/modules/icons/navigation/IconChevronLeft.vue.js +2 -2
- package/dist/martyrs/src/modules/icons/navigation/IconChevronRight.vue.cjs +2 -2
- package/dist/martyrs/src/modules/icons/navigation/IconChevronRight.vue.js +2 -2
- package/dist/martyrs/src/modules/icons/pages/IconsPage.vue.js +6 -6
- package/dist/martyrs/src/modules/icons/pages/IconsPage.vue.js.map +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/AdjustmentForm.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/inventory/components/forms/StockAlertsForm.vue.js +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/Inventory.vue.cjs +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/inventory/components/pages/InventoryEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.cjs +22 -15
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js +23 -16
- package/dist/martyrs/src/modules/music/components/cards/AlbumCard.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/cards/ArtistCard.vue.cjs +2 -2
- package/dist/martyrs/src/modules/music/components/cards/ArtistCard.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/cards/ArtistCard.vue.js +2 -2
- package/dist/martyrs/src/modules/music/components/cards/ArtistCard.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.cjs +31 -13
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js +33 -15
- package/dist/martyrs/src/modules/music/components/cards/PlaylistCard.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.cjs +39 -22
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js +39 -22
- package/dist/martyrs/src/modules/music/components/cards/TrackListCard.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/forms/AlbumForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.cjs +1 -1
- package/dist/martyrs/src/modules/music/components/forms/ArtistForm.vue.js +1 -1
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.cjs +385 -125
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js +391 -131
- package/dist/martyrs/src/modules/music/components/forms/PlaylistForm.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.cjs +24 -7
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js +25 -8
- package/dist/martyrs/src/modules/music/components/forms/SearchForm.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.cjs +99 -87
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js +111 -99
- package/dist/martyrs/src/modules/music/components/forms/TrackForm.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/layouts/MusicBottomPlayer.vue.cjs +21 -0
- package/dist/martyrs/src/modules/music/components/layouts/MusicBottomPlayer.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/music/components/layouts/MusicBottomPlayer.vue.js +21 -0
- package/dist/martyrs/src/modules/music/components/layouts/MusicBottomPlayer.vue.js.map +1 -0
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.cjs +442 -210
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js +445 -213
- package/dist/martyrs/src/modules/music/components/pages/Album.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.cjs +92 -117
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js +93 -118
- package/dist/martyrs/src/modules/music/components/pages/Artist.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/MusicHome.vue.cjs +72 -113
- package/dist/martyrs/src/modules/music/components/pages/MusicHome.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/MusicHome.vue.js +78 -119
- package/dist/martyrs/src/modules/music/components/pages/MusicHome.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.cjs +15 -12
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js +15 -12
- package/dist/martyrs/src/modules/music/components/pages/MusicLibrary.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.cjs +558 -429
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js +560 -431
- package/dist/martyrs/src/modules/music/components/pages/Playlist.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.cjs +146 -284
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js +149 -287
- package/dist/martyrs/src/modules/music/components/pages/SearchResults.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.cjs +460 -63
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js +462 -65
- package/dist/martyrs/src/modules/music/components/pages/Track.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.cjs +126 -136
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js +129 -139
- package/dist/martyrs/src/modules/music/components/player/MusicPlayer.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/player/TrackProgress.vue.cjs +18 -15
- package/dist/martyrs/src/modules/music/components/player/TrackProgress.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/player/TrackProgress.vue.js +18 -15
- package/dist/martyrs/src/modules/music/components/player/TrackProgress.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.cjs +28 -23
- package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js +29 -24
- package/dist/martyrs/src/modules/music/components/player/VolumeControl.vue.js.map +1 -1
- package/dist/martyrs/src/modules/music/music.client.cjs +3 -6
- package/dist/martyrs/src/modules/music/music.client.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/music.client.js +9 -12
- package/dist/martyrs/src/modules/music/music.client.js.map +1 -1
- package/dist/martyrs/src/modules/music/router/music.cjs +27 -1
- package/dist/martyrs/src/modules/music/router/music.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/router/music.js +27 -1
- package/dist/martyrs/src/modules/music/router/music.js.map +1 -1
- package/dist/martyrs/src/modules/music/store/artists.cjs +6 -4
- package/dist/martyrs/src/modules/music/store/artists.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/store/artists.js +6 -4
- package/dist/martyrs/src/modules/music/store/artists.js.map +1 -1
- package/dist/martyrs/src/modules/music/store/player.cjs +5 -0
- package/dist/martyrs/src/modules/music/store/player.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/store/player.js +5 -0
- package/dist/martyrs/src/modules/music/store/player.js.map +1 -1
- package/dist/martyrs/src/modules/music/store/tracks.cjs +22 -0
- package/dist/martyrs/src/modules/music/store/tracks.cjs.map +1 -1
- package/dist/martyrs/src/modules/music/store/tracks.js +22 -0
- package/dist/martyrs/src/modules/music/store/tracks.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/blocks/CardOrderBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/OrderBackoffice.vue.js +2 -2
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/martyrs/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/blocks/CardOrganization.vue.js +2 -2
- package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Members.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationBackoffice.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/pages/OrganizationEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Documents.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/components/sections/Organizations.vue.js +1 -1
- package/dist/martyrs/src/modules/organizations/router/organizations.cjs +1 -1
- package/dist/martyrs/src/modules/organizations/router/organizations.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/blocks/CardPage.vue.js +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditAttributes.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditDiscounts.vue.js +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.cjs +1 -1
- package/dist/martyrs/src/modules/products/components/sections/EditVariants.vue.js +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttBar.vue.cjs +4 -3
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttBar.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttBar.vue.js +4 -3
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttBar.vue.js.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttChart.vue.cjs +37 -70
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttChart.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttChart.vue.js +38 -71
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttChart.vue.js.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.cjs +2 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js +6 -5
- package/dist/martyrs/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue.js.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.cjs +45 -52
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js +46 -53
- package/dist/martyrs/src/modules/rents/views/components/pages/Rents.vue.js.map +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/rents/views/components/pages/RentsEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/blocks/SpotMemberModify.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/layouts/Spots.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +1 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CardDeposit.vue.js +1 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.cjs +1 -1
- package/dist/martyrs/src/modules/wallet/views/components/blocks/CryptoDeposit.vue.js +1 -1
- package/dist/martyrs.cjs.js +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/music.server.cjs +124 -31
- package/dist/music.server.js +124 -31
- package/dist/organizations.server.cjs +1 -1
- package/dist/organizations.server.js +1 -1
- package/dist/products.server.cjs +2 -2
- package/dist/products.server.js +2 -2
- package/dist/rents.server.cjs +3 -3
- package/dist/rents.server.js +3 -3
- package/dist/style.css +373 -80
- package/dist/{web-D7lZjuC0.js → web-Dkk0_7TA.js} +1 -1
- package/dist/{web-D-YZ9KHz.cjs → web-stVkXd0l.cjs} +1 -1
- package/package.json +1 -1
- package/src/builder/modes/ssr.prod.js +21 -5
- package/src/builder/rspack/rspack.config.spa.client.js +0 -44
- package/src/builder/rspack/rspack.config.ssr.client.js +40 -40
- package/src/components/Calendar/Calendar.vue +378 -377
- package/src/components/Feed/Feed.vue +28 -2
- package/src/modules/globals/controllers/classes/crud/crud.policies.js +5 -0
- package/src/modules/globals/controllers/classes/globals.validator.js +8 -1
- package/src/modules/globals/views/components/layouts/Client.vue +7 -0
- package/src/modules/music/README.md +8 -0
- package/src/modules/music/components/SidebarMusic.vue +6 -9
- package/src/modules/music/components/cards/AlbumCard.vue +20 -14
- package/src/modules/music/components/cards/ArtistCard.vue +1 -1
- package/src/modules/music/components/cards/PlaylistCard.vue +31 -11
- package/src/modules/music/components/cards/TrackListCard.vue +24 -13
- package/src/modules/music/components/forms/PlaylistForm.vue +417 -107
- package/src/modules/music/components/forms/SearchForm.vue +31 -8
- package/src/modules/music/components/forms/TrackForm.vue +50 -32
- package/src/modules/music/components/layouts/MusicBottomPlayer.vue +17 -0
- package/src/modules/music/components/pages/Album.vue +373 -186
- package/src/modules/music/components/pages/Artist.vue +54 -94
- package/src/modules/music/components/pages/MusicHome.vue +59 -56
- package/src/modules/music/components/pages/MusicLibrary.vue +13 -11
- package/src/modules/music/components/pages/Playlist.vue +495 -379
- package/src/modules/music/components/pages/SearchResults.vue +185 -313
- package/src/modules/music/components/pages/Track.vue +363 -69
- package/src/modules/music/components/player/MusicPlayer.vue +368 -97
- package/src/modules/music/components/player/TrackProgress.vue +76 -22
- package/src/modules/music/components/player/VolumeControl.vue +61 -28
- package/src/modules/music/controllers/search.controller.js +3 -0
- package/src/modules/music/controllers/stream.controller.js +11 -3
- package/src/modules/music/middlewares/playlists.verifier.js +1 -1
- package/src/modules/music/music.client.js +3 -6
- package/src/modules/music/music.server.js +8 -4
- package/src/modules/music/router/music.js +8 -1
- package/src/modules/music/routes/albums.routes.js +37 -5
- package/src/modules/music/routes/artists.routes.js +14 -4
- package/src/modules/music/routes/genres.routes.js +5 -1
- package/src/modules/music/routes/playlists.routes.js +42 -9
- package/src/modules/music/routes/tracks.routes.js +27 -2
- package/src/modules/music/store/artists.js +6 -2
- package/src/modules/music/store/player.js +6 -0
- package/src/modules/music/store/tracks.js +31 -0
- package/src/modules/music/websocket/streaming.handler.js +7 -1
- package/src/modules/rents/controllers/services/rents.services.js +2 -2
- package/src/modules/rents/views/components/pages/Gant/GanttBar.vue +4 -3
- package/src/modules/rents/views/components/pages/Gant/GanttChart.vue +42 -40
- package/src/modules/rents/views/components/pages/Gant/GanttToolbar.vue +3 -1
- package/src/modules/rents/views/components/pages/Rents.vue +60 -56
- package/dist/globals.websocket-DzvdIBf6.js +0 -306
- package/dist/globals.websocket-k6_B1T7k.cjs +0 -322
- package/dist/martyrs/src/components/Field/Field.vue2.cjs.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue.cjs.map +0 -1
- package/dist/martyrs/src/components/Menu/Menu.vue.js.map +0 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackCard.vue.cjs +0 -69
- package/dist/martyrs/src/modules/music/components/cards/TrackCard.vue.cjs.map +0 -1
- package/dist/martyrs/src/modules/music/components/cards/TrackCard.vue.js +0 -69
- package/dist/martyrs/src/modules/music/components/cards/TrackCard.vue.js.map +0 -1
- package/dist/martyrs/src/modules/music/components/layouts/MusicLayout.vue.cjs +0 -104
- package/dist/martyrs/src/modules/music/components/layouts/MusicLayout.vue.cjs.map +0 -1
- package/dist/martyrs/src/modules/music/components/layouts/MusicLayout.vue.js +0 -104
- package/dist/martyrs/src/modules/music/components/layouts/MusicLayout.vue.js.map +0 -1
- package/src/modules/music/components/cards/TrackCard.vue +0 -86
- package/src/modules/music/components/layouts/MusicLayout.vue +0 -83
|
@@ -1,306 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
const cookie = require("cookie");
|
|
3
|
-
const jwt = require("jsonwebtoken");
|
|
4
|
-
const uWS = require("uWebSockets.js");
|
|
5
|
-
function _interopNamespaceDefault(e) {
|
|
6
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
|
-
if (e) {
|
|
8
|
-
for (const k in e) {
|
|
9
|
-
if (k !== "default") {
|
|
10
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
get: () => e[k]
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
n.default = e;
|
|
19
|
-
return Object.freeze(n);
|
|
20
|
-
}
|
|
21
|
-
const cookie__namespace = /* @__PURE__ */ _interopNamespaceDefault(cookie);
|
|
22
|
-
class WebSocketManager {
|
|
23
|
-
constructor() {
|
|
24
|
-
this.app = uWS.App();
|
|
25
|
-
this.modules = /* @__PURE__ */ new Map();
|
|
26
|
-
this.userConnections = /* @__PURE__ */ new Map();
|
|
27
|
-
this.rpcMethods = /* @__PURE__ */ new Map();
|
|
28
|
-
this.app.ws("/api/ws", {
|
|
29
|
-
maxPayloadLength: 16 * 1024 * 1024,
|
|
30
|
-
idleTimeout: 120,
|
|
31
|
-
compression: uWS.SHARED_COMPRESSOR,
|
|
32
|
-
maxBackpressure: 1024 * 1024,
|
|
33
|
-
// Обработчик аутентификации и апгрейда соединения
|
|
34
|
-
upgrade: (res, req, context) => {
|
|
35
|
-
let userId = null;
|
|
36
|
-
const headers = {};
|
|
37
|
-
req.forEach((key, value) => {
|
|
38
|
-
headers[key.toLowerCase()] = value;
|
|
39
|
-
});
|
|
40
|
-
const secWebSocketKey = headers["sec-websocket-key"] || "";
|
|
41
|
-
const secWebSocketProtocol = headers["sec-websocket-protocol"] || "";
|
|
42
|
-
const secWebSocketExtensions = headers["sec-websocket-extensions"] || "";
|
|
43
|
-
try {
|
|
44
|
-
if (headers.cookie) {
|
|
45
|
-
const cookies = cookie__namespace.parse(headers.cookie);
|
|
46
|
-
if (cookies.user) {
|
|
47
|
-
const token = JSON.parse(decodeURIComponent(cookies.user));
|
|
48
|
-
const decoded = jwt.verify(token.accessToken, process.env.SECRET_KEY);
|
|
49
|
-
userId = decoded._id;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
} catch (err) {
|
|
53
|
-
console.error("Invalid token:", err);
|
|
54
|
-
}
|
|
55
|
-
if (process.env.REQUIRE_AUTH === "true" && !userId) {
|
|
56
|
-
res.writeStatus("401 Unauthorized").end("Authentication required");
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const userData = { userId };
|
|
60
|
-
res.upgrade(userData, secWebSocketKey, secWebSocketProtocol, secWebSocketExtensions, context);
|
|
61
|
-
},
|
|
62
|
-
// Обработчик открытия соединения
|
|
63
|
-
open: (ws) => {
|
|
64
|
-
ws.userId = ws.getUserData().userId;
|
|
65
|
-
ws.subscriptions = /* @__PURE__ */ new Set();
|
|
66
|
-
if (ws.userId) {
|
|
67
|
-
this._trackUserConnection(ws.userId, ws);
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
// Обработчик входящих сообщений
|
|
71
|
-
message: async (ws, message, isBinary) => {
|
|
72
|
-
if (!isBinary) {
|
|
73
|
-
try {
|
|
74
|
-
const msgStr = new TextDecoder().decode(message);
|
|
75
|
-
const msg = JSON.parse(msgStr);
|
|
76
|
-
if (msg.type === "subscribe" && msg.module && this.modules.has(msg.module)) {
|
|
77
|
-
ws.subscriptions.add(msg.module);
|
|
78
|
-
return;
|
|
79
|
-
} else if (msg.type === "unsubscribe" && msg.module) {
|
|
80
|
-
ws.subscriptions.delete(msg.module);
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
if (msg.type === "rpc") {
|
|
84
|
-
await this._handleRpcCall(ws, msg);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const moduleName = msg.module;
|
|
88
|
-
if (moduleName && this.modules.has(moduleName)) {
|
|
89
|
-
const handler = this.modules.get(moduleName);
|
|
90
|
-
Promise.resolve(handler(ws, msg)).catch((err) => {
|
|
91
|
-
console.error(`Error in handler for module ${moduleName}:`, err);
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
} catch (err) {
|
|
95
|
-
console.error("Invalid message or handler error:", err);
|
|
96
|
-
if (err instanceof Error) {
|
|
97
|
-
try {
|
|
98
|
-
ws.send(
|
|
99
|
-
JSON.stringify({
|
|
100
|
-
type: "error",
|
|
101
|
-
error: {
|
|
102
|
-
message: err.message,
|
|
103
|
-
code: err.code || "INTERNAL_ERROR"
|
|
104
|
-
}
|
|
105
|
-
}),
|
|
106
|
-
false
|
|
107
|
-
);
|
|
108
|
-
} catch (sendErr) {
|
|
109
|
-
console.error("Error sending error response:", sendErr);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
// Обработчик закрытия соединения
|
|
116
|
-
close: (ws, code, message) => {
|
|
117
|
-
const userId = ws.userId;
|
|
118
|
-
if (userId && this.userConnections.has(userId)) {
|
|
119
|
-
this.userConnections.get(userId).delete(ws);
|
|
120
|
-
if (this.userConnections.get(userId).size === 0) {
|
|
121
|
-
this.userConnections.delete(userId);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
if (ws.subscriptions && typeof ws.subscriptions.clear === "function") {
|
|
125
|
-
ws.subscriptions.clear();
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
this.listenSocket = null;
|
|
130
|
-
}
|
|
131
|
-
// Метод для запуска сервера
|
|
132
|
-
listen(port, callback) {
|
|
133
|
-
this.app.listen(port, (listenSocket) => {
|
|
134
|
-
if (listenSocket) {
|
|
135
|
-
this.listenSocket = listenSocket;
|
|
136
|
-
if (callback) callback(null, this.app);
|
|
137
|
-
} else {
|
|
138
|
-
if (callback) callback(new Error("Failed to listen"), null);
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
return this;
|
|
142
|
-
}
|
|
143
|
-
_trackUserConnection(userId, ws) {
|
|
144
|
-
if (!this.userConnections.has(userId)) {
|
|
145
|
-
this.userConnections.set(userId, /* @__PURE__ */ new Set());
|
|
146
|
-
}
|
|
147
|
-
this.userConnections.get(userId).add(ws);
|
|
148
|
-
}
|
|
149
|
-
registerModule(moduleName, handler) {
|
|
150
|
-
this.modules.set(moduleName, handler);
|
|
151
|
-
}
|
|
152
|
-
// Добавляем методы для регистрации RPC
|
|
153
|
-
registerRpcMethod(moduleName, methodName, handler, options = {}) {
|
|
154
|
-
const fullMethodName = `${moduleName}.${methodName}`;
|
|
155
|
-
if (!this.rpcMethods.has(moduleName)) {
|
|
156
|
-
this.rpcMethods.set(moduleName, /* @__PURE__ */ new Map());
|
|
157
|
-
}
|
|
158
|
-
this.rpcMethods.get(moduleName).set(methodName, {
|
|
159
|
-
handler,
|
|
160
|
-
options: {
|
|
161
|
-
requireAuth: options.requireAuth !== false,
|
|
162
|
-
// По умолчанию true
|
|
163
|
-
validateParams: options.validateParams || null,
|
|
164
|
-
rateLimit: options.rateLimit || null,
|
|
165
|
-
...options
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
console.log(`RPC method registered: ${fullMethodName}`);
|
|
169
|
-
return this;
|
|
170
|
-
}
|
|
171
|
-
// Метод для регистрации группы RPC методов из модуля
|
|
172
|
-
registerRpcMethods(moduleName, methodsMap) {
|
|
173
|
-
for (const [methodName, config] of Object.entries(methodsMap)) {
|
|
174
|
-
const handler = typeof config === "function" ? config : config.handler;
|
|
175
|
-
const options = typeof config === "function" ? {} : config.options || {};
|
|
176
|
-
this.registerRpcMethod(moduleName, methodName, handler, options);
|
|
177
|
-
}
|
|
178
|
-
return this;
|
|
179
|
-
}
|
|
180
|
-
// Обработчик RPC вызовов
|
|
181
|
-
async _handleRpcCall(ws, message) {
|
|
182
|
-
const { module: module2, method, params, id } = message;
|
|
183
|
-
if (!this.rpcMethods.has(module2) || !this.rpcMethods.get(module2).has(method)) {
|
|
184
|
-
this._sendRpcResponse(ws, id, null, {
|
|
185
|
-
code: -32601,
|
|
186
|
-
message: `Method ${module2}.${method} not found`
|
|
187
|
-
});
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
const { handler, options } = this.rpcMethods.get(module2).get(method);
|
|
191
|
-
if (options.requireAuth && !ws.userId) {
|
|
192
|
-
this._sendRpcResponse(ws, id, null, {
|
|
193
|
-
code: -32e3,
|
|
194
|
-
message: "Authentication required"
|
|
195
|
-
});
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
if (options.validateParams && !options.validateParams(params)) {
|
|
199
|
-
this._sendRpcResponse(ws, id, null, {
|
|
200
|
-
code: -32602,
|
|
201
|
-
message: "Invalid params"
|
|
202
|
-
});
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
try {
|
|
206
|
-
const context = {
|
|
207
|
-
userId: ws.userId,
|
|
208
|
-
ws,
|
|
209
|
-
sendResponse: (result2) => this._sendRpcResponse(ws, id, result2),
|
|
210
|
-
sendError: (error) => this._sendRpcResponse(ws, id, null, error)
|
|
211
|
-
};
|
|
212
|
-
const result = await handler.call(context, params, context);
|
|
213
|
-
if (!context.responseSent) {
|
|
214
|
-
this._sendRpcResponse(ws, id, result);
|
|
215
|
-
}
|
|
216
|
-
} catch (error) {
|
|
217
|
-
console.error(`Error executing RPC method ${module2}.${method}:`, error);
|
|
218
|
-
this._sendRpcResponse(ws, id, null, {
|
|
219
|
-
code: -32603,
|
|
220
|
-
message: error.message || "Internal error"
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
// Отправка ответа на RPC запрос
|
|
225
|
-
_sendRpcResponse(ws, id, result, error = null) {
|
|
226
|
-
if (ws.context?.responseSent) return;
|
|
227
|
-
if (ws.context) ws.context.responseSent = true;
|
|
228
|
-
const response = {
|
|
229
|
-
type: "rpc_response",
|
|
230
|
-
id
|
|
231
|
-
};
|
|
232
|
-
if (error) {
|
|
233
|
-
response.error = {
|
|
234
|
-
code: error.code || -32603,
|
|
235
|
-
message: error.message || "Internal error",
|
|
236
|
-
data: error.data
|
|
237
|
-
};
|
|
238
|
-
} else {
|
|
239
|
-
response.result = result;
|
|
240
|
-
}
|
|
241
|
-
try {
|
|
242
|
-
ws.send(JSON.stringify(response), false);
|
|
243
|
-
} catch (err) {
|
|
244
|
-
console.error("Error sending RPC response:", err);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
sendToUserInModule(moduleName, userId, data) {
|
|
248
|
-
const userIdStr = userId.toString();
|
|
249
|
-
const sockets = this.userConnections.get(userIdStr);
|
|
250
|
-
if (!sockets) {
|
|
251
|
-
console.log(`No sockets found for user ${userIdStr}`);
|
|
252
|
-
return false;
|
|
253
|
-
}
|
|
254
|
-
let sent = false;
|
|
255
|
-
const message = JSON.stringify(data);
|
|
256
|
-
for (const ws of sockets) {
|
|
257
|
-
if (ws.subscriptions.has(moduleName)) {
|
|
258
|
-
try {
|
|
259
|
-
const ok = ws.send(message, false);
|
|
260
|
-
if (!ok) {
|
|
261
|
-
console.warn("WebSocket backpressure exceeded for user:", userIdStr);
|
|
262
|
-
} else {
|
|
263
|
-
sent = true;
|
|
264
|
-
}
|
|
265
|
-
} catch (err) {
|
|
266
|
-
console.warn("Failed to send message to user:", userIdStr, err);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return sent;
|
|
271
|
-
}
|
|
272
|
-
broadcastToModule(moduleName, data) {
|
|
273
|
-
const message = JSON.stringify(data);
|
|
274
|
-
let failedSends = 0;
|
|
275
|
-
for (const sockets of this.userConnections.values()) {
|
|
276
|
-
for (const ws of sockets) {
|
|
277
|
-
if (ws.subscriptions.has(moduleName)) {
|
|
278
|
-
try {
|
|
279
|
-
const ok = ws.send(message, false);
|
|
280
|
-
if (!ok) {
|
|
281
|
-
failedSends++;
|
|
282
|
-
}
|
|
283
|
-
} catch (err) {
|
|
284
|
-
failedSends++;
|
|
285
|
-
console.warn("Failed to broadcast message:", err);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
if (failedSends > 0) {
|
|
291
|
-
console.warn(`Failed to send broadcast to ${failedSends} connections due to backpressure or closed sockets`);
|
|
292
|
-
}
|
|
293
|
-
return true;
|
|
294
|
-
}
|
|
295
|
-
broadcastToModuleWithFilter(moduleName, filterFn, data) {
|
|
296
|
-
const message = JSON.stringify(data);
|
|
297
|
-
let failedSends = 0;
|
|
298
|
-
for (const sockets of this.userConnections.values()) {
|
|
299
|
-
for (const ws of sockets) {
|
|
300
|
-
if (!ws.subscriptions.has(moduleName)) continue;
|
|
301
|
-
if (!filterFn(ws)) continue;
|
|
302
|
-
try {
|
|
303
|
-
const ok = ws.send(message, false);
|
|
304
|
-
if (!ok) {
|
|
305
|
-
failedSends++;
|
|
306
|
-
}
|
|
307
|
-
} catch (err) {
|
|
308
|
-
failedSends++;
|
|
309
|
-
console.warn("Failed to send filtered broadcast:", err);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
if (failedSends > 0) {
|
|
314
|
-
console.warn(`Failed to send filtered broadcast to ${failedSends} connections due to backpressure or closed sockets`);
|
|
315
|
-
}
|
|
316
|
-
return true;
|
|
317
|
-
}
|
|
318
|
-
getServer() {
|
|
319
|
-
return this.app;
|
|
320
|
-
}
|
|
321
|
-
}
|
|
322
|
-
exports.WebSocketManager = WebSocketManager;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Field.vue2.cjs","sources":["../../../../../src/components/Field/Field.vue"],"sourcesContent":["<script setup>\nimport { ref, onMounted, nextTick, watch } from 'vue'\nimport IconShow from '@martyrs/src/modules/icons/actions/IconShow.vue';\nconst emit = defineEmits(['update:field', 'focus', 'blur']);\nconst props = defineProps({\n label: null,\n symbol: null,\n type: 'text',\n placeholder: 'Enter something here',\n field: null,\n value: null,\n validation: false,\n disabled: null,\n tabindex: -1,\n autofocus: false,\n icon: null // Добавлен пропс для иконки\n});\nif (props.value) {\n emit('update:field', props.value)\n}\nconst textarea = ref(null);\nconst input = ref(null);\nconst showPassword = ref(false);\n\nfunction resize() {\n if (!textarea.value) {\n return;\n }\n const el = textarea.value;\n el.style.height = '';\n const scrollHeight = el.scrollHeight;\n if (scrollHeight > 33) {\n el.style.height = scrollHeight + 'px';\n } else {\n el.style.height = '';\n }\n}\nfunction focus() {\n if (props.autofocus) {\n if (props.type === 'textarea' && textarea.value) {\n textarea.value.focus();\n } else if (input.value) {\n input.value.focus();\n }\n }\n}\nwatch(() => props.field, () => {\n if (props.type === 'textarea') {\n nextTick(resize);\n }\n});\nwatch(() => props.autofocus, (newVal) => {\n if (newVal) {\n nextTick(focus);\n }\n});\nonMounted(() => {\n nextTick(focus);\n nextTick(resize);\n});\nconst text = ref(props.field);\n</script>\n<template>\n <div\n :class=\"[\n $attrs.class,\n { 'bg-fourth-nano': validation }\n ]\"\n class=\"field-wrapper flex-center flex-nowrap flex\"\n >\n <!-- Слот для иконки -->\n <slot name=\"icon\" v-if=\"$slots.icon\" />\n <!-- Или компонент иконки через пропс -->\n <component :is=\"icon\" v-else-if=\"icon\" class=\"i-medium t-transp mn-r-thin\" />\n \n <div\n v-if=\"label\"\n class=\"t-transp mn-r-small\"\n >\n <span class=\"t-nowrap\">\n {{label}}\n </span>\n </div>\n <div class=\"w-100 pos-relative\">\n <input\n v-if=\"type !== 'textarea'\"\n ref=\"input\"\n @input=\"event => text = emit('update:field', event.target.value)\"\n @focus=\"event => emit('focus', event)\"\n @blur=\"event => emit('blur', event)\"\n :type=\"type === 'password' && !showPassword ? 'password' : type === 'password' ? 'text' : type\"\n class=\"w-100\"\n :value=\"field\"\n :placeholder=\"placeholder\"\n :tabindex=\"tabindex\"\n :disabled=\"disabled\"\n :autofocus=\"autofocus\"\n />\n <textarea\n v-else\n ref=\"textarea\"\n @input=\"event => text = emit('update:field', event.target.value)\"\n @focus=\"event => emit('focus', event)\"\n @blur=\"event => emit('blur', event)\"\n class=\"w-100\"\n :value=\"field\"\n :placeholder=\"placeholder\"\n :tabindex=\"tabindex\"\n :disabled=\"disabled\"\n />\n </div>\n <IconShow\n v-if=\"type === 'password'\"\n :show=\"!showPassword\"\n @click=\"showPassword = !showPassword\"\n class=\"i-medium cursor-pointer\"\n />\n <slot></slot>\n <div\n v-if=\"symbol\"\n class=\"t-transp mn-l-small\"\n >\n <span>\n {{symbol}}\n </span>\n </div>\n </div>\n <!-- Validation -->\n <transition name=\"fade\">\n <div v-if=\"validation\" class=\"mn-t-thin mn-b-thin mn-b-thin invalid-feedback\">\n * {{validation.message}}\n </div>\n </transition>\n</template>\n<style scoped>\ninput,\ntextarea,\nspan {\n color: inherit;\n line-height: 1;\n}\ntextarea {\n resize: none;\n overflow: hidden; \n height: 1rem;\n}\ninput[type=\"date\"]::-webkit-calendar-picker-indicator,\ninput[type=\"time\"]::-webkit-calendar-picker-indicator {\n filter: invert(1);\n opacity: 1;\n color: inherit;\n}\n</style>"],"names":["ref","watch","nextTick","onMounted"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,UAAM,OAAO;AACb,UAAM,QAAQ;AAad,QAAI,MAAM,OAAO;AACf,WAAK,gBAAgB,MAAM,KAAK;AAAA,IAClC;AACA,UAAM,WAAWA,IAAAA,IAAI,IAAI;AACzB,UAAM,QAAQA,IAAAA,IAAI,IAAI;AACtB,UAAM,eAAeA,IAAAA,IAAI,KAAK;AAE9B,aAAS,SAAS;AAChB,UAAI,CAAC,SAAS,OAAO;AACnB;AAAA,MACF;AACA,YAAM,KAAK,SAAS;AACpB,SAAG,MAAM,SAAS;AAClB,YAAM,eAAe,GAAG;AACxB,UAAI,eAAe,IAAI;AACrB,WAAG,MAAM,SAAS,eAAe;AAAA,MACnC,OAAO;AACL,WAAG,MAAM,SAAS;AAAA,MACpB;AAAA,IACF;AACA,aAAS,QAAQ;AACf,UAAI,MAAM,WAAW;AACnB,YAAI,MAAM,SAAS,cAAc,SAAS,OAAO;AAC/C,mBAAS,MAAM,MAAK;AAAA,QACtB,WAAW,MAAM,OAAO;AACtB,gBAAM,MAAM,MAAK;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AACAC,QAAAA,MAAM,MAAM,MAAM,OAAO,MAAM;AAC7B,UAAI,MAAM,SAAS,YAAY;AAC7BC,YAAAA,SAAS,MAAM;AAAA,MACjB;AAAA,IACF,CAAC;AACDD,QAAAA,MAAM,MAAM,MAAM,WAAW,CAAC,WAAW;AACvC,UAAI,QAAQ;AACVC,YAAAA,SAAS,KAAK;AAAA,MAChB;AAAA,IACF,CAAC;AACDC,QAAAA,UAAU,MAAM;AACdD,UAAAA,SAAS,KAAK;AACdA,UAAAA,SAAS,MAAM;AAAA,IACjB,CAAC;AACD,UAAM,OAAOF,IAAAA,IAAI,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.vue.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|