@amityco/ts-sdk 7.5.3 → 7.5.4-2d34fd5f.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 (388) 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 +11 -2
  13. package/dist/@types/domains/content.d.ts.map +1 -1
  14. package/dist/@types/domains/feed.d.ts +2 -1
  15. package/dist/@types/domains/feed.d.ts.map +1 -1
  16. package/dist/@types/domains/file.d.ts +3 -1
  17. package/dist/@types/domains/file.d.ts.map +1 -1
  18. package/dist/@types/domains/invitation.d.ts +92 -0
  19. package/dist/@types/domains/invitation.d.ts.map +1 -0
  20. package/dist/@types/domains/joinRequest.d.ts +53 -0
  21. package/dist/@types/domains/joinRequest.d.ts.map +1 -0
  22. package/dist/@types/domains/notification.d.ts +4 -2
  23. package/dist/@types/domains/notification.d.ts.map +1 -1
  24. package/dist/@types/domains/pinnedPost.d.ts +1 -1
  25. package/dist/@types/domains/pinnedPost.d.ts.map +1 -1
  26. package/dist/@types/domains/post.d.ts +3 -0
  27. package/dist/@types/domains/post.d.ts.map +1 -1
  28. package/dist/@types/index.d.ts +5 -0
  29. package/dist/@types/index.d.ts.map +1 -1
  30. package/dist/communityRepository/api/createCommunity.d.ts +2 -2
  31. package/dist/communityRepository/api/createCommunity.d.ts.map +1 -1
  32. package/dist/communityRepository/api/deleteCommunity.d.ts.map +1 -1
  33. package/dist/communityRepository/api/getCommunities.d.ts +1 -1
  34. package/dist/communityRepository/api/getCommunities.d.ts.map +1 -1
  35. package/dist/communityRepository/api/getCommunity.d.ts +2 -2
  36. package/dist/communityRepository/api/getCommunity.d.ts.map +1 -1
  37. package/dist/communityRepository/api/getRecommendedCommunities.d.ts +3 -1
  38. package/dist/communityRepository/api/getRecommendedCommunities.d.ts.map +1 -1
  39. package/dist/communityRepository/api/getTrendingCommunities.d.ts +3 -1
  40. package/dist/communityRepository/api/getTrendingCommunities.d.ts.map +1 -1
  41. package/dist/communityRepository/api/joinCommunity.d.ts +3 -0
  42. package/dist/communityRepository/api/joinCommunity.d.ts.map +1 -1
  43. package/dist/communityRepository/api/queryCommunities.d.ts.map +1 -1
  44. package/dist/communityRepository/api/updateCommunity.d.ts +2 -2
  45. package/dist/communityRepository/api/updateCommunity.d.ts.map +1 -1
  46. package/dist/communityRepository/communityMembership/events/index.d.ts +1 -0
  47. package/dist/communityRepository/communityMembership/events/index.d.ts.map +1 -1
  48. package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts +1 -1
  49. package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts.map +1 -1
  50. package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts +1 -1
  51. package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts.map +1 -1
  52. package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts +1 -1
  53. package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts.map +1 -1
  54. package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts +1 -1
  55. package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts.map +1 -1
  56. package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts +1 -1
  57. package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts.map +1 -1
  58. package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts +1 -1
  59. package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts.map +1 -1
  60. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts +1 -1
  61. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts.map +1 -1
  62. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts +1 -1
  63. package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts.map +1 -1
  64. package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts +1 -1
  65. package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts.map +1 -1
  66. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoin.d.ts +2 -0
  67. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoin.d.ts.map +1 -0
  68. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts +1 -1
  69. package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts.map +1 -1
  70. package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts +1 -1
  71. package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts.map +1 -1
  72. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts +1 -1
  73. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts.map +1 -1
  74. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts +1 -1
  75. package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts.map +1 -1
  76. package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts +1 -1
  77. package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts.map +1 -1
  78. package/dist/communityRepository/communityMembership/events/utils.d.ts +2 -2
  79. package/dist/communityRepository/communityMembership/events/utils.d.ts.map +1 -1
  80. package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts +2 -2
  81. package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts.map +1 -1
  82. package/dist/communityRepository/communityMembership/observers/getMembers/enums.d.ts +2 -1
  83. package/dist/communityRepository/communityMembership/observers/getMembers/enums.d.ts.map +1 -1
  84. package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts +2 -2
  85. package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts.map +1 -1
  86. package/dist/communityRepository/communityMembership/observers/searchMembers/enums.d.ts +1 -0
  87. package/dist/communityRepository/communityMembership/observers/searchMembers/enums.d.ts.map +1 -1
  88. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts +1 -1
  89. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts.map +1 -1
  90. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts +1 -1
  91. package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts.map +1 -1
  92. package/dist/communityRepository/events/onCommunityCreated.d.ts +1 -1
  93. package/dist/communityRepository/events/onCommunityCreated.d.ts.map +1 -1
  94. package/dist/communityRepository/events/onCommunityDeleted.d.ts +1 -1
  95. package/dist/communityRepository/events/onCommunityDeleted.d.ts.map +1 -1
  96. package/dist/communityRepository/events/onCommunityUpdated.d.ts +1 -1
  97. package/dist/communityRepository/events/onCommunityUpdated.d.ts.map +1 -1
  98. package/dist/communityRepository/events/utils.d.ts +1 -1
  99. package/dist/communityRepository/events/utils.d.ts.map +1 -1
  100. package/dist/communityRepository/internalAPI/getMyJoinRequest.d.ts +16 -0
  101. package/dist/communityRepository/internalAPI/getMyJoinRequest.d.ts.map +1 -0
  102. package/dist/communityRepository/internalAPI/joinCommunity.d.ts +16 -0
  103. package/dist/communityRepository/internalAPI/joinCommunity.d.ts.map +1 -0
  104. package/dist/communityRepository/joinRequest/events/index.d.ts +4 -0
  105. package/dist/communityRepository/joinRequest/events/index.d.ts.map +1 -0
  106. package/dist/communityRepository/joinRequest/events/onJoinRequestCreated.d.ts +17 -0
  107. package/dist/communityRepository/joinRequest/events/onJoinRequestCreated.d.ts.map +1 -0
  108. package/dist/communityRepository/joinRequest/events/onJoinRequestDeleted.d.ts +17 -0
  109. package/dist/communityRepository/joinRequest/events/onJoinRequestDeleted.d.ts.map +1 -0
  110. package/dist/communityRepository/joinRequest/events/onJoinRequestUpdated.d.ts +17 -0
  111. package/dist/communityRepository/joinRequest/events/onJoinRequestUpdated.d.ts.map +1 -0
  112. package/dist/communityRepository/joinRequest/internalAPI/approveJoinRequest.d.ts +16 -0
  113. package/dist/communityRepository/joinRequest/internalAPI/approveJoinRequest.d.ts.map +1 -0
  114. package/dist/communityRepository/joinRequest/internalAPI/cancelJoinRequest.d.ts +16 -0
  115. package/dist/communityRepository/joinRequest/internalAPI/cancelJoinRequest.d.ts.map +1 -0
  116. package/dist/communityRepository/joinRequest/internalAPI/rejectJoinRequest.d.ts +16 -0
  117. package/dist/communityRepository/joinRequest/internalAPI/rejectJoinRequest.d.ts.map +1 -0
  118. package/dist/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.d.ts.map +1 -1
  119. package/dist/communityRepository/observers/getCommunities/CommunitiesPaginationController.d.ts.map +1 -1
  120. package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts +2 -2
  121. package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts.map +1 -1
  122. package/dist/communityRepository/observers/getCommunity.d.ts.map +1 -1
  123. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.d.ts +14 -0
  124. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.d.ts.map +1 -0
  125. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.d.ts +9 -0
  126. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.d.ts.map +1 -0
  127. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.d.ts +15 -0
  128. package/dist/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.d.ts.map +1 -0
  129. package/dist/communityRepository/observers/getJoinRequestList/enum.d.ts +6 -0
  130. package/dist/communityRepository/observers/getJoinRequestList/enum.d.ts.map +1 -0
  131. package/dist/communityRepository/observers/getJoinRequestList.d.ts +12 -0
  132. package/dist/communityRepository/observers/getJoinRequestList.d.ts.map +1 -0
  133. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.d.ts +14 -0
  134. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.d.ts.map +1 -0
  135. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.d.ts +9 -0
  136. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.d.ts.map +1 -0
  137. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.d.ts +15 -0
  138. package/dist/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.d.ts.map +1 -0
  139. package/dist/communityRepository/observers/getJoinRequests/enum.d.ts +6 -0
  140. package/dist/communityRepository/observers/getJoinRequests/enum.d.ts.map +1 -0
  141. package/dist/communityRepository/observers/getJoinRequests.d.ts +12 -0
  142. package/dist/communityRepository/observers/getJoinRequests.d.ts.map +1 -0
  143. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesLiveCollectionController.d.ts.map +1 -1
  144. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesPaginationController.d.ts.map +1 -1
  145. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts +2 -2
  146. package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts.map +1 -1
  147. package/dist/communityRepository/observers/getRecommendedCommunities/enums.d.ts +2 -1
  148. package/dist/communityRepository/observers/getRecommendedCommunities/enums.d.ts.map +1 -1
  149. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesLiveCollectionController.d.ts.map +1 -1
  150. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesPaginationController.d.ts.map +1 -1
  151. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts +2 -2
  152. package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts.map +1 -1
  153. package/dist/communityRepository/observers/index.d.ts +1 -0
  154. package/dist/communityRepository/observers/index.d.ts.map +1 -1
  155. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesLiveCollectionController.d.ts.map +1 -1
  156. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesPaginationController.d.ts.map +1 -1
  157. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts +2 -2
  158. package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts.map +1 -1
  159. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityLiveCollectionController.d.ts.map +1 -1
  160. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityPaginationController.d.ts.map +1 -1
  161. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts +2 -2
  162. package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts.map +1 -1
  163. package/dist/communityRepository/utils/communityWithMembership.d.ts +1 -1
  164. package/dist/communityRepository/utils/communityWithMembership.d.ts.map +1 -1
  165. package/dist/communityRepository/utils/payload.d.ts +2 -1
  166. package/dist/communityRepository/utils/payload.d.ts.map +1 -1
  167. package/dist/core/events.d.ts +3 -3
  168. package/dist/core/events.d.ts.map +1 -1
  169. package/dist/core/model/idResolvers.d.ts.map +1 -1
  170. package/dist/core/model/index.d.ts.map +1 -1
  171. package/dist/feedRepository/api/getCustomRankingGlobalFeed.d.ts +1 -1
  172. package/dist/feedRepository/api/getCustomRankingGlobalFeed.d.ts.map +1 -1
  173. package/dist/feedRepository/api/queryGlobalFeed.d.ts.map +1 -1
  174. package/dist/fileRepository/api/index.d.ts +1 -0
  175. package/dist/fileRepository/api/index.d.ts.map +1 -1
  176. package/dist/fileRepository/api/uploadClip.d.ts +17 -0
  177. package/dist/fileRepository/api/uploadClip.d.ts.map +1 -0
  178. package/dist/index.cjs.js +3047 -1474
  179. package/dist/index.d.ts +1 -0
  180. package/dist/index.d.ts.map +1 -1
  181. package/dist/index.esm.js +3265 -1693
  182. package/dist/index.umd.js +4 -4
  183. package/dist/invitationRepository/events/index.d.ts +4 -0
  184. package/dist/invitationRepository/events/index.d.ts.map +1 -0
  185. package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts +17 -0
  186. package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts.map +1 -0
  187. package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts +17 -0
  188. package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts.map +1 -0
  189. package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts +17 -0
  190. package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts.map +1 -0
  191. package/dist/invitationRepository/index.d.ts +3 -0
  192. package/dist/invitationRepository/index.d.ts.map +1 -0
  193. package/dist/invitationRepository/internalApi/acceptInvitation.d.ts +16 -0
  194. package/dist/invitationRepository/internalApi/acceptInvitation.d.ts.map +1 -0
  195. package/dist/invitationRepository/internalApi/createInvitations.d.ts +21 -0
  196. package/dist/invitationRepository/internalApi/createInvitations.d.ts.map +1 -0
  197. package/dist/invitationRepository/internalApi/getInvitation.d.ts +17 -0
  198. package/dist/invitationRepository/internalApi/getInvitation.d.ts.map +1 -0
  199. package/dist/invitationRepository/internalApi/index.d.ts +4 -0
  200. package/dist/invitationRepository/internalApi/index.d.ts.map +1 -0
  201. package/dist/invitationRepository/internalApi/rejectInvitation.d.ts +16 -0
  202. package/dist/invitationRepository/internalApi/rejectInvitation.d.ts.map +1 -0
  203. package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts +14 -0
  204. package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts.map +1 -0
  205. package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts +5 -0
  206. package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts.map +1 -0
  207. package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts +15 -0
  208. package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts.map +1 -0
  209. package/dist/invitationRepository/observers/getInvitations/enums.d.ts +6 -0
  210. package/dist/invitationRepository/observers/getInvitations/enums.d.ts.map +1 -0
  211. package/dist/invitationRepository/observers/getInvitations.d.ts +12 -0
  212. package/dist/invitationRepository/observers/getInvitations.d.ts.map +1 -0
  213. package/dist/invitationRepository/observers/getMyCommunityInvitations.d.ts +12 -0
  214. package/dist/invitationRepository/observers/getMyCommunityInvitations.d.ts.map +1 -0
  215. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.d.ts +14 -0
  216. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.d.ts.map +1 -0
  217. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.d.ts +5 -0
  218. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.d.ts.map +1 -0
  219. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.d.ts +15 -0
  220. package/dist/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.d.ts.map +1 -0
  221. package/dist/invitationRepository/observers/index.d.ts +2 -0
  222. package/dist/invitationRepository/observers/index.d.ts.map +1 -0
  223. package/dist/invitationRepository/utils/convertRawInvitationToInternalInvitation.d.ts +2 -0
  224. package/dist/invitationRepository/utils/convertRawInvitationToInternalInvitation.d.ts.map +1 -0
  225. package/dist/invitationRepository/utils/index.d.ts +2 -0
  226. package/dist/invitationRepository/utils/index.d.ts.map +1 -0
  227. package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts +2 -0
  228. package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts.map +1 -0
  229. package/dist/invitationRepository/utils/prepareMyInvitationsPayload.d.ts +2 -0
  230. package/dist/invitationRepository/utils/prepareMyInvitationsPayload.d.ts.map +1 -0
  231. package/dist/messagePreview/utils/getSubChannelMessagePreviewWithUser.d.ts +1 -1
  232. package/dist/postRepository/api/createClipPost.d.ts +32 -0
  233. package/dist/postRepository/api/createClipPost.d.ts.map +1 -0
  234. package/dist/postRepository/api/index.d.ts +1 -0
  235. package/dist/postRepository/api/index.d.ts.map +1 -1
  236. package/dist/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostQueryStreamController.d.ts.map +1 -1
  237. package/dist/postRepository/observers/getPinnedPosts/PinnedPostQueryStreamController.d.ts.map +1 -1
  238. package/dist/subChannelRepository/utils/prepareSubChannelPayload.d.ts.map +1 -1
  239. package/dist/utils/linkedObject/communityLinkedObject.d.ts +2 -0
  240. package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -0
  241. package/dist/utils/linkedObject/index.d.ts +3 -0
  242. package/dist/utils/linkedObject/index.d.ts.map +1 -1
  243. package/dist/utils/linkedObject/invitationLinkedObject.d.ts +2 -0
  244. package/dist/utils/linkedObject/invitationLinkedObject.d.ts.map +1 -0
  245. package/dist/utils/linkedObject/joinRequestLinkedObject.d.ts +2 -0
  246. package/dist/utils/linkedObject/joinRequestLinkedObject.d.ts.map +1 -0
  247. package/dist/utils/linkedObject/postLinkedObject.d.ts.map +1 -1
  248. package/dist/utils/postTypePredicate.d.ts +1 -0
  249. package/dist/utils/postTypePredicate.d.ts.map +1 -1
  250. package/dist/utils/tests/dummy/comment.d.ts +1 -1
  251. package/dist/utils/tests/dummy/post.d.ts +3 -3
  252. package/package.json +1 -1
  253. package/src/@types/core/events.ts +10 -0
  254. package/src/@types/core/model.ts +8 -1
  255. package/src/@types/core/payload.ts +48 -5
  256. package/src/@types/domains/client.ts +12 -0
  257. package/src/@types/domains/community.ts +82 -3
  258. package/src/@types/domains/content.ts +25 -1
  259. package/src/@types/domains/feed.ts +2 -1
  260. package/src/@types/domains/file.ts +5 -0
  261. package/src/@types/domains/invitation.ts +119 -0
  262. package/src/@types/domains/joinRequest.ts +66 -0
  263. package/src/@types/domains/notification.ts +2 -0
  264. package/src/@types/domains/pinnedPost.ts +1 -1
  265. package/src/@types/domains/post.ts +4 -0
  266. package/src/@types/index.ts +5 -0
  267. package/src/communityRepository/api/createCommunity.ts +5 -2
  268. package/src/communityRepository/api/deleteCommunity.ts +2 -1
  269. package/src/communityRepository/api/getCommunities.ts +9 -2
  270. package/src/communityRepository/api/getCommunity.ts +12 -3
  271. package/src/communityRepository/api/getRecommendedCommunities.ts +11 -4
  272. package/src/communityRepository/api/getTrendingCommunities.ts +11 -4
  273. package/src/communityRepository/api/joinCommunity.ts +4 -1
  274. package/src/communityRepository/api/queryCommunities.ts +7 -1
  275. package/src/communityRepository/api/updateCommunity.ts +13 -3
  276. package/src/communityRepository/communityMembership/events/index.ts +1 -0
  277. package/src/communityRepository/communityMembership/events/onCommunityJoined.ts +1 -1
  278. package/src/communityRepository/communityMembership/events/onCommunityLeft.ts +1 -1
  279. package/src/communityRepository/communityMembership/events/onCommunityUserAdded.ts +1 -1
  280. package/src/communityRepository/communityMembership/events/onCommunityUserBanned.ts +1 -1
  281. package/src/communityRepository/communityMembership/events/onCommunityUserChanged.ts +1 -1
  282. package/src/communityRepository/communityMembership/events/onCommunityUserRemoved.ts +1 -1
  283. package/src/communityRepository/communityMembership/events/onCommunityUserRoleAdded.ts +1 -1
  284. package/src/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.ts +1 -1
  285. package/src/communityRepository/communityMembership/events/onCommunityUserUnbanned.ts +1 -1
  286. package/src/communityRepository/communityMembership/events/onLocalCommunityJoin.ts +20 -0
  287. package/src/communityRepository/communityMembership/events/onLocalCommunityJoined.ts +1 -1
  288. package/src/communityRepository/communityMembership/events/onLocalCommunityLeft.ts +1 -1
  289. package/src/communityRepository/communityMembership/events/onLocalCommunityUserAdded.ts +1 -1
  290. package/src/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.ts +1 -1
  291. package/src/communityRepository/communityMembership/events/onUserDeleted.ts +3 -1
  292. package/src/communityRepository/communityMembership/events/utils.ts +2 -2
  293. package/src/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.ts +8 -2
  294. package/src/communityRepository/communityMembership/observers/getMembers/enums.ts +1 -0
  295. package/src/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.ts +8 -2
  296. package/src/communityRepository/communityMembership/observers/searchMembers/enums.ts +1 -0
  297. package/src/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.ts +1 -1
  298. package/src/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.ts +1 -1
  299. package/src/communityRepository/events/onCommunityCreated.ts +1 -1
  300. package/src/communityRepository/events/onCommunityDeleted.ts +1 -1
  301. package/src/communityRepository/events/onCommunityUpdated.ts +1 -1
  302. package/src/communityRepository/events/utils.ts +1 -1
  303. package/src/communityRepository/internalAPI/getMyJoinRequest.ts +43 -0
  304. package/src/communityRepository/internalAPI/joinCommunity.ts +66 -0
  305. package/src/communityRepository/joinRequest/events/index.ts +3 -0
  306. package/src/communityRepository/joinRequest/events/onJoinRequestCreated.ts +33 -0
  307. package/src/communityRepository/joinRequest/events/onJoinRequestDeleted.ts +33 -0
  308. package/src/communityRepository/joinRequest/events/onJoinRequestUpdated.ts +33 -0
  309. package/src/communityRepository/joinRequest/internalAPI/approveJoinRequest.ts +52 -0
  310. package/src/communityRepository/joinRequest/internalAPI/cancelJoinRequest.ts +49 -0
  311. package/src/communityRepository/joinRequest/internalAPI/rejectJoinRequest.ts +52 -0
  312. package/src/communityRepository/observers/getCommunities/CommunitiesLiveCollectionController.ts +6 -0
  313. package/src/communityRepository/observers/getCommunities/CommunitiesPaginationController.ts +1 -0
  314. package/src/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.ts +2 -2
  315. package/src/communityRepository/observers/getCommunity.ts +26 -11
  316. package/src/communityRepository/observers/getJoinRequestList/JoinRequestListLiveCollectionController.ts +135 -0
  317. package/src/communityRepository/observers/getJoinRequestList/JoinRequestListPaginationController.ts +30 -0
  318. package/src/communityRepository/observers/getJoinRequestList/JoinRequestListQueryStreamController.ts +116 -0
  319. package/src/communityRepository/observers/getJoinRequestList/enum.ts +5 -0
  320. package/src/communityRepository/observers/getJoinRequestList.ts +51 -0
  321. package/src/communityRepository/observers/getJoinRequests/JoinRequestsLiveCollectionController.ts +126 -0
  322. package/src/communityRepository/observers/getJoinRequests/JoinRequestsPaginationController.ts +25 -0
  323. package/src/communityRepository/observers/getJoinRequests/JoinRequestsQueryStreamController.ts +108 -0
  324. package/src/communityRepository/observers/getJoinRequests/enum.ts +5 -0
  325. package/src/communityRepository/observers/getJoinRequests.ts +44 -0
  326. package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesLiveCollectionController.ts +8 -1
  327. package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesPaginationController.ts +6 -1
  328. package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.ts +2 -2
  329. package/src/communityRepository/observers/getRecommendedCommunities/enums.ts +1 -0
  330. package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesLiveCollectionController.ts +9 -1
  331. package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesPaginationController.ts +6 -1
  332. package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.ts +2 -2
  333. package/src/communityRepository/observers/index.ts +1 -0
  334. package/src/communityRepository/observers/searchCommunities/SearchCommunitiesLiveCollectionController.ts +6 -0
  335. package/src/communityRepository/observers/searchCommunities/SearchCommunitiesPaginationController.ts +1 -0
  336. package/src/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.ts +2 -2
  337. package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityLiveCollectionController.ts +6 -0
  338. package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityPaginationController.ts +1 -0
  339. package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.ts +2 -2
  340. package/src/communityRepository/utils/communityWithMembership.ts +9 -5
  341. package/src/communityRepository/utils/payload.ts +28 -2
  342. package/src/core/liveCollection/PaginationController.ts +1 -1
  343. package/src/core/liveCollection/PaginationNoPageController.ts +1 -1
  344. package/src/core/model/idResolvers.ts +3 -0
  345. package/src/core/model/index.ts +3 -0
  346. package/src/feedRepository/api/getCustomRankingGlobalFeed.ts +1 -1
  347. package/src/feedRepository/api/queryGlobalFeed.ts +3 -1
  348. package/src/fileRepository/api/index.ts +1 -0
  349. package/src/fileRepository/api/uploadClip.ts +71 -0
  350. package/src/index.ts +2 -0
  351. package/src/invitationRepository/events/index.ts +3 -0
  352. package/src/invitationRepository/events/onLocalInvitationCreated.ts +33 -0
  353. package/src/invitationRepository/events/onLocalInvitationDeleted.ts +33 -0
  354. package/src/invitationRepository/events/onLocalInvitationUpdated.ts +33 -0
  355. package/src/invitationRepository/index.ts +2 -0
  356. package/src/invitationRepository/internalApi/acceptInvitation.ts +45 -0
  357. package/src/invitationRepository/internalApi/createInvitations.ts +52 -0
  358. package/src/invitationRepository/internalApi/getInvitation.ts +47 -0
  359. package/src/invitationRepository/internalApi/index.ts +3 -0
  360. package/src/invitationRepository/internalApi/rejectInvitation.ts +45 -0
  361. package/src/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.ts +148 -0
  362. package/src/invitationRepository/observers/getInvitations/InvitationsPaginationController.ts +19 -0
  363. package/src/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.ts +97 -0
  364. package/src/invitationRepository/observers/getInvitations/enums.ts +5 -0
  365. package/src/invitationRepository/observers/getInvitations.ts +44 -0
  366. package/src/invitationRepository/observers/getMyCommunityInvitations.ts +48 -0
  367. package/src/invitationRepository/observers/getMyInvitations/MyInvitationsLiveCollectionController.ts +148 -0
  368. package/src/invitationRepository/observers/getMyInvitations/MyInvitationsPaginationController.ts +22 -0
  369. package/src/invitationRepository/observers/getMyInvitations/MyInvitationsQueryStreamController.ts +105 -0
  370. package/src/invitationRepository/observers/index.ts +1 -0
  371. package/src/invitationRepository/utils/convertRawInvitationToInternalInvitation.ts +8 -0
  372. package/src/invitationRepository/utils/index.ts +1 -0
  373. package/src/invitationRepository/utils/prepareInvitationPayload.ts +12 -0
  374. package/src/invitationRepository/utils/prepareMyInvitationsPayload.ts +12 -0
  375. package/src/messagePreview/utils/getChannelMessagePreviewWithUser.ts +3 -3
  376. package/src/postRepository/api/createClipPost.ts +62 -0
  377. package/src/postRepository/api/index.ts +2 -0
  378. package/src/postRepository/api/queryPosts.ts +1 -1
  379. package/src/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostQueryStreamController.ts +7 -1
  380. package/src/postRepository/observers/getPinnedPosts/PinnedPostQueryStreamController.ts +7 -1
  381. package/src/postRepository/observers/getPosts/PostPaginationController.ts +1 -1
  382. package/src/subChannelRepository/utils/prepareSubChannelPayload.ts +4 -0
  383. package/src/utils/linkedObject/communityLinkedObject.ts +57 -0
  384. package/src/utils/linkedObject/index.ts +6 -0
  385. package/src/utils/linkedObject/invitationLinkedObject.ts +37 -0
  386. package/src/utils/linkedObject/joinRequestLinkedObject.ts +31 -0
  387. package/src/utils/linkedObject/postLinkedObject.ts +12 -1
  388. package/src/utils/postTypePredicate.ts +10 -0
