@amityco/ts-sdk 7.4.1-b7aa4210.0 → 7.4.1-c116567e.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.
Files changed (207) hide show
  1. package/dist/@types/core/events.d.ts +3 -0
  2. package/dist/@types/core/events.d.ts.map +1 -1
  3. package/dist/@types/core/model.d.ts +3 -1
  4. package/dist/@types/core/model.d.ts.map +1 -1
  5. package/dist/@types/core/payload.d.ts +11 -4
  6. package/dist/@types/core/payload.d.ts.map +1 -1
  7. package/dist/@types/domains/client.d.ts +10 -0
  8. package/dist/@types/domains/client.d.ts.map +1 -1
  9. package/dist/@types/domains/community.d.ts +10 -1
  10. package/dist/@types/domains/community.d.ts.map +1 -1
  11. package/dist/@types/domains/invitation.d.ts +72 -0
  12. package/dist/@types/domains/invitation.d.ts.map +1 -0
  13. package/dist/@types/index.d.ts +2 -0
  14. package/dist/@types/index.d.ts.map +1 -1
  15. package/dist/communityRepository/api/createCommunity.d.ts +2 -2
  16. package/dist/communityRepository/api/createCommunity.d.ts.map +1 -1
  17. package/dist/communityRepository/api/getCommunities.d.ts +1 -1
  18. package/dist/communityRepository/api/getCommunities.d.ts.map +1 -1
  19. package/dist/communityRepository/api/getCommunity.d.ts.map +1 -1
  20. package/dist/communityRepository/api/getRecommendedCommunities.d.ts +3 -1
  21. package/dist/communityRepository/api/getRecommendedCommunities.d.ts.map +1 -1
  22. package/dist/communityRepository/api/getTrendingCommunities.d.ts +3 -1
  23. package/dist/communityRepository/api/getTrendingCommunities.d.ts.map +1 -1
  24. package/dist/communityRepository/api/queryCommunities.d.ts.map +1 -1
  25. package/dist/communityRepository/api/updateCommunity.d.ts +2 -2
  26. package/dist/communityRepository/api/updateCommunity.d.ts.map +1 -1
  27. package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts +1 -1
  28. package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts.map +1 -1
  29. package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts +1 -1
  30. package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts.map +1 -1
  31. package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts +1 -1
  32. package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts.map +1 -1
  33. package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts +1 -1
  34. package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts.map +1 -1
  35. package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts +1 -1
  36. package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts.map +1 -1
  37. package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts +1 -1
  38. package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts.map +1 -1
  39. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts +1 -1
  40. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts.map +1 -1
  41. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts +1 -1
  42. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts.map +1 -1
  43. package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts +1 -1
  44. package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts.map +1 -1
  45. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts +1 -1
  46. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts.map +1 -1
  47. package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts +1 -1
  48. package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts.map +1 -1
  49. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts +1 -1
  50. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts.map +1 -1
  51. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts +1 -1
  52. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts.map +1 -1
  53. package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts +1 -1
  54. package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts.map +1 -1
  55. package/dist/communityRepository/communityMembership/events/utils.d.ts +2 -2
  56. package/dist/communityRepository/communityMembership/events/utils.d.ts.map +1 -1
  57. package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts +2 -2
  58. package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts.map +1 -1
  59. package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts +2 -2
  60. package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts.map +1 -1
  61. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts +1 -1
  62. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts.map +1 -1
  63. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts +1 -1
  64. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts.map +1 -1
  65. package/dist/communityRepository/events/onCommunityCreated.d.ts +1 -1
  66. package/dist/communityRepository/events/onCommunityCreated.d.ts.map +1 -1
  67. package/dist/communityRepository/events/onCommunityDeleted.d.ts +1 -1
  68. package/dist/communityRepository/events/onCommunityDeleted.d.ts.map +1 -1
  69. package/dist/communityRepository/events/onCommunityUpdated.d.ts +1 -1
  70. package/dist/communityRepository/events/onCommunityUpdated.d.ts.map +1 -1
  71. package/dist/communityRepository/events/utils.d.ts +1 -1
  72. package/dist/communityRepository/events/utils.d.ts.map +1 -1
  73. package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts +2 -2
  74. package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts.map +1 -1
  75. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts +2 -2
  76. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts.map +1 -1
  77. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts +2 -2
  78. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts.map +1 -1
  79. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts +2 -2
  80. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts.map +1 -1
  81. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts +2 -2
  82. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts.map +1 -1
  83. package/dist/communityRepository/utils/communityWithMembership.d.ts +1 -1
  84. package/dist/communityRepository/utils/communityWithMembership.d.ts.map +1 -1
  85. package/dist/communityRepository/utils/payload.d.ts +1 -1
  86. package/dist/communityRepository/utils/payload.d.ts.map +1 -1
  87. package/dist/core/events.d.ts +3 -3
  88. package/dist/core/events.d.ts.map +1 -1
  89. package/dist/core/model/idResolvers.d.ts.map +1 -1
  90. package/dist/core/model/index.d.ts.map +1 -1
  91. package/dist/index.cjs.js +2935 -2421
  92. package/dist/index.d.ts +1 -0
  93. package/dist/index.d.ts.map +1 -1
  94. package/dist/index.esm.js +2283 -1770
  95. package/dist/index.umd.js +4 -4
  96. package/dist/invitationRepository/events/index.d.ts +4 -0
  97. package/dist/invitationRepository/events/index.d.ts.map +1 -0
  98. package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts +17 -0
  99. package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts.map +1 -0
  100. package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts +17 -0
  101. package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts.map +1 -0
  102. package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts +17 -0
  103. package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts.map +1 -0
  104. package/dist/invitationRepository/index.d.ts +2 -0
  105. package/dist/invitationRepository/index.d.ts.map +1 -0
  106. package/dist/invitationRepository/internalApi/acceptInvitation.d.ts +16 -0
  107. package/dist/invitationRepository/internalApi/acceptInvitation.d.ts.map +1 -0
  108. package/dist/invitationRepository/internalApi/cancelInvitation.d.ts +16 -0
  109. package/dist/invitationRepository/internalApi/cancelInvitation.d.ts.map +1 -0
  110. package/dist/invitationRepository/internalApi/createInvitations.d.ts +21 -0
  111. package/dist/invitationRepository/internalApi/createInvitations.d.ts.map +1 -0
  112. package/dist/invitationRepository/internalApi/index.d.ts +5 -0
  113. package/dist/invitationRepository/internalApi/index.d.ts.map +1 -0
  114. package/dist/invitationRepository/internalApi/rejectInvitation.d.ts +16 -0
  115. package/dist/invitationRepository/internalApi/rejectInvitation.d.ts.map +1 -0
  116. package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts +14 -0
  117. package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts.map +1 -0
  118. package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts +5 -0
  119. package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts.map +1 -0
  120. package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts +15 -0
  121. package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts.map +1 -0
  122. package/dist/invitationRepository/observers/getInvitations/enums.d.ts +6 -0
  123. package/dist/invitationRepository/observers/getInvitations/enums.d.ts.map +1 -0
  124. package/dist/invitationRepository/observers/getInvitations.d.ts +12 -0
  125. package/dist/invitationRepository/observers/getInvitations.d.ts.map +1 -0
  126. package/dist/invitationRepository/utils/index.d.ts +2 -0
  127. package/dist/invitationRepository/utils/index.d.ts.map +1 -0
  128. package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts +2 -0
  129. package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts.map +1 -0
  130. package/dist/utils/linkedObject/communityLinkedObject.d.ts +2 -0
  131. package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -0
  132. package/dist/utils/linkedObject/index.d.ts +2 -0
  133. package/dist/utils/linkedObject/index.d.ts.map +1 -1
  134. package/dist/utils/linkedObject/invitationLinkedObject.d.ts +2 -0
  135. package/dist/utils/linkedObject/invitationLinkedObject.d.ts.map +1 -0
  136. package/dist/utils/tests/dummy/post.d.ts +3 -3
  137. package/package.json +1 -1
  138. package/src/@types/core/events.ts +4 -0
  139. package/src/@types/core/model.ts +5 -1
  140. package/src/@types/core/payload.ts +13 -4
  141. package/src/@types/domains/client.ts +12 -0
  142. package/src/@types/domains/community.ts +18 -1
  143. package/src/@types/domains/invitation.ts +92 -0
  144. package/src/@types/index.ts +2 -0
  145. package/src/communityRepository/api/createCommunity.ts +5 -2
  146. package/src/communityRepository/api/getCommunities.ts +7 -2
  147. package/src/communityRepository/api/getCommunity.ts +4 -1
  148. package/src/communityRepository/api/getRecommendedCommunities.ts +11 -4
  149. package/src/communityRepository/api/getTrendingCommunities.ts +11 -4
  150. package/src/communityRepository/api/queryCommunities.ts +6 -1
  151. package/src/communityRepository/api/updateCommunity.ts +13 -3
  152. package/src/communityRepository/communityMembership/events/onCommunityJoined.ts +1 -1
  153. package/src/communityRepository/communityMembership/events/onCommunityLeft.ts +1 -1
  154. package/src/communityRepository/communityMembership/events/onCommunityUserAdded.ts +1 -1
  155. package/src/communityRepository/communityMembership/events/onCommunityUserBanned.ts +1 -1
  156. package/src/communityRepository/communityMembership/events/onCommunityUserChanged.ts +1 -1
  157. package/src/communityRepository/communityMembership/events/onCommunityUserRemoved.ts +1 -1
  158. package/src/communityRepository/communityMembership/events/onCommunityUserRoleAdded.ts +1 -1
  159. package/src/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.ts +1 -1
  160. package/src/communityRepository/communityMembership/events/onCommunityUserUnbanned.ts +1 -1
  161. package/src/communityRepository/communityMembership/events/onLocalCommunityJoined.ts +1 -1
  162. package/src/communityRepository/communityMembership/events/onLocalCommunityLeft.ts +1 -1
  163. package/src/communityRepository/communityMembership/events/onLocalCommunityUserAdded.ts +1 -1
  164. package/src/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.ts +1 -1
  165. package/src/communityRepository/communityMembership/events/onUserDeleted.ts +3 -1
  166. package/src/communityRepository/communityMembership/events/utils.ts +2 -2
  167. package/src/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.ts +8 -2
  168. package/src/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.ts +8 -2
  169. package/src/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.ts +1 -1
  170. package/src/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.ts +1 -1
  171. package/src/communityRepository/events/onCommunityCreated.ts +1 -1
  172. package/src/communityRepository/events/onCommunityDeleted.ts +1 -1
  173. package/src/communityRepository/events/onCommunityUpdated.ts +1 -1
  174. package/src/communityRepository/events/utils.ts +1 -1
  175. package/src/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.ts +2 -2
  176. package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.ts +2 -2
  177. package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.ts +2 -2
  178. package/src/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.ts +2 -2
  179. package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.ts +2 -2
  180. package/src/communityRepository/utils/communityWithMembership.ts +8 -4
  181. package/src/communityRepository/utils/payload.ts +1 -1
  182. package/src/core/liveCollection/PaginationController.ts +1 -1
  183. package/src/core/liveCollection/PaginationNoPageController.ts +1 -1
  184. package/src/core/model/idResolvers.ts +2 -0
  185. package/src/core/model/index.ts +2 -0
  186. package/src/index.ts +2 -0
  187. package/src/invitationRepository/events/index.ts +3 -0
  188. package/src/invitationRepository/events/onLocalInvitationCreated.ts +33 -0
  189. package/src/invitationRepository/events/onLocalInvitationDeleted.ts +33 -0
  190. package/src/invitationRepository/events/onLocalInvitationUpdated.ts +33 -0
  191. package/src/invitationRepository/index.ts +1 -0
  192. package/src/invitationRepository/internalApi/acceptInvitation.ts +45 -0
  193. package/src/invitationRepository/internalApi/cancelInvitation.ts +44 -0
  194. package/src/invitationRepository/internalApi/createInvitations.ts +52 -0
  195. package/src/invitationRepository/internalApi/index.ts +4 -0
  196. package/src/invitationRepository/internalApi/rejectInvitation.ts +45 -0
  197. package/src/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.ts +148 -0
  198. package/src/invitationRepository/observers/getInvitations/InvitationsPaginationController.ts +19 -0
  199. package/src/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.ts +97 -0
  200. package/src/invitationRepository/observers/getInvitations/enums.ts +5 -0
  201. package/src/invitationRepository/observers/getInvitations.ts +44 -0
  202. package/src/invitationRepository/utils/index.ts +1 -0
  203. package/src/invitationRepository/utils/prepareInvitationPayload.ts +11 -0
  204. package/src/messagePreview/utils/getChannelMessagePreviewWithUser.ts +3 -3
  205. package/src/utils/linkedObject/communityLinkedObject.ts +29 -0
  206. package/src/utils/linkedObject/index.ts +4 -0
  207. package/src/utils/linkedObject/invitationLinkedObject.ts +44 -0
