@amityco/ts-sdk 7.5.1-3d3fd19.0 → 7.5.1-3eaba4ad.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 +1 -8
- package/dist/@types/core/events.d.ts.map +1 -1
- package/dist/@types/core/model.d.ts +1 -5
- package/dist/@types/core/model.d.ts.map +1 -1
- package/dist/@types/core/payload.d.ts +5 -38
- package/dist/@types/core/payload.d.ts.map +1 -1
- package/dist/@types/domains/channel.d.ts +2 -0
- package/dist/@types/domains/channel.d.ts.map +1 -1
- package/dist/@types/domains/client.d.ts +0 -10
- package/dist/@types/domains/client.d.ts.map +1 -1
- package/dist/@types/domains/community.d.ts +1 -51
- package/dist/@types/domains/community.d.ts.map +1 -1
- package/dist/@types/domains/content.d.ts +4 -1
- package/dist/@types/domains/content.d.ts.map +1 -1
- package/dist/@types/domains/notification.d.ts +2 -4
- package/dist/@types/domains/notification.d.ts.map +1 -1
- package/dist/@types/domains/post.d.ts +2 -0
- package/dist/@types/domains/post.d.ts.map +1 -1
- package/dist/@types/domains/stream.d.ts +4 -0
- package/dist/@types/domains/stream.d.ts.map +1 -1
- package/dist/@types/index.d.ts +0 -3
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/channelRepository/api/createChannel.d.ts +3 -1
- package/dist/channelRepository/api/createChannel.d.ts.map +1 -1
- package/dist/channelRepository/internalApi/getChannel.d.ts.map +1 -1
- 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/getTotalChannelsUnread.d.ts.map +1 -1
- package/dist/channelRepository/utils/prepareChannelPayload.d.ts.map +1 -1
- package/dist/communityRepository/api/createCommunity.d.ts +2 -2
- package/dist/communityRepository/api/createCommunity.d.ts.map +1 -1
- package/dist/communityRepository/api/getCommunities.d.ts +1 -1
- package/dist/communityRepository/api/getCommunities.d.ts.map +1 -1
- package/dist/communityRepository/api/getCommunity.d.ts +1 -1
- package/dist/communityRepository/api/getCommunity.d.ts.map +1 -1
- package/dist/communityRepository/api/getRecommendedCommunities.d.ts +1 -3
- package/dist/communityRepository/api/getRecommendedCommunities.d.ts.map +1 -1
- package/dist/communityRepository/api/getTrendingCommunities.d.ts +1 -3
- package/dist/communityRepository/api/getTrendingCommunities.d.ts.map +1 -1
- package/dist/communityRepository/api/joinCommunity.d.ts +0 -3
- package/dist/communityRepository/api/joinCommunity.d.ts.map +1 -1
- package/dist/communityRepository/api/queryCommunities.d.ts.map +1 -1
- package/dist/communityRepository/api/updateCommunity.d.ts +2 -2
- package/dist/communityRepository/api/updateCommunity.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/index.d.ts +0 -1
- package/dist/communityRepository/communityMembership/events/index.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/utils.d.ts +2 -2
- package/dist/communityRepository/communityMembership/events/utils.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts +1 -1
- package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts.map +1 -1
- package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts +1 -1
- package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts.map +1 -1
- package/dist/communityRepository/events/onCommunityCreated.d.ts +1 -1
- package/dist/communityRepository/events/onCommunityCreated.d.ts.map +1 -1
- package/dist/communityRepository/events/onCommunityDeleted.d.ts +1 -1
- package/dist/communityRepository/events/onCommunityDeleted.d.ts.map +1 -1
- package/dist/communityRepository/events/onCommunityUpdated.d.ts +1 -1
- package/dist/communityRepository/events/onCommunityUpdated.d.ts.map +1 -1
- package/dist/communityRepository/events/utils.d.ts +1 -1
- package/dist/communityRepository/events/utils.d.ts.map +1 -1
- package/dist/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getCommunities/CommunitiesPaginationController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getCommunity.d.ts.map +1 -1
- package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesLiveCollectionController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesPaginationController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesLiveCollectionController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesPaginationController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/observers/index.d.ts +0 -1
- package/dist/communityRepository/observers/index.d.ts.map +1 -1
- package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesPaginationController.d.ts.map +1 -1
- package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityPaginationController.d.ts.map +1 -1
- package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/utils/communityWithMembership.d.ts +1 -1
- package/dist/communityRepository/utils/communityWithMembership.d.ts.map +1 -1
- package/dist/communityRepository/utils/payload.d.ts +1 -2
- package/dist/communityRepository/utils/payload.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/model/idResolvers.d.ts.map +1 -1
- package/dist/core/model/index.d.ts.map +1 -1
- package/dist/index.cjs.js +5113 -6421
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +2588 -3895
- package/dist/index.umd.js +4 -4
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts +2 -0
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts.map +1 -1
- package/dist/messagePreview/utils/getSubChannelMessagePreviewWithUser.d.ts +1 -1
- package/dist/messageRepository/api/deleteMessage.d.ts.map +1 -1
- package/dist/messageRepository/observers/getMessages/MessageQueryStreamController.d.ts.map +1 -1
- package/dist/postRepository/api/createPost.d.ts.map +1 -1
- package/dist/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostQueryStreamController.d.ts.map +1 -1
- package/dist/postRepository/observers/getPinnedPosts/PinnedPostQueryStreamController.d.ts.map +1 -1
- package/dist/postRepository/utils/payload.d.ts.map +1 -1
- package/dist/streamRepository/api/createStream.d.ts +1 -1
- package/dist/streamRepository/api/createStream.d.ts.map +1 -1
- package/dist/streamRepository/api/editStream.d.ts +18 -0
- package/dist/streamRepository/api/editStream.d.ts.map +1 -0
- package/dist/streamRepository/api/index.d.ts +1 -0
- package/dist/streamRepository/api/index.d.ts.map +1 -1
- package/dist/streamRepository/api/updateStream.d.ts +4 -1
- package/dist/streamRepository/api/updateStream.d.ts.map +1 -1
- package/dist/streamRepository/internalApi/getLiveChat.d.ts +16 -0
- package/dist/streamRepository/internalApi/getLiveChat.d.ts.map +1 -0
- package/dist/streamRepository/internalApi/getStream.d.ts +2 -2
- package/dist/streamRepository/internalApi/getStream.d.ts.map +1 -1
- package/dist/subChannelRepository/utils/prepareSubChannelPayload.d.ts.map +1 -1
- package/dist/utils/linkedObject/index.d.ts +0 -3
- package/dist/utils/linkedObject/index.d.ts.map +1 -1
- package/dist/utils/linkedObject/postLinkedObject.d.ts.map +1 -1
- package/dist/utils/linkedObject/streamLinkedObject.d.ts.map +1 -1
- package/dist/utils/postTypePredicate.d.ts +4 -3
- package/dist/utils/postTypePredicate.d.ts.map +1 -1
- package/dist/utils/tests/dummy/comment.d.ts +1 -1
- package/dist/utils/tests/dummy/post.d.ts +3 -3
- package/package.json +1 -1
- package/src/@types/core/events.ts +1 -11
- package/src/@types/core/model.ts +1 -8
- package/src/@types/core/payload.ts +5 -48
- package/src/@types/domains/channel.ts +3 -0
- package/src/@types/domains/client.ts +0 -12
- package/src/@types/domains/community.ts +3 -82
- package/src/@types/domains/content.ts +6 -0
- package/src/@types/domains/notification.ts +0 -2
- package/src/@types/domains/post.ts +2 -0
- package/src/@types/domains/stream.ts +4 -0
- package/src/@types/index.ts +0 -3
- package/src/channelRepository/api/createChannel.ts +12 -9
- package/src/channelRepository/internalApi/getChannel.ts +0 -1
- package/src/channelRepository/observers/getChannel.ts +1 -11
- package/src/channelRepository/observers/getChannels/ChannelLiveCollectionController.ts +1 -10
- package/src/channelRepository/observers/getTotalChannelsUnread.ts +1 -3
- package/src/channelRepository/utils/constructChannelObject.ts +2 -2
- package/src/channelRepository/utils/prepareChannelPayload.ts +1 -6
- package/src/client/utils/ReadReceiptSync/readReceiptSyncEngine.ts +1 -1
- package/src/communityRepository/api/createCommunity.ts +2 -5
- package/src/communityRepository/api/getCommunities.ts +2 -9
- package/src/communityRepository/api/getCommunity.ts +2 -13
- package/src/communityRepository/api/getRecommendedCommunities.ts +4 -11
- package/src/communityRepository/api/getTrendingCommunities.ts +4 -11
- package/src/communityRepository/api/joinCommunity.ts +1 -4
- package/src/communityRepository/api/queryCommunities.ts +1 -7
- package/src/communityRepository/api/updateCommunity.ts +3 -13
- package/src/communityRepository/communityMembership/events/index.ts +0 -1
- package/src/communityRepository/communityMembership/events/onCommunityJoined.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityLeft.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserAdded.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserBanned.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserChanged.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserRemoved.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserRoleAdded.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserUnbanned.ts +1 -1
- package/src/communityRepository/communityMembership/events/onLocalCommunityJoined.ts +1 -1
- package/src/communityRepository/communityMembership/events/onLocalCommunityLeft.ts +1 -1
- package/src/communityRepository/communityMembership/events/onLocalCommunityUserAdded.ts +1 -1
- package/src/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.ts +1 -1
- package/src/communityRepository/communityMembership/events/onUserDeleted.ts +1 -3
- package/src/communityRepository/communityMembership/events/utils.ts +2 -2
- package/src/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.ts +2 -8
- package/src/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.ts +2 -8
- package/src/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.ts +1 -1
- package/src/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.ts +1 -1
- package/src/communityRepository/events/onCommunityCreated.ts +1 -1
- package/src/communityRepository/events/onCommunityDeleted.ts +1 -1
- package/src/communityRepository/events/onCommunityUpdated.ts +1 -1
- package/src/communityRepository/events/utils.ts +1 -1
- package/src/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.ts +0 -6
- package/src/communityRepository/observers/getCommunities/CommunitiesPaginationController.ts +0 -1
- package/src/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/getCommunity.ts +0 -3
- package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesLiveCollectionController.ts +1 -2
- package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesPaginationController.ts +1 -6
- package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesLiveCollectionController.ts +1 -2
- package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesPaginationController.ts +1 -6
- package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/index.ts +0 -1
- package/src/communityRepository/observers/searchCommunities/SearchCommunitiesPaginationController.ts +0 -1
- package/src/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityPaginationController.ts +0 -1
- package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.ts +2 -2
- package/src/communityRepository/utils/communityWithMembership.ts +5 -9
- package/src/communityRepository/utils/payload.ts +2 -28
- package/src/core/liveCollection/PaginationController.ts +1 -1
- package/src/core/liveCollection/PaginationNoPageController.ts +1 -1
- package/src/core/model/idResolvers.ts +0 -3
- package/src/core/model/index.ts +0 -3
- package/src/index.ts +0 -2
- package/src/messagePreview/utils/getChannelMessagePreviewWithUser.ts +1 -1
- package/src/messageRepository/api/deleteMessage.ts +16 -0
- package/src/messageRepository/events/onMessageCreated.ts +1 -1
- package/src/messageRepository/observers/getMessages/MessageQueryStreamController.ts +13 -0
- package/src/postRepository/api/createPost.ts +3 -2
- package/src/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostQueryStreamController.ts +1 -7
- package/src/postRepository/observers/getPinnedPosts/PinnedPostQueryStreamController.ts +1 -7
- package/src/postRepository/utils/payload.ts +35 -1
- package/src/streamRepository/api/createStream.ts +4 -1
- package/src/streamRepository/api/editStream.ts +51 -0
- package/src/streamRepository/api/index.ts +1 -0
- package/src/streamRepository/api/updateStream.ts +8 -1
- package/src/streamRepository/internalApi/getLiveChat.ts +59 -0
- package/src/streamRepository/internalApi/getStream.ts +3 -3
- package/src/streamRepository/observers/getStreams/GetStreamsLiveCollectionController.ts +1 -1
- package/src/subChannelRepository/utils/prepareSubChannelPayload.ts +0 -4
- package/src/utils/linkedObject/index.ts +0 -6
- package/src/utils/linkedObject/postLinkedObject.ts +34 -11
- package/src/utils/linkedObject/streamLinkedObject.ts +2 -0
- package/src/utils/postTypePredicate.ts +16 -3
- package/dist/@types/domains/invitation.d.ts +0 -92
- package/dist/@types/domains/invitation.d.ts.map +0 -1
- package/dist/@types/domains/joinRequest.d.ts +0 -53
- package/dist/@types/domains/joinRequest.d.ts.map +0 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityJoin.d.ts +0 -2
- package/dist/communityRepository/communityMembership/events/onLocalCommunityJoin.d.ts.map +0 -1
- package/dist/communityRepository/internalAPI/getMyJoinRequest.d.ts +0 -16
- package/dist/communityRepository/internalAPI/getMyJoinRequest.d.ts.map +0 -1
- package/dist/communityRepository/internalAPI/joinCommunity.d.ts +0 -16
- package/dist/communityRepository/internalAPI/joinCommunity.d.ts.map +0 -1
- package/dist/communityRepository/joinRequest/events/index.d.ts +0 -4
- package/dist/communityRepository/joinRequest/events/index.d.ts.map +0 -1
- package/dist/communityRepository/joinRequest/events/onJoinRequestCreated.d.ts +0 -17
- package/dist/communityRepository/joinRequest/events/onJoinRequestCreated.d.ts.map +0 -1
- package/dist/communityRepository/joinRequest/events/onJoinRequestDeleted.d.ts +0 -17
- package/dist/communityRepository/joinRequest/events/onJoinRequestDeleted.d.ts.map +0 -1
- package/dist/communityRepository/joinRequest/events/onJoinRequestUpdated.d.ts +0 -17
- package/dist/communityRepository/joinRequest/events/onJoinRequestUpdated.d.ts.map +0 -1
- package/dist/communityRepository/joinRequest/internalAPI/approveJoinRequest.d.ts +0 -16
- package/dist/communityRepository/joinRequest/internalAPI/approveJoinRequest.d.ts.map +0 -1
- package/dist/communityRepository/joinRequest/internalAPI/cancelJoinRequest.d.ts +0 -16
- package/dist/communityRepository/joinRequest/internalAPI/cancelJoinRequest.d.ts.map +0 -1
- package/dist/communityRepository/joinRequest/internalAPI/rejectJoinRequest.d.ts +0 -16
- package/dist/communityRepository/joinRequest/internalAPI/rejectJoinRequest.d.ts.map +0 -1
- package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.d.ts +0 -14
- package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.d.ts.map +0 -1
- package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.d.ts +0 -9
- package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.d.ts.map +0 -1
- package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.d.ts +0 -15
- package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.d.ts.map +0 -1
- package/dist/communityRepository/observers/getJoinRequestList/enum.d.ts +0 -6
- package/dist/communityRepository/observers/getJoinRequestList/enum.d.ts.map +0 -1
- package/dist/communityRepository/observers/getJoinRequestList.d.ts +0 -12
- package/dist/communityRepository/observers/getJoinRequestList.d.ts.map +0 -1
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.d.ts +0 -14
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.d.ts.map +0 -1
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.d.ts +0 -9
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.d.ts.map +0 -1
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.d.ts +0 -15
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.d.ts.map +0 -1
- package/dist/communityRepository/observers/getJoinRequests/enum.d.ts +0 -6
- package/dist/communityRepository/observers/getJoinRequests/enum.d.ts.map +0 -1
- package/dist/communityRepository/observers/getJoinRequests.d.ts +0 -12
- package/dist/communityRepository/observers/getJoinRequests.d.ts.map +0 -1
- package/dist/invitationRepository/events/index.d.ts +0 -4
- package/dist/invitationRepository/events/index.d.ts.map +0 -1
- package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts +0 -17
- package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts.map +0 -1
- package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts +0 -17
- package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts.map +0 -1
- package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts +0 -17
- package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts.map +0 -1
- package/dist/invitationRepository/index.d.ts +0 -3
- package/dist/invitationRepository/index.d.ts.map +0 -1
- package/dist/invitationRepository/internalApi/acceptInvitation.d.ts +0 -16
- package/dist/invitationRepository/internalApi/acceptInvitation.d.ts.map +0 -1
- package/dist/invitationRepository/internalApi/createInvitations.d.ts +0 -21
- package/dist/invitationRepository/internalApi/createInvitations.d.ts.map +0 -1
- package/dist/invitationRepository/internalApi/getInvitation.d.ts +0 -17
- package/dist/invitationRepository/internalApi/getInvitation.d.ts.map +0 -1
- package/dist/invitationRepository/internalApi/index.d.ts +0 -4
- package/dist/invitationRepository/internalApi/index.d.ts.map +0 -1
- package/dist/invitationRepository/internalApi/rejectInvitation.d.ts +0 -16
- package/dist/invitationRepository/internalApi/rejectInvitation.d.ts.map +0 -1
- package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts +0 -14
- package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts.map +0 -1
- package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts +0 -5
- package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts.map +0 -1
- package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts +0 -15
- package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts.map +0 -1
- package/dist/invitationRepository/observers/getInvitations/enums.d.ts +0 -6
- package/dist/invitationRepository/observers/getInvitations/enums.d.ts.map +0 -1
- package/dist/invitationRepository/observers/getInvitations.d.ts +0 -12
- package/dist/invitationRepository/observers/getInvitations.d.ts.map +0 -1
- package/dist/invitationRepository/observers/getMyCommunityInvitations.d.ts +0 -12
- package/dist/invitationRepository/observers/getMyCommunityInvitations.d.ts.map +0 -1
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.d.ts +0 -14
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.d.ts.map +0 -1
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.d.ts +0 -5
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.d.ts.map +0 -1
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.d.ts +0 -15
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.d.ts.map +0 -1
- package/dist/invitationRepository/observers/index.d.ts +0 -2
- package/dist/invitationRepository/observers/index.d.ts.map +0 -1
- package/dist/invitationRepository/utils/convertRawInvitationToInternalInvitation.d.ts +0 -2
- package/dist/invitationRepository/utils/convertRawInvitationToInternalInvitation.d.ts.map +0 -1
- package/dist/invitationRepository/utils/index.d.ts +0 -2
- package/dist/invitationRepository/utils/index.d.ts.map +0 -1
- package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts +0 -2
- package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts.map +0 -1
- package/dist/invitationRepository/utils/prepareMyInvitationsPayload.d.ts +0 -2
- package/dist/invitationRepository/utils/prepareMyInvitationsPayload.d.ts.map +0 -1
- package/dist/utils/linkedObject/communityLinkedObject.d.ts +0 -2
- package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +0 -1
- package/dist/utils/linkedObject/invitationLinkedObject.d.ts +0 -2
- package/dist/utils/linkedObject/invitationLinkedObject.d.ts.map +0 -1
- package/dist/utils/linkedObject/joinRequestLinkedObject.d.ts +0 -2
- package/dist/utils/linkedObject/joinRequestLinkedObject.d.ts.map +0 -1
- package/src/@types/domains/invitation.ts +0 -119
- package/src/@types/domains/joinRequest.ts +0 -66
- package/src/communityRepository/communityMembership/events/onLocalCommunityJoin.ts +0 -20
- package/src/communityRepository/internalAPI/getMyJoinRequest.ts +0 -43
- package/src/communityRepository/internalAPI/joinCommunity.ts +0 -66
- package/src/communityRepository/joinRequest/events/index.ts +0 -3
- package/src/communityRepository/joinRequest/events/onJoinRequestCreated.ts +0 -33
- package/src/communityRepository/joinRequest/events/onJoinRequestDeleted.ts +0 -33
- package/src/communityRepository/joinRequest/events/onJoinRequestUpdated.ts +0 -33
- package/src/communityRepository/joinRequest/internalAPI/approveJoinRequest.ts +0 -52
- package/src/communityRepository/joinRequest/internalAPI/cancelJoinRequest.ts +0 -46
- package/src/communityRepository/joinRequest/internalAPI/rejectJoinRequest.ts +0 -52
- package/src/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.ts +0 -130
- package/src/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.ts +0 -30
- package/src/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.ts +0 -112
- package/src/communityRepository/observers/getJoinRequestList/enum.ts +0 -5
- package/src/communityRepository/observers/getJoinRequestList.ts +0 -51
- package/src/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.ts +0 -126
- package/src/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.ts +0 -26
- package/src/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.ts +0 -108
- package/src/communityRepository/observers/getJoinRequests/enum.ts +0 -5
- package/src/communityRepository/observers/getJoinRequests.ts +0 -44
- package/src/invitationRepository/events/index.ts +0 -3
- package/src/invitationRepository/events/onLocalInvitationCreated.ts +0 -33
- package/src/invitationRepository/events/onLocalInvitationDeleted.ts +0 -33
- package/src/invitationRepository/events/onLocalInvitationUpdated.ts +0 -33
- package/src/invitationRepository/index.ts +0 -2
- package/src/invitationRepository/internalApi/acceptInvitation.ts +0 -45
- package/src/invitationRepository/internalApi/createInvitations.ts +0 -52
- package/src/invitationRepository/internalApi/getInvitation.ts +0 -47
- package/src/invitationRepository/internalApi/index.ts +0 -3
- package/src/invitationRepository/internalApi/rejectInvitation.ts +0 -45
- package/src/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.ts +0 -148
- package/src/invitationRepository/observers/getInvitations/InvitationsPaginationController.ts +0 -19
- package/src/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.ts +0 -97
- package/src/invitationRepository/observers/getInvitations/enums.ts +0 -5
- package/src/invitationRepository/observers/getInvitations.ts +0 -44
- package/src/invitationRepository/observers/getMyCommunityInvitations.ts +0 -48
- package/src/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.ts +0 -148
- package/src/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.ts +0 -22
- package/src/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.ts +0 -105
- package/src/invitationRepository/observers/index.ts +0 -1
- package/src/invitationRepository/utils/convertRawInvitationToInternalInvitation.ts +0 -8
- package/src/invitationRepository/utils/index.ts +0 -1
- package/src/invitationRepository/utils/prepareInvitationPayload.ts +0 -12
- package/src/invitationRepository/utils/prepareMyInvitationsPayload.ts +0 -12
- package/src/utils/linkedObject/communityLinkedObject.ts +0 -57
- package/src/utils/linkedObject/invitationLinkedObject.ts +0 -37
- package/src/utils/linkedObject/joinRequestLinkedObject.ts +0 -31
|
@@ -58,6 +58,10 @@ declare global {
|
|
|
58
58
|
pollId: Amity.Poll['pollId'];
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
+
type ContentDataStream = {
|
|
62
|
+
streamId: Amity.Stream['streamId'];
|
|
63
|
+
};
|
|
64
|
+
|
|
61
65
|
type ContentData<T extends ContentType> = T extends 'text'
|
|
62
66
|
? ContentDataText
|
|
63
67
|
: T extends 'file'
|
|
@@ -68,6 +72,8 @@ declare global {
|
|
|
68
72
|
? ContentDataVideo
|
|
69
73
|
: T extends 'poll'
|
|
70
74
|
? ContentDataPoll
|
|
75
|
+
: T extends 'liveStream'
|
|
76
|
+
? ContentDataStream
|
|
71
77
|
: T extends 'json'
|
|
72
78
|
? Record<string, unknown>
|
|
73
79
|
: T extends string
|
|
@@ -10,7 +10,6 @@ declare global {
|
|
|
10
10
|
POST_REACT = 'reaction_on_post',
|
|
11
11
|
COMMENT_REACT = 'reaction_on_comment',
|
|
12
12
|
REPLY_REACT = 'reaction_on_reply',
|
|
13
|
-
RESPONSE_JOIN_REQUEST = 'respond_on_join_request',
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
const enum TrayAction {
|
|
@@ -20,7 +19,6 @@ declare global {
|
|
|
20
19
|
REACTION = 'reaction',
|
|
21
20
|
MENTION = 'mention',
|
|
22
21
|
REPLY = 'reply',
|
|
23
|
-
JOIN_REQUEST = 'join_request',
|
|
24
22
|
}
|
|
25
23
|
|
|
26
24
|
type RawNotificationTrayItem = {
|
|
@@ -53,6 +53,7 @@ declare global {
|
|
|
53
53
|
|
|
54
54
|
type InternalPost<T extends PostContentType = any> = RawPost<T> & {
|
|
55
55
|
feedType?: 'reviewing' | 'published';
|
|
56
|
+
childPost?: Amity.RawPost;
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
type PostLinkObject = {
|
|
@@ -65,6 +66,7 @@ declare global {
|
|
|
65
66
|
getVideoInfo: () => Amity.File<'video'> | undefined;
|
|
66
67
|
getVideoThumbnailInfo: () => Amity.File<'image'> | undefined;
|
|
67
68
|
getFileInfo: () => Amity.File<'file'> | undefined;
|
|
69
|
+
getLivestreamInfo: () => Amity.Stream | undefined;
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
type Post<T extends PostContentType = any> = Amity.InternalPost<T> & Amity.PostLinkObject;
|
|
@@ -73,6 +73,9 @@ declare global {
|
|
|
73
73
|
*/
|
|
74
74
|
targetId?: string; // communityId, userId, etc..
|
|
75
75
|
targetType?: string; // 'community', 'user', etc..
|
|
76
|
+
channelId?: string;
|
|
77
|
+
postId?: string;
|
|
78
|
+
channelEnabled?: boolean;
|
|
76
79
|
} & Amity.Metadata &
|
|
77
80
|
Amity.Timestamps &
|
|
78
81
|
Amity.SoftDelete;
|
|
@@ -81,6 +84,7 @@ declare global {
|
|
|
81
84
|
|
|
82
85
|
type StreamLinkedObject = {
|
|
83
86
|
moderation?: Amity.StreamModeration;
|
|
87
|
+
getLiveChat: () => Promise<Amity.Channel<'live'> | undefined>;
|
|
84
88
|
};
|
|
85
89
|
|
|
86
90
|
type Stream = Amity.InternalStream & Amity.StreamLinkedObject;
|
package/src/@types/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { getActiveClient } from '~/client/api';
|
|
1
|
+
import { getActiveClient } from '~/client/api/activeClient';
|
|
2
2
|
|
|
3
3
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
4
4
|
|
|
5
|
-
import { prepareChannelPayload } from '../utils';
|
|
6
|
-
import {
|
|
5
|
+
import { prepareChannelPayload } from '../utils/prepareChannelPayload';
|
|
6
|
+
import { constructChannelObject } from '../utils/constructChannelObject';
|
|
7
7
|
|
|
8
8
|
/* begin_public_function
|
|
9
9
|
id: channel.create
|
|
@@ -23,11 +23,14 @@ import { constructChannelDynamicValue } from '../utils/constructChannelDynamicVa
|
|
|
23
23
|
* @async
|
|
24
24
|
*/
|
|
25
25
|
export const createChannel = async <T extends Amity.ChannelType>(
|
|
26
|
-
bundle: {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
bundle: {
|
|
27
|
+
type: T;
|
|
28
|
+
userIds?: Amity.InternalUser['userId'][];
|
|
29
|
+
// For live channel linked with a livestream post
|
|
30
|
+
videoStreamId?: string;
|
|
31
|
+
postId?: string;
|
|
32
|
+
} & Pick<Amity.Channel<T>, 'displayName' | 'avatarFileId' | 'tags' | 'metadata' | 'isPublic'>,
|
|
33
|
+
): Promise<Amity.Cached<Amity.Channel<T>>> => {
|
|
31
34
|
const client = getActiveClient();
|
|
32
35
|
client.log('user/createChannel', bundle);
|
|
33
36
|
|
|
@@ -53,7 +56,7 @@ export const createChannel = async <T extends Amity.ChannelType>(
|
|
|
53
56
|
|
|
54
57
|
const { channels } = data;
|
|
55
58
|
return {
|
|
56
|
-
data:
|
|
59
|
+
data: constructChannelObject(channels[0]),
|
|
57
60
|
cachedAt,
|
|
58
61
|
};
|
|
59
62
|
};
|
|
@@ -9,7 +9,6 @@ import { pushToTombstone } from '~/cache/api/pushToTombstone';
|
|
|
9
9
|
|
|
10
10
|
import { prepareChannelPayload } from '../utils';
|
|
11
11
|
import { prepareUnreadCountInfo } from '../utils/prepareUnreadCountInfo';
|
|
12
|
-
import { constructChannelDynamicValue } from '../utils/constructChannelDynamicValue';
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* ```js
|
|
@@ -297,17 +297,7 @@ export const getChannel = (
|
|
|
297
297
|
),
|
|
298
298
|
convertEventPayload(onSubChannelCreated, 'channelId', 'channel'),
|
|
299
299
|
convertEventPayload(onChannelUnreadInfoUpdatedLocal, 'channelId', 'channel'),
|
|
300
|
-
convertEventPayload(
|
|
301
|
-
(callback: Amity.Listener<Amity.ChannelUnread>) => {
|
|
302
|
-
const processPayload = (payloads: Amity.ChannelUnread[]) => {
|
|
303
|
-
payloads.forEach(callback);
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
return onChannelUnreadUpdatedLocal(processPayload);
|
|
307
|
-
},
|
|
308
|
-
'channelId',
|
|
309
|
-
'channel',
|
|
310
|
-
),
|
|
300
|
+
convertEventPayload(onChannelUnreadUpdatedLocal, 'channelId', 'channel'),
|
|
311
301
|
],
|
|
312
302
|
{
|
|
313
303
|
forceDispatch: true,
|
|
@@ -572,16 +572,7 @@ export class ChannelLiveCollectionController extends LiveCollectionController<
|
|
|
572
572
|
action: Amity.ChannelActionType.OnUpdate,
|
|
573
573
|
},
|
|
574
574
|
{
|
|
575
|
-
fn: convertEventPayload(
|
|
576
|
-
(callback: Amity.Listener<Amity.ChannelUnread>) => {
|
|
577
|
-
const processPayload = (payloads: Amity.ChannelUnread[]) => {
|
|
578
|
-
payloads.forEach(callback);
|
|
579
|
-
};
|
|
580
|
-
return onChannelUnreadUpdatedLocal(processPayload);
|
|
581
|
-
},
|
|
582
|
-
'channelId',
|
|
583
|
-
'channel',
|
|
584
|
-
),
|
|
575
|
+
fn: convertEventPayload(onChannelUnreadUpdatedLocal, 'channelId', 'channel'),
|
|
585
576
|
action: Amity.ChannelActionType.OnUpdate,
|
|
586
577
|
},
|
|
587
578
|
];
|
|
@@ -82,9 +82,7 @@ export const getTotalChannelsUnread = (
|
|
|
82
82
|
});
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
const realtimeRouter = (
|
|
86
|
-
const { data: userUnread } = _getTotalChannelsUnread();
|
|
87
|
-
|
|
85
|
+
const realtimeRouter = (userUnread: Amity.UserUnread) => {
|
|
88
86
|
if (isEqual(model, userUnread)) return;
|
|
89
87
|
|
|
90
88
|
dispatcher({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getChannelMessagePreviewWithUser } from '~/messagePreview/utils';
|
|
2
2
|
import { constructChannelDynamicValue } from './constructChannelDynamicValue';
|
|
3
|
-
import {
|
|
3
|
+
import { channelLinkedObject } from '~/utils/linkedObject/channelLinkedObject';
|
|
4
4
|
|
|
5
5
|
export const constructChannelObject = (channel: Amity.StaticInternalChannel): Amity.Channel => {
|
|
6
6
|
/**
|
|
@@ -10,7 +10,7 @@ export const constructChannelObject = (channel: Amity.StaticInternalChannel): Am
|
|
|
10
10
|
* 3. [LinkedObject.channel] add markAsRead >> Amity.InternalChannel -> Amity.Channel
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
return
|
|
13
|
+
return channelLinkedObject(
|
|
14
14
|
constructChannelDynamicValue(getChannelMessagePreviewWithUser(channel)),
|
|
15
15
|
);
|
|
16
16
|
};
|
|
@@ -7,7 +7,6 @@ import { getActiveClient } from '~/client/api/activeClient';
|
|
|
7
7
|
import { pullFromCache } from '~/cache/api/pullFromCache';
|
|
8
8
|
import { convertRawUserToInternalUser } from '~/userRepository/utils/convertRawUserToInternalUser';
|
|
9
9
|
import { pushToCache } from '~/cache/api';
|
|
10
|
-
import { fireEvent } from '~/core/events';
|
|
11
10
|
|
|
12
11
|
export const MARKER_INCLUDED_CHANNEL_TYPE = ['broadcast', 'conversation', 'community'];
|
|
13
12
|
export const isUnreadCountSupport = ({ type }: Pick<Amity.RawChannel, 'type'>) =>
|
|
@@ -57,8 +56,6 @@ const updateChannelUnread = ({
|
|
|
57
56
|
channels: Amity.RawChannel[];
|
|
58
57
|
channelUsers: Amity.RawMembership<'channel'>[];
|
|
59
58
|
}) => {
|
|
60
|
-
const channelsUnread: Amity.ChannelUnread[] = [];
|
|
61
|
-
|
|
62
59
|
for (let i = 0; i < channels.length; i += 1) {
|
|
63
60
|
const cacheKey = ['channelUnread', 'get', channels[i].channelId];
|
|
64
61
|
const channelUser = channelUsers.find(
|
|
@@ -87,11 +84,9 @@ const updateChannelUnread = ({
|
|
|
87
84
|
isMentioned,
|
|
88
85
|
isDeleted: channels[i].isDeleted || false,
|
|
89
86
|
};
|
|
90
|
-
pushToCache(cacheKey, cacheChannelUnread);
|
|
91
87
|
|
|
92
|
-
|
|
88
|
+
pushToCache(cacheKey, cacheChannelUnread);
|
|
93
89
|
}
|
|
94
|
-
fireEvent('local.channelUnread.updated', channelsUnread);
|
|
95
90
|
};
|
|
96
91
|
|
|
97
92
|
export const prepareChannelPayload = async (
|
|
@@ -167,7 +167,7 @@ export class MessageReadReceiptSyncEngine {
|
|
|
167
167
|
channelUnread.unreadCount = Math.max(channelUnread.lastSegment - segment, 0);
|
|
168
168
|
|
|
169
169
|
pushToCache(cacheKey, channelUnread);
|
|
170
|
-
fireEvent('local.channelUnread.updated',
|
|
170
|
+
fireEvent('local.channelUnread.updated', channelUnread);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
// Step 2: Enqueue the read receipt
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LinkedObject } from '~/utils/linkedObject';
|
|
2
1
|
import { getActiveClient } from '~/client/api';
|
|
3
2
|
|
|
4
3
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
@@ -12,7 +11,7 @@ import { prepareCommunityPayload, prepareCommunityRequest } from '../utils';
|
|
|
12
11
|
/**
|
|
13
12
|
* ```js
|
|
14
13
|
* import { createCommunity } from '@amityco/ts-sdk'
|
|
15
|
-
* const created = await createCommunity({ communityId: 'foobar', displayName: 'foobar'
|
|
14
|
+
* const created = await createCommunity({ communityId: 'foobar', displayName: 'foobar' })
|
|
16
15
|
* ```
|
|
17
16
|
*
|
|
18
17
|
* Creates an {@link Amity.Community}
|
|
@@ -34,8 +33,6 @@ export const createCommunity = async (
|
|
|
34
33
|
| 'postSetting'
|
|
35
34
|
| 'tags'
|
|
36
35
|
| 'metadata'
|
|
37
|
-
| 'isDiscoverable'
|
|
38
|
-
| 'requiresJoinApproval'
|
|
39
36
|
> &
|
|
40
37
|
Amity.CommunityStorySettings & {
|
|
41
38
|
userIds?: string[];
|
|
@@ -63,7 +60,7 @@ export const createCommunity = async (
|
|
|
63
60
|
|
|
64
61
|
const { communities } = data;
|
|
65
62
|
return {
|
|
66
|
-
data:
|
|
63
|
+
data: communities[0],
|
|
67
64
|
cachedAt,
|
|
68
65
|
};
|
|
69
66
|
};
|
|
@@ -5,7 +5,6 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
5
5
|
|
|
6
6
|
import { saveCommunityUsers } from '~/communityRepository/utils/saveCommunityUsers';
|
|
7
7
|
import { prepareCommunityPayload } from '../utils';
|
|
8
|
-
import { LinkedObject } from '~/utils/linkedObject';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* ```js
|
|
@@ -23,21 +22,15 @@ import { LinkedObject } from '~/utils/linkedObject';
|
|
|
23
22
|
*/
|
|
24
23
|
export const getCommunities = async (
|
|
25
24
|
communityIds: Amity.Community['communityId'][],
|
|
26
|
-
includeDiscoverablePrivateCommunity?: boolean,
|
|
27
25
|
): Promise<Amity.Cached<Amity.Community[]>> => {
|
|
28
26
|
const client = getActiveClient();
|
|
29
27
|
client.log('community/getCommunities', communityIds);
|
|
30
28
|
|
|
31
|
-
const encodedCommunityIds = communityIds.map(communityId => encodeURIComponent(communityId));
|
|
32
|
-
|
|
33
29
|
// API-FIX: endpoint should not be /list, parameters should be querystring.
|
|
34
30
|
const { data: payload } = await client.http.get<Amity.CommunityPayload>(
|
|
35
31
|
`/api/v3/communities/list`,
|
|
36
32
|
{
|
|
37
|
-
params: {
|
|
38
|
-
communityIds: encodedCommunityIds,
|
|
39
|
-
includeDiscoverablePrivateCommunity: includeDiscoverablePrivateCommunity ?? true,
|
|
40
|
-
},
|
|
33
|
+
params: { communityIds },
|
|
41
34
|
},
|
|
42
35
|
);
|
|
43
36
|
|
|
@@ -50,7 +43,7 @@ export const getCommunities = async (
|
|
|
50
43
|
}
|
|
51
44
|
|
|
52
45
|
return {
|
|
53
|
-
data: data.communities
|
|
46
|
+
data: data.communities,
|
|
54
47
|
cachedAt,
|
|
55
48
|
};
|
|
56
49
|
};
|
|
@@ -5,7 +5,6 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
5
5
|
|
|
6
6
|
import { saveCommunityUsers } from '~/communityRepository/utils/saveCommunityUsers';
|
|
7
7
|
import { prepareCommunityPayload } from '../utils';
|
|
8
|
-
import { LinkedObject } from '~/utils/linkedObject';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* ```js
|
|
@@ -23,8 +22,6 @@ import { LinkedObject } from '~/utils/linkedObject';
|
|
|
23
22
|
*/
|
|
24
23
|
export const getCommunity = async (
|
|
25
24
|
communityId: Amity.Community['communityId'],
|
|
26
|
-
type?: Amity.JoinRequestType,
|
|
27
|
-
includeDiscoverablePrivateCommunity?: boolean,
|
|
28
25
|
): Promise<Amity.Cached<Amity.Community>> => {
|
|
29
26
|
const client = getActiveClient();
|
|
30
27
|
client.log('community/getCommunity', communityId);
|
|
@@ -32,12 +29,6 @@ export const getCommunity = async (
|
|
|
32
29
|
// API-FIX: endpoint should not be /list, parameters should be querystring.
|
|
33
30
|
const { data: payload } = await client.http.get<Amity.CommunityPayload>(
|
|
34
31
|
`/api/v3/communities/${communityId}`,
|
|
35
|
-
{
|
|
36
|
-
params: {
|
|
37
|
-
type: 'communityJoinRequest',
|
|
38
|
-
includeDiscoverablePrivateCommunity: includeDiscoverablePrivateCommunity ?? true,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
32
|
);
|
|
42
33
|
|
|
43
34
|
const data = prepareCommunityPayload(payload);
|
|
@@ -51,9 +42,7 @@ export const getCommunity = async (
|
|
|
51
42
|
const { communities } = data;
|
|
52
43
|
|
|
53
44
|
return {
|
|
54
|
-
data:
|
|
55
|
-
communities.find(community => community.communityId === communityId)!,
|
|
56
|
-
),
|
|
45
|
+
data: communities.find(community => community.communityId === communityId)!,
|
|
57
46
|
cachedAt,
|
|
58
47
|
};
|
|
59
48
|
};
|
|
@@ -84,7 +73,7 @@ getCommunity.locally = (
|
|
|
84
73
|
if (!cached) return;
|
|
85
74
|
|
|
86
75
|
return {
|
|
87
|
-
data:
|
|
76
|
+
data: cached.data,
|
|
88
77
|
cachedAt: cached.cachedAt,
|
|
89
78
|
};
|
|
90
79
|
};
|
|
@@ -4,7 +4,6 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
4
4
|
|
|
5
5
|
import { prepareCommunityPayload } from '../utils';
|
|
6
6
|
import { COLLECTION_DEFAULT_PAGINATION_LIMIT } from '~/utils/constants';
|
|
7
|
-
import { LinkedObject } from '~/utils/linkedObject';
|
|
8
7
|
|
|
9
8
|
/* begin_public_function
|
|
10
9
|
id: community.query.recommended_communities
|
|
@@ -25,24 +24,18 @@ import { LinkedObject } from '~/utils/linkedObject';
|
|
|
25
24
|
* @private
|
|
26
25
|
*/
|
|
27
26
|
export const getRecommendedCommunities = async (
|
|
28
|
-
query?: Amity.PageLimit
|
|
27
|
+
query?: Amity.PageLimit,
|
|
29
28
|
): Promise<Amity.Cached<Amity.Community[]>> => {
|
|
30
29
|
const client = getActiveClient();
|
|
31
30
|
client.log('community/getRecommendedCommunities', query);
|
|
32
31
|
|
|
33
|
-
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT
|
|
34
|
-
query ?? {};
|
|
32
|
+
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT } = query ?? {};
|
|
35
33
|
|
|
36
34
|
// API-FIX: backend doesnt answer Amity.Response
|
|
37
35
|
// const { data: payload } = await client.http.get<Amity.Response<CommunityPayload>>(
|
|
38
36
|
const { data: payload } = await client.http.get<Amity.CommunityPayload>(
|
|
39
37
|
`/api/v3/communities/recommended`,
|
|
40
|
-
{
|
|
41
|
-
params: {
|
|
42
|
-
includeDiscoverablePrivateCommunity: includeDiscoverablePrivateCommunity ?? true,
|
|
43
|
-
options: { limit },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
38
|
+
{ params: { options: { limit } } },
|
|
46
39
|
);
|
|
47
40
|
|
|
48
41
|
const data = prepareCommunityPayload(payload);
|
|
@@ -54,5 +47,5 @@ export const getRecommendedCommunities = async (
|
|
|
54
47
|
ingestInCache(data, { cachedAt });
|
|
55
48
|
}
|
|
56
49
|
|
|
57
|
-
return { data: communities
|
|
50
|
+
return { data: communities, cachedAt };
|
|
58
51
|
};
|
|
@@ -4,7 +4,6 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
4
4
|
|
|
5
5
|
import { prepareCommunityPayload } from '../utils';
|
|
6
6
|
import { COLLECTION_DEFAULT_PAGINATION_LIMIT } from '~/utils/constants';
|
|
7
|
-
import { LinkedObject } from '~/utils/linkedObject';
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* ```js
|
|
@@ -22,24 +21,18 @@ import { LinkedObject } from '~/utils/linkedObject';
|
|
|
22
21
|
* @private
|
|
23
22
|
*/
|
|
24
23
|
export const getTrendingCommunities = async (
|
|
25
|
-
query?: Amity.PageLimit
|
|
24
|
+
query?: Amity.PageLimit,
|
|
26
25
|
): Promise<Amity.Cached<Amity.Community[]>> => {
|
|
27
26
|
const client = getActiveClient();
|
|
28
27
|
client.log('community/getTrendingCommunities', query);
|
|
29
28
|
|
|
30
|
-
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT
|
|
31
|
-
query ?? {};
|
|
29
|
+
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT } = query ?? {};
|
|
32
30
|
|
|
33
31
|
// API-FIX: backend doesnt answer Amity.Response
|
|
34
32
|
// const { data } = await client.http.get<Amity.Response<CommunityPayload>>(
|
|
35
33
|
const { data: payload } = await client.http.get<Amity.CommunityPayload>(
|
|
36
34
|
`/api/v3/communities/top-trending`,
|
|
37
|
-
{
|
|
38
|
-
params: {
|
|
39
|
-
includeDiscoverablePrivateCommunity: includeDiscoverablePrivateCommunity ?? true,
|
|
40
|
-
options: { limit },
|
|
41
|
-
},
|
|
42
|
-
},
|
|
35
|
+
{ params: { options: { limit } } },
|
|
43
36
|
);
|
|
44
37
|
|
|
45
38
|
const data = prepareCommunityPayload(payload);
|
|
@@ -51,5 +44,5 @@ export const getTrendingCommunities = async (
|
|
|
51
44
|
ingestInCache(data, { cachedAt });
|
|
52
45
|
}
|
|
53
46
|
|
|
54
|
-
return { data: communities
|
|
47
|
+
return { data: communities, cachedAt };
|
|
55
48
|
};
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { getActiveClient } from '~/client/api
|
|
1
|
+
import { getActiveClient } from '~/client/api';
|
|
2
2
|
|
|
3
3
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
4
4
|
import { prepareCommunityPayload } from '~/communityRepository/utils';
|
|
5
5
|
import { fireEvent } from '~/core/events';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated This function will to be deprecated and use the new community.join().
|
|
9
|
-
*/
|
|
10
7
|
/* begin_public_function
|
|
11
8
|
id: community.join
|
|
12
9
|
*/
|
|
@@ -6,7 +6,6 @@ import { getResolver } from '~/core/model';
|
|
|
6
6
|
import { inferIsDeleted } from '~/utils/inferIsDeleted';
|
|
7
7
|
import { saveCommunityUsers } from '~/communityRepository/utils/saveCommunityUsers';
|
|
8
8
|
import { prepareCommunityPayload } from '../utils';
|
|
9
|
-
import { LinkedObject } from '~/utils/linkedObject';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* ```js
|
|
@@ -50,7 +49,6 @@ export const queryCommunities = async (
|
|
|
50
49
|
...restParams,
|
|
51
50
|
isDeleted: inferIsDeleted(includeDeleted),
|
|
52
51
|
filter: membership,
|
|
53
|
-
includeDiscoverablePrivateCommunity: params?.includeDiscoverablePrivateCommunity ?? true,
|
|
54
52
|
options,
|
|
55
53
|
},
|
|
56
54
|
},
|
|
@@ -70,9 +68,5 @@ export const queryCommunities = async (
|
|
|
70
68
|
saveCommunityUsers(data.communities, data.communityUsers);
|
|
71
69
|
}
|
|
72
70
|
|
|
73
|
-
return {
|
|
74
|
-
data: communities.map(community => LinkedObject.community(community)),
|
|
75
|
-
cachedAt,
|
|
76
|
-
paging,
|
|
77
|
-
};
|
|
71
|
+
return { data: communities, cachedAt, paging };
|
|
78
72
|
};
|
|
@@ -5,7 +5,6 @@ import { fireEvent } from '~/core/events';
|
|
|
5
5
|
|
|
6
6
|
import { saveCommunityUsers } from '~/communityRepository/utils/saveCommunityUsers';
|
|
7
7
|
import { prepareCommunityPayload, prepareCommunityRequest } from '../utils';
|
|
8
|
-
import { LinkedObject } from '~/utils/linkedObject';
|
|
9
8
|
|
|
10
9
|
/* begin_public_function
|
|
11
10
|
id: community.update
|
|
@@ -13,7 +12,7 @@ import { LinkedObject } from '~/utils/linkedObject';
|
|
|
13
12
|
/**
|
|
14
13
|
* ```js
|
|
15
14
|
* import { updateCommunity } from '@amityco/ts-sdk'
|
|
16
|
-
* const updated = await updateCommunity(communityId, { displayName: 'foobar'
|
|
15
|
+
* const updated = await updateCommunity(communityId, { displayName: 'foobar' })
|
|
17
16
|
* ```
|
|
18
17
|
*
|
|
19
18
|
* Updates an {@link Amity.Community}
|
|
@@ -29,14 +28,7 @@ export const updateCommunity = async (
|
|
|
29
28
|
communityId: Amity.Community['communityId'],
|
|
30
29
|
patch: Patch<
|
|
31
30
|
Amity.Community,
|
|
32
|
-
| '
|
|
33
|
-
| 'avatarFileId'
|
|
34
|
-
| 'description'
|
|
35
|
-
| 'postSetting'
|
|
36
|
-
| 'tags'
|
|
37
|
-
| 'metadata'
|
|
38
|
-
| 'isDiscoverable'
|
|
39
|
-
| 'requiresJoinApproval'
|
|
31
|
+
'displayName' | 'avatarFileId' | 'description' | 'postSetting' | 'tags' | 'metadata'
|
|
40
32
|
> &
|
|
41
33
|
Amity.CommunityStorySettings,
|
|
42
34
|
): Promise<Amity.Cached<Amity.Community>> => {
|
|
@@ -61,9 +53,7 @@ export const updateCommunity = async (
|
|
|
61
53
|
const { communities } = data;
|
|
62
54
|
|
|
63
55
|
return {
|
|
64
|
-
data:
|
|
65
|
-
communities.find(community => community.communityId === communityId)!,
|
|
66
|
-
),
|
|
56
|
+
data: communities.find(community => community.communityId === communityId)!,
|
|
67
57
|
cachedAt,
|
|
68
58
|
};
|
|
69
59
|
};
|
|
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
|
|
|
16
16
|
* @category Community Events
|
|
17
17
|
*/
|
|
18
18
|
export const onCommunityJoined = (
|
|
19
|
-
callback: (community: Amity.
|
|
19
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
20
20
|
) => createCommunityMemberEventSubscriber('community.joined', callback);
|
|
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
|
|
|
16
16
|
* @category Community Events
|
|
17
17
|
*/
|
|
18
18
|
export const onCommunityLeft = (
|
|
19
|
-
callback: (community: Amity.
|
|
19
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
20
20
|
) => createCommunityMemberEventSubscriber('community.left', callback);
|
|
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
|
|
|
16
16
|
* @category Community Events
|
|
17
17
|
*/
|
|
18
18
|
export const onCommunityUserAdded = (
|
|
19
|
-
callback: (community: Amity.
|
|
19
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
20
20
|
) => createCommunityMemberEventSubscriber('community.userAdded', callback);
|
|
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
|
|
|
16
16
|
* @category Community Events
|
|
17
17
|
*/
|
|
18
18
|
export const onCommunityUserBanned = (
|
|
19
|
-
callback: (community: Amity.
|
|
19
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
20
20
|
) => createCommunityMemberEventSubscriber('community.userBanned', callback);
|
|
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
|
|
|
16
16
|
* @category Community Events
|
|
17
17
|
*/
|
|
18
18
|
export const onCommunityUserChanged = (
|
|
19
|
-
callback: (community: Amity.
|
|
19
|
+
callback: (community: Amity.Community, members: Amity.Membership<'community'>[]) => void,
|
|
20
20
|
) => createCommunityMemberEventSubscriber('community.userChanged', callback);
|
|
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
|
|
|
16
16
|
* @category Community Events
|
|
17
17
|
*/
|
|
18
18
|
export const onCommunityUserRemoved = (
|
|
19
|
-
callback: (community: Amity.
|
|
19
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
20
20
|
) => createCommunityMemberEventSubscriber('community.userRemoved', callback);
|
|
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
|
|
|
16
16
|
* @category Community Events
|
|
17
17
|
*/
|
|
18
18
|
export const onCommunityUserRoleAdded = (
|
|
19
|
-
callback: (community: Amity.
|
|
19
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
20
20
|
) => createCommunityMemberEventSubscriber('community.roleAdded', callback);
|
|
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
|
|
|
16
16
|
* @category Community Events
|
|
17
17
|
*/
|
|
18
18
|
export const onCommunityUserRoleRemoved = (
|
|
19
|
-
callback: (community: Amity.
|
|
19
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
20
20
|
) => createCommunityMemberEventSubscriber('community.roleRemoved', callback);
|
|
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
|
|
|
16
16
|
* @category Community Events
|
|
17
17
|
*/
|
|
18
18
|
export const onCommunityUserUnbanned = (
|
|
19
|
-
callback: (community: Amity.
|
|
19
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
20
20
|
) => createCommunityMemberEventSubscriber('community.userUnbanned', callback);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLocalCommunityMemberEventSubscriber } from './utils';
|
|
2
2
|
|
|
3
3
|
export const onLocalCommunityJoined = (
|
|
4
|
-
callback: (community: Amity.
|
|
4
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
5
5
|
) => createLocalCommunityMemberEventSubscriber('local.community.joined', callback);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createLocalCommunityMemberEventSubscriber } from './utils';
|
|
2
2
|
|
|
3
3
|
export const onLocalCommunityLeft = (
|
|
4
|
-
callback: (community: Amity.
|
|
4
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
5
5
|
) => createLocalCommunityMemberEventSubscriber('local.community.left', callback);
|
|
@@ -16,5 +16,5 @@ import { createLocalCommunityMemberEventSubscriber } from './utils';
|
|
|
16
16
|
* @category Community Events
|
|
17
17
|
*/
|
|
18
18
|
export const onLocalCommunityUserAdded = (
|
|
19
|
-
callback: (community: Amity.
|
|
19
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
20
20
|
) => createLocalCommunityMemberEventSubscriber('local.community.userAdded', callback);
|
|
@@ -16,5 +16,5 @@ import { createLocalCommunityMemberEventSubscriber } from './utils';
|
|
|
16
16
|
* @category Community Events
|
|
17
17
|
*/
|
|
18
18
|
export const onLocalCommunityUserRemoved = (
|
|
19
|
-
callback: (community: Amity.
|
|
19
|
+
callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
|
|
20
20
|
) => createLocalCommunityMemberEventSubscriber('local.community.userRemoved', callback);
|