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,324 @@
|
|
|
1
|
+
import { ILocalDataSource } from '../source/local/ILocalDataSource';
|
|
2
|
+
import { IRemoteDataSource } from '../source/remote/IRemoteDataSource';
|
|
3
|
+
import { UserEntity } from '../../Domain/entity/UserEntity';
|
|
4
|
+
import RepositoryException, {
|
|
5
|
+
UNEXPECTED_REPOSITORY_EXCEPTION_CODE,
|
|
6
|
+
UNEXPECTED_REPOSITORY_EXCEPTION_MESSAGE,
|
|
7
|
+
USER_ENTITY_REPOSITORY_EXCEPTION_CODE,
|
|
8
|
+
USER_ENTITY_REPOSITORY_EXCEPTION_MESSAGE,
|
|
9
|
+
} from '../source/exception/RepositoryException';
|
|
10
|
+
import {
|
|
11
|
+
LocalDataSourceException,
|
|
12
|
+
NOT_FOUND_LOCAL_DATASOURCE_EXCEPTION_CODE,
|
|
13
|
+
NOT_FOUND_LOCAL_DATASOURCE_EXCEPTION_MESSAGE,
|
|
14
|
+
UNEXPECTED_LOCAL_DATASOURCE_EXCEPTION_CODE,
|
|
15
|
+
} from '../source/exception/LocalDataSourceException';
|
|
16
|
+
import { IMapper } from '../mapper/IMapper';
|
|
17
|
+
import { LocalUserDTO } from '../dto/user/LocalUserDTO';
|
|
18
|
+
import { RemoteUserDTO } from '../dto/user/RemoteUserDTO';
|
|
19
|
+
import { UserLocalDTOMapper } from '../mapper/UserLocalDTOMapper';
|
|
20
|
+
import { UserRemoteDTOMapper } from '../mapper/UserRemoteDTOMapper';
|
|
21
|
+
import {
|
|
22
|
+
INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE,
|
|
23
|
+
INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE,
|
|
24
|
+
RemoteDataSourceException,
|
|
25
|
+
UNAUTHORISED_REMOTE_DATASOURCE_EXCEPTION_CODE,
|
|
26
|
+
} from '../source/exception/RemoteDataSourceException';
|
|
27
|
+
import {
|
|
28
|
+
PaginatedResult,
|
|
29
|
+
Pagination,
|
|
30
|
+
} from '../../Domain/repository/Pagination';
|
|
31
|
+
import {
|
|
32
|
+
PaginatedDTOResult,
|
|
33
|
+
RemoteDataSource,
|
|
34
|
+
} from '../source/remote/RemoteDataSource';
|
|
35
|
+
|
|
36
|
+
export default class UsersRepository {
|
|
37
|
+
private localDataSource: ILocalDataSource;
|
|
38
|
+
|
|
39
|
+
private remoteDataSource: IRemoteDataSource;
|
|
40
|
+
|
|
41
|
+
private userRemoteDTOMapper: IMapper;
|
|
42
|
+
|
|
43
|
+
private userLocalDTOMapper: IMapper;
|
|
44
|
+
|
|
45
|
+
// eslint-disable-next-line no-useless-constructor
|
|
46
|
+
constructor(
|
|
47
|
+
localDataSource: ILocalDataSource,
|
|
48
|
+
remoteDataSource: IRemoteDataSource,
|
|
49
|
+
) {
|
|
50
|
+
this.localDataSource = localDataSource;
|
|
51
|
+
this.remoteDataSource = remoteDataSource;
|
|
52
|
+
this.userLocalDTOMapper = new UserLocalDTOMapper();
|
|
53
|
+
this.userRemoteDTOMapper = new UserRemoteDTOMapper();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async getUserFromLocal(userId: number): Promise<UserEntity> {
|
|
57
|
+
let checkResult = true;
|
|
58
|
+
|
|
59
|
+
if (userId === 0) {
|
|
60
|
+
checkResult = false;
|
|
61
|
+
}
|
|
62
|
+
let userEntity: UserEntity = UserLocalDTOMapper.createDefaultUserEntity();
|
|
63
|
+
|
|
64
|
+
if (checkResult) {
|
|
65
|
+
try {
|
|
66
|
+
// TODO: change
|
|
67
|
+
const dto: LocalUserDTO = new LocalUserDTO();
|
|
68
|
+
|
|
69
|
+
dto.id = userId.toString();
|
|
70
|
+
|
|
71
|
+
const userDTO: LocalUserDTO = await this.localDataSource.getUser(dto);
|
|
72
|
+
|
|
73
|
+
userEntity = await this.userLocalDTOMapper.toEntity(userDTO);
|
|
74
|
+
} catch (e) {
|
|
75
|
+
if (e instanceof LocalDataSourceException) {
|
|
76
|
+
if (e.code !== UNEXPECTED_LOCAL_DATASOURCE_EXCEPTION_CODE) {
|
|
77
|
+
return Promise.reject(
|
|
78
|
+
new RepositoryException(
|
|
79
|
+
NOT_FOUND_LOCAL_DATASOURCE_EXCEPTION_MESSAGE,
|
|
80
|
+
NOT_FOUND_LOCAL_DATASOURCE_EXCEPTION_CODE,
|
|
81
|
+
),
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return Promise.reject(
|
|
86
|
+
new RepositoryException(
|
|
87
|
+
UNEXPECTED_REPOSITORY_EXCEPTION_MESSAGE,
|
|
88
|
+
UNEXPECTED_REPOSITORY_EXCEPTION_CODE,
|
|
89
|
+
),
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
checkResult = false;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const prom = new Promise<UserEntity>((resolve, reject) => {
|
|
97
|
+
if (checkResult === true) {
|
|
98
|
+
resolve(userEntity);
|
|
99
|
+
} else {
|
|
100
|
+
reject(
|
|
101
|
+
new RepositoryException(
|
|
102
|
+
USER_ENTITY_REPOSITORY_EXCEPTION_MESSAGE,
|
|
103
|
+
USER_ENTITY_REPOSITORY_EXCEPTION_CODE,
|
|
104
|
+
),
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
return prom;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// eslint-disable-next-line class-methods-use-this
|
|
113
|
+
async getUserFromRemote(userId: number): Promise<UserEntity> {
|
|
114
|
+
let checkResult = true;
|
|
115
|
+
|
|
116
|
+
if (userId === 0) {
|
|
117
|
+
checkResult = false;
|
|
118
|
+
}
|
|
119
|
+
let userEntity: UserEntity = UserLocalDTOMapper.createDefaultUserEntity();
|
|
120
|
+
|
|
121
|
+
if (checkResult) {
|
|
122
|
+
try {
|
|
123
|
+
// TODO: change
|
|
124
|
+
const dto: RemoteUserDTO = new RemoteUserDTO();
|
|
125
|
+
|
|
126
|
+
dto.id = userId.toString();
|
|
127
|
+
|
|
128
|
+
const userDTO: LocalUserDTO = await this.remoteDataSource.getUser(dto);
|
|
129
|
+
|
|
130
|
+
userEntity = await this.userRemoteDTOMapper.toEntity(userDTO);
|
|
131
|
+
} catch (e) {
|
|
132
|
+
if (e instanceof RemoteDataSourceException) {
|
|
133
|
+
if (e.code !== UNAUTHORISED_REMOTE_DATASOURCE_EXCEPTION_CODE) {
|
|
134
|
+
return Promise.reject(
|
|
135
|
+
new RepositoryException(
|
|
136
|
+
INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE,
|
|
137
|
+
INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE,
|
|
138
|
+
),
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return Promise.reject(
|
|
143
|
+
new RepositoryException(
|
|
144
|
+
UNEXPECTED_REPOSITORY_EXCEPTION_MESSAGE,
|
|
145
|
+
UNEXPECTED_REPOSITORY_EXCEPTION_CODE,
|
|
146
|
+
),
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
checkResult = false;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const prom = new Promise<UserEntity>((resolve, reject) => {
|
|
154
|
+
if (checkResult === true) {
|
|
155
|
+
resolve(userEntity);
|
|
156
|
+
} else {
|
|
157
|
+
reject(
|
|
158
|
+
new RepositoryException(
|
|
159
|
+
USER_ENTITY_REPOSITORY_EXCEPTION_MESSAGE,
|
|
160
|
+
USER_ENTITY_REPOSITORY_EXCEPTION_CODE,
|
|
161
|
+
),
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
return prom;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
// eslint-disable-next-line class-methods-use-this
|
|
170
|
+
async getUsersFromLocal(usersIds: Array<number>): Promise<Array<UserEntity>> {
|
|
171
|
+
const arrayUserDTO: Array<LocalUserDTO> = new Array<LocalUserDTO>();
|
|
172
|
+
|
|
173
|
+
try {
|
|
174
|
+
for (let i = 0; i < usersIds.length; i += 1) {
|
|
175
|
+
let dto: LocalUserDTO = new LocalUserDTO();
|
|
176
|
+
|
|
177
|
+
dto.id = usersIds[i].toString();
|
|
178
|
+
// TODO: check loop with await
|
|
179
|
+
// eslint-disable-next-line no-await-in-loop
|
|
180
|
+
dto = await this.localDataSource.getUser(dto);
|
|
181
|
+
arrayUserDTO.push(dto);
|
|
182
|
+
}
|
|
183
|
+
const users: Array<UserEntity> = new Array<UserEntity>();
|
|
184
|
+
|
|
185
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
186
|
+
for (const item of arrayUserDTO) {
|
|
187
|
+
// eslint-disable-next-line no-await-in-loop
|
|
188
|
+
const entity: UserEntity = await this.userLocalDTOMapper.toEntity(item);
|
|
189
|
+
|
|
190
|
+
users.push(entity);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return Promise.resolve(users);
|
|
194
|
+
} catch (e) {
|
|
195
|
+
return Promise.reject(e);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
// eslint-disable-next-line class-methods-use-this
|
|
200
|
+
async getUsersFromRemote(
|
|
201
|
+
usersIds: Array<number>,
|
|
202
|
+
): Promise<Array<UserEntity>> {
|
|
203
|
+
const arrayUserDTO: Array<RemoteUserDTO> = new Array<RemoteUserDTO>();
|
|
204
|
+
|
|
205
|
+
try {
|
|
206
|
+
for (let i = 0; i < usersIds.length; i += 1) {
|
|
207
|
+
let dto: RemoteUserDTO = new RemoteUserDTO();
|
|
208
|
+
|
|
209
|
+
dto.id = usersIds[i].toString();
|
|
210
|
+
// TODO: check loop with await
|
|
211
|
+
// eslint-disable-next-line no-await-in-loop
|
|
212
|
+
dto = await this.remoteDataSource.getUser(dto);
|
|
213
|
+
arrayUserDTO.push(dto);
|
|
214
|
+
}
|
|
215
|
+
const users: Array<UserEntity> = new Array<UserEntity>();
|
|
216
|
+
|
|
217
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
218
|
+
for (const item of arrayUserDTO) {
|
|
219
|
+
// eslint-disable-next-line no-await-in-loop
|
|
220
|
+
const entity: UserEntity = await this.userRemoteDTOMapper.toEntity(
|
|
221
|
+
item,
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
users.push(entity);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return Promise.resolve(users);
|
|
228
|
+
} catch (e) {
|
|
229
|
+
return Promise.reject(e);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// eslint-disable-next-line class-methods-use-this
|
|
234
|
+
async getALLUsersFromRemote(
|
|
235
|
+
pagination?: Pagination,
|
|
236
|
+
filter?: string,
|
|
237
|
+
): Promise<PaginatedResult<UserEntity>> {
|
|
238
|
+
const currentPagination: Pagination = pagination || new Pagination(1, 5);
|
|
239
|
+
|
|
240
|
+
if (this.remoteDataSource instanceof RemoteDataSource) {
|
|
241
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
242
|
+
const result: PaginatedDTOResult =
|
|
243
|
+
await this.remoteDataSource.getAllUsers(currentPagination, filter);
|
|
244
|
+
const ResultData: UserEntity[] = [];
|
|
245
|
+
|
|
246
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
247
|
+
for (const remoteUser of result.ResultData) {
|
|
248
|
+
// eslint-disable-next-line no-await-in-loop
|
|
249
|
+
const userEntity: UserEntity = await this.userRemoteDTOMapper.toEntity<
|
|
250
|
+
RemoteUserDTO,
|
|
251
|
+
UserEntity
|
|
252
|
+
>(remoteUser);
|
|
253
|
+
|
|
254
|
+
ResultData.push(userEntity);
|
|
255
|
+
}
|
|
256
|
+
// const PaginatedList: Record<number, UserEntity[]> = {};
|
|
257
|
+
//
|
|
258
|
+
// //
|
|
259
|
+
// // eslint-disable-next-line no-restricted-syntax
|
|
260
|
+
// for (const [key, value] of Object.entries(result.PaginatedList)) {
|
|
261
|
+
// const remoteUsers: RemoteUserDTO[] = value;
|
|
262
|
+
// const pageusers: UserEntity[] = [];
|
|
263
|
+
//
|
|
264
|
+
// // eslint-disable-next-line no-restricted-syntax
|
|
265
|
+
// for (const remoteUser of remoteUsers) {
|
|
266
|
+
// const userEntity: UserEntity =
|
|
267
|
+
// // eslint-disable-next-line no-await-in-loop
|
|
268
|
+
// await this.userRemoteDTOMapper.toEntity<RemoteUserDTO, UserEntity>(
|
|
269
|
+
// remoteUser,
|
|
270
|
+
// );
|
|
271
|
+
//
|
|
272
|
+
// pageusers.push(userEntity);
|
|
273
|
+
// }
|
|
274
|
+
//
|
|
275
|
+
// PaginatedList[parseInt(key, 10)] = pageusers;
|
|
276
|
+
// }
|
|
277
|
+
|
|
278
|
+
return {
|
|
279
|
+
// PaginatedList,
|
|
280
|
+
ResultData,
|
|
281
|
+
CurrentPagination: result.PaginationResult,
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// eslint-disable-next-line prefer-promise-reject-errors
|
|
286
|
+
return Promise.reject(false);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
async saveUsersToLocal(entities: Array<UserEntity>): Promise<boolean> {
|
|
290
|
+
try {
|
|
291
|
+
// TODO: check this loop
|
|
292
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
293
|
+
for (const item of entities) {
|
|
294
|
+
// eslint-disable-next-line no-await-in-loop
|
|
295
|
+
const dto: LocalUserDTO = await this.userLocalDTOMapper.fromEntity(
|
|
296
|
+
item,
|
|
297
|
+
);
|
|
298
|
+
|
|
299
|
+
// eslint-disable-next-line no-await-in-loop
|
|
300
|
+
await this.localDataSource.saveUser(dto);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return Promise.resolve(true);
|
|
304
|
+
} catch (e) {
|
|
305
|
+
// eslint-disable-next-line prefer-promise-reject-errors
|
|
306
|
+
return Promise.reject(false);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
async saveUserToLocal(entity: UserEntity): Promise<boolean> {
|
|
311
|
+
try {
|
|
312
|
+
const dto: LocalUserDTO = await this.userLocalDTOMapper.fromEntity(
|
|
313
|
+
entity,
|
|
314
|
+
);
|
|
315
|
+
|
|
316
|
+
await this.localDataSource.saveUser(dto);
|
|
317
|
+
|
|
318
|
+
return Promise.resolve(true);
|
|
319
|
+
} catch (e) {
|
|
320
|
+
// eslint-disable-next-line prefer-promise-reject-errors
|
|
321
|
+
return Promise.reject(false);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import RepositoryException from './RepositoryException';
|
|
2
|
+
|
|
3
|
+
export const UNEXPECTED_LOCAL_DATASOURCE_EXCEPTION_MESSAGE = 'unexpected';
|
|
4
|
+
export const UNEXPECTED_LOCAL_DATASOURCE_EXCEPTION_CODE = 111;
|
|
5
|
+
|
|
6
|
+
export const ALREADY_LOCAL_DATASOURCE_EXIST_EXCEPTION_MESSAGE = 'already exist';
|
|
7
|
+
export const ALREADY_LOCAL_DATASOURCE_EXIST_EXCEPTION_CODE = 112;
|
|
8
|
+
|
|
9
|
+
export const NOT_FOUND_LOCAL_DATASOURCE_EXCEPTION_MESSAGE = 'not found';
|
|
10
|
+
export const NOT_FOUND_LOCAL_DATASOURCE_EXCEPTION_CODE = 113;
|
|
11
|
+
|
|
12
|
+
export class LocalDataSourceException extends RepositoryException {
|
|
13
|
+
// eslint-disable-next-line no-useless-constructor
|
|
14
|
+
constructor(message: string, code: number) {
|
|
15
|
+
super(message, code);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import RepositoryException from './RepositoryException';
|
|
2
|
+
|
|
3
|
+
export const UNEXPECTED_MAPPER_DTO_EXCEPTION_MESSAGE =
|
|
4
|
+
'Error. Mapper DTO Unexpected exception .';
|
|
5
|
+
export const UNEXPECTED_MAPPER_DTO_EXCEPTION_EXCEPTION_CODE = 131;
|
|
6
|
+
|
|
7
|
+
export const INCORRECT_DATA_MAPPER_DTO_EXCEPTION_MESSAGE =
|
|
8
|
+
'Error. Mapper DTO Incorrect data exception .';
|
|
9
|
+
export const INCORRECT_DATA_MAPPER_DTO_EXCEPTION_CODE = 132;
|
|
10
|
+
|
|
11
|
+
export class MapperDTOException extends RepositoryException {
|
|
12
|
+
public _description: string;
|
|
13
|
+
|
|
14
|
+
// eslint-disable-next-line no-useless-constructor
|
|
15
|
+
constructor(message: string, code: number, description = '') {
|
|
16
|
+
super(message, code);
|
|
17
|
+
this._description = description;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import RepositoryException from './RepositoryException';
|
|
2
|
+
|
|
3
|
+
export const UNAUTHORISED_REMOTE_DATASOURCE_EXCEPTION_MESSAGE = 'unauthorised';
|
|
4
|
+
export const UNAUTHORISED_REMOTE_DATASOURCE_EXCEPTION_CODE = 121;
|
|
5
|
+
|
|
6
|
+
export const INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE =
|
|
7
|
+
'incorrect data';
|
|
8
|
+
export const INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE = 122;
|
|
9
|
+
|
|
10
|
+
export const RESTRICTED_REMOTE_DATASOURCE_ACCESS_EXCEPTION_MESSAGE =
|
|
11
|
+
'restricted access';
|
|
12
|
+
export const RESTRICTED_REMOTE_DATASOURCE_ACCESS_EXCEPTION_CODE = 123;
|
|
13
|
+
|
|
14
|
+
export const CONNECTION_FAILD_REMOTE_DATASOURCE_EXCEPTION_MESSAGE =
|
|
15
|
+
'connection failed';
|
|
16
|
+
export const CONNECTION_FAILD_REMOTE_DATASOURCE_EXCEPTION_CODE = 124;
|
|
17
|
+
|
|
18
|
+
export const NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_MESSAGE = 'not found';
|
|
19
|
+
export const NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_CODE = 125;
|
|
20
|
+
|
|
21
|
+
export class RemoteDataSourceException extends RepositoryException {
|
|
22
|
+
public description: string;
|
|
23
|
+
|
|
24
|
+
constructor(message: string, code: number, description = '') {
|
|
25
|
+
super(message, code);
|
|
26
|
+
this.description = description;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const UNEXPECTED_REPOSITORY_EXCEPTION_MESSAGE = 'error';
|
|
2
|
+
export const UNEXPECTED_REPOSITORY_EXCEPTION_CODE = 101;
|
|
3
|
+
|
|
4
|
+
export const USER_ENTITY_REPOSITORY_EXCEPTION_MESSAGE =
|
|
5
|
+
'Error. UserId raise User Entity exception.';
|
|
6
|
+
export const USER_ENTITY_REPOSITORY_EXCEPTION_CODE = 102;
|
|
7
|
+
|
|
8
|
+
export const DIALOG_ENTITY_REPOSITORY_EXCEPTION_MESSAGE =
|
|
9
|
+
'Error. DialogId raise Dialog Entity exception.';
|
|
10
|
+
export const DIALOG_ENTITY_REPOSITORY_EXCEPTION_CODE = 103;
|
|
11
|
+
|
|
12
|
+
export const MESSAGE_ENTITY_REPOSITORY_EXCEPTION_MESSAGE =
|
|
13
|
+
'Error. MessageId raise Message Entity exception.';
|
|
14
|
+
export const MESSAGE_ENTITY_REPOSITORY_EXCEPTION_CODE = 103;
|
|
15
|
+
|
|
16
|
+
export const FILE_ENTITY_REPOSITORY_EXCEPTION_MESSAGE =
|
|
17
|
+
'Error. Id raise File Entity exception.';
|
|
18
|
+
export const FILE_ENTITY_REPOSITORY_EXCEPTION_CODE = 104;
|
|
19
|
+
|
|
20
|
+
export default class RepositoryException extends Error {
|
|
21
|
+
public readonly code: number;
|
|
22
|
+
|
|
23
|
+
constructor(public message: string, code: number) {
|
|
24
|
+
super(message);
|
|
25
|
+
this.code = code;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
import { FunctionResult } from '../../../CommonTypes/FunctionResult';
|
|
2
|
+
import { PublicDialogEntity } from '../../../Domain/entity/PublicDialogEntity';
|
|
3
|
+
|
|
4
|
+
// const COLLECTION = 'CHATS';
|
|
5
|
+
// request to server with sDK
|
|
6
|
+
const listChats: PublicDialogEntity[] = [
|
|
7
|
+
{
|
|
8
|
+
id: '1',
|
|
9
|
+
name: 'Chat 1',
|
|
10
|
+
customData: { todo: '' },
|
|
11
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
12
|
+
ownerId: '',
|
|
13
|
+
photo: '',
|
|
14
|
+
type: 0,
|
|
15
|
+
unreadMessageCount: 0,
|
|
16
|
+
updatedAt: '',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: '2',
|
|
20
|
+
name: 'Chat 2',
|
|
21
|
+
customData: { todo: '' },
|
|
22
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
23
|
+
ownerId: '',
|
|
24
|
+
photo: '',
|
|
25
|
+
type: 0,
|
|
26
|
+
unreadMessageCount: 0,
|
|
27
|
+
updatedAt: '',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: '3',
|
|
31
|
+
name: 'Chat 3',
|
|
32
|
+
customData: { todo: '' },
|
|
33
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
34
|
+
ownerId: '',
|
|
35
|
+
photo: '',
|
|
36
|
+
type: 0,
|
|
37
|
+
unreadMessageCount: 0,
|
|
38
|
+
updatedAt: '',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: '4',
|
|
42
|
+
name: 'Chat 4',
|
|
43
|
+
customData: { todo: '' },
|
|
44
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
45
|
+
ownerId: '',
|
|
46
|
+
photo: '',
|
|
47
|
+
type: 0,
|
|
48
|
+
unreadMessageCount: 0,
|
|
49
|
+
updatedAt: '',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: '5',
|
|
53
|
+
name: 'Chat 5',
|
|
54
|
+
customData: { todo: '' },
|
|
55
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
56
|
+
ownerId: '',
|
|
57
|
+
photo: '',
|
|
58
|
+
type: 0,
|
|
59
|
+
unreadMessageCount: 0,
|
|
60
|
+
updatedAt: '',
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
// request to local cash
|
|
64
|
+
const listCasheChats: PublicDialogEntity[] = [
|
|
65
|
+
{
|
|
66
|
+
id: '1',
|
|
67
|
+
name: 'Cash Chat 1',
|
|
68
|
+
customData: { todo: '' },
|
|
69
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
70
|
+
ownerId: '',
|
|
71
|
+
photo: '',
|
|
72
|
+
type: 0,
|
|
73
|
+
unreadMessageCount: 0,
|
|
74
|
+
updatedAt: '',
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: '2',
|
|
78
|
+
name: 'Cash Chat 2',
|
|
79
|
+
customData: { todo: '' },
|
|
80
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
81
|
+
ownerId: '',
|
|
82
|
+
photo: '',
|
|
83
|
+
type: 0,
|
|
84
|
+
unreadMessageCount: 0,
|
|
85
|
+
updatedAt: '',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: '3',
|
|
89
|
+
name: 'Chat 3 from Cash',
|
|
90
|
+
customData: { todo: '' },
|
|
91
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
92
|
+
ownerId: '',
|
|
93
|
+
photo: '',
|
|
94
|
+
type: 0,
|
|
95
|
+
unreadMessageCount: 0,
|
|
96
|
+
updatedAt: '',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: '4',
|
|
100
|
+
name: 'Chat 4 from Cash',
|
|
101
|
+
customData: { todo: '' },
|
|
102
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
103
|
+
ownerId: '',
|
|
104
|
+
photo: '',
|
|
105
|
+
type: 0,
|
|
106
|
+
unreadMessageCount: 0,
|
|
107
|
+
updatedAt: '',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: '5',
|
|
111
|
+
name: 'Chat 5 from Cash',
|
|
112
|
+
customData: { todo: '' },
|
|
113
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
114
|
+
ownerId: '',
|
|
115
|
+
photo: '',
|
|
116
|
+
type: 0,
|
|
117
|
+
unreadMessageCount: 0,
|
|
118
|
+
updatedAt: '',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
id: '6',
|
|
122
|
+
name: 'Chat 6 from Cash',
|
|
123
|
+
customData: { todo: '' },
|
|
124
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
125
|
+
ownerId: '',
|
|
126
|
+
photo: '',
|
|
127
|
+
type: 0,
|
|
128
|
+
unreadMessageCount: 0,
|
|
129
|
+
updatedAt: '',
|
|
130
|
+
},
|
|
131
|
+
];
|
|
132
|
+
// request preloaded
|
|
133
|
+
const preloadedChats: PublicDialogEntity[] = [
|
|
134
|
+
{
|
|
135
|
+
id: '1',
|
|
136
|
+
name: 'Preload Chat 1',
|
|
137
|
+
customData: { todo: '' },
|
|
138
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
139
|
+
ownerId: '',
|
|
140
|
+
photo: '',
|
|
141
|
+
type: 0,
|
|
142
|
+
unreadMessageCount: 0,
|
|
143
|
+
updatedAt: '',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: '2',
|
|
147
|
+
name: 'Preload Chat 2',
|
|
148
|
+
customData: { todo: '' },
|
|
149
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
150
|
+
ownerId: '',
|
|
151
|
+
photo: '',
|
|
152
|
+
type: 0,
|
|
153
|
+
unreadMessageCount: 0,
|
|
154
|
+
updatedAt: '',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
id: '3',
|
|
158
|
+
name: 'Preload Chat 3',
|
|
159
|
+
customData: { todo: '' },
|
|
160
|
+
lastMessage: { dateSent: '', text: '', userId: 0 },
|
|
161
|
+
ownerId: '',
|
|
162
|
+
photo: '',
|
|
163
|
+
type: 0,
|
|
164
|
+
unreadMessageCount: 0,
|
|
165
|
+
updatedAt: '',
|
|
166
|
+
},
|
|
167
|
+
];
|
|
168
|
+
|
|
169
|
+
export function getOne(
|
|
170
|
+
id: number,
|
|
171
|
+
): Promise<FunctionResult<PublicDialogEntity>> {
|
|
172
|
+
console.log('StorageDataSource. getOne');
|
|
173
|
+
try {
|
|
174
|
+
const filteredData = listChats.filter((item) => item.id === id.toString());
|
|
175
|
+
|
|
176
|
+
console.log(
|
|
177
|
+
`getOne id = ${id}, filtredData = ${JSON.stringify(filteredData)}`,
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
return Promise.resolve({
|
|
181
|
+
error: null,
|
|
182
|
+
result: filteredData.length > 0 ? filteredData[0] : [],
|
|
183
|
+
});
|
|
184
|
+
} catch (err) {
|
|
185
|
+
return Promise.resolve({ error: err, result: [] });
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
export function getOneFromCash(
|
|
189
|
+
id: number,
|
|
190
|
+
): Promise<FunctionResult<PublicDialogEntity>> {
|
|
191
|
+
console.log('StorageDataSource. getOneFromCash');
|
|
192
|
+
try {
|
|
193
|
+
const filteredData = listCasheChats.filter(
|
|
194
|
+
(item) => item.id === id.toString(),
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
console.log(
|
|
198
|
+
`getOneFromCash id = ${id}, filtredData = ${JSON.stringify(
|
|
199
|
+
filteredData,
|
|
200
|
+
)}`,
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
return Promise.resolve({
|
|
204
|
+
error: null,
|
|
205
|
+
result: filteredData.length > 0 ? filteredData[0] : [],
|
|
206
|
+
});
|
|
207
|
+
} catch (err) {
|
|
208
|
+
return Promise.resolve({ error: err, result: [] });
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
//
|
|
212
|
+
export function getOneFromPreload(
|
|
213
|
+
id: number,
|
|
214
|
+
): Promise<FunctionResult<PublicDialogEntity>> {
|
|
215
|
+
console.log('StorageDataSource. getOneFromPreload');
|
|
216
|
+
try {
|
|
217
|
+
const filteredData = preloadedChats.filter(
|
|
218
|
+
(item) => item.id === id.toString(),
|
|
219
|
+
);
|
|
220
|
+
|
|
221
|
+
console.log(
|
|
222
|
+
`getOne id = ${id}, filtredData = ${JSON.stringify(filteredData)}`,
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
return Promise.resolve({
|
|
226
|
+
error: null,
|
|
227
|
+
result: filteredData.length > 0 ? filteredData[0] : [],
|
|
228
|
+
});
|
|
229
|
+
} catch (err) {
|
|
230
|
+
return Promise.resolve({ error: err, result: [] });
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
//
|
|
234
|
+
export function getAll(): Promise<FunctionResult<PublicDialogEntity[]>> {
|
|
235
|
+
console.log('StorageDataSource. getAll');
|
|
236
|
+
try {
|
|
237
|
+
return Promise.resolve({ error: null, result: listChats });
|
|
238
|
+
} catch (err) {
|
|
239
|
+
return Promise.resolve({ error: err, result: [] });
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
export function getAllFromCash(): Promise<
|
|
243
|
+
FunctionResult<PublicDialogEntity[]>
|
|
244
|
+
> {
|
|
245
|
+
console.log('StorageDataSource. getAllFromCash');
|
|
246
|
+
try {
|
|
247
|
+
return Promise.resolve({ error: null, result: listCasheChats });
|
|
248
|
+
} catch (err) {
|
|
249
|
+
return Promise.resolve({ error: err, result: [] });
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
//
|
|
253
|
+
export function getAllFromPreload(): Promise<
|
|
254
|
+
FunctionResult<PublicDialogEntity[]>
|
|
255
|
+
> {
|
|
256
|
+
console.log('StorageDataSource. getAllFromPreload');
|
|
257
|
+
try {
|
|
258
|
+
return Promise.resolve({ error: null, result: preloadedChats });
|
|
259
|
+
} catch (err) {
|
|
260
|
+
return Promise.resolve({ error: err, result: [] });
|
|
261
|
+
}
|
|
262
|
+
}
|