@amityco/ts-sdk 7.5.2 → 7.5.3-69a90234.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 (361) hide show
  1. package/.env +26 -26
  2. package/dist/@types/core/events.d.ts +7 -0
  3. package/dist/@types/core/events.d.ts.map +1 -1
  4. package/dist/@types/core/model.d.ts +5 -1
  5. package/dist/@types/core/model.d.ts.map +1 -1
  6. package/dist/@types/core/payload.d.ts +38 -5
  7. package/dist/@types/core/payload.d.ts.map +1 -1
  8. package/dist/@types/domains/client.d.ts +10 -0
  9. package/dist/@types/domains/client.d.ts.map +1 -1
  10. package/dist/@types/domains/community.d.ts +51 -1
  11. package/dist/@types/domains/community.d.ts.map +1 -1
  12. package/dist/@types/domains/content.d.ts +5 -2
  13. package/dist/@types/domains/content.d.ts.map +1 -1
  14. package/dist/@types/domains/invitation.d.ts +92 -0
  15. package/dist/@types/domains/invitation.d.ts.map +1 -0
  16. package/dist/@types/domains/joinRequest.d.ts +53 -0
  17. package/dist/@types/domains/joinRequest.d.ts.map +1 -0
  18. package/dist/@types/domains/notification.d.ts +4 -2
  19. package/dist/@types/domains/notification.d.ts.map +1 -1
  20. package/dist/@types/domains/pinnedPost.d.ts +1 -1
  21. package/dist/@types/domains/pinnedPost.d.ts.map +1 -1
  22. package/dist/@types/index.d.ts +5 -0
  23. package/dist/@types/index.d.ts.map +1 -1
  24. package/dist/client/api/enableUnreadCount.d.ts.map +1 -1
  25. package/dist/client/api/login.d.ts.map +1 -1
  26. package/dist/client/utils/markerSyncEngine.d.ts +1 -1
  27. package/dist/client/utils/markerSyncEngine.d.ts.map +1 -1
  28. package/dist/communityRepository/api/createCommunity.d.ts +2 -2
  29. package/dist/communityRepository/api/createCommunity.d.ts.map +1 -1
  30. package/dist/communityRepository/api/getCommunities.d.ts +1 -1
  31. package/dist/communityRepository/api/getCommunities.d.ts.map +1 -1
  32. package/dist/communityRepository/api/getCommunity.d.ts +1 -1
  33. package/dist/communityRepository/api/getCommunity.d.ts.map +1 -1
  34. package/dist/communityRepository/api/getRecommendedCommunities.d.ts +3 -1
  35. package/dist/communityRepository/api/getRecommendedCommunities.d.ts.map +1 -1
  36. package/dist/communityRepository/api/getTrendingCommunities.d.ts +3 -1
  37. package/dist/communityRepository/api/getTrendingCommunities.d.ts.map +1 -1
  38. package/dist/communityRepository/api/joinCommunity.d.ts +3 -0
  39. package/dist/communityRepository/api/joinCommunity.d.ts.map +1 -1
  40. package/dist/communityRepository/api/queryCommunities.d.ts.map +1 -1
  41. package/dist/communityRepository/api/updateCommunity.d.ts +2 -2
  42. package/dist/communityRepository/api/updateCommunity.d.ts.map +1 -1
  43. package/dist/communityRepository/communityMembership/events/index.d.ts +1 -0
  44. package/dist/communityRepository/communityMembership/events/index.d.ts.map +1 -1
  45. package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts +1 -1
  46. package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts.map +1 -1
  47. package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts +1 -1
  48. package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts.map +1 -1
  49. package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts +1 -1
  50. package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts.map +1 -1
  51. package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts +1 -1
  52. package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts.map +1 -1
  53. package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts +1 -1
  54. package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts.map +1 -1
  55. package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts +1 -1
  56. package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts.map +1 -1
  57. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts +1 -1
  58. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts.map +1 -1
  59. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts +1 -1
  60. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts.map +1 -1
  61. package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts +1 -1
  62. package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts.map +1 -1
  63. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoin.d.ts +2 -0
  64. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoin.d.ts.map +1 -0
  65. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts +1 -1
  66. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts.map +1 -1
  67. package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts +1 -1
  68. package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts.map +1 -1
  69. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts +1 -1
  70. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts.map +1 -1
  71. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts +1 -1
  72. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts.map +1 -1
  73. package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts +1 -1
  74. package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts.map +1 -1
  75. package/dist/communityRepository/communityMembership/events/utils.d.ts +2 -2
  76. package/dist/communityRepository/communityMembership/events/utils.d.ts.map +1 -1
  77. package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts +2 -2
  78. package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts.map +1 -1
  79. package/dist/communityRepository/communityMembership/observers/getMembers/enums.d.ts +2 -1
  80. package/dist/communityRepository/communityMembership/observers/getMembers/enums.d.ts.map +1 -1
  81. package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts +2 -2
  82. package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts.map +1 -1
  83. package/dist/communityRepository/communityMembership/observers/searchMembers/enums.d.ts +1 -0
  84. package/dist/communityRepository/communityMembership/observers/searchMembers/enums.d.ts.map +1 -1
  85. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts +1 -1
  86. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts.map +1 -1
  87. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts +1 -1
  88. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts.map +1 -1
  89. package/dist/communityRepository/events/onCommunityCreated.d.ts +1 -1
  90. package/dist/communityRepository/events/onCommunityCreated.d.ts.map +1 -1
  91. package/dist/communityRepository/events/onCommunityDeleted.d.ts +1 -1
  92. package/dist/communityRepository/events/onCommunityDeleted.d.ts.map +1 -1
  93. package/dist/communityRepository/events/onCommunityUpdated.d.ts +1 -1
  94. package/dist/communityRepository/events/onCommunityUpdated.d.ts.map +1 -1
  95. package/dist/communityRepository/events/utils.d.ts +1 -1
  96. package/dist/communityRepository/events/utils.d.ts.map +1 -1
  97. package/dist/communityRepository/internalAPI/getMyJoinRequest.d.ts +16 -0
  98. package/dist/communityRepository/internalAPI/getMyJoinRequest.d.ts.map +1 -0
  99. package/dist/communityRepository/internalAPI/joinCommunity.d.ts +16 -0
  100. package/dist/communityRepository/internalAPI/joinCommunity.d.ts.map +1 -0
  101. package/dist/communityRepository/joinRequest/events/index.d.ts +4 -0
  102. package/dist/communityRepository/joinRequest/events/index.d.ts.map +1 -0
  103. package/dist/communityRepository/joinRequest/events/onJoinRequestCreated.d.ts +17 -0
  104. package/dist/communityRepository/joinRequest/events/onJoinRequestCreated.d.ts.map +1 -0
  105. package/dist/communityRepository/joinRequest/events/onJoinRequestDeleted.d.ts +17 -0
  106. package/dist/communityRepository/joinRequest/events/onJoinRequestDeleted.d.ts.map +1 -0
  107. package/dist/communityRepository/joinRequest/events/onJoinRequestUpdated.d.ts +17 -0
  108. package/dist/communityRepository/joinRequest/events/onJoinRequestUpdated.d.ts.map +1 -0
  109. package/dist/communityRepository/joinRequest/internalAPI/approveJoinRequest.d.ts +16 -0
  110. package/dist/communityRepository/joinRequest/internalAPI/approveJoinRequest.d.ts.map +1 -0
  111. package/dist/communityRepository/joinRequest/internalAPI/cancelJoinRequest.d.ts +16 -0
  112. package/dist/communityRepository/joinRequest/internalAPI/cancelJoinRequest.d.ts.map +1 -0
  113. package/dist/communityRepository/joinRequest/internalAPI/rejectJoinRequest.d.ts +16 -0
  114. package/dist/communityRepository/joinRequest/internalAPI/rejectJoinRequest.d.ts.map +1 -0
  115. package/dist/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.d.ts.map +1 -1
  116. package/dist/communityRepository/observers/getCommunities/CommunitiesPaginationController.d.ts.map +1 -1
  117. package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts +2 -2
  118. package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts.map +1 -1
  119. package/dist/communityRepository/observers/getCommunity.d.ts.map +1 -1
  120. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.d.ts +14 -0
  121. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.d.ts.map +1 -0
  122. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.d.ts +9 -0
  123. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.d.ts.map +1 -0
  124. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.d.ts +15 -0
  125. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.d.ts.map +1 -0
  126. package/dist/communityRepository/observers/getJoinRequestList/enum.d.ts +6 -0
  127. package/dist/communityRepository/observers/getJoinRequestList/enum.d.ts.map +1 -0
  128. package/dist/communityRepository/observers/getJoinRequestList.d.ts +12 -0
  129. package/dist/communityRepository/observers/getJoinRequestList.d.ts.map +1 -0
  130. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.d.ts +14 -0
  131. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.d.ts.map +1 -0
  132. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.d.ts +9 -0
  133. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.d.ts.map +1 -0
  134. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.d.ts +15 -0
  135. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.d.ts.map +1 -0
  136. package/dist/communityRepository/observers/getJoinRequests/enum.d.ts +6 -0
  137. package/dist/communityRepository/observers/getJoinRequests/enum.d.ts.map +1 -0
  138. package/dist/communityRepository/observers/getJoinRequests.d.ts +12 -0
  139. package/dist/communityRepository/observers/getJoinRequests.d.ts.map +1 -0
  140. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesLiveCollectionController.d.ts.map +1 -1
  141. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesPaginationController.d.ts.map +1 -1
  142. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts +2 -2
  143. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts.map +1 -1
  144. package/dist/communityRepository/observers/getRecommendedCommunities/enums.d.ts +2 -1
  145. package/dist/communityRepository/observers/getRecommendedCommunities/enums.d.ts.map +1 -1
  146. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesLiveCollectionController.d.ts.map +1 -1
  147. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesPaginationController.d.ts.map +1 -1
  148. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts +2 -2
  149. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts.map +1 -1
  150. package/dist/communityRepository/observers/index.d.ts +1 -0
  151. package/dist/communityRepository/observers/index.d.ts.map +1 -1
  152. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesLiveCollectionController.d.ts.map +1 -1
  153. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesPaginationController.d.ts.map +1 -1
  154. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts +2 -2
  155. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts.map +1 -1
  156. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityLiveCollectionController.d.ts.map +1 -1
  157. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityPaginationController.d.ts.map +1 -1
  158. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts +2 -2
  159. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts.map +1 -1
  160. package/dist/communityRepository/utils/communityWithMembership.d.ts +1 -1
  161. package/dist/communityRepository/utils/communityWithMembership.d.ts.map +1 -1
  162. package/dist/communityRepository/utils/payload.d.ts +2 -1
  163. package/dist/communityRepository/utils/payload.d.ts.map +1 -1
  164. package/dist/core/events.d.ts +3 -3
  165. package/dist/core/events.d.ts.map +1 -1
  166. package/dist/core/model/idResolvers.d.ts.map +1 -1
  167. package/dist/core/model/index.d.ts.map +1 -1
  168. package/dist/index.cjs.js +3305 -1955
  169. package/dist/index.d.ts +1 -0
  170. package/dist/index.d.ts.map +1 -1
  171. package/dist/index.esm.js +3417 -2068
  172. package/dist/index.umd.js +4 -4
  173. package/dist/invitationRepository/events/index.d.ts +4 -0
  174. package/dist/invitationRepository/events/index.d.ts.map +1 -0
  175. package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts +17 -0
  176. package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts.map +1 -0
  177. package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts +17 -0
  178. package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts.map +1 -0
  179. package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts +17 -0
  180. package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts.map +1 -0
  181. package/dist/invitationRepository/index.d.ts +3 -0
  182. package/dist/invitationRepository/index.d.ts.map +1 -0
  183. package/dist/invitationRepository/internalApi/acceptInvitation.d.ts +16 -0
  184. package/dist/invitationRepository/internalApi/acceptInvitation.d.ts.map +1 -0
  185. package/dist/invitationRepository/internalApi/createInvitations.d.ts +21 -0
  186. package/dist/invitationRepository/internalApi/createInvitations.d.ts.map +1 -0
  187. package/dist/invitationRepository/internalApi/getInvitation.d.ts +17 -0
  188. package/dist/invitationRepository/internalApi/getInvitation.d.ts.map +1 -0
  189. package/dist/invitationRepository/internalApi/index.d.ts +4 -0
  190. package/dist/invitationRepository/internalApi/index.d.ts.map +1 -0
  191. package/dist/invitationRepository/internalApi/rejectInvitation.d.ts +16 -0
  192. package/dist/invitationRepository/internalApi/rejectInvitation.d.ts.map +1 -0
  193. package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts +14 -0
  194. package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts.map +1 -0
  195. package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts +5 -0
  196. package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts.map +1 -0
  197. package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts +15 -0
  198. package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts.map +1 -0
  199. package/dist/invitationRepository/observers/getInvitations/enums.d.ts +6 -0
  200. package/dist/invitationRepository/observers/getInvitations/enums.d.ts.map +1 -0
  201. package/dist/invitationRepository/observers/getInvitations.d.ts +12 -0
  202. package/dist/invitationRepository/observers/getInvitations.d.ts.map +1 -0
  203. package/dist/invitationRepository/observers/getMyCommunityInvitations.d.ts +12 -0
  204. package/dist/invitationRepository/observers/getMyCommunityInvitations.d.ts.map +1 -0
  205. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.d.ts +14 -0
  206. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.d.ts.map +1 -0
  207. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.d.ts +5 -0
  208. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.d.ts.map +1 -0
  209. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.d.ts +15 -0
  210. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.d.ts.map +1 -0
  211. package/dist/invitationRepository/observers/index.d.ts +2 -0
  212. package/dist/invitationRepository/observers/index.d.ts.map +1 -0
  213. package/dist/invitationRepository/utils/convertRawInvitationToInternalInvitation.d.ts +2 -0
  214. package/dist/invitationRepository/utils/convertRawInvitationToInternalInvitation.d.ts.map +1 -0
  215. package/dist/invitationRepository/utils/index.d.ts +2 -0
  216. package/dist/invitationRepository/utils/index.d.ts.map +1 -0
  217. package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts +2 -0
  218. package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts.map +1 -0
  219. package/dist/invitationRepository/utils/prepareMyInvitationsPayload.d.ts +2 -0
  220. package/dist/invitationRepository/utils/prepareMyInvitationsPayload.d.ts.map +1 -0
  221. package/dist/messagePreview/utils/getSubChannelMessagePreviewWithUser.d.ts +1 -1
  222. package/dist/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostQueryStreamController.d.ts.map +1 -1
  223. package/dist/postRepository/observers/getPinnedPosts/PinnedPostQueryStreamController.d.ts.map +1 -1
  224. package/dist/subChannelRepository/utils/prepareSubChannelPayload.d.ts.map +1 -1
  225. package/dist/utils/linkedObject/communityLinkedObject.d.ts +2 -0
  226. package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -0
  227. package/dist/utils/linkedObject/index.d.ts +3 -0
  228. package/dist/utils/linkedObject/index.d.ts.map +1 -1
  229. package/dist/utils/linkedObject/invitationLinkedObject.d.ts +2 -0
  230. package/dist/utils/linkedObject/invitationLinkedObject.d.ts.map +1 -0
  231. package/dist/utils/linkedObject/joinRequestLinkedObject.d.ts +2 -0
  232. package/dist/utils/linkedObject/joinRequestLinkedObject.d.ts.map +1 -0
  233. package/dist/utils/tests/dummy/comment.d.ts +1 -1
  234. package/dist/utils/tests/dummy/post.d.ts +3 -3
  235. package/package.json +1 -1
  236. package/src/@types/core/events.ts +10 -0
  237. package/src/@types/core/model.ts +8 -1
  238. package/src/@types/core/payload.ts +48 -5
  239. package/src/@types/domains/client.ts +12 -0
  240. package/src/@types/domains/community.ts +82 -3
  241. package/src/@types/domains/content.ts +15 -1
  242. package/src/@types/domains/invitation.ts +119 -0
  243. package/src/@types/domains/joinRequest.ts +66 -0
  244. package/src/@types/domains/notification.ts +2 -0
  245. package/src/@types/domains/pinnedPost.ts +1 -1
  246. package/src/@types/index.ts +5 -0
  247. package/src/client/api/enableUnreadCount.ts +0 -22
  248. package/src/client/api/login.ts +0 -4
  249. package/src/client/utils/markerSyncEngine.ts +3 -24
  250. package/src/communityRepository/api/createCommunity.ts +5 -2
  251. package/src/communityRepository/api/getCommunities.ts +9 -2
  252. package/src/communityRepository/api/getCommunity.ts +13 -2
  253. package/src/communityRepository/api/getRecommendedCommunities.ts +11 -4
  254. package/src/communityRepository/api/getTrendingCommunities.ts +11 -4
  255. package/src/communityRepository/api/joinCommunity.ts +4 -1
  256. package/src/communityRepository/api/queryCommunities.ts +7 -1
  257. package/src/communityRepository/api/updateCommunity.ts +13 -3
  258. package/src/communityRepository/communityMembership/events/index.ts +1 -0
  259. package/src/communityRepository/communityMembership/events/onCommunityJoined.ts +1 -1
  260. package/src/communityRepository/communityMembership/events/onCommunityLeft.ts +1 -1
  261. package/src/communityRepository/communityMembership/events/onCommunityUserAdded.ts +1 -1
  262. package/src/communityRepository/communityMembership/events/onCommunityUserBanned.ts +1 -1
  263. package/src/communityRepository/communityMembership/events/onCommunityUserChanged.ts +1 -1
  264. package/src/communityRepository/communityMembership/events/onCommunityUserRemoved.ts +1 -1
  265. package/src/communityRepository/communityMembership/events/onCommunityUserRoleAdded.ts +1 -1
  266. package/src/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.ts +1 -1
  267. package/src/communityRepository/communityMembership/events/onCommunityUserUnbanned.ts +1 -1
  268. package/src/communityRepository/communityMembership/events/onLocalCommunityJoin.ts +20 -0
  269. package/src/communityRepository/communityMembership/events/onLocalCommunityJoined.ts +1 -1
  270. package/src/communityRepository/communityMembership/events/onLocalCommunityLeft.ts +1 -1
  271. package/src/communityRepository/communityMembership/events/onLocalCommunityUserAdded.ts +1 -1
  272. package/src/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.ts +1 -1
  273. package/src/communityRepository/communityMembership/events/onUserDeleted.ts +3 -1
  274. package/src/communityRepository/communityMembership/events/utils.ts +2 -2
  275. package/src/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.ts +8 -2
  276. package/src/communityRepository/communityMembership/observers/getMembers/enums.ts +1 -0
  277. package/src/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.ts +8 -2
  278. package/src/communityRepository/communityMembership/observers/searchMembers/enums.ts +1 -0
  279. package/src/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.ts +1 -1
  280. package/src/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.ts +1 -1
  281. package/src/communityRepository/events/onCommunityCreated.ts +1 -1
  282. package/src/communityRepository/events/onCommunityDeleted.ts +1 -1
  283. package/src/communityRepository/events/onCommunityUpdated.ts +1 -1
  284. package/src/communityRepository/events/utils.ts +1 -1
  285. package/src/communityRepository/internalAPI/getMyJoinRequest.ts +43 -0
  286. package/src/communityRepository/internalAPI/joinCommunity.ts +66 -0
  287. package/src/communityRepository/joinRequest/events/index.ts +3 -0
  288. package/src/communityRepository/joinRequest/events/onJoinRequestCreated.ts +33 -0
  289. package/src/communityRepository/joinRequest/events/onJoinRequestDeleted.ts +33 -0
  290. package/src/communityRepository/joinRequest/events/onJoinRequestUpdated.ts +33 -0
  291. package/src/communityRepository/joinRequest/internalAPI/approveJoinRequest.ts +52 -0
  292. package/src/communityRepository/joinRequest/internalAPI/cancelJoinRequest.ts +49 -0
  293. package/src/communityRepository/joinRequest/internalAPI/rejectJoinRequest.ts +52 -0
  294. package/src/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.ts +6 -0
  295. package/src/communityRepository/observers/getCommunities/CommunitiesPaginationController.ts +1 -0
  296. package/src/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.ts +2 -2
  297. package/src/communityRepository/observers/getCommunity.ts +3 -0
  298. package/src/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.ts +135 -0
  299. package/src/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.ts +30 -0
  300. package/src/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.ts +116 -0
  301. package/src/communityRepository/observers/getJoinRequestList/enum.ts +5 -0
  302. package/src/communityRepository/observers/getJoinRequestList.ts +51 -0
  303. package/src/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.ts +126 -0
  304. package/src/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.ts +26 -0
  305. package/src/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.ts +108 -0
  306. package/src/communityRepository/observers/getJoinRequests/enum.ts +5 -0
  307. package/src/communityRepository/observers/getJoinRequests.ts +44 -0
  308. package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesLiveCollectionController.ts +8 -1
  309. package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesPaginationController.ts +6 -1
  310. package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.ts +2 -2
  311. package/src/communityRepository/observers/getRecommendedCommunities/enums.ts +1 -0
  312. package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesLiveCollectionController.ts +9 -1
  313. package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesPaginationController.ts +6 -1
  314. package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.ts +2 -2
  315. package/src/communityRepository/observers/index.ts +1 -0
  316. package/src/communityRepository/observers/searchCommunities/SearchCommunitiesLiveCollectionController.ts +6 -0
  317. package/src/communityRepository/observers/searchCommunities/SearchCommunitiesPaginationController.ts +1 -0
  318. package/src/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.ts +2 -2
  319. package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityLiveCollectionController.ts +6 -0
  320. package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityPaginationController.ts +1 -0
  321. package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.ts +2 -2
  322. package/src/communityRepository/utils/communityWithMembership.ts +9 -5
  323. package/src/communityRepository/utils/payload.ts +28 -2
  324. package/src/core/liveCollection/PaginationController.ts +1 -1
  325. package/src/core/liveCollection/PaginationNoPageController.ts +1 -1
  326. package/src/core/model/idResolvers.ts +3 -0
  327. package/src/core/model/index.ts +3 -0
  328. package/src/index.ts +2 -0
  329. package/src/invitationRepository/events/index.ts +3 -0
  330. package/src/invitationRepository/events/onLocalInvitationCreated.ts +33 -0
  331. package/src/invitationRepository/events/onLocalInvitationDeleted.ts +33 -0
  332. package/src/invitationRepository/events/onLocalInvitationUpdated.ts +33 -0
  333. package/src/invitationRepository/index.ts +2 -0
  334. package/src/invitationRepository/internalApi/acceptInvitation.ts +45 -0
  335. package/src/invitationRepository/internalApi/createInvitations.ts +52 -0
  336. package/src/invitationRepository/internalApi/getInvitation.ts +47 -0
  337. package/src/invitationRepository/internalApi/index.ts +3 -0
  338. package/src/invitationRepository/internalApi/rejectInvitation.ts +45 -0
  339. package/src/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.ts +148 -0
  340. package/src/invitationRepository/observers/getInvitations/InvitationsPaginationController.ts +19 -0
  341. package/src/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.ts +97 -0
  342. package/src/invitationRepository/observers/getInvitations/enums.ts +5 -0
  343. package/src/invitationRepository/observers/getInvitations.ts +44 -0
  344. package/src/invitationRepository/observers/getMyCommunityInvitations.ts +48 -0
  345. package/src/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.ts +148 -0
  346. package/src/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.ts +22 -0
  347. package/src/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.ts +105 -0
  348. package/src/invitationRepository/observers/index.ts +1 -0
  349. package/src/invitationRepository/utils/convertRawInvitationToInternalInvitation.ts +8 -0
  350. package/src/invitationRepository/utils/index.ts +1 -0
  351. package/src/invitationRepository/utils/prepareInvitationPayload.ts +12 -0
  352. package/src/invitationRepository/utils/prepareMyInvitationsPayload.ts +12 -0
  353. package/src/messagePreview/utils/getChannelMessagePreviewWithUser.ts +3 -3
  354. package/src/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostQueryStreamController.ts +7 -1
  355. package/src/postRepository/observers/getPinnedPosts/PinnedPostQueryStreamController.ts +7 -1
  356. package/src/reactionRepository/api/addReaction.ts +1 -1
  357. package/src/subChannelRepository/utils/prepareSubChannelPayload.ts +4 -0
  358. package/src/utils/linkedObject/communityLinkedObject.ts +57 -0
  359. package/src/utils/linkedObject/index.ts +6 -0
  360. package/src/utils/linkedObject/invitationLinkedObject.ts +37 -0
  361. package/src/utils/linkedObject/joinRequestLinkedObject.ts +31 -0
