@ozdao/martyrs 0.2.492 → 0.2.493
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 +52 -45
- package/dist/builder.js +53 -46
- 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.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
package/dist/globals.server.cjs
CHANGED
|
@@ -1,7 +1,326 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
3
|
const abac = require("./abac-6LjoG9u-.cjs");
|
|
4
|
-
const
|
|
4
|
+
const cookie = require("cookie");
|
|
5
|
+
const jwt = require("jsonwebtoken");
|
|
6
|
+
const uWS = require("uWebSockets.js");
|
|
7
|
+
function _interopNamespaceDefault(e) {
|
|
8
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
9
|
+
if (e) {
|
|
10
|
+
for (const k in e) {
|
|
11
|
+
if (k !== "default") {
|
|
12
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
13
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: () => e[k]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
n.default = e;
|
|
21
|
+
return Object.freeze(n);
|
|
22
|
+
}
|
|
23
|
+
const cookie__namespace = /* @__PURE__ */ _interopNamespaceDefault(cookie);
|
|
24
|
+
class WebSocketManager {
|
|
25
|
+
constructor() {
|
|
26
|
+
this.app = uWS.App();
|
|
27
|
+
this.modules = /* @__PURE__ */ new Map();
|
|
28
|
+
this.userConnections = /* @__PURE__ */ new Map();
|
|
29
|
+
this.rpcMethods = /* @__PURE__ */ new Map();
|
|
30
|
+
this.app.ws("/api/ws", {
|
|
31
|
+
maxPayloadLength: 16 * 1024 * 1024,
|
|
32
|
+
idleTimeout: 120,
|
|
33
|
+
compression: uWS.SHARED_COMPRESSOR,
|
|
34
|
+
maxBackpressure: 1024 * 1024,
|
|
35
|
+
// Обработчик аутентификации и апгрейда соединения
|
|
36
|
+
upgrade: (res, req, context) => {
|
|
37
|
+
let userId = null;
|
|
38
|
+
const headers = {};
|
|
39
|
+
req.forEach((key, value) => {
|
|
40
|
+
headers[key.toLowerCase()] = value;
|
|
41
|
+
});
|
|
42
|
+
const secWebSocketKey = headers["sec-websocket-key"] || "";
|
|
43
|
+
const secWebSocketProtocol = headers["sec-websocket-protocol"] || "";
|
|
44
|
+
const secWebSocketExtensions = headers["sec-websocket-extensions"] || "";
|
|
45
|
+
try {
|
|
46
|
+
if (headers.cookie) {
|
|
47
|
+
const cookies = cookie__namespace.parse(headers.cookie);
|
|
48
|
+
if (cookies.user) {
|
|
49
|
+
const token = JSON.parse(decodeURIComponent(cookies.user));
|
|
50
|
+
const decoded = jwt.verify(token.accessToken, process.env.SECRET_KEY);
|
|
51
|
+
userId = decoded._id;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
} catch (err) {
|
|
55
|
+
console.error("Invalid token:", err);
|
|
56
|
+
}
|
|
57
|
+
if (process.env.REQUIRE_AUTH === "true" && !userId) {
|
|
58
|
+
res.writeStatus("401 Unauthorized").end("Authentication required");
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const userData = { userId };
|
|
62
|
+
res.upgrade(userData, secWebSocketKey, secWebSocketProtocol, secWebSocketExtensions, context);
|
|
63
|
+
},
|
|
64
|
+
// Обработчик открытия соединения
|
|
65
|
+
open: (ws) => {
|
|
66
|
+
ws.userId = ws.getUserData().userId;
|
|
67
|
+
ws.subscriptions = /* @__PURE__ */ new Set();
|
|
68
|
+
if (ws.userId) {
|
|
69
|
+
this._trackUserConnection(ws.userId, ws);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
// Обработчик входящих сообщений
|
|
73
|
+
message: async (ws, message, isBinary) => {
|
|
74
|
+
if (!isBinary) {
|
|
75
|
+
try {
|
|
76
|
+
const msgStr = new TextDecoder().decode(message);
|
|
77
|
+
const msg = JSON.parse(msgStr);
|
|
78
|
+
if (msg.type === "subscribe" && msg.module && this.modules.has(msg.module)) {
|
|
79
|
+
ws.subscriptions.add(msg.module);
|
|
80
|
+
return;
|
|
81
|
+
} else if (msg.type === "unsubscribe" && msg.module) {
|
|
82
|
+
ws.subscriptions.delete(msg.module);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (msg.type === "rpc") {
|
|
86
|
+
await this._handleRpcCall(ws, msg);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const moduleName = msg.module;
|
|
90
|
+
if (moduleName && this.modules.has(moduleName)) {
|
|
91
|
+
const handler = this.modules.get(moduleName);
|
|
92
|
+
Promise.resolve(handler(ws, msg)).catch((err) => {
|
|
93
|
+
console.error(`Error in handler for module ${moduleName}:`, err);
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
} catch (err) {
|
|
97
|
+
console.error("Invalid message or handler error:", err);
|
|
98
|
+
if (err instanceof Error) {
|
|
99
|
+
try {
|
|
100
|
+
ws.send(
|
|
101
|
+
JSON.stringify({
|
|
102
|
+
type: "error",
|
|
103
|
+
error: {
|
|
104
|
+
message: err.message,
|
|
105
|
+
code: err.code || "INTERNAL_ERROR"
|
|
106
|
+
}
|
|
107
|
+
}),
|
|
108
|
+
false
|
|
109
|
+
);
|
|
110
|
+
} catch (sendErr) {
|
|
111
|
+
console.error("Error sending error response:", sendErr);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
// Обработчик закрытия соединения
|
|
118
|
+
close: (ws, code, message) => {
|
|
119
|
+
const userId = ws.userId;
|
|
120
|
+
if (userId && this.userConnections.has(userId)) {
|
|
121
|
+
this.userConnections.get(userId).delete(ws);
|
|
122
|
+
if (this.userConnections.get(userId).size === 0) {
|
|
123
|
+
this.userConnections.delete(userId);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (ws.subscriptions && typeof ws.subscriptions.clear === "function") {
|
|
127
|
+
ws.subscriptions.clear();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
this.listenSocket = null;
|
|
132
|
+
}
|
|
133
|
+
// Метод для запуска сервера
|
|
134
|
+
listen(port, callback) {
|
|
135
|
+
this.app.listen(port, (listenSocket) => {
|
|
136
|
+
if (listenSocket) {
|
|
137
|
+
this.listenSocket = listenSocket;
|
|
138
|
+
if (callback) callback(null, this.app);
|
|
139
|
+
} else {
|
|
140
|
+
if (callback) callback(new Error("Failed to listen"), null);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
return this;
|
|
144
|
+
}
|
|
145
|
+
_trackUserConnection(userId, ws) {
|
|
146
|
+
if (!this.userConnections.has(userId)) {
|
|
147
|
+
this.userConnections.set(userId, /* @__PURE__ */ new Set());
|
|
148
|
+
}
|
|
149
|
+
this.userConnections.get(userId).add(ws);
|
|
150
|
+
}
|
|
151
|
+
registerModule(moduleName, handler) {
|
|
152
|
+
this.modules.set(moduleName, handler);
|
|
153
|
+
}
|
|
154
|
+
// Добавляем методы для регистрации RPC
|
|
155
|
+
registerRpcMethod(moduleName, methodName, handler, options = {}) {
|
|
156
|
+
const fullMethodName = `${moduleName}.${methodName}`;
|
|
157
|
+
if (!this.rpcMethods.has(moduleName)) {
|
|
158
|
+
this.rpcMethods.set(moduleName, /* @__PURE__ */ new Map());
|
|
159
|
+
}
|
|
160
|
+
this.rpcMethods.get(moduleName).set(methodName, {
|
|
161
|
+
handler,
|
|
162
|
+
options: {
|
|
163
|
+
requireAuth: options.requireAuth !== false,
|
|
164
|
+
// По умолчанию true
|
|
165
|
+
validateParams: options.validateParams || null,
|
|
166
|
+
rateLimit: options.rateLimit || null,
|
|
167
|
+
...options
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
console.log(`RPC method registered: ${fullMethodName}`);
|
|
171
|
+
return this;
|
|
172
|
+
}
|
|
173
|
+
// Метод для регистрации группы RPC методов из модуля
|
|
174
|
+
registerRpcMethods(moduleName, methodsMap) {
|
|
175
|
+
for (const [methodName, config] of Object.entries(methodsMap)) {
|
|
176
|
+
const handler = typeof config === "function" ? config : config.handler;
|
|
177
|
+
const options = typeof config === "function" ? {} : config.options || {};
|
|
178
|
+
this.registerRpcMethod(moduleName, methodName, handler, options);
|
|
179
|
+
}
|
|
180
|
+
return this;
|
|
181
|
+
}
|
|
182
|
+
// Обработчик RPC вызовов
|
|
183
|
+
async _handleRpcCall(ws, message) {
|
|
184
|
+
const { module: module2, method, params, id } = message;
|
|
185
|
+
if (!this.rpcMethods.has(module2) || !this.rpcMethods.get(module2).has(method)) {
|
|
186
|
+
this._sendRpcResponse(ws, id, null, {
|
|
187
|
+
code: -32601,
|
|
188
|
+
message: `Method ${module2}.${method} not found`
|
|
189
|
+
});
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const { handler, options } = this.rpcMethods.get(module2).get(method);
|
|
193
|
+
if (options.requireAuth && !ws.userId) {
|
|
194
|
+
this._sendRpcResponse(ws, id, null, {
|
|
195
|
+
code: -32e3,
|
|
196
|
+
message: "Authentication required"
|
|
197
|
+
});
|
|
198
|
+
return;
|
|
199
|
+
}
|
|
200
|
+
if (options.validateParams && !options.validateParams(params)) {
|
|
201
|
+
this._sendRpcResponse(ws, id, null, {
|
|
202
|
+
code: -32602,
|
|
203
|
+
message: "Invalid params"
|
|
204
|
+
});
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
try {
|
|
208
|
+
const context = {
|
|
209
|
+
userId: ws.userId,
|
|
210
|
+
ws,
|
|
211
|
+
sendResponse: (result2) => this._sendRpcResponse(ws, id, result2),
|
|
212
|
+
sendError: (error) => this._sendRpcResponse(ws, id, null, error)
|
|
213
|
+
};
|
|
214
|
+
const result = await handler.call(context, params, context);
|
|
215
|
+
if (!context.responseSent) {
|
|
216
|
+
this._sendRpcResponse(ws, id, result);
|
|
217
|
+
}
|
|
218
|
+
} catch (error) {
|
|
219
|
+
console.error(`Error executing RPC method ${module2}.${method}:`, error);
|
|
220
|
+
this._sendRpcResponse(ws, id, null, {
|
|
221
|
+
code: -32603,
|
|
222
|
+
message: error.message || "Internal error"
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
// Отправка ответа на RPC запрос
|
|
227
|
+
_sendRpcResponse(ws, id, result, error = null) {
|
|
228
|
+
if (ws.context?.responseSent) return;
|
|
229
|
+
if (ws.context) ws.context.responseSent = true;
|
|
230
|
+
const response = {
|
|
231
|
+
type: "rpc_response",
|
|
232
|
+
id
|
|
233
|
+
};
|
|
234
|
+
if (error) {
|
|
235
|
+
response.error = {
|
|
236
|
+
code: error.code || -32603,
|
|
237
|
+
message: error.message || "Internal error",
|
|
238
|
+
data: error.data
|
|
239
|
+
};
|
|
240
|
+
} else {
|
|
241
|
+
response.result = result;
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
ws.send(JSON.stringify(response), false);
|
|
245
|
+
} catch (err) {
|
|
246
|
+
console.error("Error sending RPC response:", err);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
sendToUserInModule(moduleName, userId, data) {
|
|
250
|
+
const userIdStr = userId.toString();
|
|
251
|
+
const sockets = this.userConnections.get(userIdStr);
|
|
252
|
+
if (!sockets) {
|
|
253
|
+
console.log(`No sockets found for user ${userIdStr}`);
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
let sent = false;
|
|
257
|
+
const message = JSON.stringify(data);
|
|
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
|
+
console.warn("WebSocket backpressure exceeded for user:", userIdStr);
|
|
264
|
+
} else {
|
|
265
|
+
sent = true;
|
|
266
|
+
}
|
|
267
|
+
} catch (err) {
|
|
268
|
+
console.warn("Failed to send message to user:", userIdStr, err);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return sent;
|
|
273
|
+
}
|
|
274
|
+
broadcastToModule(moduleName, data) {
|
|
275
|
+
const message = JSON.stringify(data);
|
|
276
|
+
let failedSends = 0;
|
|
277
|
+
for (const sockets of this.userConnections.values()) {
|
|
278
|
+
for (const ws of sockets) {
|
|
279
|
+
if (ws.subscriptions.has(moduleName)) {
|
|
280
|
+
try {
|
|
281
|
+
const ok = ws.send(message, false);
|
|
282
|
+
if (!ok) {
|
|
283
|
+
failedSends++;
|
|
284
|
+
}
|
|
285
|
+
} catch (err) {
|
|
286
|
+
failedSends++;
|
|
287
|
+
console.warn("Failed to broadcast message:", err);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (failedSends > 0) {
|
|
293
|
+
console.warn(`Failed to send broadcast to ${failedSends} connections due to backpressure or closed sockets`);
|
|
294
|
+
}
|
|
295
|
+
return true;
|
|
296
|
+
}
|
|
297
|
+
broadcastToModuleWithFilter(moduleName, filterFn, data) {
|
|
298
|
+
const message = JSON.stringify(data);
|
|
299
|
+
let failedSends = 0;
|
|
300
|
+
for (const sockets of this.userConnections.values()) {
|
|
301
|
+
for (const ws of sockets) {
|
|
302
|
+
if (!ws.subscriptions.has(moduleName)) continue;
|
|
303
|
+
if (!filterFn(ws)) continue;
|
|
304
|
+
try {
|
|
305
|
+
const ok = ws.send(message, false);
|
|
306
|
+
if (!ok) {
|
|
307
|
+
failedSends++;
|
|
308
|
+
}
|
|
309
|
+
} catch (err) {
|
|
310
|
+
failedSends++;
|
|
311
|
+
console.warn("Failed to send filtered broadcast:", err);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (failedSends > 0) {
|
|
316
|
+
console.warn(`Failed to send filtered broadcast to ${failedSends} connections due to backpressure or closed sockets`);
|
|
317
|
+
}
|
|
318
|
+
return true;
|
|
319
|
+
}
|
|
320
|
+
getServer() {
|
|
321
|
+
return this.app;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
5
324
|
const initGlobalsPolicies = function initializeDefaultPolicies(abacAccessControl) {
|
|
6
325
|
abacAccessControl.registerGlobalPolicy("AdminModeratorAccessPolicy", async (context) => {
|
|
7
326
|
const { user, req } = context;
|
|
@@ -120,8 +439,8 @@ function initializeGlobals(app, db, origins, publicPath) {
|
|
|
120
439
|
}
|
|
121
440
|
const globals_server = {
|
|
122
441
|
initialize: initializeGlobals,
|
|
123
|
-
WebSocketManager
|
|
442
|
+
WebSocketManager
|
|
124
443
|
};
|
|
125
|
-
exports.WebSocketManager =
|
|
444
|
+
exports.WebSocketManager = WebSocketManager;
|
|
126
445
|
exports.default = globals_server;
|
|
127
446
|
exports.initialize = initializeGlobals;
|
package/dist/globals.server.js
CHANGED
|
@@ -1,5 +1,307 @@
|
|
|
1
1
|
import { A as ABAC } from "./abac-Cf_9lCSh.js";
|
|
2
|
-
import
|
|
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
|
+
}
|
|
3
305
|
const initGlobalsPolicies = function initializeDefaultPolicies(abacAccessControl) {
|
|
4
306
|
abacAccessControl.registerGlobalPolicy("AdminModeratorAccessPolicy", async (context) => {
|
|
5
307
|
const { user, req } = context;
|
|
@@ -78,7 +78,14 @@ class Validator {
|
|
|
78
78
|
boolean(message) {
|
|
79
79
|
this.rules.push({
|
|
80
80
|
type: "boolean",
|
|
81
|
-
check: (value) =>
|
|
81
|
+
check: (value) => {
|
|
82
|
+
if (typeof value === "boolean") return true;
|
|
83
|
+
if (typeof value === "string") {
|
|
84
|
+
const lowered = value.toLowerCase();
|
|
85
|
+
return lowered === "true" || lowered === "false";
|
|
86
|
+
}
|
|
87
|
+
return false;
|
|
88
|
+
},
|
|
82
89
|
message
|
|
83
90
|
});
|
|
84
91
|
return this;
|
|
@@ -77,7 +77,14 @@ class Validator {
|
|
|
77
77
|
boolean(message) {
|
|
78
78
|
this.rules.push({
|
|
79
79
|
type: "boolean",
|
|
80
|
-
check: (value) =>
|
|
80
|
+
check: (value) => {
|
|
81
|
+
if (typeof value === "boolean") return true;
|
|
82
|
+
if (typeof value === "string") {
|
|
83
|
+
const lowered = value.toLowerCase();
|
|
84
|
+
return lowered === "true" || lowered === "false";
|
|
85
|
+
}
|
|
86
|
+
return false;
|
|
87
|
+
},
|
|
81
88
|
message
|
|
82
89
|
});
|
|
83
90
|
return this;
|
|
@@ -6,8 +6,8 @@ const globals_abac = require("./globals.abac-CPXLas7N.cjs");
|
|
|
6
6
|
const globals_logger = require("./globals.logger-CZMgIMlM.cjs");
|
|
7
7
|
const globals_observer = require("./globals.observer-CV2wCzzh.cjs");
|
|
8
8
|
const queryProcessor = require("./queryProcessor-B_X680wC.cjs");
|
|
9
|
-
const globals_verifier = require("./globals.verifier-
|
|
10
|
-
const crud = require("./crud-
|
|
9
|
+
const globals_verifier = require("./globals.verifier-C0zj_LLo.cjs");
|
|
10
|
+
const crud = require("./crud-JN_LFj01.cjs");
|
|
11
11
|
const abac = require("./abac-6LjoG9u-.cjs");
|
|
12
12
|
const StockAdjustmentModel = (db) => {
|
|
13
13
|
const StockAdjustmentSchema = new db.mongoose.Schema({
|
package/dist/inventory.server.js
CHANGED
|
@@ -4,8 +4,8 @@ import { g as globalsabac } from "./globals.abac-DNdtSYop.js";
|
|
|
4
4
|
import { C as Cache, L as Logger } from "./globals.logger-Bf6rRU7j.js";
|
|
5
5
|
import { O as Observer } from "./globals.observer-CDqUjVU5.js";
|
|
6
6
|
import { q as queryProcessorGlobals } from "./queryProcessor-CVcLPEnv.js";
|
|
7
|
-
import { a as Validator, V as Verifier } from "./globals.verifier-
|
|
8
|
-
import { C as CRUD } from "./crud-
|
|
7
|
+
import { a as Validator, V as Verifier } from "./globals.verifier-DFqKQ7hK.js";
|
|
8
|
+
import { C as CRUD } from "./crud-sE7GLPbj.js";
|
|
9
9
|
import { A as ABAC } from "./abac-Cf_9lCSh.js";
|
|
10
10
|
const StockAdjustmentModel = (db) => {
|
|
11
11
|
const StockAdjustmentSchema = new db.mongoose.Schema({
|