@@ -1,3 +1,4 @@
1
+ import { LinkedObject } from '~/utils/linkedObject';
1
2
  import { getActiveClient } from '~/client/api';
2
3
 
3
4
  import { ingestInCache } from '~/cache/api/ingestInCache';
@@ -11,7 +12,7 @@ import { prepareCommunityPayload, prepareCommunityRequest } from '../utils';
11
12
  /**
12
13
  * ```js
13
14
  * import { createCommunity } from '@amityco/ts-sdk'
14
- * const created = await createCommunity({ communityId: 'foobar', displayName: 'foobar' })
15
+ * const created = await createCommunity({ communityId: 'foobar', displayName: 'foobar', isDiscoverable: true, requiresJoinApproval: false })
15
16
  * ```
16
17
  *
17
18
  * Creates an {@link Amity.Community}
@@ -33,6 +34,8 @@ export const createCommunity = async (
33
34
  | 'postSetting'
34
35
  | 'tags'
35
36
  | 'metadata'
37
+ | 'isDiscoverable'
38
+ | 'requiresJoinApproval'
36
39
  > &
37
40
  Amity.CommunityStorySettings & {
38
41
  userIds?: string[];
@@ -60,7 +63,7 @@ export const createCommunity = async (
60
63
 
61
64
  const { communities } = data;
62
65
  return {
63
- data: communities[0],
66
+ data: LinkedObject.community(communities[0]),
64
67
  cachedAt,
65
68
  };
66
69
  };
@@ -5,6 +5,7 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
5
5
 
6
6
  import { saveCommunityUsers } from '~/communityRepository/utils/saveCommunityUsers';
7
7
  import { prepareCommunityPayload } from '../utils';
8
+ import { LinkedObject } from '~/utils/linkedObject';
8
9
 
9
10
  /**
10
11
  * ```js
@@ -22,6 +23,7 @@ import { prepareCommunityPayload } from '../utils';
22
23
  */
