quickblox-react-ui-kit 0.1.0
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/.prettierignore +4 -0
- package/.prettierrc +8 -0
- package/LICENSE.md +19 -0
- package/README.md +255 -0
- package/dist/App.d.ts +4 -0
- package/dist/CommonTypes/FunctionResult.d.ts +4 -0
- package/dist/Data/Stubs.d.ts +29 -0
- package/dist/Data/dto/dialog/LocalDialogDTO.d.ts +16 -0
- package/dist/Data/dto/dialog/LocalDialogsDTO.d.ts +9 -0
- package/dist/Data/dto/dialog/RemoteDialogDTO.d.ts +18 -0
- package/dist/Data/dto/dialog/RemoteDialogsDTO.d.ts +9 -0
- package/dist/Data/dto/file/LocalFileDTO.d.ts +10 -0
- package/dist/Data/dto/file/RemoteFileDTO.d.ts +10 -0
- package/dist/Data/dto/message/LocalMessageDTO.d.ts +20 -0
- package/dist/Data/dto/message/LocalMessagesDTO.d.ts +9 -0
- package/dist/Data/dto/message/RemoteMessageDTO.d.ts +20 -0
- package/dist/Data/dto/message/RemoteMessagesDTO.d.ts +9 -0
- package/dist/Data/dto/user/LocalUserDTO.d.ts +14 -0
- package/dist/Data/dto/user/LocalUsersDTO.d.ts +9 -0
- package/dist/Data/dto/user/RemoteUserDTO.d.ts +14 -0
- package/dist/Data/dto/user/RemoteUsersDTO.d.ts +9 -0
- package/dist/Data/mapper/DialogLocalDTOMapper.d.ts +17 -0
- package/dist/Data/mapper/DialogRemoteDTOMapper.d.ts +18 -0
- package/dist/Data/mapper/FileLocalDTOMapper.d.ts +8 -0
- package/dist/Data/mapper/FileRemoteDTOMapper.d.ts +8 -0
- package/dist/Data/mapper/IMapper.d.ts +4 -0
- package/dist/Data/mapper/MessageLocalDTOMapper.d.ts +8 -0
- package/dist/Data/mapper/MessageRemoteDTOMapper.d.ts +8 -0
- package/dist/Data/mapper/UserLocalDTOMapper.d.ts +9 -0
- package/dist/Data/mapper/UserRemoteDTOMapper.d.ts +9 -0
- package/dist/Data/repository/ConnectionRepository.d.ts +15 -0
- package/dist/Data/repository/DialogsRepository.d.ts +28 -0
- package/dist/Data/repository/EventMessagesRepository.d.ts +35 -0
- package/dist/Data/repository/FileRepository.d.ts +14 -0
- package/dist/Data/repository/MessagesRepository.d.ts +24 -0
- package/dist/Data/repository/UsersRepository.d.ts +18 -0
- package/dist/Data/source/exception/LocalDataSourceException.d.ts +10 -0
- package/dist/Data/source/exception/MapperDTOException.d.ts +9 -0
- package/dist/Data/source/exception/RemoteDataSourceException.d.ts +15 -0
- package/dist/Data/source/exception/RepositoryException.d.ts +15 -0
- package/dist/Data/source/local/ChatLocalStorageDataSource.d.ts +8 -0
- package/dist/Data/source/local/ILocalDataSource.d.ts +25 -0
- package/dist/Data/source/local/ILocalFileDataSource.d.ts +7 -0
- package/dist/Data/source/local/LocalDataSource.d.ts +28 -0
- package/dist/Data/source/local/LocalFileDataSource.d.ts +8 -0
- package/dist/Data/source/remote/IRemoteDataSource.d.ts +36 -0
- package/dist/Data/source/remote/Mapper/DialogDTOMapper.d.ts +7 -0
- package/dist/Data/source/remote/Mapper/FileDTOMapper.d.ts +7 -0
- package/dist/Data/source/remote/Mapper/IDTOMapper.d.ts +4 -0
- package/dist/Data/source/remote/Mapper/MessageDTOMapper.d.ts +9 -0
- package/dist/Data/source/remote/Mapper/UserDTOMapper.d.ts +7 -0
- package/dist/Data/source/remote/RemoteDataSource.d.ts +81 -0
- package/dist/Domain/entity/Chat.d.ts +4 -0
- package/dist/Domain/entity/ChatMessageAttachmentEntity.d.ts +14 -0
- package/dist/Domain/entity/CustomDataEntity.d.ts +3 -0
- package/dist/Domain/entity/DialogEntity.d.ts +13 -0
- package/dist/Domain/entity/DialogEventInfo.d.ts +14 -0
- package/dist/Domain/entity/DialogTypes.d.ts +5 -0
- package/dist/Domain/entity/EventMessageType.d.ts +5 -0
- package/dist/Domain/entity/FileEntity.d.ts +10 -0
- package/dist/Domain/entity/FileTypes.d.ts +6 -0
- package/dist/Domain/entity/GroupDialogEntity.d.ts +19 -0
- package/dist/Domain/entity/LastMessageEntity.d.ts +5 -0
- package/dist/Domain/entity/MessageEntity.d.ts +21 -0
- package/dist/Domain/entity/NotificationTypes.d.ts +5 -0
- package/dist/Domain/entity/PrivateDialogEntity.d.ts +16 -0
- package/dist/Domain/entity/PublicDialogEntity.d.ts +18 -0
- package/dist/Domain/entity/UserEntity.d.ts +12 -0
- package/dist/Domain/exception/domain/DomainExecption.d.ts +4 -0
- package/dist/Domain/repository/IDialogsRepository.d.ts +20 -0
- package/dist/Domain/repository/IFileRepository.d.ts +6 -0
- package/dist/Domain/repository/IMessagesRepository.d.ts +15 -0
- package/dist/Domain/repository/IUsersRepository.d.ts +8 -0
- package/dist/Domain/repository/Pagination.d.ts +16 -0
- package/dist/Domain/use_cases/CreateDialogUseCase.d.ts +12 -0
- package/dist/Domain/use_cases/GetAllDialogsUseCase.d.ts +8 -0
- package/dist/Domain/use_cases/GetAllDialogsUseCaseWithMock.d.ts +10 -0
- package/dist/Domain/use_cases/GetAllMessagesForDialog.d.ts +11 -0
- package/dist/Domain/use_cases/GetAllUsersUseCase.d.ts +11 -0
- package/dist/Domain/use_cases/GetDialogByIdUseCase.d.ts +9 -0
- package/dist/Domain/use_cases/GetUsersByIdsUseCase.d.ts +9 -0
- package/dist/Domain/use_cases/LeaveDialogUseCase.d.ts +18 -0
- package/dist/Domain/use_cases/RemoveUsersFromTheDialogUseCase.d.ts +12 -0
- package/dist/Domain/use_cases/SendTextMessageUseCase.d.ts +9 -0
- package/dist/Domain/use_cases/SubscribeToDialogEventsUseCase.d.ts +16 -0
- package/dist/Domain/use_cases/SubscribeToDialogsUpdatesUseCase.d.ts +11 -0
- package/dist/Domain/use_cases/SubscribeToDialogsUpdatesUseCaseWithMock.d.ts +11 -0
- package/dist/Domain/use_cases/SyncDialogsUseCase.d.ts +23 -0
- package/dist/Domain/use_cases/UpdateDialogUseCase.d.ts +12 -0
- package/dist/Domain/use_cases/UploadFileUseCase.d.ts +9 -0
- package/dist/Domain/use_cases/UserTypingMessageUseCase.d.ts +13 -0
- package/dist/Domain/use_cases/base/BaseUseCase.d.ts +5 -0
- package/dist/Domain/use_cases/base/IUseCase.d.ts +5 -0
- package/dist/Domain/use_cases/base/Subscribable/ISubscribable.d.ts +5 -0
- package/dist/Domain/use_cases/base/Subscribable/SubscriptionPerformer.d.ts +24 -0
- package/dist/MyButton/MyButton.d.ts +9 -0
- package/dist/MyInput/MyInput.d.ts +10 -0
- package/dist/Presentation/Views/Base/BaseViewModel.d.ts +23 -0
- package/dist/Presentation/Views/CreateDialogFlow/CreateNewDialogFlow.d.ts +7 -0
- package/dist/Presentation/Views/Dialogs/DialogViewModel.d.ts +16 -0
- package/dist/Presentation/Views/Dialogs/Dialogs.d.ts +20 -0
- package/dist/Presentation/Views/Dialogs/useDialogsViewModel.d.ts +2 -0
- package/dist/Presentation/Views/Dialogs/useDialogsViewModelWithMockUseCase.d.ts +4 -0
- package/dist/Presentation/assets/DarkTheme.d.ts +21 -0
- package/dist/Presentation/assets/LightTheme.d.ts +21 -0
- package/dist/Presentation/assets/Theme.d.ts +20 -0
- package/dist/Presentation/assets/ThemeScheme.d.ts +43 -0
- package/dist/Presentation/components/Button.d.ts +4 -0
- package/dist/Presentation/components/Navbar.d.ts +2 -0
- package/dist/Presentation/components/TextInput.d.ts +1 -0
- package/dist/Presentation/components/UI/ DefaultThemes/CustomTheme.d.ts +6 -0
- package/dist/Presentation/components/UI/ DefaultThemes/DefaultTheme.d.ts +21 -0
- package/dist/Presentation/components/UI/Buttons/ActiveButton/ActiveButton.d.ts +9 -0
- package/dist/Presentation/components/UI/Buttons/MainBoundedButton/MainBoundedButton.d.ts +11 -0
- package/dist/Presentation/components/UI/Buttons/MainButton/MainButton.d.ts +21 -0
- package/dist/Presentation/components/UI/Dialogs/CreateDialog/CreateDialog.d.ts +13 -0
- package/dist/Presentation/components/UI/Dialogs/DialogInformation/DialogInformation.d.ts +12 -0
- package/dist/Presentation/components/UI/Dialogs/DialogInformation/DialogMemberButton/DialogMembersButton.d.ts +10 -0
- package/dist/Presentation/components/UI/Dialogs/DialogInformation/UsersList/SingleUser/SingleUser.d.ts +9 -0
- package/dist/Presentation/components/UI/Dialogs/DialogInformation/UsersList/UsersList.d.ts +10 -0
- package/dist/Presentation/components/UI/Dialogs/DialogInformation/UsersList/UsersListViewModel.d.ts +10 -0
- package/dist/Presentation/components/UI/Dialogs/DialogInformation/UsersList/useUsersListViewModel.d.ts +3 -0
- package/dist/Presentation/components/UI/Dialogs/EditDialog/EditDialog.d.ts +19 -0
- package/dist/Presentation/components/UI/Dialogs/EditDialog/UserAvatar/UserAvatar.d.ts +11 -0
- package/dist/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.d.ts +15 -0
- package/dist/Presentation/components/UI/Dialogs/InviteMembers/InviteMembers.d.ts +14 -0
- package/dist/Presentation/components/UI/Dialogs/InviteMembers/InviteMembersViewModel.d.ts +13 -0
- package/dist/Presentation/components/UI/Dialogs/InviteMembers/InviteUsersList/SingleUserWithCheckBox/SingleUserWithCheckBox.d.ts +13 -0
- package/dist/Presentation/components/UI/Dialogs/InviteMembers/InviteUsersResultViewModel.d.ts +6 -0
- package/dist/Presentation/components/UI/Dialogs/InviteMembers/NotFoundContent/NotFoundContent.d.ts +7 -0
- package/dist/Presentation/components/UI/Dialogs/InviteMembers/useInviteMembersViewModel.d.ts +2 -0
- package/dist/Presentation/components/UI/Dialogs/MembersList/MembersList.d.ts +10 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/AudioAttachmentComponent/AudioAttachmentComponent.d.ts +8 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.d.ts +12 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.d.ts +8 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/MessagesView.d.ts +11 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/MessagesViewModel.d.ts +14 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/VideoAttachmentComponent/VideoAttachmentComponent.d.ts +8 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/VoiceRecordingProgress/VoiceRecordingProgress.d.ts +10 -0
- package/dist/Presentation/components/UI/Dialogs/MessagesView/useMessagesViewModelWithMockUseCase.d.ts +4 -0
- package/dist/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.d.ts +34 -0
- package/dist/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialogViewModel.d.ts +11 -0
- package/dist/Presentation/components/UI/Dialogs/YesNoQuestion/YesNoQuestion.d.ts +14 -0
- package/dist/Presentation/components/UI/Elements/SwitchButton/SwitchButton.d.ts +11 -0
- package/dist/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.d.ts +12 -0
- package/dist/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/ActiveSvg/ActiveSvg.d.ts +10 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Add/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/AddContact/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Archive/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Copy/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Delete/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Download/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Edit/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/EditDots/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Emoji/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/ForwardFilled/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Hungup/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/IncomeCall/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Like/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/NewChat/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/OutcomeCall/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Phone/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/PhoneFilled/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Remove/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Remove2/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/ReplyFilled/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Send/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Share/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/SwapCamera/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Unarchive/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/VideoIcon/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Actions/Voice/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Brodcast/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Chat/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/ChatFilled/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Conference/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Contact/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/ContactFilled/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/GroupChat/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Notifications/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/PrivateChat/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/PublicChannel/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/Stream/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/StreamFilled/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Contents/User/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/IconsCommonTypes.d.ts +6 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/Attachment/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/AudioFile/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/BrokenFile/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/Camera/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/GifFile/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/ImageFile/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/ImageFilled/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/LinkWeb/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/Location/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/TextDocument/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Media/VideoFile/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Moderation/Admin/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Moderation/Banned/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Moderation/Freeze/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Moderation/Moderations/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Moderation/Muted/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/ArrowLeft/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/ArrowRight/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Back/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Close/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Down/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Leave/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/More/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Next/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Plus/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Refresh/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Search/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/Settings/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Navigation/SettingsField/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Status/Error/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Status/Help/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Status/Information/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Status/InformationFill/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Status/Loader/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Status/Mention/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Status/Sent/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/CameraOff/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/CameraOn/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/CheckOff/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/CheckOn/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Favourite/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/FavouriteFilled/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/FullScreen/inex.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Hide/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Louder/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/MicOff/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/MicOn/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Minimize/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/NotifyOff/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/NotifyOn/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Pause/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Quite/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Record/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Screenshare/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Show/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/Speaker/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/SpeakerOff/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/StopRecord/index.d.ts +4 -0
- package/dist/Presentation/components/UI/svgs/Icons/Toggle/StopShare/index.d.ts +4 -0
- package/dist/Presentation/components/containers/ColumnContainer/ColumnContainer.d.ts +5 -0
- package/dist/Presentation/components/containers/RowCenterContainer/RowCenterContainer.d.ts +33 -0
- package/dist/Presentation/components/containers/RowLeftContainer/RowLeftContainer.d.ts +33 -0
- package/dist/Presentation/components/containers/RowRightContainer/RowRightContainer.d.ts +33 -0
- package/dist/Presentation/components/containers/ScrollableContainer/ScrollableContainer.d.ts +14 -0
- package/dist/Presentation/components/layouts/Desktop/Desktop.d.ts +4 -0
- package/dist/Presentation/components/layouts/Desktop/DesktopLayoutForMockModels.d.ts +9 -0
- package/dist/Presentation/components/layouts/LayoutCommonTypes.d.ts +6 -0
- package/dist/Presentation/components/layouts/TestStage/LoginView/Login.d.ts +9 -0
- package/dist/Presentation/components/layouts/TestStage/TestStageMarkup.d.ts +4 -0
- package/dist/Presentation/components/layouts/TestStage/TestStageWithMockData/TestStageWithMockData.d.ts +3 -0
- package/dist/Presentation/components/providers/ModalContextProvider/Modal.d.ts +14 -0
- package/dist/Presentation/components/providers/ModalContextProvider/ModalContextProvider.d.ts +4 -0
- package/dist/Presentation/components/providers/ModalContextProvider/useModal.d.ts +11 -0
- package/dist/Presentation/components/providers/ProviderProps.d.ts +4 -0
- package/dist/Presentation/components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.d.ts +41 -0
- package/dist/Presentation/components/providers/QuickBloxUIKitProvider/useEventMessagesRepository.d.ts +3 -0
- package/dist/Presentation/components/providers/QuickBloxUIKitProvider/useQBConnection.d.ts +7 -0
- package/dist/Presentation/components/providers/QuickBloxUIKitProvider/useQbDataContext.d.ts +3 -0
- package/dist/QBconfig.d.ts +29 -0
- package/dist/index-ui.d.ts +25 -0
- package/dist/index-ui.js +2589 -0
- package/dist/index.d.ts +1 -0
- package/dist/qb-api-calls/index.d.ts +59 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/utils/DateTimeFormatter.d.ts +4 -0
- package/dist/utils/parse.d.ts +6 -0
- package/global.d.ts +855 -0
- package/package.json +104 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +47 -0
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +25 -0
- package/public/quickblox.js +54609 -0
- package/public/robots.txt +3 -0
- package/src/App.scss +0 -0
- package/src/App.tsx +230 -0
- package/src/CommonTypes/FunctionResult.ts +4 -0
- package/src/Data/Stubs.ts +1131 -0
- package/src/Data/dto/dialog/LocalDialogDTO.ts +42 -0
- package/src/Data/dto/dialog/LocalDialogsDTO.ts +21 -0
- package/src/Data/dto/dialog/RemoteDialogDTO.ts +58 -0
- package/src/Data/dto/dialog/RemoteDialogsDTO.ts +21 -0
- package/src/Data/dto/file/LocalFileDTO.ts +26 -0
- package/src/Data/dto/file/RemoteFileDTO.ts +26 -0
- package/src/Data/dto/message/LocalMessageDTO.ts +51 -0
- package/src/Data/dto/message/LocalMessagesDTO.ts +21 -0
- package/src/Data/dto/message/RemoteMessageDTO.ts +51 -0
- package/src/Data/dto/message/RemoteMessagesDTO.ts +21 -0
- package/src/Data/dto/user/LocalUserDTO.ts +37 -0
- package/src/Data/dto/user/LocalUsersDTO.ts +23 -0
- package/src/Data/dto/user/RemoteUserDTO.ts +37 -0
- package/src/Data/dto/user/RemoteUsersDTO.ts +21 -0
- package/src/Data/mapper/DialogLocalDTOMapper.ts +742 -0
- package/src/Data/mapper/DialogRemoteDTOMapper.ts +776 -0
- package/src/Data/mapper/FileLocalDTOMapper.ts +253 -0
- package/src/Data/mapper/FileRemoteDTOMapper.ts +265 -0
- package/src/Data/mapper/IMapper.ts +14 -0
- package/src/Data/mapper/MessageLocalDTOMapper.ts +425 -0
- package/src/Data/mapper/MessageRemoteDTOMapper.ts +430 -0
- package/src/Data/mapper/UserLocalDTOMapper.ts +381 -0
- package/src/Data/mapper/UserRemoteDTOMapper.ts +393 -0
- package/src/Data/repository/ConnectionRepository.ts +128 -0
- package/src/Data/repository/DialogsRepository.ts +422 -0
- package/src/Data/repository/EventMessagesRepository.ts +291 -0
- package/src/Data/repository/FileRepository.ts +110 -0
- package/src/Data/repository/MessagesRepository.ts +288 -0
- package/src/Data/repository/UsersRepository.ts +324 -0
- package/src/Data/source/exception/LocalDataSourceException.ts +17 -0
- package/src/Data/source/exception/MapperDTOException.ts +19 -0
- package/src/Data/source/exception/RemoteDataSourceException.ts +28 -0
- package/src/Data/source/exception/RepositoryException.ts +27 -0
- package/src/Data/source/local/ChatLocalStorageDataSource.ts +262 -0
- package/src/Data/source/local/ILocalDataSource.ts +45 -0
- package/src/Data/source/local/ILocalFileDataSource.ts +11 -0
- package/src/Data/source/local/LocalDataSource.ts +377 -0
- package/src/Data/source/local/LocalFileDataSource.ts +22 -0
- package/src/Data/source/remote/IRemoteDataSource.ts +112 -0
- package/src/Data/source/remote/Mapper/DialogDTOMapper.ts +401 -0
- package/src/Data/source/remote/Mapper/FileDTOMapper.ts +276 -0
- package/src/Data/source/remote/Mapper/IDTOMapper.ts +4 -0
- package/src/Data/source/remote/Mapper/MessageDTOMapper.ts +399 -0
- package/src/Data/source/remote/Mapper/UserDTOMapper.ts +344 -0
- package/src/Data/source/remote/RemoteDataSource.ts +1278 -0
- package/src/Domain/entity/Chat.ts +4 -0
- package/src/Domain/entity/ChatMessageAttachmentEntity.ts +15 -0
- package/src/Domain/entity/CustomDataEntity.ts +3 -0
- package/src/Domain/entity/DialogEntity.ts +15 -0
- package/src/Domain/entity/DialogEventInfo.ts +15 -0
- package/src/Domain/entity/DialogTypes.ts +7 -0
- package/src/Domain/entity/EventMessageType.ts +7 -0
- package/src/Domain/entity/FileEntity.ts +11 -0
- package/src/Domain/entity/FileTypes.ts +9 -0
- package/src/Domain/entity/GroupDialogEntity.ts +54 -0
- package/src/Domain/entity/LastMessageEntity.ts +5 -0
- package/src/Domain/entity/MessageEntity.ts +25 -0
- package/src/Domain/entity/NotificationTypes.ts +7 -0
- package/src/Domain/entity/PrivateDialogEntity.ts +46 -0
- package/src/Domain/entity/PublicDialogEntity.ts +72 -0
- package/src/Domain/entity/UserEntity.ts +22 -0
- package/src/Domain/exception/domain/DomainExecption.ts +5 -0
- package/src/Domain/repository/IDialogsRepository.ts +40 -0
- package/src/Domain/repository/IFileRepository.ts +9 -0
- package/src/Domain/repository/IMessagesRepository.ts +28 -0
- package/src/Domain/repository/IUsersRepository.ts +13 -0
- package/src/Domain/repository/Pagination.ts +48 -0
- package/src/Domain/use_cases/CreateDialogUseCase.ts +73 -0
- package/src/Domain/use_cases/GetAllDialogsUseCase.ts +20 -0
- package/src/Domain/use_cases/GetAllDialogsUseCaseWithMock.ts +45 -0
- package/src/Domain/use_cases/GetAllMessagesForDialog.ts +61 -0
- package/src/Domain/use_cases/GetAllUsersUseCase.ts +34 -0
- package/src/Domain/use_cases/GetDialogByIdUseCase.ts +28 -0
- package/src/Domain/use_cases/GetUsersByIdsUseCase.ts +22 -0
- package/src/Domain/use_cases/LeaveDialogUseCase.ts +109 -0
- package/src/Domain/use_cases/RemoveUsersFromTheDialogUseCase.ts +103 -0
- package/src/Domain/use_cases/SendTextMessageUseCase.ts +26 -0
- package/src/Domain/use_cases/SubscribeToDialogEventsUseCase.ts +141 -0
- package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCase.ts +69 -0
- package/src/Domain/use_cases/SubscribeToDialogsUpdatesUseCaseWithMock.ts +61 -0
- package/src/Domain/use_cases/SyncDialogsUseCase.ts +246 -0
- package/src/Domain/use_cases/UpdateDialogUseCase.ts +65 -0
- package/src/Domain/use_cases/UploadFileUseCase.ts +24 -0
- package/src/Domain/use_cases/UserTypingMessageUseCase.ts +51 -0
- package/src/Domain/use_cases/base/BaseUseCase.ts +77 -0
- package/src/Domain/use_cases/base/IUseCase.ts +5 -0
- package/src/Domain/use_cases/base/Subscribable/ISubscribable.ts +6 -0
- package/src/Domain/use_cases/base/Subscribable/SubscriptionPerformer.ts +143 -0
- package/src/MyButton/MyButton.scss +11 -0
- package/src/MyButton/MyButton.tsx +25 -0
- package/src/MyInput/MyInput.scss +9 -0
- package/src/MyInput/MyInput.tsx +36 -0
- package/src/Presentation/.gitkeep +0 -0
- package/src/Presentation/Views/Base/BaseViewModel.ts +66 -0
- package/src/Presentation/Views/CreateDialogFlow/CreateNewDialogFlow.tsx +187 -0
- package/src/Presentation/Views/Dialogs/DialogViewModel.ts +23 -0
- package/src/Presentation/Views/Dialogs/Dialogs.scss +66 -0
- package/src/Presentation/Views/Dialogs/Dialogs.tsx +372 -0
- package/src/Presentation/Views/Dialogs/useDialogsViewModel.ts +136 -0
- package/src/Presentation/Views/Dialogs/useDialogsViewModelWithMockUseCase.ts +345 -0
- package/src/Presentation/Views/Navigation/More.svg +7 -0
- package/src/Presentation/assets/DarkTheme.ts +58 -0
- package/src/Presentation/assets/LightTheme.ts +58 -0
- package/src/Presentation/assets/Theme.ts +143 -0
- package/src/Presentation/assets/ThemeScheme.ts +83 -0
- package/src/Presentation/assets/fonts/.gitkeep +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.eot +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.ttf +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.woff +0 -0
- package/src/Presentation/assets/fonts/Roboto-Bold.woff2 +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.eot +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.ttf +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.woff +0 -0
- package/src/Presentation/assets/fonts/Roboto-Medium.woff2 +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.eot +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.ttf +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.woff +0 -0
- package/src/Presentation/assets/fonts/Roboto-Regular.woff2 +0 -0
- package/src/Presentation/assets/img/Artem_Koltunov_Selfi.png +0 -0
- package/src/Presentation/assets/img/bee-img.png +0 -0
- package/src/Presentation/assets/styles/_fonts.scss +32 -0
- package/src/Presentation/assets/styles/_reset-styles.scss +435 -0
- package/src/Presentation/assets/styles/_theme_colors_scheme.scss +56 -0
- package/src/Presentation/assets/styles/_theme_dark.scss +33 -0
- package/src/Presentation/assets/styles/_theme_light.scss +33 -0
- package/src/Presentation/assets/styles/_variables.scss +2 -0
- package/src/Presentation/components/Button.js +5 -0
- package/src/Presentation/components/Navbar.tsx +45 -0
- package/src/Presentation/components/TextInput.js +10 -0
- package/src/Presentation/components/UI/ DefaultThemes/CustomTheme.ts +13 -0
- package/src/Presentation/components/UI/ DefaultThemes/DefaultTheme.ts +58 -0
- package/src/Presentation/components/UI/Buttons/ActiveButton/ActiveButton.tsx +40 -0
- package/src/Presentation/components/UI/Buttons/MainBoundedButton/MainBoundedButton.scss +0 -0
- package/src/Presentation/components/UI/Buttons/MainBoundedButton/MainBoundedButton.tsx +30 -0
- package/src/Presentation/components/UI/Buttons/MainButton/MainButton.scss +127 -0
- package/src/Presentation/components/UI/Buttons/MainButton/MainButton.tsx +62 -0
- package/src/Presentation/components/UI/Dialogs/CreateDialog/CreateDialog.scss +45 -0
- package/src/Presentation/components/UI/Dialogs/CreateDialog/CreateDialog.tsx +77 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogInformation.scss +429 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogInformation.tsx +646 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogMemberButton/DialogMembersButton.scss +42 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/DialogMemberButton/DialogMembersButton.tsx +26 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/SingleUser/SingleUser.scss +95 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/SingleUser/SingleUser.tsx +42 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/UsersList.scss +60 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/UsersList.tsx +65 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/UsersListViewModel.ts +13 -0
- package/src/Presentation/components/UI/Dialogs/DialogInformation/UsersList/useUsersListViewModel.ts +81 -0
- package/src/Presentation/components/UI/Dialogs/EditDialog/EditDialog.scss +183 -0
- package/src/Presentation/components/UI/Dialogs/EditDialog/EditDialog.tsx +262 -0
- package/src/Presentation/components/UI/Dialogs/EditDialog/UserAvatar/UserAvatar.scss +32 -0
- package/src/Presentation/components/UI/Dialogs/EditDialog/UserAvatar/UserAvatar.tsx +59 -0
- package/src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.scss +67 -0
- package/src/Presentation/components/UI/Dialogs/HeaderDialogs/HeaderDialogs.tsx +112 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteMembers.scss +146 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteMembers.tsx +374 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteMembersViewModel.ts +18 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteUsersList/SingleUserWithCheckBox/SingleUserWithCheckBox.scss +113 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteUsersList/SingleUserWithCheckBox/SingleUserWithCheckBox.tsx +87 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/InviteUsersResultViewModel.ts +12 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/NotFoundContent/NotFoundContent.scss +37 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/NotFoundContent/NotFoundContent.tsx +22 -0
- package/src/Presentation/components/UI/Dialogs/InviteMembers/useInviteMembersViewModel.ts +116 -0
- package/src/Presentation/components/UI/Dialogs/MembersList/MembersList.scss +128 -0
- package/src/Presentation/components/UI/Dialogs/MembersList/MembersList.tsx +89 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AudioAttachmentComponent/AudioAttachmentComponent.scss +7 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/AudioAttachmentComponent/AudioAttachmentComponent.tsx +27 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.scss +133 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/HeaderMessages/HeaderMessages.tsx +137 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.scss +11 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/ImageAttachmentComponent/ImageAttachmentComponent.tsx +25 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.scss +327 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesView.tsx +794 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/MessagesViewModel.ts +20 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/VideoAttachmentComponent/VideoAttachmentComponent.scss +7 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/VideoAttachmentComponent/VideoAttachmentComponent.tsx +33 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/VoiceRecordingProgress/VoiceRecordingProgress.scss +35 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/VoiceRecordingProgress/VoiceRecordingProgress.tsx +86 -0
- package/src/Presentation/components/UI/Dialogs/MessagesView/useMessagesViewModelWithMockUseCase.ts +452 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.scss +100 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialog.tsx +405 -0
- package/src/Presentation/components/UI/Dialogs/PreviewDialog/PreviewDialogViewModel.ts +42 -0
- package/src/Presentation/components/UI/Dialogs/YesNoQuestion/YesNoQuestion.scss +35 -0
- package/src/Presentation/components/UI/Dialogs/YesNoQuestion/YesNoQuestion.tsx +89 -0
- package/src/Presentation/components/UI/Elements/SwitchButton/SwitchButton.scss +61 -0
- package/src/Presentation/components/UI/Elements/SwitchButton/SwitchButton.tsx +48 -0
- package/src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.scss +74 -0
- package/src/Presentation/components/UI/Placeholders/ErrorComponent/ErrorComponent.tsx +72 -0
- package/src/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.scss +21 -0
- package/src/Presentation/components/UI/Placeholders/LoaderComponent/LoaderComponent.tsx +41 -0
- package/src/Presentation/components/UI/svgs/ActiveSvg/ActiveSvg.scss +3 -0
- package/src/Presentation/components/UI/svgs/ActiveSvg/ActiveSvg.tsx +41 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Add/Add.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Add/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/AddContact/Add contact.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/AddContact/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Archive/Archive.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Archive/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Copy/Copy.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Copy/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Delete/Delete.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Delete/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Download/Download.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Download/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Edit/Edit.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Edit/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/EditDots/EditDots.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/EditDots/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Emoji/Emoji.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Emoji/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ForwardFilled/Forward filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ForwardFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Hungup/Hungup.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Hungup/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/IncomeCall/Income call.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/IncomeCall/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Like/Like.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Like/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/NewChat/New chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/NewChat/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/OutcomeCall/Outcome call.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/OutcomeCall/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Phone/Phone.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Phone/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/PhoneFilled/Phone filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/PhoneFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove/Remove.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove2/Remove2.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Remove2/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ReplyFilled/Reply filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/ReplyFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Send/Send.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Send/index.tsx +38 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Share/Share.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Share/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/SwapCamera/Swap camera.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/SwapCamera/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Unarchive/Unarchive.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Unarchive/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/VideoIcon/Video.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/VideoIcon/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Voice/Voice.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Actions/Voice/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Brodcast/Broadcast.svg +7 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Brodcast/index.tsx +38 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Chat/Chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Chat/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ChatFilled/Chat filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ChatFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Conference/Conference.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Conference/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Contact/Contact.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Contact/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ContactFilled/Contact filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/ContactFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/GroupChat/Group chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/GroupChat/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Notifications/Notifications.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Notifications/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PrivateChat/Private chat.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PrivateChat/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PublicChannel/Public channel.svg +7 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/PublicChannel/index.tsx +67 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Stream/Stream.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/Stream/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/StreamFilled/Stream filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/StreamFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/User/User.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Contents/User/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/IconsCommonTypes.ts +6 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Attachment/Attachment.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Attachment/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/AudioFile/Audio file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/AudioFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/BrokenFile/Broken file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/BrokenFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Camera/Camera.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Camera/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/GifFile/GIF file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/GifFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/Image.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageEmpty/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFile/File.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFile/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFilled/Image filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/ImageFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/LinkWeb/Link.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/LinkWeb/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Location/Location.svg +4 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/Location/index.tsx +26 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/TextDocument/Text document.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/TextDocument/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/VideoFile/Video file.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Media/VideoFile/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Admin/Admin.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Admin/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Banned/Banned.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Banned/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Freeze/Freeze.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Freeze/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Moderations/Moderations.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Moderations/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Muted/Muted.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Moderation/Muted/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowLeft/Arrow left.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowLeft/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowRight/Arrow right.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/ArrowRight/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Back/Back.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Back/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Close/Close.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Close/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Down/Down.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Down/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Leave/Leave.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Leave/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/More/More.svg +7 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/More/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Next/Next.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Next/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Plus/Plus.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Plus/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Refresh/Refresh.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Refresh/index.tsx +36 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Search/Search.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Search/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Settings/Settings.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/Settings/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/SettingsField/Settings filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Navigation/SettingsField/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Error/Error.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Error/index.tsx +36 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Help/Help.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Help/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Information/Information.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Information/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/InformationFill/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Loader/Loader.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Loader/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Mention/Mention.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Mention/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Sent/Sent.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/Sent/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/Viewed_Delivered.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Status/ViewedDelivered/index.tsx +38 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOff/Camera off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOn/Camera on.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CameraOn/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOff/Check off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOn/Check on.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/CheckOn/index.tsx +24 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Favourite/Favourite.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Favourite/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FavouriteFilled/Favourite filled.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FavouriteFilled/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FullScreen/Full screen.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/FullScreen/inex.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Hide/Hide.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Hide/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/Play.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/ImagePlay/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Louder/Louder.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Louder/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOff/Mic off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOn/Mic on.svg +4 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/MicOn/index.tsx +26 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Minimize/Minimize.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Minimize/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOff/Notify off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOff/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOn/Notify on.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/NotifyOn/index.tsx +35 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Pause/Pause.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Pause/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Quite/Quite.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Quite/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Record/Record.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Record/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Screenshare/Screenshare.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Screenshare/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Show/Show.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Show/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Speaker/Speaker.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/Speaker/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/SpeakerOff/Speaker off.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/SpeakerOff/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopRecord/Stop record.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopRecord/index.tsx +22 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopShare/Stop share.svg +3 -0
- package/src/Presentation/components/UI/svgs/Icons/Toggle/StopShare/index.tsx +22 -0
- package/src/Presentation/components/containers/ColumnContainer/ColumnContainer.scss +6 -0
- package/src/Presentation/components/containers/ColumnContainer/ColumnContainer.tsx +24 -0
- package/src/Presentation/components/containers/RowCenterContainer/RowCenterContainer.scss +45 -0
- package/src/Presentation/components/containers/RowCenterContainer/RowCenterContainer.tsx +95 -0
- package/src/Presentation/components/containers/RowLeftContainer/RowLeftContainer.scss +45 -0
- package/src/Presentation/components/containers/RowLeftContainer/RowLeftContainer.tsx +97 -0
- package/src/Presentation/components/containers/RowRightContainer/RowRightContainer.scss +46 -0
- package/src/Presentation/components/containers/RowRightContainer/RowRightContainer.tsx +97 -0
- package/src/Presentation/components/containers/ScrollableContainer/ScrollableContainer.scss +46 -0
- package/src/Presentation/components/containers/ScrollableContainer/ScrollableContainer.tsx +85 -0
- package/src/Presentation/components/layouts/Desktop/Desktop.tsx +103 -0
- package/src/Presentation/components/layouts/Desktop/DesktopLayout.scss +31 -0
- package/src/Presentation/components/layouts/Desktop/DesktopLayoutForMockModels.tsx +31 -0
- package/src/Presentation/components/layouts/LayoutCommonTypes.ts +7 -0
- package/src/Presentation/components/layouts/TestStage/LoginView/Login.scss +71 -0
- package/src/Presentation/components/layouts/TestStage/LoginView/Login.tsx +116 -0
- package/src/Presentation/components/layouts/TestStage/TestStageMarkup.scss +24 -0
- package/src/Presentation/components/layouts/TestStage/TestStageMarkup.tsx +1109 -0
- package/src/Presentation/components/layouts/TestStage/TestStageWithMockData/TestStageWithMockData.tsx +209 -0
- package/src/Presentation/components/providers/ModalContextProvider/Modal.scss +71 -0
- package/src/Presentation/components/providers/ModalContextProvider/Modal.tsx +131 -0
- package/src/Presentation/components/providers/ModalContextProvider/ModalContextProvider.tsx +38 -0
- package/src/Presentation/components/providers/ModalContextProvider/useModal.ts +39 -0
- package/src/Presentation/components/providers/ProviderProps.ts +5 -0
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/QuickBloxUIKitProvider.tsx +255 -0
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useEventMessagesRepository.ts +10 -0
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useQBConnection.ts +38 -0
- package/src/Presentation/components/providers/QuickBloxUIKitProvider/useQbDataContext.ts +82 -0
- package/src/QBconfig.ts +41 -0
- package/src/index-ui.ts +60 -0
- package/src/index.scss +74 -0
- package/src/index.tsx +25 -0
- package/src/logo.svg +1 -0
- package/src/qb-api-calls/index.ts +543 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/setupTests.ts +5 -0
- package/src/utils/DateTimeFormatter.ts +35 -0
- package/src/utils/parse.ts +74 -0
- package/tsconfig.json +33 -0
- package/typedoc.json +4 -0
- package/webpack.config.js +56 -0
|
@@ -0,0 +1,776 @@
|
|
|
1
|
+
import { IMapper } from './IMapper';
|
|
2
|
+
import { DialogEntity } from '../../Domain/entity/DialogEntity';
|
|
3
|
+
import { DialogType } from '../../Domain/entity/DialogTypes';
|
|
4
|
+
|
|
5
|
+
import { RemoteDialogDTO } from '../dto/dialog/RemoteDialogDTO';
|
|
6
|
+
import { PublicDialogEntity } from '../../Domain/entity/PublicDialogEntity';
|
|
7
|
+
import { PrivateDialogEntity } from '../../Domain/entity/PrivateDialogEntity';
|
|
8
|
+
import { GroupDialogEntity } from '../../Domain/entity/GroupDialogEntity';
|
|
9
|
+
import {
|
|
10
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
11
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
12
|
+
MapperDTOException,
|
|
13
|
+
UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE,
|
|
14
|
+
UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
15
|
+
} from '../source/exception/MapperDTOException';
|
|
16
|
+
|
|
17
|
+
type DtoValidator<T> = {
|
|
18
|
+
[key in keyof T]: (v: unknown) => v is T[key];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export class DialogRemoteDTOMapper implements IMapper {
|
|
22
|
+
// eslint-disable-next-line class-methods-use-this
|
|
23
|
+
fromEntity<TArg, TResult>(entity: TArg): Promise<TResult> {
|
|
24
|
+
const dialog: RemoteDialogDTO = new RemoteDialogDTO();
|
|
25
|
+
|
|
26
|
+
const dialogEntity: DialogEntity = this.defineType(entity);
|
|
27
|
+
|
|
28
|
+
DialogRemoteDTOMapper.validateEntity(dialogEntity);
|
|
29
|
+
|
|
30
|
+
dialog.id = dialogEntity.id;
|
|
31
|
+
dialog.type = dialogEntity.type;
|
|
32
|
+
|
|
33
|
+
dialog.ownerId = dialogEntity.ownerId;
|
|
34
|
+
|
|
35
|
+
dialog.participantsIds =
|
|
36
|
+
DialogRemoteDTOMapper.getParticipantsIds(dialogEntity);
|
|
37
|
+
|
|
38
|
+
dialog.newParticipantsIds =
|
|
39
|
+
DialogRemoteDTOMapper.getNewParticipantsIds(dialogEntity);
|
|
40
|
+
|
|
41
|
+
if (dialog.participantsIds.length > 0) {
|
|
42
|
+
dialog.participantId = dialog.participantsIds[0].toString();
|
|
43
|
+
} else {
|
|
44
|
+
dialog.participantId =
|
|
45
|
+
DialogRemoteDTOMapper.getParticipantId(dialogEntity);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
dialog.updatedAt = dialogEntity.updatedAt;
|
|
49
|
+
|
|
50
|
+
dialog.lastMessageText = dialogEntity.lastMessage.text;
|
|
51
|
+
|
|
52
|
+
dialog.lastMessageUserId = dialogEntity.lastMessage.userId.toString();
|
|
53
|
+
|
|
54
|
+
dialog.lastMessageDateSent = dialogEntity.lastMessage.dateSent;
|
|
55
|
+
|
|
56
|
+
dialog.unreadMessageCount = dialogEntity.unreadMessageCount;
|
|
57
|
+
|
|
58
|
+
dialog.name = DialogRemoteDTOMapper.getDialogName(dialogEntity);
|
|
59
|
+
|
|
60
|
+
dialog.photo = DialogRemoteDTOMapper.getPhoto(dialogEntity) || '';
|
|
61
|
+
|
|
62
|
+
return Promise.resolve(dialog as TResult);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// eslint-disable-next-line class-methods-use-this
|
|
66
|
+
toEntity<TArg, TResult>(data: TArg): Promise<TResult> {
|
|
67
|
+
const dialog = data as unknown as RemoteDialogDTO;
|
|
68
|
+
|
|
69
|
+
DialogRemoteDTOMapper.validateRemoteDTO(dialog);
|
|
70
|
+
|
|
71
|
+
let entity: DialogEntity = DialogRemoteDTOMapper.createDefaultDialogEntity(
|
|
72
|
+
dialog.ownerId,
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
function formatPhotoUrl() {
|
|
76
|
+
if (dialog.photo && dialog.photo !== 'null') {
|
|
77
|
+
return dialog.photo && QB.content.privateUrl(dialog.photo);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return '';
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
switch (dialog.type) {
|
|
84
|
+
case DialogType.private:
|
|
85
|
+
entity = new PrivateDialogEntity(
|
|
86
|
+
{ todo: '' },
|
|
87
|
+
dialog.id,
|
|
88
|
+
dialog.name,
|
|
89
|
+
{
|
|
90
|
+
dateSent: dialog.lastMessageDateSent
|
|
91
|
+
? dialog.lastMessageDateSent
|
|
92
|
+
: '',
|
|
93
|
+
text: dialog.lastMessageText ? dialog.lastMessageText : '',
|
|
94
|
+
userId: parseInt(dialog.lastMessageUserId, 10),
|
|
95
|
+
},
|
|
96
|
+
dialog.ownerId,
|
|
97
|
+
dialog.type,
|
|
98
|
+
dialog.unreadMessageCount,
|
|
99
|
+
dialog.updatedAt,
|
|
100
|
+
parseInt(dialog.participantId, 10),
|
|
101
|
+
);
|
|
102
|
+
break;
|
|
103
|
+
case DialogType.public:
|
|
104
|
+
entity = new PublicDialogEntity(
|
|
105
|
+
{ todo: '' },
|
|
106
|
+
dialog.id,
|
|
107
|
+
{
|
|
108
|
+
dateSent: dialog.lastMessageDateSent
|
|
109
|
+
? dialog.lastMessageDateSent
|
|
110
|
+
: '',
|
|
111
|
+
text: dialog.lastMessageText ? dialog.lastMessageText : '',
|
|
112
|
+
userId: parseInt(dialog.lastMessageUserId, 10),
|
|
113
|
+
},
|
|
114
|
+
dialog.ownerId,
|
|
115
|
+
dialog.type,
|
|
116
|
+
dialog.unreadMessageCount,
|
|
117
|
+
dialog.updatedAt,
|
|
118
|
+
dialog.name,
|
|
119
|
+
formatPhotoUrl(),
|
|
120
|
+
);
|
|
121
|
+
break;
|
|
122
|
+
case DialogType.group:
|
|
123
|
+
entity = new GroupDialogEntity(
|
|
124
|
+
{ todo: '' },
|
|
125
|
+
dialog.id,
|
|
126
|
+
{
|
|
127
|
+
dateSent: dialog.lastMessageDateSent
|
|
128
|
+
? dialog.lastMessageDateSent
|
|
129
|
+
: '',
|
|
130
|
+
text: dialog.lastMessageText ? dialog.lastMessageText : '',
|
|
131
|
+
userId: parseInt(dialog.lastMessageUserId, 10),
|
|
132
|
+
},
|
|
133
|
+
dialog.ownerId,
|
|
134
|
+
dialog.type,
|
|
135
|
+
dialog.unreadMessageCount,
|
|
136
|
+
dialog.updatedAt,
|
|
137
|
+
dialog.participantsIds,
|
|
138
|
+
dialog.name,
|
|
139
|
+
formatPhotoUrl(),
|
|
140
|
+
);
|
|
141
|
+
break;
|
|
142
|
+
default:
|
|
143
|
+
return Promise.reject(
|
|
144
|
+
new MapperDTOException(
|
|
145
|
+
UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
146
|
+
UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE,
|
|
147
|
+
'undefinded type dialog in DTO',
|
|
148
|
+
),
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return Promise.resolve(entity as unknown as TResult);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
private static getPhoto(entity: unknown): string | null {
|
|
156
|
+
// if (
|
|
157
|
+
// dialogEntity instanceof GroupDialogEntity ||
|
|
158
|
+
// dialogEntity instanceof PublicDialogEntity
|
|
159
|
+
// )
|
|
160
|
+
const dialogEntity = entity as DialogEntity;
|
|
161
|
+
|
|
162
|
+
if (dialogEntity && dialogEntity.type === DialogType.public)
|
|
163
|
+
return (dialogEntity as PublicDialogEntity).photo;
|
|
164
|
+
if (dialogEntity && dialogEntity.type === DialogType.group)
|
|
165
|
+
return (dialogEntity as GroupDialogEntity).photo;
|
|
166
|
+
|
|
167
|
+
return '';
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
private static getDialogName(dialogEntity: unknown): string {
|
|
171
|
+
// if (
|
|
172
|
+
// dialogEntity instanceof GroupDialogEntity ||
|
|
173
|
+
// dialogEntity instanceof PublicDialogEntity ||
|
|
174
|
+
// dialogEntity instanceof PrivateDialogEntity
|
|
175
|
+
// )
|
|
176
|
+
|
|
177
|
+
return (dialogEntity as GroupDialogEntity).name;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
private static getParticipantId(dialogEntity: unknown): string {
|
|
181
|
+
if (dialogEntity instanceof PrivateDialogEntity)
|
|
182
|
+
return dialogEntity.participantId.toString();
|
|
183
|
+
|
|
184
|
+
return '';
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
private static getParticipantsIds(dialogEntity: DialogEntity): Array<number> {
|
|
188
|
+
return PublicDialogEntity.getParticipants(dialogEntity);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
private static getNewParticipantsIds(
|
|
192
|
+
dialogEntity: DialogEntity,
|
|
193
|
+
): Array<number> {
|
|
194
|
+
return PublicDialogEntity.getNewParticipants(dialogEntity);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
public static createDefaultDialogEntity(owner_id: string): DialogEntity {
|
|
198
|
+
return {
|
|
199
|
+
customData: { todo: '' },
|
|
200
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
201
|
+
ownerId: owner_id,
|
|
202
|
+
type: DialogType.public,
|
|
203
|
+
unreadMessageCount: 0,
|
|
204
|
+
updatedAt: '',
|
|
205
|
+
id: '',
|
|
206
|
+
name: '_',
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
private static validateEntity(dialogEntity: DialogEntity) {
|
|
211
|
+
if (dialogEntity instanceof PrivateDialogEntity) {
|
|
212
|
+
return DialogRemoteDTOMapper.validateIsPrivateDialogCorrect(dialogEntity);
|
|
213
|
+
}
|
|
214
|
+
if (dialogEntity instanceof PublicDialogEntity) {
|
|
215
|
+
return DialogRemoteDTOMapper.validateIsPublicDialogCorrect(dialogEntity);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if (dialogEntity instanceof GroupDialogEntity) {
|
|
219
|
+
return DialogRemoteDTOMapper.validateIsGroupDialogCorrect(dialogEntity);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return Promise.resolve();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
private static validateIsPrivateDialogCorrect(
|
|
226
|
+
dialogEntity: DialogEntity | unknown,
|
|
227
|
+
) {
|
|
228
|
+
const privateDialogEntityValidator: DtoValidator<PrivateDialogEntity> = {
|
|
229
|
+
name(v: unknown): v is PrivateDialogEntity['name'] {
|
|
230
|
+
const { name } = v as PrivateDialogEntity;
|
|
231
|
+
|
|
232
|
+
return name !== undefined && name !== null && name.length > 0;
|
|
233
|
+
},
|
|
234
|
+
customData(v: unknown): v is PrivateDialogEntity['customData'] {
|
|
235
|
+
const { customData } = v as PrivateDialogEntity;
|
|
236
|
+
|
|
237
|
+
return customData !== undefined && customData.todo !== undefined;
|
|
238
|
+
},
|
|
239
|
+
id(v: unknown): v is PrivateDialogEntity['id'] {
|
|
240
|
+
const { id } = v as PrivateDialogEntity;
|
|
241
|
+
|
|
242
|
+
return id !== undefined && id !== null;
|
|
243
|
+
},
|
|
244
|
+
lastMessage(v: unknown): v is PrivateDialogEntity['lastMessage'] {
|
|
245
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
246
|
+
const { lastMessage } = v as PrivateDialogEntity;
|
|
247
|
+
|
|
248
|
+
// return (
|
|
249
|
+
// lastMessage !== undefined &&
|
|
250
|
+
// lastMessage !== null &&
|
|
251
|
+
// lastMessage.dateSent !== undefined &&
|
|
252
|
+
// lastMessage.text !== undefined &&
|
|
253
|
+
// lastMessage.userId !== undefined
|
|
254
|
+
// );
|
|
255
|
+
return true;
|
|
256
|
+
},
|
|
257
|
+
ownerId(v: unknown): v is PrivateDialogEntity['ownerId'] {
|
|
258
|
+
const { ownerId } = v as PrivateDialogEntity;
|
|
259
|
+
|
|
260
|
+
return ownerId !== undefined && ownerId !== null;
|
|
261
|
+
},
|
|
262
|
+
participantId(v: unknown): v is PrivateDialogEntity['participantId'] {
|
|
263
|
+
const { participantId } = v as PrivateDialogEntity;
|
|
264
|
+
|
|
265
|
+
return participantId !== undefined && participantId !== null;
|
|
266
|
+
},
|
|
267
|
+
type(v: unknown): v is PrivateDialogEntity['type'] {
|
|
268
|
+
const { type } = v as PrivateDialogEntity;
|
|
269
|
+
|
|
270
|
+
return type !== undefined && type !== null;
|
|
271
|
+
},
|
|
272
|
+
unreadMessageCount(
|
|
273
|
+
v: unknown,
|
|
274
|
+
): v is PrivateDialogEntity['unreadMessageCount'] {
|
|
275
|
+
const { unreadMessageCount } = v as PrivateDialogEntity;
|
|
276
|
+
|
|
277
|
+
return unreadMessageCount !== undefined && unreadMessageCount !== null;
|
|
278
|
+
},
|
|
279
|
+
updatedAt(v: unknown): v is PrivateDialogEntity['updatedAt'] {
|
|
280
|
+
const { updatedAt } = v as PrivateDialogEntity;
|
|
281
|
+
|
|
282
|
+
return updatedAt !== undefined && updatedAt !== null;
|
|
283
|
+
},
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
if (!privateDialogEntityValidator.id(dialogEntity))
|
|
287
|
+
throw new MapperDTOException(
|
|
288
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
289
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
290
|
+
'field {id} does not exist or empty',
|
|
291
|
+
);
|
|
292
|
+
if (!privateDialogEntityValidator.name(dialogEntity))
|
|
293
|
+
throw new MapperDTOException(
|
|
294
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
295
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
296
|
+
'field {name} does not exist or empty',
|
|
297
|
+
);
|
|
298
|
+
if (!privateDialogEntityValidator.customData(dialogEntity))
|
|
299
|
+
throw new MapperDTOException(
|
|
300
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
301
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
302
|
+
'field {customData} does not exist or empty',
|
|
303
|
+
);
|
|
304
|
+
if (!privateDialogEntityValidator.lastMessage(dialogEntity))
|
|
305
|
+
throw new MapperDTOException(
|
|
306
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
307
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
308
|
+
'field {lastMessage} does not exist or empty',
|
|
309
|
+
);
|
|
310
|
+
if (!privateDialogEntityValidator.ownerId(dialogEntity))
|
|
311
|
+
throw new MapperDTOException(
|
|
312
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
313
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
314
|
+
'field {ownerId} does not exist or empty',
|
|
315
|
+
);
|
|
316
|
+
if (!privateDialogEntityValidator.participantId(dialogEntity))
|
|
317
|
+
throw new MapperDTOException(
|
|
318
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
319
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
320
|
+
'field {participantId} does not exist or empty',
|
|
321
|
+
);
|
|
322
|
+
if (!privateDialogEntityValidator.type(dialogEntity))
|
|
323
|
+
throw new MapperDTOException(
|
|
324
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
325
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
326
|
+
'field {type} does not exist or empty',
|
|
327
|
+
);
|
|
328
|
+
if (!privateDialogEntityValidator.unreadMessageCount(dialogEntity))
|
|
329
|
+
throw new MapperDTOException(
|
|
330
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
331
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
332
|
+
'field {unreadMessageCount} does not exist or empty',
|
|
333
|
+
);
|
|
334
|
+
if (!privateDialogEntityValidator.updatedAt(dialogEntity))
|
|
335
|
+
throw new MapperDTOException(
|
|
336
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
337
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
338
|
+
'field {updatedAt} does not exist or empty',
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
private static validateIsPublicDialogCorrect(dialogEntity: DialogEntity) {
|
|
343
|
+
const publicDialogEntityValidator: DtoValidator<PublicDialogEntity> = {
|
|
344
|
+
customData(v: unknown): v is PublicDialogEntity['customData'] {
|
|
345
|
+
const { customData } = v as PublicDialogEntity;
|
|
346
|
+
|
|
347
|
+
return customData !== undefined && customData.todo !== undefined;
|
|
348
|
+
},
|
|
349
|
+
id(v: unknown): v is PublicDialogEntity['id'] {
|
|
350
|
+
const { id } = v as PublicDialogEntity;
|
|
351
|
+
|
|
352
|
+
return id !== undefined && id !== null;
|
|
353
|
+
},
|
|
354
|
+
lastMessage(v: unknown): v is PublicDialogEntity['lastMessage'] {
|
|
355
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
356
|
+
const { lastMessage } = v as PublicDialogEntity;
|
|
357
|
+
|
|
358
|
+
// return (
|
|
359
|
+
// lastMessage !== undefined &&
|
|
360
|
+
// lastMessage !== null &&
|
|
361
|
+
// lastMessage.dateSent !== undefined &&
|
|
362
|
+
// lastMessage.text !== undefined &&
|
|
363
|
+
// lastMessage.userId !== undefined
|
|
364
|
+
// );
|
|
365
|
+
return true;
|
|
366
|
+
},
|
|
367
|
+
ownerId(v: unknown): v is PublicDialogEntity['ownerId'] {
|
|
368
|
+
const { ownerId } = v as PublicDialogEntity;
|
|
369
|
+
|
|
370
|
+
return ownerId !== undefined && ownerId !== null;
|
|
371
|
+
},
|
|
372
|
+
type(v: unknown): v is PublicDialogEntity['type'] {
|
|
373
|
+
const { type } = v as PublicDialogEntity;
|
|
374
|
+
|
|
375
|
+
return type !== undefined && type !== null;
|
|
376
|
+
},
|
|
377
|
+
unreadMessageCount(
|
|
378
|
+
v: unknown,
|
|
379
|
+
): v is PublicDialogEntity['unreadMessageCount'] {
|
|
380
|
+
const { unreadMessageCount } = v as PublicDialogEntity;
|
|
381
|
+
|
|
382
|
+
return unreadMessageCount !== undefined && unreadMessageCount !== null;
|
|
383
|
+
},
|
|
384
|
+
updatedAt(v: unknown): v is PublicDialogEntity['updatedAt'] {
|
|
385
|
+
const { updatedAt } = v as PublicDialogEntity;
|
|
386
|
+
|
|
387
|
+
return updatedAt !== undefined && updatedAt !== null;
|
|
388
|
+
},
|
|
389
|
+
|
|
390
|
+
name(v: unknown): v is PublicDialogEntity['name'] {
|
|
391
|
+
const { name } = v as PublicDialogEntity;
|
|
392
|
+
|
|
393
|
+
return name !== undefined && name !== null;
|
|
394
|
+
},
|
|
395
|
+
|
|
396
|
+
photo(v: unknown): v is PublicDialogEntity['photo'] {
|
|
397
|
+
const { photo } = v as PublicDialogEntity;
|
|
398
|
+
|
|
399
|
+
return photo !== undefined && photo !== null;
|
|
400
|
+
},
|
|
401
|
+
};
|
|
402
|
+
|
|
403
|
+
if (!publicDialogEntityValidator.id(dialogEntity))
|
|
404
|
+
throw new MapperDTOException(
|
|
405
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
406
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
407
|
+
'field {id} does not exist or empty',
|
|
408
|
+
);
|
|
409
|
+
if (!publicDialogEntityValidator.customData(dialogEntity))
|
|
410
|
+
throw new MapperDTOException(
|
|
411
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
412
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
413
|
+
'field {customData} does not exist or empty',
|
|
414
|
+
);
|
|
415
|
+
if (!publicDialogEntityValidator.lastMessage(dialogEntity))
|
|
416
|
+
throw new MapperDTOException(
|
|
417
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
418
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
419
|
+
'field {lastMessage} does not exist or empty',
|
|
420
|
+
);
|
|
421
|
+
if (!publicDialogEntityValidator.ownerId(dialogEntity))
|
|
422
|
+
throw new MapperDTOException(
|
|
423
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
424
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
425
|
+
'field {ownerId} does not exist or empty',
|
|
426
|
+
);
|
|
427
|
+
if (!publicDialogEntityValidator.type(dialogEntity))
|
|
428
|
+
throw new MapperDTOException(
|
|
429
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
430
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
431
|
+
'field {type} does not exist or empty',
|
|
432
|
+
);
|
|
433
|
+
if (!publicDialogEntityValidator.unreadMessageCount(dialogEntity))
|
|
434
|
+
throw new MapperDTOException(
|
|
435
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
436
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
437
|
+
'field {unreadMessageCount} does not exist or empty',
|
|
438
|
+
);
|
|
439
|
+
if (!publicDialogEntityValidator.updatedAt(dialogEntity))
|
|
440
|
+
throw new MapperDTOException(
|
|
441
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
442
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
443
|
+
'field {updatedAt} does not exist or empty',
|
|
444
|
+
);
|
|
445
|
+
if (!publicDialogEntityValidator.name(dialogEntity))
|
|
446
|
+
throw new MapperDTOException(
|
|
447
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
448
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
449
|
+
'field {name} does not exist or empty',
|
|
450
|
+
);
|
|
451
|
+
if (!publicDialogEntityValidator.photo(dialogEntity))
|
|
452
|
+
throw new MapperDTOException(
|
|
453
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
454
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
455
|
+
'field {photo} does not exist or empty',
|
|
456
|
+
);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
private static validateIsGroupDialogCorrect(dialogEntity: DialogEntity) {
|
|
460
|
+
const groupDialogEntityValidator: DtoValidator<GroupDialogEntity> = {
|
|
461
|
+
customData(v: unknown): v is GroupDialogEntity['customData'] {
|
|
462
|
+
const { customData } = v as PublicDialogEntity;
|
|
463
|
+
|
|
464
|
+
return customData !== undefined && customData.todo !== undefined;
|
|
465
|
+
},
|
|
466
|
+
id(v: unknown): v is GroupDialogEntity['id'] {
|
|
467
|
+
const { id } = v as PublicDialogEntity;
|
|
468
|
+
|
|
469
|
+
return id !== undefined && id !== null;
|
|
470
|
+
},
|
|
471
|
+
lastMessage(v: unknown): v is GroupDialogEntity['lastMessage'] {
|
|
472
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
473
|
+
const { lastMessage } = v as PublicDialogEntity;
|
|
474
|
+
|
|
475
|
+
// return (
|
|
476
|
+
// lastMessage !== undefined &&
|
|
477
|
+
// lastMessage !== null &&
|
|
478
|
+
// lastMessage.dateSent !== undefined &&
|
|
479
|
+
// lastMessage.text !== undefined &&
|
|
480
|
+
// lastMessage.userId !== undefined
|
|
481
|
+
// );
|
|
482
|
+
return true;
|
|
483
|
+
},
|
|
484
|
+
ownerId(v: unknown): v is GroupDialogEntity['ownerId'] {
|
|
485
|
+
const { ownerId } = v as PublicDialogEntity;
|
|
486
|
+
|
|
487
|
+
return ownerId !== undefined && ownerId !== null;
|
|
488
|
+
},
|
|
489
|
+
type(v: unknown): v is GroupDialogEntity['type'] {
|
|
490
|
+
const { type } = v as PublicDialogEntity;
|
|
491
|
+
|
|
492
|
+
return type !== undefined && type !== null;
|
|
493
|
+
},
|
|
494
|
+
unreadMessageCount(
|
|
495
|
+
v: unknown,
|
|
496
|
+
): v is GroupDialogEntity['unreadMessageCount'] {
|
|
497
|
+
const { unreadMessageCount } = v as PublicDialogEntity;
|
|
498
|
+
|
|
499
|
+
return unreadMessageCount !== undefined && unreadMessageCount !== null;
|
|
500
|
+
},
|
|
501
|
+
updatedAt(v: unknown): v is GroupDialogEntity['updatedAt'] {
|
|
502
|
+
const { updatedAt } = v as PublicDialogEntity;
|
|
503
|
+
|
|
504
|
+
return updatedAt !== undefined && updatedAt !== null;
|
|
505
|
+
},
|
|
506
|
+
|
|
507
|
+
name(v: unknown): v is GroupDialogEntity['name'] {
|
|
508
|
+
const { name } = v as PublicDialogEntity;
|
|
509
|
+
|
|
510
|
+
return name !== undefined && name !== null;
|
|
511
|
+
},
|
|
512
|
+
|
|
513
|
+
photo(v: unknown): v is GroupDialogEntity['photo'] {
|
|
514
|
+
const { photo } = v as PublicDialogEntity;
|
|
515
|
+
|
|
516
|
+
return photo !== undefined && photo !== null;
|
|
517
|
+
},
|
|
518
|
+
|
|
519
|
+
participantIds(v: unknown): v is GroupDialogEntity['participantIds'] {
|
|
520
|
+
const { participantIds } = v as GroupDialogEntity;
|
|
521
|
+
|
|
522
|
+
return participantIds !== undefined && participantIds !== null;
|
|
523
|
+
},
|
|
524
|
+
};
|
|
525
|
+
|
|
526
|
+
if (!groupDialogEntityValidator.id(dialogEntity))
|
|
527
|
+
throw new MapperDTOException(
|
|
528
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
529
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
530
|
+
'field {id} does not exist or empty',
|
|
531
|
+
);
|
|
532
|
+
if (!groupDialogEntityValidator.customData(dialogEntity))
|
|
533
|
+
throw new MapperDTOException(
|
|
534
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
535
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
536
|
+
'field {customData} does not exist or empty',
|
|
537
|
+
);
|
|
538
|
+
if (!groupDialogEntityValidator.lastMessage(dialogEntity))
|
|
539
|
+
throw new MapperDTOException(
|
|
540
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
541
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
542
|
+
'field {lastMessage} does not exist or empty',
|
|
543
|
+
);
|
|
544
|
+
if (!groupDialogEntityValidator.ownerId(dialogEntity))
|
|
545
|
+
throw new MapperDTOException(
|
|
546
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
547
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
548
|
+
'field {ownerId} does not exist or empty',
|
|
549
|
+
);
|
|
550
|
+
if (!groupDialogEntityValidator.type(dialogEntity))
|
|
551
|
+
throw new MapperDTOException(
|
|
552
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
553
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
554
|
+
'field {type} does not exist or empty',
|
|
555
|
+
);
|
|
556
|
+
if (!groupDialogEntityValidator.unreadMessageCount(dialogEntity))
|
|
557
|
+
throw new MapperDTOException(
|
|
558
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
559
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
560
|
+
'field {unreadMessageCount} does not exist or empty',
|
|
561
|
+
);
|
|
562
|
+
if (!groupDialogEntityValidator.updatedAt(dialogEntity))
|
|
563
|
+
throw new MapperDTOException(
|
|
564
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
565
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
566
|
+
'field {updatedAt} does not exist or empty',
|
|
567
|
+
);
|
|
568
|
+
if (!groupDialogEntityValidator.name(dialogEntity))
|
|
569
|
+
throw new MapperDTOException(
|
|
570
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
571
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
572
|
+
'field {name} does not exist or empty',
|
|
573
|
+
);
|
|
574
|
+
if (!groupDialogEntityValidator.photo(dialogEntity))
|
|
575
|
+
throw new MapperDTOException(
|
|
576
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
577
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
578
|
+
'field {photo} does not exist or empty',
|
|
579
|
+
);
|
|
580
|
+
if (!groupDialogEntityValidator.participantIds(dialogEntity))
|
|
581
|
+
throw new MapperDTOException(
|
|
582
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
583
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
584
|
+
'field {participantIds} does not exist or empty',
|
|
585
|
+
);
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
// eslint-disable-next-line class-methods-use-this
|
|
589
|
+
private defineType(entity: unknown): DialogEntity {
|
|
590
|
+
let dialogEntity: DialogEntity | null = entity as DialogEntity;
|
|
591
|
+
const dialogType = (entity as DialogEntity).type;
|
|
592
|
+
|
|
593
|
+
switch (dialogType) {
|
|
594
|
+
case DialogType.private:
|
|
595
|
+
dialogEntity =
|
|
596
|
+
entity instanceof PrivateDialogEntity
|
|
597
|
+
? (entity as unknown as PrivateDialogEntity)
|
|
598
|
+
: null;
|
|
599
|
+
break;
|
|
600
|
+
case DialogType.public:
|
|
601
|
+
dialogEntity =
|
|
602
|
+
entity instanceof PublicDialogEntity
|
|
603
|
+
? (entity as unknown as PublicDialogEntity)
|
|
604
|
+
: null;
|
|
605
|
+
break;
|
|
606
|
+
case DialogType.group:
|
|
607
|
+
dialogEntity = entity as GroupDialogEntity;
|
|
608
|
+
// entity instanceof GroupDialogEntity
|
|
609
|
+
// ? (entity as unknown as GroupDialogEntity)
|
|
610
|
+
// : null;
|
|
611
|
+
break;
|
|
612
|
+
default:
|
|
613
|
+
dialogEntity = null;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
if (!dialogEntity)
|
|
617
|
+
throw new MapperDTOException(
|
|
618
|
+
UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
619
|
+
UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE,
|
|
620
|
+
'wrong entity type',
|
|
621
|
+
);
|
|
622
|
+
|
|
623
|
+
return dialogEntity;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
private static validateRemoteDTO(data: RemoteDialogDTO) {
|
|
627
|
+
const dtoValidator: DtoValidator<RemoteDialogDTO> = {
|
|
628
|
+
id(v: unknown): v is RemoteDialogDTO['id'] {
|
|
629
|
+
const { id } = v as RemoteDialogDTO;
|
|
630
|
+
|
|
631
|
+
return id !== undefined;
|
|
632
|
+
},
|
|
633
|
+
lastMessageId(v: unknown): v is RemoteDialogDTO['lastMessageId'] {
|
|
634
|
+
const { lastMessageId } = v as RemoteDialogDTO;
|
|
635
|
+
|
|
636
|
+
return lastMessageId !== undefined;
|
|
637
|
+
},
|
|
638
|
+
lastMessageDateSent(
|
|
639
|
+
v: unknown,
|
|
640
|
+
): v is RemoteDialogDTO['lastMessageDateSent'] {
|
|
641
|
+
const { lastMessageDateSent } = v as RemoteDialogDTO;
|
|
642
|
+
|
|
643
|
+
return lastMessageDateSent !== undefined;
|
|
644
|
+
},
|
|
645
|
+
lastMessageText(v: unknown): v is RemoteDialogDTO['lastMessageText'] {
|
|
646
|
+
const { lastMessageText } = v as RemoteDialogDTO;
|
|
647
|
+
|
|
648
|
+
return lastMessageText !== undefined;
|
|
649
|
+
},
|
|
650
|
+
lastMessageUserId(v: unknown): v is RemoteDialogDTO['lastMessageUserId'] {
|
|
651
|
+
const { lastMessageUserId } = v as RemoteDialogDTO;
|
|
652
|
+
|
|
653
|
+
return lastMessageUserId !== undefined;
|
|
654
|
+
},
|
|
655
|
+
name(v: unknown): v is RemoteDialogDTO['name'] {
|
|
656
|
+
const { name } = v as RemoteDialogDTO;
|
|
657
|
+
|
|
658
|
+
return name !== undefined;
|
|
659
|
+
},
|
|
660
|
+
ownerId(v: unknown): v is RemoteDialogDTO['ownerId'] {
|
|
661
|
+
const { ownerId } = v as RemoteDialogDTO;
|
|
662
|
+
|
|
663
|
+
return ownerId !== undefined;
|
|
664
|
+
},
|
|
665
|
+
participantId(v: unknown): v is RemoteDialogDTO['participantId'] {
|
|
666
|
+
const { participantId } = v as RemoteDialogDTO;
|
|
667
|
+
|
|
668
|
+
return participantId !== undefined;
|
|
669
|
+
},
|
|
670
|
+
participantsIds(v: unknown): v is RemoteDialogDTO['participantsIds'] {
|
|
671
|
+
const { participantsIds } = v as RemoteDialogDTO;
|
|
672
|
+
|
|
673
|
+
return participantsIds !== undefined;
|
|
674
|
+
},
|
|
675
|
+
photo(v: unknown): v is RemoteDialogDTO['photo'] {
|
|
676
|
+
const { photo } = v as RemoteDialogDTO;
|
|
677
|
+
|
|
678
|
+
return photo !== undefined;
|
|
679
|
+
},
|
|
680
|
+
type(v: unknown): v is RemoteDialogDTO['type'] {
|
|
681
|
+
const { type } = v as RemoteDialogDTO;
|
|
682
|
+
|
|
683
|
+
return type !== undefined;
|
|
684
|
+
},
|
|
685
|
+
unreadMessageCount(
|
|
686
|
+
v: unknown,
|
|
687
|
+
): v is RemoteDialogDTO['unreadMessageCount'] {
|
|
688
|
+
const { unreadMessageCount } = v as RemoteDialogDTO;
|
|
689
|
+
|
|
690
|
+
return unreadMessageCount !== undefined;
|
|
691
|
+
},
|
|
692
|
+
updatedAt(v: unknown): v is RemoteDialogDTO['updatedAt'] {
|
|
693
|
+
const { updatedAt } = v as RemoteDialogDTO;
|
|
694
|
+
|
|
695
|
+
return updatedAt !== undefined;
|
|
696
|
+
},
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
if (!dtoValidator.id(data))
|
|
700
|
+
throw new MapperDTOException(
|
|
701
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
702
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
703
|
+
'field {id} does not exist or empty in DTO',
|
|
704
|
+
);
|
|
705
|
+
|
|
706
|
+
if (!dtoValidator.lastMessageDateSent(data))
|
|
707
|
+
throw new MapperDTOException(
|
|
708
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
709
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
710
|
+
'field {lastMessageDateSent} does not exist or empty in DTO',
|
|
711
|
+
);
|
|
712
|
+
|
|
713
|
+
if (!dtoValidator.lastMessageText(data))
|
|
714
|
+
throw new MapperDTOException(
|
|
715
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
716
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
717
|
+
'field {lastMessageText} does not exist or empty in DTO',
|
|
718
|
+
);
|
|
719
|
+
|
|
720
|
+
if (!dtoValidator.name(data))
|
|
721
|
+
throw new MapperDTOException(
|
|
722
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
723
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
724
|
+
'field {name} does not exist or empty in DTO',
|
|
725
|
+
);
|
|
726
|
+
|
|
727
|
+
if (!dtoValidator.ownerId(data))
|
|
728
|
+
throw new MapperDTOException(
|
|
729
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
730
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
731
|
+
'field {ownerId} does not exist or empty in DTO',
|
|
732
|
+
);
|
|
733
|
+
|
|
734
|
+
if (!dtoValidator.participantId(data))
|
|
735
|
+
throw new MapperDTOException(
|
|
736
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
737
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
738
|
+
'field {participantId} does not exist or empty in DTO',
|
|
739
|
+
);
|
|
740
|
+
|
|
741
|
+
if (!dtoValidator.participantsIds(data))
|
|
742
|
+
throw new MapperDTOException(
|
|
743
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
744
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
745
|
+
'field {participantsIds} does not exist or empty in DTO',
|
|
746
|
+
);
|
|
747
|
+
|
|
748
|
+
if (!dtoValidator.photo(data))
|
|
749
|
+
throw new MapperDTOException(
|
|
750
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
751
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
752
|
+
'field {photo} does not exist or empty in DTO',
|
|
753
|
+
);
|
|
754
|
+
|
|
755
|
+
if (!dtoValidator.type(data))
|
|
756
|
+
throw new MapperDTOException(
|
|
757
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
758
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
759
|
+
'field {type} does not exist or empty in DTO',
|
|
760
|
+
);
|
|
761
|
+
|
|
762
|
+
if (!dtoValidator.unreadMessageCount(data))
|
|
763
|
+
throw new MapperDTOException(
|
|
764
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
765
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
766
|
+
'field {unreadMessageCount} does not exist or empty in DTO',
|
|
767
|
+
);
|
|
768
|
+
|
|
769
|
+
if (!dtoValidator.updatedAt(data))
|
|
770
|
+
throw new MapperDTOException(
|
|
771
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE,
|
|
772
|
+
INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE,
|
|
773
|
+
'field {updatedAt} does not exist or empty in DTO',
|
|
774
|
+
);
|
|
775
|
+
}
|
|
776
|
+
}
|