@amityco/ts-sdk 7.27.0 → 7.27.1-01fa6bf5.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 +5 -0
- package/dist/@types/core/events.d.ts.map +1 -1
- package/dist/@types/core/payload.d.ts +26 -0
- package/dist/@types/core/payload.d.ts.map +1 -1
- package/dist/@types/core/permissions.d.ts +10 -4
- package/dist/@types/core/permissions.d.ts.map +1 -1
- package/dist/@types/domains/analytics.d.ts +3 -1
- package/dist/@types/domains/analytics.d.ts.map +1 -1
- package/dist/@types/domains/channel.d.ts +5 -0
- package/dist/@types/domains/channel.d.ts.map +1 -1
- package/dist/@types/domains/client.d.ts +18 -0
- package/dist/@types/domains/client.d.ts.map +1 -1
- package/dist/@types/domains/comment.d.ts +27 -0
- package/dist/@types/domains/comment.d.ts.map +1 -1
- package/dist/@types/domains/community.d.ts +1 -0
- package/dist/@types/domains/community.d.ts.map +1 -1
- package/dist/@types/domains/curatedContent.d.ts +25 -0
- package/dist/@types/domains/curatedContent.d.ts.map +1 -0
- package/dist/@types/domains/pinnedMessage.d.ts +43 -0
- package/dist/@types/domains/pinnedMessage.d.ts.map +1 -0
- package/dist/@types/domains/post.d.ts +11 -0
- package/dist/@types/domains/post.d.ts.map +1 -1
- package/dist/@types/index.d.ts +3 -1
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/adRepository/events/index.d.ts +2 -0
- package/dist/adRepository/events/index.d.ts.map +1 -0
- package/dist/adRepository/index.d.ts +2 -0
- package/dist/adRepository/index.d.ts.map +1 -1
- package/dist/adRepository/observers/index.d.ts +2 -0
- package/dist/adRepository/observers/index.d.ts.map +1 -0
- package/dist/analytic/service/analytic/AnalyticsEngine.d.ts +3 -0
- package/dist/analytic/service/analytic/AnalyticsEngine.d.ts.map +1 -1
- package/dist/analytic/service/analytic/AnalyticsEventCapturer.d.ts +3 -0
- package/dist/analytic/service/analytic/AnalyticsEventCapturer.d.ts.map +1 -1
- package/dist/categoryRepository/events/index.d.ts +2 -0
- package/dist/categoryRepository/events/index.d.ts.map +1 -0
- package/dist/categoryRepository/index.d.ts +1 -0
- package/dist/categoryRepository/index.d.ts.map +1 -1
- package/dist/channelRepository/api/createChannel.d.ts.map +1 -1
- package/dist/channelRepository/events/index.d.ts +2 -0
- package/dist/channelRepository/events/index.d.ts.map +1 -1
- package/dist/channelRepository/events/onChannelMemberRoleAdded.d.ts +22 -0
- package/dist/channelRepository/events/onChannelMemberRoleAdded.d.ts.map +1 -1
- package/dist/channelRepository/events/onChannelMemberRoleRemoved.d.ts +22 -0
- package/dist/channelRepository/events/onChannelMemberRoleRemoved.d.ts.map +1 -1
- package/dist/channelRepository/events/onChannelMessagePinned.d.ts +24 -0
- package/dist/channelRepository/events/onChannelMessagePinned.d.ts.map +1 -0
- package/dist/channelRepository/events/onChannelMessageUnpinned.d.ts +21 -0
- package/dist/channelRepository/events/onChannelMessageUnpinned.d.ts.map +1 -0
- package/dist/channelRepository/events/onChannelPinnedMessageDeleted.d.ts +12 -0
- package/dist/channelRepository/events/onChannelPinnedMessageDeleted.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/getChannels/getChannels.d.ts.map +1 -1
- package/dist/channelRepository/observers/getMyMembership.d.ts.map +1 -1
- package/dist/channelRepository/observers/searchChannels/SearchChannelLiveCollectionController.d.ts.map +1 -1
- package/dist/channelRepository/utils/applyChannelRolePayload.d.ts +21 -0
- package/dist/channelRepository/utils/applyChannelRolePayload.d.ts.map +1 -0
- package/dist/channelRepository/utils/index.d.ts +2 -0
- package/dist/channelRepository/utils/index.d.ts.map +1 -1
- package/dist/channelRepository/utils/updatePinnedMessageCache.d.ts +24 -0
- package/dist/channelRepository/utils/updatePinnedMessageCache.d.ts.map +1 -0
- package/dist/client/api/createClient.d.ts +5 -1
- package/dist/client/api/createClient.d.ts.map +1 -1
- package/dist/client/api/getShareableLinkConfiguration.d.ts.map +1 -1
- package/dist/client/api/getSocialSettings.d.ts.map +1 -1
- package/dist/client/api/setupLoginSubscriptions.d.ts.map +1 -1
- package/dist/client/events/onVisitorUsageLimitReached.d.ts.map +1 -1
- package/dist/client/observers/getUserUnread.d.ts.map +1 -1
- package/dist/commentRepository/api/approveComment.d.ts +17 -0
- package/dist/commentRepository/api/approveComment.d.ts.map +1 -0
- package/dist/commentRepository/api/createComment.d.ts +12 -1
- package/dist/commentRepository/api/createComment.d.ts.map +1 -1
- package/dist/commentRepository/api/declineComment.d.ts +18 -0
- package/dist/commentRepository/api/declineComment.d.ts.map +1 -0
- package/dist/commentRepository/api/deleteComment.d.ts.map +1 -1
- package/dist/commentRepository/api/index.d.ts +2 -0
- package/dist/commentRepository/api/index.d.ts.map +1 -1
- package/dist/commentRepository/api/updateComment.d.ts.map +1 -1
- package/dist/commentRepository/events/index.d.ts +1 -0
- package/dist/commentRepository/events/index.d.ts.map +1 -1
- package/dist/commentRepository/events/onCommentApproved.d.ts +17 -0
- package/dist/commentRepository/events/onCommentApproved.d.ts.map +1 -0
- package/dist/commentRepository/events/utils.d.ts.map +1 -1
- package/dist/commentRepository/internalApi/getComment.d.ts.map +1 -1
- package/dist/commentRepository/observers/getComment.d.ts.map +1 -1
- package/dist/commentRepository/observers/getCommentReviewQueue/LiveCollectionController.d.ts +13 -0
- package/dist/commentRepository/observers/getCommentReviewQueue/LiveCollectionController.d.ts.map +1 -0
- package/dist/commentRepository/observers/getCommentReviewQueue/PaginationController.d.ts +5 -0
- package/dist/commentRepository/observers/getCommentReviewQueue/PaginationController.d.ts.map +1 -0
- package/dist/commentRepository/observers/getCommentReviewQueue/QueryStreamController.d.ts +15 -0
- package/dist/commentRepository/observers/getCommentReviewQueue/QueryStreamController.d.ts.map +1 -0
- package/dist/commentRepository/observers/getCommentReviewQueue.d.ts +22 -0
- package/dist/commentRepository/observers/getCommentReviewQueue.d.ts.map +1 -0
- package/dist/commentRepository/observers/getComments/CommentLiveCollectionController.d.ts +1 -1
- package/dist/commentRepository/observers/getComments/CommentLiveCollectionController.d.ts.map +1 -1
- package/dist/commentRepository/observers/getComments/CommentQueryStreamController.d.ts.map +1 -1
- package/dist/commentRepository/observers/getComments/enums.d.ts +1 -0
- package/dist/commentRepository/observers/getComments/enums.d.ts.map +1 -1
- package/dist/commentRepository/observers/getComments.d.ts.map +1 -1
- package/dist/commentRepository/observers/index.d.ts +1 -0
- package/dist/commentRepository/observers/index.d.ts.map +1 -1
- package/dist/commentRepository/utils/approval.d.ts +49 -0
- package/dist/commentRepository/utils/approval.d.ts.map +1 -0
- package/dist/commentRepository/utils/payload.d.ts +6 -0
- package/dist/commentRepository/utils/payload.d.ts.map +1 -1
- package/dist/communityRepository/api/createCommunity.d.ts +1 -1
- package/dist/communityRepository/api/createCommunity.d.ts.map +1 -1
- package/dist/communityRepository/api/updateCommunity.d.ts +1 -1
- package/dist/communityRepository/api/updateCommunity.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/getMembers.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/searchMembers.d.ts.map +1 -1
- package/dist/communityRepository/observers/getJoinRequestList.d.ts +1 -1
- package/dist/communityRepository/observers/getJoinRequestList.d.ts.map +1 -1
- package/dist/communityRepository/observers/getJoinRequests.d.ts +1 -1
- package/dist/communityRepository/observers/getJoinRequests.d.ts.map +1 -1
- package/dist/communityRepository/observers/semanticSearchCommunities.d.ts +1 -1
- package/dist/communityRepository/observers/semanticSearchCommunities.d.ts.map +1 -1
- package/dist/core/device.d.ts +1 -1
- package/dist/core/device.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/transports/http.d.ts.map +1 -1
- package/dist/core/transports/utils.d.ts +8 -0
- package/dist/core/transports/utils.d.ts.map +1 -1
- package/dist/curatedContentRepository/api/getPool.d.ts +2 -0
- package/dist/curatedContentRepository/api/getPool.d.ts.map +1 -0
- package/dist/curatedContentRepository/api/index.d.ts +2 -0
- package/dist/curatedContentRepository/api/index.d.ts.map +1 -0
- package/dist/curatedContentRepository/events/index.d.ts +2 -0
- package/dist/curatedContentRepository/events/index.d.ts.map +1 -0
- package/dist/curatedContentRepository/index.d.ts +4 -0
- package/dist/curatedContentRepository/index.d.ts.map +1 -0
- package/dist/curatedContentRepository/observers/index.d.ts +2 -0
- package/dist/curatedContentRepository/observers/index.d.ts.map +1 -0
- package/dist/eventRepository/observers/getEvents.d.ts +1 -1
- package/dist/eventRepository/observers/getEvents.d.ts.map +1 -1
- package/dist/eventRepository/observers/getMyEvents.d.ts +1 -1
- package/dist/eventRepository/observers/getMyEvents.d.ts.map +1 -1
- package/dist/eventRepository/observers/getRSVPs.d.ts +1 -1
- package/dist/eventRepository/observers/getRSVPs.d.ts.map +1 -1
- package/dist/feedRepository/events/index.d.ts +2 -0
- package/dist/feedRepository/events/index.d.ts.map +1 -0
- package/dist/feedRepository/index.d.ts +1 -0
- package/dist/feedRepository/index.d.ts.map +1 -1
- package/dist/feedRepository/observers/utils.d.ts +1 -0
- package/dist/feedRepository/observers/utils.d.ts.map +1 -1
- package/dist/fileRepository/events/index.d.ts +2 -0
- package/dist/fileRepository/events/index.d.ts.map +1 -0
- package/dist/fileRepository/index.d.ts +2 -0
- package/dist/fileRepository/index.d.ts.map +1 -1
- package/dist/fileRepository/observers/index.d.ts +2 -0
- package/dist/fileRepository/observers/index.d.ts.map +1 -0
- package/dist/index.cjs.js +1923 -582
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1898 -558
- package/dist/index.umd.js +2 -2
- package/dist/invitationRepository/observers/getInvitations.d.ts.map +1 -1
- package/dist/invitationRepository/observers/getMyCommunityInvitations.d.ts +1 -1
- package/dist/invitationRepository/observers/getMyCommunityInvitations.d.ts.map +1 -1
- package/dist/liveReactionRepository/observers/getReactions.d.ts.map +1 -1
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts +1 -0
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts.map +1 -1
- package/dist/messageRepository/api/index.d.ts +2 -0
- package/dist/messageRepository/api/index.d.ts.map +1 -1
- package/dist/messageRepository/api/pinMessage.d.ts +29 -0
- package/dist/messageRepository/api/pinMessage.d.ts.map +1 -0
- package/dist/messageRepository/api/unpinMessage.d.ts +28 -0
- package/dist/messageRepository/api/unpinMessage.d.ts.map +1 -0
- package/dist/messageRepository/observers/getMessages/getMessages.d.ts.map +1 -1
- package/dist/messageRepository/utils/refreshChannelPermissionsForMessage.d.ts +13 -0
- package/dist/messageRepository/utils/refreshChannelPermissionsForMessage.d.ts.map +1 -0
- package/dist/notificationTray/observers/getNotificationTrayItems.d.ts +1 -1
- package/dist/notificationTray/observers/getNotificationTrayItems.d.ts.map +1 -1
- package/dist/postRepository/observers/getGlobalPinnedPosts.d.ts +1 -1
- package/dist/postRepository/observers/getGlobalPinnedPosts.d.ts.map +1 -1
- package/dist/postRepository/observers/getPinnedPosts.d.ts +1 -1
- package/dist/postRepository/observers/getPinnedPosts.d.ts.map +1 -1
- package/dist/postRepository/observers/getPosts.d.ts.map +1 -1
- package/dist/postRepository/observers/searchPostsByHashtag.d.ts.map +1 -1
- package/dist/postRepository/observers/semanticSearchPosts.d.ts +1 -1
- package/dist/postRepository/observers/semanticSearchPosts.d.ts.map +1 -1
- package/dist/postRepository/observers/utils.d.ts +1 -0
- package/dist/postRepository/observers/utils.d.ts.map +1 -1
- package/dist/postRepository/utils/PostCommentCountEngine/ApproveTask.d.ts +16 -0
- package/dist/postRepository/utils/PostCommentCountEngine/ApproveTask.d.ts.map +1 -0
- package/dist/postRepository/utils/PostCommentCountEngine/PostCommentCountEngine.d.ts +25 -1
- package/dist/postRepository/utils/PostCommentCountEngine/PostCommentCountEngine.d.ts.map +1 -1
- package/dist/postRepository/utils/PostCommentCountEngine/postCommentCountEngineOnLoginHandler.d.ts +9 -0
- package/dist/postRepository/utils/PostCommentCountEngine/postCommentCountEngineOnLoginHandler.d.ts.map +1 -0
- package/dist/postRepository/utils/latestComments.d.ts +10 -0
- package/dist/postRepository/utils/latestComments.d.ts.map +1 -0
- package/dist/postRepository/utils/payload.d.ts.map +1 -1
- package/dist/productRepository/api/index.d.ts +2 -0
- package/dist/productRepository/api/index.d.ts.map +1 -0
- package/dist/productRepository/events/index.d.ts +2 -0
- package/dist/productRepository/events/index.d.ts.map +1 -0
- package/dist/productRepository/index.d.ts +2 -0
- package/dist/productRepository/index.d.ts.map +1 -1
- package/dist/productRepository/observers/getProduct.d.ts.map +1 -1
- package/dist/productRepository/observers/searchProducts.d.ts.map +1 -1
- package/dist/reactionRepository/observers/getReactions/getReactions.d.ts.map +1 -1
- package/dist/roomPresenceRepository/events/index.d.ts +2 -0
- package/dist/roomPresenceRepository/events/index.d.ts.map +1 -0
- package/dist/roomPresenceRepository/index.d.ts +2 -0
- package/dist/roomPresenceRepository/index.d.ts.map +1 -1
- package/dist/roomPresenceRepository/observers/index.d.ts +2 -0
- package/dist/roomPresenceRepository/observers/index.d.ts.map +1 -0
- package/dist/roomRepository/api/index.d.ts +0 -1
- package/dist/roomRepository/api/index.d.ts.map +1 -1
- package/dist/roomRepository/observers/getRoom.d.ts.map +1 -1
- package/dist/roomRepository/observers/utils.d.ts +1 -0
- package/dist/roomRepository/observers/utils.d.ts.map +1 -1
- package/dist/storyRepository/events/index.d.ts +8 -0
- package/dist/storyRepository/events/index.d.ts.map +1 -0
- package/dist/storyRepository/index.d.ts +1 -0
- package/dist/storyRepository/index.d.ts.map +1 -1
- package/dist/storyRepository/observers/getActiveStoriesByTarget.d.ts.map +1 -1
- package/dist/storyRepository/observers/getStoryByStoryId.d.ts.map +1 -1
- package/dist/storyRepository/observers/getTargetById.d.ts.map +1 -1
- package/dist/storyRepository/observers/getTargetsByTargetIds.d.ts.map +1 -1
- package/dist/subChannelRepository/observers/getSubChannels/getSubChannels.d.ts.map +1 -1
- package/dist/userRepository/observers/getReachedUsers.d.ts.map +1 -1
- package/dist/utils/constants.d.ts +4 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/linkedObject/commentLinkedObject.d.ts.map +1 -1
- package/dist/utils/linkedObject/curatedContentTopicLinkedObject.d.ts +2 -0
- package/dist/utils/linkedObject/curatedContentTopicLinkedObject.d.ts.map +1 -0
- package/dist/utils/linkedObject/index.d.ts +1 -0
- package/dist/utils/linkedObject/index.d.ts.map +1 -1
- package/dist/utils/linkedObject/messageLinkedObject.d.ts.map +1 -1
- package/dist/utils/linkedObject/postLinkedObject.d.ts.map +1 -1
- package/package.json +8 -3
- package/dist/__mocks__/marker/api/getMessageMarkers.d.ts +0 -3
- package/dist/__mocks__/marker/api/getMessageMarkers.d.ts.map +0 -1
- package/dist/__mocks__/marker/api/getSubChannelMarkers.d.ts +0 -3
- package/dist/__mocks__/marker/api/getSubChannelMarkers.d.ts.map +0 -1
- package/dist/__mocks__/marker/api/index.d.ts +0 -6
- package/dist/__mocks__/marker/api/index.d.ts.map +0 -1
- package/dist/adRepository/api/tests/integration/getNetworkAds.integration.test.d.ts +0 -2
- package/dist/adRepository/api/tests/integration/getNetworkAds.integration.test.d.ts.map +0 -1
- package/dist/cache/api/tests/dropFromCache.test.d.ts +0 -2
- package/dist/cache/api/tests/dropFromCache.test.d.ts.map +0 -1
- package/dist/cache/api/tests/enableCache.test.d.ts +0 -2
- package/dist/cache/api/tests/enableCache.test.d.ts.map +0 -1
- package/dist/cache/api/tests/ingestInCache.test.d.ts +0 -2
- package/dist/cache/api/tests/ingestInCache.test.d.ts.map +0 -1
- package/dist/cache/api/tests/pullFromCache.test.d.ts +0 -2
- package/dist/cache/api/tests/pullFromCache.test.d.ts.map +0 -1
- package/dist/cache/api/tests/pushToCache.test.d.ts +0 -2
- package/dist/cache/api/tests/pushToCache.test.d.ts.map +0 -1
- package/dist/cache/api/tests/upsertInCache.test.d.ts +0 -2
- package/dist/cache/api/tests/upsertInCache.test.d.ts.map +0 -1
- package/dist/cache/utils/tests/encodeKey.test.d.ts +0 -2
- package/dist/cache/utils/tests/encodeKey.test.d.ts.map +0 -1
- package/dist/cache/utils/tests/partialMatch.test.d.ts +0 -2
- package/dist/cache/utils/tests/partialMatch.test.d.ts.map +0 -1
- package/dist/categoryRepository/api/tests/integration/getCategory.integration.test.d.ts +0 -2
- package/dist/categoryRepository/api/tests/integration/getCategory.integration.test.d.ts.map +0 -1
- package/dist/categoryRepository/internalApi/tests/integration/getCategory.integration.test.d.ts +0 -2
- package/dist/categoryRepository/internalApi/tests/integration/getCategory.integration.test.d.ts.map +0 -1
- package/dist/categoryRepository/internalApi/tests/integration/queryCategories.integration.test.d.ts +0 -2
- package/dist/categoryRepository/internalApi/tests/integration/queryCategories.integration.test.d.ts.map +0 -1
- package/dist/categoryRepository/observers/tests/getCategories.test.d.ts +0 -2
- package/dist/categoryRepository/observers/tests/getCategories.test.d.ts.map +0 -1
- package/dist/categoryRepository/observers/tests/integration/getCategories.integration.test.d.ts +0 -2
- package/dist/categoryRepository/observers/tests/integration/getCategories.integration.test.d.ts.map +0 -1
- package/dist/categoryRepository/observers/tests/integration/setup.d.ts +0 -10
- package/dist/categoryRepository/observers/tests/integration/setup.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/createChannel.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/createChannel.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/getChannel.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/getChannel.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/getChannelByIds.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/getChannelByIds.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/integration/createChannel.integration.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/integration/createChannel.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/integration/deleteChannel.integration.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/integration/deleteChannel.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/integration/getChannelByIds.integration.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/integration/getChannelByIds.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/integration/joinChannel.integration.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/integration/joinChannel.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/integration/leaveChannel.integration.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/integration/leaveChannel.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/integration/markChannelsAsReadBySegment.integration.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/integration/markChannelsAsReadBySegment.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/integration/muteChannel.integration.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/integration/muteChannel.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/integration/queryChannels.integration.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/integration/queryChannels.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/integration/unmuteChannel.integration.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/integration/unmuteChannel.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/integration/updateChannel.integration.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/integration/updateChannel.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/joinChannel.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/joinChannel.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/leaveChannel.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/leaveChannel.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/muteChannel.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/muteChannel.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/queryChannels.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/queryChannels.test.d.ts.map +0 -1
- package/dist/channelRepository/api/tests/unmuteChannel.test.d.ts +0 -2
- package/dist/channelRepository/api/tests/unmuteChannel.test.d.ts.map +0 -1
- package/dist/channelRepository/channelMembership/api/tests/addMembers.test.d.ts +0 -2
- package/dist/channelRepository/channelMembership/api/tests/addMembers.test.d.ts.map +0 -1
- package/dist/channelRepository/channelMembership/api/tests/queryChannelMembers.test.d.ts +0 -2
- package/dist/channelRepository/channelMembership/api/tests/queryChannelMembers.test.d.ts.map +0 -1
- package/dist/channelRepository/channelMembership/api/tests/removeMembers.test.d.ts +0 -2
- package/dist/channelRepository/channelMembership/api/tests/removeMembers.test.d.ts.map +0 -1
- package/dist/channelRepository/channelMembership/observers/tests/getMembers.test.d.ts +0 -2
- package/dist/channelRepository/channelMembership/observers/tests/getMembers.test.d.ts.map +0 -1
- package/dist/channelRepository/channelMembership/observers/tests/searchMembers.test.d.ts +0 -2
- package/dist/channelRepository/channelMembership/observers/tests/searchMembers.test.d.ts.map +0 -1
- package/dist/channelRepository/events/tests/onChannelCreated.test.d.ts +0 -2
- package/dist/channelRepository/events/tests/onChannelCreated.test.d.ts.map +0 -1
- package/dist/channelRepository/events/tests/onChannelJoined.test.d.ts +0 -2
- package/dist/channelRepository/events/tests/onChannelJoined.test.d.ts.map +0 -1
- package/dist/channelRepository/events/tests/onChannelMemberAdded.test.d.ts +0 -2
- package/dist/channelRepository/events/tests/onChannelMemberAdded.test.d.ts.map +0 -1
- package/dist/channelRepository/events/tests/onChannelMemberBanned.test.d.ts +0 -2
- package/dist/channelRepository/events/tests/onChannelMemberBanned.test.d.ts.map +0 -1
- package/dist/channelRepository/events/tests/onChannelMemberRemoved.test.d.ts +0 -2
- package/dist/channelRepository/events/tests/onChannelMemberRemoved.test.d.ts.map +0 -1
- package/dist/channelRepository/events/tests/onChannelMemberUnbanned.test.d.ts +0 -2
- package/dist/channelRepository/events/tests/onChannelMemberUnbanned.test.d.ts.map +0 -1
- package/dist/channelRepository/events/tests/onChannelUpdated.test.d.ts +0 -2
- package/dist/channelRepository/events/tests/onChannelUpdated.test.d.ts.map +0 -1
- package/dist/channelRepository/observers/tests/getChannel.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/getChannel.test.d.ts.map +0 -1
- package/dist/channelRepository/observers/tests/getChannelWithMessagePreview.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/getChannelWithMessagePreview.test.d.ts.map +0 -1
- package/dist/channelRepository/observers/tests/getChannels.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/getChannels.test.d.ts.map +0 -1
- package/dist/channelRepository/observers/tests/getChannelsWithMessagePreview.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/getChannelsWithMessagePreview.test.d.ts.map +0 -1
- package/dist/channelRepository/observers/tests/integrations/getChannel.integration.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/integrations/getChannel.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/observers/tests/integrations/getChannels.integration.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/integrations/getChannels.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/observers/tests/integrations/getMyMembership.integration.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/integrations/getMyMembership.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/observers/tests/integrations/getMyMembership.noUser.integration.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/integrations/getMyMembership.noUser.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/observers/tests/integrations/getTotalChannelsUnread.integration.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/integrations/getTotalChannelsUnread.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/observers/tests/integrations/getTotalChannelsUnread.noUser.integration.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/integrations/getTotalChannelsUnread.noUser.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/observers/tests/integrations/searchChannels.integration.test.d.ts +0 -2
- package/dist/channelRepository/observers/tests/integrations/searchChannels.integration.test.d.ts.map +0 -1
- package/dist/channelRepository/utils/tests/prepareChannelPayload.test.d.ts +0 -6
- package/dist/channelRepository/utils/tests/prepareChannelPayload.test.d.ts.map +0 -1
- package/dist/client/api/tests/ShareableLinkConfiguration.test.d.ts +0 -2
- package/dist/client/api/tests/ShareableLinkConfiguration.test.d.ts.map +0 -1
- package/dist/client/api/tests/accessTokenExpiryWatcher.test.d.ts +0 -2
- package/dist/client/api/tests/accessTokenExpiryWatcher.test.d.ts.map +0 -1
- package/dist/client/api/tests/activeClient.test.d.ts +0 -2
- package/dist/client/api/tests/activeClient.test.d.ts.map +0 -1
- package/dist/client/api/tests/activeUser.test.d.ts +0 -2
- package/dist/client/api/tests/activeUser.test.d.ts.map +0 -1
- package/dist/client/api/tests/createClient.test.d.ts +0 -2
- package/dist/client/api/tests/createClient.test.d.ts.map +0 -1
- package/dist/client/api/tests/getToken.test.d.ts +0 -2
- package/dist/client/api/tests/getToken.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/accessTokenExpiryWatcher.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/accessTokenExpiryWatcher.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/accessTokenFunctions.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/accessTokenFunctions.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/activeUser.branches.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/activeUser.branches.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/activeUser.noUser.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/activeUser.noUser.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/createClient.branches.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/createClient.branches.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/createClient.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/createClient.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/getSettings.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/getSettings.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/login.branches.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/login.branches.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/login.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/login.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/loginAlternate.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/loginAlternate.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/loginAsBot.catch.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/loginAsBot.catch.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/loginAsBot.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/loginAsBot.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/loginAsBotTerminated.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/loginAsBotTerminated.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/loginAsVisitor.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/loginAsVisitor.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/loginAsVisitorTerminated.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/loginAsVisitorTerminated.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/logout.branches.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/logout.branches.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/resumeSession.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/resumeSession.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/resumeSessionLegacy.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/resumeSessionLegacy.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/sessionState.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/sessionState.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/setupLoginSubscriptions.branches.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/setupLoginSubscriptions.branches.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/setupLoginSubscriptions.legacyUnread.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/setupLoginSubscriptions.legacyUnread.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/utilities.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/utilities.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/integration/validateAndTerminate.integration.test.d.ts +0 -2
- package/dist/client/api/tests/integration/validateAndTerminate.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/login.test.d.ts +0 -2
- package/dist/client/api/tests/login.test.d.ts.map +0 -1
- package/dist/client/api/tests/loginWithAccessToken.test.d.ts +0 -2
- package/dist/client/api/tests/loginWithAccessToken.test.d.ts.map +0 -1
- package/dist/client/api/tests/logout.test.d.ts +0 -2
- package/dist/client/api/tests/logout.test.d.ts.map +0 -1
- package/dist/client/api/tests/notifications.integration.test.d.ts +0 -2
- package/dist/client/api/tests/notifications.integration.test.d.ts.map +0 -1
- package/dist/client/api/tests/renewTokenWithHandler.test.d.ts +0 -2
- package/dist/client/api/tests/renewTokenWithHandler.test.d.ts.map +0 -1
- package/dist/client/api/tests/renewWithAccessToken.test.d.ts +0 -2
- package/dist/client/api/tests/renewWithAccessToken.test.d.ts.map +0 -1
- package/dist/client/api/tests/renewal.test.d.ts +0 -2
- package/dist/client/api/tests/renewal.test.d.ts.map +0 -1
- package/dist/client/api/tests/resumeSession.test.d.ts +0 -2
- package/dist/client/api/tests/resumeSession.test.d.ts.map +0 -1
- package/dist/client/api/tests/setSessionState.test.d.ts +0 -2
- package/dist/client/api/tests/setSessionState.test.d.ts.map +0 -1
- package/dist/client/api/tests/terminateClient.test.d.ts +0 -2
- package/dist/client/api/tests/terminateClient.test.d.ts.map +0 -1
- package/dist/client/api/tests/validateAccessToken.test.d.ts +0 -2
- package/dist/client/api/tests/validateAccessToken.test.d.ts.map +0 -1
- package/dist/client/events/tests/onSessionStateChange.test.d.ts +0 -2
- package/dist/client/events/tests/onSessionStateChange.test.d.ts.map +0 -1
- package/dist/client/events/tests/onTokenTerminated.test.d.ts +0 -2
- package/dist/client/events/tests/onTokenTerminated.test.d.ts.map +0 -1
- package/dist/client/events/tests/onVisitorUsageLimitReached.test.d.ts +0 -2
- package/dist/client/events/tests/onVisitorUsageLimitReached.test.d.ts.map +0 -1
- package/dist/client/observers/tests/integrations/getUserUnread.integration.test.d.ts +0 -2
- package/dist/client/observers/tests/integrations/getUserUnread.integration.test.d.ts.map +0 -1
- package/dist/client/observers/tests/integrations/getUserUnreadEdgeCases.integration.test.d.ts +0 -2
- package/dist/client/observers/tests/integrations/getUserUnreadEdgeCases.integration.test.d.ts.map +0 -1
- package/dist/client/utils/tests/autoSubscriptionManager.test.d.ts +0 -2
- package/dist/client/utils/tests/autoSubscriptionManager.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/createComment.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/createComment.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/deleteComment.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/deleteComment.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/getComment.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/getComment.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/getCommentByIds.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/getCommentByIds.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/getComments.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/getComments.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/hardDeleteComment.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/hardDeleteComment.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/createComment.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/createComment.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/deleteComment.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/deleteComment.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/flagComment.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/flagComment.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/getComment.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/getComment.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/getCommentByIds.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/getCommentByIds.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/getComments.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/getComments.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/hardDeleteComment.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/hardDeleteComment.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/isCommentFlaggedByMe.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/isCommentFlaggedByMe.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/queryComments.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/queryComments.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/softDeleteComment.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/softDeleteComment.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/unflagComment.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/unflagComment.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/integration/updateComment.integration.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/integration/updateComment.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/queryComments.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/queryComments.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/softDeleteComment.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/softDeleteComment.test.d.ts.map +0 -1
- package/dist/commentRepository/api/tests/updateComment.test.d.ts +0 -2
- package/dist/commentRepository/api/tests/updateComment.test.d.ts.map +0 -1
- package/dist/commentRepository/events/tests/onCommentCreated.test.d.ts +0 -2
- package/dist/commentRepository/events/tests/onCommentCreated.test.d.ts.map +0 -1
- package/dist/commentRepository/events/tests/onCommentDeleted.test.d.ts +0 -2
- package/dist/commentRepository/events/tests/onCommentDeleted.test.d.ts.map +0 -1
- package/dist/commentRepository/observers/tests/CommentPaginationController.test.d.ts +0 -2
- package/dist/commentRepository/observers/tests/CommentPaginationController.test.d.ts.map +0 -1
- package/dist/commentRepository/observers/tests/getComment.test.d.ts +0 -2
- package/dist/commentRepository/observers/tests/getComment.test.d.ts.map +0 -1
- package/dist/commentRepository/observers/tests/integrations/getComment.integration.test.d.ts +0 -2
- package/dist/commentRepository/observers/tests/integrations/getComment.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/observers/tests/integrations/getComments.integration.test.d.ts +0 -2
- package/dist/commentRepository/observers/tests/integrations/getComments.integration.test.d.ts.map +0 -1
- package/dist/commentRepository/observers/tests/integrations/getCommentsExcludeBlockUser.integration.test.d.ts +0 -2
- package/dist/commentRepository/observers/tests/integrations/getCommentsExcludeBlockUser.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/createCommunity.test.d.ts +0 -2
- package/dist/communityRepository/api/test/createCommunity.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/deleteCommunity.test.d.ts +0 -2
- package/dist/communityRepository/api/test/deleteCommunity.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/getCommunities.test.d.ts +0 -2
- package/dist/communityRepository/api/test/getCommunities.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/getCommunity.test.d.ts +0 -2
- package/dist/communityRepository/api/test/getCommunity.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/getRecommendedCommunities.test.d.ts +0 -2
- package/dist/communityRepository/api/test/getRecommendedCommunities.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/getTrendingCommunities.test.d.ts +0 -2
- package/dist/communityRepository/api/test/getTrendingCommunities.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/integration/createCommunity.integration.test.d.ts +0 -2
- package/dist/communityRepository/api/test/integration/createCommunity.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/integration/deleteCommunity.integration.test.d.ts +0 -2
- package/dist/communityRepository/api/test/integration/deleteCommunity.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/integration/getCommunities.integration.test.d.ts +0 -2
- package/dist/communityRepository/api/test/integration/getCommunities.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/integration/getCommunity.integration.test.d.ts +0 -2
- package/dist/communityRepository/api/test/integration/getCommunity.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/integration/getRecommendedCommunities.integration.test.d.ts +0 -2
- package/dist/communityRepository/api/test/integration/getRecommendedCommunities.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/integration/getTrendingCommunities.integration.test.d.ts +0 -2
- package/dist/communityRepository/api/test/integration/getTrendingCommunities.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/integration/joinCommunity.integration.test.d.ts +0 -2
- package/dist/communityRepository/api/test/integration/joinCommunity.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/integration/leaveCommunity.integration.test.d.ts +0 -2
- package/dist/communityRepository/api/test/integration/leaveCommunity.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/integration/queryCommunities.integration.test.d.ts +0 -2
- package/dist/communityRepository/api/test/integration/queryCommunities.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/integration/setup.d.ts +0 -17
- package/dist/communityRepository/api/test/integration/setup.d.ts.map +0 -1
- package/dist/communityRepository/api/test/integration/updateCommunity.integration.test.d.ts +0 -2
- package/dist/communityRepository/api/test/integration/updateCommunity.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/joinCommunity.test.d.ts +0 -2
- package/dist/communityRepository/api/test/joinCommunity.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/leaveCommunity.test.d.ts +0 -2
- package/dist/communityRepository/api/test/leaveCommunity.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/queryCommunity.test.d.ts +0 -2
- package/dist/communityRepository/api/test/queryCommunity.test.d.ts.map +0 -1
- package/dist/communityRepository/api/test/updateCommunity.test.d.ts +0 -2
- package/dist/communityRepository/api/test/updateCommunity.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/api/tests/addMembers.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/api/tests/addMembers.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/api/tests/integration/addMembers.integration.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/api/tests/integration/addMembers.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/api/tests/integration/queryCommunityMembers.integration.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/api/tests/integration/queryCommunityMembers.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/api/tests/integration/removeMembers.integration.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/api/tests/integration/removeMembers.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/api/tests/integration/setup.d.ts +0 -10
- package/dist/communityRepository/communityMembership/api/tests/integration/setup.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/api/tests/queryCommunityMembers.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/api/tests/queryCommunityMembers.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/api/tests/removeMembers.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/api/tests/removeMembers.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/events/tests/onCommunityJoined.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/events/tests/onCommunityJoined.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/events/tests/onCommunityLeft.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/events/tests/onCommunityLeft.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserAdded.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserAdded.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserBanned.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserBanned.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserRemoved.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserRemoved.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserRoleAdded.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserRoleAdded.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserRoleRemoved.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserRoleRemoved.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserUnbaned.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/events/tests/onCommunityUserUnbaned.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/events/tests/utils.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/events/tests/utils.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/observers/tests/getMembers.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/observers/tests/getMembers.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/observers/tests/integration/getMembers.integration.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/observers/tests/integration/getMembers.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/observers/tests/integration/searchMembers.integration.test.d.ts +0 -2
- package/dist/communityRepository/communityMembership/observers/tests/integration/searchMembers.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/observers/tests/integration/setup.d.ts +0 -8
- package/dist/communityRepository/communityMembership/observers/tests/integration/setup.d.ts.map +0 -1
- package/dist/communityRepository/communityModeration/api/test/addRoles.test.d.ts +0 -2
- package/dist/communityRepository/communityModeration/api/test/addRoles.test.d.ts.map +0 -1
- package/dist/communityRepository/communityModeration/api/test/banMembers.test.d.ts +0 -2
- package/dist/communityRepository/communityModeration/api/test/banMembers.test.d.ts.map +0 -1
- package/dist/communityRepository/communityModeration/api/test/integration/addRoles.integration.test.d.ts +0 -2
- package/dist/communityRepository/communityModeration/api/test/integration/addRoles.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/communityModeration/api/test/integration/banMembers.integration.test.d.ts +0 -2
- package/dist/communityRepository/communityModeration/api/test/integration/banMembers.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/communityModeration/api/test/integration/removeRoles.integration.test.d.ts +0 -2
- package/dist/communityRepository/communityModeration/api/test/integration/removeRoles.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/communityModeration/api/test/integration/setup.d.ts +0 -14
- package/dist/communityRepository/communityModeration/api/test/integration/setup.d.ts.map +0 -1
- package/dist/communityRepository/communityModeration/api/test/integration/unbanMembers.integration.test.d.ts +0 -2
- package/dist/communityRepository/communityModeration/api/test/integration/unbanMembers.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/communityModeration/api/test/removeRoles.test.d.ts +0 -2
- package/dist/communityRepository/communityModeration/api/test/removeRoles.test.d.ts.map +0 -1
- package/dist/communityRepository/communityModeration/api/test/unbanMembers.test.d.ts +0 -2
- package/dist/communityRepository/communityModeration/api/test/unbanMembers.test.d.ts.map +0 -1
- package/dist/communityRepository/events/test/onCommunityCreated.test.d.ts +0 -2
- package/dist/communityRepository/events/test/onCommunityCreated.test.d.ts.map +0 -1
- package/dist/communityRepository/events/test/onCommunityDeleted.test.d.ts +0 -2
- package/dist/communityRepository/events/test/onCommunityDeleted.test.d.ts.map +0 -1
- package/dist/communityRepository/events/test/onCommunityUpdated.test.d.ts +0 -2
- package/dist/communityRepository/events/test/onCommunityUpdated.test.d.ts.map +0 -1
- package/dist/communityRepository/events/test/utils.test.d.ts +0 -2
- package/dist/communityRepository/events/test/utils.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/tests/getCommunities.test.d.ts +0 -2
- package/dist/communityRepository/observers/tests/getCommunities.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/tests/getCommunity.test.d.ts +0 -2
- package/dist/communityRepository/observers/tests/getCommunity.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/tests/integration/getCommunities.integration.test.d.ts +0 -2
- package/dist/communityRepository/observers/tests/integration/getCommunities.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/tests/integration/getCommunity.integration.test.d.ts +0 -2
- package/dist/communityRepository/observers/tests/integration/getCommunity.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/tests/integration/getJoinRequestList.integration.test.d.ts +0 -2
- package/dist/communityRepository/observers/tests/integration/getJoinRequestList.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/tests/integration/getJoinRequests.integration.test.d.ts +0 -2
- package/dist/communityRepository/observers/tests/integration/getJoinRequests.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/tests/integration/getRecommendedCommunities.integration.test.d.ts +0 -2
- package/dist/communityRepository/observers/tests/integration/getRecommendedCommunities.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/tests/integration/getTrendingCommunities.integration.test.d.ts +0 -2
- package/dist/communityRepository/observers/tests/integration/getTrendingCommunities.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/tests/integration/searchCommunities.integration.test.d.ts +0 -2
- package/dist/communityRepository/observers/tests/integration/searchCommunities.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/tests/integration/semanticSearchCommunities.integration.test.d.ts +0 -2
- package/dist/communityRepository/observers/tests/integration/semanticSearchCommunities.integration.test.d.ts.map +0 -1
- package/dist/communityRepository/observers/tests/integration/setup.d.ts +0 -21
- package/dist/communityRepository/observers/tests/integration/setup.d.ts.map +0 -1
- package/dist/core/query/tests/filtering.test.d.ts +0 -2
- package/dist/core/query/tests/filtering.test.d.ts.map +0 -1
- package/dist/core/query/tests/paging.test.d.ts +0 -2
- package/dist/core/query/tests/paging.test.d.ts.map +0 -1
- package/dist/core/query/tests/query.test.d.ts +0 -2
- package/dist/core/query/tests/query.test.d.ts.map +0 -1
- package/dist/core/query/tests/runQuery.test.d.ts +0 -2
- package/dist/core/query/tests/runQuery.test.d.ts.map +0 -1
- package/dist/core/tests/subscription.test.d.ts +0 -2
- package/dist/core/tests/subscription.test.d.ts.map +0 -1
- package/dist/core/transports/tests/http.test.d.ts +0 -2
- package/dist/core/transports/tests/http.test.d.ts.map +0 -1
- package/dist/core/transports/tests/mqtt.test.d.ts +0 -2
- package/dist/core/transports/tests/mqtt.test.d.ts.map +0 -1
- package/dist/eventRepository/api/tests/integration/createEvent.integration.test.d.ts +0 -2
- package/dist/eventRepository/api/tests/integration/createEvent.integration.test.d.ts.map +0 -1
- package/dist/eventRepository/api/tests/integration/deleteEvent.integration.test.d.ts +0 -2
- package/dist/eventRepository/api/tests/integration/deleteEvent.integration.test.d.ts.map +0 -1
- package/dist/eventRepository/api/tests/integration/updateEvent.integration.test.d.ts +0 -2
- package/dist/eventRepository/api/tests/integration/updateEvent.integration.test.d.ts.map +0 -1
- package/dist/eventRepository/internalApi/tests/integration/createRSVP.integration.test.d.ts +0 -2
- package/dist/eventRepository/internalApi/tests/integration/createRSVP.integration.test.d.ts.map +0 -1
- package/dist/eventRepository/internalApi/tests/integration/getEvent.integration.test.d.ts +0 -2
- package/dist/eventRepository/internalApi/tests/integration/getEvent.integration.test.d.ts.map +0 -1
- package/dist/eventRepository/internalApi/tests/integration/getMyRSVP.integration.test.d.ts +0 -2
- package/dist/eventRepository/internalApi/tests/integration/getMyRSVP.integration.test.d.ts.map +0 -1
- package/dist/eventRepository/internalApi/tests/integration/updateRSVP.integration.test.d.ts +0 -2
- package/dist/eventRepository/internalApi/tests/integration/updateRSVP.integration.test.d.ts.map +0 -1
- package/dist/eventRepository/observers/tests/integrations/getEvent.integration.test.d.ts +0 -2
- package/dist/eventRepository/observers/tests/integrations/getEvent.integration.test.d.ts.map +0 -1
- package/dist/eventRepository/observers/tests/integrations/getEvents.integration.test.d.ts +0 -2
- package/dist/eventRepository/observers/tests/integrations/getEvents.integration.test.d.ts.map +0 -1
- package/dist/eventRepository/observers/tests/integrations/getMyEvents.integration.test.d.ts +0 -2
- package/dist/eventRepository/observers/tests/integrations/getMyEvents.integration.test.d.ts.map +0 -1
- package/dist/eventRepository/observers/tests/integrations/getRSVPs.integration.test.d.ts +0 -2
- package/dist/eventRepository/observers/tests/integrations/getRSVPs.integration.test.d.ts.map +0 -1
- package/dist/external/api/tests/createUserToken.test.d.ts +0 -2
- package/dist/external/api/tests/createUserToken.test.d.ts.map +0 -1
- package/dist/external/api/tests/integration/createUserToken.integration.test.d.ts +0 -2
- package/dist/external/api/tests/integration/createUserToken.integration.test.d.ts.map +0 -1
- package/dist/feedRepository/api/test/getCustomRankingGlobalFeed.test.d.ts +0 -2
- package/dist/feedRepository/api/test/getCustomRankingGlobalFeed.test.d.ts.map +0 -1
- package/dist/feedRepository/api/test/queryGlobalFeed.test.d.ts +0 -2
- package/dist/feedRepository/api/test/queryGlobalFeed.test.d.ts.map +0 -1
- package/dist/feedRepository/api/tests/integration/queryGlobalFeed.integration.test.d.ts +0 -2
- package/dist/feedRepository/api/tests/integration/queryGlobalFeed.integration.test.d.ts.map +0 -1
- package/dist/feedRepository/observers/tests/integration/getCommunityFeed.integration.test.d.ts +0 -2
- package/dist/feedRepository/observers/tests/integration/getCommunityFeed.integration.test.d.ts.map +0 -1
- package/dist/feedRepository/observers/tests/integration/getCustomRankingGlobalFeed.integration.test.d.ts +0 -2
- package/dist/feedRepository/observers/tests/integration/getCustomRankingGlobalFeed.integration.test.d.ts.map +0 -1
- package/dist/feedRepository/observers/tests/integration/getForYouFeed.integration.test.d.ts +0 -2
- package/dist/feedRepository/observers/tests/integration/getForYouFeed.integration.test.d.ts.map +0 -1
- package/dist/feedRepository/observers/tests/integration/getGlobalFeed.integration.test.d.ts +0 -2
- package/dist/feedRepository/observers/tests/integration/getGlobalFeed.integration.test.d.ts.map +0 -1
- package/dist/feedRepository/observers/tests/integration/getUserFeed.integration.test.d.ts +0 -2
- package/dist/feedRepository/observers/tests/integration/getUserFeed.integration.test.d.ts.map +0 -1
- package/dist/feedRepository/observers/tests/unit/CursorController.test.d.ts +0 -2
- package/dist/feedRepository/observers/tests/unit/CursorController.test.d.ts.map +0 -1
- package/dist/fileRepository/api/test/uploadFile.test.d.ts +0 -2
- package/dist/fileRepository/api/test/uploadFile.test.d.ts.map +0 -1
- package/dist/fileRepository/api/test/uploadImage.test.d.ts +0 -2
- package/dist/fileRepository/api/test/uploadImage.test.d.ts.map +0 -1
- package/dist/fileRepository/api/test/uploadVideo.test.d.ts +0 -2
- package/dist/fileRepository/api/test/uploadVideo.test.d.ts.map +0 -1
- package/dist/fileRepository/api/tests/integration/deleteFile.integration.test.d.ts +0 -2
- package/dist/fileRepository/api/tests/integration/deleteFile.integration.test.d.ts.map +0 -1
- package/dist/fileRepository/api/tests/integration/fileUrlWithSize.integration.test.d.ts +0 -2
- package/dist/fileRepository/api/tests/integration/fileUrlWithSize.integration.test.d.ts.map +0 -1
- package/dist/fileRepository/api/tests/integration/getFile.integration.test.d.ts +0 -2
- package/dist/fileRepository/api/tests/integration/getFile.integration.test.d.ts.map +0 -1
- package/dist/fileRepository/api/tests/integration/updateAltText.integration.test.d.ts +0 -2
- package/dist/fileRepository/api/tests/integration/updateAltText.integration.test.d.ts.map +0 -1
- package/dist/fileRepository/api/tests/integration/uploadAudio.integration.test.d.ts +0 -2
- package/dist/fileRepository/api/tests/integration/uploadAudio.integration.test.d.ts.map +0 -1
- package/dist/fileRepository/api/tests/integration/uploadClip.integration.test.d.ts +0 -2
- package/dist/fileRepository/api/tests/integration/uploadClip.integration.test.d.ts.map +0 -1
- package/dist/fileRepository/api/tests/integration/uploadFile.integration.test.d.ts +0 -2
- package/dist/fileRepository/api/tests/integration/uploadFile.integration.test.d.ts.map +0 -1
- package/dist/fileRepository/api/tests/integration/uploadImage.integration.test.d.ts +0 -2
- package/dist/fileRepository/api/tests/integration/uploadImage.integration.test.d.ts.map +0 -1
- package/dist/fileRepository/api/tests/integration/uploadVideo.integration.test.d.ts +0 -2
- package/dist/fileRepository/api/tests/integration/uploadVideo.integration.test.d.ts.map +0 -1
- package/dist/group/utils/test/withUsers.test.d.ts +0 -2
- package/dist/group/utils/test/withUsers.test.d.ts.map +0 -1
- package/dist/invitationRepository/api/tests/integration/cancelInvitation.integration.test.d.ts +0 -2
- package/dist/invitationRepository/api/tests/integration/cancelInvitation.integration.test.d.ts.map +0 -1
- package/dist/invitationRepository/observers/tests/integrations/getInvitations.integration.test.d.ts +0 -2
- package/dist/invitationRepository/observers/tests/integrations/getInvitations.integration.test.d.ts.map +0 -1
- package/dist/invitationRepository/observers/tests/integrations/getInvitations.noUser.integration.test.d.ts +0 -2
- package/dist/invitationRepository/observers/tests/integrations/getInvitations.noUser.integration.test.d.ts.map +0 -1
- package/dist/invitationRepository/observers/tests/integrations/getMyCommunityInvitations.integration.test.d.ts +0 -2
- package/dist/invitationRepository/observers/tests/integrations/getMyCommunityInvitations.integration.test.d.ts.map +0 -1
- package/dist/liveReactionRepository/api/tests/integration/createReaction.integration.test.d.ts +0 -2
- package/dist/liveReactionRepository/api/tests/integration/createReaction.integration.test.d.ts.map +0 -1
- package/dist/liveReactionRepository/events/tests/integration/onLiveReactionCreated.integration.test.d.ts +0 -2
- package/dist/liveReactionRepository/events/tests/integration/onLiveReactionCreated.integration.test.d.ts.map +0 -1
- package/dist/liveReactionRepository/observers/tests/integrations/getReactions.integration.test.d.ts +0 -2
- package/dist/liveReactionRepository/observers/tests/integrations/getReactions.integration.test.d.ts.map +0 -1
- package/dist/liveReactionRepository/observers/tests/integrations/getReactions.noUser.integration.test.d.ts +0 -2
- package/dist/liveReactionRepository/observers/tests/integrations/getReactions.noUser.integration.test.d.ts.map +0 -1
- package/dist/marker/api/tests/getChannelMarkers.test.d.ts +0 -2
- package/dist/marker/api/tests/getChannelMarkers.test.d.ts.map +0 -1
- package/dist/marker/api/tests/getMessageMarkers.test.d.ts +0 -2
- package/dist/marker/api/tests/getMessageMarkers.test.d.ts.map +0 -1
- package/dist/marker/api/tests/getSubChannelMarkers.test.d.ts +0 -2
- package/dist/marker/api/tests/getSubChannelMarkers.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/createMessage.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/createMessage.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/deleteMessage.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/deleteMessage.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/editMessage.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/editMessage.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/flagMessage.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/flagMessage.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/getMessage.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/getMessage.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/getMessages.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/getMessages.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/createMessage.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/createMessage.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/deleteMessage.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/deleteMessage.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/editMessage.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/editMessage.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/flagMessage.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/flagMessage.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/getDeliveredUsers.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/getDeliveredUsers.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/getReadUsers.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/getReadUsers.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/isMessageFlaggedByMe.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/isMessageFlaggedByMe.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/markAsDelivered.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/markAsDelivered.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/queryMessages.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/queryMessages.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/softDeleteMessage.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/softDeleteMessage.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/unflagMessage.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/unflagMessage.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/integration/updateMessage.integration.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/integration/updateMessage.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/markAsDelivered.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/markAsDelivered.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/queryMessages.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/queryMessages.test.d.ts.map +0 -1
- package/dist/messageRepository/api/tests/unflagMessage.test.d.ts +0 -2
- package/dist/messageRepository/api/tests/unflagMessage.test.d.ts.map +0 -1
- package/dist/messageRepository/events/tests/events.test.d.ts +0 -2
- package/dist/messageRepository/events/tests/events.test.d.ts.map +0 -1
- package/dist/messageRepository/observers/tests/getAroundMessages.test.d.ts +0 -2
- package/dist/messageRepository/observers/tests/getAroundMessages.test.d.ts.map +0 -1
- package/dist/messageRepository/observers/tests/getMessage.test.d.ts +0 -2
- package/dist/messageRepository/observers/tests/getMessage.test.d.ts.map +0 -1
- package/dist/messageRepository/observers/tests/getMessages.test.d.ts +0 -2
- package/dist/messageRepository/observers/tests/getMessages.test.d.ts.map +0 -1
- package/dist/messageRepository/observers/tests/integration/getMessage.integration.test.d.ts +0 -2
- package/dist/messageRepository/observers/tests/integration/getMessage.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/observers/tests/integration/getMessages.integration.test.d.ts +0 -2
- package/dist/messageRepository/observers/tests/integration/getMessages.integration.test.d.ts.map +0 -1
- package/dist/messageRepository/observers/tests/markReadMessage.test.d.ts +0 -2
- package/dist/messageRepository/observers/tests/markReadMessage.test.d.ts.map +0 -1
- package/dist/notificationTray/api/tests/integration/markItemsSeen.integration.test.d.ts +0 -2
- package/dist/notificationTray/api/tests/integration/markItemsSeen.integration.test.d.ts.map +0 -1
- package/dist/notificationTray/api/tests/integration/markTraySeen.integration.test.d.ts +0 -2
- package/dist/notificationTray/api/tests/integration/markTraySeen.integration.test.d.ts.map +0 -1
- package/dist/notificationTray/events/tests/integrations/onNotificationTraySeenUpdated.integration.test.d.ts +0 -2
- package/dist/notificationTray/events/tests/integrations/onNotificationTraySeenUpdated.integration.test.d.ts.map +0 -1
- package/dist/notificationTray/internalApi/tests/integration/getNotificationTraySeen.integration.test.d.ts +0 -2
- package/dist/notificationTray/internalApi/tests/integration/getNotificationTraySeen.integration.test.d.ts.map +0 -1
- package/dist/notificationTray/observers/tests/integrations/getNotificationTrayItems.integration.test.d.ts +0 -2
- package/dist/notificationTray/observers/tests/integrations/getNotificationTrayItems.integration.test.d.ts.map +0 -1
- package/dist/notificationTray/observers/tests/integrations/getNotificationTraySeen.integration.test.d.ts +0 -2
- package/dist/notificationTray/observers/tests/integrations/getNotificationTraySeen.integration.test.d.ts.map +0 -1
- package/dist/pollRepository/api/tests/closePoll.test.d.ts +0 -2
- package/dist/pollRepository/api/tests/closePoll.test.d.ts.map +0 -1
- package/dist/pollRepository/api/tests/createPoll.test.d.ts +0 -2
- package/dist/pollRepository/api/tests/createPoll.test.d.ts.map +0 -1
- package/dist/pollRepository/api/tests/getPoll.test.d.ts +0 -2
- package/dist/pollRepository/api/tests/getPoll.test.d.ts.map +0 -1
- package/dist/pollRepository/api/tests/integration/closePoll.integration.test.d.ts +0 -2
- package/dist/pollRepository/api/tests/integration/closePoll.integration.test.d.ts.map +0 -1
- package/dist/pollRepository/api/tests/integration/createPoll.integration.test.d.ts +0 -2
- package/dist/pollRepository/api/tests/integration/createPoll.integration.test.d.ts.map +0 -1
- package/dist/pollRepository/api/tests/integration/deletePoll.integration.test.d.ts +0 -2
- package/dist/pollRepository/api/tests/integration/deletePoll.integration.test.d.ts.map +0 -1
- package/dist/pollRepository/api/tests/integration/getPoll.integration.test.d.ts +0 -2
- package/dist/pollRepository/api/tests/integration/getPoll.integration.test.d.ts.map +0 -1
- package/dist/pollRepository/api/tests/integration/unvotePoll.integration.test.d.ts +0 -2
- package/dist/pollRepository/api/tests/integration/unvotePoll.integration.test.d.ts.map +0 -1
- package/dist/pollRepository/api/tests/integration/votePoll.integration.test.d.ts +0 -2
- package/dist/pollRepository/api/tests/integration/votePoll.integration.test.d.ts.map +0 -1
- package/dist/pollRepository/api/tests/votePoll.test.d.ts +0 -2
- package/dist/pollRepository/api/tests/votePoll.test.d.ts.map +0 -1
- package/dist/pollRepository/observers/tests/integrations/getPoll.integration.test.d.ts +0 -2
- package/dist/pollRepository/observers/tests/integrations/getPoll.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/getPost.test.d.ts +0 -2
- package/dist/postRepository/api/tests/getPost.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/getPostByIds.test.d.ts +0 -2
- package/dist/postRepository/api/tests/getPostByIds.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/getPosts.test.d.ts +0 -2
- package/dist/postRepository/api/tests/getPosts.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/approvePost.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/approvePost.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/createOtherPosts.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/createOtherPosts.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/createPost.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/createPost.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/declinePost.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/declinePost.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/deletePost.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/deletePost.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/editPost.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/editPost.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/flagPost.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/flagPost.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/getPost.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/getPost.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/getPostByIds.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/getPostByIds.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/getPosts.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/getPosts.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/observerCollections.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/observerCollections.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/pinProduct.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/pinProduct.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/setup.d.ts +0 -67
- package/dist/postRepository/api/tests/integration/setup.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/unpinProduct.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/unpinProduct.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/integration/updateProductTags.integration.test.d.ts +0 -2
- package/dist/postRepository/api/tests/integration/updateProductTags.integration.test.d.ts.map +0 -1
- package/dist/postRepository/api/tests/queryPosts.test.d.ts +0 -2
- package/dist/postRepository/api/tests/queryPosts.test.d.ts.map +0 -1
- package/dist/postRepository/events/tests/onPostApproved.test.d.ts +0 -2
- package/dist/postRepository/events/tests/onPostApproved.test.d.ts.map +0 -1
- package/dist/postRepository/events/tests/onPostCreated.test.d.ts +0 -2
- package/dist/postRepository/events/tests/onPostCreated.test.d.ts.map +0 -1
- package/dist/postRepository/events/tests/onPostDeclined.test.d.ts +0 -2
- package/dist/postRepository/events/tests/onPostDeclined.test.d.ts.map +0 -1
- package/dist/postRepository/events/tests/onPostDeleted.test.d.ts +0 -2
- package/dist/postRepository/events/tests/onPostDeleted.test.d.ts.map +0 -1
- package/dist/postRepository/events/tests/onPostFlagged.test.d.ts +0 -2
- package/dist/postRepository/events/tests/onPostFlagged.test.d.ts.map +0 -1
- package/dist/postRepository/events/tests/onPostReactionAdded.test.d.ts +0 -2
- package/dist/postRepository/events/tests/onPostReactionAdded.test.d.ts.map +0 -1
- package/dist/postRepository/events/tests/onPostReactionRemoved.test.d.ts +0 -2
- package/dist/postRepository/events/tests/onPostReactionRemoved.test.d.ts.map +0 -1
- package/dist/postRepository/events/tests/onPostUnflagged.test.d.ts +0 -2
- package/dist/postRepository/events/tests/onPostUnflagged.test.d.ts.map +0 -1
- package/dist/postRepository/events/tests/onPostUpdated.test.d.ts +0 -2
- package/dist/postRepository/events/tests/onPostUpdated.test.d.ts.map +0 -1
- package/dist/postRepository/observers/tests/getPost.test.d.ts +0 -2
- package/dist/postRepository/observers/tests/getPost.test.d.ts.map +0 -1
- package/dist/postRepository/observers/tests/getPosts.test.d.ts +0 -2
- package/dist/postRepository/observers/tests/getPosts.test.d.ts.map +0 -1
- package/dist/postRepository/observers/tests/getPostsExcludeBlockUser.test.d.ts +0 -2
- package/dist/postRepository/observers/tests/getPostsExcludeBlockUser.test.d.ts.map +0 -1
- package/dist/postRepository/tests/integration/postAnalytics.integration.test.d.ts +0 -2
- package/dist/postRepository/tests/integration/postAnalytics.integration.test.d.ts.map +0 -1
- package/dist/postRepository/tests/integration/setup.d.ts +0 -6
- package/dist/postRepository/tests/integration/setup.d.ts.map +0 -1
- package/dist/productRepository/tests/integration/getProduct.integration.test.d.ts +0 -2
- package/dist/productRepository/tests/integration/getProduct.integration.test.d.ts.map +0 -1
- package/dist/productRepository/tests/integration/productAnalytics.integration.test.d.ts +0 -2
- package/dist/productRepository/tests/integration/productAnalytics.integration.test.d.ts.map +0 -1
- package/dist/productRepository/tests/integration/searchProducts.integration.test.d.ts +0 -2
- package/dist/productRepository/tests/integration/searchProducts.integration.test.d.ts.map +0 -1
- package/dist/productRepository/tests/integration/setup.d.ts +0 -11
- package/dist/productRepository/tests/integration/setup.d.ts.map +0 -1
- package/dist/reactionRepository/api/tests/addReaction.test.d.ts +0 -2
- package/dist/reactionRepository/api/tests/addReaction.test.d.ts.map +0 -1
- package/dist/reactionRepository/api/tests/integration/addReaction.integration.test.d.ts +0 -2
- package/dist/reactionRepository/api/tests/integration/addReaction.integration.test.d.ts.map +0 -1
- package/dist/reactionRepository/api/tests/integration/queryReactions.integration.test.d.ts +0 -2
- package/dist/reactionRepository/api/tests/integration/queryReactions.integration.test.d.ts.map +0 -1
- package/dist/reactionRepository/api/tests/integration/queryReactor.integration.test.d.ts +0 -2
- package/dist/reactionRepository/api/tests/integration/queryReactor.integration.test.d.ts.map +0 -1
- package/dist/reactionRepository/api/tests/integration/removeReaction.integration.test.d.ts +0 -2
- package/dist/reactionRepository/api/tests/integration/removeReaction.integration.test.d.ts.map +0 -1
- package/dist/reactionRepository/api/tests/removeReaction.test.d.ts +0 -2
- package/dist/reactionRepository/api/tests/removeReaction.test.d.ts.map +0 -1
- package/dist/reactionRepository/observers/tests/integrations/getReactions.integration.test.d.ts +0 -2
- package/dist/reactionRepository/observers/tests/integrations/getReactions.integration.test.d.ts.map +0 -1
- package/dist/report/api/tests/createReport.test.d.ts +0 -2
- package/dist/report/api/tests/createReport.test.d.ts.map +0 -1
- package/dist/report/api/tests/deleteReport.test.d.ts +0 -2
- package/dist/report/api/tests/deleteReport.test.d.ts.map +0 -1
- package/dist/report/api/tests/integration/createReport.integration.test.d.ts +0 -2
- package/dist/report/api/tests/integration/createReport.integration.test.d.ts.map +0 -1
- package/dist/report/api/tests/integration/deleteReport.integration.test.d.ts +0 -2
- package/dist/report/api/tests/integration/deleteReport.integration.test.d.ts.map +0 -1
- package/dist/report/api/tests/integration/isReportedByMe.integration.test.d.ts +0 -2
- package/dist/report/api/tests/integration/isReportedByMe.integration.test.d.ts.map +0 -1
- package/dist/role/api/tests/integration/getRole.integration.test.d.ts +0 -2
- package/dist/role/api/tests/integration/getRole.integration.test.d.ts.map +0 -1
- package/dist/role/api/tests/integration/queryRoles.integration.test.d.ts +0 -2
- package/dist/role/api/tests/integration/queryRoles.integration.test.d.ts.map +0 -1
- package/dist/roomPresenceRepository/api/tests/integration/getRoomOnlineUsers.integration.test.d.ts +0 -2
- package/dist/roomPresenceRepository/api/tests/integration/getRoomOnlineUsers.integration.test.d.ts.map +0 -1
- package/dist/roomPresenceRepository/api/tests/integration/getRoomUserCount.integration.test.d.ts +0 -2
- package/dist/roomPresenceRepository/api/tests/integration/getRoomUserCount.integration.test.d.ts.map +0 -1
- package/dist/roomPresenceRepository/api/tests/integration/startHeartbeat.integration.test.d.ts +0 -2
- package/dist/roomPresenceRepository/api/tests/integration/startHeartbeat.integration.test.d.ts.map +0 -1
- package/dist/roomPresenceRepository/api/tests/integration/stopHeartbeat.integration.test.d.ts +0 -2
- package/dist/roomPresenceRepository/api/tests/integration/stopHeartbeat.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/api/getRecordedUrl.d.ts +0 -19
- package/dist/roomRepository/api/getRecordedUrl.d.ts.map +0 -1
- package/dist/roomRepository/api/tests/integration/createRoom.integration.test.d.ts +0 -2
- package/dist/roomRepository/api/tests/integration/createRoom.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/api/tests/integration/deleteRoom.integration.test.d.ts +0 -2
- package/dist/roomRepository/api/tests/integration/deleteRoom.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/api/tests/integration/getBroadcasterData.integration.test.d.ts +0 -2
- package/dist/roomRepository/api/tests/integration/getBroadcasterData.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/api/tests/integration/getRecordedUrl.integration.test.d.ts +0 -2
- package/dist/roomRepository/api/tests/integration/getRecordedUrl.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/api/tests/integration/leaveRoom.integration.test.d.ts +0 -2
- package/dist/roomRepository/api/tests/integration/leaveRoom.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/api/tests/integration/removeParticipant.integration.test.d.ts +0 -2
- package/dist/roomRepository/api/tests/integration/removeParticipant.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/api/tests/integration/roomAnalytics.integration.test.d.ts +0 -2
- package/dist/roomRepository/api/tests/integration/roomAnalytics.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/api/tests/integration/setup.d.ts +0 -23
- package/dist/roomRepository/api/tests/integration/setup.d.ts.map +0 -1
- package/dist/roomRepository/api/tests/integration/stopRoom.integration.test.d.ts +0 -2
- package/dist/roomRepository/api/tests/integration/stopRoom.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/api/tests/integration/updateCohostPermission.integration.test.d.ts +0 -2
- package/dist/roomRepository/api/tests/integration/updateCohostPermission.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/api/tests/integration/updateRoom.integration.test.d.ts +0 -2
- package/dist/roomRepository/api/tests/integration/updateRoom.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/observers/tests/integration/getRoom.integration.test.d.ts +0 -2
- package/dist/roomRepository/observers/tests/integration/getRoom.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/observers/tests/integration/getRooms.integration.test.d.ts +0 -2
- package/dist/roomRepository/observers/tests/integration/getRooms.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/observers/tests/integration/observerUtils.integration.test.d.ts +0 -2
- package/dist/roomRepository/observers/tests/integration/observerUtils.integration.test.d.ts.map +0 -1
- package/dist/roomRepository/observers/tests/integration/setup.d.ts +0 -2
- package/dist/roomRepository/observers/tests/integration/setup.d.ts.map +0 -1
- package/dist/storyRepository/api/tests/integration/createImageStory.integration.test.d.ts +0 -2
- package/dist/storyRepository/api/tests/integration/createImageStory.integration.test.d.ts.map +0 -1
- package/dist/storyRepository/api/tests/integration/createVideoStory.integration.test.d.ts +0 -2
- package/dist/storyRepository/api/tests/integration/createVideoStory.integration.test.d.ts.map +0 -1
- package/dist/storyRepository/api/tests/integration/hardDeleteStory.integration.test.d.ts +0 -2
- package/dist/storyRepository/api/tests/integration/hardDeleteStory.integration.test.d.ts.map +0 -1
- package/dist/storyRepository/api/tests/integration/softDeleteStory.integration.test.d.ts +0 -2
- package/dist/storyRepository/api/tests/integration/softDeleteStory.integration.test.d.ts.map +0 -1
- package/dist/storyRepository/internalApi/tests/integration/getStoryByStoryId.integration.test.d.ts +0 -2
- package/dist/storyRepository/internalApi/tests/integration/getStoryByStoryId.integration.test.d.ts.map +0 -1
- package/dist/storyRepository/observers/tests/integration/getActiveStoriesByTarget.integration.test.d.ts +0 -2
- package/dist/storyRepository/observers/tests/integration/getActiveStoriesByTarget.integration.test.d.ts.map +0 -1
- package/dist/storyRepository/observers/tests/integration/getGlobalStoryTargets.integration.test.d.ts +0 -2
- package/dist/storyRepository/observers/tests/integration/getGlobalStoryTargets.integration.test.d.ts.map +0 -1
- package/dist/storyRepository/observers/tests/integration/getStoriesByTargetIds.integration.test.d.ts +0 -2
- package/dist/storyRepository/observers/tests/integration/getStoriesByTargetIds.integration.test.d.ts.map +0 -1
- package/dist/storyRepository/observers/tests/integration/getStoryByStoryId.integration.test.d.ts +0 -2
- package/dist/storyRepository/observers/tests/integration/getStoryByStoryId.integration.test.d.ts.map +0 -1
- package/dist/storyRepository/observers/tests/integration/getTargetById.integration.test.d.ts +0 -2
- package/dist/storyRepository/observers/tests/integration/getTargetById.integration.test.d.ts.map +0 -1
- package/dist/storyRepository/observers/tests/integration/getTargetsByTargetIds.integration.test.d.ts +0 -2
- package/dist/storyRepository/observers/tests/integration/getTargetsByTargetIds.integration.test.d.ts.map +0 -1
- package/dist/streamRepository/api/tests/createStream.test.d.ts +0 -2
- package/dist/streamRepository/api/tests/createStream.test.d.ts.map +0 -1
- package/dist/streamRepository/api/tests/deleteStream.test.d.ts +0 -2
- package/dist/streamRepository/api/tests/deleteStream.test.d.ts.map +0 -1
- package/dist/streamRepository/api/tests/getStream.test.d.ts +0 -2
- package/dist/streamRepository/api/tests/getStream.test.d.ts.map +0 -1
- package/dist/streamRepository/api/tests/integration/createStream.integration.test.d.ts +0 -2
- package/dist/streamRepository/api/tests/integration/createStream.integration.test.d.ts.map +0 -1
- package/dist/streamRepository/api/tests/integration/deleteStream.integration.test.d.ts +0 -2
- package/dist/streamRepository/api/tests/integration/deleteStream.integration.test.d.ts.map +0 -1
- package/dist/streamRepository/api/tests/integration/disposeStream.integration.test.d.ts +0 -2
- package/dist/streamRepository/api/tests/integration/disposeStream.integration.test.d.ts.map +0 -1
- package/dist/streamRepository/api/tests/integration/editStream.integration.test.d.ts +0 -2
- package/dist/streamRepository/api/tests/integration/editStream.integration.test.d.ts.map +0 -1
- package/dist/streamRepository/api/tests/integration/updateStream.integration.test.d.ts +0 -2
- package/dist/streamRepository/api/tests/integration/updateStream.integration.test.d.ts.map +0 -1
- package/dist/streamRepository/observers/tests/getStreamById.test.d.ts +0 -2
- package/dist/streamRepository/observers/tests/getStreamById.test.d.ts.map +0 -1
- package/dist/streamRepository/observers/tests/integration/getStreamById.integration.test.d.ts +0 -2
- package/dist/streamRepository/observers/tests/integration/getStreamById.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/createSubChannel.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/createSubChannel.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/deleteSubChannel.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/deleteSubChannel.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/getSubChannel.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/getSubChannel.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/getSubChannels.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/getSubChannels.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/hardDeleteSubChannel.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/hardDeleteSubChannel.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/createSubChannel.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/createSubChannel.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/deleteSubChannel.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/deleteSubChannel.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/getSubChannel.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/getSubChannel.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/getSubChannels.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/getSubChannels.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/hardDeleteSubChannel.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/hardDeleteSubChannel.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/markAsReadBySegment.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/markAsReadBySegment.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/querySubChannels.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/querySubChannels.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/readingAPI.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/readingAPI.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/softDeleteSubChannel.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/softDeleteSubChannel.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/startReadingAPI.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/startReadingAPI.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/stopReadingAPI.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/stopReadingAPI.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/integration/updateSubChannel.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/integration/updateSubChannel.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/softDeleteSubChannel.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/softDeleteSubChannel.test.d.ts.map +0 -1
- package/dist/subChannelRepository/api/tests/updateSubChannel.test.d.ts +0 -2
- package/dist/subChannelRepository/api/tests/updateSubChannel.test.d.ts.map +0 -1
- package/dist/subChannelRepository/observers/tests/getSubChannel.test.d.ts +0 -2
- package/dist/subChannelRepository/observers/tests/getSubChannel.test.d.ts.map +0 -1
- package/dist/subChannelRepository/observers/tests/getSubChannelWithMessagePreview.test.d.ts +0 -2
- package/dist/subChannelRepository/observers/tests/getSubChannelWithMessagePreview.test.d.ts.map +0 -1
- package/dist/subChannelRepository/observers/tests/getSubChannels.test.d.ts +0 -2
- package/dist/subChannelRepository/observers/tests/getSubChannels.test.d.ts.map +0 -1
- package/dist/subChannelRepository/observers/tests/getSubChannelsWithMessagePreview.test.d.ts +0 -2
- package/dist/subChannelRepository/observers/tests/getSubChannelsWithMessagePreview.test.d.ts.map +0 -1
- package/dist/subChannelRepository/observers/tests/integrations/getSubChannel.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/observers/tests/integrations/getSubChannel.integration.test.d.ts.map +0 -1
- package/dist/subChannelRepository/observers/tests/integrations/getSubChannels.integration.test.d.ts +0 -2
- package/dist/subChannelRepository/observers/tests/integrations/getSubChannels.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/flagUser.test.d.ts +0 -2
- package/dist/userRepository/api/tests/flagUser.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/getUser.test.d.ts +0 -2
- package/dist/userRepository/api/tests/getUser.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/flagUser.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/flagUser.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/getAllBlockedUsers.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/getAllBlockedUsers.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/getAllBlockingUsers.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/getAllBlockingUsers.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/getUser.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/getUser.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/getUserByIds.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/getUserByIds.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/isUserFlaggedByMe.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/isUserFlaggedByMe.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/queryBlockedUsers.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/queryBlockedUsers.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/queryUsers.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/queryUsers.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/unflagUser.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/unflagUser.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/integration/updateUser.integration.test.d.ts +0 -2
- package/dist/userRepository/api/tests/integration/updateUser.integration.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/queryBlockedUsers.test.d.ts +0 -2
- package/dist/userRepository/api/tests/queryBlockedUsers.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/queryUsers.test.d.ts +0 -2
- package/dist/userRepository/api/tests/queryUsers.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/unflagUser.test.d.ts +0 -2
- package/dist/userRepository/api/tests/unflagUser.test.d.ts.map +0 -1
- package/dist/userRepository/api/tests/updateUser.test.d.ts +0 -2
- package/dist/userRepository/api/tests/updateUser.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/getUser.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/getUser.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/getUsers.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/getUsers.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/integrations/enums.integration.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/integrations/enums.integration.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/integrations/getBlockedUsers.integration.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/integrations/getBlockedUsers.integration.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/integrations/getBlockingUsers.integration.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/integrations/getBlockingUsers.integration.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/integrations/getReachedUsers.integration.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/integrations/getReachedUsers.integration.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/integrations/getUser.integration.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/integrations/getUser.integration.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/integrations/getUsers.integration.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/integrations/getUsers.integration.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/integrations/searchUserByDisplayName.integration.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/integrations/searchUserByDisplayName.integration.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/integrations/searchUsers.integration.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/integrations/searchUsers.integration.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/searchUserByDisplayName.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/searchUserByDisplayName.test.d.ts.map +0 -1
- package/dist/userRepository/observers/tests/searchUsers.test.d.ts +0 -2
- package/dist/userRepository/observers/tests/searchUsers.test.d.ts.map +0 -1
- package/dist/userRepository/relationship/block/api/tests/blockUser.test.d.ts +0 -2
- package/dist/userRepository/relationship/block/api/tests/blockUser.test.d.ts.map +0 -1
- package/dist/userRepository/relationship/block/api/tests/unBlockUser.test.d.ts +0 -2
- package/dist/userRepository/relationship/block/api/tests/unBlockUser.test.d.ts.map +0 -1
- package/dist/userRepository/relationship/follow/api/tests/getFollowInfo.test.d.ts +0 -2
- package/dist/userRepository/relationship/follow/api/tests/getFollowInfo.test.d.ts.map +0 -1
- package/dist/userRepository/relationship/follow/observers/tests/getFollowInfo.test.d.ts +0 -2
- package/dist/userRepository/relationship/follow/observers/tests/getFollowInfo.test.d.ts.map +0 -1
- package/dist/userRepository/relationship/follow/observers/tests/getFollowers.test.d.ts +0 -2
- package/dist/userRepository/relationship/follow/observers/tests/getFollowers.test.d.ts.map +0 -1
- package/dist/userRepository/relationship/follow/observers/tests/getFollowings.test.d.ts +0 -2
- package/dist/userRepository/relationship/follow/observers/tests/getFollowings.test.d.ts.map +0 -1
- package/dist/userRepository/relationship/follow/observers/tests/getMyFollowInfo.test.d.ts +0 -2
- package/dist/userRepository/relationship/follow/observers/tests/getMyFollowInfo.test.d.ts.map +0 -1
- package/dist/utils/tests/client.d.ts +0 -7
- package/dist/utils/tests/client.d.ts.map +0 -1
- package/dist/utils/tests/dummy/block.d.ts +0 -44
- package/dist/utils/tests/dummy/block.d.ts.map +0 -1
- package/dist/utils/tests/dummy/category.d.ts +0 -71
- package/dist/utils/tests/dummy/category.d.ts.map +0 -1
- package/dist/utils/tests/dummy/channel.d.ts +0 -237
- package/dist/utils/tests/dummy/channel.d.ts.map +0 -1
- package/dist/utils/tests/dummy/comment.d.ts +0 -126
- package/dist/utils/tests/dummy/comment.d.ts.map +0 -1
- package/dist/utils/tests/dummy/community.d.ts +0 -123
- package/dist/utils/tests/dummy/community.d.ts.map +0 -1
- package/dist/utils/tests/dummy/feed.d.ts +0 -5
- package/dist/utils/tests/dummy/feed.d.ts.map +0 -1
- package/dist/utils/tests/dummy/file.d.ts +0 -5
- package/dist/utils/tests/dummy/file.d.ts.map +0 -1
- package/dist/utils/tests/dummy/follow.d.ts +0 -14
- package/dist/utils/tests/dummy/follow.d.ts.map +0 -1
- package/dist/utils/tests/dummy/index.d.ts +0 -24
- package/dist/utils/tests/dummy/index.d.ts.map +0 -1
- package/dist/utils/tests/dummy/marker.d.ts +0 -10
- package/dist/utils/tests/dummy/marker.d.ts.map +0 -1
- package/dist/utils/tests/dummy/member.d.ts +0 -2
- package/dist/utils/tests/dummy/member.d.ts.map +0 -1
- package/dist/utils/tests/dummy/message.d.ts +0 -35
- package/dist/utils/tests/dummy/message.d.ts.map +0 -1
- package/dist/utils/tests/dummy/messagePreviewChannel.d.ts +0 -3
- package/dist/utils/tests/dummy/messagePreviewChannel.d.ts.map +0 -1
- package/dist/utils/tests/dummy/poll.d.ts +0 -3
- package/dist/utils/tests/dummy/poll.d.ts.map +0 -1
- package/dist/utils/tests/dummy/post.d.ts +0 -55
- package/dist/utils/tests/dummy/post.d.ts.map +0 -1
- package/dist/utils/tests/dummy/reaction.d.ts +0 -4
- package/dist/utils/tests/dummy/reaction.d.ts.map +0 -1
- package/dist/utils/tests/dummy/role.d.ts +0 -4
- package/dist/utils/tests/dummy/role.d.ts.map +0 -1
- package/dist/utils/tests/dummy/stream.d.ts +0 -98
- package/dist/utils/tests/dummy/stream.d.ts.map +0 -1
- package/dist/utils/tests/dummy/subChannel.d.ts +0 -33
- package/dist/utils/tests/dummy/subChannel.d.ts.map +0 -1
- package/dist/utils/tests/dummy/token.d.ts +0 -10
- package/dist/utils/tests/dummy/token.d.ts.map +0 -1
- package/dist/utils/tests/dummy/user.d.ts +0 -117
- package/dist/utils/tests/dummy/user.d.ts.map +0 -1
- package/dist/utils/tests/index.d.ts +0 -4
- package/dist/utils/tests/index.d.ts.map +0 -1
- package/dist/utils/tests/inferIsDeleted.test.d.ts +0 -2
- package/dist/utils/tests/inferIsDeleted.test.d.ts.map +0 -1
- package/dist/utils/tests/isEquals.test.d.ts +0 -2
- package/dist/utils/tests/isEquals.test.d.ts.map +0 -1
- package/dist/utils/tests/liveObject.test.d.ts +0 -2
- package/dist/utils/tests/liveObject.test.d.ts.map +0 -1
- package/dist/utils/tests/utils.d.ts +0 -4
- package/dist/utils/tests/utils.d.ts.map +0 -1
package/dist/index.esm.js
CHANGED
|
@@ -3,8 +3,9 @@ import mitt from 'mitt';
|
|
|
3
3
|
import debug from 'debug';
|
|
4
4
|
import axios from 'axios';
|
|
5
5
|
import HttpAgent, { HttpsAgent } from 'agentkeepalive';
|
|
6
|
-
import mqtt from 'mqtt';
|
|
7
6
|
import uuid$1 from 'react-native-uuid';
|
|
7
|
+
import mqtt from 'mqtt';
|
|
8
|
+
import { UAParser } from 'ua-parser-js';
|
|
8
9
|
import jwtDecode from 'jwt-decode';
|
|
9
10
|
import hash from 'object-hash';
|
|
10
11
|
import Hls from 'hls.js';
|
|
@@ -325,6 +326,7 @@ function getVersion() {
|
|
|
325
326
|
const VERSION = getVersion();
|
|
326
327
|
|
|
327
328
|
const COLLECTION_DEFAULT_PAGINATION_LIMIT = 5;
|
|
329
|
+
const LATEST_COMMENTS_LIMIT = 5;
|
|
328
330
|
const COLLECTION_DEFAULT_PAGINATION_SIZE = 20;
|
|
329
331
|
const COLLECTION_DEFAULT_CACHING_POLICY = 'cache_then_server';
|
|
330
332
|
const ENABLE_CACHE_MESSAGE = 'For using Live Collection feature you need to enable Cache!';
|
|
@@ -340,7 +342,11 @@ const YEAR = 365 * DAY;
|
|
|
340
342
|
const ACCESS_TOKEN_WATCHER_INTERVAL = 10 * MINUTE;
|
|
341
343
|
const API_ENDPOINTS = {
|
|
342
344
|
forYouFeed: '/api/v1/feeds/for-you',
|
|
345
|
+
commentReviewQueue: (communityId) => `/api/v3/communities/${encodeURIComponent(communityId)}/comments/review-queue`,
|
|
343
346
|
};
|
|
347
|
+
// The review-queue route defaults to 10, not the SDK-wide page size, and caps at 100
|
|
348
|
+
const COMMENT_REVIEW_QUEUE_DEFAULT_PAGINATION_SIZE = 10;
|
|
349
|
+
const COMMENT_REVIEW_QUEUE_MAX_PAGINATION_SIZE = 100;
|
|
344
350
|
|
|
345
351
|
// cache constants
|
|
346
352
|
const CACHE_KEY_GET = 'get';
|
|
@@ -1937,6 +1943,8 @@ function computeUrl(type, region) {
|
|
|
1937
1943
|
return URLS[type].replace('{region}', region);
|
|
1938
1944
|
}
|
|
1939
1945
|
|
|
1946
|
+
const uuid = () => uuid$1.v4().toString();
|
|
1947
|
+
|
|
1940
1948
|
/**
|
|
1941
1949
|
* Unwraps v3 server payload (for error handling and type extraction)
|
|
1942
1950
|
*
|
|
@@ -1961,6 +1969,24 @@ const unwrapPayload = (response) => {
|
|
|
1961
1969
|
// unjust, but helps force uncast "T | undefined" to allow deconstruction without warnings
|
|
1962
1970
|
return undefined;
|
|
1963
1971
|
};
|
|
1972
|
+
/**
|
|
1973
|
+
* Builds a hex string of `bytes` length from the SDK's uuid helper (a v4 UUID is
|
|
1974
|
+
* 16 bytes / 32 hex chars once hyphens are removed) — avoids a new crypto dependency.
|
|
1975
|
+
*/
|
|
1976
|
+
const randomHex = (bytes) => {
|
|
1977
|
+
let hex = '';
|
|
1978
|
+
while (hex.length < bytes * 2)
|
|
1979
|
+
hex += uuid().replace(/-/g, '');
|
|
1980
|
+
return hex.slice(0, bytes * 2);
|
|
1981
|
+
};
|
|
1982
|
+
/**
|
|
1983
|
+
* W3C Trace Context `traceparent`: `version-<16-byte trace-id>-<8-byte span-id>-<flags>`.
|
|
1984
|
+
* The SDK is the trace originator, so it mints a fresh trace + span id per request; flags `01` = sampled.
|
|
1985
|
+
*
|
|
1986
|
+
* @category Transport
|
|
1987
|
+
* @hidden
|
|
1988
|
+
*/
|
|
1989
|
+
const generateTraceparent = () => `00-${randomHex(16)}-${randomHex(8)}-01`;
|
|
1964
1990
|
|
|
1965
1991
|
class NetworkActivitiesWatcher {
|
|
1966
1992
|
constructor() {
|
|
@@ -2085,6 +2111,10 @@ const createHttpTransport = (endpoint) => {
|
|
|
2085
2111
|
});
|
|
2086
2112
|
instance.defaults.withCredentials = false;
|
|
2087
2113
|
instance.interceptors.request.use(config => {
|
|
2114
|
+
// Request tracing — set on every outbound request (login included), never persisted.
|
|
2115
|
+
// Must run before the session-url early-return below so /api/v5/sessions carries them too.
|
|
2116
|
+
config.headers.set('x-request-id', uuid());
|
|
2117
|
+
config.headers.set('traceparent', generateTraceparent());
|
|
2088
2118
|
// do not check expiration for token creation url
|
|
2089
2119
|
if (config.url === '/api/v5/sessions') {
|
|
2090
2120
|
return config;
|
|
@@ -2128,20 +2158,28 @@ const createHttpTransport = (endpoint) => {
|
|
|
2128
2158
|
});
|
|
2129
2159
|
return response;
|
|
2130
2160
|
}, error => {
|
|
2131
|
-
var _a, _b, _c;
|
|
2161
|
+
var _a, _b, _c, _d;
|
|
2132
2162
|
const { response } = error;
|
|
2133
2163
|
// handle unauthorized request
|
|
2134
2164
|
if ((response === null || response === void 0 ? void 0 : response.data.code) === 400100 /* Amity.ServerError.UNAUTHORIZED */) {
|
|
2135
2165
|
fireEvent('tokenTerminated', "terminated" /* Amity.SessionStates.TERMINATED */);
|
|
2136
2166
|
}
|
|
2167
|
+
// handle globally banned user. The realtime `user.didGlobalBan` event can be missed
|
|
2168
|
+
// (e.g. MQTT dropped before delivery), so mirror the 400100 handling above and fire
|
|
2169
|
+
// the same virtual event the login subscriptions already listen to. That terminates
|
|
2170
|
+
// the session with `TokenTerminationReason.GLOBAL_BAN` and notifies `onClientBanned`
|
|
2171
|
+
// consumers, instead of leaving the session `established` with a revoked token.
|
|
2172
|
+
if (((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.code) === 400312 /* Amity.ServerError.GLOBAL_BAN */) {
|
|
2173
|
+
fireEvent('user.didGlobalBan', { users: [], files: [] });
|
|
2174
|
+
}
|
|
2137
2175
|
// handle visitor daily usage limit exceeded
|
|
2138
|
-
if (((
|
|
2176
|
+
if (((_b = response === null || response === void 0 ? void 0 : response.data) === null || _b === void 0 ? void 0 : _b.code) === 400323 /* Amity.ServerError.VISITOR_USAGE_LIMIT_EXCEEDED */) {
|
|
2139
2177
|
throttledFireVisitorUsageLimit();
|
|
2140
2178
|
throw new ASCError('Visitor usage limit exceeded', 400323 /* Amity.ServerError.VISITOR_USAGE_LIMIT_EXCEEDED */, "error" /* Amity.ErrorLevel.ERROR */);
|
|
2141
2179
|
}
|
|
2142
2180
|
// if it's an error with status in the response payload,
|
|
2143
2181
|
// then it's an expected error.
|
|
2144
|
-
if ((
|
|
2182
|
+
if ((_c = response === null || response === void 0 ? void 0 : response.data) === null || _c === void 0 ? void 0 : _c.status) {
|
|
2145
2183
|
unwrapPayload(response === null || response === void 0 ? void 0 : response.data);
|
|
2146
2184
|
}
|
|
2147
2185
|
// as on request cancellation error is returned
|
|
@@ -2149,7 +2187,7 @@ const createHttpTransport = (endpoint) => {
|
|
|
2149
2187
|
throw error;
|
|
2150
2188
|
}
|
|
2151
2189
|
// unexpected error.
|
|
2152
|
-
throw new Error((
|
|
2190
|
+
throw new Error((_d = response === null || response === void 0 ? void 0 : response.data) !== null && _d !== void 0 ? _d : error);
|
|
2153
2191
|
});
|
|
2154
2192
|
instance.defaults.paramsSerializer = {
|
|
2155
2193
|
encode: params => encodeURIComponent(params),
|
|
@@ -2347,8 +2385,6 @@ const getItem = async (key) => {
|
|
|
2347
2385
|
});
|
|
2348
2386
|
};
|
|
2349
2387
|
|
|
2350
|
-
const uuid = () => uuid$1.v4().toString();
|
|
2351
|
-
|
|
2352
2388
|
// TODO: find a way to uniquely identify the device
|
|
2353
2389
|
let tabIndex = 0;
|
|
2354
2390
|
// This logic is running on browser only
|
|
@@ -2408,22 +2444,60 @@ const getMQTTClientId = async (userId) => {
|
|
|
2408
2444
|
};
|
|
2409
2445
|
/** @hidden */
|
|
2410
2446
|
const getDeviceModel = () => {
|
|
2411
|
-
var _a
|
|
2447
|
+
var _a;
|
|
2412
2448
|
if ((_a = safeProcess.versions) === null || _a === void 0 ? void 0 : _a.node)
|
|
2413
2449
|
return safeProcess.versions.node;
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2450
|
+
return undefined;
|
|
2451
|
+
};
|
|
2452
|
+
const hasNavigator = () => typeof navigator !== 'undefined' && !!navigator;
|
|
2453
|
+
const getLocale = () => (hasNavigator() ? navigator.language : undefined);
|
|
2454
|
+
const getTimezone = () => {
|
|
2455
|
+
try {
|
|
2456
|
+
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
2457
|
+
}
|
|
2458
|
+
catch (_a) {
|
|
2459
|
+
return undefined;
|
|
2460
|
+
}
|
|
2461
|
+
};
|
|
2462
|
+
const getNetworkType = () => {
|
|
2463
|
+
var _a;
|
|
2464
|
+
if (!hasNavigator())
|
|
2465
|
+
return undefined;
|
|
2466
|
+
return (_a = navigator.connection) === null || _a === void 0 ? void 0 : _a.effectiveType;
|
|
2467
|
+
};
|
|
2468
|
+
const isNode = () => { var _a; return !!((_a = safeProcess.versions) === null || _a === void 0 ? void 0 : _a.node); };
|
|
2469
|
+
const parseUserAgent = () => {
|
|
2470
|
+
if (!hasNavigator() || !navigator.userAgent)
|
|
2471
|
+
return {};
|
|
2472
|
+
const { os, browser, device } = new UAParser(navigator.userAgent).getResult();
|
|
2473
|
+
const result = {};
|
|
2474
|
+
if (os.name)
|
|
2475
|
+
result.osName = os.name;
|
|
2476
|
+
if (os.version)
|
|
2477
|
+
result.osVersion = os.version;
|
|
2478
|
+
if (browser.name)
|
|
2479
|
+
result.browserName = browser.name;
|
|
2480
|
+
if (browser.version)
|
|
2481
|
+
result.browserVersion = browser.version;
|
|
2482
|
+
if (device.type === 'tablet')
|
|
2483
|
+
result.deviceType = 'tablet';
|
|
2484
|
+
else if (device.type === 'mobile')
|
|
2485
|
+
result.deviceType = 'mobile';
|
|
2486
|
+
else
|
|
2487
|
+
result.deviceType = 'desktop';
|
|
2488
|
+
return result;
|
|
2417
2489
|
};
|
|
2418
2490
|
/** @hidden */
|
|
2419
2491
|
const getDeviceInfo = () => {
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2492
|
+
var _a;
|
|
2493
|
+
let client;
|
|
2494
|
+
try {
|
|
2495
|
+
client = getActiveClient();
|
|
2496
|
+
}
|
|
2497
|
+
catch (_b) {
|
|
2498
|
+
client = undefined;
|
|
2499
|
+
}
|
|
2500
|
+
return Object.assign({ kind: isNode() ? 'node' : 'web', model: getDeviceModel(), sdkVersion: VERSION, product: (_a = client === null || client === void 0 ? void 0 : client.product) !== null && _a !== void 0 ? _a : 'sdk', uikitVersion: client === null || client === void 0 ? void 0 : client.uikitVersion, appId: client === null || client === void 0 ? void 0 : client.appId, appVersion: client === null || client === void 0 ? void 0 : client.appVersion, locale: getLocale(), timezone: getTimezone(), networkType: getNetworkType() }, parseUserAgent());
|
|
2427
2501
|
};
|
|
2428
2502
|
|
|
2429
2503
|
/* eslint-disable no-console */
|
|
@@ -3848,6 +3922,95 @@ const prepareChannelPayload = async (rawPayload, options = { isMessagePreviewUpd
|
|
|
3848
3922
|
channelUsers });
|
|
3849
3923
|
};
|
|
3850
3924
|
|
|
3925
|
+
const channelCacheKey = (channel) => [
|
|
3926
|
+
'channel',
|
|
3927
|
+
'get',
|
|
3928
|
+
getResolver('channel')(channel),
|
|
3929
|
+
];
|
|
3930
|
+
/**
|
|
3931
|
+
* Find a cached channel by any of its ids (internal, public, or `channelId`).
|
|
3932
|
+
*
|
|
3933
|
+
* The channel cache is keyed by the channel internal id (see `idResolvers.channel`), but
|
|
3934
|
+
* realtime payloads reference channels by different ids: pin events carry the **public**
|
|
3935
|
+
* id, messages carry `channelId`. Try the cheap direct lookup first, then scan.
|
|
3936
|
+
*/
|
|
3937
|
+
const findCachedChannelByAnyId = (id) => {
|
|
3938
|
+
var _a, _b, _c;
|
|
3939
|
+
if (!id)
|
|
3940
|
+
return undefined;
|
|
3941
|
+
const direct = (_a = pullFromCache(['channel', 'get', id])) === null || _a === void 0 ? void 0 : _a.data;
|
|
3942
|
+
if (direct)
|
|
3943
|
+
return direct;
|
|
3944
|
+
return (_c = (_b = queryCache(['channel', 'get'])) === null || _b === void 0 ? void 0 : _b.find(({ data }) => data.channelInternalId === id || data.channelPublicId === id || data.channelId === id)) === null || _c === void 0 ? void 0 : _c.data;
|
|
3945
|
+
};
|
|
3946
|
+
/**
|
|
3947
|
+
* Resolve the cached channel a `channel.messagePinned` / `channel.messageUnpinned` event
|
|
3948
|
+
* refers to. `data.channelId` is the channel public id; a pinned message body (present on
|
|
3949
|
+
* `messagePinned` only) also carries the internal id, which is the direct cache key.
|
|
3950
|
+
*/
|
|
3951
|
+
const findCachedChannelForPin = (payload) => {
|
|
3952
|
+
var _a, _b;
|
|
3953
|
+
return (_b = findCachedChannelByAnyId((_a = payload.pinnedMessage) === null || _a === void 0 ? void 0 : _a.channelId)) !== null && _b !== void 0 ? _b : findCachedChannelByAnyId(payload.channelId);
|
|
3954
|
+
};
|
|
3955
|
+
/**
|
|
3956
|
+
* Write a new pin snapshot (or `null` to clear) on a cached channel and ingest any
|
|
3957
|
+
* users delivered with it (the pin author and the message author), so the banner can
|
|
3958
|
+
* render a byline without a second fetch.
|
|
3959
|
+
*
|
|
3960
|
+
* Every `messagePinned` payload is a full snapshot — "this is the pin now" — so the last
|
|
3961
|
+
* one received always wins; there is no merging with the previous pin.
|
|
3962
|
+
*/
|
|
3963
|
+
const updatePinnedMessageCache = (channel, pinnedMessage, users) => {
|
|
3964
|
+
if (users && users.length > 0) {
|
|
3965
|
+
ingestInCache({ users: users.map(convertRawUserToInternalUser) });
|
|
3966
|
+
}
|
|
3967
|
+
const updated = Object.assign(Object.assign({}, channel), { pinnedMessage });
|
|
3968
|
+
pushToCache(channelCacheKey(channel), updated);
|
|
3969
|
+
return updated;
|
|
3970
|
+
};
|
|
3971
|
+
|
|
3972
|
+
/**
|
|
3973
|
+
* Applies a `channel.roleAdded` / `channel.roleRemoved` realtime payload to the cache.
|
|
3974
|
+
*
|
|
3975
|
+
* The event names every member the role request affected together with the
|
|
3976
|
+
* roles and channel-scoped permissions each of them is left holding. That is a
|
|
3977
|
+
* full state, not a delta, so it is written straight over the cached membership.
|
|
3978
|
+
*
|
|
3979
|
+
* Members the SDK has not fetched yet are skipped: the payload does not carry
|
|
3980
|
+
* enough to build a full {@link Amity.Membership} and the live collections only
|
|
3981
|
+
* emit rows that already exist in cache.
|
|
3982
|
+
*
|
|
3983
|
+
* @param payload the `data` of the realtime event
|
|
3984
|
+
* @returns the refreshed channel (when resolvable) and the updated cached memberships
|
|
3985
|
+
*
|
|
3986
|
+
* @hidden
|
|
3987
|
+
*/
|
|
3988
|
+
const applyChannelRolePayload = (payload) => {
|
|
3989
|
+
var _a, _b, _c;
|
|
3990
|
+
const { channelId, users = [], channels = [] } = payload;
|
|
3991
|
+
const rawChannel = (_a = channels.find(channel => channel.channelId === channelId)) !== null && _a !== void 0 ? _a : channels[0];
|
|
3992
|
+
let channel;
|
|
3993
|
+
if (rawChannel) {
|
|
3994
|
+
const channelKey = ['channel', 'get', getResolver('channel')(rawChannel)];
|
|
3995
|
+
// the role event does not touch message previews, keep whatever preview is cached
|
|
3996
|
+
const converted = convertFromRaw(rawChannel, { isMessagePreviewUpdated: false });
|
|
3997
|
+
upsertInCache(channelKey, converted);
|
|
3998
|
+
channel = (_c = (_b = pullFromCache(channelKey)) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : converted;
|
|
3999
|
+
}
|
|
4000
|
+
const members = [];
|
|
4001
|
+
users.forEach(({ userId, roles, permissions }) => {
|
|
4002
|
+
var _a, _b, _c;
|
|
4003
|
+
const memberKey = ['channelUsers', 'get', getResolver('channelUsers')({ channelId, userId })];
|
|
4004
|
+
const cached = (_a = pullFromCache(memberKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
4005
|
+
if (!cached)
|
|
4006
|
+
return;
|
|
4007
|
+
const updated = Object.assign(Object.assign({}, cached), { roles, permissions });
|
|
4008
|
+
pushToCache(memberKey, updated);
|
|
4009
|
+
members.push((_c = (_b = pullFromCache(memberKey)) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : updated);
|
|
4010
|
+
});
|
|
4011
|
+
return { channel, members };
|
|
4012
|
+
};
|
|
4013
|
+
|
|
3851
4014
|
/**
|
|
3852
4015
|
* ```js
|
|
3853
4016
|
* import { getSubChannelMarkers } from '@amityco/ts-sdk'
|
|
@@ -4033,32 +4196,6 @@ const channelMemberLinkedObject = (channelMember) => {
|
|
|
4033
4196
|
} });
|
|
4034
4197
|
};
|
|
4035
4198
|
|
|
4036
|
-
/**
|
|
4037
|
-
*
|
|
4038
|
-
* get current user's membership data
|
|
4039
|
-
*
|
|
4040
|
-
* @returns the {@link Amity.Membership<'channel'>} objects
|
|
4041
|
-
*
|
|
4042
|
-
* @category Channel API
|
|
4043
|
-
* @async
|
|
4044
|
-
*/
|
|
4045
|
-
const getMyMembership$1 = (channelId) => {
|
|
4046
|
-
const client = getActiveClient();
|
|
4047
|
-
client.log('channel/getMyMembership.locally');
|
|
4048
|
-
const cacheChannelUser = pullFromCache([
|
|
4049
|
-
'channelUsers',
|
|
4050
|
-
'get',
|
|
4051
|
-
`${channelId}#${client.userId}`,
|
|
4052
|
-
]);
|
|
4053
|
-
if (!cacheChannelUser) {
|
|
4054
|
-
throw new ASCApiError('Item not found!', 400400 /* Amity.ServerError.ITEM_NOT_FOUND */, "error" /* Amity.ErrorLevel.ERROR */);
|
|
4055
|
-
}
|
|
4056
|
-
return {
|
|
4057
|
-
data: cacheChannelUser.data,
|
|
4058
|
-
cachedAt: cacheChannelUser.cachedAt,
|
|
4059
|
-
};
|
|
4060
|
-
};
|
|
4061
|
-
|
|
4062
4199
|
/**
|
|
4063
4200
|
* ```js
|
|
4064
4201
|
* import { isEqual } from '~/utils/isEqual'
|
|
@@ -4129,55 +4266,81 @@ function isEqual(x, y) {
|
|
|
4129
4266
|
}));
|
|
4130
4267
|
}
|
|
4131
4268
|
|
|
4132
|
-
|
|
4269
|
+
/**
|
|
4270
|
+
*
|
|
4271
|
+
* get current user's membership data
|
|
4272
|
+
*
|
|
4273
|
+
* @returns the {@link Amity.Membership<'channel'>} objects
|
|
4274
|
+
*
|
|
4275
|
+
* @category Channel API
|
|
4276
|
+
* @async
|
|
4277
|
+
*/
|
|
4278
|
+
const getMyMembership$1 = (channelId) => {
|
|
4279
|
+
const client = getActiveClient();
|
|
4280
|
+
client.log('channel/getMyMembership.locally');
|
|
4281
|
+
const cacheChannelUser = pullFromCache([
|
|
4282
|
+
'channelUsers',
|
|
4283
|
+
'get',
|
|
4284
|
+
`${channelId}#${client.userId}`,
|
|
4285
|
+
]);
|
|
4286
|
+
if (!cacheChannelUser) {
|
|
4287
|
+
throw new ASCApiError('Item not found!', 400400 /* Amity.ServerError.ITEM_NOT_FOUND */, "error" /* Amity.ErrorLevel.ERROR */);
|
|
4288
|
+
}
|
|
4289
|
+
return {
|
|
4290
|
+
data: cacheChannelUser.data,
|
|
4291
|
+
cachedAt: cacheChannelUser.cachedAt,
|
|
4292
|
+
};
|
|
4293
|
+
};
|
|
4294
|
+
|
|
4295
|
+
const callbacks$e = [];
|
|
4133
4296
|
let mainDisposer$b = null;
|
|
4134
|
-
const dispose$
|
|
4135
|
-
const index = callbacks$
|
|
4297
|
+
const dispose$e = (cb) => {
|
|
4298
|
+
const index = callbacks$e.indexOf(cb);
|
|
4136
4299
|
if (index > -1) {
|
|
4137
|
-
callbacks$
|
|
4300
|
+
callbacks$e.splice(index, 1);
|
|
4138
4301
|
}
|
|
4139
|
-
if (callbacks$
|
|
4302
|
+
if (callbacks$e.length === 0) {
|
|
4140
4303
|
mainDisposer$b === null || mainDisposer$b === void 0 ? void 0 : mainDisposer$b();
|
|
4141
4304
|
}
|
|
4142
4305
|
};
|
|
4143
4306
|
const onChannelCreated = (callback) => {
|
|
4144
|
-
if (callbacks$
|
|
4307
|
+
if (callbacks$e.length === 0) {
|
|
4145
4308
|
const client = getActiveClient();
|
|
4146
4309
|
const filter = async (payload) => {
|
|
4147
4310
|
const data = await prepareChannelPayload(payload);
|
|
4148
4311
|
ingestInCache(data);
|
|
4149
|
-
callbacks$
|
|
4312
|
+
callbacks$e.forEach(cb => cb(data.channels[0]));
|
|
4150
4313
|
};
|
|
4151
4314
|
mainDisposer$b = createEventSubscriber(client, 'onChannelCreated', 'channel.created', filter);
|
|
4152
4315
|
}
|
|
4153
|
-
callbacks$
|
|
4154
|
-
return () => dispose$
|
|
4316
|
+
callbacks$e.push(callback);
|
|
4317
|
+
return () => dispose$e(callback);
|
|
4155
4318
|
};
|
|
4156
4319
|
|
|
4157
|
-
const callbacks$
|
|
4158
|
-
const mainDisposers = [];
|
|
4159
|
-
const dispose$
|
|
4160
|
-
const index = callbacks$
|
|
4320
|
+
const callbacks$d = [];
|
|
4321
|
+
const mainDisposers$2 = [];
|
|
4322
|
+
const dispose$d = (cb) => {
|
|
4323
|
+
const index = callbacks$d.indexOf(cb);
|
|
4161
4324
|
if (index > -1) {
|
|
4162
|
-
callbacks$
|
|
4325
|
+
callbacks$d.splice(index, 1);
|
|
4163
4326
|
}
|
|
4164
|
-
if (callbacks$
|
|
4165
|
-
mainDisposers.forEach(fn => fn());
|
|
4327
|
+
if (callbacks$d.length === 0) {
|
|
4328
|
+
mainDisposers$2.forEach(fn => fn());
|
|
4166
4329
|
}
|
|
4167
4330
|
};
|
|
4168
4331
|
const onChannelUpdated = (callback) => {
|
|
4169
4332
|
const client = getActiveClient();
|
|
4170
|
-
if (callbacks$
|
|
4333
|
+
if (callbacks$d.length === 0) {
|
|
4171
4334
|
const filter = async (payload) => {
|
|
4172
4335
|
const data = await prepareChannelPayload(payload);
|
|
4173
4336
|
ingestInCache(data);
|
|
4174
|
-
callbacks$
|
|
4337
|
+
callbacks$d.forEach(cb => cb(data.channels[0]));
|
|
4175
4338
|
};
|
|
4176
|
-
mainDisposers.push(createEventSubscriber(client, 'onChannelUpdated', 'channel.updated', filter));
|
|
4177
|
-
mainDisposers.push(createEventSubscriber(client, 'onChannelUpdated', 'local.channel.updated', payload => callbacks$
|
|
4339
|
+
mainDisposers$2.push(createEventSubscriber(client, 'onChannelUpdated', 'channel.updated', filter));
|
|
4340
|
+
mainDisposers$2.push(createEventSubscriber(client, 'onChannelUpdated', 'local.channel.updated', payload => callbacks$d.forEach(cb => cb(payload.channels[0]))));
|
|
4178
4341
|
}
|
|
4179
|
-
callbacks$
|
|
4180
|
-
return () => dispose$
|
|
4342
|
+
callbacks$d.push(callback);
|
|
4343
|
+
return () => dispose$d(callback);
|
|
4181
4344
|
};
|
|
4182
4345
|
|
|
4183
4346
|
const addFlagIsDeletedSubChannelUnreadByChannelId = (channelId) => {
|
|
@@ -4200,19 +4363,19 @@ const deleteChannelUnreadByChannelId = (channelId) => {
|
|
|
4200
4363
|
}
|
|
4201
4364
|
};
|
|
4202
4365
|
|
|
4203
|
-
const callbacks$
|
|
4366
|
+
const callbacks$c = [];
|
|
4204
4367
|
let mainDisposer$a = null;
|
|
4205
|
-
const dispose$
|
|
4206
|
-
const index = callbacks$
|
|
4368
|
+
const dispose$c = (cb) => {
|
|
4369
|
+
const index = callbacks$c.indexOf(cb);
|
|
4207
4370
|
if (index > -1) {
|
|
4208
|
-
callbacks$
|
|
4371
|
+
callbacks$c.splice(index, 1);
|
|
4209
4372
|
}
|
|
4210
|
-
if (callbacks$
|
|
4373
|
+
if (callbacks$c.length === 0) {
|
|
4211
4374
|
mainDisposer$a === null || mainDisposer$a === void 0 ? void 0 : mainDisposer$a();
|
|
4212
4375
|
}
|
|
4213
4376
|
};
|
|
4214
4377
|
const onChannelDeleted = (callback) => {
|
|
4215
|
-
if (callbacks$
|
|
4378
|
+
if (callbacks$c.length === 0) {
|
|
4216
4379
|
const client = getActiveClient();
|
|
4217
4380
|
const filter = async (payload) => {
|
|
4218
4381
|
const data = await prepareChannelPayload(payload);
|
|
@@ -4232,53 +4395,53 @@ const onChannelDeleted = (callback) => {
|
|
|
4232
4395
|
}
|
|
4233
4396
|
});
|
|
4234
4397
|
ingestInCache(data);
|
|
4235
|
-
callbacks$
|
|
4398
|
+
callbacks$c.forEach(cb => cb(data.channels[0]));
|
|
4236
4399
|
};
|
|
4237
4400
|
mainDisposer$a = createEventSubscriber(client, 'onChannelDeleted', 'channel.deleted', filter);
|
|
4238
4401
|
}
|
|
4239
|
-
callbacks$
|
|
4240
|
-
return () => dispose$
|
|
4402
|
+
callbacks$c.push(callback);
|
|
4403
|
+
return () => dispose$c(callback);
|
|
4241
4404
|
};
|
|
4242
4405
|
|
|
4243
|
-
const callbacks$
|
|
4406
|
+
const callbacks$b = [];
|
|
4244
4407
|
let mainDisposer$9 = null;
|
|
4245
|
-
const dispose$
|
|
4246
|
-
const index = callbacks$
|
|
4408
|
+
const dispose$b = (cb) => {
|
|
4409
|
+
const index = callbacks$b.indexOf(cb);
|
|
4247
4410
|
if (index > -1) {
|
|
4248
|
-
callbacks$
|
|
4411
|
+
callbacks$b.splice(index, 1);
|
|
4249
4412
|
}
|
|
4250
|
-
if (callbacks$
|
|
4413
|
+
if (callbacks$b.length === 0) {
|
|
4251
4414
|
mainDisposer$9 === null || mainDisposer$9 === void 0 ? void 0 : mainDisposer$9();
|
|
4252
4415
|
}
|
|
4253
4416
|
};
|
|
4254
4417
|
const onChannelJoined = (callback) => {
|
|
4255
|
-
if (callbacks$
|
|
4418
|
+
if (callbacks$b.length === 0) {
|
|
4256
4419
|
const client = getActiveClient();
|
|
4257
4420
|
const filter = async (payload) => {
|
|
4258
4421
|
const preparedPayload = await prepareChannelPayload(payload);
|
|
4259
4422
|
const { channels, channelUsers } = preparedPayload;
|
|
4260
4423
|
ingestInCache(preparedPayload);
|
|
4261
|
-
callbacks$
|
|
4424
|
+
callbacks$b.forEach(cb => cb(channels[0], channelUsers[0]));
|
|
4262
4425
|
};
|
|
4263
4426
|
mainDisposer$9 = createEventSubscriber(client, 'onChannelJoined', 'channel.joined', filter);
|
|
4264
4427
|
}
|
|
4265
|
-
callbacks$
|
|
4266
|
-
return () => dispose$
|
|
4428
|
+
callbacks$b.push(callback);
|
|
4429
|
+
return () => dispose$b(callback);
|
|
4267
4430
|
};
|
|
4268
4431
|
|
|
4269
|
-
const callbacks$
|
|
4432
|
+
const callbacks$a = [];
|
|
4270
4433
|
let mainDisposer$8 = null;
|
|
4271
|
-
const dispose$
|
|
4272
|
-
const index = callbacks$
|
|
4434
|
+
const dispose$a = (cb) => {
|
|
4435
|
+
const index = callbacks$a.indexOf(cb);
|
|
4273
4436
|
if (index > -1) {
|
|
4274
|
-
callbacks$
|
|
4437
|
+
callbacks$a.splice(index, 1);
|
|
4275
4438
|
}
|
|
4276
|
-
if (callbacks$
|
|
4439
|
+
if (callbacks$a.length === 0) {
|
|
4277
4440
|
mainDisposer$8 === null || mainDisposer$8 === void 0 ? void 0 : mainDisposer$8();
|
|
4278
4441
|
}
|
|
4279
4442
|
};
|
|
4280
4443
|
const onChannelLeft = (callback) => {
|
|
4281
|
-
if (callbacks$
|
|
4444
|
+
if (callbacks$a.length === 0) {
|
|
4282
4445
|
const client = getActiveClient();
|
|
4283
4446
|
const filter = async (payload) => {
|
|
4284
4447
|
const { userId } = getActiveClient();
|
|
@@ -4302,27 +4465,27 @@ const onChannelLeft = (callback) => {
|
|
|
4302
4465
|
}
|
|
4303
4466
|
const { channels, channelUsers } = preparedPayload;
|
|
4304
4467
|
ingestInCache(preparedPayload);
|
|
4305
|
-
callbacks$
|
|
4468
|
+
callbacks$a.forEach(cb => cb(channels[0], channelUsers[0]));
|
|
4306
4469
|
};
|
|
4307
4470
|
mainDisposer$8 = createEventSubscriber(client, 'onChannelLeft', 'channel.left', filter);
|
|
4308
4471
|
}
|
|
4309
|
-
callbacks$
|
|
4310
|
-
return () => dispose$
|
|
4472
|
+
callbacks$a.push(callback);
|
|
4473
|
+
return () => dispose$a(callback);
|
|
4311
4474
|
};
|
|
4312
4475
|
|
|
4313
|
-
const callbacks$
|
|
4476
|
+
const callbacks$9 = [];
|
|
4314
4477
|
let mainDisposer$7 = null;
|
|
4315
|
-
const dispose$
|
|
4316
|
-
const index = callbacks$
|
|
4478
|
+
const dispose$9 = (cb) => {
|
|
4479
|
+
const index = callbacks$9.indexOf(cb);
|
|
4317
4480
|
if (index > -1) {
|
|
4318
|
-
callbacks$
|
|
4481
|
+
callbacks$9.splice(index, 1);
|
|
4319
4482
|
}
|
|
4320
|
-
if (callbacks$
|
|
4483
|
+
if (callbacks$9.length === 0) {
|
|
4321
4484
|
mainDisposer$7 === null || mainDisposer$7 === void 0 ? void 0 : mainDisposer$7();
|
|
4322
4485
|
}
|
|
4323
4486
|
};
|
|
4324
4487
|
const onChannelSetMuted = (callback) => {
|
|
4325
|
-
if (callbacks$
|
|
4488
|
+
if (callbacks$9.length === 0) {
|
|
4326
4489
|
const client = getActiveClient();
|
|
4327
4490
|
const filter = async (payload) => {
|
|
4328
4491
|
var _a;
|
|
@@ -4337,24 +4500,124 @@ const onChannelSetMuted = (callback) => {
|
|
|
4337
4500
|
payload.channelId,
|
|
4338
4501
|
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
4339
4502
|
if (channel) {
|
|
4340
|
-
callbacks$
|
|
4503
|
+
callbacks$9.forEach(cb => cb(channel));
|
|
4341
4504
|
}
|
|
4342
4505
|
};
|
|
4343
4506
|
mainDisposer$7 = createEventSubscriber(client, 'onChannelMute', 'channel.setMuted', filter);
|
|
4344
4507
|
}
|
|
4508
|
+
callbacks$9.push(callback);
|
|
4509
|
+
return () => dispose$9(callback);
|
|
4510
|
+
};
|
|
4511
|
+
|
|
4512
|
+
const callbacks$8 = [];
|
|
4513
|
+
let mainDisposer$6 = null;
|
|
4514
|
+
const dispose$8 = (cb) => {
|
|
4515
|
+
const index = callbacks$8.indexOf(cb);
|
|
4516
|
+
if (index > -1) {
|
|
4517
|
+
callbacks$8.splice(index, 1);
|
|
4518
|
+
}
|
|
4519
|
+
if (callbacks$8.length === 0) {
|
|
4520
|
+
mainDisposer$6 === null || mainDisposer$6 === void 0 ? void 0 : mainDisposer$6();
|
|
4521
|
+
}
|
|
4522
|
+
};
|
|
4523
|
+
/* begin_public_function
|
|
4524
|
+
id: channel.event.message_pinned
|
|
4525
|
+
*/
|
|
4526
|
+
/**
|
|
4527
|
+
* ```js
|
|
4528
|
+
* import { onChannelMessagePinned } from '@amityco/ts-sdk'
|
|
4529
|
+
* const dispose = onChannelMessagePinned(channel => {
|
|
4530
|
+
* // channel.pinnedMessage is the new pin
|
|
4531
|
+
* })
|
|
4532
|
+
* ```
|
|
4533
|
+
*
|
|
4534
|
+
* Fired when a message is pinned in a channel (the `channel.messagePinned` realtime
|
|
4535
|
+
* event). Pinning a different message while one is already pinned emits a single
|
|
4536
|
+
* `messagePinned` carrying the replacement — treat every payload as a full snapshot.
|
|
4537
|
+
*
|
|
4538
|
+
* The updated channel is written to cache before the callback runs, so
|
|
4539
|
+
* `ChannelRepository.getChannel` observers see `channel.pinnedMessage` change.
|
|
4540
|
+
*
|
|
4541
|
+
* @param callback The function to call when the event was fired
|
|
4542
|
+
* @returns an {@link Amity.Unsubscriber} function to run when willing to stop listening
|
|
4543
|
+
*
|
|
4544
|
+
* @category Channel Events
|
|
4545
|
+
*/
|
|
4546
|
+
const onChannelMessagePinned = (callback) => {
|
|
4547
|
+
if (callbacks$8.length === 0) {
|
|
4548
|
+
const client = getActiveClient();
|
|
4549
|
+
const filter = (payload) => {
|
|
4550
|
+
var _a;
|
|
4551
|
+
const channel = findCachedChannelForPin(payload);
|
|
4552
|
+
if (!channel)
|
|
4553
|
+
return;
|
|
4554
|
+
const updated = updatePinnedMessageCache(channel, (_a = payload.pinnedMessage) !== null && _a !== void 0 ? _a : null, payload.users);
|
|
4555
|
+
callbacks$8.forEach(cb => cb(updated));
|
|
4556
|
+
};
|
|
4557
|
+
mainDisposer$6 = createEventSubscriber(client, 'onChannelMessagePinned', 'channel.messagePinned', filter);
|
|
4558
|
+
}
|
|
4559
|
+
callbacks$8.push(callback);
|
|
4560
|
+
return () => dispose$8(callback);
|
|
4561
|
+
};
|
|
4562
|
+
/* end_public_function */
|
|
4563
|
+
|
|
4564
|
+
const callbacks$7 = [];
|
|
4565
|
+
let mainDisposer$5 = null;
|
|
4566
|
+
const dispose$7 = (cb) => {
|
|
4567
|
+
const index = callbacks$7.indexOf(cb);
|
|
4568
|
+
if (index > -1) {
|
|
4569
|
+
callbacks$7.splice(index, 1);
|
|
4570
|
+
}
|
|
4571
|
+
if (callbacks$7.length === 0) {
|
|
4572
|
+
mainDisposer$5 === null || mainDisposer$5 === void 0 ? void 0 : mainDisposer$5();
|
|
4573
|
+
}
|
|
4574
|
+
};
|
|
4575
|
+
/* begin_public_function
|
|
4576
|
+
id: channel.event.message_unpinned
|
|
4577
|
+
*/
|
|
4578
|
+
/**
|
|
4579
|
+
* ```js
|
|
4580
|
+
* import { onChannelMessageUnpinned } from '@amityco/ts-sdk'
|
|
4581
|
+
* const dispose = onChannelMessageUnpinned(channel => {
|
|
4582
|
+
* // channel.pinnedMessage is now null
|
|
4583
|
+
* })
|
|
4584
|
+
* ```
|
|
4585
|
+
*
|
|
4586
|
+
* Fired when a channel's pinned message is removed (the `channel.messageUnpinned`
|
|
4587
|
+
* realtime event) — either by an explicit unpin or automatically by the server when the
|
|
4588
|
+
* pinned message is deleted or its author is banned from the channel / globally.
|
|
4589
|
+
*
|
|
4590
|
+
* @param callback The function to call when the event was fired
|
|
4591
|
+
* @returns an {@link Amity.Unsubscriber} function to run when willing to stop listening
|
|
4592
|
+
*
|
|
4593
|
+
* @category Channel Events
|
|
4594
|
+
*/
|
|
4595
|
+
const onChannelMessageUnpinned = (callback) => {
|
|
4596
|
+
if (callbacks$7.length === 0) {
|
|
4597
|
+
const client = getActiveClient();
|
|
4598
|
+
const filter = (payload) => {
|
|
4599
|
+
const channel = findCachedChannelForPin(payload);
|
|
4600
|
+
if (!channel)
|
|
4601
|
+
return;
|
|
4602
|
+
const updated = updatePinnedMessageCache(channel, null);
|
|
4603
|
+
callbacks$7.forEach(cb => cb(updated));
|
|
4604
|
+
};
|
|
4605
|
+
mainDisposer$5 = createEventSubscriber(client, 'onChannelMessageUnpinned', 'channel.messageUnpinned', filter);
|
|
4606
|
+
}
|
|
4345
4607
|
callbacks$7.push(callback);
|
|
4346
4608
|
return () => dispose$7(callback);
|
|
4347
4609
|
};
|
|
4610
|
+
/* end_public_function */
|
|
4348
4611
|
|
|
4349
4612
|
const callbacks$6 = [];
|
|
4350
|
-
let mainDisposer$
|
|
4613
|
+
let mainDisposer$4 = null;
|
|
4351
4614
|
const dispose$6 = (cb) => {
|
|
4352
4615
|
const index = callbacks$6.indexOf(cb);
|
|
4353
4616
|
if (index > -1) {
|
|
4354
4617
|
callbacks$6.splice(index, 1);
|
|
4355
4618
|
}
|
|
4356
4619
|
if (callbacks$6.length === 0) {
|
|
4357
|
-
mainDisposer$
|
|
4620
|
+
mainDisposer$4 === null || mainDisposer$4 === void 0 ? void 0 : mainDisposer$4();
|
|
4358
4621
|
}
|
|
4359
4622
|
};
|
|
4360
4623
|
const onChannelMemberAdded = (callback) => {
|
|
@@ -4366,21 +4629,21 @@ const onChannelMemberAdded = (callback) => {
|
|
|
4366
4629
|
ingestInCache(preparedPayload);
|
|
4367
4630
|
callbacks$6.forEach(cb => cb(channels[0], channelUsers.find(cu => cu.membership === 'member')));
|
|
4368
4631
|
};
|
|
4369
|
-
mainDisposer$
|
|
4632
|
+
mainDisposer$4 = createEventSubscriber(client, 'onChannelMemberAdded', 'channel.membersAdded', filter);
|
|
4370
4633
|
}
|
|
4371
4634
|
callbacks$6.push(callback);
|
|
4372
4635
|
return () => dispose$6(callback);
|
|
4373
4636
|
};
|
|
4374
4637
|
|
|
4375
4638
|
const callbacks$5 = [];
|
|
4376
|
-
let mainDisposer$
|
|
4639
|
+
let mainDisposer$3 = null;
|
|
4377
4640
|
const dispose$5 = (cb) => {
|
|
4378
4641
|
const index = callbacks$5.indexOf(cb);
|
|
4379
4642
|
if (index > -1) {
|
|
4380
4643
|
callbacks$5.splice(index, 1);
|
|
4381
4644
|
}
|
|
4382
4645
|
if (callbacks$5.length === 0) {
|
|
4383
|
-
mainDisposer$
|
|
4646
|
+
mainDisposer$3 === null || mainDisposer$3 === void 0 ? void 0 : mainDisposer$3();
|
|
4384
4647
|
}
|
|
4385
4648
|
};
|
|
4386
4649
|
const onChannelMemberRemoved = (callback) => {
|
|
@@ -4392,21 +4655,21 @@ const onChannelMemberRemoved = (callback) => {
|
|
|
4392
4655
|
ingestInCache(preparedPayload);
|
|
4393
4656
|
callbacks$5.forEach(cb => cb(channels[0], channelUsers[0]));
|
|
4394
4657
|
};
|
|
4395
|
-
mainDisposer$
|
|
4658
|
+
mainDisposer$3 = createEventSubscriber(client, 'onChannelMemberRemoved', 'channel.membersRemoved', filter);
|
|
4396
4659
|
}
|
|
4397
4660
|
callbacks$5.push(callback);
|
|
4398
4661
|
return () => dispose$5(callback);
|
|
4399
4662
|
};
|
|
4400
4663
|
|
|
4401
4664
|
const callbacks$4 = [];
|
|
4402
|
-
let mainDisposer$
|
|
4665
|
+
let mainDisposer$2 = null;
|
|
4403
4666
|
const dispose$4 = (cb) => {
|
|
4404
4667
|
const index = callbacks$4.indexOf(cb);
|
|
4405
4668
|
if (index > -1) {
|
|
4406
4669
|
callbacks$4.splice(index, 1);
|
|
4407
4670
|
}
|
|
4408
4671
|
if (callbacks$4.length === 0) {
|
|
4409
|
-
mainDisposer$
|
|
4672
|
+
mainDisposer$2 === null || mainDisposer$2 === void 0 ? void 0 : mainDisposer$2();
|
|
4410
4673
|
}
|
|
4411
4674
|
};
|
|
4412
4675
|
const onChannelMemberBanned = (callback) => {
|
|
@@ -4426,20 +4689,20 @@ const onChannelMemberBanned = (callback) => {
|
|
|
4426
4689
|
ingestInCache(preparedPayload);
|
|
4427
4690
|
callbacks$4.forEach(cb => cb(channels[0], channelUsers.find(cu => cu.membership === 'banned')));
|
|
4428
4691
|
};
|
|
4429
|
-
mainDisposer$
|
|
4692
|
+
mainDisposer$2 = createEventSubscriber(client, 'onChannelMemberBanned', 'channel.banned', filter);
|
|
4430
4693
|
callbacks$4.push(callback);
|
|
4431
4694
|
return () => dispose$4(callback);
|
|
4432
4695
|
};
|
|
4433
4696
|
|
|
4434
4697
|
const callbacks$3 = [];
|
|
4435
|
-
let mainDisposer$
|
|
4698
|
+
let mainDisposer$1 = null;
|
|
4436
4699
|
const dispose$3 = (cb) => {
|
|
4437
4700
|
const index = callbacks$3.indexOf(cb);
|
|
4438
4701
|
if (index > -1) {
|
|
4439
4702
|
callbacks$3.splice(index, 1);
|
|
4440
4703
|
}
|
|
4441
4704
|
if (callbacks$3.length === 0) {
|
|
4442
|
-
mainDisposer$
|
|
4705
|
+
mainDisposer$1 === null || mainDisposer$1 === void 0 ? void 0 : mainDisposer$1();
|
|
4443
4706
|
}
|
|
4444
4707
|
};
|
|
4445
4708
|
const onChannelMemberUnbanned = (callback) => {
|
|
@@ -4451,59 +4714,127 @@ const onChannelMemberUnbanned = (callback) => {
|
|
|
4451
4714
|
ingestInCache(preparedPayload);
|
|
4452
4715
|
callbacks$3.forEach(cb => cb(channels[0], channelUsers.find(cu => cu.membership === 'none')));
|
|
4453
4716
|
};
|
|
4454
|
-
mainDisposer$
|
|
4717
|
+
mainDisposer$1 = createEventSubscriber(client, 'onChannelMemberUnbanned', 'channel.unbanned', filter);
|
|
4455
4718
|
}
|
|
4456
4719
|
callbacks$3.push(callback);
|
|
4457
4720
|
return () => dispose$3(callback);
|
|
4458
4721
|
};
|
|
4459
4722
|
|
|
4460
4723
|
const callbacks$2 = [];
|
|
4461
|
-
|
|
4724
|
+
const mainDisposers$1 = [];
|
|
4462
4725
|
const dispose$2 = (cb) => {
|
|
4463
4726
|
const index = callbacks$2.indexOf(cb);
|
|
4464
4727
|
if (index > -1) {
|
|
4465
4728
|
callbacks$2.splice(index, 1);
|
|
4466
4729
|
}
|
|
4467
4730
|
if (callbacks$2.length === 0) {
|
|
4468
|
-
|
|
4731
|
+
mainDisposers$1.forEach(fn => fn());
|
|
4732
|
+
mainDisposers$1.length = 0;
|
|
4469
4733
|
}
|
|
4470
4734
|
};
|
|
4735
|
+
/* begin_public_function
|
|
4736
|
+
id: channel.event.member_role_added
|
|
4737
|
+
*/
|
|
4738
|
+
/**
|
|
4739
|
+
* ```js
|
|
4740
|
+
* import { onChannelMemberRoleAdded } from '@amityco/ts-sdk'
|
|
4741
|
+
* const dispose = onChannelMemberRoleAdded((channel, member) => {
|
|
4742
|
+
* // member.roles and member.permissions are the member's resulting state
|
|
4743
|
+
* })
|
|
4744
|
+
* ```
|
|
4745
|
+
*
|
|
4746
|
+
* Fired when a role is added to a member of a {@link Amity.Channel}, either by the
|
|
4747
|
+
* local `ChannelRepository.Moderation.addRole` call or by the `channel.roleAdded` realtime
|
|
4748
|
+
* event coming from any client or the admin console.
|
|
4749
|
+
*
|
|
4750
|
+
* The realtime event reaches every subscriber of the channel topic (see `getChannelTopic`),
|
|
4751
|
+
* not only the actor or the affected members. It carries the affected members' resulting
|
|
4752
|
+
* channel roles and channel-scoped permissions, which are written to cache before the
|
|
4753
|
+
* callback runs. The callback is invoked once per affected member already held in cache.
|
|
4754
|
+
*
|
|
4755
|
+
* @param callback The function to call when the event was fired
|
|
4756
|
+
* @returns an {@link Amity.Unsubscriber} function to run when willing to stop listening
|
|
4757
|
+
*
|
|
4758
|
+
* @category Channel Events
|
|
4759
|
+
*/
|
|
4471
4760
|
const onChannelMemberRoleAdded = (callback) => {
|
|
4472
4761
|
if (callbacks$2.length === 0) {
|
|
4473
4762
|
const client = getActiveClient();
|
|
4474
|
-
const
|
|
4763
|
+
const onLocal = async (payload) => {
|
|
4475
4764
|
const { channels, channelUsers } = payload;
|
|
4476
4765
|
callbacks$2.forEach(cb => cb(channels[0], channelUsers.find(channelUser => channelUser.membership === 'member')));
|
|
4477
4766
|
};
|
|
4478
|
-
|
|
4767
|
+
const onRealtime = (payload) => {
|
|
4768
|
+
const { channel, members } = applyChannelRolePayload(payload);
|
|
4769
|
+
if (!channel)
|
|
4770
|
+
return;
|
|
4771
|
+
members.forEach(member => callbacks$2.forEach(cb => cb(channel, member)));
|
|
4772
|
+
};
|
|
4773
|
+
mainDisposers$1.push(createEventSubscriber(client, 'onChannelMemberRoleAdded', 'local.channel-moderator.role-added', onLocal));
|
|
4774
|
+
mainDisposers$1.push(createEventSubscriber(client, 'onChannelMemberRoleAdded', 'channel.roleAdded', onRealtime));
|
|
4479
4775
|
}
|
|
4480
4776
|
callbacks$2.push(callback);
|
|
4481
4777
|
return () => dispose$2(callback);
|
|
4482
4778
|
};
|
|
4779
|
+
/* end_public_function */
|
|
4483
4780
|
|
|
4484
4781
|
const callbacks$1 = [];
|
|
4485
|
-
|
|
4782
|
+
const mainDisposers = [];
|
|
4486
4783
|
const dispose$1 = (cb) => {
|
|
4487
4784
|
const index = callbacks$1.indexOf(cb);
|
|
4488
4785
|
if (index > -1) {
|
|
4489
4786
|
callbacks$1.splice(index, 1);
|
|
4490
4787
|
}
|
|
4491
4788
|
if (callbacks$1.length === 0) {
|
|
4492
|
-
|
|
4789
|
+
mainDisposers.forEach(fn => fn());
|
|
4790
|
+
mainDisposers.length = 0;
|
|
4493
4791
|
}
|
|
4494
4792
|
};
|
|
4793
|
+
/* begin_public_function
|
|
4794
|
+
id: channel.event.member_role_removed
|
|
4795
|
+
*/
|
|
4796
|
+
/**
|
|
4797
|
+
* ```js
|
|
4798
|
+
* import { onChannelMemberRoleRemoved } from '@amityco/ts-sdk'
|
|
4799
|
+
* const dispose = onChannelMemberRoleRemoved((channel, member) => {
|
|
4800
|
+
* // member.roles and member.permissions are the member's resulting state
|
|
4801
|
+
* })
|
|
4802
|
+
* ```
|
|
4803
|
+
*
|
|
4804
|
+
* Fired when a role is removed from a member of a {@link Amity.Channel}, either by the
|
|
4805
|
+
* local `ChannelRepository.Moderation.removeRole` call or by the `channel.roleRemoved` realtime
|
|
4806
|
+
* event coming from any client or the admin console.
|
|
4807
|
+
*
|
|
4808
|
+
* The realtime event reaches every subscriber of the channel topic (see `getChannelTopic`),
|
|
4809
|
+
* not only the actor or the affected members. It carries the affected members' resulting
|
|
4810
|
+
* channel roles and channel-scoped permissions, which are written to cache before the
|
|
4811
|
+
* callback runs. The callback is invoked once per affected member already held in cache.
|
|
4812
|
+
*
|
|
4813
|
+
* @param callback The function to call when the event was fired
|
|
4814
|
+
* @returns an {@link Amity.Unsubscriber} function to run when willing to stop listening
|
|
4815
|
+
*
|
|
4816
|
+
* @category Channel Events
|
|
4817
|
+
*/
|
|
4495
4818
|
const onChannelMemberRoleRemoved = (callback) => {
|
|
4496
4819
|
if (callbacks$1.length === 0) {
|
|
4497
4820
|
const client = getActiveClient();
|
|
4498
|
-
const
|
|
4821
|
+
const onLocal = async (payload) => {
|
|
4499
4822
|
const { channels, channelUsers } = payload;
|
|
4500
4823
|
callbacks$1.forEach(cb => cb(channels[0], channelUsers.find(channelUser => channelUser.membership === 'member')));
|
|
4501
4824
|
};
|
|
4502
|
-
|
|
4825
|
+
const onRealtime = (payload) => {
|
|
4826
|
+
const { channel, members } = applyChannelRolePayload(payload);
|
|
4827
|
+
if (!channel)
|
|
4828
|
+
return;
|
|
4829
|
+
members.forEach(member => callbacks$1.forEach(cb => cb(channel, member)));
|
|
4830
|
+
};
|
|
4831
|
+
mainDisposers.push(createEventSubscriber(client, 'onChannelMemberRoleRemoved', 'local.channel-moderator.role-removed', onLocal));
|
|
4832
|
+
mainDisposers.push(createEventSubscriber(client, 'onChannelMemberRoleRemoved', 'channel.roleRemoved', onRealtime));
|
|
4503
4833
|
}
|
|
4504
4834
|
callbacks$1.push(callback);
|
|
4505
4835
|
return () => dispose$1(callback);
|
|
4506
4836
|
};
|
|
4837
|
+
/* end_public_function */
|
|
4507
4838
|
|
|
4508
4839
|
/**
|
|
4509
4840
|
* Fired when a {@link Amity.Channel} has been archived by the active user.
|
|
@@ -4578,6 +4909,9 @@ const onChannelSetUserMuted = (callback) => {
|
|
|
4578
4909
|
return () => dispose(callback);
|
|
4579
4910
|
};
|
|
4580
4911
|
|
|
4912
|
+
/* begin_public_function
|
|
4913
|
+
id: channel.get-my-membership
|
|
4914
|
+
*/
|
|
4581
4915
|
const getMyMembership = (channelId, callback) => {
|
|
4582
4916
|
const { _id: userId } = getActiveUser();
|
|
4583
4917
|
if (!userId)
|
|
@@ -4627,6 +4961,8 @@ const getMyMembership = (channelId, callback) => {
|
|
|
4627
4961
|
disposers.push(onChannelMemberBanned(realtimeRouter));
|
|
4628
4962
|
disposers.push(onChannelMemberUnbanned(realtimeRouter));
|
|
4629
4963
|
disposers.push(onChannelSetUserMuted(realtimeRouter));
|
|
4964
|
+
disposers.push(onChannelMemberRoleAdded(realtimeRouter));
|
|
4965
|
+
disposers.push(onChannelMemberRoleRemoved(realtimeRouter));
|
|
4630
4966
|
onFetch();
|
|
4631
4967
|
return () => {
|
|
4632
4968
|
disposers.forEach(fn => fn());
|
|
@@ -5020,7 +5356,9 @@ const initializeMessagePreviewSetting = async () => {
|
|
|
5020
5356
|
const getSocialSettings = async () => {
|
|
5021
5357
|
const client = getActiveClient();
|
|
5022
5358
|
const { data } = await client.http.get(`/api/v3/network-settings/social`);
|
|
5023
|
-
return data.socialNetworkSetting
|
|
5359
|
+
return Object.assign(Object.assign({}, data.socialNetworkSetting), {
|
|
5360
|
+
// Networks that never set the comment edit switch allow the edit
|
|
5361
|
+
isAllowEditCommentWhenReviewingEnabled: data.socialNetworkSetting.isAllowEditCommentWhenReviewingEnabled });
|
|
5024
5362
|
};
|
|
5025
5363
|
|
|
5026
5364
|
/**
|
|
@@ -5706,6 +6044,32 @@ class AnalyticsEventCapturer {
|
|
|
5706
6044
|
activityType: "view" /* Amity.AnalyticEventActivityType.View */,
|
|
5707
6045
|
});
|
|
5708
6046
|
}
|
|
6047
|
+
markCuratedContentWidgetAsViewed(topicId) {
|
|
6048
|
+
this.markAs({
|
|
6049
|
+
uniqueId: `curatedContentWidget.${topicId}`,
|
|
6050
|
+
contentId: topicId,
|
|
6051
|
+
contentType: "curated_content_widget" /* Amity.AnalyticEventContentType.CuratedContentWidget */,
|
|
6052
|
+
activityType: "view" /* Amity.AnalyticEventActivityType.View */,
|
|
6053
|
+
});
|
|
6054
|
+
}
|
|
6055
|
+
markCuratedContentPostAsViewed(postId, topicId) {
|
|
6056
|
+
this.markAs({
|
|
6057
|
+
uniqueId: `curatedContentPost.${postId}.view`,
|
|
6058
|
+
contentId: postId,
|
|
6059
|
+
contentType: "curated_content_post" /* Amity.AnalyticEventContentType.CuratedContentPost */,
|
|
6060
|
+
activityType: "view" /* Amity.AnalyticEventActivityType.View */,
|
|
6061
|
+
metadata: { topicId },
|
|
6062
|
+
});
|
|
6063
|
+
}
|
|
6064
|
+
markCuratedContentPostAsClicked(postId, topicId) {
|
|
6065
|
+
this.markAs({
|
|
6066
|
+
uniqueId: `curatedContentPost.${postId}.click`,
|
|
6067
|
+
contentId: postId,
|
|
6068
|
+
contentType: "curated_content_post" /* Amity.AnalyticEventContentType.CuratedContentPost */,
|
|
6069
|
+
activityType: "linkClicked" /* Amity.AnalyticEventActivityType.Click */,
|
|
6070
|
+
metadata: { topicId },
|
|
6071
|
+
});
|
|
6072
|
+
}
|
|
5709
6073
|
markPostAsMeaningfullyViewed(postId, feedRenderPosition) {
|
|
5710
6074
|
var _a;
|
|
5711
6075
|
const cached = (_a = pullFromCache(['feedMetadata', 'get', postId])) === null || _a === void 0 ? void 0 : _a.data;
|
|
@@ -5869,6 +6233,24 @@ class AnalyticsEngine {
|
|
|
5869
6233
|
this._eventCapturer.markPostAsViewed(postId);
|
|
5870
6234
|
}
|
|
5871
6235
|
}
|
|
6236
|
+
markCuratedContentWidgetAsViewed(topicId) {
|
|
6237
|
+
if (this._client.sessionState === "established" /* Amity.SessionStates.ESTABLISHED */ ||
|
|
6238
|
+
this._client.sessionState === "tokenExpired" /* Amity.SessionStates.TOKEN_EXPIRED */) {
|
|
6239
|
+
this._eventCapturer.markCuratedContentWidgetAsViewed(topicId);
|
|
6240
|
+
}
|
|
6241
|
+
}
|
|
6242
|
+
markCuratedContentPostAsViewed(postId, topicId) {
|
|
6243
|
+
if (this._client.sessionState === "established" /* Amity.SessionStates.ESTABLISHED */ ||
|
|
6244
|
+
this._client.sessionState === "tokenExpired" /* Amity.SessionStates.TOKEN_EXPIRED */) {
|
|
6245
|
+
this._eventCapturer.markCuratedContentPostAsViewed(postId, topicId);
|
|
6246
|
+
}
|
|
6247
|
+
}
|
|
6248
|
+
markCuratedContentPostAsClicked(postId, topicId) {
|
|
6249
|
+
if (this._client.sessionState === "established" /* Amity.SessionStates.ESTABLISHED */ ||
|
|
6250
|
+
this._client.sessionState === "tokenExpired" /* Amity.SessionStates.TOKEN_EXPIRED */) {
|
|
6251
|
+
this._eventCapturer.markCuratedContentPostAsClicked(postId, topicId);
|
|
6252
|
+
}
|
|
6253
|
+
}
|
|
5872
6254
|
markPostAsMeaningfullyViewed(postId, feedRenderPosition) {
|
|
5873
6255
|
if (this._client.sessionState === "established" /* Amity.SessionStates.ESTABLISHED */ ||
|
|
5874
6256
|
this._client.sessionState === "tokenExpired" /* Amity.SessionStates.TOKEN_EXPIRED */) {
|
|
@@ -7265,6 +7647,265 @@ class CursorController {
|
|
|
7265
7647
|
}
|
|
7266
7648
|
}
|
|
7267
7649
|
|
|
7650
|
+
class ResetTask {
|
|
7651
|
+
constructor(postId, latestCreatedAt, serverCommentCount) {
|
|
7652
|
+
this.postId = postId;
|
|
7653
|
+
this.latestCreatedAt = latestCreatedAt;
|
|
7654
|
+
this.serverCommentCount = serverCommentCount;
|
|
7655
|
+
}
|
|
7656
|
+
}
|
|
7657
|
+
|
|
7658
|
+
// Task to track comment creation
|
|
7659
|
+
class CreateTask {
|
|
7660
|
+
constructor(postId, commentId, createdAt) {
|
|
7661
|
+
this.postId = postId;
|
|
7662
|
+
this.commentId = commentId;
|
|
7663
|
+
this.createdAt = createdAt;
|
|
7664
|
+
}
|
|
7665
|
+
}
|
|
7666
|
+
|
|
7667
|
+
/**
|
|
7668
|
+
* A pending comment was approved and now counts publicly. Unlike `CreateTask` it carries no
|
|
7669
|
+
* `createdAt` and bypasses the age guard on purpose: the comment was written before the last post
|
|
7670
|
+
* payload (so its `createdAt` is old) but entered the server count only now. Same rule as iOS.
|
|
7671
|
+
*
|
|
7672
|
+
* Accepted trade-off (plan 40 §9): if a `ResetTask` that already includes this comment lands
|
|
7673
|
+
* between the approve response and the late `comment.approved` event, the count reads +1 until
|
|
7674
|
+
* the next server sync — the same self-correcting drift accepted for stale deletes.
|
|
7675
|
+
*/
|
|
7676
|
+
class ApproveTask {
|
|
7677
|
+
constructor(postId, commentId) {
|
|
7678
|
+
this.postId = postId;
|
|
7679
|
+
this.commentId = commentId;
|
|
7680
|
+
}
|
|
7681
|
+
}
|
|
7682
|
+
|
|
7683
|
+
// Task to track comment deletion
|
|
7684
|
+
class DeleteTask {
|
|
7685
|
+
constructor(postId, commentId) {
|
|
7686
|
+
this.postId = postId;
|
|
7687
|
+
this.commentId = commentId;
|
|
7688
|
+
}
|
|
7689
|
+
}
|
|
7690
|
+
|
|
7691
|
+
class CommentChange {
|
|
7692
|
+
constructor(latestCreatedAt, serverCommentCount) {
|
|
7693
|
+
this.latestCommentCreatedAt = latestCreatedAt;
|
|
7694
|
+
this.serverCommentCount = serverCommentCount;
|
|
7695
|
+
this.createdCommentIds = new Set();
|
|
7696
|
+
this.deletedCommentIds = new Set();
|
|
7697
|
+
}
|
|
7698
|
+
}
|
|
7699
|
+
|
|
7700
|
+
class PostCommentCountEngine {
|
|
7701
|
+
constructor() {
|
|
7702
|
+
this.isProcessing = false;
|
|
7703
|
+
this.tasks = [];
|
|
7704
|
+
this.commentChangeTracker = new Map();
|
|
7705
|
+
// Ids of the LOGGED-IN USER's own pending comments, per post. Survives ResetTask, so the
|
|
7706
|
+
// author's +1 does not vanish on the next post refresh; emptied only when the comment leaves
|
|
7707
|
+
// the pending state (approval hands it to createdCommentIds, decline/delete drops it).
|
|
7708
|
+
this.pendingAuthoredCommentIds = new Map();
|
|
7709
|
+
}
|
|
7710
|
+
queueCommentChangeTask(task) {
|
|
7711
|
+
this.tasks.push(task);
|
|
7712
|
+
if (!this.isProcessing) {
|
|
7713
|
+
this.processCommentChangeTask();
|
|
7714
|
+
}
|
|
7715
|
+
}
|
|
7716
|
+
addPendingAuthoredComment(postId, commentId, { publish = true } = {}) {
|
|
7717
|
+
var _a;
|
|
7718
|
+
const ids = (_a = this.pendingAuthoredCommentIds.get(postId)) !== null && _a !== void 0 ? _a : new Set();
|
|
7719
|
+
if (ids.has(commentId))
|
|
7720
|
+
return;
|
|
7721
|
+
ids.add(commentId);
|
|
7722
|
+
this.pendingAuthoredCommentIds.set(postId, ids);
|
|
7723
|
+
if (publish)
|
|
7724
|
+
this.publishIfTracked(postId);
|
|
7725
|
+
}
|
|
7726
|
+
removePendingAuthoredComment(postId, commentId, { publish = true } = {}) {
|
|
7727
|
+
const ids = this.pendingAuthoredCommentIds.get(postId);
|
|
7728
|
+
if (!(ids === null || ids === void 0 ? void 0 : ids.delete(commentId)))
|
|
7729
|
+
return false;
|
|
7730
|
+
if (ids.size === 0)
|
|
7731
|
+
this.pendingAuthoredCommentIds.delete(postId);
|
|
7732
|
+
if (publish)
|
|
7733
|
+
this.publishIfTracked(postId);
|
|
7734
|
+
return true;
|
|
7735
|
+
}
|
|
7736
|
+
/** Whether a post payload has seeded this post; without one every count is `0`. */
|
|
7737
|
+
hasTracker(postId) {
|
|
7738
|
+
return this.commentChangeTracker.has(postId);
|
|
7739
|
+
}
|
|
7740
|
+
isPendingAuthoredComment(postId, commentId) {
|
|
7741
|
+
var _a, _b;
|
|
7742
|
+
return (_b = (_a = this.pendingAuthoredCommentIds.get(postId)) === null || _a === void 0 ? void 0 : _a.has(commentId)) !== null && _b !== void 0 ? _b : false;
|
|
7743
|
+
}
|
|
7744
|
+
// Drops every per-post state. Called on logout / user switch.
|
|
7745
|
+
reset() {
|
|
7746
|
+
this.tasks = [];
|
|
7747
|
+
this.commentChangeTracker.clear();
|
|
7748
|
+
this.pendingAuthoredCommentIds.clear();
|
|
7749
|
+
}
|
|
7750
|
+
publishIfTracked(postId) {
|
|
7751
|
+
// Without a tracker there is no server figure to add to; the next ResetTask picks it up.
|
|
7752
|
+
if (!this.commentChangeTracker.has(postId))
|
|
7753
|
+
return;
|
|
7754
|
+
PostCommentCountEngine.publishUpdate(postId, this.getLocalCommentCount(postId, true));
|
|
7755
|
+
}
|
|
7756
|
+
processCommentChangeTask() {
|
|
7757
|
+
if (this.isProcessing) {
|
|
7758
|
+
return;
|
|
7759
|
+
}
|
|
7760
|
+
this.isProcessing = true;
|
|
7761
|
+
if (this.tasks.length === 0) {
|
|
7762
|
+
this.isProcessing = false;
|
|
7763
|
+
return;
|
|
7764
|
+
}
|
|
7765
|
+
// Process in capped batches, coalescing updates
|
|
7766
|
+
const batch = this.tasks.splice(0, PostCommentCountEngine.BATCH_SIZE);
|
|
7767
|
+
const modifiedPostIds = new Set();
|
|
7768
|
+
batch.forEach(task => {
|
|
7769
|
+
let modified = false;
|
|
7770
|
+
if (task instanceof ResetTask) {
|
|
7771
|
+
modified = this.processResetTaskInternal(task);
|
|
7772
|
+
}
|
|
7773
|
+
else if (task instanceof CreateTask) {
|
|
7774
|
+
modified = this.processCreateTaskInternal(task);
|
|
7775
|
+
}
|
|
7776
|
+
else if (task instanceof ApproveTask) {
|
|
7777
|
+
modified = this.processApproveTaskInternal(task);
|
|
7778
|
+
}
|
|
7779
|
+
else if (task instanceof DeleteTask) {
|
|
7780
|
+
modified = this.processDeleteTaskInternal(task);
|
|
7781
|
+
}
|
|
7782
|
+
if (modified) {
|
|
7783
|
+
modifiedPostIds.add(task.postId);
|
|
7784
|
+
}
|
|
7785
|
+
});
|
|
7786
|
+
// Publish one update per modified post
|
|
7787
|
+
modifiedPostIds.forEach(postId => {
|
|
7788
|
+
PostCommentCountEngine.publishUpdate(postId, this.getLocalCommentCount(postId, true));
|
|
7789
|
+
});
|
|
7790
|
+
this.isProcessing = false;
|
|
7791
|
+
// Recurse if more tasks remain
|
|
7792
|
+
if (this.tasks.length > 0) {
|
|
7793
|
+
this.processCommentChangeTask();
|
|
7794
|
+
}
|
|
7795
|
+
}
|
|
7796
|
+
processResetTaskInternal(task) {
|
|
7797
|
+
// Always creates/overwrites tracker
|
|
7798
|
+
this.commentChangeTracker.set(task.postId, new CommentChange(task.latestCreatedAt, task.serverCommentCount));
|
|
7799
|
+
return true;
|
|
7800
|
+
}
|
|
7801
|
+
processCreateTaskInternal(task) {
|
|
7802
|
+
// The comment is public now: the author-local +1 hands over to the normal path, so the
|
|
7803
|
+
// count stays put instead of moving twice.
|
|
7804
|
+
const wasPendingAuthored = this.removePendingAuthoredComment(task.postId, task.commentId, {
|
|
7805
|
+
publish: false,
|
|
7806
|
+
});
|
|
7807
|
+
const tracker = this.commentChangeTracker.get(task.postId);
|
|
7808
|
+
if (!tracker)
|
|
7809
|
+
return false; // No tracker, skip
|
|
7810
|
+
if (tracker.deletedCommentIds.delete(task.commentId))
|
|
7811
|
+
return true; // Re-approval cancels the earlier removal
|
|
7812
|
+
if (tracker.createdCommentIds.has(task.commentId))
|
|
7813
|
+
return wasPendingAuthored; // Deduplication
|
|
7814
|
+
if (task.createdAt <= tracker.latestCommentCreatedAt)
|
|
7815
|
+
return wasPendingAuthored; // Timestamp filtering
|
|
7816
|
+
tracker.createdCommentIds.add(task.commentId);
|
|
7817
|
+
return true;
|
|
7818
|
+
}
|
|
7819
|
+
processApproveTaskInternal(task) {
|
|
7820
|
+
// The comment is public now: the author-local +1 hands over to the normal path, so the
|
|
7821
|
+
// count stays put instead of moving twice.
|
|
7822
|
+
const wasPendingAuthored = this.removePendingAuthoredComment(task.postId, task.commentId, {
|
|
7823
|
+
publish: false,
|
|
7824
|
+
});
|
|
7825
|
+
const tracker = this.commentChangeTracker.get(task.postId);
|
|
7826
|
+
if (!tracker)
|
|
7827
|
+
return false; // No tracker, skip
|
|
7828
|
+
if (tracker.deletedCommentIds.delete(task.commentId))
|
|
7829
|
+
return true; // Re-approval cancels the earlier re-review removal
|
|
7830
|
+
if (tracker.createdCommentIds.has(task.commentId))
|
|
7831
|
+
return wasPendingAuthored; // Approve response and comment.approved event dedupe by id
|
|
7832
|
+
// No timestamp filtering: approval is the moment the comment enters the count, not createdAt
|
|
7833
|
+
tracker.createdCommentIds.add(task.commentId);
|
|
7834
|
+
return true;
|
|
7835
|
+
}
|
|
7836
|
+
processDeleteTaskInternal(task) {
|
|
7837
|
+
const tracker = this.commentChangeTracker.get(task.postId);
|
|
7838
|
+
if (!tracker)
|
|
7839
|
+
return false; // No tracker, skip
|
|
7840
|
+
if (tracker.deletedCommentIds.has(task.commentId))
|
|
7841
|
+
return false; // Deduplication
|
|
7842
|
+
tracker.deletedCommentIds.add(task.commentId);
|
|
7843
|
+
return true;
|
|
7844
|
+
}
|
|
7845
|
+
/**
|
|
7846
|
+
* The count as this session sees it: the last server figure plus the local delta.
|
|
7847
|
+
*
|
|
7848
|
+
* `includePending` adds the logged-in user's own pending comments — the author's view. A
|
|
7849
|
+
* pending id is added only while the public delta does not already count it, so a comment
|
|
7850
|
+
* present in both sets counts once: a `comment.created` that arrives pending after the
|
|
7851
|
+
* `comment.approved` hand-over adds nothing, while an approved comment sent back to review
|
|
7852
|
+
* (created, deleted and pending all hold its id) keeps the author's +1.
|
|
7853
|
+
*
|
|
7854
|
+
* `0` for a post no payload has seeded yet; callers fall back to the post's own figure.
|
|
7855
|
+
*/
|
|
7856
|
+
getLocalCommentCount(postId, includePending = false) {
|
|
7857
|
+
var _a;
|
|
7858
|
+
const tracker = this.commentChangeTracker.get(postId);
|
|
7859
|
+
if (!tracker)
|
|
7860
|
+
return 0;
|
|
7861
|
+
const publicDelta = tracker.createdCommentIds.size - tracker.deletedCommentIds.size;
|
|
7862
|
+
if (!includePending)
|
|
7863
|
+
return Math.max(0, tracker.serverCommentCount + publicDelta);
|
|
7864
|
+
let pendingExtra = 0;
|
|
7865
|
+
(_a = this.pendingAuthoredCommentIds.get(postId)) === null || _a === void 0 ? void 0 : _a.forEach(commentId => {
|
|
7866
|
+
const countedPublicly = tracker.createdCommentIds.has(commentId) && !tracker.deletedCommentIds.has(commentId);
|
|
7867
|
+
if (!countedPublicly)
|
|
7868
|
+
pendingExtra += 1;
|
|
7869
|
+
});
|
|
7870
|
+
return Math.max(0, tracker.serverCommentCount + publicDelta + pendingExtra);
|
|
7871
|
+
}
|
|
7872
|
+
static publishUpdate(postId, newCount) {
|
|
7873
|
+
var _a;
|
|
7874
|
+
const queryKey = ['post', 'get', postId];
|
|
7875
|
+
mergeInCache(queryKey, {
|
|
7876
|
+
localCommentCount: newCount,
|
|
7877
|
+
});
|
|
7878
|
+
const postPayload = (_a = pullFromCache(queryKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
7879
|
+
if (!postPayload)
|
|
7880
|
+
return;
|
|
7881
|
+
fireEvent('local.post.updated', {
|
|
7882
|
+
posts: [postPayload],
|
|
7883
|
+
});
|
|
7884
|
+
}
|
|
7885
|
+
}
|
|
7886
|
+
PostCommentCountEngine.BATCH_SIZE = 50;
|
|
7887
|
+
let instance$1;
|
|
7888
|
+
var PostCommentCountEngine$1 = {
|
|
7889
|
+
getInstance: () => {
|
|
7890
|
+
if (!instance$1) {
|
|
7891
|
+
instance$1 = new PostCommentCountEngine();
|
|
7892
|
+
}
|
|
7893
|
+
return instance$1;
|
|
7894
|
+
},
|
|
7895
|
+
};
|
|
7896
|
+
|
|
7897
|
+
/**
|
|
7898
|
+
* Comment-count state is per user — in particular the ids of the logged-in user's own pending
|
|
7899
|
+
* comments — so it must not survive a logout or a user switch.
|
|
7900
|
+
*
|
|
7901
|
+
* @category private
|
|
7902
|
+
*/
|
|
7903
|
+
const postCommentCountEngineOnLoginHandler = () => onSessionStateChange(state => {
|
|
7904
|
+
if (state === "notLoggedIn" /* Amity.SessionStates.NOT_LOGGED_IN */ || state === "terminated" /* Amity.SessionStates.TERMINATED */) {
|
|
7905
|
+
PostCommentCountEngine$1.getInstance().reset();
|
|
7906
|
+
}
|
|
7907
|
+
});
|
|
7908
|
+
|
|
7268
7909
|
const EVENTS = [
|
|
7269
7910
|
'disconnected',
|
|
7270
7911
|
'error',
|
|
@@ -7371,10 +8012,14 @@ const onNetworkActivities = (callback) => NetworkActivitiesWatcher$1.getInstance
|
|
|
7371
8012
|
*
|
|
7372
8013
|
* @category Client Events
|
|
7373
8014
|
*/
|
|
8015
|
+
/* begin_public_function
|
|
8016
|
+
id: core.onVisitorUsageLimitReached
|
|
8017
|
+
*/
|
|
7374
8018
|
const onVisitorUsageLimitReached = (callback) => {
|
|
7375
8019
|
const client = getActiveClient();
|
|
7376
8020
|
return createEventSubscriber(client, 'client/onVisitorUsageLimitReached', 'visitorUsageLimitReached', callback);
|
|
7377
8021
|
};
|
|
8022
|
+
/* end_public_function */
|
|
7378
8023
|
|
|
7379
8024
|
/**
|
|
7380
8025
|
* ```js
|
|
@@ -7454,7 +8099,7 @@ const setupLoginSubscriptions = (unsubWatcher) => {
|
|
|
7454
8099
|
// NOTE: This is a temporary solution to handle the channel marker when the user is forced to leave
|
|
7455
8100
|
// the channel because currently backend can't handle this, so every time a user is banned from
|
|
7456
8101
|
// a channel or the channel is deleted the channel's unread count will not be reset to zero
|
|
7457
|
-
onChannelDeleted(removeChannelMarkerCache), onChannelMemberBanned(removeChannelMarkerCache), markReadEngineOnLoginHandler(), analyticsEngineOnLoginHandler(), objectResolverEngineOnLoginHandler(), reactionSyncEngineOnLoginHandler(), blockedUserSyncEngineOnLoginHandler(), blockingUserSyncEngineOnLoginHandler(), blockRealtimeOnLoginHandler(), resetAutoSubscriptionsOnLogout(), CursorController.clearOnLogout());
|
|
8102
|
+
onChannelDeleted(removeChannelMarkerCache), onChannelMemberBanned(removeChannelMarkerCache), markReadEngineOnLoginHandler(), analyticsEngineOnLoginHandler(), objectResolverEngineOnLoginHandler(), reactionSyncEngineOnLoginHandler(), blockedUserSyncEngineOnLoginHandler(), blockingUserSyncEngineOnLoginHandler(), blockRealtimeOnLoginHandler(), resetAutoSubscriptionsOnLogout(), CursorController.clearOnLogout(), postCommentCountEngineOnLoginHandler());
|
|
7458
8103
|
if (client.useLegacyUnreadCount) {
|
|
7459
8104
|
subscriptions.push(readReceiptSyncEngineOnLoginHandler());
|
|
7460
8105
|
}
|
|
@@ -8490,7 +9135,7 @@ const DEFAULT_DEBUG_SESSION = 'amity';
|
|
|
8490
9135
|
*
|
|
8491
9136
|
* @category Client API
|
|
8492
9137
|
* */
|
|
8493
|
-
const createClient = (apiKey, apiRegion = API_REGIONS.SG, { debugSession = DEFAULT_DEBUG_SESSION, apiEndpoint, prefixDeviceIdKey, rteEnabled = true, } = {}) => {
|
|
9138
|
+
const createClient = (apiKey, apiRegion = API_REGIONS.SG, { debugSession = DEFAULT_DEBUG_SESSION, apiEndpoint, prefixDeviceIdKey, rteEnabled = true, product, uikitVersion, appId, appVersion, } = {}) => {
|
|
8494
9139
|
var _a, _b, _c;
|
|
8495
9140
|
const log = createLogger(debugSession);
|
|
8496
9141
|
log('client/api/createClient', {
|
|
@@ -8519,6 +9164,10 @@ const createClient = (apiKey, apiRegion = API_REGIONS.SG, { debugSession = DEFAU
|
|
|
8519
9164
|
const useLegacyUnreadCount = true;
|
|
8520
9165
|
const client = {
|
|
8521
9166
|
version: `${VERSION}`,
|
|
9167
|
+
product,
|
|
9168
|
+
uikitVersion,
|
|
9169
|
+
appId,
|
|
9170
|
+
appVersion,
|
|
8522
9171
|
apiKey,
|
|
8523
9172
|
/*
|
|
8524
9173
|
* SDK Components
|
|
@@ -8757,13 +9406,13 @@ class GlobalFileAccessType {
|
|
|
8757
9406
|
}
|
|
8758
9407
|
}
|
|
8759
9408
|
_GlobalFileAccessType_fileAccessType = new WeakMap();
|
|
8760
|
-
let instance
|
|
9409
|
+
let instance;
|
|
8761
9410
|
var GlobalFileAccessType$1 = {
|
|
8762
9411
|
getInstance: () => {
|
|
8763
|
-
if (!instance
|
|
8764
|
-
instance
|
|
9412
|
+
if (!instance) {
|
|
9413
|
+
instance = new GlobalFileAccessType();
|
|
8765
9414
|
}
|
|
8766
|
-
return instance
|
|
9415
|
+
return instance;
|
|
8767
9416
|
},
|
|
8768
9417
|
};
|
|
8769
9418
|
|
|
@@ -8835,6 +9484,9 @@ const CONTENT_TYPE_CONFIG = {
|
|
|
8835
9484
|
* @category Client API
|
|
8836
9485
|
* @async
|
|
8837
9486
|
*/
|
|
9487
|
+
/* begin_public_function
|
|
9488
|
+
id: core_client.getShareableLinkConfiguration
|
|
9489
|
+
*/
|
|
8838
9490
|
const getShareableLinkConfiguration = async () => {
|
|
8839
9491
|
var _a, _b;
|
|
8840
9492
|
const client = getActiveClient();
|
|
@@ -8860,6 +9512,7 @@ const getShareableLinkConfiguration = async () => {
|
|
|
8860
9512
|
},
|
|
8861
9513
|
};
|
|
8862
9514
|
};
|
|
9515
|
+
/* end_public_function */
|
|
8863
9516
|
|
|
8864
9517
|
/**
|
|
8865
9518
|
* Retrieves a pair of {@link Amity.Tokens} necessary for connection
|
|
@@ -9508,6 +10161,9 @@ const removeFunctionProperties = (obj) => {
|
|
|
9508
10161
|
*
|
|
9509
10162
|
* @category Message Live Object
|
|
9510
10163
|
*/
|
|
10164
|
+
/* begin_public_function
|
|
10165
|
+
id: client.get-user-unread
|
|
10166
|
+
*/
|
|
9511
10167
|
const getUserUnread = (callback) => {
|
|
9512
10168
|
const { _id: userId } = getActiveUser();
|
|
9513
10169
|
if (!userId)
|
|
@@ -9600,7 +10256,7 @@ const getUserUnread = (callback) => {
|
|
|
9600
10256
|
};
|
|
9601
10257
|
};
|
|
9602
10258
|
|
|
9603
|
-
var index$
|
|
10259
|
+
var index$t = /*#__PURE__*/Object.freeze({
|
|
9604
10260
|
__proto__: null,
|
|
9605
10261
|
getActiveClient: getActiveClient,
|
|
9606
10262
|
getActiveUser: getActiveUser,
|
|
@@ -10826,7 +11482,7 @@ const getMyFollowInfo = (callback) => {
|
|
|
10826
11482
|
};
|
|
10827
11483
|
/* end_public_function */
|
|
10828
11484
|
|
|
10829
|
-
var index$
|
|
11485
|
+
var index$s = /*#__PURE__*/Object.freeze({
|
|
10830
11486
|
__proto__: null,
|
|
10831
11487
|
blockUser: blockUser,
|
|
10832
11488
|
unBlockUser: unBlockUser,
|
|
@@ -11403,6 +12059,9 @@ class JoinRequestsLiveCollectionController extends LiveCollectionController {
|
|
|
11403
12059
|
* @category joinRequest Live Collection
|
|
11404
12060
|
*
|
|
11405
12061
|
*/
|
|
12062
|
+
/* begin_public_function
|
|
12063
|
+
id: community.get-join-requests
|
|
12064
|
+
*/
|
|
11406
12065
|
const getJoinRequests = (params, callback, config) => {
|
|
11407
12066
|
const { log, cache } = getActiveClient();
|
|
11408
12067
|
if (!cache) {
|
|
@@ -12167,6 +12826,16 @@ const createChannel = async (bundle) => {
|
|
|
12167
12826
|
/* c8 ignore next */
|
|
12168
12827
|
isPublic: (bundle === null || bundle === void 0 ? void 0 : bundle.type) === 'community' ? isPublic : undefined }));
|
|
12169
12828
|
}
|
|
12829
|
+
// Fire the event locally, the same way createCommunity and createPost do.
|
|
12830
|
+
// Without it a running getChannels collection never inserts the new channel:
|
|
12831
|
+
// its query stream controller inserts an id only on OnCreate / OnJoin /
|
|
12832
|
+
// OnResolveChannel / OnUnarchived, and the first sent message arrives as an
|
|
12833
|
+
// OnUpdate, which only re-notifies. Reusing the MQTT event name means the
|
|
12834
|
+
// already-wired onChannelCreated -> OnCreate path does the insert, so the
|
|
12835
|
+
// list updates without a re-query. onChannelCreated re-runs
|
|
12836
|
+
// prepareChannelPayload + ingestInCache itself, so this is idempotent with
|
|
12837
|
+
// the ingest below.
|
|
12838
|
+
fireEvent('channel.created', payload.data);
|
|
12170
12839
|
const data = await prepareChannelPayload(payload.data);
|
|
12171
12840
|
const cachedAt = client.cache && Date.now();
|
|
12172
12841
|
if (client.cache)
|
|
@@ -12338,8 +13007,32 @@ const streamLinkedObject = (stream) => {
|
|
|
12338
13007
|
} });
|
|
12339
13008
|
};
|
|
12340
13009
|
|
|
13010
|
+
const KNOWN_APPROVAL_STATUSES = [
|
|
13011
|
+
"pending" /* Amity.CommentApprovalStatusEnum.Pending */,
|
|
13012
|
+
"approved" /* Amity.CommentApprovalStatusEnum.Approved */,
|
|
13013
|
+
"rejected" /* Amity.CommentApprovalStatusEnum.Rejected */,
|
|
13014
|
+
];
|
|
13015
|
+
/**
|
|
13016
|
+
* The server sends `approvalStatus` only while a comment is held for review or after it was
|
|
13017
|
+
* rejected. Absent, `null`, or an unrecognised value all resolve to `approved` — never to
|
|
13018
|
+
* `pending`, which would mark every comment written before the feature as unpublished.
|
|
13019
|
+
*/
|
|
13020
|
+
const resolveCommentApprovalStatus = (approvalStatus) => {
|
|
13021
|
+
if (approvalStatus && KNOWN_APPROVAL_STATUSES.includes(approvalStatus)) {
|
|
13022
|
+
return approvalStatus;
|
|
13023
|
+
}
|
|
13024
|
+
return "approved" /* Amity.CommentApprovalStatusEnum.Approved */;
|
|
13025
|
+
};
|
|
13026
|
+
const prepareComment = (comment) => (Object.assign(Object.assign(Object.assign({}, (comment.hasOwnProperty('myReactions') ? {} : { myReactions: [] })), comment), { approvalStatus: resolveCommentApprovalStatus(comment.approvalStatus) }));
|
|
13027
|
+
function prepareCommentPayload(commentPayload) {
|
|
13028
|
+
const { comments, commentChildren } = commentPayload;
|
|
13029
|
+
return Object.assign(Object.assign(Object.assign({}, commentPayload), { comments: comments.map(prepareComment) }), (commentChildren ? { commentChildren: commentChildren.map(prepareComment) } : {}));
|
|
13030
|
+
}
|
|
13031
|
+
|
|
12341
13032
|
const commentLinkedObject = (comment) => {
|
|
12342
|
-
return Object.assign(Object.assign({}, comment), {
|
|
13033
|
+
return Object.assign(Object.assign({}, comment), {
|
|
13034
|
+
// Non-optional on the public model: absent on the wire means approved
|
|
13035
|
+
approvalStatus: resolveCommentApprovalStatus(comment.approvalStatus), get target() {
|
|
12343
13036
|
const commentTypes = {
|
|
12344
13037
|
type: comment.targetType,
|
|
12345
13038
|
};
|
|
@@ -12547,7 +13240,7 @@ const getWatchSessionStorage = () => {
|
|
|
12547
13240
|
return storageInstance;
|
|
12548
13241
|
};
|
|
12549
13242
|
|
|
12550
|
-
const privateKey = "
|
|
13243
|
+
const privateKey = "MIIEpQIBAAKCAQEAwAEc/oZgYIvKSUG/C3mONYLR4ZPgAjMEX4bJ+xqqakUDRtqlNO+eZs2blQ1Ko0DBkqPExyQezvjibH5W2UZBV5RaBTlTcNVKTToMBEGesAfaEcM3qUyQHxdbFYZv6P4sb14dcwxTQ8usmaV8ooiR1Fcaso5ZWYcZ8Hb46FbQ7OoVumsBtPWwfZ4f003o5VCl6AIM6lcLv9UDLlFVYhE+PeXpRHtfWlGqxMvqC9oinlwhL6nWv6VjQXW4nhcib72dPBzfHT7k/PMKto2SxALYdb68ENiAGuJLWi3AUHSyYCJK2w7wIlWfJUAI0v26ub10IpExr6D5QuW2577jjP93iwIDAQABAoIBAFWfqXhwIIatkFY+9Z1+ZcbDQimgsmMIsUiQaX6Lk7e0cxOj6czDlxYtVtaPiNtow2pLkjNkjkCqiP7tEHnwdK9DvylZOTa2R15NJpK3WLcTqVIGhsn/FL5owfvFah6zSsmXZParZm5zY9NZE03ALZhOB9/cz0e3kf/EbpfeL2mW7MApyiUt5i09ycchroOpcWp73ipIxvgigtZyUGFmsQicWhUs28F0D7w4Qfk76yG3nqXeb+BAMhCaIaa/k/aAxhiZG/ygEQWQrcC8gfe+jyicMAQPDEVS9YuUMGsLjIjKuVLZzp2xirQnhc2i2zVNEIvG6soprPOBEMQugzrtX5ECgYEA3b7KAbBIbDl1e4ZSCWhHdHkiWVZHaopsR/LhqDDNhXjWjq3AesgV6k0j9EdziMn/HmmOso0bz99GTV3JZf4A9ztTLumJlkHbdVtlgOqSjrFLj12rH9KXTheyIhWSpUmm8+WB1xasFbqpvJaGo7F3pd2Fqj1XR4mp5BO7c/t7LJ0CgYEA3aouEzXQ9THRKYocdfY69EI1Il1t/d/RSqqd9BxEjxBgxkM13ZiYIn/R4WW/nCUrlmhxG44Aa2Gob4Ahfsui2xKTg/g/3Zk/rAxAEGkfOLGoenaJMD41fH4wUq3FRYwkvnaMb9Hd6f/TlBHslIRa2NN58bSBGJCyBP2b59+2+EcCgYEAixDVRXvV37GlYUOa/XVdosk5Zoe6oDGRuQm0xbNdoUBoZvDHDvme7ONWEiQha/8qtVsD+CyQ7awcPfb8kK9c0bBt+bTS6d4BkTcxkEkMgtrkBVR8Nqfu5jXsLH4VCv4G61zbMhZw8+ut+az5YX2yCN7Frj9sFlxapMRPQmzMEe0CgYEAumsAzM8ZqNv4mAK65Mnr0rhLj1cbxcKRdUYACOgtEFQpzxN/HZnTeFAe5nx3pI3uFlRHq3DFEYnT6dHMWaJQmAULYpVIwMi9L6gtyJ9fzoI6uqMtxRDMUqKdaSsTGOY/kJ6KhQ/unXi1K3XXjR+yd1+C0q+HUm1+CYxvrZYLfskCgYEArsEy+IQOiqniJ0NE2vVUF+UK/IRZaic9YKcpov5Ot7Vvzm/MnnW4N1ljVskocETBWMmPUvNSExVjPebi+rxd8fa5kY8BJScPTzMFbunZn/wjtGdcM10qdlVQ9doG61A/9P3ezFKCfS4AvF/H/59LcSx2Bh28fp3/efiVIOpVd4Y=";
|
|
12551
13244
|
/*
|
|
12552
13245
|
* The crypto algorithm used for importing key and signing string
|
|
12553
13246
|
*/
|
|
@@ -12990,6 +13683,122 @@ const fileLinkedObject = (file) => {
|
|
|
12990
13683
|
return file;
|
|
12991
13684
|
};
|
|
12992
13685
|
|
|
13686
|
+
const isCommentPending = (comment) => resolveCommentApprovalStatus(comment.approvalStatus) === "pending" /* Amity.CommentApprovalStatusEnum.Pending */;
|
|
13687
|
+
const isCommentApproved = (comment) => resolveCommentApprovalStatus(comment.approvalStatus) === "approved" /* Amity.CommentApprovalStatusEnum.Approved */;
|
|
13688
|
+
// Only post and content references feed PostCommentCountEngine; story counts live on the story.
|
|
13689
|
+
const isCountedReference = (comment) => ['post', 'content'].includes(comment.referenceType);
|
|
13690
|
+
const isAuthoredByCurrentUser = (comment) => comment.userId === getActiveClient().userId;
|
|
13691
|
+
/**
|
|
13692
|
+
* Whether a comment on this reference would be held for review, read from the cached post's
|
|
13693
|
+
* community. `true` when that cannot be known — the post or its community is not cached yet.
|
|
13694
|
+
* A pending guess that turns out approved is corrected by the response and the comment then
|
|
13695
|
+
* enters the list; an approved guess that turns out pending has already been shown in a public
|
|
13696
|
+
* list with nothing to take it back out. Only shapes the optimistic object — the server
|
|
13697
|
+
* response is the authority on the actual status.
|
|
13698
|
+
*/
|
|
13699
|
+
const isCommentApprovalRequired = (bundle) => {
|
|
13700
|
+
var _a, _b;
|
|
13701
|
+
// Only comments on community posts are gated; every other reference is known-off
|
|
13702
|
+
if (bundle.referenceType !== 'post')
|
|
13703
|
+
return false;
|
|
13704
|
+
const post = (_a = pullFromCache(['post', 'get', bundle.referenceId])) === null || _a === void 0 ? void 0 : _a.data;
|
|
13705
|
+
if (!post)
|
|
13706
|
+
return true;
|
|
13707
|
+
// A user-feed post is known-off
|
|
13708
|
+
if (post.targetType !== 'community')
|
|
13709
|
+
return false;
|
|
13710
|
+
const community = (_b = pullFromCache([
|
|
13711
|
+
'community',
|
|
13712
|
+
'get',
|
|
13713
|
+
post.targetId,
|
|
13714
|
+
])) === null || _b === void 0 ? void 0 : _b.data;
|
|
13715
|
+
if (!community)
|
|
13716
|
+
return true;
|
|
13717
|
+
return community.needApprovalOnCommentCreation === true;
|
|
13718
|
+
};
|
|
13719
|
+
/**
|
|
13720
|
+
* An approved comment arrived over realtime: one `CreateTask` carrying its own `createdAt`, so
|
|
13721
|
+
* the timestamp filter skips anything the last post payload already counted. The author's own
|
|
13722
|
+
* comment reaches here as an echo too; the engine de-duplicates it by id against the task the
|
|
13723
|
+
* create response queued.
|
|
13724
|
+
*/
|
|
13725
|
+
const applyCommentCreatedCount = (comment) => {
|
|
13726
|
+
if (!isCountedReference(comment))
|
|
13727
|
+
return;
|
|
13728
|
+
PostCommentCountEngine$1.getInstance().queueCommentChangeTask(new CreateTask(comment.referenceId, comment.commentId, comment.createdAt));
|
|
13729
|
+
};
|
|
13730
|
+
/**
|
|
13731
|
+
* The author's own pending comment counts in their view only. Recorded as separate engine state
|
|
13732
|
+
* so it survives a post refresh (`ResetTask`).
|
|
13733
|
+
*/
|
|
13734
|
+
const recordPendingAuthoredComment = (comment, options) => {
|
|
13735
|
+
if (!isCountedReference(comment) || !isAuthoredByCurrentUser(comment))
|
|
13736
|
+
return;
|
|
13737
|
+
PostCommentCountEngine$1.getInstance().addPendingAuthoredComment(comment.referenceId, comment.commentId, options);
|
|
13738
|
+
};
|
|
13739
|
+
/**
|
|
13740
|
+
* A pending comment was declined or deleted: it was never in the server count, so no
|
|
13741
|
+
* `DeleteTask` — only the author-local +1 goes away.
|
|
13742
|
+
*/
|
|
13743
|
+
const releasePendingAuthoredComment = (comment) => {
|
|
13744
|
+
if (!isCountedReference(comment))
|
|
13745
|
+
return;
|
|
13746
|
+
PostCommentCountEngine$1.getInstance().removePendingAuthoredComment(comment.referenceId, comment.commentId);
|
|
13747
|
+
};
|
|
13748
|
+
/**
|
|
13749
|
+
* Reveal: exactly one `ApproveTask`. The engine de-duplicates by comment id, so the approve
|
|
13750
|
+
* response and the `comment.approved` event may both call this. `ApproveTask` bypasses the age
|
|
13751
|
+
* guard on purpose — the comment was written before the last server sync but enters the public
|
|
13752
|
+
* count now — matching the iOS `ApproveTask` (plan 40 §9, guard off for approve).
|
|
13753
|
+
*/
|
|
13754
|
+
const applyCommentApprovedCount = (comment) => {
|
|
13755
|
+
if (!isCountedReference(comment))
|
|
13756
|
+
return;
|
|
13757
|
+
PostCommentCountEngine$1.getInstance().queueCommentChangeTask(new ApproveTask(comment.referenceId, comment.commentId));
|
|
13758
|
+
};
|
|
13759
|
+
/**
|
|
13760
|
+
* Re-review: an approved comment edited back to pending leaves the public count once. The
|
|
13761
|
+
* author keeps their own +1 through the pending set, so their count does not move.
|
|
13762
|
+
*/
|
|
13763
|
+
const applyCommentReReviewCount = (comment) => {
|
|
13764
|
+
if (!isCountedReference(comment))
|
|
13765
|
+
return;
|
|
13766
|
+
recordPendingAuthoredComment(comment, { publish: false });
|
|
13767
|
+
PostCommentCountEngine$1.getInstance().queueCommentChangeTask(new DeleteTask(comment.referenceId, comment.commentId));
|
|
13768
|
+
};
|
|
13769
|
+
/** Adds a reply to its cached parent's `children` (and count) once. */
|
|
13770
|
+
const linkCommentToParent = (comment) => {
|
|
13771
|
+
var _a;
|
|
13772
|
+
if (!comment.parentId)
|
|
13773
|
+
return;
|
|
13774
|
+
const parentKey = ['comment', 'get', comment.parentId];
|
|
13775
|
+
const parent = (_a = pullFromCache(parentKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
13776
|
+
if (!parent || parent.children.includes(comment.commentId))
|
|
13777
|
+
return;
|
|
13778
|
+
pushToCache(parentKey, Object.assign(Object.assign({}, parent), { childrenNumber: parent.childrenNumber + 1, children: [...new Set([...parent.children, comment.commentId])] }));
|
|
13779
|
+
};
|
|
13780
|
+
/** Removes a reply from its cached parent's `children` (and count) once. */
|
|
13781
|
+
const unlinkCommentFromParent = (comment) => {
|
|
13782
|
+
var _a;
|
|
13783
|
+
if (!comment.parentId)
|
|
13784
|
+
return;
|
|
13785
|
+
const parentKey = ['comment', 'get', comment.parentId];
|
|
13786
|
+
const parent = (_a = pullFromCache(parentKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
13787
|
+
if (!parent || !parent.children.includes(comment.commentId))
|
|
13788
|
+
return;
|
|
13789
|
+
pushToCache(parentKey, Object.assign(Object.assign({}, parent), { childrenNumber: parent.childrenNumber - 1, children: parent.children.filter(id => id !== comment.commentId) }));
|
|
13790
|
+
};
|
|
13791
|
+
|
|
13792
|
+
/**
|
|
13793
|
+
* The server's list is oldest → newest, so the newest ids are the last ones. Kept unique so the
|
|
13794
|
+
* create response, the local event and the realtime echo cannot each add the same comment.
|
|
13795
|
+
*/
|
|
13796
|
+
const capLatestCommentIds = (commentIds) => [...new Set(commentIds)].slice(-LATEST_COMMENTS_LIMIT);
|
|
13797
|
+
/** A comment belongs in the post preview only while it is cached, not deleted and public. */
|
|
13798
|
+
const isPreviewableComment = (comment) => comment !== undefined && !comment.isDeleted && isCommentApproved(comment);
|
|
13799
|
+
/** The post's preview list after one of the user's own top-level comments is created. */
|
|
13800
|
+
const appendLatestCommentId = (post, commentId) => { var _a; return capLatestCommentIds([...((_a = post.comments) !== null && _a !== void 0 ? _a : []), commentId]); };
|
|
13801
|
+
|
|
12993
13802
|
const postLinkedObject = (post) => {
|
|
12994
13803
|
return shallowClone(post, {
|
|
12995
13804
|
childrenPosts: post.children
|
|
@@ -13013,19 +13822,13 @@ const postLinkedObject = (post) => {
|
|
|
13013
13822
|
get latestComments() {
|
|
13014
13823
|
if (!post.comments)
|
|
13015
13824
|
return [];
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
13024
|
-
if (!commentCached)
|
|
13025
|
-
return null;
|
|
13026
|
-
return commentLinkedObject(commentCached);
|
|
13027
|
-
})
|
|
13028
|
-
.filter(Boolean) || []);
|
|
13825
|
+
// Same rule as the server's own list and as iOS: deleted and non-public comments are
|
|
13826
|
+
// dropped first, then the newest LATEST_COMMENTS_LIMIT remain
|
|
13827
|
+
return post.comments
|
|
13828
|
+
.map(commentId => { var _a; return (_a = pullFromCache(['comment', 'get', commentId])) === null || _a === void 0 ? void 0 : _a.data; })
|
|
13829
|
+
.filter(isPreviewableComment)
|
|
13830
|
+
.slice(-LATEST_COMMENTS_LIMIT)
|
|
13831
|
+
.map(commentLinkedObject);
|
|
13029
13832
|
},
|
|
13030
13833
|
get creator() {
|
|
13031
13834
|
// The id is checked for a value, not just for presence: a payload can
|
|
@@ -13038,6 +13841,15 @@ const postLinkedObject = (post) => {
|
|
|
13038
13841
|
return undefined;
|
|
13039
13842
|
return userLinkedObject(cacheData.data);
|
|
13040
13843
|
},
|
|
13844
|
+
getLocalCommentCount(includePending = false) {
|
|
13845
|
+
var _a;
|
|
13846
|
+
const engine = PostCommentCountEngine$1.getInstance();
|
|
13847
|
+
// Before any payload has seeded the engine for this post there is no tracker; the
|
|
13848
|
+
// post's own figure is the best answer then.
|
|
13849
|
+
return engine.hasTracker(post.postId)
|
|
13850
|
+
? engine.getLocalCommentCount(post.postId, includePending)
|
|
13851
|
+
: (_a = post.localCommentCount) !== null && _a !== void 0 ? _a : post.commentsCount;
|
|
13852
|
+
},
|
|
13041
13853
|
get targetCommunity() {
|
|
13042
13854
|
var _a;
|
|
13043
13855
|
if (!post.targetId)
|
|
@@ -13402,7 +14214,8 @@ const messageLinkedObject = (message) => {
|
|
|
13402
14214
|
},
|
|
13403
14215
|
get creator() {
|
|
13404
14216
|
var _a;
|
|
13405
|
-
|
|
14217
|
+
const creator = (_a = pullFromCache(['user', 'get', message.creatorId])) === null || _a === void 0 ? void 0 : _a.data;
|
|
14218
|
+
return creator ? userLinkedObject(creator) : undefined;
|
|
13406
14219
|
}, markRead: () => markReadMessage(message), addReaction: (reactionName) => addReactionToMessage(reactionName, message), removeReaction: (reactionName) => removeReactionToMessage(reactionName, message) });
|
|
13407
14220
|
};
|
|
13408
14221
|
|
|
@@ -13994,6 +14807,9 @@ class RSVPLiveCollectionController extends LiveCollectionController {
|
|
|
13994
14807
|
* @category RSVP Live Collection
|
|
13995
14808
|
*
|
|
13996
14809
|
*/
|
|
14810
|
+
/* begin_public_function
|
|
14811
|
+
id: event.get-rsvps
|
|
14812
|
+
*/
|
|
13997
14813
|
const getRSVPs = (params, callback, config) => {
|
|
13998
14814
|
const { log, cache } = getActiveClient();
|
|
13999
14815
|
if (!cache)
|
|
@@ -14063,6 +14879,22 @@ const eventLinkedObject = (event) => {
|
|
|
14063
14879
|
} });
|
|
14064
14880
|
};
|
|
14065
14881
|
|
|
14882
|
+
const curatedContentTopicLinkedObject = (topic) => {
|
|
14883
|
+
return shallowClone(topic, {
|
|
14884
|
+
analytics: {
|
|
14885
|
+
markAsViewed: () => {
|
|
14886
|
+
AnalyticsEngine$1.getInstance().markCuratedContentWidgetAsViewed(topic.topicId);
|
|
14887
|
+
},
|
|
14888
|
+
markPostAsViewed: (postId) => {
|
|
14889
|
+
AnalyticsEngine$1.getInstance().markCuratedContentPostAsViewed(postId, topic.topicId);
|
|
14890
|
+
},
|
|
14891
|
+
markPostClick: (postId) => {
|
|
14892
|
+
AnalyticsEngine$1.getInstance().markCuratedContentPostAsClicked(postId, topic.topicId);
|
|
14893
|
+
},
|
|
14894
|
+
},
|
|
14895
|
+
});
|
|
14896
|
+
};
|
|
14897
|
+
|
|
14066
14898
|
const LinkedObject = {
|
|
14067
14899
|
file: fileLinkedObject,
|
|
14068
14900
|
ad: adLinkedObject,
|
|
@@ -14087,6 +14919,7 @@ const LinkedObject = {
|
|
|
14087
14919
|
eventResponse: eventResponseLinkedObject,
|
|
14088
14920
|
product: productLinkedObject,
|
|
14089
14921
|
poll: pollLinkedObject,
|
|
14922
|
+
curatedContentTopic: curatedContentTopicLinkedObject,
|
|
14090
14923
|
};
|
|
14091
14924
|
|
|
14092
14925
|
/* begin_public_function
|
|
@@ -15335,6 +16168,9 @@ const queryReachUser = async ({ viewId, viewedType, limit, token, }) => {
|
|
|
15335
16168
|
return response.data;
|
|
15336
16169
|
};
|
|
15337
16170
|
|
|
16171
|
+
/* begin_public_function
|
|
16172
|
+
id: user.get-reached-users
|
|
16173
|
+
*/
|
|
15338
16174
|
const getReachedUsers = (params, callback) => {
|
|
15339
16175
|
// Pre-defined function to avoid undefined function call
|
|
15340
16176
|
let onFetch = (initial = false) => undefined;
|
|
@@ -15409,9 +16245,9 @@ var AmityUserSearchMatchType;
|
|
|
15409
16245
|
AmityUserSearchMatchType["PARTIAL"] = "partial";
|
|
15410
16246
|
})(AmityUserSearchMatchType || (AmityUserSearchMatchType = {}));
|
|
15411
16247
|
|
|
15412
|
-
var index$
|
|
16248
|
+
var index$r = /*#__PURE__*/Object.freeze({
|
|
15413
16249
|
__proto__: null,
|
|
15414
|
-
Relationship: index$
|
|
16250
|
+
Relationship: index$s,
|
|
15415
16251
|
getUserByIds: getUserByIds,
|
|
15416
16252
|
updateUser: updateUser,
|
|
15417
16253
|
flagUser: flagUser,
|
|
@@ -15580,7 +16416,7 @@ const fileUrlWithSize = (fileUrl, size) => {
|
|
|
15580
16416
|
};
|
|
15581
16417
|
|
|
15582
16418
|
/* begin_public_function
|
|
15583
|
-
id: file.upload.video
|
|
16419
|
+
id: file.upload.video
|
|
15584
16420
|
*/
|
|
15585
16421
|
/**
|
|
15586
16422
|
* ```js
|
|
@@ -15819,7 +16655,7 @@ const uploadAudio = async (formData, onProgress) => {
|
|
|
15819
16655
|
};
|
|
15820
16656
|
/* end_public_function */
|
|
15821
16657
|
|
|
15822
|
-
var index$
|
|
16658
|
+
var index$q = /*#__PURE__*/Object.freeze({
|
|
15823
16659
|
__proto__: null,
|
|
15824
16660
|
getFile: getFile,
|
|
15825
16661
|
uploadFile: uploadFile,
|
|
@@ -16012,147 +16848,6 @@ getMessage$1.locally = (messageId) => {
|
|
|
16012
16848
|
};
|
|
16013
16849
|
};
|
|
16014
16850
|
|
|
16015
|
-
class ResetTask {
|
|
16016
|
-
constructor(postId, latestCreatedAt, serverCommentCount) {
|
|
16017
|
-
this.postId = postId;
|
|
16018
|
-
this.latestCreatedAt = latestCreatedAt;
|
|
16019
|
-
this.serverCommentCount = serverCommentCount;
|
|
16020
|
-
}
|
|
16021
|
-
}
|
|
16022
|
-
|
|
16023
|
-
// Task to track comment creation
|
|
16024
|
-
class CreateTask {
|
|
16025
|
-
constructor(postId, commentId, createdAt) {
|
|
16026
|
-
this.postId = postId;
|
|
16027
|
-
this.commentId = commentId;
|
|
16028
|
-
this.createdAt = createdAt;
|
|
16029
|
-
}
|
|
16030
|
-
}
|
|
16031
|
-
|
|
16032
|
-
// Task to track comment deletion
|
|
16033
|
-
class DeleteTask {
|
|
16034
|
-
constructor(postId, commentId) {
|
|
16035
|
-
this.postId = postId;
|
|
16036
|
-
this.commentId = commentId;
|
|
16037
|
-
}
|
|
16038
|
-
}
|
|
16039
|
-
|
|
16040
|
-
class CommentChange {
|
|
16041
|
-
constructor(latestCreatedAt, serverCommentCount) {
|
|
16042
|
-
this.latestCommentCreatedAt = latestCreatedAt;
|
|
16043
|
-
this.serverCommentCount = serverCommentCount;
|
|
16044
|
-
this.createdCommentIds = new Set();
|
|
16045
|
-
this.deletedCommentIds = new Set();
|
|
16046
|
-
}
|
|
16047
|
-
}
|
|
16048
|
-
|
|
16049
|
-
class PostCommentCountEngine {
|
|
16050
|
-
constructor() {
|
|
16051
|
-
this.isProcessing = false;
|
|
16052
|
-
this.tasks = [];
|
|
16053
|
-
this.commentChangeTracker = new Map();
|
|
16054
|
-
}
|
|
16055
|
-
queueCommentChangeTask(task) {
|
|
16056
|
-
this.tasks.push(task);
|
|
16057
|
-
if (!this.isProcessing) {
|
|
16058
|
-
this.processCommentChangeTask();
|
|
16059
|
-
}
|
|
16060
|
-
}
|
|
16061
|
-
processCommentChangeTask() {
|
|
16062
|
-
if (this.isProcessing) {
|
|
16063
|
-
return;
|
|
16064
|
-
}
|
|
16065
|
-
this.isProcessing = true;
|
|
16066
|
-
if (this.tasks.length === 0) {
|
|
16067
|
-
this.isProcessing = false;
|
|
16068
|
-
return;
|
|
16069
|
-
}
|
|
16070
|
-
// Process in capped batches, coalescing updates
|
|
16071
|
-
const batch = this.tasks.splice(0, PostCommentCountEngine.BATCH_SIZE);
|
|
16072
|
-
const modifiedPostIds = new Set();
|
|
16073
|
-
batch.forEach(task => {
|
|
16074
|
-
let modified = false;
|
|
16075
|
-
if (task instanceof ResetTask) {
|
|
16076
|
-
modified = this.processResetTaskInternal(task);
|
|
16077
|
-
}
|
|
16078
|
-
else if (task instanceof CreateTask) {
|
|
16079
|
-
modified = this.processCreateTaskInternal(task);
|
|
16080
|
-
}
|
|
16081
|
-
else if (task instanceof DeleteTask) {
|
|
16082
|
-
modified = this.processDeleteTaskInternal(task);
|
|
16083
|
-
}
|
|
16084
|
-
if (modified) {
|
|
16085
|
-
modifiedPostIds.add(task.postId);
|
|
16086
|
-
}
|
|
16087
|
-
});
|
|
16088
|
-
// Publish one update per modified post
|
|
16089
|
-
modifiedPostIds.forEach(postId => {
|
|
16090
|
-
const count = this.computeCommentCount(postId);
|
|
16091
|
-
PostCommentCountEngine.publishUpdate(postId, count);
|
|
16092
|
-
});
|
|
16093
|
-
this.isProcessing = false;
|
|
16094
|
-
// Recurse if more tasks remain
|
|
16095
|
-
if (this.tasks.length > 0) {
|
|
16096
|
-
this.processCommentChangeTask();
|
|
16097
|
-
}
|
|
16098
|
-
}
|
|
16099
|
-
processResetTaskInternal(task) {
|
|
16100
|
-
// Always creates/overwrites tracker
|
|
16101
|
-
this.commentChangeTracker.set(task.postId, new CommentChange(task.latestCreatedAt, task.serverCommentCount));
|
|
16102
|
-
return true;
|
|
16103
|
-
}
|
|
16104
|
-
processCreateTaskInternal(task) {
|
|
16105
|
-
const tracker = this.commentChangeTracker.get(task.postId);
|
|
16106
|
-
if (!tracker)
|
|
16107
|
-
return false; // No tracker, skip
|
|
16108
|
-
if (tracker.createdCommentIds.has(task.commentId))
|
|
16109
|
-
return false; // Deduplication
|
|
16110
|
-
if (task.createdAt <= tracker.latestCommentCreatedAt)
|
|
16111
|
-
return false; // Timestamp filtering
|
|
16112
|
-
tracker.createdCommentIds.add(task.commentId);
|
|
16113
|
-
return true;
|
|
16114
|
-
}
|
|
16115
|
-
processDeleteTaskInternal(task) {
|
|
16116
|
-
const tracker = this.commentChangeTracker.get(task.postId);
|
|
16117
|
-
if (!tracker)
|
|
16118
|
-
return false; // No tracker, skip
|
|
16119
|
-
if (tracker.deletedCommentIds.has(task.commentId))
|
|
16120
|
-
return false; // Deduplication
|
|
16121
|
-
tracker.deletedCommentIds.add(task.commentId);
|
|
16122
|
-
return true;
|
|
16123
|
-
}
|
|
16124
|
-
computeCommentCount(postId) {
|
|
16125
|
-
const tracker = this.commentChangeTracker.get(postId);
|
|
16126
|
-
if (!tracker)
|
|
16127
|
-
return 0;
|
|
16128
|
-
const count = tracker.serverCommentCount + tracker.createdCommentIds.size - tracker.deletedCommentIds.size;
|
|
16129
|
-
return Math.max(0, count);
|
|
16130
|
-
}
|
|
16131
|
-
static publishUpdate(postId, newCount) {
|
|
16132
|
-
var _a;
|
|
16133
|
-
const queryKey = ['post', 'get', postId];
|
|
16134
|
-
mergeInCache(queryKey, {
|
|
16135
|
-
localCommentCount: newCount,
|
|
16136
|
-
});
|
|
16137
|
-
const postPayload = (_a = pullFromCache(queryKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
16138
|
-
if (!postPayload)
|
|
16139
|
-
return;
|
|
16140
|
-
fireEvent('local.post.updated', {
|
|
16141
|
-
posts: [postPayload],
|
|
16142
|
-
});
|
|
16143
|
-
}
|
|
16144
|
-
}
|
|
16145
|
-
PostCommentCountEngine.BATCH_SIZE = 50;
|
|
16146
|
-
let instance;
|
|
16147
|
-
var PostCommentCountEngine$1 = {
|
|
16148
|
-
getInstance: () => {
|
|
16149
|
-
if (!instance) {
|
|
16150
|
-
instance = new PostCommentCountEngine();
|
|
16151
|
-
}
|
|
16152
|
-
return instance;
|
|
16153
|
-
},
|
|
16154
|
-
};
|
|
16155
|
-
|
|
16156
16851
|
const updateStreamReferences = (streams, streamId, postId) => {
|
|
16157
16852
|
if (!streamId)
|
|
16158
16853
|
return streams;
|
|
@@ -16172,7 +16867,7 @@ const preparePostPayload = (payload) => {
|
|
|
16172
16867
|
let mappedNewStream = [];
|
|
16173
16868
|
// feed type
|
|
16174
16869
|
const posts = postsData.map(post => {
|
|
16175
|
-
var _a, _b, _c
|
|
16870
|
+
var _a, _b, _c;
|
|
16176
16871
|
const feedType = (_a = postPayload.feeds.find(feed => feed.feedId === post.feedId)) === null || _a === void 0 ? void 0 : _a.feedType;
|
|
16177
16872
|
const childPosts = payload.postChildren.filter(children => children.parentPostId === post.postId);
|
|
16178
16873
|
if (childPosts.length > 0 && isAmityLivestreamPost(childPosts[0])) {
|
|
@@ -16191,7 +16886,11 @@ const preparePostPayload = (payload) => {
|
|
|
16191
16886
|
// Queue ResetTask for this post
|
|
16192
16887
|
PostCommentCountEngine$1.getInstance().queueCommentChangeTask(new ResetTask(post.postId, latestCreatedAt, (_c = post.commentsCount) !== null && _c !== void 0 ? _c : 0));
|
|
16193
16888
|
return Object.assign(Object.assign({}, post), { childPosts,
|
|
16194
|
-
feedType,
|
|
16889
|
+
feedType,
|
|
16890
|
+
// The ResetTask above has just seeded the engine, so this is the server figure plus the
|
|
16891
|
+
// author's own pending comments. Reading `post.commentsCount` here instead would overwrite
|
|
16892
|
+
// that +1 in the cache on every refresh, since the ingest that follows merges this object.
|
|
16893
|
+
localCommentCount: PostCommentCountEngine$1.getInstance().getLocalCommentCount(post.postId, true), pinnedProductId: post === null || post === void 0 ? void 0 : post.pinnedProductId });
|
|
16195
16894
|
});
|
|
16196
16895
|
return Object.assign(Object.assign({}, postPayload), { postChildren, videoStreamings: mappedNewStream, posts, communities: communityWithMembershipStatus, communityUsers: mappedCommunityUsers });
|
|
16197
16896
|
};
|
|
@@ -16944,62 +17643,67 @@ const onPostReactionRemoved = (callback) => {
|
|
|
16944
17643
|
return createEventSubscriber(client, 'post.removeReaction', 'post.removeReaction', filter);
|
|
16945
17644
|
};
|
|
16946
17645
|
|
|
17646
|
+
/**
|
|
17647
|
+
* `comment.created` fires while a comment is still pending, so delivery is not visibility. The
|
|
17648
|
+
* two side effects that make a comment public — the parent link that feeds the reply list and
|
|
17649
|
+
* the comment-count task — are gated here; `comment.approved` is the only reveal signal, and a
|
|
17650
|
+
* decline arrives as `comment.deleted`.
|
|
17651
|
+
*/
|
|
17652
|
+
const applyApprovalSideEffects = (event, comment, previous) => {
|
|
17653
|
+
switch (event) {
|
|
17654
|
+
case 'comment.created':
|
|
17655
|
+
if (isCommentPending(comment)) {
|
|
17656
|
+
recordPendingAuthoredComment(comment);
|
|
17657
|
+
}
|
|
17658
|
+
else {
|
|
17659
|
+
linkCommentToParent(comment);
|
|
17660
|
+
applyCommentCreatedCount(comment);
|
|
17661
|
+
}
|
|
17662
|
+
break;
|
|
17663
|
+
case 'comment.approved':
|
|
17664
|
+
linkCommentToParent(comment);
|
|
17665
|
+
applyCommentApprovedCount(comment);
|
|
17666
|
+
break;
|
|
17667
|
+
case 'comment.updated':
|
|
17668
|
+
// An effective edit in a gated community sends an approved comment back for review
|
|
17669
|
+
if (isCommentPending(comment) && previous && isCommentApproved(previous)) {
|
|
17670
|
+
unlinkCommentFromParent(comment);
|
|
17671
|
+
applyCommentReReviewCount(comment);
|
|
17672
|
+
}
|
|
17673
|
+
break;
|
|
17674
|
+
case 'comment.deleted':
|
|
17675
|
+
unlinkCommentFromParent(comment);
|
|
17676
|
+
// A pending comment was never counted, so its deletion (or decline) moves no count
|
|
17677
|
+
if (previous && isCommentPending(previous))
|
|
17678
|
+
releasePendingAuthoredComment(comment);
|
|
17679
|
+
break;
|
|
17680
|
+
}
|
|
17681
|
+
};
|
|
16947
17682
|
const createCommentEventSubscriber = (event, callback) => {
|
|
16948
17683
|
const client = getActiveClient();
|
|
16949
17684
|
const filter = (payload) => {
|
|
16950
|
-
var _a;
|
|
17685
|
+
var _a, _b;
|
|
16951
17686
|
if (!client.cache) {
|
|
16952
17687
|
// TODO: here we are missing specific properties here!
|
|
16953
17688
|
callback(LinkedObject.comment(payload.comments[0]));
|
|
16954
17689
|
}
|
|
16955
17690
|
else {
|
|
16956
|
-
const
|
|
17691
|
+
const flagged = ['comment.flagged', 'comment.unflagged'].includes(event)
|
|
16957
17692
|
? prepareCommentFromFlaggedEvent(payload)
|
|
16958
17693
|
: payload;
|
|
16959
|
-
//
|
|
16960
|
-
|
|
17694
|
+
// Resolve `approvalStatus` before the merge: an absent value means approved and has to
|
|
17695
|
+
// overwrite a cached `pending`, which a plain merge would leave in place.
|
|
17696
|
+
const processed = prepareCommentPayload(flagged);
|
|
16961
17697
|
const { comments } = processed;
|
|
16962
17698
|
if (comments.length > 0) {
|
|
16963
|
-
const
|
|
16964
|
-
|
|
16965
|
-
|
|
16966
|
-
|
|
16967
|
-
|
|
16968
|
-
|
|
16969
|
-
if (comments[0].parentId) {
|
|
16970
|
-
const parentComment = pullFromCache([
|
|
16971
|
-
'comment',
|
|
16972
|
-
'get',
|
|
16973
|
-
comments[0].parentId,
|
|
16974
|
-
]);
|
|
16975
|
-
if (parentComment === null || parentComment === void 0 ? void 0 : parentComment.data) {
|
|
16976
|
-
// Skip to update parent childComment if current comment already exists
|
|
16977
|
-
if (!parentComment.data.children.includes(comments[0].commentId)) {
|
|
16978
|
-
pushToCache(['comment', 'get', comments[0].parentId], Object.assign(Object.assign({}, parentComment.data), { childrenNumber: parentComment.data.childrenNumber + 1, children: [...new Set([...parentComment.data.children, comments[0].commentId])] }));
|
|
16979
|
-
}
|
|
16980
|
-
}
|
|
16981
|
-
}
|
|
16982
|
-
}
|
|
17699
|
+
const commentKey = ['comment', 'get', comments[0].commentId];
|
|
17700
|
+
const previous = (_a = pullFromCache(commentKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
17701
|
+
// NOTE: The event data should be merge with existing cache rather than replace it
|
|
17702
|
+
ingestInCache(processed, undefined, false);
|
|
17703
|
+
const comment = pullFromCache(commentKey);
|
|
17704
|
+
applyApprovalSideEffects(event, comment.data, previous);
|
|
16983
17705
|
if (['comment.deleted'].includes(event)) {
|
|
16984
|
-
|
|
16985
|
-
const parentComment = pullFromCache([
|
|
16986
|
-
'comment',
|
|
16987
|
-
'get',
|
|
16988
|
-
comments[0].parentId,
|
|
16989
|
-
]);
|
|
16990
|
-
if (parentComment === null || parentComment === void 0 ? void 0 : parentComment.data) {
|
|
16991
|
-
// Remove deleted comment in parent childComment if still exists
|
|
16992
|
-
if (parentComment.data.children.includes(comments[0].commentId)) {
|
|
16993
|
-
const newParentComment = Object.assign(Object.assign({}, parentComment.data), { childrenNumber: parentComment.data.childrenNumber - 1, children: [
|
|
16994
|
-
...new Set([
|
|
16995
|
-
...parentComment.data.children.filter(id => id !== comments[0].commentId),
|
|
16996
|
-
]),
|
|
16997
|
-
] });
|
|
16998
|
-
pushToCache(['comment', 'get', comments[0].parentId], newParentComment);
|
|
16999
|
-
}
|
|
17000
|
-
}
|
|
17001
|
-
}
|
|
17002
|
-
const queries = (_a = queryCache(['comment', 'query'])) === null || _a === void 0 ? void 0 : _a.filter(({ key }) => { var _a; return ((_a = key[2]) === null || _a === void 0 ? void 0 : _a.referenceId) === comment.data.referenceId; });
|
|
17706
|
+
const queries = (_b = queryCache(['comment', 'query'])) === null || _b === void 0 ? void 0 : _b.filter(({ key }) => { var _a; return ((_a = key[2]) === null || _a === void 0 ? void 0 : _a.referenceId) === comment.data.referenceId; });
|
|
17003
17707
|
queries === null || queries === void 0 ? void 0 : queries.map(({ key, data }) => upsertInCache(key, data, { cachedAt: -1 }));
|
|
17004
17708
|
}
|
|
17005
17709
|
callback(LinkedObject.comment(comment.data));
|
|
@@ -17011,13 +17715,13 @@ const createCommentEventSubscriber = (event, callback) => {
|
|
|
17011
17715
|
const createLocalCommentEventSubscriber = (event, callback) => {
|
|
17012
17716
|
const client = getActiveClient();
|
|
17013
17717
|
const filter = (payload) => {
|
|
17014
|
-
var _a, _b, _c, _d
|
|
17718
|
+
var _a, _b, _c, _d;
|
|
17015
17719
|
if (!client.cache) {
|
|
17016
17720
|
// TODO: here we are missing specific properties here!
|
|
17017
17721
|
callback(LinkedObject.comment(payload.comments[0]));
|
|
17018
17722
|
}
|
|
17019
17723
|
else {
|
|
17020
|
-
const processed = payload;
|
|
17724
|
+
const processed = prepareCommentPayload(payload);
|
|
17021
17725
|
ingestInCache(processed);
|
|
17022
17726
|
const { comments } = processed;
|
|
17023
17727
|
if (comments.length > 0) {
|
|
@@ -17026,7 +17730,9 @@ const createLocalCommentEventSubscriber = (event, callback) => {
|
|
|
17026
17730
|
'get',
|
|
17027
17731
|
comments[0].commentId,
|
|
17028
17732
|
]);
|
|
17029
|
-
|
|
17733
|
+
// A pending comment is persisted for its author but never linked into the public
|
|
17734
|
+
// surfaces (parent reply list, post comment list)
|
|
17735
|
+
if (['local.comment.created'].includes(event) && isCommentApproved(comments[0])) {
|
|
17030
17736
|
if (comments[0].parentId) {
|
|
17031
17737
|
const parentComment = pullFromCache([
|
|
17032
17738
|
'comment',
|
|
@@ -17055,11 +17761,11 @@ const createLocalCommentEventSubscriber = (event, callback) => {
|
|
|
17055
17761
|
const postCacheKey = ['post', 'get', comments[0].referenceId];
|
|
17056
17762
|
const postCache = (_a = pullFromCache(postCacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
17057
17763
|
if (postCache) {
|
|
17058
|
-
const updatedPostCache = Object.assign(Object.assign({}, postCache), { comments:
|
|
17764
|
+
const updatedPostCache = Object.assign(Object.assign({}, postCache), { comments: appendLatestCommentId(postCache, comments[0].commentId) });
|
|
17059
17765
|
pushToCache(postCacheKey, updatedPostCache);
|
|
17060
17766
|
}
|
|
17061
17767
|
}
|
|
17062
|
-
const queries = (
|
|
17768
|
+
const queries = (_b = queryCache(['comment', 'query'])) === null || _b === void 0 ? void 0 : _b.filter(({ key }) => { var _a; return ((_a = key[2]) === null || _a === void 0 ? void 0 : _a.referenceId) === comment.data.referenceId; });
|
|
17063
17769
|
queries === null || queries === void 0 ? void 0 : queries.map(({ key, data }) => upsertInCache(key, data, { cachedAt: -1 }));
|
|
17064
17770
|
}
|
|
17065
17771
|
if (['local.comment.deleted'].includes(event)) {
|
|
@@ -17093,13 +17799,13 @@ const createLocalCommentEventSubscriber = (event, callback) => {
|
|
|
17093
17799
|
}
|
|
17094
17800
|
else {
|
|
17095
17801
|
const postCacheKey = ['post', 'get', comments[0].referenceId];
|
|
17096
|
-
const postCache = (
|
|
17802
|
+
const postCache = (_c = pullFromCache(postCacheKey)) === null || _c === void 0 ? void 0 : _c.data;
|
|
17097
17803
|
if (postCache) {
|
|
17098
17804
|
const updatedPost = Object.assign(Object.assign({}, postCache), { comments: postCache === null || postCache === void 0 ? void 0 : postCache.comments.filter(commentId => { var _a; return commentId !== ((_a = comments[0]) === null || _a === void 0 ? void 0 : _a.commentId); }) });
|
|
17099
17805
|
pushToCache(postCacheKey, updatedPost);
|
|
17100
17806
|
}
|
|
17101
17807
|
}
|
|
17102
|
-
const queries = (
|
|
17808
|
+
const queries = (_d = queryCache(['comment', 'query'])) === null || _d === void 0 ? void 0 : _d.filter(({ key }) => { var _a; return ((_a = key[2]) === null || _a === void 0 ? void 0 : _a.referenceId) === comment.data.referenceId; });
|
|
17103
17809
|
queries === null || queries === void 0 ? void 0 : queries.map(({ key, data }) => upsertInCache(key, data, { cachedAt: -1 }));
|
|
17104
17810
|
}
|
|
17105
17811
|
callback(LinkedObject.comment(comment.data));
|
|
@@ -17160,6 +17866,23 @@ const onCommentUpdated = (callback) => createCommentEventSubscriber('comment.upd
|
|
|
17160
17866
|
*/
|
|
17161
17867
|
const onCommentDeleted = (callback) => createCommentEventSubscriber('comment.deleted', callback);
|
|
17162
17868
|
|
|
17869
|
+
/**
|
|
17870
|
+
* ```js
|
|
17871
|
+
* import { onCommentApproved } from '@amityco/ts-sdk'
|
|
17872
|
+
* const dispose = onCommentApproved(comment => {
|
|
17873
|
+
* // ...
|
|
17874
|
+
* })
|
|
17875
|
+
* ```
|
|
17876
|
+
*
|
|
17877
|
+
* Fired when a {@link Amity.InternalComment} held for review has been approved
|
|
17878
|
+
*
|
|
17879
|
+
* @param callback The function to call when the event was fired
|
|
17880
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
17881
|
+
*
|
|
17882
|
+
* @category Comment Events
|
|
17883
|
+
*/
|
|
17884
|
+
const onCommentApproved = (callback) => createCommentEventSubscriber('comment.approved', callback);
|
|
17885
|
+
|
|
17163
17886
|
/**
|
|
17164
17887
|
* ```js
|
|
17165
17888
|
* import { onCommentFlagged } from '@amityco/ts-sdk'
|
|
@@ -17751,6 +18474,7 @@ class ReactionLiveCollectionController extends LiveCollectionController {
|
|
|
17751
18474
|
/* eslint-disable no-use-before-define */
|
|
17752
18475
|
/* begin_public_function
|
|
17753
18476
|
id: reaction.query
|
|
18477
|
+
spec: SDK/API/reaction/getReactions/v1.md
|
|
17754
18478
|
*/
|
|
17755
18479
|
/**
|
|
17756
18480
|
* ```js
|
|
@@ -17792,7 +18516,7 @@ const getReactions$1 = (params, callback, config) => {
|
|
|
17792
18516
|
};
|
|
17793
18517
|
/* end_public_function */
|
|
17794
18518
|
|
|
17795
|
-
var index$
|
|
18519
|
+
var index$p = /*#__PURE__*/Object.freeze({
|
|
17796
18520
|
__proto__: null,
|
|
17797
18521
|
addReaction: addReaction,
|
|
17798
18522
|
removeReaction: removeReaction,
|
|
@@ -17803,17 +18527,6 @@ var index$o = /*#__PURE__*/Object.freeze({
|
|
|
17803
18527
|
getReactions: getReactions$1
|
|
17804
18528
|
});
|
|
17805
18529
|
|
|
17806
|
-
function prepareCommentPayload(commentPayload) {
|
|
17807
|
-
const { comments } = commentPayload;
|
|
17808
|
-
return Object.assign(Object.assign({}, commentPayload), { comments: comments.map(comment => {
|
|
17809
|
-
if (comment.hasOwnProperty('myReactions'))
|
|
17810
|
-
return comment;
|
|
17811
|
-
// Sometimes `myReactions` field will not come with BE response because that field is empty
|
|
17812
|
-
// We need to put it with an empty array manually to make it show up in client side
|
|
17813
|
-
return Object.assign({ myReactions: [] }, comment);
|
|
17814
|
-
}) });
|
|
17815
|
-
}
|
|
17816
|
-
|
|
17817
18530
|
const createMessageReport = async ({ client, referenceId, }) => {
|
|
17818
18531
|
const { data: payload } = await client.http.post(`/api/v5/messages/${encodeURIComponent(referenceId)}/flags`);
|
|
17819
18532
|
if (client.cache) {
|
|
@@ -17960,7 +18673,7 @@ const getPostReport = async ({ client, referenceId, }) => {
|
|
|
17960
18673
|
};
|
|
17961
18674
|
const getUserReport = async ({ client, referenceId, }) => {
|
|
17962
18675
|
var _a;
|
|
17963
|
-
const { data } = await client.http.get(`/api/v3/users/${referenceId}/
|
|
18676
|
+
const { data } = await client.http.get(`/api/v3/users/${referenceId}/isFlagByMe`);
|
|
17964
18677
|
const { result, isFlagByMe } = data !== null && data !== void 0 ? data : {};
|
|
17965
18678
|
return (_a = result !== null && result !== void 0 ? result : isFlagByMe) !== null && _a !== void 0 ? _a : false;
|
|
17966
18679
|
};
|
|
@@ -18277,20 +18990,20 @@ const getArchivedChannelIds = async () => {
|
|
|
18277
18990
|
|
|
18278
18991
|
/**
|
|
18279
18992
|
* ```js
|
|
18280
|
-
* import {
|
|
18281
|
-
* const dispose =
|
|
18993
|
+
* import { onMessageDeleted } from '@amityco/ts-sdk'
|
|
18994
|
+
* const dispose = onMessageDeleted(message => {
|
|
18282
18995
|
* // ...
|
|
18283
18996
|
* })
|
|
18284
18997
|
* ```
|
|
18285
18998
|
*
|
|
18286
|
-
* Fired when an {@link Amity.Message}
|
|
18999
|
+
* Fired when an {@link Amity.Message} was deleted
|
|
18287
19000
|
*
|
|
18288
19001
|
* @param callback The function to call when the event was fired
|
|
18289
19002
|
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
18290
19003
|
*
|
|
18291
19004
|
* @category Message Events
|
|
18292
19005
|
*/
|
|
18293
|
-
const
|
|
19006
|
+
const onMessageDeleted = (callback) => {
|
|
18294
19007
|
const client = getActiveClient();
|
|
18295
19008
|
const filter = async (rawPayload) => {
|
|
18296
19009
|
const payload = await prepareMessagePayload(rawPayload);
|
|
@@ -18298,30 +19011,48 @@ const onMessageUpdated = (callback) => {
|
|
|
18298
19011
|
callback(payload.messages[0]);
|
|
18299
19012
|
};
|
|
18300
19013
|
const disposers = [
|
|
18301
|
-
createEventSubscriber(client, '
|
|
18302
|
-
createEventSubscriber(client, '
|
|
19014
|
+
createEventSubscriber(client, 'message/onMessageDeleted', 'message.deleted', filter),
|
|
19015
|
+
createEventSubscriber(client, 'message/onMessageDeleted', 'local.message.deleted', payload => callback(payload.messages[0])),
|
|
18303
19016
|
];
|
|
18304
19017
|
return () => {
|
|
18305
19018
|
disposers.forEach(fn => fn());
|
|
18306
19019
|
};
|
|
18307
19020
|
};
|
|
18308
19021
|
|
|
19022
|
+
/**
|
|
19023
|
+
* Defensive clear of `channel.pinnedMessage` when the pinned message itself is deleted.
|
|
19024
|
+
*
|
|
19025
|
+
* The server also emits `channel.messageUnpinned` in this case, but realtime events are
|
|
19026
|
+
* fire-and-forget and their order is not guaranteed. Clearing on `message.deleted`
|
|
19027
|
+
* (MQTT or local) makes the banner disappear even if the unpin event is lost; the
|
|
19028
|
+
* server's own `messageUnpinned` then becomes a no-op.
|
|
19029
|
+
*
|
|
19030
|
+
* Internal — wired into the `getChannel` live object; not exported publicly.
|
|
19031
|
+
*/
|
|
19032
|
+
const onChannelPinnedMessageDeleted = (callback) => onMessageDeleted(message => {
|
|
19033
|
+
var _a;
|
|
19034
|
+
const channel = findCachedChannelByAnyId(message.channelId);
|
|
19035
|
+
if (!channel || ((_a = channel.pinnedMessage) === null || _a === void 0 ? void 0 : _a.messageId) !== message.messageId)
|
|
19036
|
+
return;
|
|
19037
|
+
callback(updatePinnedMessageCache(channel, null));
|
|
19038
|
+
});
|
|
19039
|
+
|
|
18309
19040
|
/**
|
|
18310
19041
|
* ```js
|
|
18311
|
-
* import {
|
|
18312
|
-
* const dispose =
|
|
19042
|
+
* import { onMessageUpdated } from '@amityco/ts-sdk'
|
|
19043
|
+
* const dispose = onMessageUpdated(message => {
|
|
18313
19044
|
* // ...
|
|
18314
19045
|
* })
|
|
18315
19046
|
* ```
|
|
18316
19047
|
*
|
|
18317
|
-
* Fired when an {@link Amity.Message}
|
|
19048
|
+
* Fired when an {@link Amity.Message} has been updated
|
|
18318
19049
|
*
|
|
18319
19050
|
* @param callback The function to call when the event was fired
|
|
18320
19051
|
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
18321
19052
|
*
|
|
18322
19053
|
* @category Message Events
|
|
18323
19054
|
*/
|
|
18324
|
-
const
|
|
19055
|
+
const onMessageUpdated = (callback) => {
|
|
18325
19056
|
const client = getActiveClient();
|
|
18326
19057
|
const filter = async (rawPayload) => {
|
|
18327
19058
|
const payload = await prepareMessagePayload(rawPayload);
|
|
@@ -18329,8 +19060,8 @@ const onMessageDeleted = (callback) => {
|
|
|
18329
19060
|
callback(payload.messages[0]);
|
|
18330
19061
|
};
|
|
18331
19062
|
const disposers = [
|
|
18332
|
-
createEventSubscriber(client, '
|
|
18333
|
-
createEventSubscriber(client, '
|
|
19063
|
+
createEventSubscriber(client, 'onMessageUpdated', 'message.updated', filter),
|
|
19064
|
+
createEventSubscriber(client, 'onMessageUpdated', 'local.message.updated', payload => callback(payload.messages[0])),
|
|
18334
19065
|
];
|
|
18335
19066
|
return () => {
|
|
18336
19067
|
disposers.forEach(fn => fn());
|
|
@@ -18911,6 +19642,132 @@ softDeleteMessage.optimistically = (messageId) => {
|
|
|
18911
19642
|
};
|
|
18912
19643
|
/* end_public_function */
|
|
18913
19644
|
|
|
19645
|
+
/**
|
|
19646
|
+
* Fire-and-forget refresh of `channelUsers[...].permissions` for the channel a
|
|
19647
|
+
* message belongs to. Used by `pinMessage` / `unpinMessage` on `403` so the next
|
|
19648
|
+
* `hasPermission(PIN_MESSAGE).channel(channelId)` reflects a revoked role
|
|
19649
|
+
* ([`pinMessage` REQ-010](../../@types/../..) / [`unpinMessage` REQ-008](../../@types/../..)).
|
|
19650
|
+
*
|
|
19651
|
+
* The API only receives a `messageId`, so the channel is resolved through the
|
|
19652
|
+
* local cache: first the message row, then any cached channel whose current pin
|
|
19653
|
+
* is that message. When nothing matches the refresh is skipped — the next
|
|
19654
|
+
* channel read picks up the fresh permissions anyway.
|
|
19655
|
+
*/
|
|
19656
|
+
const refreshChannelPermissionsForMessage = (messageId) => {
|
|
19657
|
+
var _a, _b, _c;
|
|
19658
|
+
const cachedMessage = (_a = getMessage$1.locally(messageId)) === null || _a === void 0 ? void 0 : _a.data;
|
|
19659
|
+
let channelId = cachedMessage === null || cachedMessage === void 0 ? void 0 : cachedMessage.channelId;
|
|
19660
|
+
if (!channelId) {
|
|
19661
|
+
channelId = (_c = (_b = queryCache(['channel', 'get'])) === null || _b === void 0 ? void 0 : _b.find(({ data }) => { var _a; return ((_a = data.pinnedMessage) === null || _a === void 0 ? void 0 : _a.messageId) === messageId; })) === null || _c === void 0 ? void 0 : _c.data.channelId;
|
|
19662
|
+
}
|
|
19663
|
+
if (!channelId)
|
|
19664
|
+
return;
|
|
19665
|
+
getChannel$1(channelId).catch(() => {
|
|
19666
|
+
/* silent per spec; UIKit renders no error toast */
|
|
19667
|
+
});
|
|
19668
|
+
};
|
|
19669
|
+
|
|
19670
|
+
/* begin_public_function
|
|
19671
|
+
id: message.pin
|
|
19672
|
+
*/
|
|
19673
|
+
/**
|
|
19674
|
+
* ```js
|
|
19675
|
+
* import { MessageRepository } from '@amityco/ts-sdk'
|
|
19676
|
+
* const channel = await MessageRepository.pinMessage(messageId)
|
|
19677
|
+
* console.log(channel.pinnedMessage)
|
|
19678
|
+
* ```
|
|
19679
|
+
*
|
|
19680
|
+
* Pins a {@link Amity.Message} in its livestream (`live`) channel. A channel holds at
|
|
19681
|
+
* most one pinned message: pinning a different message replaces the current pin in a
|
|
19682
|
+
* single step — no unpin is needed first. Pinning the message that is already pinned is
|
|
19683
|
+
* rejected by the server (400).
|
|
19684
|
+
*
|
|
19685
|
+
* The caller must hold the `PIN_MESSAGE` permission in the channel (or be an admin with
|
|
19686
|
+
* `ModerateChannel`). The server also rejects pinning a deleted message, a message whose
|
|
19687
|
+
* author is banned from the channel or globally banned, and pinning in any channel type
|
|
19688
|
+
* other than `live`. On any error the pin state is left unchanged.
|
|
19689
|
+
*
|
|
19690
|
+
* The response is the affected channel; it is ingested into cache and fires
|
|
19691
|
+
* `local.channel.updated`, so `ChannelRepository.getChannel` observers update without
|
|
19692
|
+
* waiting for the `channel.messagePinned` realtime event.
|
|
19693
|
+
*
|
|
19694
|
+
* @param messageId the **internal** ID of the {@link Amity.Message} to pin
|
|
19695
|
+
* @returns the updated {@link Amity.Channel}, with `pinnedMessage` set
|
|
19696
|
+
*
|
|
19697
|
+
* @category Message API
|
|
19698
|
+
* @async
|
|
19699
|
+
*/
|
|
19700
|
+
const pinMessage = async (messageId) => {
|
|
19701
|
+
const client = getActiveClient();
|
|
19702
|
+
client.log('message/pinMessage', messageId);
|
|
19703
|
+
let payload;
|
|
19704
|
+
try {
|
|
19705
|
+
({ data: payload } = await client.http.post(`/api/v5/messages/${encodeURIComponent(messageId)}/pin`));
|
|
19706
|
+
}
|
|
19707
|
+
catch (error) {
|
|
19708
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === 400301 /* Amity.ServerError.PERMISSION_DENIED */) {
|
|
19709
|
+
refreshChannelPermissionsForMessage(messageId);
|
|
19710
|
+
}
|
|
19711
|
+
throw error;
|
|
19712
|
+
}
|
|
19713
|
+
const data = await prepareChannelPayload(payload);
|
|
19714
|
+
if (client.cache)
|
|
19715
|
+
ingestInCache(data);
|
|
19716
|
+
fireEvent('local.channel.updated', data);
|
|
19717
|
+
return constructChannelObject(data.channels[0]);
|
|
19718
|
+
};
|
|
19719
|
+
/* end_public_function */
|
|
19720
|
+
|
|
19721
|
+
/* begin_public_function
|
|
19722
|
+
id: message.unpin
|
|
19723
|
+
*/
|
|
19724
|
+
/**
|
|
19725
|
+
* ```js
|
|
19726
|
+
* import { MessageRepository } from '@amityco/ts-sdk'
|
|
19727
|
+
* const channel = await MessageRepository.unpinMessage(messageId)
|
|
19728
|
+
* console.log(channel.pinnedMessage) // null
|
|
19729
|
+
* ```
|
|
19730
|
+
*
|
|
19731
|
+
* Removes the pin from a {@link Amity.Message}. `messageId` must be the message that is
|
|
19732
|
+
* **currently** pinned in its channel; otherwise the server answers 400 — this is
|
|
19733
|
+
* deliberate, so a stale client cannot clear a pin that someone else has since replaced.
|
|
19734
|
+
* On that error, re-read the channel (or rely on the `channel.messagePinned` event) to
|
|
19735
|
+
* get the current pin.
|
|
19736
|
+
*
|
|
19737
|
+
* The caller must hold the `PIN_MESSAGE` permission in the channel (or be an admin with
|
|
19738
|
+
* `ModerateChannel`). Unpinning is allowed regardless of channel type and stream state.
|
|
19739
|
+
*
|
|
19740
|
+
* The response is the affected channel; it is ingested into cache and fires
|
|
19741
|
+
* `local.channel.updated`, so `ChannelRepository.getChannel` observers update without
|
|
19742
|
+
* waiting for the `channel.messageUnpinned` realtime event.
|
|
19743
|
+
*
|
|
19744
|
+
* @param messageId the **internal** ID of the currently pinned {@link Amity.Message}
|
|
19745
|
+
* @returns the updated {@link Amity.Channel}, with `pinnedMessage` cleared
|
|
19746
|
+
*
|
|
19747
|
+
* @category Message API
|
|
19748
|
+
* @async
|
|
19749
|
+
*/
|
|
19750
|
+
const unpinMessage = async (messageId) => {
|
|
19751
|
+
const client = getActiveClient();
|
|
19752
|
+
client.log('message/unpinMessage', messageId);
|
|
19753
|
+
let payload;
|
|
19754
|
+
try {
|
|
19755
|
+
({ data: payload } = await client.http.delete(`/api/v5/messages/${encodeURIComponent(messageId)}/pin`));
|
|
19756
|
+
}
|
|
19757
|
+
catch (error) {
|
|
19758
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === 400301 /* Amity.ServerError.PERMISSION_DENIED */) {
|
|
19759
|
+
refreshChannelPermissionsForMessage(messageId);
|
|
19760
|
+
}
|
|
19761
|
+
throw error;
|
|
19762
|
+
}
|
|
19763
|
+
const data = await prepareChannelPayload(payload);
|
|
19764
|
+
if (client.cache)
|
|
19765
|
+
ingestInCache(data);
|
|
19766
|
+
fireEvent('local.channel.updated', data);
|
|
19767
|
+
return constructChannelObject(data.channels[0]);
|
|
19768
|
+
};
|
|
19769
|
+
/* end_public_function */
|
|
19770
|
+
|
|
18914
19771
|
/**
|
|
18915
19772
|
* ```js
|
|
18916
19773
|
* import { MessageRepository } from '@amityco/ts-sdk'
|
|
@@ -19613,6 +20470,7 @@ class MessageLiveCollectionController extends LiveCollectionController {
|
|
|
19613
20470
|
|
|
19614
20471
|
/* begin_public_function
|
|
19615
20472
|
id: message.query
|
|
20473
|
+
spec: SDK/API/message/getMessages/v1.md
|
|
19616
20474
|
*/
|
|
19617
20475
|
/**
|
|
19618
20476
|
* ```js
|
|
@@ -19807,13 +20665,15 @@ const searchMessage = (params, callback) => {
|
|
|
19807
20665
|
};
|
|
19808
20666
|
/* end_public_function */
|
|
19809
20667
|
|
|
19810
|
-
var index$
|
|
20668
|
+
var index$o = /*#__PURE__*/Object.freeze({
|
|
19811
20669
|
__proto__: null,
|
|
19812
20670
|
createMessage: createMessage,
|
|
19813
20671
|
updateMessage: updateMessage,
|
|
19814
20672
|
editMessage: editMessage,
|
|
19815
20673
|
deleteMessage: deleteMessage,
|
|
19816
20674
|
softDeleteMessage: softDeleteMessage,
|
|
20675
|
+
pinMessage: pinMessage,
|
|
20676
|
+
unpinMessage: unpinMessage,
|
|
19817
20677
|
markAsDelivered: markAsDelivered,
|
|
19818
20678
|
getReadUsers: getReadUsers,
|
|
19819
20679
|
getDeliveredUsers: getDeliveredUsers,
|
|
@@ -20243,6 +21103,7 @@ class SubChannelLiveCollectionController extends LiveCollectionController {
|
|
|
20243
21103
|
/* eslint-disable no-use-before-define */
|
|
20244
21104
|
/* begin_public_function
|
|
20245
21105
|
id: subchannel.query
|
|
21106
|
+
spec: SDK/API/subChannel/getSubChannels/v1.md
|
|
20246
21107
|
*/
|
|
20247
21108
|
/**
|
|
20248
21109
|
* ```js
|
|
@@ -20343,7 +21204,7 @@ const stopMessageReceiptSync = (subChannelId) => {
|
|
|
20343
21204
|
};
|
|
20344
21205
|
/* end_public_function */
|
|
20345
21206
|
|
|
20346
|
-
var index$
|
|
21207
|
+
var index$n = /*#__PURE__*/Object.freeze({
|
|
20347
21208
|
__proto__: null,
|
|
20348
21209
|
getSubChannelByIds: getSubChannels$1,
|
|
20349
21210
|
createSubChannel: createSubChannel,
|
|
@@ -20451,6 +21312,9 @@ const getChannel = (channelId, callback) => {
|
|
|
20451
21312
|
onChannelMemberBanned,
|
|
20452
21313
|
onChannelMemberUnbanned,
|
|
20453
21314
|
onChannelSetMuted,
|
|
21315
|
+
onChannelMessagePinned,
|
|
21316
|
+
onChannelMessageUnpinned,
|
|
21317
|
+
onChannelPinnedMessageDeleted,
|
|
20454
21318
|
convertEventPayload(onChannelMarkerFetched, 'entityId', 'channel'),
|
|
20455
21319
|
convertEventPayload(onChannelMarkerUpdated, 'entityId', 'channel'),
|
|
20456
21320
|
convertEventPayload((callback) => {
|
|
@@ -21076,6 +21940,14 @@ class ChannelLiveCollectionController extends LiveCollectionController {
|
|
|
21076
21940
|
return;
|
|
21077
21941
|
if (messagePreviewSetting ===
|
|
21078
21942
|
"message-preview-not-include-deleted" /* Amity.MessagePreviewSetting.MESSAGE_PREVIEW_NOT_INCLUDE_DELETED */) {
|
|
21943
|
+
// The replacement preview the server sends back is an OLDER
|
|
21944
|
+
// message than the one just deleted, and
|
|
21945
|
+
// updateChannelMessagePreviewCache drops any preview that is not
|
|
21946
|
+
// newer than what is cached — so without clearing the entry
|
|
21947
|
+
// first the refetch is a no-op and the channel keeps showing the
|
|
21948
|
+
// deleted message. getChannel's own live object already does
|
|
21949
|
+
// this; the live collections did not.
|
|
21950
|
+
dropFromCache(['messagePreviewChannel', 'get', message.channelId]);
|
|
21079
21951
|
await getChannel$1(message.channelId);
|
|
21080
21952
|
}
|
|
21081
21953
|
callback(message);
|
|
@@ -21187,6 +22059,7 @@ class ChannelLiveCollectionController extends LiveCollectionController {
|
|
|
21187
22059
|
/* eslint-disable no-use-before-define */
|
|
21188
22060
|
/* begin_public_function
|
|
21189
22061
|
id: channel.query
|
|
22062
|
+
spec: SDK/API/channel/getChannels/v1.md
|
|
21190
22063
|
*/
|
|
21191
22064
|
/**
|
|
21192
22065
|
* ```js
|
|
@@ -21800,6 +22673,14 @@ class SearchChannelLiveCollectionController extends LiveCollectionController {
|
|
|
21800
22673
|
return;
|
|
21801
22674
|
if (messagePreviewSetting ===
|
|
21802
22675
|
"message-preview-not-include-deleted" /* Amity.MessagePreviewSetting.MESSAGE_PREVIEW_NOT_INCLUDE_DELETED */) {
|
|
22676
|
+
// The replacement preview the server sends back is an OLDER
|
|
22677
|
+
// message than the one just deleted, and
|
|
22678
|
+
// updateChannelMessagePreviewCache drops any preview that is not
|
|
22679
|
+
// newer than what is cached — so without clearing the entry
|
|
22680
|
+
// first the refetch is a no-op and the channel keeps showing the
|
|
22681
|
+
// deleted message. getChannel's own live object already does
|
|
22682
|
+
// this; the live collections did not.
|
|
22683
|
+
dropFromCache(['messagePreviewChannel', 'get', message.channelId]);
|
|
21803
22684
|
await getChannel$1(message.channelId);
|
|
21804
22685
|
}
|
|
21805
22686
|
callback(message);
|
|
@@ -22294,7 +23175,7 @@ const searchMembers$1 = (params, callback, config) => {
|
|
|
22294
23175
|
};
|
|
22295
23176
|
/* end_public_function */
|
|
22296
23177
|
|
|
22297
|
-
var index$
|
|
23178
|
+
var index$m = /*#__PURE__*/Object.freeze({
|
|
22298
23179
|
__proto__: null,
|
|
22299
23180
|
addMembers: addMembers$1,
|
|
22300
23181
|
removeMembers: removeMembers$1,
|
|
@@ -22516,7 +23397,7 @@ const unmuteMembers = async (channelId, userIds) => {
|
|
|
22516
23397
|
};
|
|
22517
23398
|
/* end_public_function */
|
|
22518
23399
|
|
|
22519
|
-
var index$
|
|
23400
|
+
var index$l = /*#__PURE__*/Object.freeze({
|
|
22520
23401
|
__proto__: null,
|
|
22521
23402
|
addRole: addRole,
|
|
22522
23403
|
removeRole: removeRole,
|
|
@@ -22526,10 +23407,10 @@ var index$k = /*#__PURE__*/Object.freeze({
|
|
|
22526
23407
|
unmuteMembers: unmuteMembers
|
|
22527
23408
|
});
|
|
22528
23409
|
|
|
22529
|
-
var index$
|
|
23410
|
+
var index$k = /*#__PURE__*/Object.freeze({
|
|
22530
23411
|
__proto__: null,
|
|
22531
|
-
Membership: index$
|
|
22532
|
-
Moderation: index$
|
|
23412
|
+
Membership: index$m,
|
|
23413
|
+
Moderation: index$l,
|
|
22533
23414
|
getChannelByIds: getChannelByIds$1,
|
|
22534
23415
|
createChannel: createChannel,
|
|
22535
23416
|
updateChannel: updateChannel,
|
|
@@ -22547,6 +23428,8 @@ var index$j = /*#__PURE__*/Object.freeze({
|
|
|
22547
23428
|
onChannelJoined: onChannelJoined,
|
|
22548
23429
|
onChannelLeft: onChannelLeft,
|
|
22549
23430
|
onChannelSetMuted: onChannelSetMuted,
|
|
23431
|
+
onChannelMessagePinned: onChannelMessagePinned,
|
|
23432
|
+
onChannelMessageUnpinned: onChannelMessageUnpinned,
|
|
22550
23433
|
onChannelMemberAdded: onChannelMemberAdded,
|
|
22551
23434
|
onChannelMemberRemoved: onChannelMemberRemoved,
|
|
22552
23435
|
onChannelMemberBanned: onChannelMemberBanned,
|
|
@@ -22564,7 +23447,11 @@ var index$j = /*#__PURE__*/Object.freeze({
|
|
|
22564
23447
|
isUnreadCountSupport: isUnreadCountSupport,
|
|
22565
23448
|
convertFromRaw: convertFromRaw,
|
|
22566
23449
|
preUpdateChannelCache: preUpdateChannelCache,
|
|
22567
|
-
prepareChannelPayload: prepareChannelPayload
|
|
23450
|
+
prepareChannelPayload: prepareChannelPayload,
|
|
23451
|
+
findCachedChannelByAnyId: findCachedChannelByAnyId,
|
|
23452
|
+
findCachedChannelForPin: findCachedChannelForPin,
|
|
23453
|
+
updatePinnedMessageCache: updatePinnedMessageCache,
|
|
23454
|
+
applyChannelRolePayload: applyChannelRolePayload
|
|
22568
23455
|
});
|
|
22569
23456
|
|
|
22570
23457
|
const saveCommunityUsers = (communities, communityUsers) => {
|
|
@@ -23697,6 +24584,7 @@ const applyFilter = (data, params) => {
|
|
|
23697
24584
|
};
|
|
23698
24585
|
/* begin_public_function
|
|
23699
24586
|
id: community.membership.query
|
|
24587
|
+
spec: API/community/get-members/v2.md
|
|
23700
24588
|
*/
|
|
23701
24589
|
/**
|
|
23702
24590
|
* ```js
|
|
@@ -23917,6 +24805,7 @@ class SearchCommunityMembersLiveCollectionController extends LiveCollectionContr
|
|
|
23917
24805
|
|
|
23918
24806
|
/* begin_public_function
|
|
23919
24807
|
id: community.membership.query
|
|
24808
|
+
spec: API/community/get-members/v2.md
|
|
23920
24809
|
*/
|
|
23921
24810
|
/**
|
|
23922
24811
|
* ```js
|
|
@@ -23958,7 +24847,7 @@ const searchMembers = (params, callback, config) => {
|
|
|
23958
24847
|
};
|
|
23959
24848
|
/* end_public_function */
|
|
23960
24849
|
|
|
23961
|
-
var index$
|
|
24850
|
+
var index$j = /*#__PURE__*/Object.freeze({
|
|
23962
24851
|
__proto__: null,
|
|
23963
24852
|
addMembers: addMembers,
|
|
23964
24853
|
removeMembers: removeMembers,
|
|
@@ -24062,7 +24951,7 @@ class SearchCommunityLiveCollectionController extends LiveCollectionController {
|
|
|
24062
24951
|
}
|
|
24063
24952
|
|
|
24064
24953
|
/* begin_public_function
|
|
24065
|
-
id: community.
|
|
24954
|
+
id: community.search
|
|
24066
24955
|
*/
|
|
24067
24956
|
/**
|
|
24068
24957
|
* ```js
|
|
@@ -24854,6 +25743,9 @@ class SemanticSearchCommunityLiveCollectionController extends LiveCollectionCont
|
|
|
24854
25743
|
* @category Posts Live Collection
|
|
24855
25744
|
*
|
|
24856
25745
|
*/
|
|
25746
|
+
/* begin_public_function
|
|
25747
|
+
id: community.semantic-search
|
|
25748
|
+
*/
|
|
24857
25749
|
const semanticSearchCommunities = (params, callback, config) => {
|
|
24858
25750
|
const { log, cache } = getActiveClient();
|
|
24859
25751
|
if (!cache) {
|
|
@@ -25209,7 +26101,7 @@ const unbanMembers = async (communityId, userIds) => {
|
|
|
25209
26101
|
};
|
|
25210
26102
|
/* end_public_function */
|
|
25211
26103
|
|
|
25212
|
-
var index$
|
|
26104
|
+
var index$i = /*#__PURE__*/Object.freeze({
|
|
25213
26105
|
__proto__: null,
|
|
25214
26106
|
addRoles: addRoles,
|
|
25215
26107
|
removeRoles: removeRoles,
|
|
@@ -25217,10 +26109,10 @@ var index$h = /*#__PURE__*/Object.freeze({
|
|
|
25217
26109
|
unbanMembers: unbanMembers
|
|
25218
26110
|
});
|
|
25219
26111
|
|
|
25220
|
-
var index$
|
|
26112
|
+
var index$h = /*#__PURE__*/Object.freeze({
|
|
25221
26113
|
__proto__: null,
|
|
25222
|
-
Moderation: index$
|
|
25223
|
-
Membership: index$
|
|
26114
|
+
Moderation: index$i,
|
|
26115
|
+
Membership: index$j,
|
|
25224
26116
|
getCommunityByIds: getCommunities$1,
|
|
25225
26117
|
createCommunity: createCommunity,
|
|
25226
26118
|
updateCommunity: updateCommunity,
|
|
@@ -25456,14 +26348,14 @@ const getCategories = (params, callback, config) => {
|
|
|
25456
26348
|
};
|
|
25457
26349
|
/* end_public_function */
|
|
25458
26350
|
|
|
25459
|
-
var index$
|
|
26351
|
+
var index$g = /*#__PURE__*/Object.freeze({
|
|
25460
26352
|
__proto__: null,
|
|
25461
26353
|
getCategory: getCategory,
|
|
25462
26354
|
getCategories: getCategories
|
|
25463
26355
|
});
|
|
25464
26356
|
|
|
25465
26357
|
/* begin_public_function
|
|
25466
|
-
id: feed.query.global_feed
|
|
26358
|
+
id: feed.query.global_feed.page
|
|
25467
26359
|
*/
|
|
25468
26360
|
/**
|
|
25469
26361
|
*
|
|
@@ -25755,6 +26647,11 @@ const createCommentOptimistic = (bundle) => {
|
|
|
25755
26647
|
targetType: 'community',
|
|
25756
26648
|
dataType: 'text',
|
|
25757
26649
|
syncState: "syncing" /* Amity.SyncState.Syncing */,
|
|
26650
|
+
// In a gated community the optimistic object stays out of public collections until the
|
|
26651
|
+
// response settles the status; the author's own view still updates through the local event
|
|
26652
|
+
approvalStatus: isCommentApprovalRequired(bundle)
|
|
26653
|
+
? "pending" /* Amity.CommentApprovalStatusEnum.Pending */
|
|
26654
|
+
: "approved" /* Amity.CommentApprovalStatusEnum.Approved */,
|
|
25758
26655
|
};
|
|
25759
26656
|
const cachedAt = UNSYNCED_OBJECT_CACHED_AT_VALUE;
|
|
25760
26657
|
pushToCache(['comment', 'get', comment.commentId], comment, { cachedAt });
|
|
@@ -25771,32 +26668,57 @@ const createCommentOptimistic = (bundle) => {
|
|
|
25771
26668
|
* ```js
|
|
25772
26669
|
* import { CommentRepository } from '@amityco/ts-sdk'
|
|
25773
26670
|
* const newComment = await CommentRepository.createComment(bundle)
|
|
26671
|
+
*
|
|
26672
|
+
* // Server-confirmed only: nothing is shown until the request succeeds
|
|
26673
|
+
* const confirmed = await CommentRepository.createComment(bundle, false)
|
|
25774
26674
|
* ```
|
|
25775
26675
|
*
|
|
25776
26676
|
* Creates an {@link Amity.Comment}
|
|
25777
26677
|
*
|
|
26678
|
+
* With `isOptimistic` (the default) a local comment appears at once with `syncState: 'syncing'`,
|
|
26679
|
+
* moves to `'synced'` when the server confirms it and to `'error'` if the request fails, so the
|
|
26680
|
+
* caller can offer a retry. With `isOptimistic: false` nothing is created locally until the
|
|
26681
|
+
* server answers: on success the comment arrives already `'synced'`; on failure no comment
|
|
26682
|
+
* entity exists anywhere and the promise rejects.
|
|
26683
|
+
*
|
|
25778
26684
|
* @param bundle The data necessary to create a new {@link Amity.Comment}
|
|
26685
|
+
* @param isOptimistic Show a local comment before the server confirms it. Default `true`.
|
|
26686
|
+
* Ignored when the client cache is disabled, since there is nowhere to hold the local comment.
|
|
25779
26687
|
* @returns The newly created {@link Amity.Comment}
|
|
25780
26688
|
*
|
|
25781
26689
|
* @category Comment API
|
|
25782
26690
|
* @async
|
|
25783
26691
|
*/
|
|
25784
|
-
const createComment = async (bundle) => {
|
|
26692
|
+
const createComment = async (bundle, isOptimistic = true) => {
|
|
25785
26693
|
const client = getActiveClient();
|
|
25786
|
-
client.log('comment/createComment', bundle);
|
|
25787
|
-
|
|
26694
|
+
client.log('comment/createComment', Object.assign(Object.assign({}, bundle), { isOptimistic }));
|
|
26695
|
+
// Without a local comment the server assigns the id; with one, the same id travels through the
|
|
26696
|
+
// optimistic object, the response and every realtime event so each step recognises it.
|
|
26697
|
+
const optimisticData = isOptimistic ? createCommentOptimistic(bundle) : undefined;
|
|
25788
26698
|
const commentId = optimisticData === null || optimisticData === void 0 ? void 0 : optimisticData.commentId;
|
|
25789
26699
|
try {
|
|
25790
|
-
const { data } = await client.http.post('/api/v3/comments', Object.assign(Object.assign({}, bundle), { commentId }));
|
|
25791
|
-
const { comments } = data;
|
|
26700
|
+
const { data: payload } = await client.http.post('/api/v3/comments', Object.assign(Object.assign({}, bundle), { commentId }));
|
|
25792
26701
|
// BE always returns an array of comments If it got record 0 from BE it might have a problem on creation logic
|
|
25793
|
-
if (comments.length === 0)
|
|
26702
|
+
if (payload.comments.length === 0)
|
|
25794
26703
|
throw new Error('Comment not created');
|
|
26704
|
+
// Absent `approvalStatus` means approved; the result is the only source of the status.
|
|
26705
|
+
// The confirmed comment is written as `synced` so the cache itself tells the two states apart
|
|
26706
|
+
// (a local-event subscriber is not guaranteed to be listening).
|
|
26707
|
+
const prepared = prepareCommentPayload(payload);
|
|
26708
|
+
const data = Object.assign(Object.assign({}, prepared), { comments: prepared.comments.map(comment => comment.commentId === (commentId !== null && commentId !== void 0 ? commentId : comment.commentId)
|
|
26709
|
+
? Object.assign(Object.assign({}, comment), { syncState: "synced" /* Amity.SyncState.Synced */ }) : comment) });
|
|
26710
|
+
const { comments } = data;
|
|
25795
26711
|
const cachedAt = client.cache && Date.now();
|
|
25796
26712
|
if (client.cache)
|
|
25797
26713
|
ingestInCache(data, { cachedAt });
|
|
25798
26714
|
if (['post', 'content'].includes(bundle.referenceType)) {
|
|
25799
|
-
|
|
26715
|
+
if (isCommentPending(comments[0])) {
|
|
26716
|
+
// Not counted for anyone else until approved; the author sees their own +1
|
|
26717
|
+
recordPendingAuthoredComment(comments[0]);
|
|
26718
|
+
}
|
|
26719
|
+
else {
|
|
26720
|
+
PostCommentCountEngine$1.getInstance().queueCommentChangeTask(new CreateTask(bundle.referenceId, comments[0].commentId, comments[0].createdAt));
|
|
26721
|
+
}
|
|
25800
26722
|
}
|
|
25801
26723
|
else if (bundle.referenceType === 'story') {
|
|
25802
26724
|
const storyIndex = pullFromCache([
|
|
@@ -25817,9 +26739,9 @@ const createComment = async (bundle) => {
|
|
|
25817
26739
|
categories: [],
|
|
25818
26740
|
comments,
|
|
25819
26741
|
communities: [],
|
|
25820
|
-
communityUsers:
|
|
25821
|
-
files:
|
|
25822
|
-
users:
|
|
26742
|
+
communityUsers: payload.communityUsers,
|
|
26743
|
+
files: payload.files,
|
|
26744
|
+
users: payload.users,
|
|
25823
26745
|
});
|
|
25824
26746
|
}
|
|
25825
26747
|
}
|
|
@@ -25827,9 +26749,9 @@ const createComment = async (bundle) => {
|
|
|
25827
26749
|
fireEvent('local.comment.created', {
|
|
25828
26750
|
comments: [Object.assign(Object.assign({}, comments[0]), { syncState: "synced" /* Amity.SyncState.Synced */ })],
|
|
25829
26751
|
commentChildren: data.commentChildren,
|
|
25830
|
-
users:
|
|
25831
|
-
files:
|
|
25832
|
-
communityUsers:
|
|
26752
|
+
users: payload.users,
|
|
26753
|
+
files: payload.files,
|
|
26754
|
+
communityUsers: payload.communityUsers,
|
|
25833
26755
|
});
|
|
25834
26756
|
return {
|
|
25835
26757
|
data: LinkedObject.comment(comments[0]),
|
|
@@ -25837,9 +26759,17 @@ const createComment = async (bundle) => {
|
|
|
25837
26759
|
};
|
|
25838
26760
|
}
|
|
25839
26761
|
catch (e) {
|
|
26762
|
+
// Only a local comment has anything to mark as failed; a server-confirmed-only create leaves
|
|
26763
|
+
// no entity behind
|
|
25840
26764
|
if (optimisticData) {
|
|
26765
|
+
const failed = Object.assign(Object.assign({}, optimisticData), { syncState: "error" /* Amity.SyncState.Error */ });
|
|
26766
|
+
// Write the failure to the cache directly: the local event below only reaches pages that
|
|
26767
|
+
// observe comments, and the caller's retry UI reads the cached state
|
|
26768
|
+
pushToCache(['comment', 'get', failed.commentId], failed, {
|
|
26769
|
+
cachedAt: UNSYNCED_OBJECT_CACHED_AT_VALUE,
|
|
26770
|
+
});
|
|
25841
26771
|
fireEvent('local.comment.created', {
|
|
25842
|
-
comments: [
|
|
26772
|
+
comments: [failed],
|
|
25843
26773
|
commentChildren: [],
|
|
25844
26774
|
users: [],
|
|
25845
26775
|
files: [],
|
|
@@ -25872,16 +26802,26 @@ const createComment = async (bundle) => {
|
|
|
25872
26802
|
* @async
|
|
25873
26803
|
*/
|
|
25874
26804
|
const updateComment = async (commentId, patch) => {
|
|
26805
|
+
var _a;
|
|
25875
26806
|
const client = getActiveClient();
|
|
25876
26807
|
client.log('user/updateComment', patch);
|
|
25877
|
-
const
|
|
26808
|
+
const previous = (_a = pullFromCache(['comment', 'get', commentId])) === null || _a === void 0 ? void 0 : _a.data;
|
|
26809
|
+
const { data: payload } = await client.http.put(`/api/v3/comments/${encodeURIComponent(commentId)}`, patch);
|
|
26810
|
+
const data = prepareCommentPayload(payload);
|
|
26811
|
+
const updated = data.comments.find(comment => comment.commentId === commentId);
|
|
25878
26812
|
const cachedAt = client.cache && Date.now();
|
|
25879
26813
|
if (client.cache)
|
|
25880
26814
|
ingestInCache(data, { cachedAt });
|
|
25881
|
-
|
|
25882
|
-
|
|
26815
|
+
// An effective edit in a gated community sends the comment back for review: it leaves the
|
|
26816
|
+
// public reply list and the public count once. The `comment.updated` event below removes it
|
|
26817
|
+
// from the comment collections; the realtime echo finds it already pending and does nothing.
|
|
26818
|
+
if (isCommentPending(updated) && previous && isCommentApproved(previous)) {
|
|
26819
|
+
unlinkCommentFromParent(updated);
|
|
26820
|
+
applyCommentReReviewCount(updated);
|
|
26821
|
+
}
|
|
26822
|
+
fireEvent('comment.updated', payload);
|
|
25883
26823
|
return {
|
|
25884
|
-
data: LinkedObject.comment(
|
|
26824
|
+
data: LinkedObject.comment(updated),
|
|
25885
26825
|
cachedAt,
|
|
25886
26826
|
};
|
|
25887
26827
|
};
|
|
@@ -26021,7 +26961,13 @@ const deleteComment = async (commentId, permanent = false) => {
|
|
|
26021
26961
|
const post = (_b = pullFromCache(['post', 'get', comment.data.referenceId])) === null || _b === void 0 ? void 0 : _b.data;
|
|
26022
26962
|
if (post) {
|
|
26023
26963
|
const engine = PostCommentCountEngine$1.getInstance();
|
|
26024
|
-
|
|
26964
|
+
if (isCommentPending(comment.data)) {
|
|
26965
|
+
// Never counted for anyone else; only the author's own +1 goes away
|
|
26966
|
+
engine.removePendingAuthoredComment(post.postId, commentId);
|
|
26967
|
+
}
|
|
26968
|
+
else {
|
|
26969
|
+
engine.queueCommentChangeTask(new DeleteTask(post.postId, commentId));
|
|
26970
|
+
}
|
|
26025
26971
|
if (!deleted.parentId && ((_c = deleted.children /* c8 ignore next */) === null || _c === void 0 ? void 0 : _c.length) > 0) {
|
|
26026
26972
|
// NOTE: delete the parent comment will also remove all children comments
|
|
26027
26973
|
deleted.children.forEach((childCommentId) => {
|
|
@@ -26091,6 +27037,109 @@ const hardDeleteComment = async (commentId) => {
|
|
|
26091
27037
|
};
|
|
26092
27038
|
/* end_public_function */
|
|
26093
27039
|
|
|
27040
|
+
/* begin_public_function
|
|
27041
|
+
id: comment.approve
|
|
27042
|
+
*/
|
|
27043
|
+
/**
|
|
27044
|
+
* ```js
|
|
27045
|
+
* import { CommentRepository } from '@amityco/ts-sdk'
|
|
27046
|
+
*
|
|
27047
|
+
* const { data: comment } = await CommentRepository.approveComment('commentId')
|
|
27048
|
+
* ```
|
|
27049
|
+
*
|
|
27050
|
+
* Approves a {@link Amity.Comment} held for review, making it visible to everyone
|
|
27051
|
+
*
|
|
27052
|
+
* @param commentId The {@link Amity.Comment} ID to be approved
|
|
27053
|
+
* @return The {@link Amity.Comment} that was approved
|
|
27054
|
+
*
|
|
27055
|
+
* @category Comment API
|
|
27056
|
+
* @async
|
|
27057
|
+
*/
|
|
27058
|
+
const approveComment = async (commentId) => {
|
|
27059
|
+
const client = getActiveClient();
|
|
27060
|
+
client.log('comment/approveComment', commentId);
|
|
27061
|
+
// No request body, and nothing is revealed before the server confirms
|
|
27062
|
+
const { data: payload } = await client.http.post(`/api/v3/comments/${encodeURIComponent(commentId)}/approve`);
|
|
27063
|
+
const data = prepareCommentPayload(prepareMembershipPayload(payload, 'communityUsers'));
|
|
27064
|
+
const approved = data.comments.find(comment => comment.commentId === commentId);
|
|
27065
|
+
const cachedAt = client.cache && Date.now();
|
|
27066
|
+
if (client.cache)
|
|
27067
|
+
ingestInCache(data, { cachedAt });
|
|
27068
|
+
// The reveal path: parent link and exactly one count task. Applied here so it does not depend
|
|
27069
|
+
// on an observer being open; the event below and the realtime `comment.approved` that follows
|
|
27070
|
+
// find the work done and reconcile by comment id (collection insert, queue removal).
|
|
27071
|
+
linkCommentToParent(approved);
|
|
27072
|
+
applyCommentApprovedCount(approved);
|
|
27073
|
+
fireEvent('comment.approved', payload);
|
|
27074
|
+
return {
|
|
27075
|
+
data: LinkedObject.comment(approved),
|
|
27076
|
+
cachedAt,
|
|
27077
|
+
};
|
|
27078
|
+
};
|
|
27079
|
+
/* end_public_function */
|
|
27080
|
+
|
|
27081
|
+
// Rejected is terminal and implies deleted
|
|
27082
|
+
const markRejected = (comment) => (Object.assign(Object.assign({}, comment), { approvalStatus: "rejected" /* Amity.CommentApprovalStatusEnum.Rejected */, isDeleted: true }));
|
|
27083
|
+
/* begin_public_function
|
|
27084
|
+
id: comment.decline
|
|
27085
|
+
*/
|
|
27086
|
+
/**
|
|
27087
|
+
* ```js
|
|
27088
|
+
* import { CommentRepository } from '@amityco/ts-sdk'
|
|
27089
|
+
*
|
|
27090
|
+
* const { data: comment } = await CommentRepository.declineComment('commentId', 'Off-topic')
|
|
27091
|
+
* ```
|
|
27092
|
+
*
|
|
27093
|
+
* Declines a {@link Amity.Comment} held for review. A declined comment is also a deleted comment
|
|
27094
|
+
*
|
|
27095
|
+
* @param commentId The {@link Amity.Comment} ID to be declined
|
|
27096
|
+
* @param reason Optional reviewer's note, at most 250 characters, kept for the moderation record only
|
|
27097
|
+
* @return The {@link Amity.Comment} that was declined
|
|
27098
|
+
*
|
|
27099
|
+
* @category Comment API
|
|
27100
|
+
* @async
|
|
27101
|
+
*/
|
|
27102
|
+
const declineComment = async (commentId, reason) => {
|
|
27103
|
+
var _a, _b, _c, _d, _e, _f;
|
|
27104
|
+
const client = getActiveClient();
|
|
27105
|
+
client.log('comment/declineComment', commentId, reason);
|
|
27106
|
+
// Read before the request: the fallback when the response carries no comment
|
|
27107
|
+
const cached = (_a = pullFromCache(['comment', 'get', commentId])) === null || _a === void 0 ? void 0 : _a.data;
|
|
27108
|
+
// `reason` is surfaced to nobody; the key is absent from the body when the caller gives none
|
|
27109
|
+
const { data: payload } = await client.http.post(`/api/v3/comments/${encodeURIComponent(commentId)}/decline`, reason ? { reason } : undefined);
|
|
27110
|
+
// The BE contract (PDT-5135 §3) states the response body for approve only; for decline the
|
|
27111
|
+
// standard comment payload is assumed. Ingest whatever came back, and when the body carries no
|
|
27112
|
+
// comment fall back to the cached one so the delete path below still runs.
|
|
27113
|
+
const returned = (_b = payload === null || payload === void 0 ? void 0 : payload.comments) === null || _b === void 0 ? void 0 : _b.some(comment => comment.commentId === commentId);
|
|
27114
|
+
if (!returned && !cached)
|
|
27115
|
+
throw new Error('Comment not found after decline');
|
|
27116
|
+
const comments = returned
|
|
27117
|
+
? payload.comments.map(comment => comment.commentId === commentId ? markRejected(comment) : comment)
|
|
27118
|
+
: [markRejected(cached)];
|
|
27119
|
+
const declined = {
|
|
27120
|
+
comments,
|
|
27121
|
+
commentChildren: (_c = payload === null || payload === void 0 ? void 0 : payload.commentChildren) !== null && _c !== void 0 ? _c : [],
|
|
27122
|
+
users: (_d = payload === null || payload === void 0 ? void 0 : payload.users) !== null && _d !== void 0 ? _d : [],
|
|
27123
|
+
files: (_e = payload === null || payload === void 0 ? void 0 : payload.files) !== null && _e !== void 0 ? _e : [],
|
|
27124
|
+
communityUsers: (_f = payload === null || payload === void 0 ? void 0 : payload.communityUsers) !== null && _f !== void 0 ? _f : [],
|
|
27125
|
+
};
|
|
27126
|
+
// There is no `comment.declined` event: the existing delete path drops the comment from every
|
|
27127
|
+
// collection and the review queue, and moves no count because a pending comment was never counted.
|
|
27128
|
+
const data = prepareCommentPayload(prepareMembershipPayload(declined, 'communityUsers'));
|
|
27129
|
+
const rejected = data.comments.find(comment => comment.commentId === commentId);
|
|
27130
|
+
const cachedAt = client.cache && Date.now();
|
|
27131
|
+
if (client.cache)
|
|
27132
|
+
ingestInCache(data, { cachedAt });
|
|
27133
|
+
unlinkCommentFromParent(rejected);
|
|
27134
|
+
releasePendingAuthoredComment(rejected);
|
|
27135
|
+
fireEvent('comment.deleted', declined);
|
|
27136
|
+
return {
|
|
27137
|
+
data: LinkedObject.comment(rejected),
|
|
27138
|
+
cachedAt,
|
|
27139
|
+
};
|
|
27140
|
+
};
|
|
27141
|
+
/* end_public_function */
|
|
27142
|
+
|
|
26094
27143
|
/* begin_public_function
|
|
26095
27144
|
id: comment.flag
|
|
26096
27145
|
*/
|
|
@@ -26176,6 +27225,7 @@ const isCommentFlaggedByMe = async (commentId) => {
|
|
|
26176
27225
|
/* end_public_function */
|
|
26177
27226
|
|
|
26178
27227
|
const getComment$1 = async (commentId) => {
|
|
27228
|
+
var _a;
|
|
26179
27229
|
const client = getActiveClient();
|
|
26180
27230
|
client.log('comment/getComment', commentId);
|
|
26181
27231
|
isInTombstone('comment', commentId);
|
|
@@ -26186,7 +27236,11 @@ const getComment$1 = async (commentId) => {
|
|
|
26186
27236
|
data = response.data;
|
|
26187
27237
|
}
|
|
26188
27238
|
catch (error) {
|
|
26189
|
-
|
|
27239
|
+
// A pending comment answers 404 to anyone but its author and reviewers. That is a
|
|
27240
|
+
// visibility answer, not a deletion — never tombstone a comment known to be pending.
|
|
27241
|
+
const cached = (_a = pullFromCache(['comment', 'get', commentId])) === null || _a === void 0 ? void 0 : _a.data;
|
|
27242
|
+
const isKnownPending = !!cached && isCommentPending(cached);
|
|
27243
|
+
if (!isKnownPending && checkIfShouldGoesToTombstone(error === null || error === void 0 ? void 0 : error.code)) {
|
|
26190
27244
|
pushToTombstone('comment', commentId);
|
|
26191
27245
|
}
|
|
26192
27246
|
throw error;
|
|
@@ -26313,6 +27367,7 @@ const onLocalCommentReactionRemoved = (callback) => {
|
|
|
26313
27367
|
*/
|
|
26314
27368
|
const getComment = (commentId, callback) => {
|
|
26315
27369
|
return liveObject(commentId, callback, 'commentId', getComment$1, [
|
|
27370
|
+
onCommentApproved,
|
|
26316
27371
|
onCommentDeleteLocal,
|
|
26317
27372
|
onCommentDeleted,
|
|
26318
27373
|
onCommentFlagged,
|
|
@@ -26326,28 +27381,31 @@ const getComment = (commentId, callback) => {
|
|
|
26326
27381
|
};
|
|
26327
27382
|
/* end_public_function */
|
|
26328
27383
|
|
|
26329
|
-
|
|
26330
|
-
|
|
26331
|
-
|
|
26332
|
-
|
|
26333
|
-
|
|
26334
|
-
|
|
26335
|
-
|
|
26336
|
-
|
|
26337
|
-
|
|
26338
|
-
|
|
26339
|
-
|
|
26340
|
-
|
|
26341
|
-
|
|
26342
|
-
|
|
26343
|
-
|
|
26344
|
-
|
|
27384
|
+
/**
|
|
27385
|
+
* ```js
|
|
27386
|
+
* import { onCommentCreated } from '@amityco/ts-sdk'
|
|
27387
|
+
* const dispose = onCommentCreated(comment => {
|
|
27388
|
+
* // ...
|
|
27389
|
+
* })
|
|
27390
|
+
* ```
|
|
27391
|
+
*
|
|
27392
|
+
* Fired when a {@link Amity.InternalComment} has been created
|
|
27393
|
+
*
|
|
27394
|
+
* @param callback The function to call when the event was fired
|
|
27395
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
27396
|
+
*
|
|
27397
|
+
* @category Comment Events
|
|
27398
|
+
*/
|
|
27399
|
+
const onCommentCreatedLocal = (callback) => {
|
|
27400
|
+
return createLocalCommentEventSubscriber('local.comment.created', callback);
|
|
27401
|
+
};
|
|
26345
27402
|
|
|
26346
27403
|
var EnumCommentActions;
|
|
26347
27404
|
(function (EnumCommentActions) {
|
|
26348
27405
|
EnumCommentActions["OnCommentCreated"] = "onCommentCreated";
|
|
26349
27406
|
EnumCommentActions["OnCommentUpdated"] = "onCommentUpdated";
|
|
26350
27407
|
EnumCommentActions["OnCommentDeleted"] = "onCommentDeleted";
|
|
27408
|
+
EnumCommentActions["OnCommentApproved"] = "onCommentApproved";
|
|
26351
27409
|
EnumCommentActions["OnCommentFlagged"] = "onCommentFlagged";
|
|
26352
27410
|
EnumCommentActions["OnCommentUnflagged"] = "onCommentUnflagged";
|
|
26353
27411
|
EnumCommentActions["OnCommentReactionAdded"] = "onCommentReactionAdded";
|
|
@@ -26370,15 +27428,17 @@ class CommentQueryStreamController extends QueryStreamController {
|
|
|
26370
27428
|
}
|
|
26371
27429
|
appendToQueryStream(response, direction, refresh = false) {
|
|
26372
27430
|
var _a, _b;
|
|
27431
|
+
// The public list is approved-only even when the server widens the read for a reviewer
|
|
27432
|
+
const commentIds = response.comments.filter(isCommentApproved).map(getResolver('comment'));
|
|
26373
27433
|
if (refresh) {
|
|
26374
27434
|
pushToCache(this.cacheKey, {
|
|
26375
|
-
data:
|
|
27435
|
+
data: commentIds,
|
|
26376
27436
|
});
|
|
26377
27437
|
}
|
|
26378
27438
|
else {
|
|
26379
27439
|
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
26380
27440
|
const comments = (_b = collection === null || collection === void 0 ? void 0 : collection.data) !== null && _b !== void 0 ? _b : [];
|
|
26381
|
-
pushToCache(this.cacheKey, Object.assign(Object.assign({}, collection), { data: [...new Set([...comments, ...
|
|
27441
|
+
pushToCache(this.cacheKey, Object.assign(Object.assign({}, collection), { data: [...new Set([...comments, ...commentIds])] }));
|
|
26382
27442
|
}
|
|
26383
27443
|
}
|
|
26384
27444
|
reactor(action) {
|
|
@@ -26397,8 +27457,19 @@ class CommentQueryStreamController extends QueryStreamController {
|
|
|
26397
27457
|
return;
|
|
26398
27458
|
}
|
|
26399
27459
|
if (action === EnumCommentActions.OnCommentCreated) {
|
|
27460
|
+
// A pending comment reaches clients over realtime before anyone may see it: persist
|
|
27461
|
+
// only, no insert and no emit. `comment.approved` is the reveal signal.
|
|
27462
|
+
if (!isCommentApproved(comment))
|
|
27463
|
+
return;
|
|
27464
|
+
collection.data = [...new Set([comment.commentId, ...collection.data])];
|
|
27465
|
+
}
|
|
27466
|
+
if (action === EnumCommentActions.OnCommentApproved) {
|
|
26400
27467
|
collection.data = [...new Set([comment.commentId, ...collection.data])];
|
|
26401
27468
|
}
|
|
27469
|
+
// An effective edit in a gated community returns the comment to review: it leaves the list
|
|
27470
|
+
if (action === EnumCommentActions.OnCommentUpdated && isCommentPending(comment)) {
|
|
27471
|
+
collection.data = collection.data.filter(commentId => commentId !== comment.commentId);
|
|
27472
|
+
}
|
|
26402
27473
|
pushToCache(this.cacheKey, collection);
|
|
26403
27474
|
this.notifyChange({ origin: "event" /* Amity.LiveDataOrigin.EVENT */, loading: false });
|
|
26404
27475
|
};
|
|
@@ -26408,24 +27479,22 @@ class CommentQueryStreamController extends QueryStreamController {
|
|
|
26408
27479
|
}
|
|
26409
27480
|
}
|
|
26410
27481
|
|
|
26411
|
-
|
|
26412
|
-
|
|
26413
|
-
|
|
26414
|
-
|
|
26415
|
-
|
|
26416
|
-
|
|
26417
|
-
|
|
26418
|
-
|
|
26419
|
-
|
|
26420
|
-
|
|
26421
|
-
|
|
26422
|
-
|
|
26423
|
-
|
|
26424
|
-
|
|
26425
|
-
|
|
26426
|
-
|
|
26427
|
-
return createLocalCommentEventSubscriber('local.comment.created', callback);
|
|
26428
|
-
};
|
|
27482
|
+
class CommentPaginationController extends PaginationController {
|
|
27483
|
+
async getRequest(queryParams, token) {
|
|
27484
|
+
var _a;
|
|
27485
|
+
const { pageSize, limit, includeDeleted } = queryParams, params = __rest(queryParams, ["pageSize", "limit", "includeDeleted"]);
|
|
27486
|
+
const effectiveLimit = (_a = pageSize !== null && pageSize !== void 0 ? pageSize : limit) !== null && _a !== void 0 ? _a : COLLECTION_DEFAULT_PAGINATION_LIMIT;
|
|
27487
|
+
const baseOptions = {
|
|
27488
|
+
type: params.sortBy || queryParams.limit || queryParams.pageSize ? 'pagination' : undefined,
|
|
27489
|
+
};
|
|
27490
|
+
const options = token
|
|
27491
|
+
? Object.assign(Object.assign({}, baseOptions), { token }) : Object.assign(Object.assign({}, baseOptions), { pageSize: effectiveLimit, limit: effectiveLimit });
|
|
27492
|
+
const { data: queryResponse } = await this.http.get(`/api/v3/comments`, {
|
|
27493
|
+
params: Object.assign(Object.assign({}, params), { isDeleted: inferIsDeleted(includeDeleted), options }),
|
|
27494
|
+
});
|
|
27495
|
+
return queryResponse;
|
|
27496
|
+
}
|
|
27497
|
+
}
|
|
26429
27498
|
|
|
26430
27499
|
class CommentLiveCollectionController extends LiveCollectionController {
|
|
26431
27500
|
constructor(query, callback) {
|
|
@@ -26461,6 +27530,7 @@ class CommentLiveCollectionController extends LiveCollectionController {
|
|
|
26461
27530
|
{ fn: onCommentCreated, action: EnumCommentActions.OnCommentCreated },
|
|
26462
27531
|
{ fn: onCommentUpdated, action: EnumCommentActions.OnCommentUpdated },
|
|
26463
27532
|
{ fn: onCommentDeleted, action: EnumCommentActions.OnCommentDeleted },
|
|
27533
|
+
{ fn: onCommentApproved, action: EnumCommentActions.OnCommentApproved },
|
|
26464
27534
|
{ fn: onCommentFlagged, action: EnumCommentActions.OnCommentFlagged },
|
|
26465
27535
|
{ fn: onCommentUnflagged, action: EnumCommentActions.OnCommentUnflagged },
|
|
26466
27536
|
{ fn: onCommentReactionAdded, action: EnumCommentActions.OnCommentReactionAdded },
|
|
@@ -26494,7 +27564,8 @@ class CommentLiveCollectionController extends LiveCollectionController {
|
|
|
26494
27564
|
});
|
|
26495
27565
|
}
|
|
26496
27566
|
applyFilter(data) {
|
|
26497
|
-
|
|
27567
|
+
// Approved-only, for every caller including the author of a pending comment
|
|
27568
|
+
let comments = data.filter(isCommentApproved);
|
|
26498
27569
|
if (!this.query.includeDeleted) {
|
|
26499
27570
|
comments = filterByPropEquality(comments, 'isDeleted', false);
|
|
26500
27571
|
}
|
|
@@ -26543,6 +27614,7 @@ class CommentLiveCollectionController extends LiveCollectionController {
|
|
|
26543
27614
|
|
|
26544
27615
|
/* begin_public_function
|
|
26545
27616
|
id: comment.query
|
|
27617
|
+
spec: API/comment/getComments/v2.md
|
|
26546
27618
|
*/
|
|
26547
27619
|
/**
|
|
26548
27620
|
* ```js
|
|
@@ -26582,7 +27654,202 @@ const getComments = (params, callback, config) => {
|
|
|
26582
27654
|
};
|
|
26583
27655
|
/* end_public_function */
|
|
26584
27656
|
|
|
26585
|
-
|
|
27657
|
+
class CommentReviewQueuePaginationController extends PaginationController {
|
|
27658
|
+
async getRequest(queryParams, token) {
|
|
27659
|
+
const { communityId, limit } = queryParams, params = __rest(queryParams, ["communityId", "limit"]);
|
|
27660
|
+
// The route defaults to 10, not the SDK-wide 20, and rejects anything above 100
|
|
27661
|
+
const effectiveLimit = Math.min(limit !== null && limit !== void 0 ? limit : COMMENT_REVIEW_QUEUE_DEFAULT_PAGINATION_SIZE, COMMENT_REVIEW_QUEUE_MAX_PAGINATION_SIZE);
|
|
27662
|
+
// Token paging only. The route also accepts options[skip], but offset paging over a queue that
|
|
27663
|
+
// drains from the front skips items, so the SDK never sends it.
|
|
27664
|
+
const options = token ? { token } : { limit: effectiveLimit };
|
|
27665
|
+
const { data: queryResponse } = await this.http.get(API_ENDPOINTS.commentReviewQueue(communityId), {
|
|
27666
|
+
params: Object.assign(Object.assign({}, params), { options }),
|
|
27667
|
+
});
|
|
27668
|
+
return queryResponse;
|
|
27669
|
+
}
|
|
27670
|
+
}
|
|
27671
|
+
|
|
27672
|
+
class CommentReviewQueueQueryStreamController extends QueryStreamController {
|
|
27673
|
+
constructor(query, cacheKey, notifyChange) {
|
|
27674
|
+
super(query, cacheKey);
|
|
27675
|
+
this.notifyChange = notifyChange;
|
|
27676
|
+
}
|
|
27677
|
+
async saveToMainDB(response) {
|
|
27678
|
+
const processedPayload = prepareCommentPayload(response);
|
|
27679
|
+
const client = getActiveClient();
|
|
27680
|
+
const cachedAt = client.cache && Date.now();
|
|
27681
|
+
if (client.cache) {
|
|
27682
|
+
ingestInCache(processedPayload, { cachedAt });
|
|
27683
|
+
}
|
|
27684
|
+
}
|
|
27685
|
+
appendToQueryStream(response, direction, refresh = false) {
|
|
27686
|
+
var _a, _b;
|
|
27687
|
+
// Server order is queue-entry order, oldest first. Keep it: later pages append, nothing
|
|
27688
|
+
// re-sorts by createdAt (the two diverge on re-review).
|
|
27689
|
+
const commentIds = response.comments.map(getResolver('comment'));
|
|
27690
|
+
if (refresh) {
|
|
27691
|
+
pushToCache(this.cacheKey, {
|
|
27692
|
+
data: commentIds,
|
|
27693
|
+
});
|
|
27694
|
+
}
|
|
27695
|
+
else {
|
|
27696
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
27697
|
+
const comments = (_b = collection === null || collection === void 0 ? void 0 : collection.data) !== null && _b !== void 0 ? _b : [];
|
|
27698
|
+
pushToCache(this.cacheKey, Object.assign(Object.assign({}, collection), { data: [...new Set([...comments, ...commentIds])] }));
|
|
27699
|
+
}
|
|
27700
|
+
}
|
|
27701
|
+
matchesQuery(comment) {
|
|
27702
|
+
return (comment.targetType === 'community' &&
|
|
27703
|
+
comment.targetId === this.query.communityId &&
|
|
27704
|
+
(!this.query.postId || comment.referenceId === this.query.postId));
|
|
27705
|
+
}
|
|
27706
|
+
reactor(action) {
|
|
27707
|
+
return (comment) => {
|
|
27708
|
+
var _a;
|
|
27709
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
27710
|
+
if (!collection || !this.matchesQuery(comment))
|
|
27711
|
+
return;
|
|
27712
|
+
const isQueued = collection.data.includes(comment.commentId);
|
|
27713
|
+
// A date-filtered queue is the server's to shape; live events only remove from it
|
|
27714
|
+
const acceptsLiveInserts = !this.query.startDate && !this.query.endDate;
|
|
27715
|
+
switch (action) {
|
|
27716
|
+
case EnumCommentActions.OnCommentCreated:
|
|
27717
|
+
case EnumCommentActions.OnCommentUpdated:
|
|
27718
|
+
if (isCommentPending(comment) && !comment.isDeleted) {
|
|
27719
|
+
if (isQueued || !acceptsLiveInserts)
|
|
27720
|
+
return;
|
|
27721
|
+
// Enters (or, after an edit, re-enters) the queue at the end
|
|
27722
|
+
collection.data = [...collection.data, comment.commentId];
|
|
27723
|
+
}
|
|
27724
|
+
else {
|
|
27725
|
+
if (!isQueued)
|
|
27726
|
+
return;
|
|
27727
|
+
collection.data = collection.data.filter(commentId => commentId !== comment.commentId);
|
|
27728
|
+
}
|
|
27729
|
+
break;
|
|
27730
|
+
case EnumCommentActions.OnCommentApproved:
|
|
27731
|
+
case EnumCommentActions.OnCommentDeleted:
|
|
27732
|
+
if (!isQueued)
|
|
27733
|
+
return;
|
|
27734
|
+
collection.data = collection.data.filter(commentId => commentId !== comment.commentId);
|
|
27735
|
+
break;
|
|
27736
|
+
default:
|
|
27737
|
+
return;
|
|
27738
|
+
}
|
|
27739
|
+
pushToCache(this.cacheKey, collection);
|
|
27740
|
+
this.notifyChange({ origin: "event" /* Amity.LiveDataOrigin.EVENT */, loading: false });
|
|
27741
|
+
};
|
|
27742
|
+
}
|
|
27743
|
+
subscribeRTE(createSubscriber) {
|
|
27744
|
+
return createSubscriber.map(subscriber => subscriber.fn(this.reactor(subscriber.action)));
|
|
27745
|
+
}
|
|
27746
|
+
}
|
|
27747
|
+
|
|
27748
|
+
class CommentReviewQueueLiveCollectionController extends LiveCollectionController {
|
|
27749
|
+
constructor(query, callback) {
|
|
27750
|
+
const queryStreamId = hash(query);
|
|
27751
|
+
const cacheKey = ['commentReviewQueue', 'collection', queryStreamId];
|
|
27752
|
+
const paginationController = new CommentReviewQueuePaginationController(query);
|
|
27753
|
+
super(paginationController, queryStreamId, cacheKey, callback);
|
|
27754
|
+
this.query = query;
|
|
27755
|
+
this.queryStreamController = new CommentReviewQueueQueryStreamController(this.query, this.cacheKey, this.notifyChange.bind(this));
|
|
27756
|
+
this.callback = callback.bind(this);
|
|
27757
|
+
this.loadPage({ initial: true });
|
|
27758
|
+
}
|
|
27759
|
+
setup() {
|
|
27760
|
+
var _a;
|
|
27761
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
27762
|
+
if (!collection) {
|
|
27763
|
+
pushToCache(this.cacheKey, {
|
|
27764
|
+
data: [],
|
|
27765
|
+
params: {},
|
|
27766
|
+
});
|
|
27767
|
+
}
|
|
27768
|
+
}
|
|
27769
|
+
async persistModel(queryPayload) {
|
|
27770
|
+
await this.queryStreamController.saveToMainDB(queryPayload);
|
|
27771
|
+
}
|
|
27772
|
+
persistQueryStream({ response, direction, refresh, }) {
|
|
27773
|
+
this.queryStreamController.appendToQueryStream(response, direction, refresh);
|
|
27774
|
+
}
|
|
27775
|
+
startSubscription() {
|
|
27776
|
+
// No `comment.declined` exists: a decline arrives as `comment.deleted`
|
|
27777
|
+
return this.queryStreamController.subscribeRTE([
|
|
27778
|
+
{ fn: onCommentCreated, action: EnumCommentActions.OnCommentCreated },
|
|
27779
|
+
{ fn: onCommentUpdated, action: EnumCommentActions.OnCommentUpdated },
|
|
27780
|
+
{ fn: onCommentApproved, action: EnumCommentActions.OnCommentApproved },
|
|
27781
|
+
{ fn: onCommentDeleted, action: EnumCommentActions.OnCommentDeleted },
|
|
27782
|
+
{ fn: onCommentDeleteLocal, action: EnumCommentActions.OnCommentDeleted },
|
|
27783
|
+
]);
|
|
27784
|
+
}
|
|
27785
|
+
notifyChange({ origin, loading, error }) {
|
|
27786
|
+
var _a;
|
|
27787
|
+
// A caller who lost REVIEW_COMMUNITY_COMMENT must not keep reading stale pending content
|
|
27788
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === 400301 /* Amity.ServerError.PERMISSION_DENIED */) {
|
|
27789
|
+
pushToCache(this.cacheKey, { data: [], params: {} });
|
|
27790
|
+
}
|
|
27791
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
27792
|
+
if (!collection)
|
|
27793
|
+
return;
|
|
27794
|
+
const data = collection.data
|
|
27795
|
+
.map(id => pullFromCache(['comment', 'get', id]))
|
|
27796
|
+
.filter(isNonNullable)
|
|
27797
|
+
.map(({ data }) => data)
|
|
27798
|
+
.filter(comment => isCommentPending(comment) && !comment.isDeleted)
|
|
27799
|
+
.map(LinkedObject.comment);
|
|
27800
|
+
if (!this.shouldNotify(data) && origin === 'event')
|
|
27801
|
+
return;
|
|
27802
|
+
this.callback({
|
|
27803
|
+
onNextPage: () => this.loadPage({ direction: "next" /* Amity.LiveCollectionPageDirection.NEXT */ }),
|
|
27804
|
+
data,
|
|
27805
|
+
hasNextPage: !!this.paginationController.getNextToken(),
|
|
27806
|
+
loading,
|
|
27807
|
+
error,
|
|
27808
|
+
});
|
|
27809
|
+
}
|
|
27810
|
+
}
|
|
27811
|
+
|
|
27812
|
+
/* begin_public_function
|
|
27813
|
+
id: comment.review_queue
|
|
27814
|
+
*/
|
|
27815
|
+
/**
|
|
27816
|
+
* ```js
|
|
27817
|
+
* import { CommentRepository } from '@amityco/ts-sdk'
|
|
27818
|
+
*
|
|
27819
|
+
* const unsub = CommentRepository.getCommentReviewQueue(
|
|
27820
|
+
* { communityId: 'communityId' },
|
|
27821
|
+
* ({ data: comments, hasNextPage, onNextPage }) => {
|
|
27822
|
+
* // every comment is awaiting review
|
|
27823
|
+
* },
|
|
27824
|
+
* )
|
|
27825
|
+
* ```
|
|
27826
|
+
*
|
|
27827
|
+
* Observe the {@link Amity.Comment} list awaiting moderator review in a community, oldest first
|
|
27828
|
+
*
|
|
27829
|
+
* @param params the community to read the queue of, optionally narrowed to one post and a date range
|
|
27830
|
+
* @param callback the function to call when new data are available
|
|
27831
|
+
* @returns An {@link Amity.Unsubscriber} function to run when willing to stop observing the queue
|
|
27832
|
+
*
|
|
27833
|
+
* @category Comments Live Collection
|
|
27834
|
+
*/
|
|
27835
|
+
const getCommentReviewQueue = (params, callback) => {
|
|
27836
|
+
const { log, cache } = getActiveClient();
|
|
27837
|
+
if (!cache)
|
|
27838
|
+
console.log(ENABLE_CACHE_MESSAGE);
|
|
27839
|
+
const timestamp = Date.now();
|
|
27840
|
+
log(`getCommentReviewQueue(tmpid: ${timestamp}) > listen`);
|
|
27841
|
+
const commentReviewQueueLiveCollection = new CommentReviewQueueLiveCollectionController(params, callback);
|
|
27842
|
+
const disposers = commentReviewQueueLiveCollection.startSubscription();
|
|
27843
|
+
const cacheKey = commentReviewQueueLiveCollection.getCacheKey();
|
|
27844
|
+
disposers.push(() => dropFromCache(cacheKey));
|
|
27845
|
+
return () => {
|
|
27846
|
+
log(`getCommentReviewQueue(tmpid: ${timestamp}) > dispose`);
|
|
27847
|
+
disposers.forEach(fn => fn());
|
|
27848
|
+
};
|
|
27849
|
+
};
|
|
27850
|
+
/* end_public_function */
|
|
27851
|
+
|
|
27852
|
+
var index$f = /*#__PURE__*/Object.freeze({
|
|
26586
27853
|
__proto__: null,
|
|
26587
27854
|
getCommentByIds: getCommentByIds,
|
|
26588
27855
|
createComment: createComment,
|
|
@@ -26590,18 +27857,22 @@ var index$e = /*#__PURE__*/Object.freeze({
|
|
|
26590
27857
|
deleteComment: deleteComment,
|
|
26591
27858
|
softDeleteComment: softDeleteComment,
|
|
26592
27859
|
hardDeleteComment: hardDeleteComment,
|
|
27860
|
+
approveComment: approveComment,
|
|
27861
|
+
declineComment: declineComment,
|
|
26593
27862
|
flagComment: flagComment,
|
|
26594
27863
|
unflagComment: unflagComment,
|
|
26595
27864
|
isCommentFlaggedByMe: isCommentFlaggedByMe,
|
|
26596
27865
|
onCommentCreated: onCommentCreated,
|
|
26597
27866
|
onCommentUpdated: onCommentUpdated,
|
|
26598
27867
|
onCommentDeleted: onCommentDeleted,
|
|
27868
|
+
onCommentApproved: onCommentApproved,
|
|
26599
27869
|
onCommentFlagged: onCommentFlagged,
|
|
26600
27870
|
onCommentUnflagged: onCommentUnflagged,
|
|
26601
27871
|
onCommentReactionAdded: onCommentReactionAdded,
|
|
26602
27872
|
onCommentReactionRemoved: onCommentReactionRemoved,
|
|
26603
27873
|
getComment: getComment,
|
|
26604
|
-
getComments: getComments
|
|
27874
|
+
getComments: getComments,
|
|
27875
|
+
getCommentReviewQueue: getCommentReviewQueue
|
|
26605
27876
|
});
|
|
26606
27877
|
|
|
26607
27878
|
/**
|
|
@@ -26717,6 +27988,10 @@ const generateCommentSubscriptions$1 = (cacheKey) => {
|
|
|
26717
27988
|
action: EnumPostActions.OnPostUpdated,
|
|
26718
27989
|
}));
|
|
26719
27990
|
};
|
|
27991
|
+
/* begin_public_function
|
|
27992
|
+
id: feed.get-global-feed-subscriptions
|
|
27993
|
+
*/
|
|
27994
|
+
/** Returns RTE subscriptions for use by Amity.LiveCollectionCallback-based feed controllers. */
|
|
26720
27995
|
const getGlobalFeedSubscriptions = (cacheKey) => {
|
|
26721
27996
|
return [
|
|
26722
27997
|
{ fn: onPostCreated, action: EnumPostActions.OnPostCreated },
|
|
@@ -27431,6 +28706,10 @@ const commentEventHandler = (callback, eventHandler, cacheKey, resolveId) => {
|
|
|
27431
28706
|
callback(comment);
|
|
27432
28707
|
});
|
|
27433
28708
|
};
|
|
28709
|
+
/* begin_public_function
|
|
28710
|
+
id: post.generate-comment-subscriptions
|
|
28711
|
+
*/
|
|
28712
|
+
/** Returns RTE subscriptions for use by Amity.LiveCollectionCallback-based post controllers. */
|
|
27434
28713
|
const generateCommentSubscriptions = ({ cacheKey, resolveId, }) => {
|
|
27435
28714
|
const eventHandlers = [
|
|
27436
28715
|
onCommentCreated,
|
|
@@ -27851,7 +29130,7 @@ const getForYouFeed = (callback) => {
|
|
|
27851
29130
|
};
|
|
27852
29131
|
/* end_public_function */
|
|
27853
29132
|
|
|
27854
|
-
var index$
|
|
29133
|
+
var index$e = /*#__PURE__*/Object.freeze({
|
|
27855
29134
|
__proto__: null,
|
|
27856
29135
|
queryGlobalFeed: queryGlobalFeed,
|
|
27857
29136
|
getCustomRankingGlobalFeed: getCustomRankingGlobalFeed,
|
|
@@ -28986,6 +30265,7 @@ class PostLiveCollectionController extends LiveCollectionController {
|
|
|
28986
30265
|
|
|
28987
30266
|
/* begin_public_function
|
|
28988
30267
|
id: post.query
|
|
30268
|
+
spec: API/post/query/v2.md
|
|
28989
30269
|
*/
|
|
28990
30270
|
/**
|
|
28991
30271
|
* ```js
|
|
@@ -29163,6 +30443,9 @@ class PinnedPostLiveCollectionController extends LiveCollectionController {
|
|
|
29163
30443
|
* @category Pined Posts Live Collection
|
|
29164
30444
|
*
|
|
29165
30445
|
*/
|
|
30446
|
+
/* begin_public_function
|
|
30447
|
+
id: post.get-pinned-posts
|
|
30448
|
+
*/
|
|
29166
30449
|
const getPinnedPosts = (params, callback, config) => {
|
|
29167
30450
|
const { log, cache } = getActiveClient();
|
|
29168
30451
|
if (!cache) {
|
|
@@ -29309,6 +30592,9 @@ class GlobalPinnedPostLiveCollectionController extends LiveCollectionController
|
|
|
29309
30592
|
* @category Pined Posts Live Collection
|
|
29310
30593
|
*
|
|
29311
30594
|
*/
|
|
30595
|
+
/* begin_public_function
|
|
30596
|
+
id: post.get-global-pinned-posts
|
|
30597
|
+
*/
|
|
29312
30598
|
const getGlobalPinnedPosts = (params, callback, config) => {
|
|
29313
30599
|
const { log, cache } = getActiveClient();
|
|
29314
30600
|
if (!cache) {
|
|
@@ -29542,6 +30828,9 @@ class SemanticSearchPostLiveCollectionController extends LiveCollectionControlle
|
|
|
29542
30828
|
* @category Posts Live Collection
|
|
29543
30829
|
*
|
|
29544
30830
|
*/
|
|
30831
|
+
/* begin_public_function
|
|
30832
|
+
id: post.semantic-search
|
|
30833
|
+
*/
|
|
29545
30834
|
const semanticSearchPosts = (params, callback, config) => {
|
|
29546
30835
|
const { log, cache } = getActiveClient();
|
|
29547
30836
|
if (!cache) {
|
|
@@ -29751,7 +31040,8 @@ class SearchPostLiveCollectionController extends LiveCollectionController {
|
|
|
29751
31040
|
}
|
|
29752
31041
|
|
|
29753
31042
|
/* begin_public_function
|
|
29754
|
-
id: post.query
|
|
31043
|
+
id: post.query.by_hashtag
|
|
31044
|
+
spec: API/post/query/v2.md
|
|
29755
31045
|
*/
|
|
29756
31046
|
/**
|
|
29757
31047
|
* ```js
|
|
@@ -30002,31 +31292,6 @@ const getBroadcasterData = async (roomId) => {
|
|
|
30002
31292
|
};
|
|
30003
31293
|
/* end_public_function */
|
|
30004
31294
|
|
|
30005
|
-
/* begin_public_function
|
|
30006
|
-
id: room.getRecordedUrl
|
|
30007
|
-
*/
|
|
30008
|
-
/**
|
|
30009
|
-
* ```js
|
|
30010
|
-
* import { getRecordedUrl } from '@amityco/ts-sdk'
|
|
30011
|
-
* const recordedUrl = await getRecordedUrl('roomId')
|
|
30012
|
-
* ```
|
|
30013
|
-
*
|
|
30014
|
-
* Gets the recorded URL for a room
|
|
30015
|
-
*
|
|
30016
|
-
* @param roomId The ID of the room to get recorded URL for
|
|
30017
|
-
* @returns The recorded URL information
|
|
30018
|
-
*
|
|
30019
|
-
* @category Room API
|
|
30020
|
-
* @async
|
|
30021
|
-
*/
|
|
30022
|
-
const getRecordedUrl = async (roomId) => {
|
|
30023
|
-
const client = getActiveClient();
|
|
30024
|
-
client.log('room/getRecordedUrl', { roomId });
|
|
30025
|
-
const { data } = await client.http.get(`/api/v1/rooms/${roomId}/recorded`);
|
|
30026
|
-
return data;
|
|
30027
|
-
};
|
|
30028
|
-
/* end_public_function */
|
|
30029
|
-
|
|
30030
31295
|
/* begin_public_function
|
|
30031
31296
|
id: room.removeParticipant
|
|
30032
31297
|
*/
|
|
@@ -30733,6 +31998,10 @@ var EnumRoomActions;
|
|
|
30733
31998
|
const convertToRoomEventPayload = (eventHandler) => (callback) => eventHandler((payload) => {
|
|
30734
31999
|
callback(payload.room);
|
|
30735
32000
|
});
|
|
32001
|
+
/* begin_public_function
|
|
32002
|
+
id: room.get-room-subscription
|
|
32003
|
+
*/
|
|
32004
|
+
/** Returns RTE subscriptions for use by Amity.LiveCollectionCallback-based room controllers. */
|
|
30736
32005
|
// TODO: confirm related events
|
|
30737
32006
|
const getRoomSubscription = () => [
|
|
30738
32007
|
{
|
|
@@ -30789,6 +32058,9 @@ const getRoomSubscription = () => [
|
|
|
30789
32058
|
},
|
|
30790
32059
|
];
|
|
30791
32060
|
|
|
32061
|
+
/* begin_public_function
|
|
32062
|
+
id: room.get
|
|
32063
|
+
*/
|
|
30792
32064
|
const getRoom = (roomId, callback) => {
|
|
30793
32065
|
return liveObject(roomId, callback, '_id', getRoomById, [
|
|
30794
32066
|
onRoomEndBroadcasting,
|
|
@@ -30996,14 +32268,13 @@ const getRooms = (params, callback, config) => {
|
|
|
30996
32268
|
};
|
|
30997
32269
|
/* end_public_function */
|
|
30998
32270
|
|
|
30999
|
-
var index$
|
|
32271
|
+
var index$d = /*#__PURE__*/Object.freeze({
|
|
31000
32272
|
__proto__: null,
|
|
31001
32273
|
createRoom: createRoom,
|
|
31002
32274
|
updateRoom: updateRoom,
|
|
31003
32275
|
deleteRoom: deleteRoom,
|
|
31004
32276
|
stopRoom: stopRoom,
|
|
31005
32277
|
getBroadcasterData: getBroadcasterData,
|
|
31006
|
-
getRecordedUrl: getRecordedUrl,
|
|
31007
32278
|
removeParticipant: removeParticipant,
|
|
31008
32279
|
leaveRoom: leaveRoom,
|
|
31009
32280
|
AmityRoomAnalytics: AmityRoomAnalytics,
|
|
@@ -31295,7 +32566,7 @@ const getCommunityLiveRoomPosts = (params, callback, config) => {
|
|
|
31295
32566
|
};
|
|
31296
32567
|
/* end_public_function */
|
|
31297
32568
|
|
|
31298
|
-
var index$
|
|
32569
|
+
var index$c = /*#__PURE__*/Object.freeze({
|
|
31299
32570
|
__proto__: null,
|
|
31300
32571
|
getPostByIds: getPostByIds,
|
|
31301
32572
|
createPost: createPost,
|
|
@@ -31910,7 +33181,7 @@ const getStreams = (params, callback, config) => {
|
|
|
31910
33181
|
};
|
|
31911
33182
|
};
|
|
31912
33183
|
|
|
31913
|
-
var index$
|
|
33184
|
+
var index$b = /*#__PURE__*/Object.freeze({
|
|
31914
33185
|
__proto__: null,
|
|
31915
33186
|
createStream: createStream,
|
|
31916
33187
|
updateStream: updateStream,
|
|
@@ -32213,7 +33484,7 @@ const stopHeartbeat = (roomId) => {
|
|
|
32213
33484
|
};
|
|
32214
33485
|
/* end_public_function */
|
|
32215
33486
|
|
|
32216
|
-
var index$
|
|
33487
|
+
var index$a = /*#__PURE__*/Object.freeze({
|
|
32217
33488
|
__proto__: null,
|
|
32218
33489
|
getRoomOnlineUsers: getRoomOnlineUsers,
|
|
32219
33490
|
getRoomUserCount: getRoomUserCount,
|
|
@@ -32524,7 +33795,7 @@ const getPoll = (pollId, callback) => {
|
|
|
32524
33795
|
};
|
|
32525
33796
|
/* end_public_function */
|
|
32526
33797
|
|
|
32527
|
-
var index$
|
|
33798
|
+
var index$9 = /*#__PURE__*/Object.freeze({
|
|
32528
33799
|
__proto__: null,
|
|
32529
33800
|
createPoll: createPoll,
|
|
32530
33801
|
closePoll: closePoll,
|
|
@@ -32828,7 +34099,7 @@ const getPlayer = async (parameters) => {
|
|
|
32828
34099
|
return video;
|
|
32829
34100
|
};
|
|
32830
34101
|
|
|
32831
|
-
var index$
|
|
34102
|
+
var index$8 = /*#__PURE__*/Object.freeze({
|
|
32832
34103
|
__proto__: null,
|
|
32833
34104
|
getPlayer: getPlayer
|
|
32834
34105
|
});
|
|
@@ -33156,33 +34427,74 @@ const softDeleteStory = async (storyId) => {
|
|
|
33156
34427
|
return result;
|
|
33157
34428
|
};
|
|
33158
34429
|
|
|
33159
|
-
const
|
|
34430
|
+
const onStoryCreated = (callback) => {
|
|
33160
34431
|
const client = getActiveClient();
|
|
33161
34432
|
const filter = async (payload) => {
|
|
33162
34433
|
// Apply the necessary field for story payload
|
|
33163
|
-
const convertPayload = convertRawStoryToInternal(payload);
|
|
34434
|
+
const convertPayload = convertRawStoryToInternal(payload, true);
|
|
33164
34435
|
ingestInCache(convertPayload);
|
|
33165
34436
|
callback(convertPayload.stories);
|
|
33166
34437
|
};
|
|
33167
|
-
const disposers = [createEventSubscriber(client, '
|
|
34438
|
+
const disposers = [createEventSubscriber(client, 'onStoryCreated', 'story.created', filter)];
|
|
33168
34439
|
return () => {
|
|
33169
34440
|
disposers.forEach(fn => fn());
|
|
33170
34441
|
};
|
|
33171
34442
|
};
|
|
33172
|
-
const
|
|
34443
|
+
const onStoryCreatedLocal = (callback) => {
|
|
33173
34444
|
const client = getActiveClient();
|
|
33174
34445
|
const filter = async (payload) => {
|
|
33175
34446
|
ingestInCache(payload);
|
|
33176
34447
|
callback(payload.stories);
|
|
33177
34448
|
};
|
|
33178
34449
|
const disposers = [
|
|
33179
|
-
createEventSubscriber(client, '
|
|
34450
|
+
createEventSubscriber(client, 'onStoryCreated', 'local.story.created', filter),
|
|
33180
34451
|
];
|
|
33181
34452
|
return () => {
|
|
33182
34453
|
disposers.forEach(fn => fn());
|
|
33183
34454
|
};
|
|
33184
34455
|
};
|
|
33185
34456
|
|
|
34457
|
+
const onStoryDeleted = (callback) => {
|
|
34458
|
+
const client = getActiveClient();
|
|
34459
|
+
const filter = async (payload) => {
|
|
34460
|
+
const convertPayload = convertRawStoryToInternal(payload);
|
|
34461
|
+
ingestInCache(convertPayload);
|
|
34462
|
+
callback(convertPayload.stories);
|
|
34463
|
+
};
|
|
34464
|
+
const disposer = [createEventSubscriber(client, 'onStoryDeleted', 'story.deleted', filter)];
|
|
34465
|
+
return () => {
|
|
34466
|
+
disposer.forEach(fn => fn());
|
|
34467
|
+
};
|
|
34468
|
+
};
|
|
34469
|
+
const onStoryDeletedLocal = (callback) => {
|
|
34470
|
+
const client = getActiveClient();
|
|
34471
|
+
const filter = async (payload) => {
|
|
34472
|
+
ingestInCache(payload);
|
|
34473
|
+
callback(payload.stories);
|
|
34474
|
+
};
|
|
34475
|
+
const disposer = [createEventSubscriber(client, 'onStoryDeleted', 'local.story.deleted', filter)];
|
|
34476
|
+
return () => {
|
|
34477
|
+
disposer.forEach(fn => fn());
|
|
34478
|
+
};
|
|
34479
|
+
};
|
|
34480
|
+
|
|
34481
|
+
const onStoryError = (callback) => {
|
|
34482
|
+
const client = getActiveClient();
|
|
34483
|
+
const filter = async (payload) => {
|
|
34484
|
+
ingestInCache(payload);
|
|
34485
|
+
callback(payload.stories);
|
|
34486
|
+
};
|
|
34487
|
+
return createEventSubscriber(client, 'onStoryError', 'local.story.error', filter);
|
|
34488
|
+
};
|
|
34489
|
+
|
|
34490
|
+
const onStoryLocalDataUpdated = (callback) => {
|
|
34491
|
+
const client = getActiveClient();
|
|
34492
|
+
const filter = (payload) => {
|
|
34493
|
+
callback(payload);
|
|
34494
|
+
};
|
|
34495
|
+
return createEventSubscriber(client, 'onStoryLocalDataUpdated', 'local.story.reload', filter);
|
|
34496
|
+
};
|
|
34497
|
+
|
|
33186
34498
|
const onStoryReactionAdded = (callback) => {
|
|
33187
34499
|
const client = getActiveClient();
|
|
33188
34500
|
const filter = async (payload) => {
|
|
@@ -33243,6 +34555,33 @@ const onStoryReactionRemovedLocal = (callback) => {
|
|
|
33243
34555
|
};
|
|
33244
34556
|
};
|
|
33245
34557
|
|
|
34558
|
+
const onStoryUpdated = (callback) => {
|
|
34559
|
+
const client = getActiveClient();
|
|
34560
|
+
const filter = async (payload) => {
|
|
34561
|
+
// Apply the necessary field for story payload
|
|
34562
|
+
const convertPayload = convertRawStoryToInternal(payload);
|
|
34563
|
+
ingestInCache(convertPayload);
|
|
34564
|
+
callback(convertPayload.stories);
|
|
34565
|
+
};
|
|
34566
|
+
const disposers = [createEventSubscriber(client, 'onStoryUpdated', 'story.updated', filter)];
|
|
34567
|
+
return () => {
|
|
34568
|
+
disposers.forEach(fn => fn());
|
|
34569
|
+
};
|
|
34570
|
+
};
|
|
34571
|
+
const onStoryUpdatedLocal = (callback) => {
|
|
34572
|
+
const client = getActiveClient();
|
|
34573
|
+
const filter = async (payload) => {
|
|
34574
|
+
ingestInCache(payload);
|
|
34575
|
+
callback(payload.stories);
|
|
34576
|
+
};
|
|
34577
|
+
const disposers = [
|
|
34578
|
+
createEventSubscriber(client, 'onStoryUpdated', 'local.story.updated', filter),
|
|
34579
|
+
];
|
|
34580
|
+
return () => {
|
|
34581
|
+
disposers.forEach(fn => fn());
|
|
34582
|
+
};
|
|
34583
|
+
};
|
|
34584
|
+
|
|
33246
34585
|
const updateLocalLastStoryExpires = (stories) => {
|
|
33247
34586
|
stories.forEach(story => {
|
|
33248
34587
|
const currentCache = pullFromCache(["story-expire" /* STORY_KEY_CACHE.EXPIRE */, story.targetId]);
|
|
@@ -33289,74 +34628,6 @@ const getActiveStoriesByTarget$1 = async ({ targetType, targetId, options, }) =>
|
|
|
33289
34628
|
};
|
|
33290
34629
|
};
|
|
33291
34630
|
|
|
33292
|
-
const onStoryCreated = (callback) => {
|
|
33293
|
-
const client = getActiveClient();
|
|
33294
|
-
const filter = async (payload) => {
|
|
33295
|
-
// Apply the necessary field for story payload
|
|
33296
|
-
const convertPayload = convertRawStoryToInternal(payload, true);
|
|
33297
|
-
ingestInCache(convertPayload);
|
|
33298
|
-
callback(convertPayload.stories);
|
|
33299
|
-
};
|
|
33300
|
-
const disposers = [createEventSubscriber(client, 'onStoryCreated', 'story.created', filter)];
|
|
33301
|
-
return () => {
|
|
33302
|
-
disposers.forEach(fn => fn());
|
|
33303
|
-
};
|
|
33304
|
-
};
|
|
33305
|
-
const onStoryCreatedLocal = (callback) => {
|
|
33306
|
-
const client = getActiveClient();
|
|
33307
|
-
const filter = async (payload) => {
|
|
33308
|
-
ingestInCache(payload);
|
|
33309
|
-
callback(payload.stories);
|
|
33310
|
-
};
|
|
33311
|
-
const disposers = [
|
|
33312
|
-
createEventSubscriber(client, 'onStoryCreated', 'local.story.created', filter),
|
|
33313
|
-
];
|
|
33314
|
-
return () => {
|
|
33315
|
-
disposers.forEach(fn => fn());
|
|
33316
|
-
};
|
|
33317
|
-
};
|
|
33318
|
-
|
|
33319
|
-
const onStoryDeleted = (callback) => {
|
|
33320
|
-
const client = getActiveClient();
|
|
33321
|
-
const filter = async (payload) => {
|
|
33322
|
-
const convertPayload = convertRawStoryToInternal(payload);
|
|
33323
|
-
ingestInCache(convertPayload);
|
|
33324
|
-
callback(convertPayload.stories);
|
|
33325
|
-
};
|
|
33326
|
-
const disposer = [createEventSubscriber(client, 'onStoryDeleted', 'story.deleted', filter)];
|
|
33327
|
-
return () => {
|
|
33328
|
-
disposer.forEach(fn => fn());
|
|
33329
|
-
};
|
|
33330
|
-
};
|
|
33331
|
-
const onStoryDeletedLocal = (callback) => {
|
|
33332
|
-
const client = getActiveClient();
|
|
33333
|
-
const filter = async (payload) => {
|
|
33334
|
-
ingestInCache(payload);
|
|
33335
|
-
callback(payload.stories);
|
|
33336
|
-
};
|
|
33337
|
-
const disposer = [createEventSubscriber(client, 'onStoryDeleted', 'local.story.deleted', filter)];
|
|
33338
|
-
return () => {
|
|
33339
|
-
disposer.forEach(fn => fn());
|
|
33340
|
-
};
|
|
33341
|
-
};
|
|
33342
|
-
|
|
33343
|
-
const onStoryError = (callback) => {
|
|
33344
|
-
const client = getActiveClient();
|
|
33345
|
-
const filter = async (payload) => {
|
|
33346
|
-
ingestInCache(payload);
|
|
33347
|
-
callback(payload.stories);
|
|
33348
|
-
};
|
|
33349
|
-
return createEventSubscriber(client, 'onStoryError', 'local.story.error', filter);
|
|
33350
|
-
};
|
|
33351
|
-
|
|
33352
|
-
const onStoryLocalDataUpdated = (callback) => {
|
|
33353
|
-
const client = getActiveClient();
|
|
33354
|
-
const filter = (payload) => {
|
|
33355
|
-
callback(payload);
|
|
33356
|
-
};
|
|
33357
|
-
return createEventSubscriber(client, 'onStoryLocalDataUpdated', 'local.story.reload', filter);
|
|
33358
|
-
};
|
|
33359
|
-
|
|
33360
34631
|
/**
|
|
33361
34632
|
* ```js
|
|
33362
34633
|
* import { StoryRepository } from '@amityco/js-sdk';
|
|
@@ -33377,6 +34648,9 @@ const onStoryLocalDataUpdated = (callback) => {
|
|
|
33377
34648
|
*
|
|
33378
34649
|
* @category SubChannel Live Object
|
|
33379
34650
|
*/
|
|
34651
|
+
/* begin_public_function
|
|
34652
|
+
id: story.get-active-stories-by-target
|
|
34653
|
+
*/
|
|
33380
34654
|
const getActiveStoriesByTarget = (params, callback) => {
|
|
33381
34655
|
const { log, cache } = getActiveClient();
|
|
33382
34656
|
const disposers = [];
|
|
@@ -33515,6 +34789,9 @@ const getActiveStoriesByTarget = (params, callback) => {
|
|
|
33515
34789
|
};
|
|
33516
34790
|
|
|
33517
34791
|
const getSingleItemFromArray = (func) => (callback) => func((result) => callback(result[0]));
|
|
34792
|
+
/* begin_public_function
|
|
34793
|
+
id: story.get-by-story-id
|
|
34794
|
+
*/
|
|
33518
34795
|
const getStoryByStoryId = (storyId, callback) => {
|
|
33519
34796
|
return liveObject(storyId, data => {
|
|
33520
34797
|
if (!(data === null || data === void 0 ? void 0 : data.data)) {
|
|
@@ -33550,6 +34827,9 @@ const getTargetsByTargetIds$1 = async (targets) => {
|
|
|
33550
34827
|
};
|
|
33551
34828
|
};
|
|
33552
34829
|
|
|
34830
|
+
/* begin_public_function
|
|
34831
|
+
id: story.get-target-by-id
|
|
34832
|
+
*/
|
|
33553
34833
|
const getTargetById = (params, callback) => {
|
|
33554
34834
|
return liveObject(
|
|
33555
34835
|
// @TODO: Now I put @ts-ignore here because I don't know how to fix this, it always say that params is not assignable to `NEVER`
|
|
@@ -33565,6 +34845,9 @@ const getTargetById = (params, callback) => {
|
|
|
33565
34845
|
}, []);
|
|
33566
34846
|
};
|
|
33567
34847
|
|
|
34848
|
+
/* begin_public_function
|
|
34849
|
+
id: story.get-targets-by-target-ids
|
|
34850
|
+
*/
|
|
33568
34851
|
const getTargetsByTargetIds = (params, callback) => {
|
|
33569
34852
|
const { log, cache } = getActiveClient();
|
|
33570
34853
|
const disposers = [];
|
|
@@ -34001,12 +35284,24 @@ const getGlobalStoryTargets = (params, callback, config) => {
|
|
|
34001
35284
|
};
|
|
34002
35285
|
};
|
|
34003
35286
|
|
|
34004
|
-
var index$
|
|
35287
|
+
var index$7 = /*#__PURE__*/Object.freeze({
|
|
34005
35288
|
__proto__: null,
|
|
34006
35289
|
createImageStory: createImageStory,
|
|
34007
35290
|
createVideoStory: createVideoStory,
|
|
34008
35291
|
hardDeleteStory: hardDeleteStory,
|
|
34009
35292
|
softDeleteStory: softDeleteStory,
|
|
35293
|
+
onStoryCreated: onStoryCreated,
|
|
35294
|
+
onStoryCreatedLocal: onStoryCreatedLocal,
|
|
35295
|
+
onStoryDeleted: onStoryDeleted,
|
|
35296
|
+
onStoryDeletedLocal: onStoryDeletedLocal,
|
|
35297
|
+
onStoryError: onStoryError,
|
|
35298
|
+
onStoryLocalDataUpdated: onStoryLocalDataUpdated,
|
|
35299
|
+
onStoryReactionAdded: onStoryReactionAdded,
|
|
35300
|
+
onStoryReactionAddedLocal: onStoryReactionAddedLocal,
|
|
35301
|
+
onStoryReactionRemoved: onStoryReactionRemoved,
|
|
35302
|
+
onStoryReactionRemovedLocal: onStoryReactionRemovedLocal,
|
|
35303
|
+
onStoryUpdated: onStoryUpdated,
|
|
35304
|
+
onStoryUpdatedLocal: onStoryUpdatedLocal,
|
|
34010
35305
|
getActiveStoriesByTarget: getActiveStoriesByTarget,
|
|
34011
35306
|
getStoryByStoryId: getStoryByStoryId,
|
|
34012
35307
|
getTargetById: getTargetById,
|
|
@@ -34038,7 +35333,7 @@ const getNetworkAds = async () => {
|
|
|
34038
35333
|
};
|
|
34039
35334
|
};
|
|
34040
35335
|
|
|
34041
|
-
var index$
|
|
35336
|
+
var index$6 = /*#__PURE__*/Object.freeze({
|
|
34042
35337
|
__proto__: null,
|
|
34043
35338
|
getNetworkAds: getNetworkAds
|
|
34044
35339
|
});
|
|
@@ -34317,6 +35612,9 @@ class NotificationTrayItemsLiveCollectionController extends LiveCollectionContro
|
|
|
34317
35612
|
* @category Notification tray items Live Collection
|
|
34318
35613
|
*
|
|
34319
35614
|
*/
|
|
35615
|
+
/* begin_public_function
|
|
35616
|
+
id: notification-tray.get-items
|
|
35617
|
+
*/
|
|
34320
35618
|
const getNotificationTrayItems = (params, callback, config) => {
|
|
34321
35619
|
const { log, cache } = getActiveClient();
|
|
34322
35620
|
if (!cache) {
|
|
@@ -34429,7 +35727,7 @@ const markTraySeen = async (lastSeenAt) => {
|
|
|
34429
35727
|
};
|
|
34430
35728
|
/* end_public_function */
|
|
34431
35729
|
|
|
34432
|
-
var index$
|
|
35730
|
+
var index$5 = /*#__PURE__*/Object.freeze({
|
|
34433
35731
|
__proto__: null,
|
|
34434
35732
|
getNotificationTraySeen: getNotificationTraySeen,
|
|
34435
35733
|
getNotificationTrayItems: getNotificationTrayItems,
|
|
@@ -34649,6 +35947,9 @@ class MyInvitationsLiveCollectionController extends LiveCollectionController {
|
|
|
34649
35947
|
* @category My Community Invitations Live Collection
|
|
34650
35948
|
*
|
|
34651
35949
|
*/
|
|
35950
|
+
/* begin_public_function
|
|
35951
|
+
id: invitation.get-my-community-invitations
|
|
35952
|
+
*/
|
|
34652
35953
|
const getMyCommunityInvitations = (params, callback, config) => {
|
|
34653
35954
|
const { log, cache } = getActiveClient();
|
|
34654
35955
|
if (!cache) {
|
|
@@ -34701,6 +36002,8 @@ const getMyCommunityInvitations = (params, callback, config) => {
|
|
|
34701
36002
|
*
|
|
34702
36003
|
* @category Invitation Observable
|
|
34703
36004
|
*/
|
|
36005
|
+
// NOTE: Invitation events use a streaming event pattern; callback is Amity.Listener rather than
|
|
36006
|
+
// Amity.LiveObjectCallback or Amity.LiveCollectionCallback as this is not a LiveObject/LiveCollection.
|
|
34704
36007
|
const getInvitations = (params, callback) => {
|
|
34705
36008
|
const { _id: userId } = getCurrentUser();
|
|
34706
36009
|
if (!userId)
|
|
@@ -34731,7 +36034,7 @@ const getInvitations = (params, callback) => {
|
|
|
34731
36034
|
};
|
|
34732
36035
|
};
|
|
34733
36036
|
|
|
34734
|
-
var index$
|
|
36037
|
+
var index$4 = /*#__PURE__*/Object.freeze({
|
|
34735
36038
|
__proto__: null,
|
|
34736
36039
|
cancelInvitation: cancelInvitation,
|
|
34737
36040
|
onLocalInvitationCreated: onLocalInvitationCreated,
|
|
@@ -34857,6 +36160,11 @@ const onLiveReactionCreatedLocal = (callback) => {
|
|
|
34857
36160
|
*
|
|
34858
36161
|
* @category Live Reaction Observable
|
|
34859
36162
|
*/
|
|
36163
|
+
/* begin_public_function
|
|
36164
|
+
id: live-reaction.get-reactions
|
|
36165
|
+
*/
|
|
36166
|
+
// NOTE: Live reactions use a streaming event pattern; callback is Amity.Listener rather than
|
|
36167
|
+
// Amity.LiveObjectCallback or Amity.LiveCollectionCallback as this is not a LiveObject/LiveCollection.
|
|
34860
36168
|
// TODO: confirm return type for this observable property
|
|
34861
36169
|
const getReactions = (postId, callback) => {
|
|
34862
36170
|
const { _id: userId } = getActiveUser();
|
|
@@ -34880,7 +36188,7 @@ const getReactions = (postId, callback) => {
|
|
|
34880
36188
|
};
|
|
34881
36189
|
};
|
|
34882
36190
|
|
|
34883
|
-
var index$
|
|
36191
|
+
var index$3 = /*#__PURE__*/Object.freeze({
|
|
34884
36192
|
__proto__: null,
|
|
34885
36193
|
createReaction: createReaction,
|
|
34886
36194
|
onLiveReactionCreated: onLiveReactionCreated,
|
|
@@ -35210,6 +36518,9 @@ class EventLiveCollectionController extends LiveCollectionController {
|
|
|
35210
36518
|
* @category Event Live Collection
|
|
35211
36519
|
*
|
|
35212
36520
|
*/
|
|
36521
|
+
/* begin_public_function
|
|
36522
|
+
id: event.get-events
|
|
36523
|
+
*/
|
|
35213
36524
|
const getEvents = (params, callback, config) => {
|
|
35214
36525
|
const { log, cache } = getActiveClient();
|
|
35215
36526
|
if (!cache)
|
|
@@ -35230,7 +36541,7 @@ class MyEventPaginationController extends PaginationController {
|
|
|
35230
36541
|
async getRequest(queryParams, token) {
|
|
35231
36542
|
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT } = queryParams, params = __rest(queryParams, ["limit"]);
|
|
35232
36543
|
const options = token ? { token } : { limit };
|
|
35233
|
-
const { data: response } = await this.http.get(`/api/v1/events/me/
|
|
36544
|
+
const { data: response } = await this.http.get(`/api/v1/events/me/rsvp`, { params: Object.assign(Object.assign({}, params), { options }) });
|
|
35234
36545
|
return response;
|
|
35235
36546
|
}
|
|
35236
36547
|
}
|
|
@@ -35347,6 +36658,9 @@ class MyEventLiveCollectionController extends LiveCollectionController {
|
|
|
35347
36658
|
* @category Event Live Collection
|
|
35348
36659
|
*
|
|
35349
36660
|
*/
|
|
36661
|
+
/* begin_public_function
|
|
36662
|
+
id: event.get-my-events
|
|
36663
|
+
*/
|
|
35350
36664
|
const getMyEvents = (params, callback, config) => {
|
|
35351
36665
|
const { log, cache } = getActiveClient();
|
|
35352
36666
|
if (!cache)
|
|
@@ -35363,7 +36677,7 @@ const getMyEvents = (params, callback, config) => {
|
|
|
35363
36677
|
};
|
|
35364
36678
|
};
|
|
35365
36679
|
|
|
35366
|
-
var index$
|
|
36680
|
+
var index$2 = /*#__PURE__*/Object.freeze({
|
|
35367
36681
|
__proto__: null,
|
|
35368
36682
|
createEvent: createEvent,
|
|
35369
36683
|
updateEvent: updateEvent,
|
|
@@ -35425,6 +36739,7 @@ getProduct$1.locally = (productId) => {
|
|
|
35425
36739
|
|
|
35426
36740
|
/* begin_public_function
|
|
35427
36741
|
id: product.get
|
|
36742
|
+
spec: API/product/get/v1.md
|
|
35428
36743
|
*/
|
|
35429
36744
|
/**
|
|
35430
36745
|
* ```js
|
|
@@ -35548,6 +36863,7 @@ class SearchProductLiveCollectionController extends LiveCollectionController {
|
|
|
35548
36863
|
|
|
35549
36864
|
/* begin_public_function
|
|
35550
36865
|
id: product.search
|
|
36866
|
+
spec: API/product/search/v2.md
|
|
35551
36867
|
*/
|
|
35552
36868
|
/**
|
|
35553
36869
|
* ```js
|
|
@@ -35590,12 +36906,36 @@ const searchProducts = (params, callback, config) => {
|
|
|
35590
36906
|
};
|
|
35591
36907
|
/* end_public_function */
|
|
35592
36908
|
|
|
35593
|
-
var index = /*#__PURE__*/Object.freeze({
|
|
36909
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
35594
36910
|
__proto__: null,
|
|
35595
36911
|
getProduct: getProduct,
|
|
35596
36912
|
searchProducts: searchProducts
|
|
35597
36913
|
});
|
|
35598
36914
|
|
|
36915
|
+
const getPool = async (topicId, limit) => {
|
|
36916
|
+
const client = getActiveClient();
|
|
36917
|
+
if (!topicId)
|
|
36918
|
+
throw new ASCError('topicId must not be empty', 800110 /* Amity.ClientError.INVALID_PARAMETERS */, "error" /* Amity.ErrorLevel.ERROR */);
|
|
36919
|
+
if (limit !== undefined && (limit < 1 || limit > 100))
|
|
36920
|
+
throw new ASCError('limit must be between 1 and 100', 800110 /* Amity.ClientError.INVALID_PARAMETERS */, "error" /* Amity.ErrorLevel.ERROR */);
|
|
36921
|
+
const { data } = await client.http.get('/api/v5/curated-content/pool', { params: { topicId, limit } });
|
|
36922
|
+
const { topic } = data, payload = __rest(data, ["topic"]);
|
|
36923
|
+
const processedPayload = preparePostPayload(payload);
|
|
36924
|
+
const cachedAt = client.cache && Date.now();
|
|
36925
|
+
if (client.cache) {
|
|
36926
|
+
ingestInCache(processedPayload, { cachedAt });
|
|
36927
|
+
}
|
|
36928
|
+
return {
|
|
36929
|
+
topic: LinkedObject.curatedContentTopic(topic),
|
|
36930
|
+
posts: processedPayload.posts.map(LinkedObject.post),
|
|
36931
|
+
};
|
|
36932
|
+
};
|
|
36933
|
+
|
|
36934
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
36935
|
+
__proto__: null,
|
|
36936
|
+
getPool: getPool
|
|
36937
|
+
});
|
|
36938
|
+
|
|
35599
36939
|
/**
|
|
35600
36940
|
* Helper class for managing product tags per media attachment.
|
|
35601
36941
|
*
|
|
@@ -35643,4 +36983,4 @@ class AmityAttachmentProductTags {
|
|
|
35643
36983
|
}
|
|
35644
36984
|
}
|
|
35645
36985
|
|
|
35646
|
-
export { API_REGIONS, index$
|
|
36986
|
+
export { API_REGIONS, index$6 as AdRepository, AmityAttachmentProductTags, AmityAutoSubscription, AmityChannelNotificationModeEnum, AmityCommunityType, AmityEventOrderOption, AmityEventOriginType, AmityEventResponseStatus, AmityEventSortOption, AmityEventStatus, AmityEventType, AmityLiveViewerCountMode, AmitySharableContentType, AnalyticsSourceTypeEnum, index$g as CategoryRepository, index$k as ChannelRepository, index$t as Client, index$f as CommentRepository, CommunityNotificationEventNameEnum, CommunityPostSettingMaps, CommunityPostSettings, index$h as CommunityRepository, ContentFeedType, ContentFlagReasonEnum, index as CuratedContentRepository, DefaultCommunityPostSetting, index$2 as EventRepository, FeedDataTypeEnum, index$e as FeedRepository, FeedSortByEnum, FeedSourceEnum, FeedTypeEnum, FileAccessTypeEnum, index$q as FileRepository, FileType, GET_WATCHER_URLS, index$4 as InvitationRepository, InvitationSortByEnum, InvitationStatusEnum, InvitationTargetTypeEnum, InvitationTypeEnum, JoinRequestStatusEnum, JoinResultStatusEnum, index$3 as LiveReactionRepository, index$8 as LiveStreamPlayer, MembershipAcceptanceTypeEnum, MessageContentType, index$o as MessageRepository, NotificationRolesFilterTypeEnum, NotificationSettingsLevelEnum, index$9 as PollRepository, PostContentType, index$c as PostRepository, PostStructureType, index$1 as ProductRepository, index$p as ReactionRepository, index$a as RoomPresenceRepository, index$d as RoomRepository, SearchUsersByEnum, index$7 as StoryRepository, index$b as StreamRepository, index$n as SubChannelRepository, SubscriptionLevels, UserNotificationModuleNameEnum, UserReportTypeEnum, index$r as UserRepository, UserTypeEnum, VERSION, VideoResolution, VideoSize, VideoTranscodingStatus, backupCache, createQuery, createReport, createUserToken, deleteReport, disableCache, dropFromCache, enableCache, exceedsUntilAtBoundary, filterByChannelMembership, filterByCommunityMembership, filterByFeedType, filterByPostDataTypes, filterByPropEquality, filterByPropInclusion, filterByPropIntersection, filterBySearchTerm, filterByStringComparePartially, filterByUntilAt, filterCommentsByBlockUsers, filterPostsByBlockUsers, getBlockUsersId, getChannelTopic, getCommentTopic, getCommunityStoriesTopic, getCommunityTopic, getLiveReactionTopic, getLiveStreamTopic, getMarkedMessageTopic, getMarkerUserFeedTopic, getMessageTopic, getMyFollowersTopic, getMyFollowingsTopic, getNetworkId, getNetworkTopic, getPostTopic, getRole, getRoomStreamerTopic, getRoomWatcherTopic, getSmartFeedChannelTopic, getSmartFeedMessageTopic, getSmartFeedSubChannelTopic, getStoryTopic, getSubChannelTopic, getUserTopic, isAfterBefore, isAfterBeforeRaw, isCachable, isFetcher, isFresh, isLocal, isMutator, isOffline, isPaged, isReportedByMe, isSkip, mergeInCache, index$5 as notificationTray, onChannelMarkerFetched, onFeedMarkerFetched, onFeedMarkerUpdated, onMessageMarked, onMessageMarkerFetched, onSubChannelMarkerFetched, onSubChannelMarkerUpdated, onUserMarkerFetched, onUserMarkerFetchedLegacy, pullFromCache, pushToCache, queryCache, queryOptions, queryRoles, restoreCache, runQuery, sortByChannelSegment, sortByDisplayName, sortByFirstCreated, sortByFirstUpdated, sortByLastActivity, sortByLastCreated, sortByLastUpdated, sortByLocalSortingDate, sortByName, sortBySegmentNumber, subscribeTopic, toPage, toPageRaw, toToken, upsertInCache, validateUntilAt, wipeCache };
|