stream-chat-react-native-core 4.10.0 → 5.0.0-offline-support.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/lib/commonjs/components/Attachment/Attachment.js +1 -1
- package/lib/commonjs/components/Attachment/AttachmentActions.js +1 -1
- package/lib/commonjs/components/Attachment/Card.js +1 -1
- package/lib/commonjs/components/Attachment/FileAttachment.js +1 -1
- package/lib/commonjs/components/Attachment/FileAttachmentGroup.js +1 -1
- package/lib/commonjs/components/Attachment/FileIcon.js +1 -1
- package/lib/commonjs/components/Attachment/GallaryImage.js +1 -1
- package/lib/commonjs/components/Attachment/Gallery.js +1 -1
- package/lib/commonjs/components/Attachment/Giphy.js +1 -1
- package/lib/commonjs/components/Attachment/ImageLoadingFailedIndicator.js +1 -1
- package/lib/commonjs/components/Attachment/ImageLoadingIndicator.js +1 -1
- package/lib/commonjs/components/Attachment/VideoThumbnail.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/AttachmentPicker.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/AttachmentSelectionBar.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/commonjs/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteInput.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
- package/lib/commonjs/components/AutoCompleteInput/AutoCompleteSuggestionList.js +1 -1
- package/lib/commonjs/components/Avatar/Avatar.js +29 -16
- package/lib/commonjs/components/Avatar/Avatar.js.map +1 -1
- package/lib/commonjs/components/Avatar/GroupAvatar.js +26 -19
- package/lib/commonjs/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +227 -257
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js +2 -0
- package/lib/commonjs/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js +2 -0
- package/lib/commonjs/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelList.js +33 -3
- package/lib/commonjs/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListFooterLoadingIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderErrorIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListLoadingIndicator.js +1 -1
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js +20 -8
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/commonjs/components/ChannelList/Skeleton.js +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/handleEventToSyncDB.js +187 -0
- package/lib/commonjs/components/ChannelList/hooks/listeners/handleEventToSyncDB.js.map +1 -0
- package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelDeleted.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelHidden.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelTruncated.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelUpdated.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.js +128 -18
- package/lib/commonjs/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js +2 -2
- package/lib/commonjs/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/listeners/useSyncDatabase.js +34 -0
- package/lib/commonjs/components/ChannelList/hooks/listeners/useSyncDatabase.js.map +1 -0
- package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js +4 -4
- package/lib/commonjs/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js +47 -21
- package/lib/commonjs/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js +7 -9
- package/lib/commonjs/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js +8 -6
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMessenger.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewMutedStatus.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewStatus.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/commonjs/components/ChannelPreview/ChannelPreviewUnreadCount.js +1 -1
- package/lib/commonjs/components/Chat/Chat.js +18 -7
- package/lib/commonjs/components/Chat/Chat.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js +3 -1
- package/lib/commonjs/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/commonjs/components/Chat/hooks/useMutedUsers.js +3 -3
- package/lib/commonjs/components/Chat/hooks/useMutedUsers.js.map +1 -1
- package/lib/commonjs/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryImage.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/AnimatedGalleryVideo.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryFooter.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGrid.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ImageGridHandle.js +1 -1
- package/lib/commonjs/components/ImageGallery/components/ProgressControl.js +1 -1
- package/lib/commonjs/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDot.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingDots.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/commonjs/components/Indicators/LoadingIndicator.js +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleView.js +1 -1
- package/lib/commonjs/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/commonjs/components/Message/Message.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageAvatar.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageDeleted.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageFooter.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessagePinnedHeader.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageReplies.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageRepliesAvatars.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageStatus.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageTextContainer.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/ReactionList.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.js +1 -1
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.test.js +1 -1
- package/lib/commonjs/components/Message/hooks/useMessageActions.js +1 -1
- package/lib/commonjs/components/MessageInput/AttachButton.js +1 -1
- package/lib/commonjs/components/MessageInput/CommandsButton.js +1 -1
- package/lib/commonjs/components/MessageInput/CooldownTimer.js +1 -1
- package/lib/commonjs/components/MessageInput/FileUploadPreview.js +1 -1
- package/lib/commonjs/components/MessageInput/ImageUploadPreview.js +1 -1
- package/lib/commonjs/components/MessageInput/InputButtons.js +1 -1
- package/lib/commonjs/components/MessageInput/MessageInput.js +1 -1
- package/lib/commonjs/components/MessageInput/MoreOptionsButton.js +1 -1
- package/lib/commonjs/components/MessageInput/SendButton.js +1 -1
- package/lib/commonjs/components/MessageInput/SendMessageDisallowedIndicator.js +1 -1
- package/lib/commonjs/components/MessageInput/ShowThreadMessageInChannelButton.js +1 -1
- package/lib/commonjs/components/MessageInput/UploadProgressIndicator.js +1 -1
- package/lib/commonjs/components/MessageInput/components/InputEditingStateHeader.js +1 -1
- package/lib/commonjs/components/MessageInput/components/InputGiphySearch.js +1 -1
- package/lib/commonjs/components/MessageInput/components/InputReplyStateHeader.js +1 -1
- package/lib/commonjs/components/MessageList/DateHeader.js +1 -1
- package/lib/commonjs/components/MessageList/InlineDateSeparator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreRecentIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineLoadingMoreThreadIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/MessageList.js +135 -107
- package/lib/commonjs/components/MessageList/MessageList.js.map +1 -1
- package/lib/commonjs/components/MessageList/MessageSystem.js +1 -1
- package/lib/commonjs/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/ScrollToBottomButton.js +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicator.js +1 -1
- package/lib/commonjs/components/MessageList/TypingIndicatorContainer.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionList.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageActionListItem.js +1 -1
- package/lib/commonjs/components/MessageOverlay/MessageOverlay.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionList.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactions.js +1 -1
- package/lib/commonjs/components/MessageOverlay/OverlayReactionsAvatar.js +1 -1
- package/lib/commonjs/components/RTLComponents/WritingDirectionAwareText.js +1 -1
- package/lib/commonjs/components/Reply/Reply.js +1 -1
- package/lib/commonjs/components/Spinner/Spinner.js +1 -1
- package/lib/commonjs/components/Thread/Thread.js +1 -1
- package/lib/commonjs/components/Thread/components/ThreadFooterComponent.js +1 -1
- package/lib/commonjs/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +1 -1
- package/lib/commonjs/contexts/attachmentPickerContext/AttachmentPickerContext.js +1 -1
- package/lib/commonjs/contexts/channelContext/ChannelContext.js +3 -3
- package/lib/commonjs/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.js +1 -1
- package/lib/commonjs/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
- package/lib/commonjs/contexts/chatContext/ChatContext.js +3 -3
- package/lib/commonjs/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.js +1 -1
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.js +1 -1
- package/lib/commonjs/contexts/messageContext/MessageContext.js +1 -1
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.js +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/MessageOverlayContext.js +1 -1
- package/lib/commonjs/contexts/messageOverlayContext/hooks/useResettableState.test.js +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.js +1 -1
- package/lib/commonjs/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +3 -3
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.js +1 -1
- package/lib/commonjs/contexts/themeContext/ThemeContext.js +1 -1
- package/lib/commonjs/contexts/threadContext/ThreadContext.js +1 -1
- package/lib/commonjs/contexts/translationContext/TranslationContext.js +1 -1
- package/lib/commonjs/contexts/typingContext/TypingContext.js +1 -1
- package/lib/commonjs/hooks/useImageErrorHandler.js +35 -0
- package/lib/commonjs/hooks/useImageErrorHandler.js.map +1 -0
- package/lib/commonjs/icons/ArrowRight.js +1 -1
- package/lib/commonjs/icons/AtMentions.js +1 -1
- package/lib/commonjs/icons/Attach.js +1 -1
- package/lib/commonjs/icons/Audio.js +1 -1
- package/lib/commonjs/icons/CSV.js +1 -1
- package/lib/commonjs/icons/Camera.js +1 -1
- package/lib/commonjs/icons/Check.js +1 -1
- package/lib/commonjs/icons/CheckAll.js +1 -1
- package/lib/commonjs/icons/CheckSend.js +1 -1
- package/lib/commonjs/icons/CircleClose.js +1 -1
- package/lib/commonjs/icons/CirclePlus.js +1 -1
- package/lib/commonjs/icons/CircleRight.js +1 -1
- package/lib/commonjs/icons/Close.js +1 -1
- package/lib/commonjs/icons/Copy.js +1 -1
- package/lib/commonjs/icons/CurveLineLeftUp.js +1 -1
- package/lib/commonjs/icons/DOC.js +1 -1
- package/lib/commonjs/icons/DOCX.js +1 -1
- package/lib/commonjs/icons/Delete.js +1 -1
- package/lib/commonjs/icons/Down.js +1 -1
- package/lib/commonjs/icons/DownloadArrow.js +1 -1
- package/lib/commonjs/icons/DownloadCloud.js +1 -1
- package/lib/commonjs/icons/Edit.js +1 -1
- package/lib/commonjs/icons/Error.js +1 -1
- package/lib/commonjs/icons/Eye.js +1 -1
- package/lib/commonjs/icons/Flag.js +1 -1
- package/lib/commonjs/icons/Folder.js +1 -1
- package/lib/commonjs/icons/GenericFile.js +1 -1
- package/lib/commonjs/icons/GiphyIcon.js +1 -1
- package/lib/commonjs/icons/Grid.js +1 -1
- package/lib/commonjs/icons/Group.js +1 -1
- package/lib/commonjs/icons/HTML.js +1 -1
- package/lib/commonjs/icons/Imgur.js +1 -1
- package/lib/commonjs/icons/LOLReaction.js +1 -1
- package/lib/commonjs/icons/Lightning.js +1 -1
- package/lib/commonjs/icons/Link.js +1 -1
- package/lib/commonjs/icons/Loading.js +1 -1
- package/lib/commonjs/icons/Logo.js +1 -1
- package/lib/commonjs/icons/LoveReaction.js +1 -1
- package/lib/commonjs/icons/MD.js +1 -1
- package/lib/commonjs/icons/MailOpen.js +1 -1
- package/lib/commonjs/icons/MenuPointHorizontal.js +1 -1
- package/lib/commonjs/icons/MenuPointVertical.js +1 -1
- package/lib/commonjs/icons/MessageFlag.js +1 -1
- package/lib/commonjs/icons/MessageIcon.js +1 -1
- package/lib/commonjs/icons/Mute.js +1 -1
- package/lib/commonjs/icons/Notification.js +1 -1
- package/lib/commonjs/icons/ODT.js +1 -1
- package/lib/commonjs/icons/PDF.js +1 -1
- package/lib/commonjs/icons/PPT.js +1 -1
- package/lib/commonjs/icons/PPTX.js +1 -1
- package/lib/commonjs/icons/Pause.js +1 -1
- package/lib/commonjs/icons/Picture.js +1 -1
- package/lib/commonjs/icons/Pin.js +1 -1
- package/lib/commonjs/icons/PinHeader.js +1 -1
- package/lib/commonjs/icons/Play.js +1 -1
- package/lib/commonjs/icons/RAR.js +1 -1
- package/lib/commonjs/icons/RTF.js +1 -1
- package/lib/commonjs/icons/Recorder.js +1 -1
- package/lib/commonjs/icons/Refresh.js +1 -1
- package/lib/commonjs/icons/SEVEN_Z.js +1 -1
- package/lib/commonjs/icons/Search.js +1 -1
- package/lib/commonjs/icons/SendRight.js +1 -1
- package/lib/commonjs/icons/SendUp.js +1 -1
- package/lib/commonjs/icons/Share.js +1 -1
- package/lib/commonjs/icons/ShareRightArrow.js +1 -1
- package/lib/commonjs/icons/Smile.js +1 -1
- package/lib/commonjs/icons/Sound.js +1 -1
- package/lib/commonjs/icons/TAR.js +1 -1
- package/lib/commonjs/icons/TXT.js +1 -1
- package/lib/commonjs/icons/ThreadReply.js +1 -1
- package/lib/commonjs/icons/ThumbsDownReaction.js +1 -1
- package/lib/commonjs/icons/ThumbsUpReaction.js +1 -1
- package/lib/commonjs/icons/Time.js +1 -1
- package/lib/commonjs/icons/Unknown.js +1 -1
- package/lib/commonjs/icons/Unpin.js +1 -1
- package/lib/commonjs/icons/User.js +1 -1
- package/lib/commonjs/icons/UserAdd.js +1 -1
- package/lib/commonjs/icons/UserAdmin.js +1 -1
- package/lib/commonjs/icons/UserDelete.js +1 -1
- package/lib/commonjs/icons/UserMinus.js +1 -1
- package/lib/commonjs/icons/Video.js +1 -1
- package/lib/commonjs/icons/Warning.js +1 -1
- package/lib/commonjs/icons/WutReaction.js +1 -1
- package/lib/commonjs/icons/XLS.js +1 -1
- package/lib/commonjs/icons/XLSX.js +1 -1
- package/lib/commonjs/icons/ZIP.js +1 -1
- package/lib/commonjs/icons/utils/base.js +1 -1
- package/lib/commonjs/index.js +11 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mock-builders/DB/consts.js +15 -0
- package/lib/commonjs/mock-builders/DB/consts.js.map +1 -0
- package/lib/commonjs/mock-builders/DB/mock.js +125 -0
- package/lib/commonjs/mock-builders/DB/mock.js.map +1 -0
- package/lib/commonjs/mock-builders/api/channelMocks.js +1 -0
- package/lib/commonjs/mock-builders/api/channelMocks.js.map +1 -1
- package/lib/commonjs/mock-builders/event/memberAdded.js +17 -0
- package/lib/commonjs/mock-builders/event/memberAdded.js.map +1 -0
- package/lib/commonjs/mock-builders/event/memberRemoved.js +17 -0
- package/lib/commonjs/mock-builders/event/memberRemoved.js.map +1 -0
- package/lib/commonjs/mock-builders/event/memberUpdated.js +17 -0
- package/lib/commonjs/mock-builders/event/memberUpdated.js.map +1 -0
- package/lib/commonjs/mock-builders/event/reactionDeleted.js +18 -0
- package/lib/commonjs/mock-builders/event/reactionDeleted.js.map +1 -0
- package/lib/commonjs/mock-builders/event/reactionNew.js +18 -0
- package/lib/commonjs/mock-builders/event/reactionNew.js.map +1 -0
- package/lib/commonjs/mock-builders/event/reactionUpdated.js +18 -0
- package/lib/commonjs/mock-builders/event/reactionUpdated.js.map +1 -0
- package/lib/commonjs/mock-builders/generator/reaction.js +1 -1
- package/lib/commonjs/mock-builders/generator/reaction.js.map +1 -1
- package/lib/commonjs/store/QuickSqliteClient.js +148 -0
- package/lib/commonjs/store/QuickSqliteClient.js.map +1 -0
- package/lib/commonjs/store/apis/deleteChannel.js +26 -0
- package/lib/commonjs/store/apis/deleteChannel.js.map +1 -0
- package/lib/commonjs/store/apis/deleteMember.js +28 -0
- package/lib/commonjs/store/apis/deleteMember.js.map +1 -0
- package/lib/commonjs/store/apis/deleteMessagesForChannel.js +26 -0
- package/lib/commonjs/store/apis/deleteMessagesForChannel.js.map +1 -0
- package/lib/commonjs/store/apis/deleteReactions.js +28 -0
- package/lib/commonjs/store/apis/deleteReactions.js.map +1 -0
- package/lib/commonjs/store/apis/getAllChannelIds.js +16 -0
- package/lib/commonjs/store/apis/getAllChannelIds.js.map +1 -0
- package/lib/commonjs/store/apis/getChannelMessages.js +45 -0
- package/lib/commonjs/store/apis/getChannelMessages.js.map +1 -0
- package/lib/commonjs/store/apis/getChannels.js +60 -0
- package/lib/commonjs/store/apis/getChannels.js.map +1 -0
- package/lib/commonjs/store/apis/getLastSyncedAt.js +23 -0
- package/lib/commonjs/store/apis/getLastSyncedAt.js.map +1 -0
- package/lib/commonjs/store/apis/getMembers.js +25 -0
- package/lib/commonjs/store/apis/getMembers.js.map +1 -0
- package/lib/commonjs/store/apis/getReads.js +25 -0
- package/lib/commonjs/store/apis/getReads.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectChannelIdsForFilterSort.js +31 -0
- package/lib/commonjs/store/apis/queries/selectChannelIdsForFilterSort.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectChannels.js +30 -0
- package/lib/commonjs/store/apis/queries/selectChannels.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectMembersForChannels.js +27 -0
- package/lib/commonjs/store/apis/queries/selectMembersForChannels.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectMessagesForChannels.js +27 -0
- package/lib/commonjs/store/apis/queries/selectMessagesForChannels.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectReactionsForMessages.js +27 -0
- package/lib/commonjs/store/apis/queries/selectReactionsForMessages.js.map +1 -0
- package/lib/commonjs/store/apis/queries/selectReadsForChannels.js +27 -0
- package/lib/commonjs/store/apis/queries/selectReadsForChannels.js.map +1 -0
- package/lib/commonjs/store/apis/updateMessage.js +69 -0
- package/lib/commonjs/store/apis/updateMessage.js.map +1 -0
- package/lib/commonjs/store/apis/updateReaction.js +53 -0
- package/lib/commonjs/store/apis/updateReaction.js.map +1 -0
- package/lib/commonjs/store/apis/upsertChannelData.js +26 -0
- package/lib/commonjs/store/apis/upsertChannelData.js.map +1 -0
- package/lib/commonjs/store/apis/upsertChannels.js +83 -0
- package/lib/commonjs/store/apis/upsertChannels.js.map +1 -0
- package/lib/commonjs/store/apis/upsertCidsForQuery.js +34 -0
- package/lib/commonjs/store/apis/upsertCidsForQuery.js.map +1 -0
- package/lib/commonjs/store/apis/upsertLastSyncedAt.js +22 -0
- package/lib/commonjs/store/apis/upsertLastSyncedAt.js.map +1 -0
- package/lib/commonjs/store/apis/upsertMembers.js +39 -0
- package/lib/commonjs/store/apis/upsertMembers.js.map +1 -0
- package/lib/commonjs/store/apis/upsertMessages.js +52 -0
- package/lib/commonjs/store/apis/upsertMessages.js.map +1 -0
- package/lib/commonjs/store/apis/upsertReads.js +39 -0
- package/lib/commonjs/store/apis/upsertReads.js.map +1 -0
- package/lib/commonjs/store/apis/utils/convertFilterSortToQuery.js +13 -0
- package/lib/commonjs/store/apis/utils/convertFilterSortToQuery.js.map +1 -0
- package/lib/commonjs/store/constants.js +11 -0
- package/lib/commonjs/store/constants.js.map +1 -0
- package/lib/commonjs/store/mappers/mapChannelDataToStorable.js +67 -0
- package/lib/commonjs/store/mappers/mapChannelDataToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapDateTimeToStorable.js +12 -0
- package/lib/commonjs/store/mappers/mapDateTimeToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapMemberToStorable.js +39 -0
- package/lib/commonjs/store/mappers/mapMemberToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapMessageToStorable.js +42 -0
- package/lib/commonjs/store/mappers/mapMessageToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapReactionToStorable.js +34 -0
- package/lib/commonjs/store/mappers/mapReactionToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapReadToStorable.js +23 -0
- package/lib/commonjs/store/mappers/mapReadToStorable.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToChannel.js +65 -0
- package/lib/commonjs/store/mappers/mapStorableToChannel.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToMember.js +38 -0
- package/lib/commonjs/store/mappers/mapStorableToMember.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToMessage.js +50 -0
- package/lib/commonjs/store/mappers/mapStorableToMessage.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToReaction.js +31 -0
- package/lib/commonjs/store/mappers/mapStorableToReaction.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToRead.js +20 -0
- package/lib/commonjs/store/mappers/mapStorableToRead.js.map +1 -0
- package/lib/commonjs/store/mappers/mapStorableToUser.js +31 -0
- package/lib/commonjs/store/mappers/mapStorableToUser.js.map +1 -0
- package/lib/commonjs/store/mappers/mapUserToStorable.js +34 -0
- package/lib/commonjs/store/mappers/mapUserToStorable.js.map +1 -0
- package/lib/commonjs/store/schema.js +161 -0
- package/lib/commonjs/store/schema.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/appendWhereCluase.js +37 -0
- package/lib/commonjs/store/sqlite-utils/appendWhereCluase.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createCreateTableQuery.js +35 -0
- package/lib/commonjs/store/sqlite-utils/createCreateTableQuery.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createDeleteQuery.js +14 -0
- package/lib/commonjs/store/sqlite-utils/createDeleteQuery.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createSelectQuery.js +26 -0
- package/lib/commonjs/store/sqlite-utils/createSelectQuery.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createUpdateQuery.js +29 -0
- package/lib/commonjs/store/sqlite-utils/createUpdateQuery.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/createUpsertQuery.js +30 -0
- package/lib/commonjs/store/sqlite-utils/createUpsertQuery.js.map +1 -0
- package/lib/commonjs/store/sqlite-utils/printRow.js +33 -0
- package/lib/commonjs/store/sqlite-utils/printRow.js.map +1 -0
- package/lib/commonjs/store/types.js +4 -0
- package/lib/commonjs/store/types.js.map +1 -0
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +1 -1
- package/lib/module/components/Attachment/AttachmentActions.js +1 -1
- package/lib/module/components/Attachment/Card.js +1 -1
- package/lib/module/components/Attachment/FileAttachment.js +1 -1
- package/lib/module/components/Attachment/FileAttachmentGroup.js +1 -1
- package/lib/module/components/Attachment/FileIcon.js +1 -1
- package/lib/module/components/Attachment/GallaryImage.js +1 -1
- package/lib/module/components/Attachment/Gallery.js +1 -1
- package/lib/module/components/Attachment/Giphy.js +1 -1
- package/lib/module/components/Attachment/ImageLoadingFailedIndicator.js +1 -1
- package/lib/module/components/Attachment/ImageLoadingIndicator.js +1 -1
- package/lib/module/components/Attachment/VideoThumbnail.js +1 -1
- package/lib/module/components/AttachmentPicker/AttachmentPicker.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerBottomSheetHandle.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerError.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentPickerErrorImage.js +1 -1
- package/lib/module/components/AttachmentPicker/components/AttachmentSelectionBar.js +1 -1
- package/lib/module/components/AttachmentPicker/components/CameraSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/FileSelectorIcon.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageOverlaySelectedComponent.js +1 -1
- package/lib/module/components/AttachmentPicker/components/ImageSelectorIcon.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteInput.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionCommandIcon.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionHeader.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionItem.js +1 -1
- package/lib/module/components/AutoCompleteInput/AutoCompleteSuggestionList.js +1 -1
- package/lib/module/components/Avatar/Avatar.js +29 -16
- package/lib/module/components/Avatar/Avatar.js.map +1 -1
- package/lib/module/components/Avatar/GroupAvatar.js +26 -19
- package/lib/module/components/Avatar/GroupAvatar.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +227 -257
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js +2 -0
- package/lib/module/components/Channel/hooks/useCreateChannelContext.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js +2 -0
- package/lib/module/components/Channel/hooks/useCreatePaginatedMessageListContext.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelList.js +33 -3
- package/lib/module/components/ChannelList/ChannelList.js.map +1 -1
- package/lib/module/components/ChannelList/ChannelListFooterLoadingIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderErrorIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListHeaderNetworkDownIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListLoadingIndicator.js +1 -1
- package/lib/module/components/ChannelList/ChannelListMessenger.js +20 -8
- package/lib/module/components/ChannelList/ChannelListMessenger.js.map +1 -1
- package/lib/module/components/ChannelList/Skeleton.js +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/handleEventToSyncDB.js +187 -0
- package/lib/module/components/ChannelList/hooks/listeners/handleEventToSyncDB.js.map +1 -0
- package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useAddedToChannelNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelDeleted.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelDeleted.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelHidden.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelHidden.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelTruncated.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelTruncated.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelUpdated.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelUpdated.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useChannelVisible.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.js +128 -18
- package/lib/module/components/ChannelList/hooks/listeners/useConnectionRecovered.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessage.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useNewMessageNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js +2 -2
- package/lib/module/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/listeners/useSyncDatabase.js +34 -0
- package/lib/module/components/ChannelList/hooks/listeners/useSyncDatabase.js.map +1 -0
- package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js +4 -4
- package/lib/module/components/ChannelList/hooks/listeners/useUserPresence.js.map +1 -1
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js +47 -21
- package/lib/module/components/ChannelList/hooks/usePaginatedChannels.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelAvatar.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreview.js +7 -9
- package/lib/module/components/ChannelPreview/ChannelPreview.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js +8 -6
- package/lib/module/components/ChannelPreview/ChannelPreviewMessage.js.map +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMessenger.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewMutedStatus.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewStatus.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewTitle.js +1 -1
- package/lib/module/components/ChannelPreview/ChannelPreviewUnreadCount.js +1 -1
- package/lib/module/components/Chat/Chat.js +18 -7
- package/lib/module/components/Chat/Chat.js.map +1 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js +3 -1
- package/lib/module/components/Chat/hooks/useCreateChatContext.js.map +1 -1
- package/lib/module/components/Chat/hooks/useMutedUsers.js +3 -3
- package/lib/module/components/Chat/hooks/useMutedUsers.js.map +1 -1
- package/lib/module/components/ImageGallery/ImageGallery.js +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryImage.js +1 -1
- package/lib/module/components/ImageGallery/components/AnimatedGalleryVideo.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryFooter.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryHeader.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryOverlay.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGalleryVideoControl.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGrid.js +1 -1
- package/lib/module/components/ImageGallery/components/ImageGridHandle.js +1 -1
- package/lib/module/components/ImageGallery/components/ProgressControl.js +1 -1
- package/lib/module/components/Indicators/EmptyStateIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingDot.js +1 -1
- package/lib/module/components/Indicators/LoadingDots.js +1 -1
- package/lib/module/components/Indicators/LoadingErrorIndicator.js +1 -1
- package/lib/module/components/Indicators/LoadingIndicator.js +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleView.js +1 -1
- package/lib/module/components/KeyboardCompatibleView/KeyboardCompatibleViewFC.js +1 -1
- package/lib/module/components/Message/Message.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageAvatar.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageDeleted.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageFooter.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessagePinnedHeader.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageReplies.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageRepliesAvatars.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageStatus.js +1 -1
- package/lib/module/components/Message/MessageSimple/MessageTextContainer.js +1 -1
- package/lib/module/components/Message/MessageSimple/ReactionList.js +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.js +1 -1
- package/lib/module/components/Message/MessageSimple/utils/renderText.test.js +1 -1
- package/lib/module/components/Message/hooks/useMessageActions.js +1 -1
- package/lib/module/components/MessageInput/AttachButton.js +1 -1
- package/lib/module/components/MessageInput/CommandsButton.js +1 -1
- package/lib/module/components/MessageInput/CooldownTimer.js +1 -1
- package/lib/module/components/MessageInput/FileUploadPreview.js +1 -1
- package/lib/module/components/MessageInput/ImageUploadPreview.js +1 -1
- package/lib/module/components/MessageInput/InputButtons.js +1 -1
- package/lib/module/components/MessageInput/MessageInput.js +1 -1
- package/lib/module/components/MessageInput/MoreOptionsButton.js +1 -1
- package/lib/module/components/MessageInput/SendButton.js +1 -1
- package/lib/module/components/MessageInput/SendMessageDisallowedIndicator.js +1 -1
- package/lib/module/components/MessageInput/ShowThreadMessageInChannelButton.js +1 -1
- package/lib/module/components/MessageInput/UploadProgressIndicator.js +1 -1
- package/lib/module/components/MessageInput/components/InputEditingStateHeader.js +1 -1
- package/lib/module/components/MessageInput/components/InputGiphySearch.js +1 -1
- package/lib/module/components/MessageInput/components/InputReplyStateHeader.js +1 -1
- package/lib/module/components/MessageList/DateHeader.js +1 -1
- package/lib/module/components/MessageList/InlineDateSeparator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreRecentIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineLoadingMoreThreadIndicator.js +1 -1
- package/lib/module/components/MessageList/InlineUnreadIndicator.js +1 -1
- package/lib/module/components/MessageList/MessageList.js +135 -107
- package/lib/module/components/MessageList/MessageList.js.map +1 -1
- package/lib/module/components/MessageList/MessageSystem.js +1 -1
- package/lib/module/components/MessageList/NetworkDownIndicator.js +1 -1
- package/lib/module/components/MessageList/ScrollToBottomButton.js +1 -1
- package/lib/module/components/MessageList/TypingIndicator.js +1 -1
- package/lib/module/components/MessageList/TypingIndicatorContainer.js +1 -1
- package/lib/module/components/MessageOverlay/MessageActionList.js +1 -1
- package/lib/module/components/MessageOverlay/MessageActionListItem.js +1 -1
- package/lib/module/components/MessageOverlay/MessageOverlay.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayBackdrop.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionList.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactions.js +1 -1
- package/lib/module/components/MessageOverlay/OverlayReactionsAvatar.js +1 -1
- package/lib/module/components/RTLComponents/WritingDirectionAwareText.js +1 -1
- package/lib/module/components/Reply/Reply.js +1 -1
- package/lib/module/components/Spinner/Spinner.js +1 -1
- package/lib/module/components/Thread/Thread.js +1 -1
- package/lib/module/components/Thread/components/ThreadFooterComponent.js +1 -1
- package/lib/module/contexts/activeChannelsRefContext/ActiveChannelsRefContext.js +1 -1
- package/lib/module/contexts/attachmentPickerContext/AttachmentPickerContext.js +1 -1
- package/lib/module/contexts/channelContext/ChannelContext.js +3 -3
- package/lib/module/contexts/channelContext/ChannelContext.js.map +1 -1
- package/lib/module/contexts/channelsContext/ChannelsContext.js +1 -1
- package/lib/module/contexts/channelsStateContext/ChannelsStateContext.js +1 -1
- package/lib/module/contexts/chatContext/ChatContext.js +3 -3
- package/lib/module/contexts/chatContext/ChatContext.js.map +1 -1
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.js +1 -1
- package/lib/module/contexts/keyboardContext/KeyboardContext.js +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js +1 -1
- package/lib/module/contexts/messageInputContext/MessageInputContext.js +1 -1
- package/lib/module/contexts/messageOverlayContext/MessageOverlayContext.js +1 -1
- package/lib/module/contexts/messageOverlayContext/hooks/useResettableState.test.js +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js +1 -1
- package/lib/module/contexts/overlayContext/OverlayContext.js +1 -1
- package/lib/module/contexts/overlayContext/OverlayProvider.js +1 -1
- package/lib/module/contexts/ownCapabilitiesContext/OwnCapabilitiesContext.js +1 -1
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js +3 -3
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.js.map +1 -1
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.js +1 -1
- package/lib/module/contexts/themeContext/ThemeContext.js +1 -1
- package/lib/module/contexts/threadContext/ThreadContext.js +1 -1
- package/lib/module/contexts/translationContext/TranslationContext.js +1 -1
- package/lib/module/contexts/typingContext/TypingContext.js +1 -1
- package/lib/module/hooks/useImageErrorHandler.js +35 -0
- package/lib/module/hooks/useImageErrorHandler.js.map +1 -0
- package/lib/module/icons/ArrowRight.js +1 -1
- package/lib/module/icons/AtMentions.js +1 -1
- package/lib/module/icons/Attach.js +1 -1
- package/lib/module/icons/Audio.js +1 -1
- package/lib/module/icons/CSV.js +1 -1
- package/lib/module/icons/Camera.js +1 -1
- package/lib/module/icons/Check.js +1 -1
- package/lib/module/icons/CheckAll.js +1 -1
- package/lib/module/icons/CheckSend.js +1 -1
- package/lib/module/icons/CircleClose.js +1 -1
- package/lib/module/icons/CirclePlus.js +1 -1
- package/lib/module/icons/CircleRight.js +1 -1
- package/lib/module/icons/Close.js +1 -1
- package/lib/module/icons/Copy.js +1 -1
- package/lib/module/icons/CurveLineLeftUp.js +1 -1
- package/lib/module/icons/DOC.js +1 -1
- package/lib/module/icons/DOCX.js +1 -1
- package/lib/module/icons/Delete.js +1 -1
- package/lib/module/icons/Down.js +1 -1
- package/lib/module/icons/DownloadArrow.js +1 -1
- package/lib/module/icons/DownloadCloud.js +1 -1
- package/lib/module/icons/Edit.js +1 -1
- package/lib/module/icons/Error.js +1 -1
- package/lib/module/icons/Eye.js +1 -1
- package/lib/module/icons/Flag.js +1 -1
- package/lib/module/icons/Folder.js +1 -1
- package/lib/module/icons/GenericFile.js +1 -1
- package/lib/module/icons/GiphyIcon.js +1 -1
- package/lib/module/icons/Grid.js +1 -1
- package/lib/module/icons/Group.js +1 -1
- package/lib/module/icons/HTML.js +1 -1
- package/lib/module/icons/Imgur.js +1 -1
- package/lib/module/icons/LOLReaction.js +1 -1
- package/lib/module/icons/Lightning.js +1 -1
- package/lib/module/icons/Link.js +1 -1
- package/lib/module/icons/Loading.js +1 -1
- package/lib/module/icons/Logo.js +1 -1
- package/lib/module/icons/LoveReaction.js +1 -1
- package/lib/module/icons/MD.js +1 -1
- package/lib/module/icons/MailOpen.js +1 -1
- package/lib/module/icons/MenuPointHorizontal.js +1 -1
- package/lib/module/icons/MenuPointVertical.js +1 -1
- package/lib/module/icons/MessageFlag.js +1 -1
- package/lib/module/icons/MessageIcon.js +1 -1
- package/lib/module/icons/Mute.js +1 -1
- package/lib/module/icons/Notification.js +1 -1
- package/lib/module/icons/ODT.js +1 -1
- package/lib/module/icons/PDF.js +1 -1
- package/lib/module/icons/PPT.js +1 -1
- package/lib/module/icons/PPTX.js +1 -1
- package/lib/module/icons/Pause.js +1 -1
- package/lib/module/icons/Picture.js +1 -1
- package/lib/module/icons/Pin.js +1 -1
- package/lib/module/icons/PinHeader.js +1 -1
- package/lib/module/icons/Play.js +1 -1
- package/lib/module/icons/RAR.js +1 -1
- package/lib/module/icons/RTF.js +1 -1
- package/lib/module/icons/Recorder.js +1 -1
- package/lib/module/icons/Refresh.js +1 -1
- package/lib/module/icons/SEVEN_Z.js +1 -1
- package/lib/module/icons/Search.js +1 -1
- package/lib/module/icons/SendRight.js +1 -1
- package/lib/module/icons/SendUp.js +1 -1
- package/lib/module/icons/Share.js +1 -1
- package/lib/module/icons/ShareRightArrow.js +1 -1
- package/lib/module/icons/Smile.js +1 -1
- package/lib/module/icons/Sound.js +1 -1
- package/lib/module/icons/TAR.js +1 -1
- package/lib/module/icons/TXT.js +1 -1
- package/lib/module/icons/ThreadReply.js +1 -1
- package/lib/module/icons/ThumbsDownReaction.js +1 -1
- package/lib/module/icons/ThumbsUpReaction.js +1 -1
- package/lib/module/icons/Time.js +1 -1
- package/lib/module/icons/Unknown.js +1 -1
- package/lib/module/icons/Unpin.js +1 -1
- package/lib/module/icons/User.js +1 -1
- package/lib/module/icons/UserAdd.js +1 -1
- package/lib/module/icons/UserAdmin.js +1 -1
- package/lib/module/icons/UserDelete.js +1 -1
- package/lib/module/icons/UserMinus.js +1 -1
- package/lib/module/icons/Video.js +1 -1
- package/lib/module/icons/Warning.js +1 -1
- package/lib/module/icons/WutReaction.js +1 -1
- package/lib/module/icons/XLS.js +1 -1
- package/lib/module/icons/XLSX.js +1 -1
- package/lib/module/icons/ZIP.js +1 -1
- package/lib/module/icons/utils/base.js +1 -1
- package/lib/module/index.js +11 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/mock-builders/DB/consts.js +15 -0
- package/lib/module/mock-builders/DB/consts.js.map +1 -0
- package/lib/module/mock-builders/DB/mock.js +125 -0
- package/lib/module/mock-builders/DB/mock.js.map +1 -0
- package/lib/module/mock-builders/api/channelMocks.js +1 -0
- package/lib/module/mock-builders/api/channelMocks.js.map +1 -1
- package/lib/module/mock-builders/event/memberAdded.js +17 -0
- package/lib/module/mock-builders/event/memberAdded.js.map +1 -0
- package/lib/module/mock-builders/event/memberRemoved.js +17 -0
- package/lib/module/mock-builders/event/memberRemoved.js.map +1 -0
- package/lib/module/mock-builders/event/memberUpdated.js +17 -0
- package/lib/module/mock-builders/event/memberUpdated.js.map +1 -0
- package/lib/module/mock-builders/event/reactionDeleted.js +18 -0
- package/lib/module/mock-builders/event/reactionDeleted.js.map +1 -0
- package/lib/module/mock-builders/event/reactionNew.js +18 -0
- package/lib/module/mock-builders/event/reactionNew.js.map +1 -0
- package/lib/module/mock-builders/event/reactionUpdated.js +18 -0
- package/lib/module/mock-builders/event/reactionUpdated.js.map +1 -0
- package/lib/module/mock-builders/generator/reaction.js +1 -1
- package/lib/module/mock-builders/generator/reaction.js.map +1 -1
- package/lib/module/store/QuickSqliteClient.js +148 -0
- package/lib/module/store/QuickSqliteClient.js.map +1 -0
- package/lib/module/store/apis/deleteChannel.js +26 -0
- package/lib/module/store/apis/deleteChannel.js.map +1 -0
- package/lib/module/store/apis/deleteMember.js +28 -0
- package/lib/module/store/apis/deleteMember.js.map +1 -0
- package/lib/module/store/apis/deleteMessagesForChannel.js +26 -0
- package/lib/module/store/apis/deleteMessagesForChannel.js.map +1 -0
- package/lib/module/store/apis/deleteReactions.js +28 -0
- package/lib/module/store/apis/deleteReactions.js.map +1 -0
- package/lib/module/store/apis/getAllChannelIds.js +16 -0
- package/lib/module/store/apis/getAllChannelIds.js.map +1 -0
- package/lib/module/store/apis/getChannelMessages.js +45 -0
- package/lib/module/store/apis/getChannelMessages.js.map +1 -0
- package/lib/module/store/apis/getChannels.js +60 -0
- package/lib/module/store/apis/getChannels.js.map +1 -0
- package/lib/module/store/apis/getLastSyncedAt.js +23 -0
- package/lib/module/store/apis/getLastSyncedAt.js.map +1 -0
- package/lib/module/store/apis/getMembers.js +25 -0
- package/lib/module/store/apis/getMembers.js.map +1 -0
- package/lib/module/store/apis/getReads.js +25 -0
- package/lib/module/store/apis/getReads.js.map +1 -0
- package/lib/module/store/apis/queries/selectChannelIdsForFilterSort.js +31 -0
- package/lib/module/store/apis/queries/selectChannelIdsForFilterSort.js.map +1 -0
- package/lib/module/store/apis/queries/selectChannels.js +30 -0
- package/lib/module/store/apis/queries/selectChannels.js.map +1 -0
- package/lib/module/store/apis/queries/selectMembersForChannels.js +27 -0
- package/lib/module/store/apis/queries/selectMembersForChannels.js.map +1 -0
- package/lib/module/store/apis/queries/selectMessagesForChannels.js +27 -0
- package/lib/module/store/apis/queries/selectMessagesForChannels.js.map +1 -0
- package/lib/module/store/apis/queries/selectReactionsForMessages.js +27 -0
- package/lib/module/store/apis/queries/selectReactionsForMessages.js.map +1 -0
- package/lib/module/store/apis/queries/selectReadsForChannels.js +27 -0
- package/lib/module/store/apis/queries/selectReadsForChannels.js.map +1 -0
- package/lib/module/store/apis/updateMessage.js +69 -0
- package/lib/module/store/apis/updateMessage.js.map +1 -0
- package/lib/module/store/apis/updateReaction.js +53 -0
- package/lib/module/store/apis/updateReaction.js.map +1 -0
- package/lib/module/store/apis/upsertChannelData.js +26 -0
- package/lib/module/store/apis/upsertChannelData.js.map +1 -0
- package/lib/module/store/apis/upsertChannels.js +83 -0
- package/lib/module/store/apis/upsertChannels.js.map +1 -0
- package/lib/module/store/apis/upsertCidsForQuery.js +34 -0
- package/lib/module/store/apis/upsertCidsForQuery.js.map +1 -0
- package/lib/module/store/apis/upsertLastSyncedAt.js +22 -0
- package/lib/module/store/apis/upsertLastSyncedAt.js.map +1 -0
- package/lib/module/store/apis/upsertMembers.js +39 -0
- package/lib/module/store/apis/upsertMembers.js.map +1 -0
- package/lib/module/store/apis/upsertMessages.js +52 -0
- package/lib/module/store/apis/upsertMessages.js.map +1 -0
- package/lib/module/store/apis/upsertReads.js +39 -0
- package/lib/module/store/apis/upsertReads.js.map +1 -0
- package/lib/module/store/apis/utils/convertFilterSortToQuery.js +13 -0
- package/lib/module/store/apis/utils/convertFilterSortToQuery.js.map +1 -0
- package/lib/module/store/constants.js +11 -0
- package/lib/module/store/constants.js.map +1 -0
- package/lib/module/store/mappers/mapChannelDataToStorable.js +67 -0
- package/lib/module/store/mappers/mapChannelDataToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapDateTimeToStorable.js +12 -0
- package/lib/module/store/mappers/mapDateTimeToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapMemberToStorable.js +39 -0
- package/lib/module/store/mappers/mapMemberToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapMessageToStorable.js +42 -0
- package/lib/module/store/mappers/mapMessageToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapReactionToStorable.js +34 -0
- package/lib/module/store/mappers/mapReactionToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapReadToStorable.js +23 -0
- package/lib/module/store/mappers/mapReadToStorable.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToChannel.js +65 -0
- package/lib/module/store/mappers/mapStorableToChannel.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToMember.js +38 -0
- package/lib/module/store/mappers/mapStorableToMember.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToMessage.js +50 -0
- package/lib/module/store/mappers/mapStorableToMessage.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToReaction.js +31 -0
- package/lib/module/store/mappers/mapStorableToReaction.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToRead.js +20 -0
- package/lib/module/store/mappers/mapStorableToRead.js.map +1 -0
- package/lib/module/store/mappers/mapStorableToUser.js +31 -0
- package/lib/module/store/mappers/mapStorableToUser.js.map +1 -0
- package/lib/module/store/mappers/mapUserToStorable.js +34 -0
- package/lib/module/store/mappers/mapUserToStorable.js.map +1 -0
- package/lib/module/store/schema.js +161 -0
- package/lib/module/store/schema.js.map +1 -0
- package/lib/module/store/sqlite-utils/appendWhereCluase.js +37 -0
- package/lib/module/store/sqlite-utils/appendWhereCluase.js.map +1 -0
- package/lib/module/store/sqlite-utils/createCreateTableQuery.js +35 -0
- package/lib/module/store/sqlite-utils/createCreateTableQuery.js.map +1 -0
- package/lib/module/store/sqlite-utils/createDeleteQuery.js +14 -0
- package/lib/module/store/sqlite-utils/createDeleteQuery.js.map +1 -0
- package/lib/module/store/sqlite-utils/createSelectQuery.js +26 -0
- package/lib/module/store/sqlite-utils/createSelectQuery.js.map +1 -0
- package/lib/module/store/sqlite-utils/createUpdateQuery.js +29 -0
- package/lib/module/store/sqlite-utils/createUpdateQuery.js.map +1 -0
- package/lib/module/store/sqlite-utils/createUpsertQuery.js +30 -0
- package/lib/module/store/sqlite-utils/createUpsertQuery.js.map +1 -0
- package/lib/module/store/sqlite-utils/printRow.js +33 -0
- package/lib/module/store/sqlite-utils/printRow.js.map +1 -0
- package/lib/module/store/types.js +4 -0
- package/lib/module/store/types.js.map +1 -0
- package/lib/module/version.json +1 -1
- package/lib/typescript/__tests__/utils/BetterSqlite.d.ts +8 -0
- package/lib/typescript/components/Channel/Channel.d.ts +3 -5
- package/lib/typescript/components/Channel/hooks/useCreateChannelContext.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreatePaginatedMessageListContext.d.ts +1 -1
- package/lib/typescript/components/ChannelList/hooks/listeners/handleEventToSyncDB.d.ts +2 -0
- package/lib/typescript/components/ChannelList/hooks/listeners/useConnectionRecovered.d.ts +3 -2
- package/lib/typescript/components/ChannelList/hooks/listeners/useSyncDatabase.d.ts +6 -0
- package/lib/typescript/components/ChannelList/hooks/usePaginatedChannels.d.ts +4 -2
- package/lib/typescript/components/Chat/Chat.d.ts +4 -0
- package/lib/typescript/components/Chat/hooks/useCreateChatContext.d.ts +1 -1
- package/lib/typescript/components/MessageList/MessageList.d.ts +1 -1
- package/lib/typescript/contexts/channelContext/ChannelContext.d.ts +17 -0
- package/lib/typescript/contexts/chatContext/ChatContext.d.ts +1 -0
- package/lib/typescript/contexts/paginatedMessageListContext/PaginatedMessageListContext.d.ts +4 -0
- package/lib/typescript/hooks/useImageErrorHandler.d.ts +5 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/store/QuickSqliteClient.d.ts +18 -0
- package/lib/typescript/store/apis/deleteChannel.d.ts +4 -0
- package/lib/typescript/store/apis/deleteMember.d.ts +6 -0
- package/lib/typescript/store/apis/deleteMessagesForChannel.d.ts +4 -0
- package/lib/typescript/store/apis/deleteReactions.d.ts +4 -0
- package/lib/typescript/store/apis/getAllChannelIds.d.ts +1 -0
- package/lib/typescript/store/apis/getChannelMessages.d.ts +6 -0
- package/lib/typescript/store/apis/getChannels.d.ts +7 -0
- package/lib/typescript/store/apis/getLastSyncedAt.d.ts +3 -0
- package/lib/typescript/store/apis/getMembers.d.ts +5 -0
- package/lib/typescript/store/apis/getReads.d.ts +5 -0
- package/lib/typescript/store/apis/queries/selectChannelIdsForFilterSort.d.ts +6 -0
- package/lib/typescript/store/apis/queries/selectChannels.d.ts +4 -0
- package/lib/typescript/store/apis/queries/selectMembersForChannels.d.ts +2 -0
- package/lib/typescript/store/apis/queries/selectMessagesForChannels.d.ts +2 -0
- package/lib/typescript/store/apis/queries/selectReactionsForMessages.d.ts +2 -0
- package/lib/typescript/store/apis/queries/selectReadsForChannels.d.ts +2 -0
- package/lib/typescript/store/apis/updateMessage.d.ts +6 -0
- package/lib/typescript/store/apis/updateReaction.d.ts +7 -0
- package/lib/typescript/store/apis/upsertChannelData.d.ts +5 -0
- package/lib/typescript/store/apis/upsertChannels.d.ts +9 -0
- package/lib/typescript/store/apis/upsertCidsForQuery.d.ts +7 -0
- package/lib/typescript/store/apis/upsertLastSyncedAt.d.ts +4 -0
- package/lib/typescript/store/apis/upsertMembers.d.ts +7 -0
- package/lib/typescript/store/apis/upsertMessages.d.ts +6 -0
- package/lib/typescript/store/apis/upsertReads.d.ts +7 -0
- package/lib/typescript/store/apis/utils/convertFilterSortToQuery.d.ts +6 -0
- package/lib/typescript/store/constants.d.ts +3 -0
- package/lib/typescript/store/mappers/mapChannelDataToStorable.d.ts +4 -0
- package/lib/typescript/store/mappers/mapDateTimeToStorable.d.ts +1 -0
- package/lib/typescript/store/mappers/mapMemberToStorable.d.ts +7 -0
- package/lib/typescript/store/mappers/mapMessageToStorable.d.ts +3 -0
- package/lib/typescript/store/mappers/mapReactionToStorable.d.ts +3 -0
- package/lib/typescript/store/mappers/mapReadToStorable.d.ts +7 -0
- package/lib/typescript/store/mappers/mapStorableToChannel.d.ts +4 -0
- package/lib/typescript/store/mappers/mapStorableToMember.d.ts +4 -0
- package/lib/typescript/store/mappers/mapStorableToMessage.d.ts +8 -0
- package/lib/typescript/store/mappers/mapStorableToReaction.d.ts +4 -0
- package/lib/typescript/store/mappers/mapStorableToRead.d.ts +4 -0
- package/lib/typescript/store/mappers/mapStorableToUser.d.ts +4 -0
- package/lib/typescript/store/mappers/mapUserToStorable.d.ts +3 -0
- package/lib/typescript/store/schema.d.ts +110 -0
- package/lib/typescript/store/sqlite-utils/__tests__/createSelectQuery.test.d.ts +1 -0
- package/lib/typescript/store/sqlite-utils/appendWhereCluase.d.ts +2 -0
- package/lib/typescript/store/sqlite-utils/createCreateTableQuery.d.ts +2 -0
- package/lib/typescript/store/sqlite-utils/createDeleteQuery.d.ts +12 -0
- package/lib/typescript/store/sqlite-utils/createSelectQuery.d.ts +13 -0
- package/lib/typescript/store/sqlite-utils/createUpdateQuery.d.ts +13 -0
- package/lib/typescript/store/sqlite-utils/createUpsertQuery.d.ts +11 -0
- package/lib/typescript/store/sqlite-utils/printRow.d.ts +2 -0
- package/lib/typescript/store/types.d.ts +8 -0
- package/package.json +4 -2
- package/src/__tests__/offline-feature.test.js +619 -0
- package/src/__tests__/utils/BetterSqlite.js +44 -0
- package/src/components/Avatar/Avatar.tsx +46 -31
- package/src/components/Avatar/GroupAvatar.tsx +55 -43
- package/src/components/Channel/Channel.tsx +101 -136
- package/src/components/Channel/hooks/useCreateChannelContext.ts +2 -0
- package/src/components/Channel/hooks/useCreatePaginatedMessageListContext.ts +2 -0
- package/src/components/ChannelList/ChannelList.tsx +25 -2
- package/src/components/ChannelList/ChannelListMessenger.tsx +4 -0
- package/src/components/ChannelList/hooks/listeners/__tests__/useChannelUpdated.test.tsx +1 -0
- package/src/components/ChannelList/hooks/listeners/handleEventToSyncDB.ts +175 -0
- package/src/components/ChannelList/hooks/listeners/useAddedToChannelNotification.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelDeleted.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelHidden.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelTruncated.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelUpdated.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useChannelVisible.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useConnectionRecovered.ts +59 -14
- package/src/components/ChannelList/hooks/listeners/useNewMessage.ts +3 -2
- package/src/components/ChannelList/hooks/listeners/useNewMessageNotification.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useRemovedFromChannelNotification.ts +2 -2
- package/src/components/ChannelList/hooks/listeners/useSyncDatabase.ts +30 -0
- package/src/components/ChannelList/hooks/listeners/useUserPresence.ts +5 -4
- package/src/components/ChannelList/hooks/usePaginatedChannels.ts +34 -10
- package/src/components/ChannelPreview/ChannelAvatar.tsx +3 -3
- package/src/components/ChannelPreview/ChannelPreview.tsx +8 -8
- package/src/components/ChannelPreview/ChannelPreviewMessage.tsx +10 -9
- package/src/components/Chat/Chat.tsx +24 -3
- package/src/components/Chat/hooks/useCreateChatContext.ts +7 -3
- package/src/components/Chat/hooks/useMutedUsers.ts +5 -3
- package/src/components/MessageList/MessageList.tsx +156 -100
- package/src/components/Thread/__tests__/__snapshots__/Thread.test.js.snap +2 -0
- package/src/contexts/channelContext/ChannelContext.tsx +15 -0
- package/src/contexts/chatContext/ChatContext.tsx +1 -0
- package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx +4 -0
- package/src/hooks/useImageErrorHandler.ts +16 -0
- package/src/index.ts +3 -0
- package/src/mock-builders/DB/consts.ts +2 -0
- package/src/mock-builders/DB/mock.ts +114 -0
- package/src/mock-builders/api/channelMocks.tsx +1 -0
- package/src/mock-builders/event/memberAdded.js +9 -0
- package/src/mock-builders/event/memberRemoved.js +9 -0
- package/src/mock-builders/event/memberUpdated.js +9 -0
- package/src/mock-builders/event/reactionDeleted.js +10 -0
- package/src/mock-builders/event/reactionNew.js +10 -0
- package/src/mock-builders/event/reactionUpdated.js +10 -0
- package/src/mock-builders/generator/reaction.js +1 -1
- package/src/store/QuickSqliteClient.ts +120 -0
- package/src/store/apis/deleteChannel.ts +14 -0
- package/src/store/apis/deleteMember.ts +25 -0
- package/src/store/apis/deleteMessagesForChannel.ts +19 -0
- package/src/store/apis/deleteReactions.ts +24 -0
- package/src/store/apis/getAllChannelIds.ts +7 -0
- package/src/store/apis/getChannelMessages.ts +50 -0
- package/src/store/apis/getChannels.ts +43 -0
- package/src/store/apis/getLastSyncedAt.ts +13 -0
- package/src/store/apis/getMembers.ts +26 -0
- package/src/store/apis/getReads.ts +26 -0
- package/src/store/apis/queries/selectChannelIdsForFilterSort.ts +28 -0
- package/src/store/apis/queries/selectChannels.ts +19 -0
- package/src/store/apis/queries/selectMembersForChannels.ts +32 -0
- package/src/store/apis/queries/selectMessagesForChannels.ts +40 -0
- package/src/store/apis/queries/selectReactionsForMessages.ts +33 -0
- package/src/store/apis/queries/selectReadsForChannels.ts +30 -0
- package/src/store/apis/updateMessage.ts +65 -0
- package/src/store/apis/updateReaction.ts +54 -0
- package/src/store/apis/upsertChannelData.ts +20 -0
- package/src/store/apis/upsertChannels.ts +79 -0
- package/src/store/apis/upsertCidsForQuery.ts +30 -0
- package/src/store/apis/upsertLastSyncedAt.ts +17 -0
- package/src/store/apis/upsertMembers.ts +41 -0
- package/src/store/apis/upsertMessages.ts +43 -0
- package/src/store/apis/upsertReads.ts +41 -0
- package/src/store/apis/utils/convertFilterSortToQuery.ts +14 -0
- package/src/store/constants.ts +3 -0
- package/src/store/mappers/mapChannelDataToStorable.ts +67 -0
- package/src/store/mappers/mapDateTimeToStorable.ts +5 -0
- package/src/store/mappers/mapMemberToStorable.ts +45 -0
- package/src/store/mappers/mapMessageToStorable.ts +35 -0
- package/src/store/mappers/mapReactionToStorable.ts +19 -0
- package/src/store/mappers/mapReadToStorable.ts +25 -0
- package/src/store/mappers/mapStorableToChannel.ts +69 -0
- package/src/store/mappers/mapStorableToMember.ts +42 -0
- package/src/store/mappers/mapStorableToMessage.ts +40 -0
- package/src/store/mappers/mapStorableToReaction.ts +25 -0
- package/src/store/mappers/mapStorableToRead.ts +21 -0
- package/src/store/mappers/mapStorableToUser.ts +23 -0
- package/src/store/mappers/mapUserToStorable.ts +18 -0
- package/src/store/schema.ts +284 -0
- package/src/store/sqlite-utils/__tests__/createSelectQuery.test.ts +21 -0
- package/src/store/sqlite-utils/appendWhereCluase.ts +31 -0
- package/src/store/sqlite-utils/createCreateTableQuery.ts +39 -0
- package/src/store/sqlite-utils/createDeleteQuery.ts +23 -0
- package/src/store/sqlite-utils/createSelectQuery.ts +25 -0
- package/src/store/sqlite-utils/createUpdateQuery.ts +27 -0
- package/src/store/sqlite-utils/createUpsertQuery.ts +48 -0
- package/src/store/sqlite-utils/printRow.ts +28 -0
- package/src/store/types.ts +11 -0
- package/src/version.json +1 -1
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.tables = void 0;
|
|
5
|
+
var tables = {
|
|
6
|
+
channelQueries: {
|
|
7
|
+
columns: {
|
|
8
|
+
cids: 'TEXT',
|
|
9
|
+
id: 'TEXT'
|
|
10
|
+
},
|
|
11
|
+
primaryKey: ['id']
|
|
12
|
+
},
|
|
13
|
+
channels: {
|
|
14
|
+
columns: {
|
|
15
|
+
autoTranslationEnabled: 'BOOLEAN',
|
|
16
|
+
autoTranslationLanguage: 'TEXT',
|
|
17
|
+
cid: 'TEXT',
|
|
18
|
+
config: 'TEXT',
|
|
19
|
+
cooldown: 'BOOLEAN',
|
|
20
|
+
createdAt: 'TEXT',
|
|
21
|
+
createdById: 'TEXT',
|
|
22
|
+
deletedAt: 'TEXT',
|
|
23
|
+
disabled: 'BOOLEAN DEFAULT FALSE',
|
|
24
|
+
extraData: 'TEXT',
|
|
25
|
+
frozen: 'BOOLEAN',
|
|
26
|
+
hidden: 'BOOLEAN',
|
|
27
|
+
id: 'TEXT',
|
|
28
|
+
invites: 'TEXT',
|
|
29
|
+
lastMessageAt: 'TEXT',
|
|
30
|
+
memberCount: 'INTEGER',
|
|
31
|
+
muted: 'BOOLEAN DEFAULT FALSE',
|
|
32
|
+
ownCapabilities: 'TEXT',
|
|
33
|
+
team: 'TEXT',
|
|
34
|
+
truncatedAt: 'TEXT',
|
|
35
|
+
truncatedBy: 'TEXT',
|
|
36
|
+
truncatedById: 'TEXT',
|
|
37
|
+
type: 'TEXT',
|
|
38
|
+
updatedAt: 'TEXT'
|
|
39
|
+
},
|
|
40
|
+
primaryKey: ['cid']
|
|
41
|
+
},
|
|
42
|
+
members: {
|
|
43
|
+
columns: {
|
|
44
|
+
banned: 'BOOLEAN DEFAULT FALSE',
|
|
45
|
+
channelRole: 'TEXT',
|
|
46
|
+
cid: 'TEXT NOT NULL',
|
|
47
|
+
createdAt: 'TEXT',
|
|
48
|
+
inviteAcceptedAt: 'TEXT',
|
|
49
|
+
invited: 'BOOLEAN',
|
|
50
|
+
inviteRejectedAt: 'TEXT',
|
|
51
|
+
isModerator: 'BOOLEAN',
|
|
52
|
+
role: 'TEXT',
|
|
53
|
+
shadowBanned: 'BOOLEAN DEFAULT FALSE',
|
|
54
|
+
updatedAt: 'TEXT',
|
|
55
|
+
userId: 'TEXT'
|
|
56
|
+
},
|
|
57
|
+
foreignKeys: [{
|
|
58
|
+
column: 'cid',
|
|
59
|
+
onDeleteAction: 'CASCADE',
|
|
60
|
+
referenceTable: 'channels',
|
|
61
|
+
referenceTableColumn: 'cid'
|
|
62
|
+
}],
|
|
63
|
+
indexes: [{
|
|
64
|
+
columns: ['cid', 'userId'],
|
|
65
|
+
name: 'index_members',
|
|
66
|
+
unique: false
|
|
67
|
+
}],
|
|
68
|
+
primaryKey: ['cid', 'userId']
|
|
69
|
+
},
|
|
70
|
+
messages: {
|
|
71
|
+
columns: {
|
|
72
|
+
attachments: 'TEXT',
|
|
73
|
+
cid: 'TEXT NOT NULL',
|
|
74
|
+
createdAt: 'TEXT',
|
|
75
|
+
deletedAt: 'TEXT',
|
|
76
|
+
extraData: 'TEXT',
|
|
77
|
+
id: 'TEXT',
|
|
78
|
+
reactionCounts: 'TEXT',
|
|
79
|
+
text: "TEXT DEFAULT ''",
|
|
80
|
+
type: 'TEXT',
|
|
81
|
+
updatedAt: 'TEXT',
|
|
82
|
+
userId: 'TEXT'
|
|
83
|
+
},
|
|
84
|
+
foreignKeys: [{
|
|
85
|
+
column: 'cid',
|
|
86
|
+
onDeleteAction: 'CASCADE',
|
|
87
|
+
referenceTable: 'channels',
|
|
88
|
+
referenceTableColumn: 'cid'
|
|
89
|
+
}],
|
|
90
|
+
indexes: [{
|
|
91
|
+
columns: ['cid', 'userId'],
|
|
92
|
+
name: 'index_messages',
|
|
93
|
+
unique: false
|
|
94
|
+
}],
|
|
95
|
+
primaryKey: ['id']
|
|
96
|
+
},
|
|
97
|
+
reactions: {
|
|
98
|
+
columns: {
|
|
99
|
+
createdAt: 'TEXT',
|
|
100
|
+
extraData: 'TEXT',
|
|
101
|
+
messageId: 'TEXT',
|
|
102
|
+
score: 'INTEGER DEFAULT 0',
|
|
103
|
+
type: 'TEXT',
|
|
104
|
+
updatedAt: 'TEXT',
|
|
105
|
+
userId: 'TEXT'
|
|
106
|
+
},
|
|
107
|
+
foreignKeys: [{
|
|
108
|
+
column: 'messageId',
|
|
109
|
+
onDeleteAction: 'CASCADE',
|
|
110
|
+
referenceTable: 'messages',
|
|
111
|
+
referenceTableColumn: 'id'
|
|
112
|
+
}],
|
|
113
|
+
indexes: [{
|
|
114
|
+
columns: ['messageId', 'userId'],
|
|
115
|
+
name: 'index_reaction',
|
|
116
|
+
unique: false
|
|
117
|
+
}],
|
|
118
|
+
primaryKey: ['messageId', 'userId', 'type']
|
|
119
|
+
},
|
|
120
|
+
reads: {
|
|
121
|
+
columns: {
|
|
122
|
+
cid: 'TEXT NOT NULL',
|
|
123
|
+
lastRead: 'TEXT NOT NULL',
|
|
124
|
+
unreadMessages: 'INTEGER DEFAULT 0',
|
|
125
|
+
userId: 'TEXT'
|
|
126
|
+
},
|
|
127
|
+
indexes: [{
|
|
128
|
+
columns: ['cid', 'userId'],
|
|
129
|
+
name: 'index_reads_cid',
|
|
130
|
+
unique: false
|
|
131
|
+
}],
|
|
132
|
+
primaryKey: ['userId', 'cid']
|
|
133
|
+
},
|
|
134
|
+
users: {
|
|
135
|
+
columns: {
|
|
136
|
+
banned: 'BOOLEAN DEFAULT FALSE',
|
|
137
|
+
createdAt: 'TEXT',
|
|
138
|
+
extraData: 'TEXT',
|
|
139
|
+
id: 'TEXT',
|
|
140
|
+
lastActive: 'TEXT',
|
|
141
|
+
online: 'INTEGER',
|
|
142
|
+
role: 'TEXT',
|
|
143
|
+
updatedAt: 'TEXT'
|
|
144
|
+
},
|
|
145
|
+
indexes: [{
|
|
146
|
+
columns: ['id'],
|
|
147
|
+
name: 'index_users_id',
|
|
148
|
+
unique: true
|
|
149
|
+
}],
|
|
150
|
+
primaryKey: ['id']
|
|
151
|
+
},
|
|
152
|
+
userSyncStatus: {
|
|
153
|
+
columns: {
|
|
154
|
+
lastSyncedAt: 'TEXT',
|
|
155
|
+
userId: 'TEXT'
|
|
156
|
+
},
|
|
157
|
+
primaryKey: ['userId']
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
exports.tables = tables;
|
|
161
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["schema.ts"],"names":["tables","channelQueries","columns","cids","id","primaryKey","channels","autoTranslationEnabled","autoTranslationLanguage","cid","config","cooldown","createdAt","createdById","deletedAt","disabled","extraData","frozen","hidden","invites","lastMessageAt","memberCount","muted","ownCapabilities","team","truncatedAt","truncatedBy","truncatedById","type","updatedAt","members","banned","channelRole","inviteAcceptedAt","invited","inviteRejectedAt","isModerator","role","shadowBanned","userId","foreignKeys","column","onDeleteAction","referenceTable","referenceTableColumn","indexes","name","unique","messages","attachments","reactionCounts","text","reactions","messageId","score","reads","lastRead","unreadMessages","users","lastActive","online","userSyncStatus","lastSyncedAt"],"mappings":";;;;AAuBO,IAAMA,MAAc,GAAG;AAC5BC,EAAAA,cAAc,EAAE;AACdC,IAAAA,OAAO,EAAE;AACPC,MAAAA,IAAI,EAAE,MADC;AAEPC,MAAAA,EAAE,EAAE;AAFG,KADK;AAKdC,IAAAA,UAAU,EAAE,CAAC,IAAD;AALE,GADY;AAQ5BC,EAAAA,QAAQ,EAAE;AACRJ,IAAAA,OAAO,EAAE;AACPK,MAAAA,sBAAsB,EAAE,SADjB;AAEPC,MAAAA,uBAAuB,EAAE,MAFlB;AAGPC,MAAAA,GAAG,EAAE,MAHE;AAIPC,MAAAA,MAAM,EAAE,MAJD;AAKPC,MAAAA,QAAQ,EAAE,SALH;AAMPC,MAAAA,SAAS,EAAE,MANJ;AAOPC,MAAAA,WAAW,EAAE,MAPN;AAQPC,MAAAA,SAAS,EAAE,MARJ;AASPC,MAAAA,QAAQ,EAAE,uBATH;AAUPC,MAAAA,SAAS,EAAE,MAVJ;AAWPC,MAAAA,MAAM,EAAE,SAXD;AAYPC,MAAAA,MAAM,EAAE,SAZD;AAaPd,MAAAA,EAAE,EAAE,MAbG;AAcPe,MAAAA,OAAO,EAAE,MAdF;AAePC,MAAAA,aAAa,EAAE,MAfR;AAgBPC,MAAAA,WAAW,EAAE,SAhBN;AAiBPC,MAAAA,KAAK,EAAE,uBAjBA;AAkBPC,MAAAA,eAAe,EAAE,MAlBV;AAmBPC,MAAAA,IAAI,EAAE,MAnBC;AAoBPC,MAAAA,WAAW,EAAE,MApBN;AAqBPC,MAAAA,WAAW,EAAE,MArBN;AAsBPC,MAAAA,aAAa,EAAE,MAtBR;AAuBPC,MAAAA,IAAI,EAAE,MAvBC;AAwBPC,MAAAA,SAAS,EAAE;AAxBJ,KADD;AA2BRxB,IAAAA,UAAU,EAAE,CAAC,KAAD;AA3BJ,GARkB;AAqC5ByB,EAAAA,OAAO,EAAE;AACP5B,IAAAA,OAAO,EAAE;AACP6B,MAAAA,MAAM,EAAE,uBADD;AAEPC,MAAAA,WAAW,EAAE,MAFN;AAGPvB,MAAAA,GAAG,EAAE,eAHE;AAIPG,MAAAA,SAAS,EAAE,MAJJ;AAKPqB,MAAAA,gBAAgB,EAAE,MALX;AAMPC,MAAAA,OAAO,EAAE,SANF;AAOPC,MAAAA,gBAAgB,EAAE,MAPX;AAQPC,MAAAA,WAAW,EAAE,SARN;AASPC,MAAAA,IAAI,EAAE,MATC;AAUPC,MAAAA,YAAY,EAAE,uBAVP;AAWPT,MAAAA,SAAS,EAAE,MAXJ;AAYPU,MAAAA,MAAM,EAAE;AAZD,KADF;AAePC,IAAAA,WAAW,EAAE,CACX;AACEC,MAAAA,MAAM,EAAE,KADV;AAEEC,MAAAA,cAAc,EAAE,SAFlB;AAGEC,MAAAA,cAAc,EAAE,UAHlB;AAIEC,MAAAA,oBAAoB,EAAE;AAJxB,KADW,CAfN;AAuBPC,IAAAA,OAAO,EAAE,CACP;AACE3C,MAAAA,OAAO,EAAE,CAAC,KAAD,EAAQ,QAAR,CADX;AAEE4C,MAAAA,IAAI,EAAE,eAFR;AAGEC,MAAAA,MAAM,EAAE;AAHV,KADO,CAvBF;AA8BP1C,IAAAA,UAAU,EAAE,CAAC,KAAD,EAAQ,QAAR;AA9BL,GArCmB;AAqE5B2C,EAAAA,QAAQ,EAAE;AACR9C,IAAAA,OAAO,EAAE;AACP+C,MAAAA,WAAW,EAAE,MADN;AAEPxC,MAAAA,GAAG,EAAE,eAFE;AAGPG,MAAAA,SAAS,EAAE,MAHJ;AAIPE,MAAAA,SAAS,EAAE,MAJJ;AAKPE,MAAAA,SAAS,EAAE,MALJ;AAMPZ,MAAAA,EAAE,EAAE,MANG;AAOP8C,MAAAA,cAAc,EAAE,MAPT;AAQPC,MAAAA,IAAI,EAAE,iBARC;AASPvB,MAAAA,IAAI,EAAE,MATC;AAUPC,MAAAA,SAAS,EAAE,MAVJ;AAWPU,MAAAA,MAAM,EAAE;AAXD,KADD;AAcRC,IAAAA,WAAW,EAAE,CACX;AACEC,MAAAA,MAAM,EAAE,KADV;AAEEC,MAAAA,cAAc,EAAE,SAFlB;AAGEC,MAAAA,cAAc,EAAE,UAHlB;AAIEC,MAAAA,oBAAoB,EAAE;AAJxB,KADW,CAdL;AAsBRC,IAAAA,OAAO,EAAE,CACP;AACE3C,MAAAA,OAAO,EAAE,CAAC,KAAD,EAAQ,QAAR,CADX;AAEE4C,MAAAA,IAAI,EAAE,gBAFR;AAGEC,MAAAA,MAAM,EAAE;AAHV,KADO,CAtBD;AA6BR1C,IAAAA,UAAU,EAAE,CAAC,IAAD;AA7BJ,GArEkB;AAoG5B+C,EAAAA,SAAS,EAAE;AACTlD,IAAAA,OAAO,EAAE;AACPU,MAAAA,SAAS,EAAE,MADJ;AAEPI,MAAAA,SAAS,EAAE,MAFJ;AAGPqC,MAAAA,SAAS,EAAE,MAHJ;AAIPC,MAAAA,KAAK,EAAE,mBAJA;AAKP1B,MAAAA,IAAI,EAAE,MALC;AAMPC,MAAAA,SAAS,EAAE,MANJ;AAOPU,MAAAA,MAAM,EAAE;AAPD,KADA;AAUTC,IAAAA,WAAW,EAAE,CACX;AACEC,MAAAA,MAAM,EAAE,WADV;AAEEC,MAAAA,cAAc,EAAE,SAFlB;AAGEC,MAAAA,cAAc,EAAE,UAHlB;AAIEC,MAAAA,oBAAoB,EAAE;AAJxB,KADW,CAVJ;AAkBTC,IAAAA,OAAO,EAAE,CACP;AACE3C,MAAAA,OAAO,EAAE,CAAC,WAAD,EAAc,QAAd,CADX;AAEE4C,MAAAA,IAAI,EAAE,gBAFR;AAGEC,MAAAA,MAAM,EAAE;AAHV,KADO,CAlBA;AAyBT1C,IAAAA,UAAU,EAAE,CAAC,WAAD,EAAc,QAAd,EAAwB,MAAxB;AAzBH,GApGiB;AA+H5BkD,EAAAA,KAAK,EAAE;AACLrD,IAAAA,OAAO,EAAE;AACPO,MAAAA,GAAG,EAAE,eADE;AAEP+C,MAAAA,QAAQ,EAAE,eAFH;AAGPC,MAAAA,cAAc,EAAE,mBAHT;AAIPlB,MAAAA,MAAM,EAAE;AAJD,KADJ;AAOLM,IAAAA,OAAO,EAAE,CACP;AACE3C,MAAAA,OAAO,EAAE,CAAC,KAAD,EAAQ,QAAR,CADX;AAEE4C,MAAAA,IAAI,EAAE,iBAFR;AAGEC,MAAAA,MAAM,EAAE;AAHV,KADO,CAPJ;AAcL1C,IAAAA,UAAU,EAAE,CAAC,QAAD,EAAW,KAAX;AAdP,GA/HqB;AA+I5BqD,EAAAA,KAAK,EAAE;AACLxD,IAAAA,OAAO,EAAE;AACP6B,MAAAA,MAAM,EAAE,uBADD;AAEPnB,MAAAA,SAAS,EAAE,MAFJ;AAGPI,MAAAA,SAAS,EAAE,MAHJ;AAIPZ,MAAAA,EAAE,EAAE,MAJG;AAKPuD,MAAAA,UAAU,EAAE,MALL;AAMPC,MAAAA,MAAM,EAAE,SAND;AAOPvB,MAAAA,IAAI,EAAE,MAPC;AAQPR,MAAAA,SAAS,EAAE;AARJ,KADJ;AAWLgB,IAAAA,OAAO,EAAE,CACP;AACE3C,MAAAA,OAAO,EAAE,CAAC,IAAD,CADX;AAEE4C,MAAAA,IAAI,EAAE,gBAFR;AAGEC,MAAAA,MAAM,EAAE;AAHV,KADO,CAXJ;AAkBL1C,IAAAA,UAAU,EAAE,CAAC,IAAD;AAlBP,GA/IqB;AAmK5BwD,EAAAA,cAAc,EAAE;AACd3D,IAAAA,OAAO,EAAE;AACP4D,MAAAA,YAAY,EAAE,MADP;AAEPvB,MAAAA,MAAM,EAAE;AAFD,KADK;AAKdlC,IAAAA,UAAU,EAAE,CAAC,QAAD;AALE;AAnKY,CAAvB","sourcesContent":["import type { MessageLabel, Role } from 'stream-chat';\n\ntype Tables = {\n [P in keyof Schema]: {\n columns: {\n [K in keyof Schema[P]]: string;\n };\n primaryKey: Array<keyof Schema[P]>;\n foreignKeys?: Array<{\n column: `${Exclude<keyof Schema[P], symbol>}`;\n referenceTable: `${keyof Schema}`;\n referenceTableColumn: string;\n // https://www.sqlite.org/foreignkeys.html#fk_actions\n onDeleteAction?: 'NO ACTION' | 'RESTRICT' | 'SET NULL' | 'SET DEFAULT' | 'CASCADE';\n }>;\n indexes?: Array<{\n columns: Array<keyof Schema[P]>;\n name: string;\n unique: boolean;\n }>;\n };\n};\n\nexport const tables: Tables = {\n channelQueries: {\n columns: {\n cids: 'TEXT',\n id: 'TEXT',\n },\n primaryKey: ['id'],\n },\n channels: {\n columns: {\n autoTranslationEnabled: 'BOOLEAN',\n autoTranslationLanguage: 'TEXT',\n cid: 'TEXT',\n config: 'TEXT',\n cooldown: 'BOOLEAN',\n createdAt: 'TEXT',\n createdById: 'TEXT',\n deletedAt: 'TEXT',\n disabled: 'BOOLEAN DEFAULT FALSE',\n extraData: 'TEXT',\n frozen: 'BOOLEAN',\n hidden: 'BOOLEAN',\n id: 'TEXT',\n invites: 'TEXT',\n lastMessageAt: 'TEXT',\n memberCount: 'INTEGER',\n muted: 'BOOLEAN DEFAULT FALSE',\n ownCapabilities: 'TEXT',\n team: 'TEXT',\n truncatedAt: 'TEXT',\n truncatedBy: 'TEXT',\n truncatedById: 'TEXT',\n type: 'TEXT',\n updatedAt: 'TEXT',\n },\n primaryKey: ['cid'],\n },\n members: {\n columns: {\n banned: 'BOOLEAN DEFAULT FALSE',\n channelRole: 'TEXT',\n cid: 'TEXT NOT NULL',\n createdAt: 'TEXT',\n inviteAcceptedAt: 'TEXT',\n invited: 'BOOLEAN',\n inviteRejectedAt: 'TEXT',\n isModerator: 'BOOLEAN',\n role: 'TEXT',\n shadowBanned: 'BOOLEAN DEFAULT FALSE',\n updatedAt: 'TEXT',\n userId: 'TEXT',\n },\n foreignKeys: [\n {\n column: 'cid',\n onDeleteAction: 'CASCADE',\n referenceTable: 'channels',\n referenceTableColumn: 'cid',\n },\n ],\n indexes: [\n {\n columns: ['cid', 'userId'],\n name: 'index_members',\n unique: false,\n },\n ],\n primaryKey: ['cid', 'userId'],\n },\n messages: {\n columns: {\n attachments: 'TEXT',\n cid: 'TEXT NOT NULL',\n createdAt: 'TEXT',\n deletedAt: 'TEXT',\n extraData: 'TEXT',\n id: 'TEXT',\n reactionCounts: 'TEXT',\n text: \"TEXT DEFAULT ''\",\n type: 'TEXT',\n updatedAt: 'TEXT',\n userId: 'TEXT',\n },\n foreignKeys: [\n {\n column: 'cid',\n onDeleteAction: 'CASCADE',\n referenceTable: 'channels',\n referenceTableColumn: 'cid',\n },\n ],\n indexes: [\n {\n columns: ['cid', 'userId'],\n name: 'index_messages',\n unique: false,\n },\n ],\n primaryKey: ['id'],\n },\n reactions: {\n columns: {\n createdAt: 'TEXT',\n extraData: 'TEXT',\n messageId: 'TEXT',\n score: 'INTEGER DEFAULT 0',\n type: 'TEXT',\n updatedAt: 'TEXT',\n userId: 'TEXT',\n },\n foreignKeys: [\n {\n column: 'messageId',\n onDeleteAction: 'CASCADE',\n referenceTable: 'messages',\n referenceTableColumn: 'id',\n },\n ],\n indexes: [\n {\n columns: ['messageId', 'userId'],\n name: 'index_reaction',\n unique: false,\n },\n ],\n primaryKey: ['messageId', 'userId', 'type'],\n },\n reads: {\n columns: {\n cid: 'TEXT NOT NULL',\n lastRead: 'TEXT NOT NULL',\n unreadMessages: 'INTEGER DEFAULT 0',\n userId: 'TEXT',\n },\n indexes: [\n {\n columns: ['cid', 'userId'],\n name: 'index_reads_cid',\n unique: false,\n },\n ],\n primaryKey: ['userId', 'cid'],\n },\n users: {\n columns: {\n banned: 'BOOLEAN DEFAULT FALSE',\n createdAt: 'TEXT',\n extraData: 'TEXT',\n id: 'TEXT',\n lastActive: 'TEXT',\n online: 'INTEGER',\n role: 'TEXT',\n updatedAt: 'TEXT',\n },\n indexes: [\n {\n columns: ['id'],\n name: 'index_users_id',\n unique: true,\n },\n ],\n primaryKey: ['id'],\n },\n userSyncStatus: {\n columns: {\n lastSyncedAt: 'TEXT',\n userId: 'TEXT',\n },\n primaryKey: ['userId'],\n },\n};\n\n// TODO: Checking the optionality of columns\nexport type Schema = {\n channelQueries: {\n cids: string;\n id: string;\n };\n channels: {\n cid: string;\n extraData: string;\n id: string;\n type: string;\n autoTranslationEnabled?: boolean;\n autoTranslationLanguage?: string;\n config?: string;\n cooldown?: number;\n createdAt?: string;\n createdById?: string;\n deletedAt?: string;\n disabled?: boolean;\n frozen?: boolean;\n hidden?: boolean;\n invites?: string;\n lastMessageAt?: string;\n memberCount?: number;\n muted?: boolean;\n ownCapabilities?: string;\n team?: string;\n truncatedAt?: string;\n truncatedBy?: string;\n truncatedById?: string;\n updatedAt?: string;\n };\n members: {\n cid: string;\n banned?: boolean;\n channelRole?: Role;\n createdAt?: string;\n inviteAcceptedAt?: string;\n invited?: boolean;\n inviteRejectedAt?: string;\n isModerator?: boolean;\n role?: string;\n shadowBanned?: boolean;\n updatedAt?: string;\n userId?: string;\n };\n messages: {\n attachments: string;\n cid: string;\n createdAt: string;\n deletedAt: string;\n extraData: string;\n id: string;\n reactionCounts: string;\n type: MessageLabel;\n updatedAt: string;\n text?: string;\n userId?: string;\n };\n reactions: {\n createdAt: string;\n messageId: string;\n type: string;\n updatedAt: string;\n extraData?: string;\n score?: number;\n userId?: string;\n };\n reads: {\n cid: string;\n lastRead: string;\n unreadMessages?: number;\n userId?: string;\n };\n users: {\n id: string;\n banned?: boolean;\n createdAt?: string;\n extraData?: string;\n lastActive?: string;\n online?: boolean;\n role?: string;\n updatedAt?: string;\n };\n userSyncStatus: {\n lastSyncedAt: string;\n userId: string;\n };\n};\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.appendWhereClause = void 0;
|
|
7
|
+
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
|
|
10
|
+
var appendWhereClause = function appendWhereClause(selectQuery, whereCondition) {
|
|
11
|
+
if (!whereCondition) return [selectQuery, []];
|
|
12
|
+
var whereClause = [];
|
|
13
|
+
var whereParams = [];
|
|
14
|
+
|
|
15
|
+
for (var key in whereCondition) {
|
|
16
|
+
var value = whereCondition[key];
|
|
17
|
+
|
|
18
|
+
if (Array.isArray(value)) {
|
|
19
|
+
if (!value || value.length === 0) continue;
|
|
20
|
+
var questionMarks = Array(Object.keys(value).length).fill('?').join(',');
|
|
21
|
+
whereClause.push(key + " in (" + questionMarks + ")");
|
|
22
|
+
whereParams.push.apply(whereParams, (0, _toConsumableArray2["default"])(value));
|
|
23
|
+
} else {
|
|
24
|
+
whereClause.push(key + " = ?");
|
|
25
|
+
whereParams.push(value);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!whereParams.length) {
|
|
30
|
+
return [selectQuery, []];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return [selectQuery + " WHERE " + whereClause.join(' AND '), whereParams];
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
exports.appendWhereClause = appendWhereClause;
|
|
37
|
+
//# sourceMappingURL=appendWhereCluase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["appendWhereCluase.ts"],"names":["appendWhereClause","selectQuery","whereCondition","whereClause","whereParams","key","value","Array","isArray","length","questionMarks","Object","keys","fill","join","push"],"mappings":";;;;;;;;;AAGO,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAC/BC,WAD+B,EAE/BC,cAF+B,EAG5B;AACH,MAAI,CAACA,cAAL,EAAqB,OAAO,CAACD,WAAD,EAAc,EAAd,CAAP;AAErB,MAAME,WAAW,GAAG,EAApB;AACA,MAAMC,WAAsB,GAAG,EAA/B;;AAEA,OAAK,IAAMC,GAAX,IAAkBH,cAAlB,EAAkC;AAChC,QAAMI,KAAc,GAAGJ,cAAc,CAACG,GAAD,CAArC;;AACA,QAAIE,KAAK,CAACC,OAAN,CAAcF,KAAd,CAAJ,EAA0B;AACxB,UAAI,CAACA,KAAD,IAAUA,KAAK,CAACG,MAAN,KAAiB,CAA/B,EAAkC;AAClC,UAAMC,aAAa,GAAGH,KAAK,CAACI,MAAM,CAACC,IAAP,CAAYN,KAAZ,EAAmBG,MAApB,CAAL,CAAiCI,IAAjC,CAAsC,GAAtC,EAA2CC,IAA3C,CAAgD,GAAhD,CAAtB;AACAX,MAAAA,WAAW,CAACY,IAAZ,CAAoBV,GAApB,aAA+BK,aAA/B;AACAN,MAAAA,WAAW,CAACW,IAAZ,OAAAX,WAAW,sCAASE,KAAT,EAAX;AACD,KALD,MAKO;AACLH,MAAAA,WAAW,CAACY,IAAZ,CAAoBV,GAApB;AACAD,MAAAA,WAAW,CAACW,IAAZ,CAAiBT,KAAjB;AACD;AACF;;AAED,MAAI,CAACF,WAAW,CAACK,MAAjB,EAAyB;AACvB,WAAO,CAACR,WAAD,EAAc,EAAd,CAAP;AACD;;AAED,SAAO,CAAIA,WAAJ,eAAyBE,WAAW,CAACW,IAAZ,CAAiB,OAAjB,CAAzB,EAAsDV,WAAtD,CAAP;AACD,CA3BM","sourcesContent":["import type { Schema } from '../schema';\nimport type { PreparedQueries, TableColumnNames } from '../types';\n\nexport const appendWhereClause = <T extends keyof Schema>(\n selectQuery: string,\n whereCondition?: Partial<{ [k in TableColumnNames<T>]: any }>,\n) => {\n if (!whereCondition) return [selectQuery, []];\n\n const whereClause = [];\n const whereParams: unknown[] = [];\n\n for (const key in whereCondition) {\n const value: unknown = whereCondition[key];\n if (Array.isArray(value)) {\n if (!value || value.length === 0) continue;\n const questionMarks = Array(Object.keys(value).length).fill('?').join(',');\n whereClause.push(`${key} in (${questionMarks})`);\n whereParams.push(...value);\n } else {\n whereClause.push(`${key} = ?`);\n whereParams.push(value);\n }\n }\n\n if (!whereParams.length) {\n return [selectQuery, []];\n }\n\n return [`${selectQuery} WHERE ${whereClause.join(' AND ')}`, whereParams] as PreparedQueries;\n};\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createCreateTableQuery = void 0;
|
|
7
|
+
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _schema = require("../schema");
|
|
13
|
+
|
|
14
|
+
var createCreateTableQuery = function createCreateTableQuery(tableName) {
|
|
15
|
+
var _tables$tableName$for, _tables$tableName$ind;
|
|
16
|
+
|
|
17
|
+
var columnsWithDescriptors = Object.entries(_schema.tables[tableName].columns).map(function (entry) {
|
|
18
|
+
var _entry = (0, _slicedToArray2["default"])(entry, 2),
|
|
19
|
+
key = _entry[0],
|
|
20
|
+
value = _entry[1];
|
|
21
|
+
|
|
22
|
+
return key + " " + value;
|
|
23
|
+
});
|
|
24
|
+
var primaryKeyConstraints = _schema.tables[tableName].primaryKey.length > 0 ? ["PRIMARY KEY (" + _schema.tables[tableName].primaryKey.join(', ') + ")"] : [];
|
|
25
|
+
var foreignKeysConstraints = ((_tables$tableName$for = _schema.tables[tableName].foreignKeys) == null ? void 0 : _tables$tableName$for.map(function (k) {
|
|
26
|
+
return "FOREIGN KEY (" + k.column + ") REFERENCES " + k.referenceTable + "(" + k.referenceTableColumn + ") ON DELETE " + (k.onDeleteAction || 'NO ACTION');
|
|
27
|
+
})) || [];
|
|
28
|
+
var indexQueries = ((_tables$tableName$ind = _schema.tables[tableName].indexes) == null ? void 0 : _tables$tableName$ind.map(function (index) {
|
|
29
|
+
return ["CREATE " + (index.unique ? 'UNIQUE' : '') + " INDEX IF NOT EXISTS " + index.name + " ON " + tableName + "(" + index.columns.join(',') + ")"];
|
|
30
|
+
})) || [];
|
|
31
|
+
return [["CREATE TABLE IF NOT EXISTS " + tableName + "(\n " + [].concat((0, _toConsumableArray2["default"])(columnsWithDescriptors), primaryKeyConstraints, (0, _toConsumableArray2["default"])(foreignKeysConstraints)).join(',\n') + "\n );"]].concat((0, _toConsumableArray2["default"])(indexQueries));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.createCreateTableQuery = createCreateTableQuery;
|
|
35
|
+
//# sourceMappingURL=createCreateTableQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["createCreateTableQuery.ts"],"names":["createCreateTableQuery","tableName","columnsWithDescriptors","Object","entries","tables","columns","map","entry","key","value","primaryKeyConstraints","primaryKey","length","join","foreignKeysConstraints","foreignKeys","k","column","referenceTable","referenceTableColumn","onDeleteAction","indexQueries","indexes","index","unique","name"],"mappings":";;;;;;;;;;;AAAA;;AAGO,IAAMA,sBAAsB,GAAG,SAAzBA,sBAAyB,CAACC,SAAD,EAAyC;AAAA;;AAC7E,MAAMC,sBAAsB,GAAGC,MAAM,CAACC,OAAP,CAAeC,eAAOJ,SAAP,EAAkBK,OAAjC,EAA0CC,GAA1C,CAA8C,UAACC,KAAD,EAAW;AACtF,iDAAqBA,KAArB;AAAA,QAAOC,GAAP;AAAA,QAAYC,KAAZ;;AACA,WAAUD,GAAV,SAAiBC,KAAjB;AACD,GAH8B,CAA/B;AAKA,MAAMC,qBAAqB,GACzBN,eAAOJ,SAAP,EAAkBW,UAAlB,CAA6BC,MAA7B,GAAsC,CAAtC,GACI,mBAAiBR,eAAOJ,SAAP,EAAkBW,UAAlB,CAA6BE,IAA7B,CAAkC,IAAlC,CAAjB,OADJ,GAEI,EAHN;AAIA,MAAMC,sBAAsB,GAC1B,yCAAOd,SAAP,EAAkBe,WAAlB,2CAA+BT,GAA/B,CACE,UAACU,CAAD;AAAA,6BACkBA,CAAC,CAACC,MADpB,qBAC0CD,CAAC,CAACE,cAD5C,SAEIF,CAAC,CAACG,oBAFN,qBAGiBH,CAAC,CAACI,cAAF,IAAoB,WAHrC;AAAA,GADF,MAKK,EANP;AAQA,MAAMC,YAA+B,GACnC,yCAAOrB,SAAP,EAAkBsB,OAAlB,2CAA2BhB,GAA3B,CAA+B,UAACiB,KAAD;AAAA,WAAW,cAC9BA,KAAK,CAACC,MAAN,GAAe,QAAf,GAA0B,EADI,8BAEtCD,KAAK,CAACE,IAFgC,YAGjCzB,SAHiC,SAGpBuB,KAAK,CAAClB,OAAN,CAAcQ,IAAd,CAAmB,GAAnB,CAHoB,OAAX;AAAA,GAA/B,MAIM,EALR;AAOA,UACE,iCACgCb,SADhC,qBAEQ,8CAAIC,sBAAJ,GAA+BS,qBAA/B,sCAAyDI,sBAAzD,GAAiFD,IAAjF,CACA,KADA,CAFR,kBADF,6CAQKQ,YARL;AAUD,CAnCM","sourcesContent":["import { tables } from '../schema';\nimport type { PreparedQueries, Table } from '../types';\n\nexport const createCreateTableQuery = (tableName: Table): PreparedQueries[] => {\n const columnsWithDescriptors = Object.entries(tables[tableName].columns).map((entry) => {\n const [key, value] = entry;\n return `${key} ${value}`;\n });\n\n const primaryKeyConstraints =\n tables[tableName].primaryKey.length > 0\n ? [`PRIMARY KEY (${tables[tableName].primaryKey.join(', ')})`]\n : [];\n const foreignKeysConstraints =\n tables[tableName].foreignKeys?.map(\n (k) =>\n `FOREIGN KEY (${k.column}) REFERENCES ${k.referenceTable}(${\n k.referenceTableColumn\n }) ON DELETE ${k.onDeleteAction || 'NO ACTION'}`,\n ) || [];\n\n const indexQueries: PreparedQueries[] =\n tables[tableName].indexes?.map((index) => [\n `CREATE ${index.unique ? 'UNIQUE' : ''} INDEX IF NOT EXISTS ${\n index.name\n } ON ${tableName}(${index.columns.join(',')})`,\n ]) || [];\n\n return [\n [\n `CREATE TABLE IF NOT EXISTS ${tableName}(\n ${[...columnsWithDescriptors, ...primaryKeyConstraints, ...foreignKeysConstraints].join(\n ',\\n',\n )}\n );`,\n ],\n ...indexQueries,\n ];\n};\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.createDeleteQuery = void 0;
|
|
5
|
+
|
|
6
|
+
var _appendWhereCluase = require("./appendWhereCluase");
|
|
7
|
+
|
|
8
|
+
var createDeleteQuery = function createDeleteQuery(table, whereCondition) {
|
|
9
|
+
var deleteQuery = "DELETE FROM " + table;
|
|
10
|
+
return (0, _appendWhereCluase.appendWhereClause)(deleteQuery, whereCondition);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
exports.createDeleteQuery = createDeleteQuery;
|
|
14
|
+
//# sourceMappingURL=createDeleteQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["createDeleteQuery.ts"],"names":["createDeleteQuery","table","whereCondition","deleteQuery"],"mappings":";;;;;AAAA;;AAeO,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAC/BC,KAD+B,EAE/BC,cAF+B,EAG5B;AACH,MAAMC,WAAW,oBAAkBF,KAAnC;AAEA,SAAO,0CAAkBE,WAAlB,EAA+BD,cAA/B,CAAP;AACD,CAPM","sourcesContent":["import { appendWhereClause } from './appendWhereCluase';\n\nimport type { Schema } from '../schema';\nimport type { PreparedQueries, TableColumnNames } from '../types';\n\n/**\n * Creates a simple delete query for sqlite.\n *\n * @param {string} table Table name\n * @param {Object} whereCondition Where condition for select query.\n * e.g., { id: 'vishal', cid: ['messaging:id1', 'messaging:id2'] }.\n * All the conditions will be joined with AND in final query.\n * @returns {string} Final select query\n */\n\nexport const createDeleteQuery = <T extends keyof Schema>(\n table: T,\n whereCondition: Partial<{ [k in TableColumnNames<T>]: any }>,\n) => {\n const deleteQuery = `DELETE FROM ${table}`;\n\n return appendWhereClause(deleteQuery, whereCondition) as PreparedQueries;\n};\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createSelectQuery = void 0;
|
|
7
|
+
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
|
|
10
|
+
var _appendWhereCluase = require("./appendWhereCluase");
|
|
11
|
+
|
|
12
|
+
var createSelectQuery = function createSelectQuery(table) {
|
|
13
|
+
var fields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ['*'];
|
|
14
|
+
var whereCondition = arguments.length > 2 ? arguments[2] : undefined;
|
|
15
|
+
var selectQuery = "SELECT " + fields.join(', ') + " FROM " + table;
|
|
16
|
+
|
|
17
|
+
var _appendWhereClause = (0, _appendWhereCluase.appendWhereClause)(selectQuery, whereCondition),
|
|
18
|
+
_appendWhereClause2 = (0, _slicedToArray2["default"])(_appendWhereClause, 2),
|
|
19
|
+
selectQueryWithWhere = _appendWhereClause2[0],
|
|
20
|
+
whereParams = _appendWhereClause2[1];
|
|
21
|
+
|
|
22
|
+
return ["" + selectQueryWithWhere, whereParams];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
exports.createSelectQuery = createSelectQuery;
|
|
26
|
+
//# sourceMappingURL=createSelectQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["createSelectQuery.ts"],"names":["createSelectQuery","table","fields","whereCondition","selectQuery","join","selectQueryWithWhere","whereParams"],"mappings":";;;;;;;;;AAAA;;AAeO,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAC/BC,KAD+B,EAI5B;AAAA,MAFHC,MAEG,uEAF+C,CAAC,GAAD,CAE/C;AAAA,MADHC,cACG;AACH,MAAMC,WAAW,eAAaF,MAAM,CAACG,IAAP,CAAY,IAAZ,CAAb,cAAuCJ,KAAxD;;AACA,2BAA4C,0CAAkBG,WAAlB,EAA+BD,cAA/B,CAA5C;AAAA;AAAA,MAAOG,oBAAP;AAAA,MAA6BC,WAA7B;;AAEA,SAAO,MAAID,oBAAJ,EAA4BC,WAA5B,CAAP;AACD,CATM","sourcesContent":["import { appendWhereClause } from './appendWhereCluase';\n\nimport type { Schema } from '../schema';\nimport type { PreparedQueries, TableColumnNames } from '../types';\n\n/**\n * Creates a simple select query for sqlite.\n *\n * @param {string} table Table name\n * @param {Array} fields Array of columns which need to be selected e.g., ['*'] or ['id', 'name']\n * @param {Object} whereCondition Where condition for select query.\n * e.g., { id: 'vishal', cid: ['messaging:id1', 'messaging:id2'] }.\n * All the conditions will be joined with AND in final query.\n * @returns {string} Final select query\n */\nexport const createSelectQuery = <T extends keyof Schema>(\n table: T,\n fields: Array<'*'> | Array<TableColumnNames<T>> = ['*'],\n whereCondition?: Partial<{ [k in TableColumnNames<T>]: any }>,\n) => {\n const selectQuery = `SELECT ${fields.join(', ')} FROM ${table}`;\n const [selectQueryWithWhere, whereParams] = appendWhereClause(selectQuery, whereCondition);\n\n return [`${selectQueryWithWhere}`, whereParams] as PreparedQueries;\n};\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createUpdateQuery = void 0;
|
|
7
|
+
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
|
|
10
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
|
+
|
|
12
|
+
var _appendWhereCluase = require("./appendWhereCluase");
|
|
13
|
+
|
|
14
|
+
var createUpdateQuery = function createUpdateQuery(table, set, whereCondition) {
|
|
15
|
+
var fields = Object.keys(set).map(function (key) {
|
|
16
|
+
return key + " = ?";
|
|
17
|
+
});
|
|
18
|
+
var updateQuery = "UPDATE " + table + " SET " + fields.join(',');
|
|
19
|
+
|
|
20
|
+
var _appendWhereClause = (0, _appendWhereCluase.appendWhereClause)(updateQuery, whereCondition),
|
|
21
|
+
_appendWhereClause2 = (0, _slicedToArray2["default"])(_appendWhereClause, 2),
|
|
22
|
+
updateQueryWithWhere = _appendWhereClause2[0],
|
|
23
|
+
whereParams = _appendWhereClause2[1];
|
|
24
|
+
|
|
25
|
+
return [updateQueryWithWhere, [].concat((0, _toConsumableArray2["default"])(Object.values(set)), (0, _toConsumableArray2["default"])(whereParams))];
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
exports.createUpdateQuery = createUpdateQuery;
|
|
29
|
+
//# sourceMappingURL=createUpdateQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["createUpdateQuery.ts"],"names":["createUpdateQuery","table","set","whereCondition","fields","Object","keys","map","key","updateQuery","join","updateQueryWithWhere","whereParams","values"],"mappings":";;;;;;;;;;;AAAA;;AAeO,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAC/BC,KAD+B,EAE/BC,GAF+B,EAG/BC,cAH+B,EAI5B;AACH,MAAMC,MAAM,GAAGC,MAAM,CAACC,IAAP,CAAYJ,GAAZ,EAAiBK,GAAjB,CAAqB,UAACC,GAAD;AAAA,WAAYA,GAAZ;AAAA,GAArB,CAAf;AACA,MAAMC,WAAW,eAAaR,KAAb,aAA0BG,MAAM,CAACM,IAAP,CAAY,GAAZ,CAA3C;;AAEA,2BAA4C,0CAAkBD,WAAlB,EAA+BN,cAA/B,CAA5C;AAAA;AAAA,MAAOQ,oBAAP;AAAA,MAA6BC,WAA7B;;AAEA,SAAO,CAACD,oBAAD,gDAA2BN,MAAM,CAACQ,MAAP,CAAcX,GAAd,CAA3B,uCAAkDU,WAAlD,GAAP;AACD,CAXM","sourcesContent":["import { appendWhereClause } from './appendWhereCluase';\n\nimport type { Schema } from '../schema';\nimport type { PreparedQueries, TableColumnNames } from '../types';\n\n/**\n * Creates a simple update query for sqlite.\n *\n * @param {string} table Table name\n * @param {Object} set Set conditions for update query.\n * @param {Object} whereCondition Where condition for select query.\n * e.g., { id: 'vishal', cid: ['messaging:id1', 'messaging:id2'] }.\n * All the conditions will be joined with AND in final query.\n * @returns {string} Final update query for sqlite\n */\nexport const createUpdateQuery = <T extends keyof Schema>(\n table: T,\n set: Partial<{ [k in TableColumnNames<T>]: any }>,\n whereCondition: Partial<{ [k in TableColumnNames<T>]: any }>,\n) => {\n const fields = Object.keys(set).map((key) => `${key} = ?`);\n const updateQuery = `UPDATE ${table} SET ${fields.join(',')}`;\n\n const [updateQueryWithWhere, whereParams] = appendWhereClause(updateQuery, whereCondition);\n\n return [updateQueryWithWhere, [...Object.values(set), ...whereParams]] as PreparedQueries;\n};\n"]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.createUpsertQuery = void 0;
|
|
5
|
+
|
|
6
|
+
var _schema = require("../schema");
|
|
7
|
+
|
|
8
|
+
var createUpsertQuery = function createUpsertQuery(table, row, conflictCheckKeys) {
|
|
9
|
+
var filteredRow = {};
|
|
10
|
+
|
|
11
|
+
for (var key in row) {
|
|
12
|
+
if (row[key] !== undefined) {
|
|
13
|
+
filteredRow[key] = row[key];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var fields = Object.keys(filteredRow);
|
|
18
|
+
var questionMarks = Array(Object.keys(fields).length).fill('?').join(',');
|
|
19
|
+
var conflictKeys = conflictCheckKeys || _schema.tables[table].primaryKey;
|
|
20
|
+
var conflictMatchersWithoutPK = fields.filter(function (f) {
|
|
21
|
+
return !conflictKeys.includes(f);
|
|
22
|
+
}).map(function (f) {
|
|
23
|
+
return f + "=excluded." + f;
|
|
24
|
+
});
|
|
25
|
+
var conflictConstraint = conflictKeys.length > 0 ? "ON CONFLICT(" + conflictKeys.join(',') + ") DO UPDATE SET\n " + conflictMatchersWithoutPK.join(',') : '';
|
|
26
|
+
return ["INSERT INTO " + table + " (" + fields.join(',') + ") VALUES (" + questionMarks + ") " + conflictConstraint, Object.values(filteredRow)];
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.createUpsertQuery = createUpsertQuery;
|
|
30
|
+
//# sourceMappingURL=createUpsertQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["createUpsertQuery.ts"],"names":["createUpsertQuery","table","row","conflictCheckKeys","filteredRow","key","undefined","fields","Object","keys","questionMarks","Array","length","fill","join","conflictKeys","tables","primaryKey","conflictMatchersWithoutPK","filter","f","includes","map","conflictConstraint","values"],"mappings":";;;;;AAAA;;AAWO,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,CAC/BC,KAD+B,EAE/BC,GAF+B,EAG/BC,iBAH+B,EAI5B;AACH,MAAMC,WAAuB,GAAG,EAAhC;;AAQA,OAAK,IAAMC,GAAX,IAAkBH,GAAlB,EAAuB;AACrB,QAAIA,GAAG,CAACG,GAAD,CAAH,KAAaC,SAAjB,EAA4B;AAC1BF,MAAAA,WAAW,CAACC,GAAD,CAAX,GAAmBH,GAAG,CAACG,GAAD,CAAtB;AACD;AACF;;AACD,MAAME,MAAM,GAAGC,MAAM,CAACC,IAAP,CAAYL,WAAZ,CAAf;AAEA,MAAMM,aAAa,GAAGC,KAAK,CAACH,MAAM,CAACC,IAAP,CAAYF,MAAZ,EAAoBK,MAArB,CAAL,CAAkCC,IAAlC,CAAuC,GAAvC,EAA4CC,IAA5C,CAAiD,GAAjD,CAAtB;AACA,MAAMC,YAAY,GAAGZ,iBAAiB,IAAIa,eAAOf,KAAP,EAAcgB,UAAxD;AACA,MAAMC,yBAAmC,GAAIX,MAAD,CACzCY,MADyC,CAClC,UAACC,CAAD;AAAA,WAAO,CAAEL,YAAD,CAA2BM,QAA3B,CAAoCD,CAApC,CAAR;AAAA,GADkC,EAEzCE,GAFyC,CAErC,UAACF,CAAD;AAAA,WAAUA,CAAV,kBAAwBA,CAAxB;AAAA,GAFqC,CAA5C;AAIA,MAAMG,kBAAkB,GACtBR,YAAY,CAACH,MAAb,GAAsB,CAAtB,oBACmBG,YAAY,CAACD,IAAb,CAAkB,GAAlB,CADnB,2BAEAI,yBAAyB,CAACJ,IAA1B,CAA+B,GAA/B,CAFA,GAGI,EAJN;AAMA,SAAO,kBACUb,KADV,UACoBM,MAAM,CAACO,IAAP,CAAY,GAAZ,CADpB,kBACiDJ,aADjD,UACmEa,kBADnE,EAELf,MAAM,CAACgB,MAAP,CAAcpB,WAAd,CAFK,CAAP;AAID,CApCM","sourcesContent":["import { Schema, tables } from '../schema';\nimport type { PreparedQueries, TableColumnNames, TableRow } from '../types';\n\n/**\n * Creates a simple upsert query for sqlite.\n *\n * @param {string} table Table name\n * @param {Object} row Table row to insert or update.\n * @param {Array} conflictCheckKeys Custom list of columns to check conflicts for - https://www.sqlite.org/lang_UPSERT.html. By default conflicts are checked on primary keys.\n * @returns {string} Final upsert query for sqlite\n */\nexport const createUpsertQuery = <T extends keyof Schema>(\n table: T,\n row: Partial<TableRow<T>>,\n conflictCheckKeys?: Array<TableColumnNames<T>>,\n) => {\n const filteredRow: typeof row = {};\n\n // In case of \"DO UPDATE SET\", we only want to update the properties which\n // are provided, and not set undefined properties in database.\n // E.g., channel date such as `own_capabilities` is only available in response of client.queryChannels or channel.query.\n // But its not available in `event.channel`. And our mapper functions such as mapChannelToStorable will set fields which are not available as undefined.\n // So when you execute upsert query for storable value of `event.channel` in `channels` table, it will\n // unset ownCapabilities field for that channel in `channels` table.\n for (const key in row) {\n if (row[key] !== undefined) {\n filteredRow[key] = row[key];\n }\n }\n const fields = Object.keys(filteredRow) as (keyof typeof row)[];\n\n const questionMarks = Array(Object.keys(fields).length).fill('?').join(',');\n const conflictKeys = conflictCheckKeys || tables[table].primaryKey;\n const conflictMatchersWithoutPK: string[] = (fields as string[])\n .filter((f) => !(conflictKeys as string[]).includes(f))\n .map((f) => `${f}=excluded.${f}`);\n\n const conflictConstraint =\n conflictKeys.length > 0\n ? `ON CONFLICT(${conflictKeys.join(',')}) DO UPDATE SET\n ${conflictMatchersWithoutPK.join(',')}`\n : '';\n\n return [\n `INSERT INTO ${table} (${fields.join(',')}) VALUES (${questionMarks}) ${conflictConstraint}`,\n Object.values(filteredRow),\n ] as PreparedQueries;\n};\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2
|
+
value: true
|
|
3
|
+
});
|
|
4
|
+
exports.printRow = void 0;
|
|
5
|
+
|
|
6
|
+
function isJson(str) {
|
|
7
|
+
try {
|
|
8
|
+
JSON.parse(str);
|
|
9
|
+
} catch (e) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var printRow = function printRow(row) {
|
|
17
|
+
var prettyRow = {};
|
|
18
|
+
|
|
19
|
+
for (var key in row) {
|
|
20
|
+
var value = row[key];
|
|
21
|
+
|
|
22
|
+
if (isJson(value)) {
|
|
23
|
+
prettyRow[key] = JSON.parse(value);
|
|
24
|
+
} else {
|
|
25
|
+
prettyRow[key] = value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
console.log(JSON.stringify(prettyRow, null, 2));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
exports.printRow = printRow;
|
|
33
|
+
//# sourceMappingURL=printRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["printRow.ts"],"names":["isJson","str","JSON","parse","e","printRow","row","prettyRow","key","value","console","log","stringify"],"mappings":";;;;;AAEA,SAASA,MAAT,CAAgBC,GAAhB,EAA6B;AAC3B,MAAI;AACFC,IAAAA,IAAI,CAACC,KAAL,CAAWF,GAAX;AACD,GAFD,CAEE,OAAOG,CAAP,EAAU;AACV,WAAO,KAAP;AACD;;AACD,SAAO,IAAP;AACD;;AAEM,IAAMC,QAAQ,GAAG,SAAXA,QAAW,CAACC,GAAD,EAAwB;AAC9C,MAAMC,SAAS,GAAG,EAAlB;;AACA,OAAK,IAAMC,GAAX,IAAkBF,GAAlB,EAAuB;AAErB,QAAMG,KAAK,GAAGH,GAAG,CAACE,GAAD,CAAjB;;AAEA,QAAIR,MAAM,CAACS,KAAD,CAAV,EAAmB;AAEjBF,MAAAA,SAAS,CAACC,GAAD,CAAT,GAAiBN,IAAI,CAACC,KAAL,CAAWM,KAAX,CAAjB;AACD,KAHD,MAGO;AAELF,MAAAA,SAAS,CAACC,GAAD,CAAT,GAAiBC,KAAjB;AACD;AACF;;AAEDC,EAAAA,OAAO,CAACC,GAAR,CAAYT,IAAI,CAACU,SAAL,CAAeL,SAAf,EAA0B,IAA1B,EAAgC,CAAhC,CAAZ;AACD,CAhBM","sourcesContent":["import type { TableRow } from '../types';\n\nfunction isJson(str: string) {\n try {\n JSON.parse(str);\n } catch (e) {\n return false;\n }\n return true;\n}\n\nexport const printRow = (row: TableRow<any>) => {\n const prettyRow = {};\n for (const key in row) {\n // @ts-ignore\n const value = row[key];\n\n if (isJson(value)) {\n // @ts-ignore\n prettyRow[key] = JSON.parse(value);\n } else {\n // @ts-ignore\n prettyRow[key] = value;\n }\n }\n\n console.log(JSON.stringify(prettyRow, null, 2));\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
|
package/lib/module/version.json
CHANGED
|
@@ -51,11 +51,6 @@ export declare type ChannelPropsWithContext<StreamChatGenerics extends DefaultSt
|
|
|
51
51
|
* @param updatedMessage UpdatedMessage object
|
|
52
52
|
*/
|
|
53
53
|
doUpdateMessageRequest?: (channelId: string, updatedMessage: Parameters<StreamChat<StreamChatGenerics>['updateMessage']>[0]) => ReturnType<StreamChat<StreamChatGenerics>['updateMessage']>;
|
|
54
|
-
/**
|
|
55
|
-
* E.g. Once unread count exceeds 255, display unread count as 255+ instead of actual count.
|
|
56
|
-
* Also 255 is the limit per Stream chat channel for unread count.
|
|
57
|
-
*/
|
|
58
|
-
globalUnreadCountLimit?: number;
|
|
59
54
|
/**
|
|
60
55
|
* When true, messageList will be scrolled at first unread message, when opened.
|
|
61
56
|
*/
|
|
@@ -87,6 +82,9 @@ export declare type ChannelPropsWithContext<StreamChatGenerics extends DefaultSt
|
|
|
87
82
|
*/
|
|
88
83
|
LoadingErrorIndicator?: React.ComponentType<LoadingErrorProps>;
|
|
89
84
|
maxMessageLength?: number;
|
|
85
|
+
/**
|
|
86
|
+
* Load the channel at a specified message instead of the most recent message.
|
|
87
|
+
*/
|
|
90
88
|
messageId?: string;
|
|
91
89
|
newMessageStateUpdateThrottleInterval?: number;
|
|
92
90
|
overrideOwnCapabilities?: Partial<OwnCapabilitiesContextValue>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ChannelContextValue } from '../../../contexts/channelContext/ChannelContext';
|
|
2
2
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
3
|
-
export declare const useCreateChannelContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channel, disabled, EmptyStateIndicator, enableMessageGroupingByUser, enforceUniqueReaction, error, giphyEnabled, hideDateSeparators, hideStickyDateHeader, isAdmin, isChannelActive, isModerator, isOwner, lastRead, loadChannelAtMessage, loading, LoadingIndicator, markRead, maxTimeBetweenGroupedMessages, members, NetworkDownIndicator, read, reloadChannel, scrollToFirstUnreadThreshold, setLastRead, setTargetedMessage, StickyHeader, targetedMessage, threadList, watcherCount, watchers, }: ChannelContextValue<StreamChatGenerics>) => ChannelContextValue<StreamChatGenerics>;
|
|
3
|
+
export declare const useCreateChannelContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channel, disabled, EmptyStateIndicator, enableMessageGroupingByUser, enforceUniqueReaction, error, giphyEnabled, hideDateSeparators, hideStickyDateHeader, isAdmin, isChannelActive, isModerator, isOwner, lastRead, loadChannelAroundMessage, loadChannelAtMessage, loading, LoadingIndicator, markRead, maxTimeBetweenGroupedMessages, members, NetworkDownIndicator, read, reloadChannel, scrollToFirstUnreadThreshold, setLastRead, setTargetedMessage, StickyHeader, targetedMessage, threadList, watcherCount, watchers, }: ChannelContextValue<StreamChatGenerics>) => ChannelContextValue<StreamChatGenerics>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PaginatedMessageListContextValue } from '../../../contexts/paginatedMessageListContext/PaginatedMessageListContext';
|
|
2
2
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
3
|
-
export declare const useCreatePaginatedMessageListContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channelId, hasMore, loadingMore, loadingMoreRecent, loadMore, loadMoreRecent, messages, setLoadingMore, setLoadingMoreRecent, }: PaginatedMessageListContextValue<StreamChatGenerics> & {
|
|
3
|
+
export declare const useCreatePaginatedMessageListContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ channelId, hasMore, hasNoMoreRecentMessagesToLoad, loadingMore, loadingMoreRecent, loadMore, loadMoreRecent, messages, setLoadingMore, setLoadingMoreRecent, }: PaginatedMessageListContextValue<StreamChatGenerics> & {
|
|
4
4
|
channelId?: string | undefined;
|
|
5
5
|
}) => PaginatedMessageListContextValue<StreamChatGenerics>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { DefaultStreamChatGenerics } from '../../../../types/types';
|
|
3
|
-
declare type
|
|
3
|
+
declare type Params = {
|
|
4
|
+
enableOfflineSupport: boolean;
|
|
4
5
|
refreshList: () => void;
|
|
5
6
|
setForceUpdate: React.Dispatch<React.SetStateAction<number>>;
|
|
6
7
|
};
|
|
7
|
-
export declare const useConnectionRecovered: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ refreshList, setForceUpdate, }:
|
|
8
|
+
export declare const useConnectionRecovered: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ enableOfflineSupport, refreshList, setForceUpdate, }: Params) => void;
|
|
8
9
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DefaultStreamChatGenerics } from '../../../../types/types';
|
|
2
|
+
declare type Params = {
|
|
3
|
+
enableOfflineSupport: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare const useSyncDatabase: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ enableOfflineSupport, }: Params) => void;
|
|
6
|
+
export {};
|
|
@@ -2,19 +2,21 @@
|
|
|
2
2
|
import type { Channel, ChannelFilters, ChannelOptions, ChannelSort } from 'stream-chat';
|
|
3
3
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
4
4
|
declare type Parameters<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
|
|
5
|
+
enableOfflineSupport: boolean;
|
|
5
6
|
filters: ChannelFilters<StreamChatGenerics>;
|
|
6
7
|
options: ChannelOptions;
|
|
7
8
|
sort: ChannelSort<StreamChatGenerics>;
|
|
8
9
|
};
|
|
9
|
-
declare type QueryType = 'reload' | 'refresh' | 'loadChannels';
|
|
10
|
+
declare type QueryType = 'queryLocalDB' | 'reload' | 'refresh' | 'loadChannels';
|
|
10
11
|
export declare type QueryChannels = (queryType?: QueryType, retryCount?: number) => Promise<void>;
|
|
11
|
-
export declare const usePaginatedChannels: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ filters, options, sort, }: Parameters<StreamChatGenerics>) => {
|
|
12
|
+
export declare const usePaginatedChannels: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ enableOfflineSupport, filters, options, sort, }: Parameters<StreamChatGenerics>) => {
|
|
12
13
|
channels: Channel<StreamChatGenerics>[];
|
|
13
14
|
error: Error | undefined;
|
|
14
15
|
hasNextPage: boolean;
|
|
15
16
|
loadingChannels: boolean;
|
|
16
17
|
loadingNextPage: boolean;
|
|
17
18
|
loadNextPage: QueryChannels | undefined;
|
|
19
|
+
staticChannelsActive: boolean;
|
|
18
20
|
refreshing: boolean;
|
|
19
21
|
refreshList: () => Promise<void> | undefined;
|
|
20
22
|
reloadList: () => Promise<void>;
|
|
@@ -12,6 +12,10 @@ export declare type ChatProps<StreamChatGenerics extends DefaultStreamChatGeneri
|
|
|
12
12
|
* app goes to background, and reconnect when app comes to foreground.
|
|
13
13
|
*/
|
|
14
14
|
closeConnectionOnBackground?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Enables offline storage and loading for chat data.
|
|
17
|
+
*/
|
|
18
|
+
enableOfflineSupport?: boolean;
|
|
15
19
|
/**
|
|
16
20
|
* Instance of Streami18n class should be provided to Chat component to enable internationalization.
|
|
17
21
|
*
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ChatContextValue } from '../../../contexts/chatContext/ChatContext';
|
|
2
2
|
import type { DefaultStreamChatGenerics } from '../../../types/types';
|
|
3
|
-
export declare const useCreateChatContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ appSettings, channel, client, connectionRecovering, isOnline, mutedUsers, setActiveChannel, }: ChatContextValue<StreamChatGenerics>) => ChatContextValue<StreamChatGenerics>;
|
|
3
|
+
export declare const useCreateChatContext: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ appSettings, channel, client, connectionRecovering, enableOfflineSupport, isOnline, mutedUsers, setActiveChannel, }: ChatContextValue<StreamChatGenerics>) => ChatContextValue<StreamChatGenerics>;
|
|
@@ -11,7 +11,7 @@ import { PaginatedMessageListContextValue } from '../../contexts/paginatedMessag
|
|
|
11
11
|
import { ThreadContextValue } from '../../contexts/threadContext/ThreadContext';
|
|
12
12
|
import { TranslationContextValue } from '../../contexts/translationContext/TranslationContext';
|
|
13
13
|
import type { DefaultStreamChatGenerics } from '../../types/types';
|
|
14
|
-
declare type MessageListPropsWithContext<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<AttachmentPickerContextValue, 'closePicker' | 'selectedPicker' | 'setSelectedPicker'> & Pick<ChannelContextValue<StreamChatGenerics>, 'channel' | 'disabled' | 'EmptyStateIndicator' | 'hideStickyDateHeader' | '
|
|
14
|
+
declare type MessageListPropsWithContext<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = Pick<AttachmentPickerContextValue, 'closePicker' | 'selectedPicker' | 'setSelectedPicker'> & Pick<ChannelContextValue<StreamChatGenerics>, 'channel' | 'disabled' | 'EmptyStateIndicator' | 'hideStickyDateHeader' | 'loadChannelAroundMessage' | 'loading' | 'LoadingIndicator' | 'markRead' | 'NetworkDownIndicator' | 'reloadChannel' | 'scrollToFirstUnreadThreshold' | 'setTargetedMessage' | 'StickyHeader' | 'targetedMessage'> & Pick<ChatContextValue<StreamChatGenerics>, 'client'> & Pick<ImageGalleryContextValue<StreamChatGenerics>, 'setImages'> & Pick<PaginatedMessageListContextValue<StreamChatGenerics>, 'hasNoMoreRecentMessagesToLoad' | 'loadMore' | 'loadMoreRecent'> & Pick<OverlayContextValue, 'overlay'> & Pick<MessagesContextValue<StreamChatGenerics>, 'deletedMessagesVisibilityType' | 'DateHeader' | 'disableTypingIndicator' | 'FlatList' | 'initialScrollToFirstUnreadMessage' | 'InlineDateSeparator' | 'InlineUnreadIndicator' | 'legacyImageViewerSwipeBehaviour' | 'Message' | 'ScrollToBottomButton' | 'MessageSystem' | 'myMessageTheme' | 'TypingIndicator' | 'TypingIndicatorContainer'> & Pick<ThreadContextValue<StreamChatGenerics>, 'loadMoreThread' | 'thread'> & Pick<TranslationContextValue, 't' | 'tDateTimeParser'> & {
|
|
15
15
|
/**
|
|
16
16
|
* Besides existing (default) UX behavior of underlying FlatList of MessageList component, if you want
|
|
17
17
|
* to attach some additional props to underlying FlatList, you can add it to following prop.
|
|
@@ -62,6 +62,23 @@ export declare type ChannelContextValue<StreamChatGenerics extends DefaultStream
|
|
|
62
62
|
* Returns true if the current user is a owner
|
|
63
63
|
*/
|
|
64
64
|
isOwner: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Loads channel around a specific message
|
|
67
|
+
*
|
|
68
|
+
* @param messageId If undefined, channel will be loaded at most recent message.
|
|
69
|
+
*/
|
|
70
|
+
loadChannelAroundMessage: ({ messageId }: {
|
|
71
|
+
messageId?: string;
|
|
72
|
+
}) => Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* @deprecated use loadChannelAroundMessage instead
|
|
75
|
+
*
|
|
76
|
+
* Loads channel at specific message
|
|
77
|
+
*
|
|
78
|
+
* @param messageId If undefined, channel will be loaded at most recent message.
|
|
79
|
+
* @param before Number of message to query before messageId
|
|
80
|
+
* @param after Number of message to query after messageId
|
|
81
|
+
*/
|
|
65
82
|
loadChannelAtMessage: ({ after, before, messageId, }: {
|
|
66
83
|
after?: number;
|
|
67
84
|
before?: number;
|