23
24
  export const getCommunities = async (
24
25
  communityIds: Amity.Community['communityId'][],
26
+ includeDiscoverablePrivateCommunity?: boolean,
25
27
  ): Promise<Amity.Cached<Amity.Community[]>> => {
26
28
  const client = getActiveClient();
27
29
  client.log('community/getCommunities', communityIds);
@@ -30,7 +32,10 @@ export const getCommunities = async (
30
32
  const { data: payload } = await client.http.get<Amity.CommunityPayload>(
31
33
  `/api/v3/communities/list`,
32
34
  {
33
- params: { communityIds },
35
+ params: {
36
+ communityIds,
37
+ includeDiscoverablePrivateCommunity: includeDiscoverablePrivateCommunity ?? true,
38
+ },
34
39
  },
35
40
  );
36
41
 
@@ -43,7 +48,7 @@ export const getCommunities = async (
43
48
  }
44
49
 
45
50
  return {
46
- data: data.communities,
51
+ data: data.communities.map(community => LinkedObject.community(community)),
47
52
  cachedAt,
48
53
  };
49
54
  };
@@ -5,6 +5,7 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
5
5
 
6
6
  import { saveCommunityUsers } from '~/communityRepository/utils/saveCommunityUsers';
7
7
  import { prepareCommunityPayload } from '../utils';
8
+ import { LinkedObject } from '~/utils/linkedObject';
8
9
 
9
10
  /**
10
11
  * ```js
@@ -42,7 +43,9 @@ export const getCommunity = async (
42
43
  const { communities } = data;
43
44
 
44
45
  return {
45
- data: communities.find(community => community.communityId === communityId)!,
46
+ data: LinkedObject.community(
47
+ communities.find(community => community.communityId === communityId)!,
48
+ ),
46
49
  cachedAt,
47
50
  };
48
51
  };
@@ -4,6 +4,7 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
4
4
 
5
5
  import { prepareCommunityPayload } from '../utils';
6
6
  import { COLLECTION_DEFAULT_PAGINATION_LIMIT } from '~/utils/constants';
7
+ import { LinkedObject } from '~/utils/linkedObject';
7
8
 
8
9
  /* begin_public_function
9
10
  id: community.query.recommended_communities
@@ -24,18 +25,24 @@ import { COLLECTION_DEFAULT_PAGINATION_LIMIT } from '~/utils/constants';
24
25
  * @private
25
26
  */
26
27
  export const getRecommendedCommunities = async (
27
- query?: Amity.PageLimit,
28
+ query?: Amity.PageLimit & { includeDiscoverablePrivateCommunity?: boolean },
28
29
  ): Promise<Amity.Cached<Amity.Community[]>> => {
29
30
  const client = getActiveClient();
30
31
  client.log('community/getRecommendedCommunities', query);
31
32
 
32
- const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT } = query ?? {};
33
+ const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, includeDiscoverablePrivateCommunity } =
34
+ query ?? {};
33
35
 
