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,543 @@
|
|
|
1
|
+
import { stringifyError } from '../utils/parse';
|
|
2
|
+
|
|
3
|
+
export type QBInitParams = {
|
|
4
|
+
appIdOrToken: string | number;
|
|
5
|
+
authKeyOrAppId: string | number;
|
|
6
|
+
authSecret?: string;
|
|
7
|
+
accountKey: string;
|
|
8
|
+
config?: QBConfig;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export function QBInit(params: QBInitParams) {
|
|
12
|
+
QB.init(
|
|
13
|
+
params.appIdOrToken,
|
|
14
|
+
params.authKeyOrAppId,
|
|
15
|
+
params.authSecret,
|
|
16
|
+
params.accountKey,
|
|
17
|
+
params.config,
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function QBCreateSession(params?: QBLoginParams) {
|
|
22
|
+
return new Promise<QBSession>((resolve, reject) => {
|
|
23
|
+
QB.createSession(params, (sessionError, session) => {
|
|
24
|
+
if (sessionError) {
|
|
25
|
+
reject(stringifyError(sessionError));
|
|
26
|
+
} else {
|
|
27
|
+
resolve(session);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function QBGetSession() {
|
|
34
|
+
return new Promise<QBSession>((resolve, reject) => {
|
|
35
|
+
QB.getSession((getSessionError, response) => {
|
|
36
|
+
if (getSessionError || !response?.session) {
|
|
37
|
+
reject(
|
|
38
|
+
getSessionError ? stringifyError(getSessionError) : 'No session',
|
|
39
|
+
);
|
|
40
|
+
} else {
|
|
41
|
+
resolve(response.session);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function loginToQuickBlox(params: QBLoginParams) {
|
|
48
|
+
return new Promise<QBUser>((resolve, reject) => {
|
|
49
|
+
QB.login(params, (loginError, user) => {
|
|
50
|
+
if (loginError) {
|
|
51
|
+
reject(stringifyError(loginError));
|
|
52
|
+
} else {
|
|
53
|
+
resolve(user);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function QBLogin(params: QBLoginParams) {
|
|
60
|
+
let session: QBSession;
|
|
61
|
+
|
|
62
|
+
return QBCreateSession()
|
|
63
|
+
.then((_session) => {
|
|
64
|
+
session = _session;
|
|
65
|
+
|
|
66
|
+
return loginToQuickBlox(params);
|
|
67
|
+
})
|
|
68
|
+
.then((user) => ({ user, session }));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function QBLogout() {
|
|
72
|
+
return new Promise((resolve) => {
|
|
73
|
+
QB.destroySession(resolve);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function QBChatConnect(params: ChatConnectParams) {
|
|
78
|
+
return new Promise((resolve, reject) => {
|
|
79
|
+
QB.chat.connect(params, (error, success) => {
|
|
80
|
+
if (error) {
|
|
81
|
+
reject(stringifyError(error));
|
|
82
|
+
} else {
|
|
83
|
+
resolve(success);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function QBChatDisconnect() {
|
|
90
|
+
QB.chat.disconnect();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function registrationAccount(params: QBCreateUserParams) {
|
|
94
|
+
return new Promise<QBUser>((resolve, reject) => {
|
|
95
|
+
QB.users.create(params, (error, createdUser) => {
|
|
96
|
+
if (error) {
|
|
97
|
+
reject(stringifyError(error));
|
|
98
|
+
} else {
|
|
99
|
+
resolve(createdUser);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function QBUserCreate(params: QBCreateUserParams) {
|
|
106
|
+
let session: QBSession;
|
|
107
|
+
|
|
108
|
+
return QBCreateSession()
|
|
109
|
+
.then((_session) => {
|
|
110
|
+
session = _session;
|
|
111
|
+
|
|
112
|
+
return registrationAccount(params);
|
|
113
|
+
})
|
|
114
|
+
.then((user) => ({ user, session }));
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function QBUserUpdate(userId: QBUser['id'], user: Partial<QBUser>) {
|
|
118
|
+
return new Promise<QBUser>((resolve, reject) => {
|
|
119
|
+
QB.users.update(userId, user, (error, updatedUser) => {
|
|
120
|
+
if (error) {
|
|
121
|
+
reject(stringifyError(error));
|
|
122
|
+
} else {
|
|
123
|
+
resolve(updatedUser);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function QBUserGet(params: GetUserParams | number) {
|
|
130
|
+
if (typeof params === 'number') {
|
|
131
|
+
return new Promise<QBUser | undefined>((resolve, reject) => {
|
|
132
|
+
QB.users.get(params, (error, result) => {
|
|
133
|
+
if (error) {
|
|
134
|
+
reject(error);
|
|
135
|
+
} else {
|
|
136
|
+
resolve(result);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return new Promise<ListUserResponse>((resolve, reject) => {
|
|
143
|
+
QB.users.get(params, (error, result: ListUserResponse) => {
|
|
144
|
+
if (error) {
|
|
145
|
+
reject(error);
|
|
146
|
+
} else {
|
|
147
|
+
resolve(result);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
//
|
|
153
|
+
export function QBUsersGet(params: GetUserParams) {
|
|
154
|
+
return new Promise<ListUserResponse>((resolve, reject) => {
|
|
155
|
+
QB.users.get(params, (error, result: ListUserResponse) => {
|
|
156
|
+
if (error) {
|
|
157
|
+
reject(error);
|
|
158
|
+
} else {
|
|
159
|
+
resolve(result);
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
export function QBUsersGetById(params: number) {
|
|
165
|
+
return new Promise<QBUser | undefined>((resolve, reject) => {
|
|
166
|
+
QB.users.get(params, (error, result) => {
|
|
167
|
+
if (error) {
|
|
168
|
+
reject(error);
|
|
169
|
+
} else {
|
|
170
|
+
resolve(result);
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
//
|
|
177
|
+
export function QBUserList(params: ListUserParams) {
|
|
178
|
+
return new Promise<ListUserResponse | undefined>((resolve, reject) => {
|
|
179
|
+
QB.users.listUsers(params, (error, response) => {
|
|
180
|
+
if (error) {
|
|
181
|
+
reject(stringifyError(error));
|
|
182
|
+
} else {
|
|
183
|
+
resolve(response);
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export function QBDataGet<T extends QBCustomObject>(
|
|
190
|
+
className: string,
|
|
191
|
+
filters: Dictionary<unknown>,
|
|
192
|
+
) {
|
|
193
|
+
return new Promise<{
|
|
194
|
+
class_name: string;
|
|
195
|
+
items: T[];
|
|
196
|
+
limit: number;
|
|
197
|
+
skip: number;
|
|
198
|
+
}>((resolve, reject) => {
|
|
199
|
+
QB.data.list<T>(className, filters, (error, result) => {
|
|
200
|
+
if (error) {
|
|
201
|
+
reject(stringifyError(error));
|
|
202
|
+
} else {
|
|
203
|
+
resolve(result);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export function QBDataCreate<T extends QBCustomObject>(
|
|
210
|
+
className: string,
|
|
211
|
+
data: Dictionary<unknown>,
|
|
212
|
+
) {
|
|
213
|
+
return new Promise<T>((resolve, reject) => {
|
|
214
|
+
QB.data.create<T>(className, data, (error, customObject) => {
|
|
215
|
+
if (error) {
|
|
216
|
+
reject(stringifyError(error));
|
|
217
|
+
} else {
|
|
218
|
+
resolve(customObject);
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export function QBDataDelete<
|
|
225
|
+
T extends QBCustomObject['_id'] | Array<QBCustomObject['_id']>,
|
|
226
|
+
>(className: string, ids: T) {
|
|
227
|
+
return new Promise<QBDataDeletedResponse>((resolve, reject) => {
|
|
228
|
+
QB.data.delete<T>(className, ids, (error, customObject) => {
|
|
229
|
+
if (error) {
|
|
230
|
+
reject(stringifyError(error));
|
|
231
|
+
} else {
|
|
232
|
+
resolve(customObject);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export function QBDataUpdate<T extends QBCustomObject>(
|
|
239
|
+
className: string,
|
|
240
|
+
_id: T['_id'],
|
|
241
|
+
data: Dictionary<unknown>,
|
|
242
|
+
) {
|
|
243
|
+
return new Promise<T>((resolve, reject) => {
|
|
244
|
+
QB.data.update<{ _id: string } & Dictionary<unknown>, T>(
|
|
245
|
+
className,
|
|
246
|
+
{ _id, ...data },
|
|
247
|
+
(error, item) => {
|
|
248
|
+
if (error) {
|
|
249
|
+
reject(stringifyError(error));
|
|
250
|
+
} else {
|
|
251
|
+
resolve(item);
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
);
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
259
|
+
export function QBGetDialogs(filters: Dictionary<any>) {
|
|
260
|
+
return new Promise<QBGetDialogResult | undefined>((resolve, reject) => {
|
|
261
|
+
QB.chat.dialog.list(filters, (error, result) => {
|
|
262
|
+
if (error) {
|
|
263
|
+
reject(stringifyError(error));
|
|
264
|
+
} else {
|
|
265
|
+
resolve(result);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export function QBGetDialogById(id: string) {
|
|
272
|
+
return new Promise<QBGetDialogResult | undefined>((resolve, reject) => {
|
|
273
|
+
QB.chat.dialog.list({ _id: id }, (error, result) => {
|
|
274
|
+
if (error) {
|
|
275
|
+
reject(stringifyError(error));
|
|
276
|
+
} else {
|
|
277
|
+
resolve(result);
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export function QBCreatePrivateDialog(
|
|
284
|
+
userId: QBUser['id'],
|
|
285
|
+
dialogName?: string,
|
|
286
|
+
data?: Dictionary<unknown>,
|
|
287
|
+
) {
|
|
288
|
+
console.log(
|
|
289
|
+
`call QBCreatePrivateDialog with userid: ${userId} dialog name: ${
|
|
290
|
+
dialogName || '-'
|
|
291
|
+
}`,
|
|
292
|
+
);
|
|
293
|
+
|
|
294
|
+
return new Promise<QBChatDialog>((resolve, reject) => {
|
|
295
|
+
QB.chat.dialog.create(
|
|
296
|
+
{ name: dialogName || '-', occupants_ids: [userId], type: 3, data },
|
|
297
|
+
(error, chat) => {
|
|
298
|
+
if (error) {
|
|
299
|
+
reject(stringifyError(error));
|
|
300
|
+
} else {
|
|
301
|
+
resolve(chat);
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
);
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
export function QBCreateGroupDialog(
|
|
308
|
+
userIds: Array<QBUser['id']>,
|
|
309
|
+
dialogName?: string,
|
|
310
|
+
data?: Dictionary<unknown>,
|
|
311
|
+
) {
|
|
312
|
+
console.log(
|
|
313
|
+
`call QBCreateGroupDialog with ids: ${JSON.stringify(userIds)} name: ${
|
|
314
|
+
dialogName || ''
|
|
315
|
+
}`,
|
|
316
|
+
);
|
|
317
|
+
|
|
318
|
+
let params = {};
|
|
319
|
+
|
|
320
|
+
if (data && data?.photo) {
|
|
321
|
+
params = {
|
|
322
|
+
name: dialogName || '-',
|
|
323
|
+
occupants_ids: [userIds],
|
|
324
|
+
type: 2,
|
|
325
|
+
photo: data?.photo,
|
|
326
|
+
};
|
|
327
|
+
} else {
|
|
328
|
+
params = {
|
|
329
|
+
name: dialogName || '-',
|
|
330
|
+
occupants_ids: [userIds],
|
|
331
|
+
type: 2,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return new Promise<QBChatDialog>((resolve, reject) => {
|
|
336
|
+
QB.chat.dialog.create(
|
|
337
|
+
// {
|
|
338
|
+
// name: dialogName || '-',
|
|
339
|
+
// occupants_ids: [userIds],
|
|
340
|
+
// type: 2,
|
|
341
|
+
// photo: data?.photo,
|
|
342
|
+
// },
|
|
343
|
+
params,
|
|
344
|
+
(error, chat) => {
|
|
345
|
+
if (error) {
|
|
346
|
+
reject(stringifyError(error));
|
|
347
|
+
} else {
|
|
348
|
+
resolve(chat);
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
);
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
export function QBUpdateDialog(
|
|
356
|
+
dialogId: QBChatDialog['_id'],
|
|
357
|
+
data: Dictionary<unknown>,
|
|
358
|
+
) {
|
|
359
|
+
return new Promise<QBChatDialog>((resolve, reject) => {
|
|
360
|
+
QB.chat.dialog.update(dialogId, data, (error, chat) => {
|
|
361
|
+
if (error) {
|
|
362
|
+
reject(stringifyError(error));
|
|
363
|
+
} else {
|
|
364
|
+
resolve(chat);
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
export function QBJoinDialog(dialogId: QBChatDialog['_id']) {
|
|
371
|
+
return new Promise((resolve, reject) => {
|
|
372
|
+
const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);
|
|
373
|
+
|
|
374
|
+
QB.chat.muc.join(dialogJid, (error, res) => {
|
|
375
|
+
if (error) {
|
|
376
|
+
reject(stringifyError(error));
|
|
377
|
+
} else {
|
|
378
|
+
resolve(res);
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
export function QBDeleteDialog(dialogIds: Array<QBChatDialog['_id']>) {
|
|
385
|
+
return new Promise<void>((resolve, reject) => {
|
|
386
|
+
QB.chat.dialog.delete(dialogIds, (error) => {
|
|
387
|
+
if (error) {
|
|
388
|
+
reject(stringifyError(error));
|
|
389
|
+
} else {
|
|
390
|
+
resolve();
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export function QBLeaveDialog(dialogId: QBChatDialog['_id']) {
|
|
397
|
+
return new Promise((resolve, reject) => {
|
|
398
|
+
const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);
|
|
399
|
+
|
|
400
|
+
QB.chat.muc.leave(dialogJid, (error, res) => {
|
|
401
|
+
if (error) {
|
|
402
|
+
reject(stringifyError(error));
|
|
403
|
+
} else {
|
|
404
|
+
resolve(res);
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
export function QBGetInfoFile(fileId: QBContentObject['id']) {
|
|
411
|
+
return new Promise((resolve, reject) => {
|
|
412
|
+
QB.content.getInfo(fileId, (error, response) => {
|
|
413
|
+
if (error) {
|
|
414
|
+
reject(stringifyError(error));
|
|
415
|
+
} else {
|
|
416
|
+
resolve(response);
|
|
417
|
+
}
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
export function QBDeleteContent(contentId: QBContentObject['id']) {
|
|
423
|
+
return new Promise((resolve, reject) => {
|
|
424
|
+
QB.content.delete(contentId, (error, response) => {
|
|
425
|
+
if (error) {
|
|
426
|
+
reject(stringifyError(error));
|
|
427
|
+
} else {
|
|
428
|
+
resolve(response);
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
});
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
export function QBCreateAndUploadContent(paramContent: QBContentParam) {
|
|
435
|
+
return new Promise((resolve, reject) => {
|
|
436
|
+
QB.content.createAndUpload(paramContent, (error, response) => {
|
|
437
|
+
if (error) {
|
|
438
|
+
reject(stringifyError(error));
|
|
439
|
+
} else {
|
|
440
|
+
resolve(response);
|
|
441
|
+
}
|
|
442
|
+
});
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
export function QBChatGetMessages(
|
|
447
|
+
dialogId: QBChatDialog['_id'],
|
|
448
|
+
skip = 0,
|
|
449
|
+
limit = 100,
|
|
450
|
+
) {
|
|
451
|
+
return new Promise<GetMessagesResult & { dialogId: QBChatDialog['_id'] }>(
|
|
452
|
+
(resolve, reject) => {
|
|
453
|
+
QB.chat.message.list(
|
|
454
|
+
{
|
|
455
|
+
chat_dialog_id: dialogId,
|
|
456
|
+
sort_desc: 'date_sent',
|
|
457
|
+
limit,
|
|
458
|
+
skip,
|
|
459
|
+
mark_as_read: 0,
|
|
460
|
+
},
|
|
461
|
+
(error, messages) => {
|
|
462
|
+
if (error) {
|
|
463
|
+
reject(stringifyError(error));
|
|
464
|
+
} else {
|
|
465
|
+
resolve({ ...messages, dialogId });
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
);
|
|
469
|
+
},
|
|
470
|
+
);
|
|
471
|
+
}
|
|
472
|
+
//
|
|
473
|
+
export function QBSendIsTypingStatus(
|
|
474
|
+
dialog: QBChatDialog,
|
|
475
|
+
senderId: QBUser['id'],
|
|
476
|
+
) {
|
|
477
|
+
const isPrivate: QBChatDialogType = 3;
|
|
478
|
+
const jidOrUserid =
|
|
479
|
+
dialog.type === isPrivate
|
|
480
|
+
? QB.chat.helpers.getRecipientId(dialog.occupants_ids, senderId)
|
|
481
|
+
: QB.chat.helpers.getRoomJidFromDialogId(dialog._id);
|
|
482
|
+
|
|
483
|
+
// const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);
|
|
484
|
+
|
|
485
|
+
try {
|
|
486
|
+
QB.chat.sendIsTypingStatus(jidOrUserid);
|
|
487
|
+
} catch (e) {
|
|
488
|
+
console.log(JSON.stringify(e));
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
export function QBSendIsStopTypingStatus(
|
|
492
|
+
dialog: QBChatDialog,
|
|
493
|
+
senderId: QBUser['id'],
|
|
494
|
+
) {
|
|
495
|
+
const isPrivate: QBChatDialogType = 3;
|
|
496
|
+
const jidOrUserid =
|
|
497
|
+
dialog.type === isPrivate
|
|
498
|
+
? QB.chat.helpers.getRecipientId(dialog.occupants_ids, senderId)
|
|
499
|
+
: QB.chat.helpers.getRoomJidFromDialogId(dialog._id);
|
|
500
|
+
|
|
501
|
+
// const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dialogId);
|
|
502
|
+
|
|
503
|
+
try {
|
|
504
|
+
QB.chat.sendIsStopTypingStatus(jidOrUserid);
|
|
505
|
+
} catch (e) {
|
|
506
|
+
console.log(JSON.stringify(e));
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
//
|
|
510
|
+
|
|
511
|
+
export function QBChatSendMessage(to: string, message: QBChatNewMessage) {
|
|
512
|
+
return new Promise<QBChatMessage['_id']>((resolve) => {
|
|
513
|
+
resolve(QB.chat.send(to, message));
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
export function QBChatSendSystemMessage(
|
|
518
|
+
to: QBUser['id'] | string,
|
|
519
|
+
message: { extension: QBSystemMessage['extension'] },
|
|
520
|
+
) {
|
|
521
|
+
return new Promise<QBSystemMessage['id']>((resolve) => {
|
|
522
|
+
resolve(QB.chat.sendSystemMessage(to, message));
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
export function QBChatMarkMessageRead(params: QBMessageStatusParams) {
|
|
527
|
+
QB.chat.sendReadStatus(params);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
export function QBWebRTCSessionGetUserMedia(
|
|
531
|
+
session: QBWebRTCSession,
|
|
532
|
+
params: QBGetUserMediaParams,
|
|
533
|
+
) {
|
|
534
|
+
return new Promise<MediaStream | undefined>((resolve, reject) => {
|
|
535
|
+
session.getUserMedia({ ...params }, (error, stream) => {
|
|
536
|
+
if (error) {
|
|
537
|
+
reject(error);
|
|
538
|
+
} else {
|
|
539
|
+
resolve(stream);
|
|
540
|
+
}
|
|
541
|
+
});
|
|
542
|
+
});
|
|
543
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="react-scripts" />
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const getDateShortFormatEU = (dateTimeToFormat: number) => {
|
|
2
|
+
const dateStr = new Date(dateTimeToFormat).toLocaleDateString('en-us', {
|
|
3
|
+
// dateStyle: 'medium',
|
|
4
|
+
day: '2-digit',
|
|
5
|
+
month: 'short',
|
|
6
|
+
weekday: 'short',
|
|
7
|
+
});
|
|
8
|
+
const result = dateStr.split(',');
|
|
9
|
+
const dayMonthPart = `${result[1]}, ${result[0]}`;
|
|
10
|
+
|
|
11
|
+
return dayMonthPart;
|
|
12
|
+
};
|
|
13
|
+
export const getTimeShort24hFormat = (dateTimeToFormat: number) => {
|
|
14
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleTimeString
|
|
15
|
+
return new Date(dateTimeToFormat).toLocaleTimeString('en-us', {
|
|
16
|
+
timeStyle: 'short',
|
|
17
|
+
hour12: false,
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const formatShortTime3 = (dateTimeToFormat: number) => {
|
|
22
|
+
return new Date(dateTimeToFormat).toLocaleTimeString('en-us', {
|
|
23
|
+
// weekday: 'long',
|
|
24
|
+
// year: 'numeric',
|
|
25
|
+
// month: 'long',
|
|
26
|
+
// day: 'numeric',
|
|
27
|
+
timeStyle: 'full',
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export const formatShortTime4 = (dateTimeToFormat: number) => {
|
|
31
|
+
return new Date(dateTimeToFormat).toLocaleDateString();
|
|
32
|
+
};
|
|
33
|
+
/*
|
|
34
|
+
|
|
35
|
+
*/
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export const jsonParse = <P>(text: string): P | string => {
|
|
2
|
+
try {
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
return JSON.parse<P>(text);
|
|
6
|
+
} catch (error) {
|
|
7
|
+
return text;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const parseErrorObject = (data: Dictionary<string | string[]>) =>
|
|
12
|
+
Object.keys(data)
|
|
13
|
+
.map((key) => {
|
|
14
|
+
const field = data[key];
|
|
15
|
+
|
|
16
|
+
return Array.isArray(field)
|
|
17
|
+
? `${key} ${field.join('')}`
|
|
18
|
+
: `${key} ${field}`;
|
|
19
|
+
})
|
|
20
|
+
.join(' ')
|
|
21
|
+
.replace(/errors\s?/, '');
|
|
22
|
+
|
|
23
|
+
export const parseErrorMessage = (message: string) => {
|
|
24
|
+
const data = jsonParse<string | string[] | Dictionary<string | string[]>>(
|
|
25
|
+
message,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
if (typeof data === 'string') {
|
|
29
|
+
return data;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (Array.isArray(data)) {
|
|
33
|
+
return data.join('');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (typeof data === 'object') {
|
|
37
|
+
return parseErrorObject(data);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return data;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export function isQBError(error: unknown): error is QBError {
|
|
44
|
+
return typeof error === 'object' && error !== null && 'message' in error;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function stringifyError(error: unknown) {
|
|
48
|
+
if (typeof error === 'string') return error;
|
|
49
|
+
|
|
50
|
+
if (error && typeof error === 'object') {
|
|
51
|
+
const dataError:
|
|
52
|
+
| { detail?: string; message?: string }
|
|
53
|
+
| Dictionary<string | string[]> = error;
|
|
54
|
+
|
|
55
|
+
if (dataError.detail) {
|
|
56
|
+
return parseErrorMessage(dataError.detail);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (dataError?.message) {
|
|
60
|
+
return parseErrorMessage(dataError.message);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return parseErrorObject(dataError);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return JSON.stringify(error);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const isSessionDoesNotExistError = (error: string) => {
|
|
70
|
+
return (
|
|
71
|
+
error.toUpperCase().replaceAll(' ', '_').replace(/[.:]/g, '') ===
|
|
72
|
+
'BASE_REQUIRED_SESSION_DOES_NOT_EXIST'
|
|
73
|
+
);
|
|
74
|
+
};
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "./dist/",
|
|
4
|
+
"sourceMap": true,
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"target": "es5",
|
|
7
|
+
"lib": [
|
|
8
|
+
"es2015",
|
|
9
|
+
"dom",
|
|
10
|
+
"dom.iterable",
|
|
11
|
+
"esnext"
|
|
12
|
+
],
|
|
13
|
+
"allowJs": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"esModuleInterop": true,
|
|
16
|
+
"allowSyntheticDefaultImports": true,
|
|
17
|
+
"strict": true,
|
|
18
|
+
"forceConsistentCasingInFileNames": true,
|
|
19
|
+
"noFallthroughCasesInSwitch": true,
|
|
20
|
+
"module": "esnext",
|
|
21
|
+
"moduleResolution": "node",
|
|
22
|
+
"resolveJsonModule": true,
|
|
23
|
+
"isolatedModules": true,
|
|
24
|
+
"noEmit": true,
|
|
25
|
+
"jsx": "react-jsx",
|
|
26
|
+
},
|
|
27
|
+
"include": [
|
|
28
|
+
"src",
|
|
29
|
+
"global.d.ts"
|
|
30
|
+
],
|
|
31
|
+
"exclude": ["node_modules", "dist"]
|
|
32
|
+
|
|
33
|
+
}
|
package/typedoc.json
ADDED