@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
|
@@ -3,7 +3,6 @@ import { pullFromCache, pushToCache } from '~/cache/api';
|
|
|
3
3
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
4
4
|
import { getResolver } from '~/core/model';
|
|
5
5
|
import { getActiveClient } from '~/client';
|
|
6
|
-
import { convertRawUserToInternalUser } from '~/userRepository/utils/convertRawUserToInternalUser';
|
|
7
6
|
|
|
8
7
|
export class PinnedPostQueryStreamController extends QueryStreamController<
|
|
9
8
|
Amity.PinnedPostPayload,
|
|
@@ -30,12 +29,7 @@ export class PinnedPostQueryStreamController extends QueryStreamController<
|
|
|
30
29
|
const cachedAt = client.cache && Date.now();
|
|
31
30
|
|
|
32
31
|
if (client.cache) {
|
|
33
|
-
|
|
34
|
-
...response,
|
|
35
|
-
users: response.users ? response.users.map(convertRawUserToInternalUser) : [],
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
ingestInCache(processedPayload, { cachedAt });
|
|
32
|
+
ingestInCache(response, { cachedAt });
|
|
39
33
|
}
|
|
40
34
|
}
|
|
41
35
|
|
|
@@ -1,8 +1,28 @@
|
|
|
1
1
|
import { addPostSetting } from '~/communityRepository/utils';
|
|
2
2
|
import { updateMembershipStatus } from '~/communityRepository/utils/communityWithMembership';
|
|
3
|
+
import { isAmityLivestreamPost } from '~/utils/postTypePredicate';
|
|
4
|
+
|
|
5
|
+
const updateStreamReferences = (
|
|
6
|
+
streams: Amity.RawStream[],
|
|
7
|
+
streamId: string | undefined,
|
|
8
|
+
postId: string,
|
|
9
|
+
) => {
|
|
10
|
+
if (!streamId) return streams;
|
|
11
|
+
|
|
12
|
+
return streams.map(stream =>
|
|
13
|
+
stream.streamId === streamId
|
|
14
|
+
? {
|
|
15
|
+
...stream,
|
|
16
|
+
referenceType: 'post',
|
|
17
|
+
referenceId: postId,
|
|
18
|
+
postId,
|
|
19
|
+
}
|
|
20
|
+
: stream,
|
|
21
|
+
);
|
|
22
|
+
};
|
|
3
23
|
|
|
4
24
|
export const preparePostPayload = (payload: Amity.PostPayload): Amity.ProcessedPostPayload => {
|
|
5
|
-
const { posts: postsData, ...postPayload } = payload;
|
|
25
|
+
const { posts: postsData, postChildren, videoStreamings, ...postPayload } = payload;
|
|
6
26
|
|
|
7
27
|
// Unpack community payload by mapping payload field to postSetting value.
|
|
8
28
|
const communitiesWithPostSetting = addPostSetting({ communities: postPayload.communities });
|
|
@@ -24,18 +44,32 @@ export const preparePostPayload = (payload: Amity.PostPayload): Amity.ProcessedP
|
|
|
24
44
|
mappedCommunityUsers,
|
|
25
45
|
);
|
|
26
46
|
|
|
47
|
+
let mappedNewStream: Amity.RawStream[] = [];
|
|
48
|
+
|
|
27
49
|
// feed type
|
|
28
50
|
const posts = postsData.map(post => {
|
|
29
51
|
const feedType = postPayload.feeds.find(feed => feed.feedId === post.feedId)?.feedType;
|
|
52
|
+
const childPost = payload.postChildren.find(children => children.parentPostId === post.postId);
|
|
53
|
+
|
|
54
|
+
if (isAmityLivestreamPost(childPost)) {
|
|
55
|
+
mappedNewStream = updateStreamReferences(
|
|
56
|
+
videoStreamings,
|
|
57
|
+
childPost.data?.streamId,
|
|
58
|
+
post.postId,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
30
61
|
|
|
31
62
|
return {
|
|
32
63
|
...post,
|
|
64
|
+
childPost,
|
|
33
65
|
feedType,
|
|
34
66
|
};
|
|
35
67
|
});
|
|
36
68
|
|
|
37
69
|
return {
|
|
38
70
|
...postPayload,
|
|
71
|
+
postChildren,
|
|
72
|
+
videoStreamings: mappedNewStream,
|
|
39
73
|
posts,
|
|
40
74
|
communities: communityWithMembershipStatus,
|
|
41
75
|
communityUsers: mappedCommunityUsers,
|
|
@@ -21,7 +21,10 @@ import { LinkedObject } from '~/utils/linkedObject';
|
|
|
21
21
|
* @async
|
|
22
22
|
*/
|
|
23
23
|
export const createStream = async (
|
|
24
|
-
bundle: Pick<
|
|
24
|
+
bundle: Pick<
|
|
25
|
+
Amity.InternalStream,
|
|
26
|
+
'title' | 'thumbnailFileId' | 'description' | 'channelEnabled'
|
|
27
|
+
> & {
|
|
25
28
|
isSecure?: boolean;
|
|
26
29
|
},
|
|
27
30
|
): Promise<Amity.Cached<Amity.Stream>> => {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getActiveClient } from '~/client/api';
|
|
2
|
+
|
|
3
|
+
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
4
|
+
import { LinkedObject } from '~/utils/linkedObject';
|
|
5
|
+
|
|
6
|
+
/* begin_public_function
|
|
7
|
+
id: stream.update
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* ```js
|
|
12
|
+
* import { StreamRepository } from '@amityco/ts-sdk'
|
|
13
|
+
* const updated = await StreamRepository.editStream(streamId, { title: 'foobar' })
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* Updates an {@link Amity.Stream}
|
|
17
|
+
*
|
|
18
|
+
* @param streamId The ID of the {@link Amity.Stream} to edit
|
|
19
|
+
* @param patch The patch data to apply
|
|
20
|
+
* @returns the updated {@link Amity.Stream} object
|
|
21
|
+
*
|
|
22
|
+
* @category Stream API
|
|
23
|
+
* @async
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
export const editStream = async (
|
|
27
|
+
streamId: Amity.Stream['streamId'],
|
|
28
|
+
patch: Patch<
|
|
29
|
+
Amity.Stream,
|
|
30
|
+
'title' | 'thumbnailFileId' | 'description' | 'metadata' | 'channelEnabled'
|
|
31
|
+
>,
|
|
32
|
+
): Promise<Amity.Cached<Amity.Stream>> => {
|
|
33
|
+
const client = getActiveClient();
|
|
34
|
+
client.log('stream/updateStream', streamId, patch);
|
|
35
|
+
|
|
36
|
+
const { data } = await client.http.put<Amity.StreamPayload>(
|
|
37
|
+
`/api/v3/video-streaming/${streamId}`,
|
|
38
|
+
patch,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const cachedAt = client.cache && Date.now();
|
|
42
|
+
if (client.cache) ingestInCache(data, { cachedAt });
|
|
43
|
+
|
|
44
|
+
const { videoStreamings } = data;
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
data: LinkedObject.stream(videoStreamings.find(stream => stream.streamId === streamId)!),
|
|
48
|
+
cachedAt,
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
/* end_public_function */
|
|
@@ -7,6 +7,9 @@ import { LinkedObject } from '~/utils/linkedObject';
|
|
|
7
7
|
id: stream.update
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
|
+
* @deprecated this function is deprecated,
|
|
11
|
+
* please use {@link Amity.StreamRepository.editStream} instead.
|
|
12
|
+
*
|
|
10
13
|
* ```js
|
|
11
14
|
* import { updateStream } from '@amityco/ts-sdk'
|
|
12
15
|
* const updated = await updateStream(streamId, { title: 'foobar' })
|
|
@@ -21,9 +24,13 @@ import { LinkedObject } from '~/utils/linkedObject';
|
|
|
21
24
|
* @category Stream API
|
|
22
25
|
* @async
|
|
23
26
|
*/
|
|
27
|
+
|
|
24
28
|
export const updateStream = async (
|
|
25
29
|
streamId: Amity.Stream['streamId'],
|
|
26
|
-
patch: Patch<
|
|
30
|
+
patch: Patch<
|
|
31
|
+
Amity.Stream,
|
|
32
|
+
'title' | 'thumbnailFileId' | 'description' | 'metadata' | 'channelEnabled'
|
|
33
|
+
>,
|
|
27
34
|
): Promise<Amity.Cached<Amity.Stream>> => {
|
|
28
35
|
const client = getActiveClient();
|
|
29
36
|
client.log('stream/updateStream', streamId, patch);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { getActiveClient } from '~/client/api/activeClient';
|
|
2
|
+
import { mergeInCache, pullFromCache } from '~/cache/api';
|
|
3
|
+
import { createChannel } from '~/channelRepository/api/createChannel';
|
|
4
|
+
import { channelLinkedObject } from '~/utils/linkedObject/channelLinkedObject';
|
|
5
|
+
import { getChannel } from '~/channelRepository/internalApi/getChannel';
|
|
6
|
+
import { constructChannelObject } from '~/channelRepository/utils/constructChannelObject';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* ```js
|
|
10
|
+
* import { getStream } from '@amityco/ts-sdk'
|
|
11
|
+
* const stream = await getStream('foobar')
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Fetches a {@link Amity.Channel} object linked with a current stream
|
|
15
|
+
*
|
|
16
|
+
* @param stream {@link Amity.Stream} that has linked live channel
|
|
17
|
+
* @returns the associated {@link Amity.Channel<'live'>} object
|
|
18
|
+
*
|
|
19
|
+
* @category Stream API
|
|
20
|
+
* @async
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
export const getLiveChat = async (
|
|
24
|
+
stream: Amity.InternalStream,
|
|
25
|
+
): Promise<Amity.Channel<'live'> | undefined> => {
|
|
26
|
+
const client = getActiveClient();
|
|
27
|
+
client.log('stream/getLiveChat', stream.streamId);
|
|
28
|
+
|
|
29
|
+
if (stream.channelId) {
|
|
30
|
+
const channel = pullFromCache<Amity.StaticInternalChannel>([
|
|
31
|
+
'channel',
|
|
32
|
+
'get',
|
|
33
|
+
stream.channelId,
|
|
34
|
+
])?.data;
|
|
35
|
+
|
|
36
|
+
if (channel) return channelLinkedObject(constructChannelObject(channel));
|
|
37
|
+
|
|
38
|
+
const { data } = await getChannel(stream.channelId);
|
|
39
|
+
return channelLinkedObject(constructChannelObject(data));
|
|
40
|
+
}
|
|
41
|
+
// No Channel ID
|
|
42
|
+
// streamer: create a new live channel
|
|
43
|
+
if (stream.userId === client.userId) {
|
|
44
|
+
const { data: channel } = await createChannel({
|
|
45
|
+
type: 'live',
|
|
46
|
+
postId: stream.postId,
|
|
47
|
+
videoStreamId: stream.streamId,
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Update channelId to stream object in cache
|
|
51
|
+
mergeInCache(['stream', 'get', stream.streamId], {
|
|
52
|
+
channelId: channel.channelId,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return channel;
|
|
56
|
+
}
|
|
57
|
+
// watcher: return undefined
|
|
58
|
+
return undefined;
|
|
59
|
+
};
|
|
@@ -22,7 +22,7 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
22
22
|
*/
|
|
23
23
|
export const getStream = async (
|
|
24
24
|
streamId: Amity.Stream['streamId'],
|
|
25
|
-
): Promise<Amity.Cached<Amity.
|
|
25
|
+
): Promise<Amity.Cached<Amity.InternalStream>> => {
|
|
26
26
|
const client = getActiveClient();
|
|
27
27
|
client.log('stream/getStream', streamId);
|
|
28
28
|
|
|
@@ -57,13 +57,13 @@ export const getStream = async (
|
|
|
57
57
|
*/
|
|
58
58
|
getStream.locally = (
|
|
59
59
|
streamId: Amity.Stream['streamId'],
|
|
60
|
-
): Amity.Cached<Amity.
|
|
60
|
+
): Amity.Cached<Amity.InternalStream> | undefined => {
|
|
61
61
|
const client = getActiveClient();
|
|
62
62
|
client.log('stream/getStream', streamId);
|
|
63
63
|
|
|
64
64
|
if (!client.cache) return;
|
|
65
65
|
|
|
66
|
-
const cached = pullFromCache<Amity.
|
|
66
|
+
const cached = pullFromCache<Amity.InternalStream>(['stream', 'get', streamId]);
|
|
67
67
|
|
|
68
68
|
if (!cached) return;
|
|
69
69
|
|
|
@@ -102,7 +102,7 @@ export class GetStreamsLiveCollectionController extends LiveCollectionController
|
|
|
102
102
|
this.queryStreamController.appendToQueryStream(response, direction, refresh);
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
-
private applyFilter = (data: Amity.
|
|
105
|
+
private applyFilter = (data: Amity.Stream[]): Amity.Stream[] => {
|
|
106
106
|
let streams = filterByPropEquality(data, 'isDeleted', this.query.isDeleted);
|
|
107
107
|
|
|
108
108
|
streams = streams.sort(
|
|
@@ -4,7 +4,6 @@ import { convertFromRaw as convertMessageFromRaw } from '~/messageRepository/uti
|
|
|
4
4
|
import { convertFromRaw as convertSubChannelFromRaw } from './convertSubChannelFromRaw';
|
|
5
5
|
|
|
6
6
|
import { updateSubChannelMessagePreviewCache } from '../../messagePreview/utils/updateSubChannelMessagePreviewCache';
|
|
7
|
-
import { convertRawUserToInternalUser } from '~/userRepository/utils/convertRawUserToInternalUser';
|
|
8
7
|
|
|
9
8
|
export const MARKER_INCLUDED_SUB_CHANNEL_TYPE = ['broadcast', 'conversation', 'community'];
|
|
10
9
|
|
|
@@ -45,13 +44,10 @@ export const prepareSubChannelPayload = async (
|
|
|
45
44
|
|
|
46
45
|
const messages = rawPayload.messages.map(m => convertMessageFromRaw(m));
|
|
47
46
|
|
|
48
|
-
const user = rawPayload.users.map(convertRawUserToInternalUser);
|
|
49
|
-
|
|
50
47
|
return {
|
|
51
48
|
...rawPayload,
|
|
52
49
|
messageFeeds,
|
|
53
50
|
messages,
|
|
54
|
-
users: user,
|
|
55
51
|
};
|
|
56
52
|
};
|
|
57
53
|
|
|
@@ -11,9 +11,6 @@ import { channelLinkedObject } from './channelLinkedObject';
|
|
|
11
11
|
import { adLinkedObject } from './adLinkedObject';
|
|
12
12
|
import { pinnedPostLinkedObject } from './pinnedPostLinkedObject';
|
|
13
13
|
import { notificationTrayLinkedObject } from './notificationTrayLinkedObject';
|
|
14
|
-
import { communityLinkedObject } from './communityLinkedObject';
|
|
15
|
-
import { invitationLinkedObject } from './invitationLinkedObject';
|
|
16
|
-
import { joinRequestLinkedObject } from './joinRequestLinkedObject';
|
|
17
14
|
|
|
18
15
|
export const LinkedObject = {
|
|
19
16
|
ad: adLinkedObject,
|
|
@@ -29,7 +26,4 @@ export const LinkedObject = {
|
|
|
29
26
|
channel: channelLinkedObject,
|
|
30
27
|
pinnedPost: pinnedPostLinkedObject,
|
|
31
28
|
notificationTray: notificationTrayLinkedObject,
|
|
32
|
-
community: communityLinkedObject,
|
|
33
|
-
invitation: invitationLinkedObject,
|
|
34
|
-
joinRequest: joinRequestLinkedObject,
|
|
35
29
|
};
|
|
@@ -2,11 +2,18 @@ import { pullFromCache } from '~/cache/api';
|
|
|
2
2
|
import { commentLinkedObject } from '~/utils/linkedObject/commentLinkedObject';
|
|
3
3
|
import AnalyticsEngine from '../../analytic/service/analytic/AnalyticsEngine';
|
|
4
4
|
import { userLinkedObject } from './userLinkedObject';
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
isAmityFilePost,
|
|
7
|
+
isAmityImagePost,
|
|
8
|
+
isAmityLivestreamPost,
|
|
9
|
+
isAmityVideoPost,
|
|
10
|
+
} from '../postTypePredicate';
|
|
11
|
+
import { streamLinkedObject } from './streamLinkedObject';
|
|
6
12
|
|
|
7
13
|
export const postLinkedObject = (post: Amity.InternalPost): Amity.Post => {
|
|
14
|
+
const { childPost, ...rest } = post;
|
|
8
15
|
return {
|
|
9
|
-
...
|
|
16
|
+
...rest,
|
|
10
17
|
|
|
11
18
|
analytics: {
|
|
12
19
|
markAsViewed: () => {
|
|
@@ -41,28 +48,44 @@ export const postLinkedObject = (post: Amity.InternalPost): Amity.Post => {
|
|
|
41
48
|
},
|
|
42
49
|
|
|
43
50
|
getImageInfo(): Amity.File<'image'> | undefined {
|
|
44
|
-
return isAmityImagePost(
|
|
45
|
-
? pullFromCache<Amity.File<'image'>>(['file', 'get',
|
|
51
|
+
return isAmityImagePost(childPost)
|
|
52
|
+
? pullFromCache<Amity.File<'image'>>(['file', 'get', childPost?.data?.fileId])?.data
|
|
46
53
|
: undefined;
|
|
47
54
|
},
|
|
48
55
|
|
|
49
56
|
getVideoInfo(): Amity.File<'video'> | undefined {
|
|
50
|
-
return isAmityVideoPost(
|
|
51
|
-
? pullFromCache<Amity.File<'video'>>([
|
|
52
|
-
|
|
57
|
+
return isAmityVideoPost(childPost)
|
|
58
|
+
? pullFromCache<Amity.File<'video'>>([
|
|
59
|
+
'file',
|
|
60
|
+
'get',
|
|
61
|
+
childPost?.data?.videoFileId?.original,
|
|
62
|
+
])?.data
|
|
53
63
|
: undefined;
|
|
54
64
|
},
|
|
55
65
|
|
|
56
66
|
getVideoThumbnailInfo(): Amity.File<'image'> | undefined {
|
|
57
|
-
return isAmityVideoPost(
|
|
58
|
-
? pullFromCache<Amity.File<'image'>>(['file', 'get',
|
|
67
|
+
return isAmityVideoPost(childPost)
|
|
68
|
+
? pullFromCache<Amity.File<'image'>>(['file', 'get', childPost?.data?.thumbnailFileId])
|
|
69
|
+
?.data
|
|
59
70
|
: undefined;
|
|
60
71
|
},
|
|
61
72
|
|
|
62
73
|
getFileInfo(): Amity.File<'file'> | undefined {
|
|
63
|
-
return isAmityFilePost(
|
|
64
|
-
? pullFromCache<Amity.File<'file'>>(['file', 'get',
|
|
74
|
+
return isAmityFilePost(childPost)
|
|
75
|
+
? pullFromCache<Amity.File<'file'>>(['file', 'get', childPost?.data?.fileId])?.data
|
|
65
76
|
: undefined;
|
|
66
77
|
},
|
|
78
|
+
|
|
79
|
+
getLivestreamInfo(): Amity.Stream | undefined {
|
|
80
|
+
if (!isAmityLivestreamPost(childPost)) return;
|
|
81
|
+
const cache = pullFromCache<Amity.InternalStream>([
|
|
82
|
+
'stream',
|
|
83
|
+
'get',
|
|
84
|
+
childPost?.data?.streamId,
|
|
85
|
+
])?.data;
|
|
86
|
+
if (!cache) return;
|
|
87
|
+
|
|
88
|
+
return streamLinkedObject(cache);
|
|
89
|
+
},
|
|
67
90
|
};
|
|
68
91
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { pullFromCache } from '~/cache/api';
|
|
2
|
+
import { getLiveChat as _getLiveChat } from '~/streamRepository/internalApi/getLiveChat';
|
|
2
3
|
|
|
3
4
|
export const streamLinkedObject = (stream: Amity.InternalStream): Amity.Stream => {
|
|
4
5
|
return {
|
|
@@ -18,5 +19,6 @@ export const streamLinkedObject = (stream: Amity.InternalStream): Amity.Stream =
|
|
|
18
19
|
get user() {
|
|
19
20
|
return pullFromCache<Amity.User>(['user', 'get', stream.userId])?.data;
|
|
20
21
|
},
|
|
22
|
+
getLiveChat: () => _getLiveChat(stream),
|
|
21
23
|
};
|
|
22
24
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export function isAmityImagePost(post
|
|
1
|
+
export function isAmityImagePost(post?: Amity.InternalPost): post is Amity.Post<'image'> {
|
|
2
2
|
return !!(
|
|
3
|
+
post &&
|
|
3
4
|
post.data &&
|
|
4
5
|
typeof post.data !== 'string' &&
|
|
5
6
|
'fileId' in post.data &&
|
|
@@ -7,8 +8,9 @@ export function isAmityImagePost(post: Amity.InternalPost): post is Amity.Post<'
|
|
|
7
8
|
);
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
export function isAmityFilePost(post
|
|
11
|
+
export function isAmityFilePost(post?: Amity.InternalPost): post is Amity.Post<'file'> {
|
|
11
12
|
return !!(
|
|
13
|
+
post &&
|
|
12
14
|
post.data &&
|
|
13
15
|
typeof post.data !== 'string' &&
|
|
14
16
|
'fileId' in post.data &&
|
|
@@ -16,8 +18,9 @@ export function isAmityFilePost(post: Amity.InternalPost): post is Amity.Post<'f
|
|
|
16
18
|
);
|
|
17
19
|
}
|
|
18
20
|
|
|
19
|
-
export function isAmityVideoPost(post
|
|
21
|
+
export function isAmityVideoPost(post?: Amity.InternalPost): post is Amity.Post<'video'> {
|
|
20
22
|
return !!(
|
|
23
|
+
post &&
|
|
21
24
|
post.data &&
|
|
22
25
|
typeof post.data !== 'string' &&
|
|
23
26
|
'videoFileId' in post.data &&
|
|
@@ -25,3 +28,13 @@ export function isAmityVideoPost(post: Amity.InternalPost): post is Amity.Post<'
|
|
|
25
28
|
post.dataType === 'video'
|
|
26
29
|
);
|
|
27
30
|
}
|
|
31
|
+
|
|
32
|
+
export function isAmityLivestreamPost(post?: Amity.InternalPost): post is Amity.Post<'liveStream'> {
|
|
33
|
+
return !!(
|
|
34
|
+
post &&
|
|
35
|
+
post.data &&
|
|
36
|
+
typeof post.data !== 'string' &&
|
|
37
|
+
'streamId' in post.data &&
|
|
38
|
+
post.dataType === 'liveStream'
|
|
39
|
+
);
|
|
40
|
+
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
export declare const enum InvitationTypeEnum {
|
|
3
|
-
CommunityMemberInvite = "communityMemberInvite",
|
|
4
|
-
LivestreamInvite = "livestreamInvite"
|
|
5
|
-
}
|
|
6
|
-
export declare const enum InvitationStatusEnum {
|
|
7
|
-
Pending = "pending",
|
|
8
|
-
Approved = "approved",
|
|
9
|
-
Rejected = "rejected",
|
|
10
|
-
Cancelled = "cancelled"
|
|
11
|
-
}
|
|
12
|
-
export declare const enum InvitationSortByEnum {
|
|
13
|
-
FirstCreated = "firstCreated",
|
|
14
|
-
LastCreated = "lastCreated"
|
|
15
|
-
}
|
|
16
|
-
declare global {
|
|
17
|
-
namespace Amity {
|
|
18
|
-
type InvitationType = InvitationTypeEnum;
|
|
19
|
-
type InvitationStatus = InvitationStatusEnum;
|
|
20
|
-
type InvitationTargetType = Extract<Amity.Domain, 'community'>;
|
|
21
|
-
type InvitationTargetMap = {
|
|
22
|
-
community: Amity.InternalCommunity;
|
|
23
|
-
};
|
|
24
|
-
type InvitationTarget<T extends InvitationTargetType> = InvitationTargetMap[T];
|
|
25
|
-
type InvitationSortBy = InvitationSortByEnum;
|
|
26
|
-
type InvitationDomain<T extends Amity.InvitationTargetType = Amity.InvitationTargetType> = T extends 'community' ? {
|
|
27
|
-
communityId: string;
|
|
28
|
-
} : {
|
|
29
|
-
communityId?: string;
|
|
30
|
-
};
|
|
31
|
-
type RawInvitation = {
|
|
32
|
-
_id: string;
|
|
33
|
-
networkId: string;
|
|
34
|
-
type: Amity.InvitationType;
|
|
35
|
-
targetId: string;
|
|
36
|
-
targetType: Amity.InvitationTargetType;
|
|
37
|
-
userId: string;
|
|
38
|
-
status: Amity.InvitationStatus;
|
|
39
|
-
respondedAt: Amity.timestamp;
|
|
40
|
-
createdBy: string;
|
|
41
|
-
invitationId: string;
|
|
42
|
-
invitedUserId: string;
|
|
43
|
-
invitedUserInternalId: string;
|
|
44
|
-
invitedUserPublicId: string;
|
|
45
|
-
inviterUserId: string;
|
|
46
|
-
inviterUserInternalId: string;
|
|
47
|
-
inviterUserPublicId: string;
|
|
48
|
-
} & Amity.Timestamps & Amity.InvitationDomain<Amity.InvitationTargetType>;
|
|
49
|
-
type InternalInvitation = Omit<RawInvitation, 'createdBy'> & {
|
|
50
|
-
createdById: string;
|
|
51
|
-
};
|
|
52
|
-
type Invitation = Omit<Amity.InternalInvitation, 'createdBy'> & Amity.InvitationLinkedObject & {
|
|
53
|
-
user?: Amity.User;
|
|
54
|
-
createdById: string;
|
|
55
|
-
createdBy?: Amity.User;
|
|
56
|
-
target?: Amity.InvitationTarget<Amity.InvitationTargetType>;
|
|
57
|
-
};
|
|
58
|
-
type QueryInvitations = {
|
|
59
|
-
targetId: string;
|
|
60
|
-
statuses?: string[];
|
|
61
|
-
token?: Amity.Token;
|
|
62
|
-
type: Amity.InvitationType;
|
|
63
|
-
sortBy?: Amity.InvitationSortBy;
|
|
64
|
-
limit?: Amity.PageLimit['limit'];
|
|
65
|
-
targetType: Amity.InvitationTargetType;
|
|
66
|
-
};
|
|
67
|
-
type InvitationLiveCollection = Amity.LiveCollectionParams<Omit<QueryInvitations, 'limit'>>;
|
|
68
|
-
type InvitationLiveCollectionCache = Amity.LiveCollectionCache<Amity.InternalInvitation['_id'], Pick<QueryInvitations, 'limit'>>;
|
|
69
|
-
type QueryMyInvitations = {
|
|
70
|
-
targetId?: string;
|
|
71
|
-
token?: Amity.Token;
|
|
72
|
-
type?: Amity.InvitationType;
|
|
73
|
-
sortBy?: Amity.InvitationSortBy;
|
|
74
|
-
limit?: Amity.PageLimit['limit'];
|
|
75
|
-
statuses?: InvitationStatusEnum[];
|
|
76
|
-
targetType?: Amity.InvitationTargetType;
|
|
77
|
-
};
|
|
78
|
-
type MyInvitationsLiveCollection = Amity.LiveCollectionParams<Omit<QueryMyInvitations, 'limit'>>;
|
|
79
|
-
type MyInvitationsLiveCollectionCache = Amity.LiveCollectionCache<Amity.InternalInvitation['_id'], Pick<QueryMyInvitations, 'limit'>>;
|
|
80
|
-
type InvitationLinkedObject = {
|
|
81
|
-
accept: () => Promise<void>;
|
|
82
|
-
reject: () => Promise<void>;
|
|
83
|
-
};
|
|
84
|
-
type CreateInvitations = {
|
|
85
|
-
type: Amity.InvitationType;
|
|
86
|
-
targetType: Amity.InvitationTargetType;
|
|
87
|
-
targetId: string;
|
|
88
|
-
userIds: string[];
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
//# sourceMappingURL=invitation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invitation.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/invitation.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
export declare const enum JoinRequestStatusEnum {
|
|
3
|
-
Pending = "pending",
|
|
4
|
-
Approved = "approved",
|
|
5
|
-
Rejected = "rejected",
|
|
6
|
-
Cancelled = "cancelled"
|
|
7
|
-
}
|
|
8
|
-
export declare const enum JoinResultStatusEnum {
|
|
9
|
-
Success = "success",
|
|
10
|
-
Pending = "pending"
|
|
11
|
-
}
|
|
12
|
-
declare global {
|
|
13
|
-
namespace Amity {
|
|
14
|
-
type JoinRequestStatus = JoinRequestStatusEnum;
|
|
15
|
-
type JoinResultStatus = JoinResultStatusEnum;
|
|
16
|
-
type JoinRequestType = 'communityJoinRequest';
|
|
17
|
-
type JoinResult = {
|
|
18
|
-
status: Amity.JoinResultStatus;
|
|
19
|
-
request?: Amity.JoinRequest;
|
|
20
|
-
};
|
|
21
|
-
type RawJoinRequest = {
|
|
22
|
-
_id: string;
|
|
23
|
-
createdAt: Amity.timestamp;
|
|
24
|
-
joinRequestId: string;
|
|
25
|
-
networkId: string;
|
|
26
|
-
requestorId: string;
|
|
27
|
-
requestorInternalId: string;
|
|
28
|
-
requestorPublicId: string;
|
|
29
|
-
respondedAt: Amity.timestamp | null;
|
|
30
|
-
responderId: string | null;
|
|
31
|
-
responderInternalId: string | null;
|
|
32
|
-
responderPublicId: string | null;
|
|
33
|
-
status: Amity.JoinRequestStatus;
|
|
34
|
-
targetId: string;
|
|
35
|
-
targetType: string;
|
|
36
|
-
type: Amity.JoinRequestType;
|
|
37
|
-
updatedAt: Amity.timestamp;
|
|
38
|
-
userId: string;
|
|
39
|
-
};
|
|
40
|
-
type InternalJoinRequest = Omit<RawJoinRequest, '_id'>;
|
|
41
|
-
type JoinRequest = Omit<Amity.InternalJoinRequest, 'responderId'> & Amity.JoinRequestLinkedObject & {
|
|
42
|
-
user?: Amity.User;
|
|
43
|
-
feeds?: Amity.Feed[];
|
|
44
|
-
files?: Amity.File[];
|
|
45
|
-
};
|
|
46
|
-
type JoinRequestLinkedObject = {
|
|
47
|
-
cancel: () => Promise<void>;
|
|
48
|
-
approve: () => Promise<void>;
|
|
49
|
-
reject: () => Promise<void>;
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
//# sourceMappingURL=joinRequest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"joinRequest.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/joinRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AAEV,0BAAkB,qBAAqB;IACrC,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,SAAS,cAAc;CACxB;AAED,0BAAkB,oBAAoB;IACpC,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,iBAAiB,GAAG,qBAAqB,CAAC;QAE/C,KAAK,gBAAgB,GAAG,oBAAoB,CAAC;QAE7C,KAAK,eAAe,GAAG,sBAAsB,CAAC;QAE9C,KAAK,UAAU,GAAG;YAChB,MAAM,EAAE,KAAK,CAAC,gBAAgB,CAAC;YAC/B,OAAO,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;SAC7B,CAAC;QAEF,KAAK,cAAc,GAAG;YACpB,GAAG,EAAE,MAAM,CAAC;YACZ,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;YAC3B,aAAa,EAAE,MAAM,CAAC;YACtB,SAAS,EAAE,MAAM,CAAC;YAElB,WAAW,EAAE,MAAM,CAAC;YACpB,mBAAmB,EAAE,MAAM,CAAC;YAC5B,iBAAiB,EAAE,MAAM,CAAC;YAE1B,WAAW,EAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;YACpC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;YAC3B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;YACnC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;YAEjC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC;YAChC,QAAQ,EAAE,MAAM,CAAC;YACjB,UAAU,EAAE,MAAM,CAAC;YACnB,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC;YAC5B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;YAC3B,MAAM,EAAE,MAAM,CAAC;SAChB,CAAC;QAEF,KAAK,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;QAEvD,KAAK,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,mBAAmB,EAAE,aAAa,CAAC,GAC/D,KAAK,CAAC,uBAAuB,GAAG;YAC9B,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC;YAClB,KAAK,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;YACrB,KAAK,CAAC,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;SACtB,CAAC;QAEJ,KAAK,uBAAuB,GAAG;YAC7B,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;YAC5B,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;YAC7B,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;SAC7B,CAAC;KACH;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"onLocalCommunityJoin.d.ts","sourceRoot":"","sources":["../../../../src/communityRepository/communityMembership/events/onLocalCommunityJoin.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,oBAAoB,2BACP,MAAM,mBAAmB,KAAK,IAAI,eAe3D,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { community } from '@amityco/ts-sdk'
|
|
4
|
-
* const isJoined = await community.getMyJoinRequest('foobar')
|
|
5
|
-
* ```
|
|
6
|
-
*
|
|
7
|
-
* Joins a {@link Amity.Community} object
|
|
8
|
-
*
|
|
9
|
-
* @param communityId the {@link Amity.Community} to join
|
|
10
|
-
* @returns A success boolean if the {@link Amity.Community} was joined
|
|
11
|
-
*
|
|
12
|
-
* @category Community API
|
|
13
|
-
* @async
|
|
14
|
-
*/
|
|
15
|
-
export declare const getMyJoinRequest: (communityId: Amity.Community['communityId']) => Promise<Amity.Cached<Amity.JoinRequest | undefined>>;
|
|
16
|
-
//# sourceMappingURL=getMyJoinRequest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMyJoinRequest.d.ts","sourceRoot":"","sources":["../../../src/communityRepository/internalAPI/getMyJoinRequest.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,gBACd,MAAM,SAAS,CAAC,aAAa,CAAC,KAC1C,QAAQ,MAAM,MAAM,CAAC,MAAM,WAAW,GAAG,SAAS,CAAC,CAiBrD,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { community } from '@amityco/ts-sdk'
|
|
4
|
-
* const isJoined = await community.join('foobar')
|
|
5
|
-
* ```
|
|
6
|
-
*
|
|
7
|
-
* Joins a {@link Amity.Community} object
|
|
8
|
-
*
|
|
9
|
-
* @param communityId the {@link Amity.Community} to join
|
|
10
|
-
* @returns A status join result
|
|
11
|
-
*
|
|
12
|
-
* @category Community API
|
|
13
|
-
* @async
|
|
14
|
-
*/
|
|
15
|
-
export declare const joinRequest: (communityId: Amity.Community['communityId']) => Promise<Amity.JoinResult>;
|
|
16
|
-
//# sourceMappingURL=joinCommunity.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"joinCommunity.d.ts","sourceRoot":"","sources":["../../../src/communityRepository/internalAPI/joinCommunity.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW,gBACT,MAAM,SAAS,CAAC,aAAa,CAAC,KAC1C,QAAQ,MAAM,UAAU,CAoC1B,CAAC"}
|