@amityco/ts-sdk 6.35.3-fa3d4ac.0 → 7.0.1-7547014.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/dist/@types/core/events.d.ts +6 -6
- package/dist/@types/core/events.d.ts.map +1 -1
- package/dist/@types/core/linkPreview.d.ts +12 -0
- package/dist/@types/core/linkPreview.d.ts.map +1 -0
- package/dist/@types/domains/analytics.d.ts +0 -3
- package/dist/@types/domains/analytics.d.ts.map +1 -1
- package/dist/@types/domains/channel.d.ts +9 -33
- package/dist/@types/domains/channel.d.ts.map +1 -1
- package/dist/@types/domains/client.d.ts +0 -4
- package/dist/@types/domains/client.d.ts.map +1 -1
- package/dist/@types/domains/community.d.ts +2 -10
- package/dist/@types/domains/community.d.ts.map +1 -1
- package/dist/@types/domains/feed.d.ts +0 -11
- package/dist/@types/domains/feed.d.ts.map +1 -1
- package/dist/@types/domains/message.d.ts +0 -12
- package/dist/@types/domains/message.d.ts.map +1 -1
- package/dist/@types/domains/subChannel.d.ts +0 -4
- package/dist/@types/domains/subChannel.d.ts.map +1 -1
- package/dist/@types/domains/user.d.ts +1 -5
- package/dist/@types/domains/user.d.ts.map +1 -1
- package/dist/channelRepository/api/deleteChannel.d.ts.map +1 -1
- package/dist/channelRepository/api/index.d.ts +0 -1
- package/dist/channelRepository/api/index.d.ts.map +1 -1
- package/dist/channelRepository/channelMembership/observers/getMembers/ChannelMemberLiveCollectionController.d.ts.map +1 -1
- package/dist/channelRepository/channelMembership/observers/getMembers/getMembers.d.ts.map +1 -1
- package/dist/channelRepository/channelMembership/observers/searchMembers/SearchChannelMemberLiveCollectionController.d.ts.map +1 -1
- package/dist/channelRepository/channelMembership/observers/searchMembers/searchMembers.d.ts.map +1 -1
- package/dist/channelRepository/{api → internalApi}/getChannel.d.ts +2 -2
- package/dist/channelRepository/internalApi/getChannel.d.ts.map +1 -0
- package/dist/channelRepository/internalApi/getChannelByIds.d.ts +32 -0
- package/dist/channelRepository/internalApi/getChannelByIds.d.ts.map +1 -0
- package/dist/channelRepository/{api → internalApi}/markAsRead.d.ts +0 -3
- package/dist/channelRepository/internalApi/markAsRead.d.ts.map +1 -0
- package/dist/channelRepository/observers/getChannel.d.ts.map +1 -1
- package/dist/channelRepository/observers/getChannels/ChannelLiveCollectionController.d.ts.map +1 -1
- package/dist/channelRepository/observers/index.d.ts +0 -2
- package/dist/channelRepository/observers/index.d.ts.map +1 -1
- package/dist/channelRepository/utils/constructChannelDynamicValue.d.ts.map +1 -1
- package/dist/channelRepository/utils/constructChannelObject.d.ts +2 -0
- package/dist/channelRepository/utils/constructChannelObject.d.ts.map +1 -0
- package/dist/channelRepository/utils/getChannelIsMentioned.d.ts +1 -1
- package/dist/channelRepository/utils/getChannelIsMentioned.d.ts.map +1 -1
- package/dist/channelRepository/utils/getSubChannelsUnreadCount.d.ts +1 -1
- package/dist/channelRepository/utils/getSubChannelsUnreadCount.d.ts.map +1 -1
- package/dist/channelRepository/utils/resolveChannels.d.ts.map +1 -1
- package/dist/channelRepository/utils/updateChannelCache.d.ts +1 -1
- package/dist/channelRepository/utils/updateChannelCache.d.ts.map +1 -1
- package/dist/client/api/fetchLinkPreview.d.ts +14 -0
- package/dist/client/api/fetchLinkPreview.d.ts.map +1 -0
- package/dist/client/api/index.d.ts +1 -0
- package/dist/client/api/index.d.ts.map +1 -1
- package/dist/client/observers/index.d.ts +0 -1
- package/dist/client/observers/index.d.ts.map +1 -1
- package/dist/client/utils/endpoints.d.ts +1 -1
- package/dist/client/utils/markerSyncEngine.d.ts +0 -4
- package/dist/client/utils/markerSyncEngine.d.ts.map +1 -1
- package/dist/client/utils/subscribeGlobalTopic.d.ts.map +1 -1
- package/dist/commentRepository/observers/index.d.ts +0 -2
- package/dist/commentRepository/observers/index.d.ts.map +1 -1
- package/dist/communityRepository/api/index.d.ts +0 -1
- package/dist/communityRepository/api/index.d.ts.map +1 -1
- package/dist/communityRepository/api/queryCommunities.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersLiveCollectionController.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/getMembers.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersPaginationController.d.ts +1 -1
- package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersPaginationController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getCommunities/CommunitiesPaginationController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/observers/index.d.ts +0 -1
- package/dist/communityRepository/observers/index.d.ts.map +1 -1
- package/dist/communityRepository/observers/searchCommunities.d.ts +1 -1
- package/dist/communityRepository/observers/searchCommunities.d.ts.map +1 -1
- package/dist/communityRepository/utils/communityQueryFilter.d.ts.map +1 -1
- package/dist/core/events.d.ts +3 -3
- package/dist/core/events.d.ts.map +1 -1
- package/dist/core/subscription.d.ts +1 -0
- package/dist/core/subscription.d.ts.map +1 -1
- package/dist/feedRepository/api/getCustomRankingGlobalFeed.d.ts +2 -35
- package/dist/feedRepository/api/getCustomRankingGlobalFeed.d.ts.map +1 -1
- package/dist/feedRepository/api/queryGlobalFeed.d.ts +2 -24
- package/dist/feedRepository/api/queryGlobalFeed.d.ts.map +1 -1
- package/dist/fileRepository/api/index.d.ts +0 -3
- package/dist/fileRepository/api/index.d.ts.map +1 -1
- package/dist/fileRepository/index.d.ts +0 -1
- package/dist/fileRepository/index.d.ts.map +1 -1
- package/dist/index.cjs.js +1282 -2686
- package/dist/index.esm.js +1233 -2638
- package/dist/index.umd.js +4 -4
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts +1 -5
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts.map +1 -1
- package/dist/messagePreview/utils/getSubChannelMessagePreviewWithUser.d.ts +0 -1
- package/dist/messagePreview/utils/getSubChannelMessagePreviewWithUser.d.ts.map +1 -1
- package/dist/messageRepository/api/createMessage.d.ts.map +1 -1
- package/dist/messageRepository/api/index.d.ts +0 -1
- package/dist/messageRepository/api/index.d.ts.map +1 -1
- package/dist/messageRepository/internalApi/getMessage.d.ts.map +1 -1
- package/dist/messageRepository/observers/getMessages/MessageLiveCollectionController.d.ts.map +1 -1
- package/dist/messageRepository/observers/getMessages/MessageQueryStreamController.d.ts.map +1 -1
- package/dist/messageRepository/observers/getMessages/getMessages.d.ts +0 -1
- package/dist/messageRepository/observers/getMessages/getMessages.d.ts.map +1 -1
- package/dist/messageRepository/observers/index.d.ts +0 -2
- package/dist/messageRepository/observers/index.d.ts.map +1 -1
- package/dist/messageRepository/utils/prepareMessagePayload.d.ts +1 -1
- package/dist/messageRepository/utils/prepareMessagePayload.d.ts.map +1 -1
- package/dist/pollRepository/observers/index.d.ts +0 -1
- package/dist/pollRepository/observers/index.d.ts.map +1 -1
- package/dist/postRepository/api/index.d.ts +0 -1
- package/dist/postRepository/api/index.d.ts.map +1 -1
- package/dist/postRepository/observers/index.d.ts +0 -2
- package/dist/postRepository/observers/index.d.ts.map +1 -1
- package/dist/role/api/queryRoles.d.ts +0 -7
- package/dist/role/api/queryRoles.d.ts.map +1 -1
- package/dist/streamRepository/api/index.d.ts +0 -2
- package/dist/streamRepository/api/index.d.ts.map +1 -1
- package/dist/streamRepository/events/onStreamFlagged.d.ts.map +1 -1
- package/dist/streamRepository/internalApi/getStream.d.ts.map +1 -0
- package/dist/subChannelRepository/utils/markReadEngine.d.ts +0 -34
- package/dist/subChannelRepository/utils/markReadEngine.d.ts.map +1 -1
- package/dist/userRepository/internalApi/queryUsers.d.ts.map +1 -1
- package/dist/userRepository/observers/getUsers/UserLiveCollectionController.d.ts.map +1 -1
- package/dist/userRepository/observers/getUsers/UserPaginationController.d.ts.map +1 -1
- package/dist/userRepository/observers/index.d.ts +0 -2
- package/dist/userRepository/observers/index.d.ts.map +1 -1
- package/dist/userRepository/relationship/block/index.d.ts +0 -1
- package/dist/userRepository/relationship/block/index.d.ts.map +1 -1
- package/dist/userRepository/relationship/follow/api/index.d.ts +0 -2
- package/dist/userRepository/relationship/follow/api/index.d.ts.map +1 -1
- package/dist/userRepository/relationship/follow/observers/index.d.ts +0 -3
- package/dist/userRepository/relationship/follow/observers/index.d.ts.map +1 -1
- package/dist/utils/liveObject.d.ts +1 -1
- package/package.json +1 -1
- package/src/@types/core/events.ts +8 -9
- package/src/@types/core/linkPreview.ts +12 -0
- package/src/@types/domains/analytics.ts +0 -7
- package/src/@types/domains/channel.ts +15 -46
- package/src/@types/domains/client.ts +0 -4
- package/src/@types/domains/community.ts +0 -8
- package/src/@types/domains/feed.ts +0 -11
- package/src/@types/domains/message.ts +0 -12
- package/src/@types/domains/subChannel.ts +0 -4
- package/src/@types/domains/user.ts +0 -4
- package/src/analytic/api/queryReachUser.ts +1 -1
- package/src/channelRepository/api/deleteChannel.ts +3 -2
- package/src/channelRepository/api/getChannelByIds.ts +5 -5
- package/src/channelRepository/api/index.ts +0 -2
- package/src/channelRepository/channelMembership/observers/getMembers/ChannelMemberLiveCollectionController.ts +0 -8
- package/src/channelRepository/channelMembership/observers/getMembers/getMembers.ts +0 -8
- package/src/channelRepository/channelMembership/observers/searchMembers/SearchChannelMemberLiveCollectionController.ts +0 -8
- package/src/channelRepository/channelMembership/observers/searchMembers/searchMembers.ts +0 -8
- package/src/channelRepository/{api → internalApi}/getChannel.ts +4 -4
- package/src/channelRepository/internalApi/getChannelByIds.ts +105 -0
- package/src/channelRepository/{api → internalApi}/markAsRead.ts +0 -3
- package/src/channelRepository/observers/getChannel.ts +36 -15
- package/src/channelRepository/observers/getChannels/ChannelLiveCollectionController.ts +11 -12
- package/src/channelRepository/observers/index.ts +0 -2
- package/src/channelRepository/utils/constructChannelDynamicValue.ts +4 -9
- package/src/channelRepository/utils/constructChannelObject.ts +16 -0
- package/src/channelRepository/utils/getChannelIsMentioned.ts +4 -1
- package/src/channelRepository/utils/getSubChannelsUnreadCount.ts +1 -1
- package/src/channelRepository/utils/resolveChannels.ts +7 -2
- package/src/channelRepository/utils/updateChannelCache.ts +4 -1
- package/src/client/api/fetchLinkPreview.ts +30 -0
- package/src/client/api/index.ts +2 -0
- package/src/client/observers/getUserUnread.ts +1 -1
- package/src/client/observers/index.ts +0 -1
- package/src/client/utils/endpoints.ts +1 -1
- package/src/client/utils/markerSyncEngine.ts +0 -9
- package/src/client/utils/subscribeGlobalTopic.ts +3 -0
- package/src/commentRepository/observers/index.ts +0 -2
- package/src/communityRepository/api/index.ts +0 -3
- package/src/communityRepository/api/queryCommunities.ts +1 -2
- package/src/communityRepository/communityMembership/observers/getMembers/CommunityMembersLiveCollectionController.ts +0 -12
- package/src/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.ts +0 -7
- package/src/communityRepository/communityMembership/observers/getMembers.ts +0 -4
- package/src/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersPaginationController.ts +1 -1
- package/src/communityRepository/communityMembership/observers/tests/getMembers.test.ts +0 -1
- package/src/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.ts +12 -16
- package/src/communityRepository/observers/getCommunities/CommunitiesPaginationController.ts +0 -1
- package/src/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.ts +0 -4
- package/src/communityRepository/observers/index.ts +0 -2
- package/src/communityRepository/observers/searchCommunities.ts +1 -1
- package/src/communityRepository/observers/tests/getCommunities.test.ts +0 -1
- package/src/communityRepository/utils/communityQueryFilter.ts +1 -8
- package/src/core/events.ts +7 -5
- package/src/core/subscription.ts +6 -0
- package/src/feedRepository/api/getCustomRankingGlobalFeed.ts +8 -55
- package/src/feedRepository/api/queryGlobalFeed.ts +6 -58
- package/src/feedRepository/api/test/getCustomRankingGlobalFeed.test.ts +1 -1
- package/src/feedRepository/api/test/queryGlobalFeed.test.ts +1 -1
- package/src/fileRepository/api/index.ts +0 -5
- package/src/fileRepository/index.ts +0 -1
- package/src/liveStreamPlayer/api/getPlayer.ts +1 -1
- package/src/messagePreview/utils/getChannelMessagePreviewWithUser.ts +2 -2
- package/src/messageRepository/api/createMessage.ts +5 -1
- package/src/messageRepository/api/index.ts +0 -2
- package/src/messageRepository/api/tests/createMessage.test.ts +6 -1
- package/src/messageRepository/api/tests/deleteMessage.test.ts +5 -1
- package/src/messageRepository/internalApi/getMessage.ts +0 -6
- package/src/messageRepository/observers/getMessages/MessageLiveCollectionController.ts +0 -20
- package/src/messageRepository/observers/getMessages/MessageQueryStreamController.ts +0 -10
- package/src/messageRepository/observers/getMessages/getMessages.ts +0 -54
- package/src/messageRepository/observers/index.ts +0 -3
- package/src/messageRepository/utils/prepareMessagePayload.ts +1 -7
- package/src/pollRepository/observers/index.ts +0 -1
- package/src/postRepository/api/index.ts +0 -1
- package/src/postRepository/observers/index.ts +0 -2
- package/src/role/api/queryRoles.ts +1 -13
- package/src/streamRepository/api/deleteStream.ts +1 -1
- package/src/streamRepository/api/index.ts +0 -4
- package/src/streamRepository/api/tests/getStream.test.ts +1 -1
- package/src/streamRepository/events/onStreamFlagged.ts +1 -6
- package/src/streamRepository/events/onStreamRecorded.ts +1 -1
- package/src/streamRepository/events/onStreamStarted.ts +1 -1
- package/src/streamRepository/events/onStreamStopped.ts +1 -1
- package/src/streamRepository/events/onStreamTerminated.ts +1 -1
- package/src/streamRepository/observers/getStreamById.ts +1 -1
- package/src/subChannelRepository/utils/markReadEngine.ts +0 -106
- package/src/userRepository/internalApi/queryUsers.ts +1 -9
- package/src/userRepository/observers/getUsers/UserLiveCollectionController.ts +12 -16
- package/src/userRepository/observers/getUsers/UserPaginationController.ts +1 -2
- package/src/userRepository/observers/index.ts +0 -2
- package/src/userRepository/observers/tests/getUsers.test.ts +1 -43
- package/src/userRepository/relationship/block/index.ts +0 -1
- package/src/userRepository/relationship/follow/api/index.ts +0 -4
- package/src/userRepository/relationship/follow/observers/index.ts +0 -4
- package/src/utils/linkedObject/channelLinkedObject.ts +1 -1
- package/src/utils/liveObject.ts +2 -2
- package/dist/channelRepository/api/getChannel.d.ts.map +0 -1
- package/dist/channelRepository/api/markAsRead.d.ts.map +0 -1
- package/dist/channelRepository/observers/observeChannel.d.ts +0 -18
- package/dist/channelRepository/observers/observeChannel.d.ts.map +0 -1
- package/dist/channelRepository/observers/observeChannels.d.ts +0 -17
- package/dist/channelRepository/observers/observeChannels.d.ts.map +0 -1
- package/dist/client/observers/getTotalUnreadCount.d.ts +0 -20
- package/dist/client/observers/getTotalUnreadCount.d.ts.map +0 -1
- package/dist/client/observers/tests/getTotalUnreadCount.test.d.ts +0 -2
- package/dist/client/observers/tests/getTotalUnreadCount.test.d.ts.map +0 -1
- package/dist/commentRepository/observers/observeComment.d.ts +0 -18
- package/dist/commentRepository/observers/observeComment.d.ts.map +0 -1
- package/dist/commentRepository/observers/observeComments.d.ts +0 -26
- package/dist/commentRepository/observers/observeComments.d.ts.map +0 -1
- package/dist/communityRepository/api/getTopTrendingCommunities.d.ts +0 -35
- package/dist/communityRepository/api/getTopTrendingCommunities.d.ts.map +0 -1
- package/dist/communityRepository/api/test/getTopTrendingCommunities.test.d.ts +0 -2
- package/dist/communityRepository/api/test/getTopTrendingCommunities.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/observeCommunity.d.ts +0 -18
- package/dist/communityRepository/observers/observeCommunity.d.ts.map +0 -1
- package/dist/feedRepository/internalApi/getCustomRankingGlobalFeed.d.ts +0 -8
- package/dist/feedRepository/internalApi/getCustomRankingGlobalFeed.d.ts.map +0 -1
- package/dist/feedRepository/internalApi/index.d.ts +0 -3
- package/dist/feedRepository/internalApi/index.d.ts.map +0 -1
- package/dist/feedRepository/internalApi/queryGlobalFeed.d.ts +0 -9
- package/dist/feedRepository/internalApi/queryGlobalFeed.d.ts.map +0 -1
- package/dist/feedRepository/internalApi/test/getCustomRankingGlobalFeed.test.d.ts +0 -2
- package/dist/feedRepository/internalApi/test/getCustomRankingGlobalFeed.test.d.ts.map +0 -1
- package/dist/feedRepository/internalApi/test/queryGlobalFeed.test.d.ts +0 -2
- package/dist/feedRepository/internalApi/test/queryGlobalFeed.test.d.ts.map +0 -1
- package/dist/fileRepository/api/createFile.d.ts +0 -17
- package/dist/fileRepository/api/createFile.d.ts.map +0 -1
- package/dist/fileRepository/api/createImage.d.ts +0 -17
- package/dist/fileRepository/api/createImage.d.ts.map +0 -1
- package/dist/fileRepository/api/createVideo.d.ts +0 -18
- package/dist/fileRepository/api/createVideo.d.ts.map +0 -1
- package/dist/fileRepository/observers/index.d.ts +0 -2
- package/dist/fileRepository/observers/index.d.ts.map +0 -1
- package/dist/fileRepository/observers/observeFile.d.ts +0 -18
- package/dist/fileRepository/observers/observeFile.d.ts.map +0 -1
- package/dist/messageRepository/api/getMessage.d.ts +0 -32
- package/dist/messageRepository/api/getMessage.d.ts.map +0 -1
- package/dist/messageRepository/api/getMessages.d.ts +0 -32
- package/dist/messageRepository/api/getMessages.d.ts.map +0 -1
- package/dist/messageRepository/observers/observeMessage.d.ts +0 -21
- package/dist/messageRepository/observers/observeMessage.d.ts.map +0 -1
- package/dist/messageRepository/observers/observeMessages.d.ts +0 -23
- package/dist/messageRepository/observers/observeMessages.d.ts.map +0 -1
- package/dist/pollRepository/observers/observePoll.d.ts +0 -18
- package/dist/pollRepository/observers/observePoll.d.ts.map +0 -1
- package/dist/postRepository/api/updatePost.d.ts +0 -24
- package/dist/postRepository/api/updatePost.d.ts.map +0 -1
- package/dist/postRepository/observers/observePost.d.ts +0 -18
- package/dist/postRepository/observers/observePost.d.ts.map +0 -1
- package/dist/postRepository/observers/observePosts.d.ts +0 -34
- package/dist/postRepository/observers/observePosts.d.ts.map +0 -1
- package/dist/streamRepository/api/getStream.d.ts.map +0 -1
- package/dist/streamRepository/api/queryStreams.d.ts +0 -25
- package/dist/streamRepository/api/queryStreams.d.ts.map +0 -1
- package/dist/userRepository/observers/getViewedUsers.d.ts +0 -7
- package/dist/userRepository/observers/getViewedUsers.d.ts.map +0 -1
- package/dist/userRepository/observers/observeUser.d.ts +0 -17
- package/dist/userRepository/observers/observeUser.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/getViewedUsers.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/getViewedUsers.test.d.ts.map +0 -1
- package/dist/userRepository/relationship/block/observers/getBlockedUsers.d.ts +0 -2
- package/dist/userRepository/relationship/block/observers/getBlockedUsers.d.ts.map +0 -1
- package/dist/userRepository/relationship/block/observers/index.d.ts +0 -2
- package/dist/userRepository/relationship/block/observers/index.d.ts.map +0 -1
- package/dist/userRepository/relationship/follow/api/acceptFollower.d.ts +0 -19
- package/dist/userRepository/relationship/follow/api/acceptFollower.d.ts.map +0 -1
- package/dist/userRepository/relationship/follow/api/declineFollower.d.ts +0 -19
- package/dist/userRepository/relationship/follow/api/declineFollower.d.ts.map +0 -1
- package/dist/userRepository/relationship/follow/observers/observeFollowInfo.d.ts +0 -18
- package/dist/userRepository/relationship/follow/observers/observeFollowInfo.d.ts.map +0 -1
- package/dist/userRepository/relationship/follow/observers/observeFollowers.d.ts +0 -18
- package/dist/userRepository/relationship/follow/observers/observeFollowers.d.ts.map +0 -1
- package/dist/userRepository/relationship/follow/observers/observeFollowings.d.ts +0 -18
- package/dist/userRepository/relationship/follow/observers/observeFollowings.d.ts.map +0 -1
- package/src/channelRepository/observers/observeChannel.ts +0 -109
- package/src/channelRepository/observers/observeChannels.ts +0 -74
- package/src/client/observers/getTotalUnreadCount.ts +0 -53
- package/src/client/observers/tests/getTotalUnreadCount.test.ts +0 -101
- package/src/commentRepository/observers/observeComment.ts +0 -102
- package/src/commentRepository/observers/observeComments.ts +0 -77
- package/src/communityRepository/api/getTopTrendingCommunities.ts +0 -97
- package/src/communityRepository/api/test/getTopTrendingCommunities.test.ts +0 -102
- package/src/communityRepository/observers/observeCommunity.ts +0 -103
- package/src/feedRepository/internalApi/getCustomRankingGlobalFeed.ts +0 -87
- package/src/feedRepository/internalApi/index.ts +0 -2
- package/src/feedRepository/internalApi/queryGlobalFeed.ts +0 -95
- package/src/feedRepository/internalApi/test/getCustomRankingGlobalFeed.test.ts +0 -138
- package/src/feedRepository/internalApi/test/queryGlobalFeed.test.ts +0 -130
- package/src/fileRepository/api/createFile.ts +0 -59
- package/src/fileRepository/api/createImage.ts +0 -59
- package/src/fileRepository/api/createVideo.ts +0 -69
- package/src/fileRepository/observers/index.ts +0 -1
- package/src/fileRepository/observers/observeFile.ts +0 -49
- package/src/messageRepository/api/getMessage.ts +0 -102
- package/src/messageRepository/api/getMessages.ts +0 -83
- package/src/messageRepository/observers/observeMessage.ts +0 -94
- package/src/messageRepository/observers/observeMessages.ts +0 -89
- package/src/pollRepository/observers/observePoll.ts +0 -67
- package/src/postRepository/api/updatePost.ts +0 -63
- package/src/postRepository/observers/observePost.ts +0 -115
- package/src/postRepository/observers/observePosts.ts +0 -86
- package/src/streamRepository/api/queryStreams.ts +0 -63
- package/src/userRepository/observers/getViewedUsers.ts +0 -99
- package/src/userRepository/observers/observeUser.ts +0 -71
- package/src/userRepository/observers/tests/getViewedUsers.test.ts +0 -39
- package/src/userRepository/relationship/block/observers/getBlockedUsers.ts +0 -13
- package/src/userRepository/relationship/block/observers/index.ts +0 -1
- package/src/userRepository/relationship/follow/api/acceptFollower.ts +0 -40
- package/src/userRepository/relationship/follow/api/declineFollower.ts +0 -40
- package/src/userRepository/relationship/follow/observers/observeFollowInfo.ts +0 -64
- package/src/userRepository/relationship/follow/observers/observeFollowers.ts +0 -74
- package/src/userRepository/relationship/follow/observers/observeFollowings.ts +0 -74
- /package/dist/streamRepository/{api → internalApi}/getStream.d.ts +0 -0
- /package/src/streamRepository/{api → internalApi}/getStream.ts +0 -0
|
@@ -101,26 +101,6 @@ export class MessageLiveCollectionController extends LiveCollectionController<
|
|
|
101
101
|
applyFilter(data: Amity.Message[]) {
|
|
102
102
|
let messages = data;
|
|
103
103
|
|
|
104
|
-
messages = messages.filter(m => {
|
|
105
|
-
if (this.query.tags) {
|
|
106
|
-
return this.query.tags.find(value => {
|
|
107
|
-
if (!m.tags) return false;
|
|
108
|
-
return m.tags.includes(value);
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return true;
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
messages = messages.filter(m => {
|
|
115
|
-
if (this.query.excludeTags) {
|
|
116
|
-
return (this.query.excludeTags || []).find(value => {
|
|
117
|
-
if (!m.tags) return true;
|
|
118
|
-
return !m.tags.includes(value);
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
return true;
|
|
122
|
-
});
|
|
123
|
-
|
|
124
104
|
/*
|
|
125
105
|
* for cases when message is deleted via RTE, this flag is used to get
|
|
126
106
|
* items from cache that are !deleted
|
|
@@ -79,19 +79,12 @@ export class MessageQueryStreamController extends QueryStreamController<
|
|
|
79
79
|
|
|
80
80
|
if (this.query.type && this.query.type !== payload.dataType) return;
|
|
81
81
|
|
|
82
|
-
if (this.query.dataType && this.query.dataType !== payload.dataType) return;
|
|
83
|
-
|
|
84
82
|
if (
|
|
85
83
|
this.query.excludingTags &&
|
|
86
84
|
this.query.excludingTags?.some(value => payload.tags?.includes(value))
|
|
87
85
|
)
|
|
88
86
|
return;
|
|
89
87
|
|
|
90
|
-
if (
|
|
91
|
-
this.query.excludeTags &&
|
|
92
|
-
this.query.excludeTags?.some(value => payload.tags?.includes(value))
|
|
93
|
-
)
|
|
94
|
-
return;
|
|
95
88
|
if (!!this.query.hasFlags !== !!payload.flagCount) return;
|
|
96
89
|
|
|
97
90
|
if (this.query.parentId && this.query.parentId !== payload.parentId) return;
|
|
@@ -109,9 +102,6 @@ export class MessageQueryStreamController extends QueryStreamController<
|
|
|
109
102
|
)
|
|
110
103
|
return;
|
|
111
104
|
|
|
112
|
-
if (this.query.tags && !this.query.tags?.some(value => payload.tags?.includes(value)))
|
|
113
|
-
return;
|
|
114
|
-
|
|
115
105
|
if (
|
|
116
106
|
(!this.query.sortBy || this.query.sortBy === 'segmentDesc') &&
|
|
117
107
|
!this.paginationController.getPrevToken()
|
|
@@ -1,62 +1,8 @@
|
|
|
1
|
-
/* eslint-disable no-use-before-define */
|
|
2
1
|
import { getActiveClient } from '~/client/api';
|
|
3
2
|
import { dropFromCache } from '~/cache/api';
|
|
4
|
-
import { filterByPropEquality } from '~/core/query';
|
|
5
|
-
|
|
6
3
|
import { ENABLE_CACHE_MESSAGE } from '~/utils/constants';
|
|
7
4
|
import { MessageLiveCollectionController } from './MessageLiveCollectionController';
|
|
8
5
|
|
|
9
|
-
/*
|
|
10
|
-
* Exported for testing
|
|
11
|
-
* @hidden
|
|
12
|
-
*/
|
|
13
|
-
export const applyFilter = <T extends Amity.Message>(
|
|
14
|
-
data: T[],
|
|
15
|
-
params: Amity.MessagesLiveCollection,
|
|
16
|
-
): T[] => {
|
|
17
|
-
let messages = data;
|
|
18
|
-
|
|
19
|
-
messages = messages.filter(m => {
|
|
20
|
-
if (params.tags) {
|
|
21
|
-
return params.tags.find(value => {
|
|
22
|
-
if (!m.tags) return false;
|
|
23
|
-
return m.tags.includes(value);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return true;
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
messages = messages.filter(m => {
|
|
30
|
-
if (params.excludeTags) {
|
|
31
|
-
return (params.excludeTags || []).find(value => {
|
|
32
|
-
if (!m.tags) return true;
|
|
33
|
-
return !m.tags.includes(value);
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
/*
|
|
40
|
-
* for cases when message is deleted via RTE, this flag is used to get
|
|
41
|
-
* items from cache that are !deleted
|
|
42
|
-
*/
|
|
43
|
-
if (!params.includeDeleted) {
|
|
44
|
-
messages = filterByPropEquality(messages, 'isDeleted', false);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
messages = messages.sort((message1, message2) => {
|
|
48
|
-
if (params.sortBy === 'segmentAsc') {
|
|
49
|
-
return message1.channelSegment - message2.channelSegment;
|
|
50
|
-
}
|
|
51
|
-
if (params.sortBy === 'segmentDesc') {
|
|
52
|
-
return message2.channelSegment - message1.channelSegment;
|
|
53
|
-
}
|
|
54
|
-
return 0;
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
return messages;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
6
|
/* begin_public_function
|
|
61
7
|
id: message.query
|
|
62
8
|
*/
|
|
@@ -149,8 +149,7 @@ export const prepareMessagePayload = async (
|
|
|
149
149
|
{};
|
|
150
150
|
|
|
151
151
|
// exclude getter properties from existing subChannel cache, update only other properties to existing subChannel cache
|
|
152
|
-
const { unreadCount,
|
|
153
|
-
convertSubChannelFromRaw(messageFeed);
|
|
152
|
+
const { unreadCount, isMentioned, ...restSubChannel } = convertSubChannelFromRaw(messageFeed);
|
|
154
153
|
|
|
155
154
|
updateSubChannelCache(messageFeed.messageFeedId, subChannelCache, restSubChannel);
|
|
156
155
|
});
|
|
@@ -215,7 +214,6 @@ export function convertParams({
|
|
|
215
214
|
export function convertQueryParams({
|
|
216
215
|
sortBy,
|
|
217
216
|
subChannelId,
|
|
218
|
-
tags,
|
|
219
217
|
includingTags,
|
|
220
218
|
excludingTags,
|
|
221
219
|
includeDeleted,
|
|
@@ -235,10 +233,6 @@ export function convertQueryParams({
|
|
|
235
233
|
},
|
|
236
234
|
};
|
|
237
235
|
|
|
238
|
-
if (tags) {
|
|
239
|
-
out.includeTags = tags;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
236
|
if (includingTags) {
|
|
243
237
|
out.includeTags = includingTags;
|
|
244
238
|
}
|
|
@@ -21,31 +21,19 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
21
21
|
export const queryRoles = async (query?: {
|
|
22
22
|
displayName?: Amity.Role['displayName'];
|
|
23
23
|
sortBy?: 'displayName' | 'firstCreated' | 'lastCreated';
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated please use `queryToken` to query next pages or previous pages
|
|
26
|
-
* The first page result includes previous token and next token in paging field
|
|
27
|
-
* use this token as the `queryToken` to query next pages or previous pages
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
page?: Amity.Page;
|
|
31
24
|
limit?: number;
|
|
32
25
|
queryToken?: string;
|
|
33
26
|
}): Promise<Amity.Cached<Amity.Paged<Amity.Role>> & Amity.Pagination> => {
|
|
34
27
|
const client = getActiveClient();
|
|
35
28
|
client.log('role/queryRoles', query);
|
|
36
29
|
|
|
37
|
-
const {
|
|
30
|
+
const { limit = 10, queryToken, displayName, sortBy, ...params } = query ?? {};
|
|
38
31
|
|
|
39
32
|
const options = (() => {
|
|
40
33
|
if (queryToken) return { token: queryToken };
|
|
41
34
|
|
|
42
35
|
if (limit) return { limit };
|
|
43
36
|
|
|
44
|
-
if (page)
|
|
45
|
-
return {
|
|
46
|
-
token: toToken(page, 'skiplimit'),
|
|
47
|
-
};
|
|
48
|
-
|
|
49
37
|
return undefined;
|
|
50
38
|
})();
|
|
51
39
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { enableCache } from '~/cache/api';
|
|
2
2
|
import { client, connectClient, disconnectClient, streamResponse } from '~/utils/tests';
|
|
3
|
-
import { getStream } from '~/streamRepository/
|
|
3
|
+
import { getStream } from '~/streamRepository/internalApi/getStream';
|
|
4
4
|
|
|
5
5
|
const STREAM_ID = streamResponse.data.videoStreamings[0].streamId;
|
|
6
6
|
|
|
@@ -28,10 +28,5 @@ export const onStreamFlagged = (
|
|
|
28
28
|
callback(payload.videoStreamings[0]);
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
return createEventSubscriber(
|
|
32
|
-
client,
|
|
33
|
-
'stream/onStreamFlagged',
|
|
34
|
-
'v3.video-streaming.didFlag',
|
|
35
|
-
filter,
|
|
36
|
-
);
|
|
31
|
+
return createEventSubscriber(client, 'stream/onStreamFlagged', 'video-streaming.didFlag', filter);
|
|
37
32
|
};
|
|
@@ -6,7 +6,7 @@ import { pullFromCache } from '~/cache/api';
|
|
|
6
6
|
import { onStreamFlagged } from '~/streamRepository/events/onStreamFlagged';
|
|
7
7
|
import { onStreamTerminated } from '~/streamRepository/events/onStreamTerminated';
|
|
8
8
|
import { LinkedObject } from '~/utils/linkedObject';
|
|
9
|
-
import { getStream as _getStream } from '../
|
|
9
|
+
import { getStream as _getStream } from '../internalApi/getStream';
|
|
10
10
|
import { onStreamRecorded, onStreamStarted, onStreamStopped } from '../events';
|
|
11
11
|
|
|
12
12
|
/* begin_public_function
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { onSessionStateChange } from '~/client/events/onSessionStateChange';
|
|
2
|
-
import { getMarkedMessageTopic, subscribeTopic } from '~/core/subscription';
|
|
3
2
|
import { setIntervalTask } from '~/utils/timer';
|
|
4
|
-
|
|
5
|
-
import { onOnline } from '~/client/utils/onOnline';
|
|
6
|
-
import { getSubChannel } from '../api/getSubChannel';
|
|
7
3
|
import { readingAPI } from '../api/readingAPI';
|
|
8
|
-
import { startReadingAPI } from '../api/startReadingAPI';
|
|
9
|
-
import { stopReadingAPI } from '../api/stopReadingAPI';
|
|
10
4
|
|
|
11
5
|
const START_READING_INTERVAL_TIME = 30000;
|
|
12
6
|
|
|
13
7
|
let isSyncRunning = false;
|
|
14
|
-
let disposers: (() => void)[] = [];
|
|
15
8
|
|
|
16
9
|
/**
|
|
17
10
|
* map contains subChannelId and isReading flag to determine which subChannel is on reading state
|
|
@@ -66,105 +59,6 @@ export const markReadEngineOnLoginHandler = () => {
|
|
|
66
59
|
};
|
|
67
60
|
};
|
|
68
61
|
|
|
69
|
-
const getParentChannelId = async (
|
|
70
|
-
subChannelId: Amity.SubChannel['subChannelId'],
|
|
71
|
-
): Promise<Amity.SubChannel['channelId']> => {
|
|
72
|
-
const cached = getSubChannel.locally(subChannelId);
|
|
73
|
-
|
|
74
|
-
if (cached) {
|
|
75
|
-
return cached.data.channelId;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const { data } = await getSubChannel(subChannelId);
|
|
79
|
-
return data.channelId;
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
const registerEventListeners = () => {
|
|
83
|
-
if (disposers.length > 0) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
disposers.push(
|
|
88
|
-
onOnline(() => {
|
|
89
|
-
// Start reading the reading subChannel again when resume from offline state
|
|
90
|
-
startReadingFromReadingList();
|
|
91
|
-
}),
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const registerTopicSubscribers = async (subChannelId: Amity.SubChannel['subChannelId']) => {
|
|
96
|
-
const channelId = await getParentChannelId(subChannelId);
|
|
97
|
-
const markedMessageTopic = getMarkedMessageTopic({ channelId, subChannelId });
|
|
98
|
-
disposers.push(subscribeTopic(markedMessageTopic));
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
const disposeAll = () => {
|
|
102
|
-
disposers.forEach(fn => fn());
|
|
103
|
-
disposers = [];
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
/* begin_public_function
|
|
107
|
-
id: subchannel.start_reading
|
|
108
|
-
*/
|
|
109
|
-
/**
|
|
110
|
-
* @deprecated Use {@link startMessageReceiptSync} instead.
|
|
111
|
-
* ```js
|
|
112
|
-
* import { startReading } from '@amityco/ts-sdk'
|
|
113
|
-
* const success = await startReading('foo')
|
|
114
|
-
* ```
|
|
115
|
-
*
|
|
116
|
-
* Set local reading state of channel to `true` and then call mark all
|
|
117
|
-
* messages as read API.
|
|
118
|
-
*
|
|
119
|
-
* @param subChannelId - The sub channel ID to start reading.
|
|
120
|
-
* @return A success boolean if reading of the sub channel had begun.
|
|
121
|
-
*
|
|
122
|
-
* @category Channel API
|
|
123
|
-
* @async
|
|
124
|
-
*/
|
|
125
|
-
export const startReading = async (subChannelId: Amity.SubChannel['subChannelId']) => {
|
|
126
|
-
isReadingMap[subChannelId] = true;
|
|
127
|
-
|
|
128
|
-
if (disposers.length === 0) {
|
|
129
|
-
registerEventListeners();
|
|
130
|
-
registerTopicSubscribers(subChannelId);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
try {
|
|
134
|
-
return await startReadingAPI(subChannelId);
|
|
135
|
-
} catch (e) {
|
|
136
|
-
isReadingMap[subChannelId] = false;
|
|
137
|
-
return false;
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
/* end_public_function */
|
|
141
|
-
|
|
142
|
-
/* begin_public_function
|
|
143
|
-
id: subchannel.stop_reading
|
|
144
|
-
*/
|
|
145
|
-
/**
|
|
146
|
-
* @deprecated Use {@link stopMessageReceiptSync} instead.
|
|
147
|
-
* ```js
|
|
148
|
-
* import { stopReading } from '@amityco/ts-sdk'
|
|
149
|
-
* const success = await stopReading('foo')
|
|
150
|
-
* ```
|
|
151
|
-
*
|
|
152
|
-
* Set local reading state of channel to `false` and then call mark all
|
|
153
|
-
* messages as unread API.
|
|
154
|
-
*
|
|
155
|
-
* @param subChannelId - The sub channel ID to stop reading.
|
|
156
|
-
* @return A success boolean if reading of the sub channel had begun.
|
|
157
|
-
*
|
|
158
|
-
* @category Channel API
|
|
159
|
-
* @async
|
|
160
|
-
*/
|
|
161
|
-
export const stopReading = (subChannelId: Amity.SubChannel['subChannelId']) => {
|
|
162
|
-
isReadingMap[subChannelId] = false;
|
|
163
|
-
disposeAll();
|
|
164
|
-
return stopReadingAPI(subChannelId);
|
|
165
|
-
};
|
|
166
|
-
/* end_public_function */
|
|
167
|
-
|
|
168
62
|
setIntervalTask(async () => {
|
|
169
63
|
if (!isSyncRunning) return;
|
|
170
64
|
|
|
@@ -27,19 +27,11 @@ export const queryUsers = async (
|
|
|
27
27
|
const client = getActiveClient();
|
|
28
28
|
client.log('user/queryUsers', query);
|
|
29
29
|
|
|
30
|
-
const {
|
|
31
|
-
page,
|
|
32
|
-
limit = 10,
|
|
33
|
-
displayName,
|
|
34
|
-
filter = 'all',
|
|
35
|
-
sortBy = 'displayName',
|
|
36
|
-
...params
|
|
37
|
-
} = query;
|
|
30
|
+
const { page, limit = 10, filter = 'all', sortBy = 'displayName', ...params } = query;
|
|
38
31
|
|
|
39
32
|
const { data } = await client.http.get<Amity.UserPayload & Amity.Pagination>(`/api/v3/users`, {
|
|
40
33
|
params: {
|
|
41
34
|
...params,
|
|
42
|
-
keyword: displayName,
|
|
43
35
|
filter,
|
|
44
36
|
sortBy,
|
|
45
37
|
options: page ? { token: page } : { limit },
|
|
@@ -103,22 +103,18 @@ export class UserLiveCollectionController extends LiveCollectionController<
|
|
|
103
103
|
applyFilter(data: Amity.InternalUser[]) {
|
|
104
104
|
let users = data;
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
})();
|
|
119
|
-
|
|
120
|
-
users = users.sort(sortFn);
|
|
121
|
-
}
|
|
106
|
+
const sortFn = (() => {
|
|
107
|
+
switch (this.query.sortBy) {
|
|
108
|
+
case 'firstCreated':
|
|
109
|
+
return sortByFirstCreated;
|
|
110
|
+
case 'lastCreated':
|
|
111
|
+
return sortByLastCreated;
|
|
112
|
+
default:
|
|
113
|
+
return sortByLastCreated;
|
|
114
|
+
}
|
|
115
|
+
})();
|
|
116
|
+
|
|
117
|
+
users = users.sort(sortFn);
|
|
122
118
|
|
|
123
119
|
if (this.query.filter === 'flagged') {
|
|
124
120
|
users = users.filter(user => !!user.hashFlag);
|
|
@@ -6,7 +6,7 @@ export class UserPaginationController extends PaginationController<
|
|
|
6
6
|
Amity.UserLiveCollection
|
|
7
7
|
> {
|
|
8
8
|
async getRequest(queryParams: Amity.UserLiveCollection, token: string | undefined) {
|
|
9
|
-
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT,
|
|
9
|
+
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, ...params } = queryParams;
|
|
10
10
|
const options = token ? { token } : { limit };
|
|
11
11
|
|
|
12
12
|
const { data: queryResponse } = await this.http.get<Amity.UserPayload & Amity.Pagination>(
|
|
@@ -14,7 +14,6 @@ export class UserPaginationController extends PaginationController<
|
|
|
14
14
|
{
|
|
15
15
|
params: {
|
|
16
16
|
...params,
|
|
17
|
-
keyword: displayName,
|
|
18
17
|
options,
|
|
19
18
|
isDeleted: false,
|
|
20
19
|
},
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { getUser } from './getUser';
|
|
2
2
|
export { getUsers } from './getUsers';
|
|
3
|
-
export { observeUser } from './observeUser';
|
|
4
3
|
export { getBlockedUsers } from './getBlockedUsers';
|
|
5
4
|
export { searchUserByDisplayName } from './searchUserByDisplayName';
|
|
6
|
-
export { getViewedUsers } from './getViewedUsers';
|
|
7
5
|
export { getReachedUsers } from './getReachedUsers';
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
// makes it easier to spy on applyFilter
|
|
15
15
|
import * as getUsersModule from '../getUsers';
|
|
16
16
|
|
|
17
|
-
const { getUsers
|
|
17
|
+
const { getUsers } = getUsersModule;
|
|
18
18
|
|
|
19
19
|
const getSnapshot = (params?: Record<string, any>) => {
|
|
20
20
|
return {
|
|
@@ -174,47 +174,5 @@ describe('getUsers', () => {
|
|
|
174
174
|
),
|
|
175
175
|
);
|
|
176
176
|
});
|
|
177
|
-
|
|
178
|
-
test('it should apply filters on RTE only', async () => {
|
|
179
|
-
const callback = jest.fn();
|
|
180
|
-
const applyFilterSpy = jest.spyOn(getUsersModule, 'applyFilter');
|
|
181
|
-
client.http.get = jest.fn().mockResolvedValue(userQueryResponse);
|
|
182
|
-
|
|
183
|
-
getUsers(params, callback);
|
|
184
|
-
await pause();
|
|
185
|
-
|
|
186
|
-
expect(applyFilterSpy).not.toHaveBeenCalled();
|
|
187
|
-
|
|
188
|
-
client.emitter.emit('user.updated', { users: [updatedUser], files: [] });
|
|
189
|
-
await pause();
|
|
190
|
-
|
|
191
|
-
expect(applyFilterSpy).toHaveBeenCalled();
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
describe('getUsers > applyFilter', () => {
|
|
197
|
-
const u1 = {
|
|
198
|
-
userId: 'test',
|
|
199
|
-
displayName: 'a',
|
|
200
|
-
createdAt: new Date().toISOString(),
|
|
201
|
-
} as Amity.InternalUser;
|
|
202
|
-
|
|
203
|
-
const u2 = {
|
|
204
|
-
userId: 'searchable',
|
|
205
|
-
displayName: 'b',
|
|
206
|
-
createdAt: getPastDate(),
|
|
207
|
-
} as Amity.InternalUser;
|
|
208
|
-
|
|
209
|
-
const filters: [string, Amity.UserLiveCollection, Amity.InternalUser[], Amity.InternalUser[]][] =
|
|
210
|
-
[
|
|
211
|
-
['it should filter by display name', { displayName: 'a' }, [u1, u2], [u1]],
|
|
212
|
-
['it should sort by dispaly name', {}, [u1, u2], [u1, u2]],
|
|
213
|
-
['it should sort by last created', { sortBy: 'lastCreated' }, [u1, u2], [u1, u2]],
|
|
214
|
-
['it should sort by first created', { sortBy: 'firstCreated' }, [u1, u2], [u2, u1]],
|
|
215
|
-
];
|
|
216
|
-
|
|
217
|
-
test.each(filters)('%s', (test, param, input, expected) => {
|
|
218
|
-
expect(applyFilter(input, param)).toStrictEqual(expected);
|
|
219
177
|
});
|
|
220
178
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { markAsRead } from '~/channelRepository/
|
|
1
|
+
import { markAsRead } from '~/channelRepository/internalApi/markAsRead';
|
|
2
2
|
import { shallowClone } from '../shallowClone';
|
|
3
3
|
|
|
4
4
|
export const channelLinkedObject = (channel: Amity.InternalChannel): Amity.Channel => {
|
package/src/utils/liveObject.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { convertGetterPropsToStatic } from '~/utils/object';
|
|
|
11
11
|
import { isEqual } from './isEqual';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* @deprecated This function
|
|
14
|
+
* @deprecated This function will to be deprecated soon.
|
|
15
15
|
*/
|
|
16
16
|
export const liveObject = <
|
|
17
17
|
T extends Amity.Model,
|
|
@@ -27,7 +27,7 @@ export const liveObject = <
|
|
|
27
27
|
): Amity.Unsubscriber => {
|
|
28
28
|
const { forceDispatch, callbackDataSelector, callbackFilter } = {
|
|
29
29
|
forceDispatch: false,
|
|
30
|
-
callbackDataSelector: (data: T) =>
|
|
30
|
+
callbackDataSelector: (data: T) => data as unknown as CallbackData,
|
|
31
31
|
...options,
|
|
32
32
|
};
|
|
33
33
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getChannel.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/api/getChannel.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU;gBACV,MAAM,OAAO,CAAC,iBAAiB,CAAC,GAC1C,QAAQ,MAAM,MAAM,CAAC,MAAM,eAAe,CAAC,CAAC;IAsC/C;;;;;;;;;;;;OAYG;uBAEU,MAAM,OAAO,CAAC,iBAAiB,CAAC,GAC1C,MAAM,MAAM,CAAC,MAAM,eAAe,CAAC,GAAG,SAAS;CAjBjD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"markAsRead.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/api/markAsRead.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU,cACV,MAAM,OAAO,CAAC,mBAAmB,CAAC,KAC5C,QAAQ,OAAO,CAuCjB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { observeChannel } from '@amityco/ts-sdk'
|
|
4
|
-
*
|
|
5
|
-
* let channel = {}
|
|
6
|
-
* const dispose = observeChannel(channelId, ({ data }) => channel = data)
|
|
7
|
-
* ```
|
|
8
|
-
*
|
|
9
|
-
* Observe all mutation on a given {@link Amity.Channel}
|
|
10
|
-
*
|
|
11
|
-
* @param channelId the ID of the channel to observe
|
|
12
|
-
* @param callback the function to call when new data are available
|
|
13
|
-
* @returns An {@link Amity.Unsubscriber} function to run when willing to stop observing the channel
|
|
14
|
-
*
|
|
15
|
-
* @category Channel Observer
|
|
16
|
-
*/
|
|
17
|
-
export declare const observeChannel: <Events extends [Amity.ChannelActionType.OnResolveChannel | Amity.ChannelActionType.OnResolveUnread | Amity.ChannelActionType.OnFetch | Amity.ChannelActionType.OnUpdate | Amity.ChannelActionType.OnDelete | Amity.ChannelActionType.OnJoin | Amity.ChannelActionType.OnLeft | Amity.ChannelActionType.OnMute | Amity.ChannelActionType.OnMemberAdded | Amity.ChannelActionType.OnMemberRemoved | Amity.ChannelActionType.OnUserMessageFeedMarkerFetch]>(channelId: string, callback: Amity.ObjectListener<Amity.Snapshot<Amity.Channel<any>>, Events>) => Amity.Unsubscriber;
|
|
18
|
-
//# sourceMappingURL=observeChannel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"observeChannel.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/observers/observeChannel.ts"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,ucACd,MAAM,iFAEhB,MAAM,YAqER,CAAC"}
|