@@ -33,7 +33,7 @@ declare global {
33
33
  feedMarker: Amity.FeedMarker;
34
34
  userMarker: Amity.UserMarker;
35
35
 
36
- community: Amity.Community;
36
+ community: Amity.InternalCommunity;
37
37
  category: Amity.InternalCategory;
38
38
  communityUsers: Amity.Membership<'community'>;
39
39
  post: Amity.InternalPost;
@@ -60,6 +60,10 @@ declare global {
60
60
 
61
61
  notificationTrayItem: Amity.InternalNotificationTrayItem;
62
62
  notificationTraySeen: Amity.InternalNotificationTraySeen;
63
+
64
+ invitation: Amity.InternalInvitation;
65
+
66
+ joinRequest: Amity.InternalJoinRequest;
63
67
  };
64
68
 
65
69
  type Model = ValueOf<Models>;
@@ -124,6 +128,9 @@ declare global {
124
128
 
125
129
  notificationTrayItem: Pick<Amity.InternalNotificationTrayItem, '_id'>;
126
130
  notificationTraySeen: Pick<Amity.InternalNotificationTraySeen, 'userId'>;
131
+
132
+ invitation: Pick<Amity.InternalInvitation, '_id'>;
133
+ joinRequest: Pick<Amity.InternalJoinRequest, 'joinRequestId'>;
127
134
  };
128
135
  }