34
36
  // API-FIX: backend doesnt answer Amity.Response
35
37
  // const { data: payload } = await client.http.get<Amity.Response<CommunityPayload>>(
36
38
  const { data: payload } = await client.http.get<Amity.CommunityPayload>(
37
39
  `/api/v3/communities/recommended`,
38
- { params: { options: { limit } } },
40
+ {
41
+ params: {
42
+ includeDiscoverablePrivateCommunity: includeDiscoverablePrivateCommunity ?? true,
43
+ options: { limit },
44
+ },
45
+ },
39
46
  );
40
47
 
41
48
  const data = prepareCommunityPayload(payload);
@@ -47,5 +54,5 @@ export const getRecommendedCommunities = async (
47
54
  ingestInCache(data, { cachedAt });
48
55
  }
49
56
 
50
- return { data: communities, cachedAt };
57
+ return { data: communities.map(community => LinkedObject.community(community)), cachedAt };
51
58
  };
@@ -4,6 +4,7 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
4
4
 
5
5
  import { prepareCommunityPayload } from '../utils';
6
6
  import { COLLECTION_DEFAULT_PAGINATION_LIMIT } from '~/utils/constants';
7
+ import { LinkedObject } from '~/utils/linkedObject';
7
8
 
8
9
  /**
9
10
  * ```js
@@ -21,18 +22,24 @@ import { COLLECTION_DEFAULT_PAGINATION_LIMIT } from '~/utils/constants';
21
22
  * @private
22
23
  */
23
24
  export const getTrendingCommunities = async (
24
- query?: Amity.PageLimit,
25
+ query?: Amity.PageLimit & { includeDiscoverablePrivateCommunity?: boolean },
25
26
  ): Promise<Amity.Cached<Amity.Community[]>> => {
26
27
  const client = getActiveClient();
27
28
  client.log('community/getTrendingCommunities', query);
28
29
 
29
- const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT } = query ?? {};
30
+ const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT, includeDiscoverablePrivateCommunity } =
31
+ query ?? {};
30
32
 
31
33
  // API-FIX: backend doesnt answer Amity.Response
