@amityco/ts-sdk 7.5.1-c1c809a0.0 → 7.5.1-d432304.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.
@@ -1 +1 @@
1
- {"version":3,"file":"communityLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/communityLinkedObject.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,qBAAqB,cAAe,MAAM,iBAAiB,KAAG,MAAM,SA+ChF,CAAC"}
1
+ {"version":3,"file":"communityLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/communityLinkedObject.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,qBAAqB,cAAe,MAAM,iBAAiB,KAAG,MAAM,SAgDhF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk",
3
- "version": "7.5.1-c1c809a0.0",
3
+ "version": "7.5.1-d432304.0",
4
4
  "license": "CC-BY-ND-4.0",
5
5
  "author": "amity.co <developers@amity.co> (https://amity.co)",
6
6
  "description": "Amity Social Cloud Typescript SDK",
@@ -33,6 +33,9 @@ declare global {
33
33
 
34
34
  type InvitationSortBy = InvitationSortByEnum;
35
35
 
36
+ type InvitationDomain<T extends Amity.InvitationTargetType = Amity.InvitationTargetType> =
37
+ T extends 'community' ? { communityId: string } : { communityId?: string };
38
+
36
39
  type RawInvitation = {
37
40
  _id: string;
38
41
  networkId: string;
@@ -50,7 +53,8 @@ declare global {
50
53
  inviterUserId: string;
51
54
  inviterUserInternalId: string;
52
55
  inviterUserPublicId: string;
53
- } & Amity.Timestamps;
56
+ } & Amity.Timestamps &
57
+ Amity.InvitationDomain<Amity.InvitationTargetType>;
54
58
 
55
59
  type InternalInvitation = Omit<RawInvitation, 'createdBy'> & {
56
60
  createdById: string;
@@ -15,7 +15,7 @@ export class MyInvitationsPaginationController extends PaginationController<
15
15
  { params: { ...params, options } },
16
16
  );
17
17
 
18
- await getCommunityByIds(data.invitations.map(invitation => invitation.targetId));
18
+ await getCommunityByIds(data.invitations.map(invitation => invitation.communityId));
19
19
 
20
20
  return data;
21
21
  }
@@ -36,6 +36,7 @@ export const communityLinkedObject = (community: Amity.InternalCommunity): Amity
36
36
  return data;
37
37
  },
38
38
  join: async () => joinRequest(community.communityId),
39
+
39
40
  getJoinRequests: (
40
41
  params: Omit<Amity.QueryJoinRequest, 'communityId'>,
41
42
  callback: Amity.LiveCollectionCallback<Amity.JoinRequest>,
@@ -28,10 +28,10 @@ export const invitationLinkedObject = (invitation: Amity.InternalInvitation): Am
28
28
  return undefined;
29
29
  },
30
30
  accept: async () => {
31
- acceptInvitation(invitation._id);
31
+ await acceptInvitation(invitation._id);
32
32
  },
33
33
  reject: async () => {
34
- rejectInvitation(invitation._id);
34
+ await rejectInvitation(invitation._id);
35
35
  },
36
36
  };
37
37
  };
@@ -19,13 +19,13 @@ export const joinRequestLinkedObject = (
19
19
  return userLinkedObject(user);
20
20
  },
21
21
  cancel: async () => {
22
- cancelJoinRequest(joinRequest);
22
+ await cancelJoinRequest(joinRequest);
23
23
  },
24
24
  approve: async () => {
25
- approveJoinRequest(joinRequest);
25
+ await approveJoinRequest(joinRequest);
26
26
  },
27
27
  reject: async () => {
28
- rejectJoinRequest(joinRequest);
28
+ await rejectJoinRequest(joinRequest);
29
29
  },
30
30
  };
31
31
  };