129
136
  }
@@ -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,16 @@ 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
+ | 'clip'
36
+ | string;
28
37
 
29
38
  type ContentFeedType = ValueOf<typeof ContentFeedType>;
30
39
 
@@ -54,10 +63,21 @@ declare global {
54
63
  };
55
64
  };
56
65
 
66
+ type ContentDataClip = {
67
+ thumbnailFileId: Amity.File<'image'>['fileId'];
68
+ fileId: Amity.File<'clip'>['fileId'];
69
+ isMuted?: boolean;
70
+ displayMode?: Amity.ClipDisplayMode;
71
+ };
72
+
57
73
  type ContentDataPoll = {
58
74
  pollId: Amity.Poll['pollId'];
59
75
  };
60
76
 
77
+ type ContentDataStream = {
78
+ streamId: Amity.Stream['streamId'];
79
+ };
80
+
61
81
  type ContentData<T extends ContentType> = T extends 'text'
62
82
  ? ContentDataText
63
83
  : T extends 'file'
@@ -68,6 +88,10 @@ declare global {
68
88
  ? ContentDataVideo
69
89
  : T extends 'poll'
70
90
  ? ContentDataPoll
91
+ : T extends 'liveStream'
92
+ ? ContentDataStream
93
+ : T extends 'clip'
94
+ ? ContentDataClip
71
95
  : T extends 'json'
72
96
  ? Record<string, unknown>
73
97
  : T extends string
@@ -11,8 +11,9 @@ declare global {
11
11
  } & Amity.Timestamps;
12
12
 
13
13
  type QueryGlobalFeed = {
14
- dataType?: 'video' | 'image' | 'file' | 'liveStream';
14
+ dataTypes?: ('video' | 'image' | 'file' | 'liveStream' | 'clip')[];
15
15
  queryToken?: string;
16
+ resolveParent?: boolean;
16
17
  };
17
18
  }
