@amityco/ts-sdk 7.4.1-d23fab2f.0 → 7.5.1-1d67f17.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 (179) hide show
  1. package/dist/@types/core/events.d.ts +0 -3
  2. package/dist/@types/core/events.d.ts.map +1 -1
  3. package/dist/@types/core/model.d.ts +1 -3
  4. package/dist/@types/core/model.d.ts.map +1 -1
  5. package/dist/@types/core/payload.d.ts +4 -8
  6. package/dist/@types/core/payload.d.ts.map +1 -1
  7. package/dist/@types/domains/client.d.ts +0 -10
  8. package/dist/@types/domains/client.d.ts.map +1 -1
  9. package/dist/@types/domains/community.d.ts +1 -7
  10. package/dist/@types/domains/community.d.ts.map +1 -1
  11. package/dist/@types/index.d.ts +0 -2
  12. package/dist/@types/index.d.ts.map +1 -1
  13. package/dist/communityRepository/api/createCommunity.d.ts +2 -2
  14. package/dist/communityRepository/api/createCommunity.d.ts.map +1 -1
  15. package/dist/communityRepository/api/getCommunities.d.ts.map +1 -1
  16. package/dist/communityRepository/api/getCommunity.d.ts.map +1 -1
  17. package/dist/communityRepository/api/getRecommendedCommunities.d.ts.map +1 -1
  18. package/dist/communityRepository/api/getTrendingCommunities.d.ts.map +1 -1
  19. package/dist/communityRepository/api/queryCommunities.d.ts.map +1 -1
  20. package/dist/communityRepository/api/updateCommunity.d.ts.map +1 -1
  21. package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts +1 -1
  22. package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts.map +1 -1
  23. package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts +1 -1
  24. package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts.map +1 -1
  25. package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts +1 -1
  26. package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts.map +1 -1
  27. package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts +1 -1
  28. package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts.map +1 -1
  29. package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts +1 -1
  30. package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts.map +1 -1
  31. package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts +1 -1
  32. package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts.map +1 -1
  33. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts +1 -1
  34. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts.map +1 -1
  35. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts +1 -1
  36. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts.map +1 -1
  37. package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts +1 -1
  38. package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts.map +1 -1
  39. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts +1 -1
  40. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts.map +1 -1
  41. package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts +1 -1
  42. package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts.map +1 -1
  43. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts +1 -1
  44. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts.map +1 -1
  45. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts +1 -1
  46. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts.map +1 -1
  47. package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts +1 -1
  48. package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts.map +1 -1
  49. package/dist/communityRepository/communityMembership/events/utils.d.ts +2 -2
  50. package/dist/communityRepository/communityMembership/events/utils.d.ts.map +1 -1
  51. package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts +2 -2
  52. package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts.map +1 -1
  53. package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts +2 -2
  54. package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts.map +1 -1
  55. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts +1 -1
  56. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts.map +1 -1
  57. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts +1 -1
  58. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts.map +1 -1
  59. package/dist/communityRepository/events/onCommunityCreated.d.ts +1 -1
  60. package/dist/communityRepository/events/onCommunityCreated.d.ts.map +1 -1
  61. package/dist/communityRepository/events/onCommunityDeleted.d.ts +1 -1
  62. package/dist/communityRepository/events/onCommunityDeleted.d.ts.map +1 -1
  63. package/dist/communityRepository/events/onCommunityUpdated.d.ts +1 -1
  64. package/dist/communityRepository/events/onCommunityUpdated.d.ts.map +1 -1
  65. package/dist/communityRepository/events/utils.d.ts +1 -1
  66. package/dist/communityRepository/events/utils.d.ts.map +1 -1
  67. package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts +2 -2
  68. package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts.map +1 -1
  69. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts +2 -2
  70. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts.map +1 -1
  71. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts +2 -2
  72. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts.map +1 -1
  73. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts +2 -2
  74. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts.map +1 -1
  75. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts +2 -2
  76. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts.map +1 -1
  77. package/dist/communityRepository/utils/communityWithMembership.d.ts +1 -1
  78. package/dist/communityRepository/utils/communityWithMembership.d.ts.map +1 -1
  79. package/dist/communityRepository/utils/payload.d.ts +1 -1
  80. package/dist/communityRepository/utils/payload.d.ts.map +1 -1
  81. package/dist/core/events.d.ts +3 -3
  82. package/dist/core/events.d.ts.map +1 -1
  83. package/dist/core/model/idResolvers.d.ts.map +1 -1
  84. package/dist/core/model/index.d.ts.map +1 -1
  85. package/dist/index.cjs.js +54 -275
  86. package/dist/index.d.ts +0 -1
  87. package/dist/index.d.ts.map +1 -1
  88. package/dist/index.esm.js +37 -257
  89. package/dist/index.umd.js +4 -4
  90. package/dist/utils/linkedObject/index.d.ts +0 -2
  91. package/dist/utils/linkedObject/index.d.ts.map +1 -1
  92. package/dist/utils/tests/dummy/post.d.ts +3 -3
  93. package/package.json +1 -1
  94. package/src/@types/core/events.ts +0 -4
  95. package/src/@types/core/model.ts +1 -5
  96. package/src/@types/core/payload.ts +4 -9
  97. package/src/@types/domains/client.ts +0 -12
  98. package/src/@types/domains/community.ts +1 -13
  99. package/src/@types/index.ts +0 -2
  100. package/src/communityRepository/api/createCommunity.ts +2 -5
  101. package/src/communityRepository/api/getCommunities.ts +1 -2
  102. package/src/communityRepository/api/getCommunity.ts +1 -4
  103. package/src/communityRepository/api/getRecommendedCommunities.ts +1 -2
  104. package/src/communityRepository/api/getTrendingCommunities.ts +1 -2
  105. package/src/communityRepository/api/queryCommunities.ts +1 -6
  106. package/src/communityRepository/api/updateCommunity.ts +1 -4
  107. package/src/communityRepository/communityMembership/events/onCommunityJoined.ts +1 -1
  108. package/src/communityRepository/communityMembership/events/onCommunityLeft.ts +1 -1
  109. package/src/communityRepository/communityMembership/events/onCommunityUserAdded.ts +1 -1
  110. package/src/communityRepository/communityMembership/events/onCommunityUserBanned.ts +1 -1
  111. package/src/communityRepository/communityMembership/events/onCommunityUserChanged.ts +1 -1
  112. package/src/communityRepository/communityMembership/events/onCommunityUserRemoved.ts +1 -1
  113. package/src/communityRepository/communityMembership/events/onCommunityUserRoleAdded.ts +1 -1
  114. package/src/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.ts +1 -1
  115. package/src/communityRepository/communityMembership/events/onCommunityUserUnbanned.ts +1 -1
  116. package/src/communityRepository/communityMembership/events/onLocalCommunityJoined.ts +1 -1
  117. package/src/communityRepository/communityMembership/events/onLocalCommunityLeft.ts +1 -1
  118. package/src/communityRepository/communityMembership/events/onLocalCommunityUserAdded.ts +1 -1
  119. package/src/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.ts +1 -1
  120. package/src/communityRepository/communityMembership/events/onUserDeleted.ts +1 -3
  121. package/src/communityRepository/communityMembership/events/utils.ts +2 -2
  122. package/src/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.ts +2 -8
  123. package/src/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.ts +2 -8
  124. package/src/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.ts +1 -1
  125. package/src/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.ts +1 -1
  126. package/src/communityRepository/events/onCommunityCreated.ts +1 -1
  127. package/src/communityRepository/events/onCommunityDeleted.ts +1 -1
  128. package/src/communityRepository/events/onCommunityUpdated.ts +1 -1
  129. package/src/communityRepository/events/utils.ts +1 -1
  130. package/src/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.ts +2 -2
  131. package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.ts +2 -2
  132. package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.ts +2 -2
  133. package/src/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.ts +2 -2
  134. package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.ts +2 -2
  135. package/src/communityRepository/utils/communityWithMembership.ts +4 -8
  136. package/src/communityRepository/utils/payload.ts +1 -1
  137. package/src/core/model/idResolvers.ts +0 -2
  138. package/src/core/model/index.ts +0 -2
  139. package/src/index.ts +0 -2
  140. package/src/utils/linkedObject/index.ts +0 -4
  141. package/dist/@types/domains/invitation.d.ts +0 -43
  142. package/dist/@types/domains/invitation.d.ts.map +0 -1
  143. package/dist/invitationRepository/events/index.d.ts +0 -2
  144. package/dist/invitationRepository/events/index.d.ts.map +0 -1
  145. package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts +0 -17
  146. package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts.map +0 -1
  147. package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts +0 -17
  148. package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts.map +0 -1
  149. package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts +0 -17
  150. package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts.map +0 -1
  151. package/dist/invitationRepository/index.d.ts +0 -2
  152. package/dist/invitationRepository/index.d.ts.map +0 -1
  153. package/dist/invitationRepository/internalApi/acceptInvitation.d.ts +0 -16
  154. package/dist/invitationRepository/internalApi/acceptInvitation.d.ts.map +0 -1
  155. package/dist/invitationRepository/internalApi/cancelInvitation.d.ts +0 -16
  156. package/dist/invitationRepository/internalApi/cancelInvitation.d.ts.map +0 -1
  157. package/dist/invitationRepository/internalApi/createInvitations.d.ts +0 -21
  158. package/dist/invitationRepository/internalApi/createInvitations.d.ts.map +0 -1
  159. package/dist/invitationRepository/internalApi/index.d.ts +0 -5
  160. package/dist/invitationRepository/internalApi/index.d.ts.map +0 -1
  161. package/dist/invitationRepository/internalApi/rejectInvitation.d.ts +0 -16
  162. package/dist/invitationRepository/internalApi/rejectInvitation.d.ts.map +0 -1
  163. package/dist/utils/linkedObject/communityLinkedObject.d.ts +0 -2
  164. package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +0 -1
  165. package/dist/utils/linkedObject/invitationLinkedObject.d.ts +0 -2
  166. package/dist/utils/linkedObject/invitationLinkedObject.d.ts.map +0 -1
  167. package/src/@types/domains/invitation.ts +0 -52
  168. package/src/invitationRepository/events/index.ts +0 -1
  169. package/src/invitationRepository/events/onLocalInvitationCreated.ts +0 -33
  170. package/src/invitationRepository/events/onLocalInvitationDeleted.ts +0 -33
  171. package/src/invitationRepository/events/onLocalInvitationUpdated.ts +0 -33
  172. package/src/invitationRepository/index.ts +0 -1
  173. package/src/invitationRepository/internalApi/acceptInvitation.ts +0 -45
  174. package/src/invitationRepository/internalApi/cancelInvitation.ts +0 -44
  175. package/src/invitationRepository/internalApi/createInvitations.ts +0 -46
  176. package/src/invitationRepository/internalApi/index.ts +0 -4
  177. package/src/invitationRepository/internalApi/rejectInvitation.ts +0 -45
  178. package/src/utils/linkedObject/communityLinkedObject.ts +0 -16
  179. package/src/utils/linkedObject/invitationLinkedObject.ts +0 -20