@@ -27,6 +27,9 @@ declare global {
27
27
  semanticSearchPost: Amity.SemanticSearchPostPayload;
28
28
  semanticSearchCommunity: Amity.SemanticSearchCommunityPayload;
29
29
  notificationTrayItem: Amity.NotificationTrayPayload;
30
+ invitation: Amity.InvitationPayload;
31
+ myInvitation: Amity.MyInvitationsPayload;
32
+ joinRequest: Amity.CommunityJoinRequestPayload;
30
33
  };
31
34
 
32
35
  type UserPayload = {
@@ -225,7 +228,7 @@ declare global {
225
228
  type SubChannelPayload<T extends Amity.MessageContentType = any> = {
226
229
  messageFeeds: Amity.RawSubChannel[];
227
230
  messages: Amity.RawMessage<T>[];
228
- users: Amity.InternalUser[];
231
+ users: Amity.RawUser[];
229
232
  files: Amity.File[];
230
233
  };
231
234
 
@@ -297,6 +300,12 @@ declare global {
297
300
  files: Amity.File[];
298
301
  };
299
302
 
303
+ type CommunityJoinRequestPayload = {
304
+ joinRequests: Amity.RawJoinRequest[];
305
+ users: Amity.RawUser[];
306
+ files: Amity.File[];
307
+ };
308
+
300
309
  type RecommendedCommunityPayload = Amity.CommunityPayload;
301
310
  type TrendingCommunityPayload = Amity.CommunityPayload;
302
311
 
@@ -306,8 +315,18 @@ declare global {
306
315
  * - communityUsers: `Amity.RawMembership` -> `Amity.Membership` (Add user getter prop)
307
316
  */
308
317
  type ProcessedCommunityPayload = Omit<CommunityPayload, 'communities' | 'communityUsers'> & {
309
- communities: Amity.Community[];
318
+ communities: Amity.InternalCommunity[];
310
319
  communityUsers: Amity.Membership<'community'>[];
320
+ users: Amity.InternalUser[];
321
+ };
322
+
323
+ type ProcessedJoinRequestPayload = Omit<
324
+ CommunityJoinRequestPayload,
325
+ 'communities' | 'communityUsers' | 'joinRequests' | 'users'
326
+ > & {
327
+ joinRequests: Amity.InternalJoinRequest[];
328
+ files: Amity.File[];
329
+ users: Amity.InternalUser[];
311
330
  };
312
331
 
313
332
  type CategoryPayload = {
@@ -333,7 +352,7 @@ declare global {
333
352
  CommunityMembershipPayload,
334
353
  'communities' | 'communityUsers'
335
354
  > & {
336
- communities: Amity.Community[];
355
+ communities: Amity.InternalCommunity[];
337
356
  communityUsers: Amity.Membership<'community'>[];
338
357
  };
339
358
 
@@ -383,7 +402,7 @@ declare global {
383
402
  Amity.StoryTargetPayload;
384
403
 
385
404
  type ProcessedGlobalStoryFeed = Omit<GlobalStoryFeedPayload, 'communities'> & {
386
- communities: Amity.Community[];
405
+ communities: Amity.InternalCommunity[];
387
406
  };
388
407
 
389
408
  // Original Payload form BE
@@ -436,7 +455,7 @@ declare global {
436
455
  */
437
456
  type ProcessedPostPayload = Omit<PostPayload, 'communities' | 'communityUsers' | 'posts'> & {
438
457
  posts: Amity.InternalPost[];
439
- communities: Amity.Community[];
458
+ communities: Amity.InternalCommunity[];
440
459
  communityUsers: Amity.Membership<'community'>[];
441
460
  };
442
461
 
@@ -545,5 +564,29 @@ declare global {
545
564
  Amity.Flaggable &
546
565
  Amity.Taggable &
547
566
  Amity.Timestamps;
567
+
568
+ type InvitationPayload = {
569
+ invitations: Amity.RawInvitation[];
570
+ users: Amity.RawUser[];
571
+ };
572
+
573
+ type ProcessedInvitationPayload = {
574
+ invitations: Amity.InternalInvitation[];
575
+ users: Amity.InternalUser[];
576
+ };
577
+
578
+ type MyInvitationsPayload = {
579
+ invitations: Amity.RawInvitation[];
580
+ users: Amity.RawUser[];
581
+ };
582
+
583
+ type ProcessedMyInvitationsPayload = {
584
+ invitations: Amity.InternalInvitation[];
585
+ users: Amity.InternalUser[];
586
+ };
587
+
588
+ type JoinRequestPayload = {
589
+ joinRequests: Amity.RawJoinRequest[];
590
+ };
548
591
  }
549
592
  }
@@ -1,10 +1,17 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import { Emitter } from 'mitt';
3
3
 
4
+ export const enum MembershipAcceptanceTypeEnum {
5
+ AUTOMATIC = 'automatic',
6
+ INVITATION = 'invitation',
7
+ }
8
+
4
9
  declare global {
5
10
  namespace Amity {
6
11
  type Logger = (topic: string, ...args: any[]) => void;
7
12
 
13
+ type MembershipAcceptanceType = MembershipAcceptanceTypeEnum;
14
+
8
15
  const enum TokenTerminationReason {
9
16
  GLOBAL_BAN = 'globalBan',
10
17
  USER_DELETED = 'userDeleted',
@@ -124,7 +131,12 @@ declare global {
124
131
  showMyPost: boolean;
125
132
  showOnlyMyFeed: boolean;
126
133
  };
134
+ story: {
135
+ allowAllUserToCreateStory: boolean;
136
+ expiryTimeMinutes: number;
137
+ };
127
138
  userPrivacySetting: 'public' | 'private';
139
+ membershipAcceptance: Amity.MembershipAcceptanceType;
128
140
  };
129
141
 
130
142
  type ConnectClientParams = {
@@ -95,17 +95,25 @@ declare global {
95
95
  hasFlaggedPost: boolean;
96
96
 
97
97
  allowCommentInStory?: boolean;
98
+
99
+ isDiscoverable?: boolean;
100
+ requiresJoinApproval?: boolean;
98
101
  } & Amity.Taggable &
99
102
  Amity.Metadata &
100
103
  Amity.Timestamps &
101
104
  Amity.SoftDelete &
102
105
  Amity.Subscribable;
103
106
 
104
- type Community = Omit<Amity.RawCommunity, 'onlyAdminCanPost' | 'needApprovalOnPostCreation'> &
107
+ type InternalCommunity = Omit<
108
+ Amity.RawCommunity,
109
+ 'onlyAdminCanPost' | 'needApprovalOnPostCreation'
110
+ > &
105
111
  Amity.CommunityStorySettings & {
106
112
  postSetting?: ValueOf<typeof CommunityPostSettings>;
107
113
  };
108
114
 
115
+ type Community = Amity.InternalCommunity & Amity.CommunityLinkedObject;
116
+
109
117
  type QueryCommunities = {
110
118
  membership?: 'all' | 'member' | 'notMember';
111
119
  categoryId?: Amity.InternalCategory['categoryId'];
@@ -114,6 +122,17 @@ declare global {
114
122
  sortBy?: Amity.CommunitySortBy | Amity.CommunitySortByEnum;
115
123
  page?: string;
116
124
  limit?: number;
125
+ includeDiscoverablePrivateCommunity?: boolean;
126
+ };
127
+
128
+ type QueryJoinCommunity = {
129
+ communityId: string;
130
+ status: Amity.JoinRequestStatus;
131
+ sortBy?: Amity.CommunitySortBy | Amity.CommunitySortByEnum;
132
+ options?: {
133
+ limit?: number;
134
+ token?: string;
135
+ };
117
136
  };
118
137
 
119
138
  type SearchQueryCommunities = {
@@ -125,12 +144,46 @@ declare global {
125
144
  sortBy?: Amity.SearchCommunitySortBy | Amity.SearchCommunitySortByEnum;
126
145
  page?: string;
127
146
  limit?: number;
147
+ includeDiscoverablePrivateCommunity?: boolean;
148
+ };
149
+
150
+ type QueryJoinRequest = {
151
+ communityId: string;
152
+ status: Amity.JoinRequestStatus;
153
+ targetType: 'community';
154
+ type: Amity.JoinRequestType;
155
+ sortBy?: Amity.CommunitySortBy | Amity.CommunitySortByEnum;
156
+ options?: {
157
+ limit?: number;
158
+ token?: string;
159
+ };
160
+ page?: string;
161
+ };
162
+
163
+ type QueryJoinRequestList = {
164
+ communityIds: string[];
165
+ sortBy?: Amity.CommunitySortBy | Amity.CommunitySortByEnum;
166
+ options?: {
167
+ limit?: number;
168
+ token?: string;
169
+ };
170
+ page?: string;
128
171
  };
129
172
 
130
173
  type CommunityLiveCollection = Amity.LiveCollectionParams<Omit<QueryCommunities, 'page'>>;
131
174
 
132
- type RecommendedCommunityLiveCollection = Amity.LiveCollectionParams<{ limit?: number }>;
133
- type TrendingCommunityLiveCollection = Amity.LiveCollectionParams<{ limit?: number }>;
175
+ type RecommendedCommunityLiveCollection = Amity.LiveCollectionParams<{
176
+ limit?: number;
177
+ includeDiscoverablePrivateCommunity?: boolean;
178
+ }>;
179
+ type TrendingCommunityLiveCollection = Amity.LiveCollectionParams<{
180
+ limit?: number;
181
+ includeDiscoverablePrivateCommunity?: boolean;
182
+ }>;
183
+
184
+ type JoinRequestLiveCollection = Amity.LiveCollectionParams<QueryJoinRequest>;
185
+
186
+ type JoinRequestListLiveCollection = Amity.LiveCollectionParams<QueryJoinRequestList>;
134
187
 
135
188
  type SearchCommunityLiveCollection = Amity.LiveCollectionParams<
136
189
  Omit<SearchQueryCommunities, 'page'>
@@ -149,6 +202,16 @@ declare global {
149
202
  Pick<SearchQueryCommunities, 'page'>
150
203
  >;
151
204
 
205
+ type JoinRequestLiveCollectionCache = Amity.LiveCollectionCache<
206
+ Amity.JoinRequest['joinRequestId'],
207
+ Pick<QueryJoinRequest, 'page'>
208
+ >;
209
+
210
+ type JoinRequestListLiveCollectionCache = Amity.LiveCollectionCache<
211
+ Amity.JoinRequest['joinRequestId'],
212
+ Pick<QueryJoinRequestList, 'page'>
213
+ >;
214
+
152
215
  type QueryCommunityMembers = {
153
216
  communityId: string;
154
217
  memberships?: ('banned' | 'member')[];
@@ -197,6 +260,7 @@ declare global {
197
260
  token?: string;
198
261
  };
199
262
  tags?: string[];
263
+ includeDiscoverablePrivateCommunity?: boolean;
200
264
  };
201
265
 
202
266
  type SemanticSearchCommunityLiveCollection = Amity.LiveCollectionParams<
@@ -209,5 +273,20 @@ declare global {
209
273
  Amity.Community['communityId'], // communityId:score
210
274
  QuerySemanticSearchCommunity
211
275
  >;
276
+
277
+ type CommunityLinkedObject = {
278
+ createInvitations: (userIds: string[]) => Promise<void>;
279
+ getMemberInvitations: (
280
+ params: Pick<Amity.InvitationLiveCollection, 'limit' | 'sortBy' | 'statuses'>,
281
+ callback: Amity.LiveCollectionCallback<Amity.Invitation>,
282
+ ) => Amity.Unsubscriber;
283
+ getInvitation: () => Promise<Amity.Invitation | undefined>;
284
+ join: () => Promise<Amity.JoinResult>;
285
+ getJoinRequests: (
286
+ params: QueryJoinRequest,
287
+ callback: Amity.LiveCollectionCallback<Amity.JoinRequest>,
288
+ ) => Amity.Unsubscriber;
289
+ getMyJoinRequest: () => Promise<Amity.JoinRequest | undefined>;
290
+ };
212
291
  }
213
292
  }
@@ -24,7 +24,15 @@ declare global {
24
24
  | Exclude<`${ContentFlagReasonEnum}`, `${ContentFlagReasonEnum.Others}`>
25
25
  | (string & {});
26
26
 
27
- type ContentType = 'text' | 'image' | 'file' | 'video' | 'poll' | 'json' | string;
27
+ type ContentType =
28
+ | 'text'
29
+ | 'image'
30
+ | 'file'
31
+ | 'video'
32
+ | 'poll'
33
+ | 'json'
34
+ | 'liveStream'
35
+ | string;
28
36
 
29
37
  type ContentFeedType = ValueOf<typeof ContentFeedType>;
30
38
 
@@ -58,6 +66,10 @@ declare global {
58
66
  pollId: Amity.Poll['pollId'];
59
67
  };
60
68
 
69
+ type ContentDataStream = {
70
+ streamId: Amity.Stream['streamId'];
71
+ };
72
+
61
73
  type ContentData<T extends ContentType> = T extends 'text'
62
74
  ? ContentDataText
63
75
  : T extends 'file'
@@ -68,6 +80,8 @@ declare global {
68
80
  ? ContentDataVideo
69
81
  : T extends 'poll'
70
82
  ? ContentDataPoll
83
+ : T extends 'liveStream'
84
+ ? ContentDataStream
71
85
  : T extends 'json'
72
86
  ? Record<string, unknown>
73
87
  : T extends string
@@ -0,0 +1,119 @@
1
+ export {};
2
+
3
+ export const enum InvitationTypeEnum {
4
+ CommunityMemberInvite = 'communityMemberInvite',
5
+ LivestreamInvite = 'livestreamInvite',
6
+ }
7
+
8
+ export const enum InvitationStatusEnum {
9
+ Pending = 'pending',
10
+ Approved = 'approved',
11
+ Rejected = 'rejected',
12
+ Cancelled = 'cancelled',
13
+ }
14
+
15
+ export const enum InvitationSortByEnum {
16
+ FirstCreated = 'firstCreated',
17
+ LastCreated = 'lastCreated',
18
+ }
19
+
20
+ declare global {
21
+ namespace Amity {
22
+ type InvitationType = InvitationTypeEnum;
23
+
24
+ type InvitationStatus = InvitationStatusEnum;
25
+
26
+ type InvitationTargetType = Extract<Amity.Domain, 'community'>;
27
+
28
+ type InvitationTargetMap = {
29
+ community: Amity.InternalCommunity;
30
+ };
31
+
32
+ type InvitationTarget<T extends InvitationTargetType> = InvitationTargetMap[T];
33
+
34
+ type InvitationSortBy = InvitationSortByEnum;
35
+
36
+ type InvitationDomain<T extends Amity.InvitationTargetType = Amity.InvitationTargetType> =
37
+ T extends 'community' ? { communityId: string } : { communityId?: string };
38
+
39
+ type RawInvitation = {
40
+ _id: string;
41
+ networkId: string;
42
+ type: Amity.InvitationType;
43
+ targetId: string;
44
+ targetType: Amity.InvitationTargetType;
45
+ userId: string;
46
+ status: Amity.InvitationStatus;
47
+ respondedAt: Amity.timestamp;
48
+ createdBy: string;
49
+ invitationId: string;
50
+ invitedUserId: string;
51
+ invitedUserInternalId: string;
52
+ invitedUserPublicId: string;
53
+ inviterUserId: string;
54
+ inviterUserInternalId: string;
55
+ inviterUserPublicId: string;
56
+ } & Amity.Timestamps &
57
+ Amity.InvitationDomain<Amity.InvitationTargetType>;
58
+
59
+ type InternalInvitation = Omit<RawInvitation, 'createdBy'> & {
60
+ createdById: string;
61
+ };
62
+
63
+ type Invitation = Omit<Amity.InternalInvitation, 'createdBy'> &
64
+ Amity.InvitationLinkedObject & {
65
+ user?: Amity.User;
66
+ createdById: string;
67
+ createdBy?: Amity.User;
68
+ target?: Amity.InvitationTarget<Amity.InvitationTargetType>;
69
+ };
70
+
71
+ type QueryInvitations = {
72
+ targetId: string;
73
+ statuses?: string[];
74
+ token?: Amity.Token;
75
+ type: Amity.InvitationType;
76
+ sortBy?: Amity.InvitationSortBy;
77
+ limit?: Amity.PageLimit['limit'];
78
+ targetType: Amity.InvitationTargetType;
79
+ };
80
+
81
+ type InvitationLiveCollection = Amity.LiveCollectionParams<Omit<QueryInvitations, 'limit'>>;
82
+
83
+ type InvitationLiveCollectionCache = Amity.LiveCollectionCache<
84
+ Amity.InternalInvitation['_id'],
85
+ Pick<QueryInvitations, 'limit'>
86
+ >;
87
+
88
+ type QueryMyInvitations = {
89
+ targetId?: string;
90
+ token?: Amity.Token;
91
+ type?: Amity.InvitationType;
92
+ sortBy?: Amity.InvitationSortBy;
93
+ limit?: Amity.PageLimit['limit'];
94
+ statuses?: InvitationStatusEnum[];
95
+ targetType?: Amity.InvitationTargetType;
96
+ };
97
+
98
+ type MyInvitationsLiveCollection = Amity.LiveCollectionParams<
99
+ Omit<QueryMyInvitations, 'limit'>
100
+ >;
101
+
102
+ type MyInvitationsLiveCollectionCache = Amity.LiveCollectionCache<
103
+ Amity.InternalInvitation['_id'],
104
+ Pick<QueryMyInvitations, 'limit'>
105
+ >;
106
+
107
+ type InvitationLinkedObject = {
108
+ accept: () => Promise<void>;
109
+ reject: () => Promise<void>;
110
+ };
111
+
112
+ type CreateInvitations = {
113
+ type: Amity.InvitationType;
114
+ targetType: Amity.InvitationTargetType;
115
+ targetId: string;
116
+ userIds: string[];
117
+ };
118
+ }
119
+ }
@@ -0,0 +1,66 @@
1
+ export {};
2
+
3
+ export const enum JoinRequestStatusEnum {
4
+ Pending = 'pending',
5
+ Approved = 'approved',
6
+ Rejected = 'rejected',
7
+ Cancelled = 'cancelled',
8
+ }
9
+
10
+ export const enum JoinResultStatusEnum {
11
+ Success = 'success',
12
+ Pending = 'pending',
13
+ }
14
+
15
+ declare global {
16
+ namespace Amity {
17
+ type JoinRequestStatus = JoinRequestStatusEnum;
18
+
19
+ type JoinResultStatus = JoinResultStatusEnum;
20
+
21
+ type JoinRequestType = 'communityJoinRequest';
22
+
23
+ type JoinResult = {
24
+ status: Amity.JoinResultStatus;
25
+ request?: Amity.JoinRequest;
26
+ };
27
+
28
+ type RawJoinRequest = {
29
+ _id: string;
30
+ createdAt: Amity.timestamp;
31
+ joinRequestId: string;
32
+ networkId: string;
33
+
34
+ requestorId: string;
35
+ requestorInternalId: string;
36
+ requestorPublicId: string;
37
+
38
+ respondedAt: Amity.timestamp | null;
39
+ responderId: string | null;
40
+ responderInternalId: string | null;
41
+ responderPublicId: string | null;
42
+
43
+ status: Amity.JoinRequestStatus;
44
+ targetId: string;
45
+ targetType: string;
46
+ type: Amity.JoinRequestType;
47
+ updatedAt: Amity.timestamp;
48
+ userId: string;
49
+ };
50
+
51
+ type InternalJoinRequest = Omit<RawJoinRequest, '_id'>;
52
+
53
+ type JoinRequest = Omit<Amity.InternalJoinRequest, 'responderId'> &
54
+ Amity.JoinRequestLinkedObject & {
55
+ user?: Amity.User;
56
+ feeds?: Amity.Feed[];
57
+ files?: Amity.File[];
58
+ };
59
+
60
+ type JoinRequestLinkedObject = {
61
+ cancel: () => Promise<void>;
62
+ approve: () => Promise<void>;
63
+ reject: () => Promise<void>;
64
+ };
65
+ }
66
+ }
@@ -10,6 +10,7 @@ declare global {
10
10
  POST_REACT = 'reaction_on_post',
11
11
  COMMENT_REACT = 'reaction_on_comment',
12
12
  REPLY_REACT = 'reaction_on_reply',
13
+ RESPONSE_JOIN_REQUEST = 'respond_on_join_request',
13
14
  }
14
15
 
15
16
  const enum TrayAction {
@@ -19,6 +20,7 @@ declare global {
19
20
  REACTION = 'reaction',
20
21
  MENTION = 'mention',
21
22
  REPLY = 'reply',
23
+ JOIN_REQUEST = 'join_request',
22
24
  }
23
25
 
24
26
  type RawNotificationTrayItem = {
@@ -32,6 +32,6 @@ declare global {
32
32
  pinnedAt: Date;
33
33
  };
34
34
 
35
- type GlobalPinnedPostLiveCollection = Amity.LiveCollectionParams<Record<string, never>>;
35
+ type GlobalPinnedPostLiveCollection = Amity.LiveCollectionParams<{}>;
36
36
  }
37
37
  }
@@ -38,3 +38,8 @@ export * from './domains/post';
38
38
  export * from './domains/story';
39
39
  export * from './domains/ad';
40
40
  export * from './domains/notification';
41
+ export * from './domains/client';
42
+ export * from './domains/invitation';
43
+ export * from './domains/joinRequest';
44
+ export * from './domains/pin';
45
+ export * from './domains/pinnedPost';
@@ -1,25 +1,3 @@
1
- import { ASCError } from '~/core/errors';
2
- import { getActiveClient } from './activeClient';
3
-
4
1
  export const enableUnreadCount = () => {
5
- const client = getActiveClient();
6
-
7
- client.log('client/api/isUnreadCountEnabled', client.isUnreadCountEnabled);
8
-
9
- if (!client) {
10
- throw new ASCError(
11
- 'There is no active client',
12
- Amity.ClientError.UNKNOWN_ERROR,
13
- Amity.ErrorLevel.FATAL,
14
- );
15
- }
16
-
17
- if (client.isUnreadCountEnabled) return false;
18
-
19
- client.isUnreadCountEnabled = true;
20
- client.useLegacyUnreadCount = false;
21
-
22
- client.emitter.emit('unreadCountEnabled', true);
23
-
24
2
  return true;
25
3
  };
@@ -26,7 +26,6 @@ import { onTokenTerminated } from '../events/onTokenTerminated';
26
26
  import { setClientToken } from '../utils/setClientToken';
27
27
  import { removeChannelMarkerCache } from '../utils/removeChannelMarkerCache';
28
28
  import { initializeMessagePreviewSetting } from '../utils/messagePreviewEngine';
29
- import { startMarkerSync } from '../utils/markerSyncEngine';
30
29
  import { ASCError } from '~/core/errors';
31
30
  import SessionWatcher from '../utils/SessionWatcher';
32
31
 
@@ -207,9 +206,6 @@ export const login = async (
207
206
  if (client.useLegacyUnreadCount) {
208
207
  subscriptions.push(readReceiptSyncEngineOnLoginHandler());
209
208
  } else subscriptions.push(legacyReadReceiptSyncEngineOnLoginHandler());
210
-
211
- const markerSyncUnsubscriber = await startMarkerSync();
212
- subscriptions.push(markerSyncUnsubscriber);
213
209
  }
214
210
 
215
211
  return true;
@@ -14,7 +14,6 @@ import { onSubChannelDeleted } from '~/subChannelRepository/events/onSubChannelD
14
14
  import { isUnreadCountSupport } from '~/subChannelRepository/utils';
15
15
 
16
16
  import { markerSync } from '../api/markerSync';
17
- import { enableUnreadCount } from '../api/enableUnreadCount';
18
17
 
19
18
  import { onOnline } from './onOnline';
20
19
  import { onUserFeedMarkerUpdated } from '~/marker/events/onUserFeedMarkerUpdated';
@@ -27,7 +26,7 @@ let isSyncRunning = false;
27
26
  let disposers: (() => void)[] = [];
28
27
  let isWaitingForResponse = false;
29
28
 
30
- let isConsistentMode = true;
29
+ const isConsistentMode = true;
31
30
  let deviceLastSyncAt: Date | null = null;
32
31
 
33
32
  const getDeviceLastSyncAt = () => {
@@ -178,17 +177,7 @@ const unRegisterEventListeners = () => {
178
177
  disposers = [];
179
178
  };
180
179
 
181
- export const startMarkerSync = async () => {
182
- await fetchDeviceLastSyncAt();
183
- pushMarkerSyncEvent(Amity.MarkerSyncEvent.START_SYNCING);
184
-
185
- isConsistentMode = true;
186
- isSyncRunning = true;
187
-
188
- registerEventListeners();
189
-
190
- return unRegisterEventListeners;
191
- };
180
+ export const startMarkerSync = async () => Promise.resolve();
192
181
 
193
182
  /**
194
183
  ```js
@@ -201,17 +190,7 @@ export const startMarkerSync = async () => {
201
190
  *
202
191
  * @category Marker API
203
192
  */
204
- export const startUnreadSync = async () => {
205
- await fetchDeviceLastSyncAt();
206
- pushMarkerSyncEvent(Amity.MarkerSyncEvent.START_SYNCING);
207
-
208
- enableUnreadCount();
209
-
210
- isConsistentMode = false;
211
- isSyncRunning = true;
212
-
213
- registerEventListeners();
214
- };
193
+ export const startUnreadSync = async () => Promise.resolve();
215
194
 
216
195
  /**
217
196
  ```js
@@ -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
  };