18
19
  }
@@ -2,6 +2,7 @@ export const FileType = Object.freeze({
2
2
  FILE: 'file',
3
3
  IMAGE: 'image',
4
4
  VIDEO: 'video',
5
+ CLIP: 'clip',
5
6
  });
6
7
 
7
8
  export const VideoResolution = Object.freeze({
@@ -55,12 +56,16 @@ declare global {
55
56
 
56
57
  type VideoMetadata = Record<string, never>;
57
58
 
59
+ type ClipMetadata = Record<string, never>;
60
+
58
61
  type MetadataFor<T extends FileType> = T extends 'file'
59
62
  ? FileMetadata
60
63
  : T extends 'image'
61
64
  ? ImageMetadata
62
65
  : T extends 'video'
63
66
  ? VideoMetadata
67
+ : T extends 'clip'
68
+ ? ClipMetadata
64
69
  : never;
65
70
 
66
71
  type File<T extends FileType = any> = Amity.FilePayload<T>;
@@ -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
  }
@@ -5,6 +5,7 @@ export const PostContentType = Object.freeze({
5
5
  VIDEO: 'video',
6
6
  LIVESTREAM: 'liveStream',
7
7
  POLL: 'poll',
8
+ CLIP: 'clip',
8
9
  });
9
10
 
10
11
  declare global {
@@ -82,10 +83,13 @@ declare global {
82
83
  getVideoInfo: () => Amity.File<'video'> | undefined;
83
84
  getVideoThumbnailInfo: () => Amity.File<'image'> | undefined;
84
85
  getFileInfo: () => Amity.File<'file'> | undefined;
86
+ getClipInfo: () => Amity.File<'clip'> | undefined;
85
87
  };
86
88
 
87
89
  type Post<T extends PostContentType = any> = Amity.InternalPost<T> & Amity.PostLinkObject;
88
90
 
91
+ type ClipDisplayMode = 'fill' | 'fit';
92
+
89
93
  type QueryPosts = {
90
94
  targetId: string;
91
95
  targetType: Amity.InternalPost['targetType'];
@@ -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,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
  };
@@ -2,6 +2,7 @@ import { getActiveClient } from '~/client/api';
2
2
 
3
3
  import { fireEvent } from '~/core/events';
4
4
  import { getCommunity } from './getCommunity';
5
+ import { LinkedObject } from '~/utils/linkedObject';
5
6
 
6
7
  /* begin_public_function
7
8
  id: community.delete
@@ -40,6 +41,6 @@ export const deleteCommunity = async (
40
41
  users: [],
41
42
  });
42
43
 
43
- return deleted.data;
44
+ return LinkedObject.community(deleted.data);
44
45
  };
45
46
  /* end_public_function */