32
34
  // const { data } = await client.http.get<Amity.Response<CommunityPayload>>(
33
35
  const { data: payload } = await client.http.get<Amity.CommunityPayload>(
34
36
  `/api/v3/communities/top-trending`,
35
- { params: { options: { limit } } },
37
+ {
38
+ params: {
39
+ includeDiscoverablePrivateCommunity: includeDiscoverablePrivateCommunity ?? true,
40
+ options: { limit },
41
+ },
42
+ },
36
43
  );
37
44
 
38
45
  const data = prepareCommunityPayload(payload);
@@ -44,5 +51,5 @@ export const getTrendingCommunities = async (
44
51
  ingestInCache(data, { cachedAt });
45
52
  }
46
53
 
47
- return { data: communities, cachedAt };
54
+ return { data: communities.map(community => LinkedObject.community(community)), cachedAt };
48
55
  };
@@ -6,6 +6,7 @@ import { getResolver } from '~/core/model';
6
6
  import { inferIsDeleted } from '~/utils/inferIsDeleted';
7
7
  import { saveCommunityUsers } from '~/communityRepository/utils/saveCommunityUsers';
8
8
  import { prepareCommunityPayload } from '../utils';
9
+ import { LinkedObject } from '~/utils/linkedObject';
9
10
 
10
11
  /**
11
12
  * ```js
@@ -68,5 +69,9 @@ export const queryCommunities = async (
68
69
  saveCommunityUsers(data.communities, data.communityUsers);
69
70
  }
70
71
 
71
- return { data: communities, cachedAt, paging };
72
+ return {
73
+ data: communities.map(community => LinkedObject.community(community)),
74
+ cachedAt,
75
+ paging,
76
+ };
72
77
  };
@@ -5,6 +5,7 @@ import { fireEvent } from '~/core/events';
5
5
 
6
6
  import { saveCommunityUsers } from '~/communityRepository/utils/saveCommunityUsers';
7
7
  import { prepareCommunityPayload, prepareCommunityRequest } from '../utils';
8
+ import { LinkedObject } from '~/utils/linkedObject';
8
9
 
9
10
  /* begin_public_function
10
11
  id: community.update
@@ -12,7 +13,7 @@ import { prepareCommunityPayload, prepareCommunityRequest } from '../utils';
12
13
  /**
13
14
  * ```js
14
15
  * import { updateCommunity } from '@amityco/ts-sdk'
15
- * const updated = await updateCommunity(communityId, { displayName: 'foobar' })
16
+ * const updated = await updateCommunity(communityId, { displayName: 'foobar', isDiscoverable: true, requiresJoinApproval: false })
16
17
  * ```
17
18
  *
18
19
  * Updates an {@link Amity.Community}
@@ -28,7 +29,14 @@ export const updateCommunity = async (
28
29
  communityId: Amity.Community['communityId'],
29
30
  patch: Patch<
30
31
  Amity.Community,
31
- 'displayName' | 'avatarFileId' | 'description' | 'postSetting' | 'tags' | 'metadata'
32
+ | 'displayName'
33
+ | 'avatarFileId'
34
+ | 'description'
35
+ | 'postSetting'
36
+ | 'tags'
37
+ | 'metadata'
38
+ | 'isDiscoverable'
39
+ | 'requiresJoinApproval'
32
40
  > &
33
41
  Amity.CommunityStorySettings,
34
42
  ): Promise<Amity.Cached<Amity.Community>> => {
@@ -53,7 +61,9 @@ export const updateCommunity = async (
53
61
  const { communities } = data;
54
62
 
55
63
  return {
56
- data: communities.find(community => community.communityId === communityId)!,
64
+ data: LinkedObject.community(
65
+ communities.find(community => community.communityId === communityId)!,
66
+ ),
57
67
  cachedAt,
58
68
  };
59
69
  };
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onCommunityJoined = (
19
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
20
  ) => createCommunityMemberEventSubscriber('community.joined', callback);
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onCommunityLeft = (
19
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
20
  ) => createCommunityMemberEventSubscriber('community.left', callback);
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onCommunityUserAdded = (
19
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
20
  ) => createCommunityMemberEventSubscriber('community.userAdded', callback);
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onCommunityUserBanned = (
19
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
20
  ) => createCommunityMemberEventSubscriber('community.userBanned', callback);
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onCommunityUserChanged = (
19
- callback: (community: Amity.Community, members: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.InternalCommunity, members: Amity.Membership<'community'>[]) => void,
20
20
  ) => createCommunityMemberEventSubscriber('community.userChanged', callback);
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onCommunityUserRemoved = (
19
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
20
  ) => createCommunityMemberEventSubscriber('community.userRemoved', callback);
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onCommunityUserRoleAdded = (
19
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
20
  ) => createCommunityMemberEventSubscriber('community.roleAdded', callback);
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onCommunityUserRoleRemoved = (
19
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
20
  ) => createCommunityMemberEventSubscriber('community.roleRemoved', callback);
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onCommunityUserUnbanned = (
19
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
20
  ) => createCommunityMemberEventSubscriber('community.userUnbanned', callback);
@@ -1,5 +1,5 @@
1
1
  import { createLocalCommunityMemberEventSubscriber } from './utils';
2
2
 
3
3
  export const onLocalCommunityJoined = (
4
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
4
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
5
5
  ) => createLocalCommunityMemberEventSubscriber('local.community.joined', callback);
@@ -1,5 +1,5 @@
1
1
  import { createLocalCommunityMemberEventSubscriber } from './utils';
2
2
 
3
3
  export const onLocalCommunityLeft = (
4
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
4
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
5
5
  ) => createLocalCommunityMemberEventSubscriber('local.community.left', callback);
@@ -16,5 +16,5 @@ import { createLocalCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onLocalCommunityUserAdded = (
19
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
20
  ) => createLocalCommunityMemberEventSubscriber('local.community.userAdded', callback);
@@ -16,5 +16,5 @@ import { createLocalCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onLocalCommunityUserRemoved = (
19
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
20
  ) => createLocalCommunityMemberEventSubscriber('local.community.userRemoved', callback);
@@ -22,7 +22,9 @@ import { getResolver } from '~/core/model';
22
22
  */
