@amityco/ts-sdk-react-native 7.5.3 → 7.6.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 +7 -0
- package/dist/@types/core/events.d.ts.map +1 -1
- package/dist/@types/core/model.d.ts +5 -1
- package/dist/@types/core/model.d.ts.map +1 -1
- package/dist/@types/core/payload.d.ts +38 -5
- package/dist/@types/core/payload.d.ts.map +1 -1
- package/dist/@types/domains/channel.d.ts +1 -0
- package/dist/@types/domains/channel.d.ts.map +1 -1
- package/dist/@types/domains/client.d.ts +10 -0
- package/dist/@types/domains/client.d.ts.map +1 -1
- package/dist/@types/domains/community.d.ts +51 -1
- package/dist/@types/domains/community.d.ts.map +1 -1
- package/dist/@types/domains/content.d.ts +5 -2
- package/dist/@types/domains/content.d.ts.map +1 -1
- package/dist/@types/domains/group.d.ts +2 -0
- package/dist/@types/domains/group.d.ts.map +1 -1
- package/dist/@types/domains/invitation.d.ts +92 -0
- package/dist/@types/domains/invitation.d.ts.map +1 -0
- package/dist/@types/domains/joinRequest.d.ts +53 -0
- package/dist/@types/domains/joinRequest.d.ts.map +1 -0
- package/dist/@types/domains/notification.d.ts +4 -2
- package/dist/@types/domains/notification.d.ts.map +1 -1
- package/dist/@types/domains/pinnedPost.d.ts +1 -1
- package/dist/@types/domains/pinnedPost.d.ts.map +1 -1
- package/dist/@types/index.d.ts +5 -0
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/channelRepository/channelMembership/observers/getMembers/ChannelMemberLiveCollectionController.d.ts.map +1 -1
- package/dist/channelRepository/channelMembership/observers/searchMembers/SearchChannelMemberLiveCollectionController.d.ts.map +1 -1
- package/dist/channelRepository/channelMembership/observers/searchMembers/SearchChannelMemberQueryStreamController.d.ts +2 -2
- package/dist/channelRepository/channelMembership/observers/searchMembers/SearchChannelMemberQueryStreamController.d.ts.map +1 -1
- package/dist/client/api/index.d.ts +1 -0
- package/dist/client/api/index.d.ts.map +1 -1
- package/dist/client/api/resumeSession.d.ts +32 -0
- package/dist/client/api/resumeSession.d.ts.map +1 -0
- package/dist/client/api/tests/resumeSession.test.d.ts +2 -0
- package/dist/client/api/tests/resumeSession.test.d.ts.map +1 -0
- package/dist/communityRepository/api/createCommunity.d.ts +3 -3
- package/dist/communityRepository/api/createCommunity.d.ts.map +1 -1
- package/dist/communityRepository/api/deleteCommunity.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 +2 -2
- package/dist/communityRepository/api/getCommunity.d.ts.map +1 -1
- package/dist/communityRepository/api/getRecommendedCommunities.d.ts +3 -1
- package/dist/communityRepository/api/getRecommendedCommunities.d.ts.map +1 -1
- package/dist/communityRepository/api/getTrendingCommunities.d.ts +3 -1
- package/dist/communityRepository/api/getTrendingCommunities.d.ts.map +1 -1
- package/dist/communityRepository/api/joinCommunity.d.ts +3 -0
- 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 +3 -3
- package/dist/communityRepository/api/updateCommunity.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/index.d.ts +1 -0
- 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/onLocalCommunityJoin.d.ts +2 -0
- package/dist/communityRepository/communityMembership/events/onLocalCommunityJoin.d.ts.map +1 -0
- 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/getMembers/enums.d.ts +2 -1
- package/dist/communityRepository/communityMembership/observers/getMembers/enums.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/communityMembership/observers/searchMembers/enums.d.ts +1 -0
- package/dist/communityRepository/communityMembership/observers/searchMembers/enums.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/internalAPI/getMyJoinRequest.d.ts +16 -0
- package/dist/communityRepository/internalAPI/getMyJoinRequest.d.ts.map +1 -0
- package/dist/communityRepository/internalAPI/joinCommunity.d.ts +16 -0
- package/dist/communityRepository/internalAPI/joinCommunity.d.ts.map +1 -0
- package/dist/communityRepository/joinRequest/events/index.d.ts +4 -0
- package/dist/communityRepository/joinRequest/events/index.d.ts.map +1 -0
- package/dist/communityRepository/joinRequest/events/onJoinRequestCreated.d.ts +17 -0
- package/dist/communityRepository/joinRequest/events/onJoinRequestCreated.d.ts.map +1 -0
- package/dist/communityRepository/joinRequest/events/onJoinRequestDeleted.d.ts +17 -0
- package/dist/communityRepository/joinRequest/events/onJoinRequestDeleted.d.ts.map +1 -0
- package/dist/communityRepository/joinRequest/events/onJoinRequestUpdated.d.ts +17 -0
- package/dist/communityRepository/joinRequest/events/onJoinRequestUpdated.d.ts.map +1 -0
- package/dist/communityRepository/joinRequest/internalAPI/approveJoinRequest.d.ts +16 -0
- package/dist/communityRepository/joinRequest/internalAPI/approveJoinRequest.d.ts.map +1 -0
- package/dist/communityRepository/joinRequest/internalAPI/cancelJoinRequest.d.ts +16 -0
- package/dist/communityRepository/joinRequest/internalAPI/cancelJoinRequest.d.ts.map +1 -0
- package/dist/communityRepository/joinRequest/internalAPI/rejectJoinRequest.d.ts +16 -0
- package/dist/communityRepository/joinRequest/internalAPI/rejectJoinRequest.d.ts.map +1 -0
- 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/getJoinRequestList/JoinRequestListLiveCollectionController.d.ts +14 -0
- package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.d.ts.map +1 -0
- package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.d.ts +9 -0
- package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.d.ts.map +1 -0
- package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.d.ts +15 -0
- package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.d.ts.map +1 -0
- package/dist/communityRepository/observers/getJoinRequestList/enum.d.ts +6 -0
- package/dist/communityRepository/observers/getJoinRequestList/enum.d.ts.map +1 -0
- package/dist/communityRepository/observers/getJoinRequestList.d.ts +12 -0
- package/dist/communityRepository/observers/getJoinRequestList.d.ts.map +1 -0
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.d.ts +14 -0
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.d.ts.map +1 -0
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.d.ts +9 -0
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.d.ts.map +1 -0
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.d.ts +15 -0
- package/dist/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.d.ts.map +1 -0
- package/dist/communityRepository/observers/getJoinRequests/enum.d.ts +6 -0
- package/dist/communityRepository/observers/getJoinRequests/enum.d.ts.map +1 -0
- package/dist/communityRepository/observers/getJoinRequests.d.ts +12 -0
- package/dist/communityRepository/observers/getJoinRequests.d.ts.map +1 -0
- 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/getRecommendedCommunities/enums.d.ts +2 -1
- package/dist/communityRepository/observers/getRecommendedCommunities/enums.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 +1 -0
- package/dist/communityRepository/observers/index.d.ts.map +1 -1
- package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesLiveCollectionController.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/SemanticSearchCommunityLiveCollectionController.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 +2 -1
- 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 +3209 -1543
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +3374 -1710
- package/dist/index.umd.js +3 -3
- package/dist/invitationRepository/events/index.d.ts +4 -0
- package/dist/invitationRepository/events/index.d.ts.map +1 -0
- package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts +17 -0
- package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts.map +1 -0
- package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts +17 -0
- package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts.map +1 -0
- package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts +17 -0
- package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts.map +1 -0
- package/dist/invitationRepository/index.d.ts +3 -0
- package/dist/invitationRepository/index.d.ts.map +1 -0
- package/dist/invitationRepository/internalApi/acceptInvitation.d.ts +16 -0
- package/dist/invitationRepository/internalApi/acceptInvitation.d.ts.map +1 -0
- package/dist/invitationRepository/internalApi/createInvitations.d.ts +21 -0
- package/dist/invitationRepository/internalApi/createInvitations.d.ts.map +1 -0
- package/dist/invitationRepository/internalApi/getInvitation.d.ts +17 -0
- package/dist/invitationRepository/internalApi/getInvitation.d.ts.map +1 -0
- package/dist/invitationRepository/internalApi/index.d.ts +4 -0
- package/dist/invitationRepository/internalApi/index.d.ts.map +1 -0
- package/dist/invitationRepository/internalApi/rejectInvitation.d.ts +16 -0
- package/dist/invitationRepository/internalApi/rejectInvitation.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts +14 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts +5 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts +15 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getInvitations/enums.d.ts +6 -0
- package/dist/invitationRepository/observers/getInvitations/enums.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getInvitations.d.ts +12 -0
- package/dist/invitationRepository/observers/getInvitations.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getMyCommunityInvitations.d.ts +12 -0
- package/dist/invitationRepository/observers/getMyCommunityInvitations.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.d.ts +14 -0
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.d.ts +5 -0
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.d.ts +15 -0
- package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.d.ts.map +1 -0
- package/dist/invitationRepository/observers/index.d.ts +2 -0
- package/dist/invitationRepository/observers/index.d.ts.map +1 -0
- package/dist/invitationRepository/utils/convertRawInvitationToInternalInvitation.d.ts +2 -0
- package/dist/invitationRepository/utils/convertRawInvitationToInternalInvitation.d.ts.map +1 -0
- package/dist/invitationRepository/utils/index.d.ts +2 -0
- package/dist/invitationRepository/utils/index.d.ts.map +1 -0
- package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts +2 -0
- package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts.map +1 -0
- package/dist/invitationRepository/utils/prepareMyInvitationsPayload.d.ts +2 -0
- package/dist/invitationRepository/utils/prepareMyInvitationsPayload.d.ts.map +1 -0
- package/dist/messagePreview/utils/getSubChannelMessagePreviewWithUser.d.ts +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/subChannelRepository/utils/prepareSubChannelPayload.d.ts.map +1 -1
- package/dist/utils/linkedObject/channelLinkedObject.d.ts.map +1 -1
- package/dist/utils/linkedObject/channelMemberLinkedObject.d.ts +2 -0
- package/dist/utils/linkedObject/channelMemberLinkedObject.d.ts.map +1 -0
- package/dist/utils/linkedObject/communityLinkedObject.d.ts +2 -0
- package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -0
- package/dist/utils/linkedObject/index.d.ts +4 -0
- package/dist/utils/linkedObject/index.d.ts.map +1 -1
- package/dist/utils/linkedObject/invitationLinkedObject.d.ts +2 -0
- package/dist/utils/linkedObject/invitationLinkedObject.d.ts.map +1 -0
- package/dist/utils/linkedObject/joinRequestLinkedObject.d.ts +2 -0
- package/dist/utils/linkedObject/joinRequestLinkedObject.d.ts.map +1 -0
- package/dist/utils/tests/dummy/comment.d.ts +1 -1
- package/dist/utils/tests/dummy/community.d.ts +2 -0
- package/dist/utils/tests/dummy/community.d.ts.map +1 -1
- package/dist/utils/tests/dummy/post.d.ts +3 -3
- package/package.json +2 -1
- package/src/@types/core/events.ts +10 -0
- package/src/@types/core/model.ts +8 -1
- package/src/@types/core/payload.ts +48 -5
- package/src/@types/domains/channel.ts +1 -0
- package/src/@types/domains/client.ts +12 -0
- package/src/@types/domains/community.ts +82 -3
- package/src/@types/domains/content.ts +15 -1
- package/src/@types/domains/group.ts +2 -0
- package/src/@types/domains/invitation.ts +119 -0
- package/src/@types/domains/joinRequest.ts +66 -0
- package/src/@types/domains/notification.ts +2 -0
- package/src/@types/domains/pinnedPost.ts +1 -1
- package/src/@types/index.ts +5 -0
- package/src/channelRepository/channelMembership/observers/getMembers/ChannelMemberLiveCollectionController.ts +3 -1
- package/src/channelRepository/channelMembership/observers/searchMembers/SearchChannelMemberLiveCollectionController.ts +2 -1
- package/src/channelRepository/channelMembership/observers/searchMembers/SearchChannelMemberQueryStreamController.ts +2 -2
- package/src/client/api/index.ts +1 -0
- package/src/client/api/resumeSession.ts +282 -0
- package/src/client/api/tests/resumeSession.test.ts +173 -0
- package/src/communityRepository/api/createCommunity.ts +6 -3
- package/src/communityRepository/api/deleteCommunity.ts +2 -1
- package/src/communityRepository/api/getCommunities.ts +9 -2
- package/src/communityRepository/api/getCommunity.ts +12 -3
- package/src/communityRepository/api/getRecommendedCommunities.ts +11 -4
- package/src/communityRepository/api/getTrendingCommunities.ts +11 -4
- package/src/communityRepository/api/joinCommunity.ts +4 -1
- package/src/communityRepository/api/queryCommunities.ts +7 -1
- package/src/communityRepository/api/updateCommunity.ts +14 -4
- package/src/communityRepository/communityMembership/events/index.ts +1 -0
- 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/onLocalCommunityJoin.ts +20 -0
- 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 +3 -1
- package/src/communityRepository/communityMembership/events/utils.ts +2 -2
- package/src/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.ts +8 -2
- package/src/communityRepository/communityMembership/observers/getMembers/enums.ts +1 -0
- package/src/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.ts +8 -2
- package/src/communityRepository/communityMembership/observers/searchMembers/enums.ts +1 -0
- 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/internalAPI/getMyJoinRequest.ts +43 -0
- package/src/communityRepository/internalAPI/joinCommunity.ts +66 -0
- package/src/communityRepository/joinRequest/events/index.ts +3 -0
- package/src/communityRepository/joinRequest/events/onJoinRequestCreated.ts +33 -0
- package/src/communityRepository/joinRequest/events/onJoinRequestDeleted.ts +33 -0
- package/src/communityRepository/joinRequest/events/onJoinRequestUpdated.ts +33 -0
- package/src/communityRepository/joinRequest/internalAPI/approveJoinRequest.ts +52 -0
- package/src/communityRepository/joinRequest/internalAPI/cancelJoinRequest.ts +49 -0
- package/src/communityRepository/joinRequest/internalAPI/rejectJoinRequest.ts +52 -0
- package/src/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.ts +6 -0
- package/src/communityRepository/observers/getCommunities/CommunitiesPaginationController.ts +1 -0
- package/src/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/getCommunity.ts +26 -11
- package/src/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.ts +135 -0
- package/src/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.ts +30 -0
- package/src/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.ts +116 -0
- package/src/communityRepository/observers/getJoinRequestList/enum.ts +5 -0
- package/src/communityRepository/observers/getJoinRequestList.ts +51 -0
- package/src/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.ts +126 -0
- package/src/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.ts +25 -0
- package/src/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.ts +108 -0
- package/src/communityRepository/observers/getJoinRequests/enum.ts +5 -0
- package/src/communityRepository/observers/getJoinRequests.ts +44 -0
- package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesLiveCollectionController.ts +8 -1
- package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesPaginationController.ts +6 -1
- package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/getRecommendedCommunities/enums.ts +1 -0
- package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesLiveCollectionController.ts +9 -1
- package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesPaginationController.ts +6 -1
- package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/index.ts +1 -0
- package/src/communityRepository/observers/searchCommunities/SearchCommunitiesLiveCollectionController.ts +6 -0
- package/src/communityRepository/observers/searchCommunities/SearchCommunitiesPaginationController.ts +1 -0
- package/src/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityLiveCollectionController.ts +6 -0
- package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityPaginationController.ts +1 -0
- package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.ts +2 -2
- package/src/communityRepository/utils/communityWithMembership.ts +9 -5
- package/src/communityRepository/utils/payload.ts +28 -2
- package/src/core/liveCollection/PaginationController.ts +1 -1
- package/src/core/liveCollection/PaginationNoPageController.ts +1 -1
- package/src/core/model/idResolvers.ts +3 -0
- package/src/core/model/index.ts +3 -0
- package/src/index.ts +2 -0
- package/src/invitationRepository/events/index.ts +3 -0
- package/src/invitationRepository/events/onLocalInvitationCreated.ts +33 -0
- package/src/invitationRepository/events/onLocalInvitationDeleted.ts +33 -0
- package/src/invitationRepository/events/onLocalInvitationUpdated.ts +33 -0
- package/src/invitationRepository/index.ts +2 -0
- package/src/invitationRepository/internalApi/acceptInvitation.ts +45 -0
- package/src/invitationRepository/internalApi/createInvitations.ts +52 -0
- package/src/invitationRepository/internalApi/getInvitation.ts +47 -0
- package/src/invitationRepository/internalApi/index.ts +3 -0
- package/src/invitationRepository/internalApi/rejectInvitation.ts +45 -0
- package/src/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.ts +148 -0
- package/src/invitationRepository/observers/getInvitations/InvitationsPaginationController.ts +19 -0
- package/src/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.ts +97 -0
- package/src/invitationRepository/observers/getInvitations/enums.ts +5 -0
- package/src/invitationRepository/observers/getInvitations.ts +44 -0
- package/src/invitationRepository/observers/getMyCommunityInvitations.ts +48 -0
- package/src/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.ts +148 -0
- package/src/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.ts +22 -0
- package/src/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.ts +105 -0
- package/src/invitationRepository/observers/index.ts +1 -0
- package/src/invitationRepository/utils/convertRawInvitationToInternalInvitation.ts +8 -0
- package/src/invitationRepository/utils/index.ts +1 -0
- package/src/invitationRepository/utils/prepareInvitationPayload.ts +12 -0
- package/src/invitationRepository/utils/prepareMyInvitationsPayload.ts +12 -0
- package/src/messagePreview/utils/getChannelMessagePreviewWithUser.ts +3 -3
- package/src/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostQueryStreamController.ts +7 -1
- package/src/postRepository/observers/getPinnedPosts/PinnedPostQueryStreamController.ts +7 -1
- package/src/subChannelRepository/utils/prepareSubChannelPayload.ts +4 -0
- package/src/utils/linkedObject/channelLinkedObject.ts +19 -0
- package/src/utils/linkedObject/channelMemberLinkedObject.ts +20 -0
- package/src/utils/linkedObject/communityLinkedObject.ts +57 -0
- package/src/utils/linkedObject/index.ts +8 -0
- package/src/utils/linkedObject/invitationLinkedObject.ts +37 -0
- package/src/utils/linkedObject/joinRequestLinkedObject.ts +31 -0
|
@@ -27,6 +27,9 @@ declare global {
|
|
|
27
27
|
semanticSearchPost: Amity.SemanticSearchPostPayload;
|
|
28
28
|
semanticSearchCommunity: Amity.SemanticSearchCommunityPayload;
|
|
29
29
|
notificationTrayItem: Amity.NotificationTrayPayload;
|
|
30
|
+
invitation: Amity.InvitationPayload;
|
|
31
|
+
myInvitation: Amity.MyInvitationsPayload;
|
|
32
|
+
joinRequest: Amity.CommunityJoinRequestPayload;
|
|
30
33
|
};
|
|
31
34
|
|
|
32
35
|
type UserPayload = {
|
|
@@ -225,7 +228,7 @@ declare global {
|
|
|
225
228
|
type SubChannelPayload<T extends Amity.MessageContentType = any> = {
|
|
226
229
|
messageFeeds: Amity.RawSubChannel[];
|
|
227
230
|
messages: Amity.RawMessage<T>[];
|
|
228
|
-
users: Amity.
|
|
231
|
+
users: Amity.RawUser[];
|
|
229
232
|
files: Amity.File[];
|
|
230
233
|
};
|
|
231
234
|
|
|
@@ -297,6 +300,12 @@ declare global {
|
|
|
297
300
|
files: Amity.File[];
|
|
298
301
|
};
|
|
299
302
|
|
|
303
|
+
type CommunityJoinRequestPayload = {
|
|
304
|
+
joinRequests: Amity.RawJoinRequest[];
|
|
305
|
+
users: Amity.RawUser[];
|
|
306
|
+
files: Amity.File[];
|
|
307
|
+
};
|
|
308
|
+
|
|
300
309
|
type RecommendedCommunityPayload = Amity.CommunityPayload;
|
|
301
310
|
type TrendingCommunityPayload = Amity.CommunityPayload;
|
|
302
311
|
|
|
@@ -306,8 +315,18 @@ declare global {
|
|
|
306
315
|
* - communityUsers: `Amity.RawMembership` -> `Amity.Membership` (Add user getter prop)
|
|
307
316
|
*/
|
|
308
317
|
type ProcessedCommunityPayload = Omit<CommunityPayload, 'communities' | 'communityUsers'> & {
|
|
309
|
-
communities: Amity.
|
|
318
|
+
communities: Amity.InternalCommunity[];
|
|
310
319
|
communityUsers: Amity.Membership<'community'>[];
|
|
320
|
+
users: Amity.InternalUser[];
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
type ProcessedJoinRequestPayload = Omit<
|
|
324
|
+
CommunityJoinRequestPayload,
|
|
325
|
+
'communities' | 'communityUsers' | 'joinRequests' | 'users'
|
|
326
|
+
> & {
|
|
327
|
+
joinRequests: Amity.InternalJoinRequest[];
|
|
328
|
+
files: Amity.File[];
|
|
329
|
+
users: Amity.InternalUser[];
|
|
311
330
|
};
|
|
312
331
|
|
|
313
332
|
type CategoryPayload = {
|
|
@@ -333,7 +352,7 @@ declare global {
|
|
|
333
352
|
CommunityMembershipPayload,
|
|
334
353
|
'communities' | 'communityUsers'
|
|
335
354
|
> & {
|
|
336
|
-
communities: Amity.
|
|
355
|
+
communities: Amity.InternalCommunity[];
|
|
337
356
|
communityUsers: Amity.Membership<'community'>[];
|
|
338
357
|
};
|
|
339
358
|
|
|
@@ -383,7 +402,7 @@ declare global {
|
|
|
383
402
|
Amity.StoryTargetPayload;
|
|
384
403
|
|
|
385
404
|
type ProcessedGlobalStoryFeed = Omit<GlobalStoryFeedPayload, 'communities'> & {
|
|
386
|
-
communities: Amity.
|
|
405
|
+
communities: Amity.InternalCommunity[];
|
|
387
406
|
};
|
|
388
407
|
|
|
389
408
|
// Original Payload form BE
|
|
@@ -436,7 +455,7 @@ declare global {
|
|
|
436
455
|
*/
|
|
437
456
|
type ProcessedPostPayload = Omit<PostPayload, 'communities' | 'communityUsers' | 'posts'> & {
|
|
438
457
|
posts: Amity.InternalPost[];
|
|
439
|
-
communities: Amity.
|
|
458
|
+
communities: Amity.InternalCommunity[];
|
|
440
459
|
communityUsers: Amity.Membership<'community'>[];
|
|
441
460
|
};
|
|
442
461
|
|
|
@@ -545,5 +564,29 @@ declare global {
|
|
|
545
564
|
Amity.Flaggable &
|
|
546
565
|
Amity.Taggable &
|
|
547
566
|
Amity.Timestamps;
|
|
567
|
+
|
|
568
|
+
type InvitationPayload = {
|
|
569
|
+
invitations: Amity.RawInvitation[];
|
|
570
|
+
users: Amity.RawUser[];
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
type ProcessedInvitationPayload = {
|
|
574
|
+
invitations: Amity.InternalInvitation[];
|
|
575
|
+
users: Amity.InternalUser[];
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
type MyInvitationsPayload = {
|
|
579
|
+
invitations: Amity.RawInvitation[];
|
|
580
|
+
users: Amity.RawUser[];
|
|
581
|
+
};
|
|
582
|
+
|
|
583
|
+
type ProcessedMyInvitationsPayload = {
|
|
584
|
+
invitations: Amity.InternalInvitation[];
|
|
585
|
+
users: Amity.InternalUser[];
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
type JoinRequestPayload = {
|
|
589
|
+
joinRequests: Amity.RawJoinRequest[];
|
|
590
|
+
};
|
|
548
591
|
}
|
|
549
592
|
}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
2
|
import { Emitter } from 'mitt';
|
|
3
3
|
|
|
4
|
+
export const enum MembershipAcceptanceTypeEnum {
|
|
5
|
+
AUTOMATIC = 'automatic',
|
|
6
|
+
INVITATION = 'invitation',
|
|
7
|
+
}
|
|
8
|
+
|
|
4
9
|
declare global {
|
|
5
10
|
namespace Amity {
|
|
6
11
|
type Logger = (topic: string, ...args: any[]) => void;
|
|
7
12
|
|
|
13
|
+
type MembershipAcceptanceType = MembershipAcceptanceTypeEnum;
|
|
14
|
+
|
|
8
15
|
const enum TokenTerminationReason {
|
|
9
16
|
GLOBAL_BAN = 'globalBan',
|
|
10
17
|
USER_DELETED = 'userDeleted',
|
|
@@ -138,7 +145,12 @@ declare global {
|
|
|
138
145
|
showMyPost: boolean;
|
|
139
146
|
showOnlyMyFeed: boolean;
|
|
140
147
|
};
|
|
148
|
+
story: {
|
|
149
|
+
allowAllUserToCreateStory: boolean;
|
|
150
|
+
expiryTimeMinutes: number;
|
|
151
|
+
};
|
|
141
152
|
userPrivacySetting: 'public' | 'private';
|
|
153
|
+
membershipAcceptance: Amity.MembershipAcceptanceType;
|
|
142
154
|
};
|
|
143
155
|
|
|
144
156
|
type ConnectClientParams = {
|
|
@@ -95,17 +95,25 @@ declare global {
|
|
|
95
95
|
hasFlaggedPost: boolean;
|
|
96
96
|
|
|
97
97
|
allowCommentInStory?: boolean;
|
|
98
|
+
|
|
99
|
+
isDiscoverable?: boolean;
|
|
100
|
+
requiresJoinApproval?: boolean;
|
|
98
101
|
} & Amity.Taggable &
|
|
99
102
|
Amity.Metadata &
|
|
100
103
|
Amity.Timestamps &
|
|
101
104
|
Amity.SoftDelete &
|
|
102
105
|
Amity.Subscribable;
|
|
103
106
|
|
|
104
|
-
type
|
|
107
|
+
type InternalCommunity = Omit<
|
|
108
|
+
Amity.RawCommunity,
|
|
109
|
+
'onlyAdminCanPost' | 'needApprovalOnPostCreation'
|
|
110
|
+
> &
|
|
105
111
|
Amity.CommunityStorySettings & {
|
|
106
112
|
postSetting?: ValueOf<typeof CommunityPostSettings>;
|
|
107
113
|
};
|
|
108
114
|
|
|
115
|
+
type Community = Amity.InternalCommunity & Amity.CommunityLinkedObject;
|
|
116
|
+
|
|
109
117
|
type QueryCommunities = {
|
|
110
118
|
membership?: 'all' | 'member' | 'notMember';
|
|
111
119
|
categoryId?: Amity.InternalCategory['categoryId'];
|
|
@@ -114,6 +122,17 @@ declare global {
|
|
|
114
122
|
sortBy?: Amity.CommunitySortBy | Amity.CommunitySortByEnum;
|
|
115
123
|
page?: string;
|
|
116
124
|
limit?: number;
|
|
125
|
+
includeDiscoverablePrivateCommunity?: boolean;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
type QueryJoinCommunity = {
|
|
129
|
+
communityId: string;
|
|
130
|
+
status: Amity.JoinRequestStatus;
|
|
131
|
+
sortBy?: Amity.CommunitySortBy | Amity.CommunitySortByEnum;
|
|
132
|
+
options?: {
|
|
133
|
+
limit?: number;
|
|
134
|
+
token?: string;
|
|
135
|
+
};
|
|
117
136
|
};
|
|
118
137
|
|
|
119
138
|
type SearchQueryCommunities = {
|
|
@@ -125,12 +144,46 @@ declare global {
|
|
|
125
144
|
sortBy?: Amity.SearchCommunitySortBy | Amity.SearchCommunitySortByEnum;
|
|
126
145
|
page?: string;
|
|
127
146
|
limit?: number;
|
|
147
|
+
includeDiscoverablePrivateCommunity?: boolean;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
type QueryJoinRequest = {
|
|
151
|
+
communityId: string;
|
|
152
|
+
status: Amity.JoinRequestStatus;
|
|
153
|
+
targetType: 'community';
|
|
154
|
+
type: Amity.JoinRequestType;
|
|
155
|
+
sortBy?: Amity.CommunitySortBy | Amity.CommunitySortByEnum;
|
|
156
|
+
options?: {
|
|
157
|
+
limit?: number;
|
|
158
|
+
token?: string;
|
|
159
|
+
};
|
|
160
|
+
page?: string;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
type QueryJoinRequestList = {
|
|
164
|
+
communityIds: string[];
|
|
165
|
+
sortBy?: Amity.CommunitySortBy | Amity.CommunitySortByEnum;
|
|
166
|
+
options?: {
|
|
167
|
+
limit?: number;
|
|
168
|
+
token?: string;
|
|
169
|
+
};
|
|
170
|
+
page?: string;
|
|
128
171
|
};
|
|
129
172
|
|
|
130
173
|
type CommunityLiveCollection = Amity.LiveCollectionParams<Omit<QueryCommunities, 'page'>>;
|
|
131
174
|
|
|
132
|
-
type RecommendedCommunityLiveCollection = Amity.LiveCollectionParams<{
|
|
133
|
-
|
|
175
|
+
type RecommendedCommunityLiveCollection = Amity.LiveCollectionParams<{
|
|
176
|
+
limit?: number;
|
|
177
|
+
includeDiscoverablePrivateCommunity?: boolean;
|
|
178
|
+
}>;
|
|
179
|
+
type TrendingCommunityLiveCollection = Amity.LiveCollectionParams<{
|
|
180
|
+
limit?: number;
|
|
181
|
+
includeDiscoverablePrivateCommunity?: boolean;
|
|
182
|
+
}>;
|
|
183
|
+
|
|
184
|
+
type JoinRequestLiveCollection = Amity.LiveCollectionParams<QueryJoinRequest>;
|
|
185
|
+
|
|
186
|
+
type JoinRequestListLiveCollection = Amity.LiveCollectionParams<QueryJoinRequestList>;
|
|
134
187
|
|
|
135
188
|
type SearchCommunityLiveCollection = Amity.LiveCollectionParams<
|
|
136
189
|
Omit<SearchQueryCommunities, 'page'>
|
|
@@ -149,6 +202,16 @@ declare global {
|
|
|
149
202
|
Pick<SearchQueryCommunities, 'page'>
|
|
150
203
|
>;
|
|
151
204
|
|
|
205
|
+
type JoinRequestLiveCollectionCache = Amity.LiveCollectionCache<
|
|
206
|
+
Amity.JoinRequest['joinRequestId'],
|
|
207
|
+
Pick<QueryJoinRequest, 'page'>
|
|
208
|
+
>;
|
|
209
|
+
|
|
210
|
+
type JoinRequestListLiveCollectionCache = Amity.LiveCollectionCache<
|
|
211
|
+
Amity.JoinRequest['joinRequestId'],
|
|
212
|
+
Pick<QueryJoinRequestList, 'page'>
|
|
213
|
+
>;
|
|
214
|
+
|
|
152
215
|
type QueryCommunityMembers = {
|
|
153
216
|
communityId: string;
|
|
154
217
|
memberships?: ('banned' | 'member')[];
|
|
@@ -197,6 +260,7 @@ declare global {
|
|
|
197
260
|
token?: string;
|
|
198
261
|
};
|
|
199
262
|
tags?: string[];
|
|
263
|
+
includeDiscoverablePrivateCommunity?: boolean;
|
|
200
264
|
};
|
|
201
265
|
|
|
202
266
|
type SemanticSearchCommunityLiveCollection = Amity.LiveCollectionParams<
|
|
@@ -209,5 +273,20 @@ declare global {
|
|
|
209
273
|
Amity.Community['communityId'], // communityId:score
|
|
210
274
|
QuerySemanticSearchCommunity
|
|
211
275
|
>;
|
|
276
|
+
|
|
277
|
+
type CommunityLinkedObject = {
|
|
278
|
+
createInvitations: (userIds: string[]) => Promise<void>;
|
|
279
|
+
getMemberInvitations: (
|
|
280
|
+
params: Pick<Amity.InvitationLiveCollection, 'limit' | 'sortBy' | 'statuses'>,
|
|
281
|
+
callback: Amity.LiveCollectionCallback<Amity.Invitation>,
|
|
282
|
+
) => Amity.Unsubscriber;
|
|
283
|
+
getInvitation: () => Promise<Amity.Invitation | undefined>;
|
|
284
|
+
join: () => Promise<Amity.JoinResult>;
|
|
285
|
+
getJoinRequests: (
|
|
286
|
+
params: QueryJoinRequest,
|
|
287
|
+
callback: Amity.LiveCollectionCallback<Amity.JoinRequest>,
|
|
288
|
+
) => Amity.Unsubscriber;
|
|
289
|
+
getMyJoinRequest: () => Promise<Amity.JoinRequest | undefined>;
|
|
290
|
+
};
|
|
212
291
|
}
|
|
213
292
|
}
|
|
@@ -24,7 +24,15 @@ declare global {
|
|
|
24
24
|
| Exclude<`${ContentFlagReasonEnum}`, `${ContentFlagReasonEnum.Others}`>
|
|
25
25
|
| (string & {});
|
|
26
26
|
|
|
27
|
-
type ContentType =
|
|
27
|
+
type ContentType =
|
|
28
|
+
| 'text'
|
|
29
|
+
| 'image'
|
|
30
|
+
| 'file'
|
|
31
|
+
| 'video'
|
|
32
|
+
| 'poll'
|
|
33
|
+
| 'json'
|
|
34
|
+
| 'liveStream'
|
|
35
|
+
| string;
|
|
28
36
|
|
|
29
37
|
type ContentFeedType = ValueOf<typeof ContentFeedType>;
|
|
30
38
|
|
|
@@ -58,6 +66,10 @@ declare global {
|
|
|
58
66
|
pollId: Amity.Poll['pollId'];
|
|
59
67
|
};
|
|
60
68
|
|
|
69
|
+
type ContentDataStream = {
|
|
70
|
+
streamId: Amity.Stream['streamId'];
|
|
71
|
+
};
|
|
72
|
+
|
|
61
73
|
type ContentData<T extends ContentType> = T extends 'text'
|
|
62
74
|
? ContentDataText
|
|
63
75
|
: T extends 'file'
|
|
@@ -68,6 +80,8 @@ declare global {
|
|
|
68
80
|
? ContentDataVideo
|
|
69
81
|
: T extends 'poll'
|
|
70
82
|
? ContentDataPoll
|
|
83
|
+
: T extends 'liveStream'
|
|
84
|
+
? ContentDataStream
|
|
71
85
|
: T extends 'json'
|
|
72
86
|
? Record<string, unknown>
|
|
73
87
|
: T extends string
|
|
@@ -15,6 +15,8 @@ declare global {
|
|
|
15
15
|
|
|
16
16
|
type Member<T extends Amity.GroupType> = {
|
|
17
17
|
userId: Amity.InternalUser['userId'];
|
|
18
|
+
userInternalId: Amity.InternalUser['userInternalId'];
|
|
19
|
+
userPublicId: Amity.InternalUser['userPublicId'];
|
|
18
20
|
} & (T extends 'channel'
|
|
19
21
|
? {
|
|
20
22
|
channelId: Amity.Channel['channelId'];
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
export const enum InvitationTypeEnum {
|
|
4
|
+
CommunityMemberInvite = 'communityMemberInvite',
|
|
5
|
+
LivestreamInvite = 'livestreamInvite',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const enum InvitationStatusEnum {
|
|
9
|
+
Pending = 'pending',
|
|
10
|
+
Approved = 'approved',
|
|
11
|
+
Rejected = 'rejected',
|
|
12
|
+
Cancelled = 'cancelled',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const enum InvitationSortByEnum {
|
|
16
|
+
FirstCreated = 'firstCreated',
|
|
17
|
+
LastCreated = 'lastCreated',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare global {
|
|
21
|
+
namespace Amity {
|
|
22
|
+
type InvitationType = InvitationTypeEnum;
|
|
23
|
+
|
|
24
|
+
type InvitationStatus = InvitationStatusEnum;
|
|
25
|
+
|
|
26
|
+
type InvitationTargetType = Extract<Amity.Domain, 'community'>;
|
|
27
|
+
|
|
28
|
+
type InvitationTargetMap = {
|
|
29
|
+
community: Amity.InternalCommunity;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type InvitationTarget<T extends InvitationTargetType> = InvitationTargetMap[T];
|
|
33
|
+
|
|
34
|
+
type InvitationSortBy = InvitationSortByEnum;
|
|
35
|
+
|
|
36
|
+
type InvitationDomain<T extends Amity.InvitationTargetType = Amity.InvitationTargetType> =
|
|
37
|
+
T extends 'community' ? { communityId: string } : { communityId?: string };
|
|
38
|
+
|
|
39
|
+
type RawInvitation = {
|
|
40
|
+
_id: string;
|
|
41
|
+
networkId: string;
|
|
42
|
+
type: Amity.InvitationType;
|
|
43
|
+
targetId: string;
|
|
44
|
+
targetType: Amity.InvitationTargetType;
|
|
45
|
+
userId: string;
|
|
46
|
+
status: Amity.InvitationStatus;
|
|
47
|
+
respondedAt: Amity.timestamp;
|
|
48
|
+
createdBy: string;
|
|
49
|
+
invitationId: string;
|
|
50
|
+
invitedUserId: string;
|
|
51
|
+
invitedUserInternalId: string;
|
|
52
|
+
invitedUserPublicId: string;
|
|
53
|
+
inviterUserId: string;
|
|
54
|
+
inviterUserInternalId: string;
|
|
55
|
+
inviterUserPublicId: string;
|
|
56
|
+
} & Amity.Timestamps &
|
|
57
|
+
Amity.InvitationDomain<Amity.InvitationTargetType>;
|
|
58
|
+
|
|
59
|
+
type InternalInvitation = Omit<RawInvitation, 'createdBy'> & {
|
|
60
|
+
createdById: string;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
type Invitation = Omit<Amity.InternalInvitation, 'createdBy'> &
|
|
64
|
+
Amity.InvitationLinkedObject & {
|
|
65
|
+
user?: Amity.User;
|
|
66
|
+
createdById: string;
|
|
67
|
+
createdBy?: Amity.User;
|
|
68
|
+
target?: Amity.InvitationTarget<Amity.InvitationTargetType>;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type QueryInvitations = {
|
|
72
|
+
targetId: string;
|
|
73
|
+
statuses?: string[];
|
|
74
|
+
token?: Amity.Token;
|
|
75
|
+
type: Amity.InvitationType;
|
|
76
|
+
sortBy?: Amity.InvitationSortBy;
|
|
77
|
+
limit?: Amity.PageLimit['limit'];
|
|
78
|
+
targetType: Amity.InvitationTargetType;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
type InvitationLiveCollection = Amity.LiveCollectionParams<Omit<QueryInvitations, 'limit'>>;
|
|
82
|
+
|
|
83
|
+
type InvitationLiveCollectionCache = Amity.LiveCollectionCache<
|
|
84
|
+
Amity.InternalInvitation['_id'],
|
|
85
|
+
Pick<QueryInvitations, 'limit'>
|
|
86
|
+
>;
|
|
87
|
+
|
|
88
|
+
type QueryMyInvitations = {
|
|
89
|
+
targetId?: string;
|
|
90
|
+
token?: Amity.Token;
|
|
91
|
+
type?: Amity.InvitationType;
|
|
92
|
+
sortBy?: Amity.InvitationSortBy;
|
|
93
|
+
limit?: Amity.PageLimit['limit'];
|
|
94
|
+
statuses?: InvitationStatusEnum[];
|
|
95
|
+
targetType?: Amity.InvitationTargetType;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
type MyInvitationsLiveCollection = Amity.LiveCollectionParams<
|
|
99
|
+
Omit<QueryMyInvitations, 'limit'>
|
|
100
|
+
>;
|
|
101
|
+
|
|
102
|
+
type MyInvitationsLiveCollectionCache = Amity.LiveCollectionCache<
|
|
103
|
+
Amity.InternalInvitation['_id'],
|
|
104
|
+
Pick<QueryMyInvitations, 'limit'>
|
|
105
|
+
>;
|
|
106
|
+
|
|
107
|
+
type InvitationLinkedObject = {
|
|
108
|
+
accept: () => Promise<void>;
|
|
109
|
+
reject: () => Promise<void>;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
type CreateInvitations = {
|
|
113
|
+
type: Amity.InvitationType;
|
|
114
|
+
targetType: Amity.InvitationTargetType;
|
|
115
|
+
targetId: string;
|
|
116
|
+
userIds: string[];
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
export const enum JoinRequestStatusEnum {
|
|
4
|
+
Pending = 'pending',
|
|
5
|
+
Approved = 'approved',
|
|
6
|
+
Rejected = 'rejected',
|
|
7
|
+
Cancelled = 'cancelled',
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const enum JoinResultStatusEnum {
|
|
11
|
+
Success = 'success',
|
|
12
|
+
Pending = 'pending',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare global {
|
|
16
|
+
namespace Amity {
|
|
17
|
+
type JoinRequestStatus = JoinRequestStatusEnum;
|
|
18
|
+
|
|
19
|
+
type JoinResultStatus = JoinResultStatusEnum;
|
|
20
|
+
|
|
21
|
+
type JoinRequestType = 'communityJoinRequest';
|
|
22
|
+
|
|
23
|
+
type JoinResult = {
|
|
24
|
+
status: Amity.JoinResultStatus;
|
|
25
|
+
request?: Amity.JoinRequest;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
type RawJoinRequest = {
|
|
29
|
+
_id: string;
|
|
30
|
+
createdAt: Amity.timestamp;
|
|
31
|
+
joinRequestId: string;
|
|
32
|
+
networkId: string;
|
|
33
|
+
|
|
34
|
+
requestorId: string;
|
|
35
|
+
requestorInternalId: string;
|
|
36
|
+
requestorPublicId: string;
|
|
37
|
+
|
|
38
|
+
respondedAt: Amity.timestamp | null;
|
|
39
|
+
responderId: string | null;
|
|
40
|
+
responderInternalId: string | null;
|
|
41
|
+
responderPublicId: string | null;
|
|
42
|
+
|
|
43
|
+
status: Amity.JoinRequestStatus;
|
|
44
|
+
targetId: string;
|
|
45
|
+
targetType: string;
|
|
46
|
+
type: Amity.JoinRequestType;
|
|
47
|
+
updatedAt: Amity.timestamp;
|
|
48
|
+
userId: string;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type InternalJoinRequest = Omit<RawJoinRequest, '_id'>;
|
|
52
|
+
|
|
53
|
+
type JoinRequest = Omit<Amity.InternalJoinRequest, 'responderId'> &
|
|
54
|
+
Amity.JoinRequestLinkedObject & {
|
|
55
|
+
user?: Amity.User;
|
|
56
|
+
feeds?: Amity.Feed[];
|
|
57
|
+
files?: Amity.File[];
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
type JoinRequestLinkedObject = {
|
|
61
|
+
cancel: () => Promise<void>;
|
|
62
|
+
approve: () => Promise<void>;
|
|
63
|
+
reject: () => Promise<void>;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -10,6 +10,7 @@ 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',
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
const enum TrayAction {
|
|
@@ -19,6 +20,7 @@ declare global {
|
|
|
19
20
|
REACTION = 'reaction',
|
|
20
21
|
MENTION = 'mention',
|
|
21
22
|
REPLY = 'reply',
|
|
23
|
+
JOIN_REQUEST = 'join_request',
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
type RawNotificationTrayItem = {
|
package/src/@types/index.ts
CHANGED
|
@@ -38,3 +38,8 @@ export * from './domains/post';
|
|
|
38
38
|
export * from './domains/story';
|
|
39
39
|
export * from './domains/ad';
|
|
40
40
|
export * from './domains/notification';
|
|
41
|
+
export * from './domains/client';
|
|
42
|
+
export * from './domains/invitation';
|
|
43
|
+
export * from './domains/joinRequest';
|
|
44
|
+
export * from './domains/pin';
|
|
45
|
+
export * from './domains/pinnedPost';
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
} from '~/core/query';
|
|
24
24
|
import { prepareChannelPayload } from '~/channelRepository/utils';
|
|
25
25
|
import { onUserDeleted } from '~/channelRepository/events/onUserDeleted';
|
|
26
|
+
import { LinkedObject } from '~/utils/linkedObject';
|
|
26
27
|
|
|
27
28
|
export class ChannelMemberLiveCollectionController extends LiveCollectionController<
|
|
28
29
|
'channelUser',
|
|
@@ -100,7 +101,8 @@ export class ChannelMemberLiveCollectionController extends LiveCollectionControl
|
|
|
100
101
|
collection.data
|
|
101
102
|
.map(id => pullFromCache<Amity.Membership<'channel'>>(['channelUsers', 'get', id])!)
|
|
102
103
|
.filter(Boolean)
|
|
103
|
-
.map(({ data }) => data)
|
|
104
|
+
.map(({ data }) => data)
|
|
105
|
+
.map(LinkedObject.channelMember) ?? [],
|
|
104
106
|
);
|
|
105
107
|
|
|
106
108
|
if (!this.shouldNotify(data) && origin === 'event') return;
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
import { filterByPropIntersection, filterBySearchTerm } from '~/core/query';
|
|
18
18
|
import { prepareChannelPayload } from '~/channelRepository/utils';
|
|
19
19
|
import { onUserDeleted } from '~/channelRepository/events/onUserDeleted';
|
|
20
|
+
import { LinkedObject } from '~/utils/linkedObject';
|
|
20
21
|
|
|
21
22
|
export class SearchChannelMemberLiveCollectionController extends LiveCollectionController<
|
|
22
23
|
'channelUser',
|
|
@@ -94,7 +95,7 @@ export class SearchChannelMemberLiveCollectionController extends LiveCollectionC
|
|
|
94
95
|
collection.data
|
|
95
96
|
.map(id => pullFromCache<Amity.Membership<'channel'>>(['channelUsers', 'get', id])!)
|
|
96
97
|
.filter(Boolean)
|
|
97
|
-
.map(({ data }) => data) ?? [],
|
|
98
|
+
.map(({ data }) => LinkedObject.channelMember(data) ?? []),
|
|
98
99
|
);
|
|
99
100
|
|
|
100
101
|
if (!this.shouldNotify(data) && origin === 'event') return;
|
|
@@ -72,7 +72,7 @@ export class SearchChannelMemberQueryStreamController extends QueryStreamControl
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
reactor(action: string) {
|
|
75
|
-
return (channel: Amity.
|
|
75
|
+
return (channel: Amity.StaticInternalChannel, channelMember: Amity.Membership<'channel'>) => {
|
|
76
76
|
if (this.query.channelId !== channelMember.channelId) return;
|
|
77
77
|
|
|
78
78
|
const collection = pullFromCache<Amity.ChannelMembersLiveCollectionCache>(
|
|
@@ -100,7 +100,7 @@ export class SearchChannelMemberQueryStreamController extends QueryStreamControl
|
|
|
100
100
|
createSubscriber: {
|
|
101
101
|
fn: (
|
|
102
102
|
reactor: (
|
|
103
|
-
channel: Amity.
|
|
103
|
+
channel: Amity.StaticInternalChannel,
|
|
104
104
|
channelMember: Amity.Membership<'channel'>,
|
|
105
105
|
) => void,
|
|
106
106
|
) => Amity.Unsubscriber;
|