@amityco/ts-sdk 7.4.1-fd0f791a.0 → 7.5.1-12f08f0.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 -1
- package/dist/@types/core/events.d.ts.map +1 -1
- package/dist/@types/domains/community.d.ts +11 -0
- package/dist/@types/domains/community.d.ts.map +1 -1
- package/dist/@types/domains/invitation.d.ts +0 -1
- package/dist/@types/domains/invitation.d.ts.map +1 -1
- package/dist/@types/domains/notification.d.ts +4 -2
- package/dist/@types/domains/notification.d.ts.map +1 -1
- package/dist/communityRepository/api/getCommunities.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/onLocalCommunityJoin.d.ts +2 -0
- package/dist/communityRepository/communityMembership/events/onLocalCommunityJoin.d.ts.map +1 -0
- package/dist/communityRepository/internalAPI/joinCommunity.d.ts.map +1 -1
- package/dist/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.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/index.d.ts +1 -0
- package/dist/communityRepository/observers/index.d.ts.map +1 -1
- package/dist/core/events.d.ts +3 -3
- package/dist/core/events.d.ts.map +1 -1
- package/dist/index.cjs.js +242 -58
- package/dist/index.esm.js +242 -58
- package/dist/index.umd.js +2 -2
- package/dist/invitationRepository/internalApi/index.d.ts +0 -1
- package/dist/invitationRepository/internalApi/index.d.ts.map +1 -1
- package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -1
- package/dist/utils/linkedObject/invitationLinkedObject.d.ts.map +1 -1
- package/dist/utils/tests/dummy/comment.d.ts +1 -1
- package/package.json +1 -1
- package/src/@types/core/events.ts +2 -2
- package/src/@types/domains/community.ts +17 -0
- package/src/@types/domains/invitation.ts +0 -1
- package/src/@types/domains/notification.ts +2 -0
- package/src/communityRepository/api/getCommunities.ts +3 -1
- package/src/communityRepository/communityMembership/events/index.ts +1 -0
- package/src/communityRepository/communityMembership/events/onLocalCommunityJoin.ts +20 -0
- package/src/communityRepository/internalAPI/joinCommunity.ts +17 -2
- package/src/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.ts +6 -0
- package/src/communityRepository/observers/getCommunity.ts +3 -0
- package/src/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.ts +130 -0
- package/src/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.ts +30 -0
- package/src/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.ts +112 -0
- package/src/communityRepository/observers/getJoinRequestList/enum.ts +5 -0
- package/src/communityRepository/observers/getJoinRequestList.ts +51 -0
- package/src/communityRepository/observers/index.ts +1 -0
- package/src/invitationRepository/internalApi/index.ts +0 -1
- package/src/utils/linkedObject/communityLinkedObject.ts +1 -3
- package/src/utils/linkedObject/invitationLinkedObject.ts +3 -10
- package/src/utils/linkedObject/joinRequestLinkedObject.ts +3 -3
- package/dist/invitationRepository/internalApi/cancelInvitation.d.ts +0 -16
- package/dist/invitationRepository/internalApi/cancelInvitation.d.ts.map +0 -1
- package/src/invitationRepository/internalApi/cancelInvitation.ts +0 -44
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cancelInvitation.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/internalApi/cancelInvitation.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,iBAAwB,MAAM,UAAU,CAAC,KAAK,CAAC,KAAG,QAAQ,OAAO,CAqB7F,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { fireEvent } from '~/core/events';
|
|
2
|
-
import { dropFromCache, pullFromCache } from '~/cache/api';
|
|
3
|
-
import { getActiveClient } from '~/client/api/activeClient';
|
|
4
|
-
|
|
5
|
-
/* begin_public_function
|
|
6
|
-
id: invitation.cancel
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* ```js
|
|
10
|
-
* import { cancelInvitation } from '@amityco/ts-sdk'
|
|
11
|
-
* const isCanceled = await cancelInvitation(invitationId)
|
|
12
|
-
* ```
|
|
13
|
-
*
|
|
14
|
-
* Cancels a {@link Amity.Invitation} object
|
|
15
|
-
*
|
|
16
|
-
* @param invitationId the {@link Amity.Invitation} to cancel
|
|
17
|
-
* @returns A success boolean if the {@link Amity.Invitation} was canceled
|
|
18
|
-
*
|
|
19
|
-
* @category Invitation API
|
|
20
|
-
* @async
|
|
21
|
-
*/
|
|
22
|
-
export const cancelInvitation = async (invitationId: Amity.Invitation['_id']): Promise<boolean> => {
|
|
23
|
-
const client = getActiveClient();
|
|
24
|
-
client.log('invitation/cancelInvitation', invitationId);
|
|
25
|
-
|
|
26
|
-
const { data } = await client.http.delete<{ success: boolean }>(
|
|
27
|
-
`/api/v1/invitations/${invitationId}`,
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
const invitation = pullFromCache<Amity.InternalInvitation>([
|
|
31
|
-
'invitation',
|
|
32
|
-
'get',
|
|
33
|
-
invitationId,
|
|
34
|
-
])?.data;
|
|
35
|
-
|
|
36
|
-
if (invitation) {
|
|
37
|
-
dropFromCache(['invitation', 'get', invitationId]);
|
|
38
|
-
|
|
39
|
-
fireEvent('local.invitation.deleted', [invitation]);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
return data.success;
|
|
43
|
-
};
|
|
44
|
-
/* end_public_function */
|