@@ -12,7 +12,5 @@ export declare const LinkedObject: {
12
12
  channel: (channel: Amity.InternalChannel<any>) => Amity.Channel<any>;
13
13
  pinnedPost: (pinnedPost: Amity.RawPin) => Amity.PinnedPost;
14
14
  notificationTray: (noti: Amity.RawNotificationTrayItem) => Amity.NotificationTrayItem;
15
- community: (community: Amity.RawCommunity) => Amity.Community;
16
- invitation: (invitation: Amity.RawInvitation) => Amity.Invitation;
17
15
  };
18
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/index.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAgBxB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/index.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;CAcxB,CAAC"}
@@ -30,21 +30,21 @@ export declare const emptyPostPayload: {
30
30
  export declare const postQueryResponse: {
31
31
  data: Omit<Amity.PostPayload<any>, "communityUsers" | "communities" | "posts"> & {
32
32
  posts: Amity.InternalPost<any>[];
33
- communities: Amity.InternalCommunity[];
33
+ communities: Amity.Community[];
34
34
  communityUsers: Amity.Membership<"community">[];
35
35
  } & Amity.Pagination;
36
36
  };
37
37
  export declare const postQueryResponse2: {
38
38
  data: Omit<Amity.PostPayload<any>, "communityUsers" | "communities" | "posts"> & {
39
39
  posts: Amity.InternalPost<any>[];
40
- communities: Amity.InternalCommunity[];
40
+ communities: Amity.Community[];
41
41
  communityUsers: Amity.Membership<"community">[];
42
42
  } & Amity.Pagination;
43
43
  };
44
44
  export declare const postQueryResponsePage2: {
45
45
  data: Omit<Amity.PostPayload<any>, "communityUsers" | "communities" | "posts"> & {
46
46
  posts: Amity.InternalPost<any>[];
47
- communities: Amity.InternalCommunity[];
47
+ communities: Amity.Community[];
48
48
  communityUsers: Amity.Membership<"community">[];
49
49
  } & Amity.Pagination;
50
50
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk",
3
- "version": "7.4.1-d23fab2f.0",
3
+ "version": "7.5.1-1d67f17.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",
@@ -261,10 +261,6 @@ declare global {
261
261
  notificationTrayItems: Amity.InternalNotificationTrayItem[];
262
262
  };
263
263
 
264
- 'local.invitation.created': Amity.InvitationPayload;
265
- 'local.invitation.updated': Amity.InvitationPayload;
266
- 'local.invitation.deleted': Amity.InvitationPayload;
267
-
268
264
  sessionStateChange: Amity.SessionStates;
269
265
  // used by accessTokenExpiryWatcher
270
266
  tokenExpired: Amity.SessionStates.TOKEN_EXPIRED;
@@ -33,7 +33,7 @@ declare global {
33
33
  feedMarker: Amity.FeedMarker;
34
34
  userMarker: Amity.UserMarker;
35
35
 
36
- community: Amity.InternalCommunity;
36
+ community: Amity.Community;
37
37
  category: Amity.InternalCategory;
38
38
  communityUsers: Amity.Membership<'community'>;
39
39
  post: Amity.InternalPost;
@@ -60,8 +60,6 @@ declare global {
60
60
 
61
61
  notificationTrayItem: Amity.InternalNotificationTrayItem;
62
62
  notificationTraySeen: Amity.InternalNotificationTraySeen;
63
-
64
- invitation: Amity.InternalInvitation;
65
63
  };
66
64
 
67
65
  type Model = ValueOf<Models>;
@@ -126,8 +124,6 @@ declare global {
126
124
 
127
125
  notificationTrayItem: Pick<Amity.InternalNotificationTrayItem, '_id'>;
128
126
  notificationTraySeen: Pick<Amity.InternalNotificationTraySeen, 'userId'>;
129
-
130
- invitation: Pick<Amity.InternalInvitation, '_id'>;
131
127
  };
132
128
  }
133
129
  }
@@ -27,7 +27,6 @@ declare global {
27
27
  semanticSearchPost: Amity.SemanticSearchPostPayload;
28
28
  semanticSearchCommunity: Amity.SemanticSearchCommunityPayload;
29
29
  notificationTrayItem: Amity.NotificationTrayPayload;
30
- invitation: Amity.InvitationPayload;
31
30
  };
32
31
 
33
32
  type UserPayload = {
@@ -307,7 +306,7 @@ declare global {
307
306
  * - communityUsers: `Amity.RawMembership` -> `Amity.Membership` (Add user getter prop)
308
307
  */
309
308
  type ProcessedCommunityPayload = Omit<CommunityPayload, 'communities' | 'communityUsers'> & {
310
- communities: Amity.InternalCommunity[];
309
+ communities: Amity.Community[];
311
310
  communityUsers: Amity.Membership<'community'>[];
312
311
  };
313
312
 
@@ -334,7 +333,7 @@ declare global {
334
333
  CommunityMembershipPayload,
335
334
  'communities' | 'communityUsers'
336
335
  > & {
337
- communities: Amity.InternalCommunity[];
336
+ communities: Amity.Community[];
338
337
  communityUsers: Amity.Membership<'community'>[];
339
338
  };
340
339
 
@@ -384,7 +383,7 @@ declare global {
384
383
  Amity.StoryTargetPayload;
385
384
 
386
385
  type ProcessedGlobalStoryFeed = Omit<GlobalStoryFeedPayload, 'communities'> & {
387
- communities: Amity.InternalCommunity[];
386
+ communities: Amity.Community[];
388
387
  };
389
388
 
390
389
  // Original Payload form BE
@@ -437,7 +436,7 @@ declare global {
437
436
  */
438
437
  type ProcessedPostPayload = Omit<PostPayload, 'communities' | 'communityUsers' | 'posts'> & {
439
438
  posts: Amity.InternalPost[];
440
- communities: Amity.InternalCommunity[];
439
+ communities: Amity.Community[];
441
440
  communityUsers: Amity.Membership<'community'>[];
442
441
  };
443
442
 
@@ -546,9 +545,5 @@ declare global {
546
545
  Amity.Flaggable &
547
546
  Amity.Taggable &
548
547
  Amity.Timestamps;
549
-
550
- type InvitationPayload = {
551
- invitations: Amity.RawInvitation[];
552
- };
553
548
  }
554
549
  }
@@ -1,17 +1,10 @@
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
-
9
4
  declare global {
10
5
  namespace Amity {
11
6
  type Logger = (topic: string, ...args: any[]) => void;
12
7
 
13
- type MembershipAcceptanceType = MembershipAcceptanceTypeEnum;
14
-
15
8
  const enum TokenTerminationReason {
16
9
  GLOBAL_BAN = 'globalBan',
17
10
  USER_DELETED = 'userDeleted',
@@ -131,12 +124,7 @@ declare global {
131
124
  showMyPost: boolean;
132
125
  showOnlyMyFeed: boolean;
133
126
  };
134
- story: {
135
- allowAllUserToCreateStory: boolean;
136
- expiryTimeMinutes: number;
137
- };
138
127
  userPrivacySetting: 'public' | 'private';
139
- membershipAcceptance: Amity.MembershipAcceptanceType;
140
128
  };
141
129
 
142
130
  type ConnectClientParams = {
@@ -95,25 +95,17 @@ declare global {
95
95
  hasFlaggedPost: boolean;
96
96
 
97
97
  allowCommentInStory?: boolean;
98
-
99
- isDiscoverable: boolean;
100
- requiresJoinApproval: boolean;
101
98
  } & Amity.Taggable &
102
99
  Amity.Metadata &
103
100
  Amity.Timestamps &
104
101
  Amity.SoftDelete &
105
102
  Amity.Subscribable;
106
103
 
107
- type InternalCommunity = Omit<
108
- Amity.RawCommunity,
109
- 'onlyAdminCanPost' | 'needApprovalOnPostCreation'
110
- > &
104
+ type Community = Omit<Amity.RawCommunity, 'onlyAdminCanPost' | 'needApprovalOnPostCreation'> &
111
105
  Amity.CommunityStorySettings & {
112
106
  postSetting?: ValueOf<typeof CommunityPostSettings>;
113
107
  };
114
108
 
115
- type Community = Amity.InternalCommunity & Amity.CommunityLinkedObject;
116
-
117
109
  type QueryCommunities = {
118
110
  membership?: 'all' | 'member' | 'notMember';
119
111
  categoryId?: Amity.InternalCategory['categoryId'];
@@ -217,9 +209,5 @@ declare global {
217
209
  Amity.Community['communityId'], // communityId:score
218
210
  QuerySemanticSearchCommunity
219
211
  >;
220
-
221
- type CommunityLinkedObject = {
222
- createInvitations: (userIds: string[]) => Promise<void>;
223
- };
224
212
  }
225
213
  }
@@ -38,5 +38,3 @@ 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';
@@ -1,4 +1,3 @@
1
- import { LinkedObject } from '~/utils/linkedObject';
2
1
  import { getActiveClient } from '~/client/api';
3
2
 
4
3
  import { ingestInCache } from '~/cache/api/ingestInCache';
@@ -12,7 +11,7 @@ import { prepareCommunityPayload, prepareCommunityRequest } from '../utils';
12
11
  /**
13
12
  * ```js
14
13
  * import { createCommunity } from '@amityco/ts-sdk'
15
- * const created = await createCommunity({ communityId: 'foobar', displayName: 'foobar', isDiscoverable: true, requiresJoinApproval: false })
14
+ * const created = await createCommunity({ communityId: 'foobar', displayName: 'foobar' })
16
15
  * ```
17
16
  *
18
17
  * Creates an {@link Amity.Community}
@@ -34,8 +33,6 @@ export const createCommunity = async (
34
33
  | 'postSetting'
35
34
  | 'tags'
36
35
  | 'metadata'
37
- | 'isDiscoverable'
38
- | 'requiresJoinApproval'
39
36
  > &
40
37
  Amity.CommunityStorySettings & {
41
38
  userIds?: string[];
@@ -63,7 +60,7 @@ export const createCommunity = async (
63
60
 
64
61
  const { communities } = data;
65
62
  return {
66
- data: LinkedObject.community(communities[0]),
63
+ data: communities[0],
67
64
  cachedAt,
68
65
  };
69
66
  };
@@ -5,7 +5,6 @@ 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';
9
8
 
10
9
  /**
11
10
  * ```js
@@ -44,7 +43,7 @@ export const getCommunities = async (
44
43
  }
45
44
 
46
45
  return {
47
- data: data.communities.map(community => LinkedObject.community(community)),
46
+ data: data.communities,
48
47
  cachedAt,
49
48
  };
50
49
  };
@@ -5,7 +5,6 @@ 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';
9
8
 
10
9
  /**
11
10
  * ```js
@@ -43,9 +42,7 @@ export const getCommunity = async (
43
42
  const { communities } = data;
44
43
 
45
44
  return {
46
- data: LinkedObject.community(
47
- communities.find(community => community.communityId === communityId)!,
48
- ),
45
+ data: communities.find(community => community.communityId === communityId)!,
49
46
  cachedAt,
50
47
  };
51
48
  };
@@ -4,7 +4,6 @@ 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';
8
7
 
9
8
  /* begin_public_function
10
9
  id: community.query.recommended_communities
@@ -48,5 +47,5 @@ export const getRecommendedCommunities = async (
48
47
  ingestInCache(data, { cachedAt });
49
48
  }
50
49
 
51
- return { data: communities.map(community => LinkedObject.community(community)), cachedAt };
50
+ return { data: communities, cachedAt };
52
51
  };
@@ -4,7 +4,6 @@ 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';
8
7
 
9
8
  /**
10
9
  * ```js
@@ -45,5 +44,5 @@ export const getTrendingCommunities = async (
45
44
  ingestInCache(data, { cachedAt });
46
45
  }
47
46
 
48
- return { data: communities.map(community => LinkedObject.community(community)), cachedAt };
47
+ return { data: communities, cachedAt };
49
48
  };
@@ -6,7 +6,6 @@ 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';
10
9
 
11
10
  /**
12
11
  * ```js
@@ -69,9 +68,5 @@ export const queryCommunities = async (
69
68
  saveCommunityUsers(data.communities, data.communityUsers);
70
69
  }
71
70
 
72
- return {
73
- data: communities.map(community => LinkedObject.community(community)),
74
- cachedAt,
75
- paging,
76
- };
71
+ return { data: communities, cachedAt, paging };
77
72
  };
@@ -5,7 +5,6 @@ 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';
9
8
 
10
9
  /* begin_public_function
11
10
  id: community.update
@@ -54,9 +53,7 @@ export const updateCommunity = async (
54
53
  const { communities } = data;
55
54
 
56
55
  return {
57
- data: LinkedObject.community(
58
- communities.find(community => community.communityId === communityId)!,
59
- ),
56
+ data: communities.find(community => community.communityId === communityId)!,
60
57
  cachedAt,
61
58
  };
62
59
  };
@@ -16,5 +16,5 @@ import { createCommunityMemberEventSubscriber } from './utils';
16
16
  * @category Community Events
17
17
  */
18
18
  export const onCommunityJoined = (
19
- callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.Community, 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.InternalCommunity, members: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
4
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
4
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
19
+ callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void,
20
20
  ) => createLocalCommunityMemberEventSubscriber('local.community.userRemoved', callback);
@@ -22,9 +22,7 @@ import { getResolver } from '~/core/model';
22
22
  */
23
23
  export const onUserDeleted =
24
24
  (communityId: string) =>
25
- (
26
- callback: (community: Amity.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
27
- ) => {
25
+ (callback: (community: Amity.Community, member: Amity.Membership<'community'>[]) => void) => {
28
26
  const client = getActiveClient();
29
27
 
30
28
  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.InternalCommunity, members: Amity.Membership<'community'>[]) => void,
56
+ callback: (community: Amity.Community, 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.InternalCommunity, members: Amity.Membership<'community'>[]) => void,
105
+ callback: (community: Amity.Community, members: Amity.Membership<'community'>[]) => void,
106
106
  ) => {
107
107
  const client = getActiveClient();
108
108
 
@@ -70,10 +70,7 @@ export class CommunityMembersQueryStreamController extends QueryStreamController
70
70
  }
71
71
 
72
72
  reactor(action: EnumCommunityMemberActions) {
73
- return (
74
- community: Amity.InternalCommunity,
75
- communityMembers: Amity.Membership<'community'>[],
76
- ) => {
73
+ return (community: Amity.Community, communityMembers: Amity.Membership<'community'>[]) => {
77
74
  const collection = pullFromCache<Amity.CommunityMemberLiveCollectionCache>(
78
75
  this.cacheKey,
79
76
  )?.data;
@@ -100,10 +97,7 @@ export class CommunityMembersQueryStreamController extends QueryStreamController
100
97
  subscribeRTE(
101
98
  createSubscriber: {
102
99
  fn: (
103
- reactor: (
104
- channel: Amity.InternalCommunity,
105
- communityUser: Amity.Membership<'community'>[],
106
- ) => void,
100
+ reactor: (channel: Amity.Community, communityUser: Amity.Membership<'community'>[]) => void,
107
101
  ) => Amity.Unsubscriber;
108
102
  action: EnumCommunityMemberActions;
109
103
  }[],
@@ -70,10 +70,7 @@ export class SearchCommunityMembersQueryStreamController extends QueryStreamCont
70
70
  }
71
71
 
72
72
  reactor(action: EnumCommunityMemberActions) {
73
- return (
74
- community: Amity.InternalCommunity,
75
- communityMembers: Amity.Membership<'community'>[],
76
- ) => {
73
+ return (community: Amity.Community, communityMembers: Amity.Membership<'community'>[]) => {
77
74
  const collection = pullFromCache<Amity.SearchCommunityMemberLiveCollectionCache>(
78
75
  this.cacheKey,
79
76
  )?.data;
@@ -98,10 +95,7 @@ export class SearchCommunityMembersQueryStreamController extends QueryStreamCont
98
95
  subscribeRTE(
99
96
  createSubscriber: {
100
97
  fn: (
101
- reactor: (
102
- channel: Amity.InternalCommunity,
103
- communityUser: Amity.Membership<'community'>[],
104
- ) => void,
98
+ reactor: (channel: Amity.Community, communityUser: Amity.Membership<'community'>[]) => void,
105
99
  ) => Amity.Unsubscriber;
106
100
  action: EnumCommunityMemberActions;
107
101
  }[],
@@ -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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
+ callback: (community: Amity.Community, 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.InternalCommunity, member: Amity.Membership<'community'>[]) => void,
20
+ callback: (community: Amity.Community, 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.InternalCommunity>) =>
18
+ export const onCommunityCreated = (callback: Amity.Listener<Amity.Community>) =>
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.InternalCommunity>) =>
18
+ export const onCommunityDeleted = (callback: Amity.Listener<Amity.Community>) =>
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.InternalCommunity>) =>
18
+ export const onCommunityUpdated = (callback: Amity.Listener<Amity.Community>) =>
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.InternalCommunity>,
10
+ callback: Amity.Listener<Amity.Community>,
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.InternalCommunity) => {
63
+ return (community: Amity.Community) => {
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.InternalCommunity) => void) => Amity.Unsubscriber;
79
+ fn: (reactor: (channel: Amity.Community) => 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.InternalCommunity) => {
69
+ return (community: Amity.Community) => {
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.InternalCommunity) => void) => Amity.Unsubscriber;
82
+ fn: (reactor: (channel: Amity.Community) => void) => Amity.Unsubscriber;
83
83
  action: EnumCommunityActions | EnumCommunityMemberActions;
84
84
  }[],
85
85
  ) {