23
23
  export const onUserDeleted =
24
24
  (communityId: string) =>
25
- (callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void) => {
25
+ (
26
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
27
+ ) => {
26
28
  const client = getActiveClient();
27
29
 
28
30
  const filter = (payload: Amity.UserPayload) => {
@@ -53,7 +53,7 @@ function getEventRelatedMember(
53
53
 
54
54
  export const createCommunityMemberEventSubscriber = (
55
55
  event: keyof Amity.MqttCommunityUserEvents,
56
- callback: (community: Amity.Community, members: Amity.Membership<'community'>[]) => void,
56
+ callback: (community: Amity.InternalCommunity, members: Amity.Membership<'community'>[]) => void,
57
57
  ) => {
58
58
  const client = getActiveClient();
59
59
 
@@ -102,7 +102,7 @@ export const createCommunityMemberEventSubscriber = (
102
102
 
103
103
  export const createLocalCommunityMemberEventSubscriber = (
104
104
  event: keyof Amity.LocalCommunityEvents,
105
- callback: (community: Amity.Community, members: Amity.Membership<'community'>[]) => void,
105
+ callback: (community: Amity.InternalCommunity, members: Amity.Membership<'community'>[]) => void,
106
106
  ) => {
107
107
  const client = getActiveClient();
108
108
 
@@ -70,7 +70,10 @@ export class CommunityMembersQueryStreamController extends QueryStreamController
70
70
  }
71
71
 
72
72
  reactor(action: EnumCommunityMemberActions) {
73
- return (community: Amity.Community, communityMembers: Amity.Membership<'community'>[]) => {
73
+ return (
74
+ community: Amity.InternalCommunity,
75
+ communityMembers: Amity.Membership<'community'>[],
76
+ ) => {
74
77
  const collection = pullFromCache<Amity.CommunityMemberLiveCollectionCache>(
75
78
  this.cacheKey,
76
79
  )?.data;
@@ -97,7 +100,10 @@ export class CommunityMembersQueryStreamController extends QueryStreamController
97
100
  subscribeRTE(
98
101
  createSubscriber: {
99
102
  fn: (
100
- reactor: (channel: Amity.Community, communityUser: Amity.Membership<'community'>[]) => void,
103
+ reactor: (
104
+ channel: Amity.InternalCommunity,
105
+ communityUser: Amity.Membership<'community'>[],
106
+ ) => void,
101
107
  ) => Amity.Unsubscriber;
102
108
  action: EnumCommunityMemberActions;
103
109
  }[],
@@ -70,7 +70,10 @@ export class SearchCommunityMembersQueryStreamController extends QueryStreamCont
70
70
  }
71
71
 
72
72
  reactor(action: EnumCommunityMemberActions) {
73
- return (community: Amity.Community, communityMembers: Amity.Membership<'community'>[]) => {
73
+ return (
74
+ community: Amity.InternalCommunity,
75
+ communityMembers: Amity.Membership<'community'>[],
76
+ ) => {
74
77
  const collection = pullFromCache<Amity.SearchCommunityMemberLiveCollectionCache>(
75
78
  this.cacheKey,
76
79
  )?.data;
@@ -95,7 +98,10 @@ export class SearchCommunityMembersQueryStreamController extends QueryStreamCont
95
98
  subscribeRTE(
96
99
  createSubscriber: {
97
100
  fn: (
98
- reactor: (channel: Amity.Community, communityUser: Amity.Membership<'community'>[]) => void,
101
+ reactor: (
102
+ channel: Amity.InternalCommunity,
103
+ communityUser: Amity.Membership<'community'>[],
104
+ ) => void,
99
105
  ) => Amity.Unsubscriber;
100
106
  action: EnumCommunityMemberActions;
101
107
  }[],
@@ -17,7 +17,7 @@ import { createEventSubscriber } from '~/core/events';
17
17
  * @category Community Events
18
18
  */
19
19
  export const onLocalCommunityRoleAdded = (
20
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
20
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
21
21
  ): Amity.Unsubscriber => {
22
22
  const client = getActiveClient();
23
23
 
@@ -17,7 +17,7 @@ import { createEventSubscriber } from '~/core/events';
17
17
  * @category Community Events
18
18
  */
19
19
  export const onLocalCommunityRoleRemoved = (
20
- callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
20
+ callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
21
21
  ): Amity.Unsubscriber => {
22
22
  const client = getActiveClient();
23
23
 
@@ -15,5 +15,5 @@ import { createCommunityEventSubscriber } from './utils';
15
15
  *
16
16
  * @category Community Events
17
17
  */
18
- export const onCommunityCreated = (callback: Amity.Listener<Amity.Community>) =>
18
+ export const onCommunityCreated = (callback: Amity.Listener<Amity.InternalCommunity>) =>
19
19
  createCommunityEventSubscriber('community.created', callback);
@@ -15,5 +15,5 @@ import { createCommunityEventSubscriber } from './utils';
15
15
  *
16
16
  * @category Community Events
17
17
  */
18
- export const onCommunityDeleted = (callback: Amity.Listener<Amity.Community>) =>
18
+ export const onCommunityDeleted = (callback: Amity.Listener<Amity.InternalCommunity>) =>
19
19
  createCommunityEventSubscriber('community.deleted', callback);
@@ -15,5 +15,5 @@ import { createCommunityEventSubscriber } from './utils';
15
15
  *
16
16
  * @category Community Events
17
17
  */
18
- export const onCommunityUpdated = (callback: Amity.Listener<Amity.Community>) =>
18
+ export const onCommunityUpdated = (callback: Amity.Listener<Amity.InternalCommunity>) =>
19
19
  createCommunityEventSubscriber('community.updated', callback);
@@ -7,7 +7,7 @@ import { prepareCommunityPayload } from '../utils';
7
7
 
8
8
  export const createCommunityEventSubscriber = (
9
9
  event: keyof Amity.MqttCommunityEvents,
10
- callback: Amity.Listener<Amity.Community>,
10
+ callback: Amity.Listener<Amity.InternalCommunity>,
11
11
  ) => {
12
12
  const client = getActiveClient();
13
13
 
@@ -60,7 +60,7 @@ export class CommunitiesQueryStreamController extends QueryStreamController<
60
60
  }
61
61
 
62
62
  reactor(action: EnumCommunityActions | EnumCommunityMemberActions) {
63
- return (community: Amity.Community) => {
63
+ return (community: Amity.InternalCommunity) => {
64
64
  const collection = pullFromCache<Amity.CommunityLiveCollectionCache>(this.cacheKey)?.data;
65
65
  if (!collection) return;
66
66
 
@@ -76,7 +76,7 @@ export class CommunitiesQueryStreamController extends QueryStreamController<
76
76
 
77
77
  subscribeRTE(
78
78
  createSubscriber: {
79
- fn: (reactor: (channel: Amity.Community) => void) => Amity.Unsubscriber;
79
+ fn: (reactor: (channel: Amity.InternalCommunity) => void) => Amity.Unsubscriber;
80
80
  action: EnumCommunityActions | EnumCommunityMemberActions;
81
81
  }[],
82
82
  ) {
@@ -66,7 +66,7 @@ export class RecommendedCommunitiesQueryStreamController extends QueryStreamCont
66
66
  }
67
67
 
68
68
  reactor(action: EnumCommunityActions | EnumCommunityMemberActions) {
69
- return (community: Amity.Community) => {
69
+ return (community: Amity.InternalCommunity) => {
70
70
  const collection = pullFromCache<Amity.RecommendedCommunityLiveCollectionCache>(
71
71
  this.cacheKey,
72
72
  )?.data;
@@ -79,7 +79,7 @@ export class RecommendedCommunitiesQueryStreamController extends QueryStreamCont
79
79
 
80
80
  subscribeRTE(
81
81
  createSubscriber: {
82
- fn: (reactor: (channel: Amity.Community) => void) => Amity.Unsubscriber;
82
+ fn: (reactor: (channel: Amity.InternalCommunity) => void) => Amity.Unsubscriber;
83
83
  action: EnumCommunityActions | EnumCommunityMemberActions;
84
84
  }[],
85
85
  ) {
@@ -64,7 +64,7 @@ export class TrendingCommunitiesQueryStreamController extends QueryStreamControl
64
64
  }
65
65
 
66
66
  reactor(action: EnumCommunityActions | EnumCommunityMemberActions) {
67
- return (community: Amity.Community) => {
67
+ return (community: Amity.InternalCommunity) => {
68
68
  const collection = pullFromCache<Amity.TrendingCommunityLiveCollectionCache>(
69
69
  this.cacheKey,
70
70
  )?.data;
@@ -77,7 +77,7 @@ export class TrendingCommunitiesQueryStreamController extends QueryStreamControl
77
77
 
78
78
  subscribeRTE(
79
79
  createSubscriber: {
80
- fn: (reactor: (channel: Amity.Community) => void) => Amity.Unsubscriber;
80
+ fn: (reactor: (channel: Amity.InternalCommunity) => void) => Amity.Unsubscriber;
81
81
  action: EnumCommunityActions | EnumCommunityMemberActions;
82
82
  }[],
83
83
  ) {
@@ -60,7 +60,7 @@ export class CommunitiesQueryStreamController extends QueryStreamController<
60
60
  }
61
61
 
62
62
  reactor(action: EnumCommunityActions | EnumCommunityMemberActions) {
63
- return (community: Amity.Community) => {
63
+ return (community: Amity.InternalCommunity) => {
64
64
  const collection = pullFromCache<Amity.SearchCommunityLiveCollectionCache>(
65
65
  this.cacheKey,
66
66
  )?.data;
@@ -73,7 +73,7 @@ export class CommunitiesQueryStreamController extends QueryStreamController<
73
73
 
74
74
  subscribeRTE(
75
75
  createSubscriber: {
76
- fn: (reactor: (channel: Amity.Community) => void) => Amity.Unsubscriber;
76
+ fn: (reactor: (channel: Amity.InternalCommunity) => void) => Amity.Unsubscriber;
77
77
  action: EnumCommunityActions | EnumCommunityMemberActions;
78
78
  }[],
79
79
  ) {
@@ -63,7 +63,7 @@ export class SemanticSearchCommunityQueryStreamController extends QueryStreamCon
63
63
  }
64
64
 
65
65
  reactor(action: EnumCommunityActions | EnumCommunityMemberActions) {
66
- return (community: Amity.Community) => {
66
+ return (community: Amity.InternalCommunity) => {
67
67
  const collection = pullFromCache<Amity.CommunityLiveCollectionCache>(this.cacheKey)?.data;
68
68
  if (!collection) return;
69
69
 
@@ -77,7 +77,7 @@ export class SemanticSearchCommunityQueryStreamController extends QueryStreamCon
77
77
 
78
78
  subscribeRTE(
79
79
  createSubscriber: {
80
- fn: (reactor: (community: Amity.Community) => void) => Amity.Unsubscriber;
80
+ fn: (reactor: (community: Amity.InternalCommunity) => void) => Amity.Unsubscriber;
81
81
  action: EnumCommunityActions | EnumCommunityMemberActions;
82
82
  }[],
83
83
  ) {
@@ -12,7 +12,7 @@ function isMember(membership: Amity.Membership<'community'>['communityMembership
12
12
  * checks if currently logged in user is part of the community
13
13
  */
14
14
  function isCurrentUserPartOfCommunity(
15
- c: Amity.Community,
15
+ c: Amity.InternalCommunity,
16
16
  m: Amity.Membership<'community'>,
17
17
  ): boolean {
18
18
  const { userId } = getActiveUser();
@@ -28,11 +28,15 @@ function isCurrentUserPartOfCommunity(
28
28
  * Althought this can be calculated, it's not scalable.
29
29
  */
30
30
  export function updateMembershipStatus(
31
- communities: Amity.Community[],
31
+ communities: Amity.RawCommunity[],
32
32
  communityUsers: Amity.Membership<'community'>[],
33
- ): Amity.Community[] {
33
+ ): Amity.InternalCommunity[] {
34
34
  return communities.map(c => {
35
- const cachedCommunity = pullFromCache<Amity.Community>(['community', 'get', c.communityId]);
35
+ const cachedCommunity = pullFromCache<Amity.InternalCommunity>([
36
+ 'community',
37
+ 'get',
38
+ c.communityId,
39
+ ]);
36
40
  if (cachedCommunity?.data && cachedCommunity?.data.hasOwnProperty('isJoined')) {
37
41
  return {
38
42
  ...cachedCommunity.data,
@@ -13,7 +13,7 @@ const getMatchPostSetting = (value: {
13
13
  ) ?? DefaultCommunityPostSetting;
14
14
 
15
15
  export function addPostSetting({ communities }: { communities: Amity.RawCommunity[] }) {
16
- return communities.map<Amity.Community>(
16
+ return communities.map<Amity.InternalCommunity>(
17
17
  ({ needApprovalOnPostCreation, onlyAdminCanPost, ...restCommunityPayload }) => ({
18
18
  postSetting: getMatchPostSetting({
19
19
  needApprovalOnPostCreation,
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { getActiveClient } from '~/client/api';
2
+ import { getActiveClient } from '~/client/api/activeClient';
3
3
 
4
4
  export abstract class PaginationController<
5
5
  TPayloadDomain extends keyof Amity.Payloads,
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from 'axios';
2
- import { getActiveClient } from '~/client/api';
2
+ import { getActiveClient } from '~/client/api/activeClient';
3
3
 
4
4
  export abstract class PaginationNoPageController<
5
5
  TPayloadDomain extends keyof Amity.Payloads,
@@ -64,6 +64,8 @@ const idResolvers: Resolvers = {
64
64
 
65
65
  notificationTrayItem: ({ _id }) => _id,
66
66
  notificationTraySeen: ({ userId }) => userId,
67
+
68
+ invitation: ({ _id }) => _id,
67
69
  };
68
70
 
69
71
  /**