@flashphoner/sfusdk 2.0.279 → 2.0.284

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 (221) hide show
  1. package/dist/client.version +1 -1
  2. package/dist/sdk/constants.d.ts +79 -42
  3. package/dist/sdk/constants.js +34 -18
  4. package/dist/sdk/constants.js.map +1 -1
  5. package/dist/sdk/sfu-extended.d.ts +73 -36
  6. package/dist/sdk/sfu-extended.js +148 -54
  7. package/dist/sdk/sfu-extended.js.map +1 -1
  8. package/docs/assets/navigation.js +1 -1
  9. package/docs/assets/search.js +1 -1
  10. package/docs/classes/sfu_extended.SfuExtended.html +116 -88
  11. package/docs/enums/constants.AttachmentState.html +2 -2
  12. package/docs/enums/constants.AuthenticationStatus.html +2 -2
  13. package/docs/enums/constants.ChannelSendPolicy.html +2 -2
  14. package/docs/enums/constants.ChatError.html +2 -2
  15. package/docs/enums/constants.ChatReceivePolicy.html +2 -2
  16. package/docs/enums/constants.ChatSectionsError.html +2 -2
  17. package/docs/enums/constants.ChatType.html +2 -2
  18. package/docs/enums/constants.ConferenceType.html +2 -2
  19. package/docs/enums/constants.ConnectionType.html +2 -2
  20. package/docs/enums/constants.ContactError.html +2 -2
  21. package/docs/enums/constants.DeliveryStatus.html +2 -2
  22. package/docs/enums/constants.InternalApi.html +10 -5
  23. package/docs/enums/constants.MeetingSyncEvent.html +10 -10
  24. package/docs/enums/constants.MessageAttachmentMediaType.html +2 -2
  25. package/docs/enums/constants.MessageAttachmentType.html +2 -2
  26. package/docs/enums/constants.MessageState.html +2 -2
  27. package/docs/enums/constants.MessageTargetEntityType.html +2 -2
  28. package/docs/enums/constants.Operations.html +2 -2
  29. package/docs/enums/constants.ParticipantRole.html +2 -2
  30. package/docs/enums/constants.PresenceStatus.html +5 -0
  31. package/docs/enums/constants.RemoteSdpType.html +2 -2
  32. package/docs/enums/constants.RoomError.html +2 -2
  33. package/docs/enums/constants.RoomEvent.html +42 -42
  34. package/docs/enums/constants.RoomState.html +2 -2
  35. package/docs/enums/constants.SfuEvent.html +53 -43
  36. package/docs/enums/constants.SortOrder.html +2 -2
  37. package/docs/enums/constants.SpaceError.html +2 -2
  38. package/docs/enums/constants.SpaceEvent.html +26 -26
  39. package/docs/enums/constants.State.html +2 -2
  40. package/docs/enums/constants.StatsType.html +2 -2
  41. package/docs/enums/constants.TrackType.html +2 -2
  42. package/docs/enums/constants.UserInfoError.html +2 -2
  43. package/docs/enums/constants.UserManagementError.html +2 -2
  44. package/docs/modules/constants.html +12 -7
  45. package/docs/types/constants.AddRemoveTracks.html +1 -1
  46. package/docs/types/constants.AddRemoveTracksSync.html +1 -1
  47. package/docs/types/constants.AddedRoleToMember.html +1 -1
  48. package/docs/types/constants.Attachment.html +1 -1
  49. package/docs/types/constants.AttachmentInfo.html +1 -1
  50. package/docs/types/constants.AttachmentRequest.html +1 -1
  51. package/docs/types/constants.AttachmentRequestAck.html +1 -1
  52. package/docs/types/constants.AttachmentStatus.html +1 -1
  53. package/docs/types/constants.AttachmentStatusEvent.html +1 -1
  54. package/docs/types/constants.AuthenticationStatusEvent.html +1 -1
  55. package/docs/types/constants.BannedContact.html +1 -0
  56. package/docs/types/constants.BitrateTestStatus.html +1 -1
  57. package/docs/types/constants.BooleanEvent.html +1 -1
  58. package/docs/types/constants.Calendar.html +1 -1
  59. package/docs/types/constants.CalendarEvent.html +1 -1
  60. package/docs/types/constants.CalendarEventEvent.html +1 -1
  61. package/docs/types/constants.Chat.html +1 -1
  62. package/docs/types/constants.ChatLoadedEvent.html +1 -1
  63. package/docs/types/constants.ChatMap.html +1 -1
  64. package/docs/types/constants.ChatMessagesCount.html +1 -1
  65. package/docs/types/constants.ChatMessagesEvent.html +1 -1
  66. package/docs/types/constants.ChatSearchResultEvent.html +1 -1
  67. package/docs/types/constants.ChatsEvent.html +1 -1
  68. package/docs/types/constants.ConnectionDetails.html +1 -1
  69. package/docs/types/constants.ConnectionFailedEvent.html +1 -1
  70. package/docs/types/constants.Contact.html +1 -0
  71. package/docs/types/constants.ContactDeleted.html +1 -0
  72. package/docs/types/constants.ContactUpdated.html +1 -0
  73. package/docs/types/constants.ControlMessage.html +1 -1
  74. package/docs/types/constants.ControlMessageEvent.html +1 -1
  75. package/docs/types/constants.CreatedRoom.html +1 -1
  76. package/docs/types/constants.EvictedFromRoom.html +1 -1
  77. package/docs/types/constants.EvictedSync.html +1 -1
  78. package/docs/types/constants.FirstAndLastChatMessage.html +1 -1
  79. package/docs/types/constants.FragmentedMessage.html +1 -1
  80. package/docs/types/constants.FriendInvite.html +1 -0
  81. package/docs/types/constants.FriendInviteDeleted.html +1 -0
  82. package/docs/types/constants.InternalMessage.html +1 -1
  83. package/docs/types/constants.JoinedRoom.html +1 -1
  84. package/docs/types/constants.JoinedRoomSync.html +1 -1
  85. package/docs/types/constants.LastReadMessageUpdate.html +1 -1
  86. package/docs/types/constants.LastReadMessageUpdated.html +1 -1
  87. package/docs/types/constants.LeftMeetingSync.html +1 -1
  88. package/docs/types/constants.LeftRoom.html +1 -1
  89. package/docs/types/constants.LoadMessagesWithMentionsResult.html +1 -1
  90. package/docs/types/constants.MeetingEndedSync.html +1 -1
  91. package/docs/types/constants.MeetingNameUpdatedSync.html +1 -1
  92. package/docs/types/constants.MeetingsPreviewEvent.html +1 -1
  93. package/docs/types/constants.Message.html +1 -1
  94. package/docs/types/constants.MessageAttachment.html +1 -1
  95. package/docs/types/constants.MessageAttachmentData.html +1 -1
  96. package/docs/types/constants.MessageAttachmentsSearchResult.html +1 -1
  97. package/docs/types/constants.MessageDeleted.html +1 -1
  98. package/docs/types/constants.MessageDeliveryStatus.html +1 -1
  99. package/docs/types/constants.MessageEdited.html +1 -1
  100. package/docs/types/constants.MessageInfo.html +1 -1
  101. package/docs/types/constants.MessageStatus.html +1 -1
  102. package/docs/types/constants.MessageStatusEvent.html +1 -1
  103. package/docs/types/constants.MessageStatusUpdate.html +1 -1
  104. package/docs/types/constants.MessageTargetEntityId.html +1 -1
  105. package/docs/types/constants.MessageWithUploadingAttachments.html +1 -1
  106. package/docs/types/constants.NewChatEvent.html +1 -1
  107. package/docs/types/constants.NewContact.html +1 -0
  108. package/docs/types/constants.NewFriendInvite.html +1 -0
  109. package/docs/types/constants.NewMeeting.html +1 -1
  110. package/docs/types/constants.NewSpaceCategoryEvent.html +1 -1
  111. package/docs/types/constants.NewSpaceChannelEvent.html +1 -1
  112. package/docs/types/constants.NewSpaceEvent.html +1 -1
  113. package/docs/types/constants.NewSpaceRoleAdded.html +1 -1
  114. package/docs/types/constants.NewSpaceThreadEvent.html +1 -1
  115. package/docs/types/constants.OperationFailed.html +1 -1
  116. package/docs/types/constants.OperationFailedEvent.html +1 -1
  117. package/docs/types/constants.Participant.html +1 -1
  118. package/docs/types/constants.ParticipantAVSMutedEvent.html +1 -1
  119. package/docs/types/constants.ParticipantConfigEvent.html +1 -1
  120. package/docs/types/constants.ParticipantRenamed.html +1 -1
  121. package/docs/types/constants.ParticipantsListEvent.html +1 -1
  122. package/docs/types/constants.ParticipantsListSyncEvent.html +1 -1
  123. package/docs/types/constants.PlacedInLobbyEvent.html +1 -1
  124. package/docs/types/constants.PlacedInWaitingRoomEvent.html +1 -1
  125. package/docs/types/constants.PublicChannelsEvent.html +1 -1
  126. package/docs/types/constants.Quality.html +1 -1
  127. package/docs/types/constants.RemoteSdp.html +1 -1
  128. package/docs/types/constants.RemoteSdpInfo.html +1 -1
  129. package/docs/types/constants.RemovedChatEvent.html +1 -1
  130. package/docs/types/constants.RemovedRoleFromMember.html +1 -1
  131. package/docs/types/constants.ResetPasswordRequestStatus.html +1 -1
  132. package/docs/types/constants.RoleAssigned.html +1 -1
  133. package/docs/types/constants.RolePermissionSectionsEvent.html +1 -1
  134. package/docs/types/constants.RolesListEvent.html +1 -1
  135. package/docs/types/constants.RoomAvailable.html +1 -1
  136. package/docs/types/constants.RoomConfigEvent.html +1 -1
  137. package/docs/types/constants.RoomExtendedConfig.html +1 -1
  138. package/docs/types/constants.RoomExtendedParticipantConfig.html +1 -1
  139. package/docs/types/constants.RoomExtendedParticipantsConfig.html +1 -1
  140. package/docs/types/constants.RoomExtendedScreenSharingConfig.html +1 -1
  141. package/docs/types/constants.RoomInfo.html +1 -1
  142. package/docs/types/constants.RoomMessage.html +1 -1
  143. package/docs/types/constants.RoomNameUpdated.html +1 -1
  144. package/docs/types/constants.RoomScreenSharingConfigEvent.html +1 -1
  145. package/docs/types/constants.SFUMeetingParticipantPreview.html +1 -1
  146. package/docs/types/constants.SFUMeetingPreview.html +1 -1
  147. package/docs/types/constants.SfuMessageEvent.html +1 -1
  148. package/docs/types/constants.SfuSpace.html +1 -1
  149. package/docs/types/constants.SfuSpaceCategory.html +1 -1
  150. package/docs/types/constants.SfuSpaceChannel.html +1 -1
  151. package/docs/types/constants.SfuSpaceChannelAccessRights.html +1 -1
  152. package/docs/types/constants.SfuSpaceInvite.html +1 -1
  153. package/docs/types/constants.SfuSpaceMember.html +1 -1
  154. package/docs/types/constants.SfuSpaceRole.html +1 -1
  155. package/docs/types/constants.SfuSpaceRolePermission.html +1 -1
  156. package/docs/types/constants.SfuSpaceRolePermissionSection.html +1 -1
  157. package/docs/types/constants.SfuSpaceThread.html +1 -1
  158. package/docs/types/constants.SfuSpaceUserBan.html +1 -1
  159. package/docs/types/constants.SignUpStatus.html +1 -1
  160. package/docs/types/constants.SpaceCategoryDeleted.html +1 -1
  161. package/docs/types/constants.SpaceCategoryUpdated.html +1 -1
  162. package/docs/types/constants.SpaceChannelDeleted.html +1 -1
  163. package/docs/types/constants.SpaceChannelMoved.html +1 -1
  164. package/docs/types/constants.SpaceChannelUpdated.html +1 -1
  165. package/docs/types/constants.SpaceCreatedEvent.html +1 -1
  166. package/docs/types/constants.SpaceDeletedEvent.html +1 -1
  167. package/docs/types/constants.SpaceInviteCreated.html +1 -1
  168. package/docs/types/constants.SpaceInviteRevoked.html +1 -1
  169. package/docs/types/constants.SpaceOverviewUpdated.html +1 -1
  170. package/docs/types/constants.SpaceRoleDeleted.html +1 -1
  171. package/docs/types/constants.SpaceRoleUpdated.html +1 -1
  172. package/docs/types/constants.SpaceThreadDeleted.html +1 -1
  173. package/docs/types/constants.SpaceThreadUpdated.html +1 -1
  174. package/docs/types/constants.StopScreenSharingEvent.html +1 -1
  175. package/docs/types/constants.StopTrackEvent.html +1 -1
  176. package/docs/types/constants.TracksQualityState.html +1 -1
  177. package/docs/types/constants.UnreadMessagesCountEvent.html +1 -1
  178. package/docs/types/constants.UnreadMessagesCountUpdate.html +1 -1
  179. package/docs/types/constants.UpdateChatEvent.html +1 -1
  180. package/docs/types/constants.UpdateMessagesDeliveryStatusEvent.html +1 -1
  181. package/docs/types/constants.UploadingAttachmentInfo.html +1 -1
  182. package/docs/types/constants.UserCalendarEvent.html +1 -1
  183. package/docs/types/constants.UserContacts.html +1 -0
  184. package/docs/types/constants.UserContactsEvent.html +1 -0
  185. package/docs/types/constants.UserEmail.html +1 -1
  186. package/docs/types/constants.UserHostKey.html +1 -1
  187. package/docs/types/constants.UserHostKeyChangedEvent.html +1 -1
  188. package/docs/types/constants.UserId.html +1 -1
  189. package/docs/types/constants.UserInfo.html +1 -1
  190. package/docs/types/constants.UserInfoChangedEvent.html +1 -1
  191. package/docs/types/constants.UserInfoEvent.html +1 -1
  192. package/docs/types/constants.UserJoinedToSpaceEvent.html +1 -1
  193. package/docs/types/constants.UserLeftSpace.html +1 -1
  194. package/docs/types/constants.UserNickname.html +1 -1
  195. package/docs/types/constants.UserNicknameChangedEvent.html +1 -1
  196. package/docs/types/constants.UserPassword.html +1 -1
  197. package/docs/types/constants.UserPhoneNumber.html +1 -1
  198. package/docs/types/constants.UserPhoneNumberChangedEvent.html +1 -1
  199. package/docs/types/constants.UserPmiSettings.html +1 -1
  200. package/docs/types/constants.UserPresenceStatusUpdated.html +1 -0
  201. package/docs/types/constants.UserRoomsEvent.html +1 -1
  202. package/docs/types/constants.UserSpacesEvent.html +1 -1
  203. package/docs/types/constants.UserSpecificChatInfo.html +1 -1
  204. package/docs/types/constants.UserTimezone.html +1 -1
  205. package/docs/types/constants.UserTimezoneChangedEvent.html +1 -1
  206. package/docs/types/constants.WaitingListEvent.html +1 -1
  207. package/docs/types/constants.WaitingParticipant.html +1 -1
  208. package/docs/types/constants.WaitingRoomUpdate.html +1 -1
  209. package/docs/variables/constants.ATTACHMENT_CHUNK_SIZE.html +1 -1
  210. package/docs/variables/constants.ATTACHMENT_ID_LENGTH.html +1 -1
  211. package/docs/variables/constants.WS_CONNECTION_TIMEOUT.html +1 -1
  212. package/docs/variables/constants.WS_PINGS_MISSING_THRESHOLD.html +1 -1
  213. package/docs/variables/constants.WS_PING_INTERVAL_MS.html +1 -1
  214. package/package.json +1 -1
  215. package/docs/enums/constants.UserState.html +0 -4
  216. package/docs/types/constants.ContactInviteEvent.html +0 -1
  217. package/docs/types/constants.ContactRemovedEvent.html +0 -1
  218. package/docs/types/constants.ContactUpdateEvent.html +0 -1
  219. package/docs/types/constants.Invite.html +0 -1
  220. package/docs/types/constants.User.html +0 -1
  221. package/docs/types/constants.UserListEvent.html +0 -1
@@ -95,6 +95,8 @@ class SfuExtended {
95
95
  * @param options.username - The user's username (optional if `authToken` is provided).
96
96
  * @param options.password - The user's password (optional if `authToken` is provided).
97
97
  * @param options.authToken - The authentication token for direct login (optional if `username` and `password` are provided).
98
+ *
99
+ * After successfully connection user contacts will receive an {@link SfuEvent.USER_PRESENCE_STATUS_UPDATED} with {@link UserPresenceStatusUpdated}
98
100
  */
99
101
  connect(options) {
100
102
  if (!options) {
@@ -147,6 +149,8 @@ class SfuExtended {
147
149
  * When disconnecting, user leaves all active rooms
148
150
  *
149
151
  * {@link state} changed to {@link State.DISCONNECTED | DISCONNECTED}
152
+ *
153
+ * After disconnection user contacts will receive an {@link SfuEvent.USER_PRESENCE_STATUS_UPDATED} with {@link UserPresenceStatusUpdated}
150
154
  */
151
155
  disconnect() {
152
156
  return __awaiter(this, void 0, void 0, function* () {
@@ -752,84 +756,100 @@ class SfuExtended {
752
756
  });
753
757
  }
754
758
  /**
755
- * Get all users from server
759
+ * Get user contacts.
760
+ *
761
+ * Returns users who are friends or with whom there are mutual space channels or direct chats, incoming and outgoing friend invites, banned users.
756
762
  */
757
- getUserList() {
763
+ getContacts() {
758
764
  __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
759
765
  const self = this;
760
766
  return new Promise(function (resolve, reject) {
761
- __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_LIST, {}, resolve, reject);
767
+ __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_CONTACTS, {}, resolve, reject);
762
768
  });
763
769
  }
764
770
  ;
765
771
  /**
766
- * Invite user to contacts
772
+ * Add a friend
767
773
  *
768
- * UserId must be passed if user exist. That user will receive {@link SfuEvent.CONTACT_INVITE} with {@link Invite}
774
+ * Sends a friend invite.
775
+ * Users will receive {@link SfuEvent.NEW_OUTGOING_FRIEND_INVITE} and {@link SfuEvent.NEW_INCOMING_FRIEND_INVITE} with {@link NewFriendInvite}.
769
776
  *
770
- * UserEmail must be passed if there is no such user yet. In this case user will be created at the server side with {@link UserState.PENDING_REGISTRATION} and default parameters
777
+ * If an invite was sent to this user previously, it will be replaced with a new one.
778
+ * Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted} for previously invite.
779
+ * Users will receive {@link SfuEvent.NEW_OUTGOING_FRIEND_INVITE} and {@link SfuEvent.NEW_INCOMING_FRIEND_INVITE} with {@link NewFriendInvite} for new friend invite.
780
+ *
781
+ * If the user that you are trying to add as a friend has already sent you an invite, sending a counter-invite will automatically add you as friends.
782
+ * Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted} for invites.
783
+ * Users will receive {@link SfuEvent.CONTACT_UPDATED} with {@link ContactUpdated} if they have mutual space channels or direct chats.
784
+ * Will receive {@link SfuEvent.NEW_CONTACT} with {@link NewContact} if haven't.
771
785
  */
772
- inviteContact(invite) {
786
+ addFriend(user) {
773
787
  __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
774
788
  const self = this;
775
789
  return new Promise(function (resolve, reject) {
776
- __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.INVITE_CONTACT, { from: __classPrivateFieldGet(self, _SfuExtended__user, "f").username, to: invite.to }, resolve, reject);
790
+ __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_FRIEND, {
791
+ userId: user.userId,
792
+ }, resolve, reject);
777
793
  });
778
794
  }
779
795
  /**
780
- * Add contact to favourites
796
+ * Remove friend
781
797
  *
782
- * {@link User.favourite} will be changed to true at the server side
798
+ * Users will receive {@link SfuEvent.CONTACT_UPDATED} with {@link ContactUpdated} if they have mutual space channels or direct chats.
799
+ * Will receive {@link SfuEvent.CONTACT_DELETED} with {@link ContactDeleted} if haven't.
783
800
  */
784
- addContactToFavourites(contact) {
801
+ removeFriend(friend) {
785
802
  __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
786
803
  const self = this;
787
804
  return new Promise(function (resolve, reject) {
788
- __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_CONTACT_TO_FAVOURITES, { id: contact.id }, resolve, reject);
805
+ __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_FRIEND, {
806
+ userId: friend.userId,
807
+ }, resolve, reject);
789
808
  });
790
809
  }
791
810
  /**
792
- * Remove contact from favourites
811
+ * Revoke friend invite
793
812
  *
794
- * {@link User.favourite} will be changed to false at the server side
813
+ * Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted}.
795
814
  */
796
- removeContactFromFavourites(contact) {
815
+ revokeFriendInvite(invite) {
797
816
  __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
798
817
  const self = this;
799
818
  return new Promise(function (resolve, reject) {
800
- __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CONTACT_FROM_FAVOURITES, { id: contact.id }, resolve, reject);
819
+ __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REVOKE_FRIEND_INVITE, {
820
+ inviteId: invite.inviteId,
821
+ }, resolve, reject);
801
822
  });
802
823
  }
803
824
  /**
804
- * Confirm contact
805
- *
806
- * {@link User.confirmed} will be changed to true for both users.
825
+ * Accept friend invite
807
826
  *
808
- * @param invite.from - user with that userId will receive {@link SfuEvent.CONTACT_UPDATE} with {@link User}
827
+ * Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted} for invites.
828
+ * Users will receive {@link SfuEvent.CONTACT_UPDATED} with {@link ContactUpdated} if they have mutual space channels or direct chats.
829
+ * Will receive {@link SfuEvent.NEW_CONTACT} with {@link NewContact} if haven't.
809
830
  */
810
- confirmContact(invite) {
831
+ acceptFriendInvite(invite) {
811
832
  __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
812
833
  const self = this;
813
834
  return new Promise(function (resolve, reject) {
814
- __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CONFIRM_CONTACT, {
815
- from: invite.from,
816
- to: invite.to,
817
- id: invite.id
835
+ __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ACCEPT_FRIEND_INVITE, {
836
+ inviteId: invite.inviteId,
818
837
  }, resolve, reject);
819
838
  });
820
839
  }
821
840
  /**
822
- * Confirm contact
841
+ * Reject friend invite
823
842
  *
824
- * {@link User.confirmed} will be changed to true for both users.
825
- *
826
- * @param contact.id - user with that userId will receive {@link SfuEvent.CONTACT_REMOVED} with {@link User}
843
+ * Promise will resolve with {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted}.
844
+ * Outgoing friend invite will not delete.
827
845
  */
828
- removeContact(contact) {
846
+ rejectFriendInvite(invite) {
829
847
  __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
830
848
  const self = this;
831
849
  return new Promise(function (resolve, reject) {
832
- __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CONTACT, { id: contact.id }, resolve, reject);
850
+ __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REJECT_FRIEND_INVITE, {
851
+ inviteId: invite.inviteId,
852
+ }, resolve, reject);
833
853
  });
834
854
  }
835
855
  /**
@@ -989,6 +1009,49 @@ class SfuExtended {
989
1009
  });
990
1010
  }
991
1011
  ;
1012
+ /**
1013
+ * Update presence status
1014
+ *
1015
+ * Friends and users with whom there are mutual space channels or direct chats will receive {@link SfuEvent.USER_PRESENCE_STATUS_UPDATED} with {@link UserPresenceStatusUpdated}.
1016
+ * The selected status is saved and will persist across subsequent connects. It can be retrieved using the {@link getUserInfo}.
1017
+ */
1018
+ updatePresenceStatus(status) {
1019
+ __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
1020
+ const self = this;
1021
+ return new Promise(function (resolve, reject) {
1022
+ __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_PRESENCE_STATUS, {
1023
+ status: status
1024
+ }, resolve, reject);
1025
+ });
1026
+ }
1027
+ ;
1028
+ /**
1029
+ * Update user activity
1030
+ *
1031
+ * Working with selected {@link PresenceStatus.ONLINE} by {@link updatePresenceStatus}.
1032
+ * Does not work with other statuses.
1033
+ *
1034
+ * The user client that called this method will receive {@link UserInfoChangedEvent} with {@link PresenceStatus.ONLINE} or {@link PresenceStatus.IDLE}.
1035
+ * Other user clients will not receive events.
1036
+ *
1037
+ * {@param isActive} = false:
1038
+ * If the user hasn't other connected active clients then user contacts will receive {@link UserPresenceStatusUpdated} with {@link PresenceStatus.IDLE}.
1039
+ * If the user has other connected active clients then user contacts will not receive events.
1040
+ *
1041
+ * {@param isActive} = true:
1042
+ * If all user clients was inactive then user contacts will receive {@link UserPresenceStatusUpdated} with {@link PresenceStatus.ONLINE}.
1043
+ * If the user has at least one active connected client, then the contacts will not receive any events.
1044
+ */
1045
+ updateActivityStatus(isActive) {
1046
+ __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
1047
+ const self = this;
1048
+ return new Promise(function (resolve, reject) {
1049
+ __classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_ACTIVITY_STATUS, {
1050
+ isActive
1051
+ }, resolve, reject);
1052
+ });
1053
+ }
1054
+ ;
992
1055
  /**
993
1056
  * @deprecated
994
1057
  */
@@ -1915,11 +1978,6 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
1915
1978
  __classPrivateFieldGet(this, _SfuExtended_downloadingAttachmentState, "f").push(Object.assign(Object.assign({}, request), { payload: null, internalMessageId: ack.internalMessageId }));
1916
1979
  }
1917
1980
  }
1918
- else if (data[0].type === constants_1.InternalApi.USER_LIST) {
1919
- const userList = data[0];
1920
- promises_1.default.resolve(data[0].internalMessageId, userList.list);
1921
- __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.USER_LIST, userList.list);
1922
- }
1923
1981
  else if (data[0].type === constants_1.InternalApi.USER_CALENDAR) {
1924
1982
  const calendar = data[0];
1925
1983
  promises_1.default.resolve(data[0].internalMessageId, calendar.calendar);
@@ -1961,24 +2019,6 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
1961
2019
  __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_CHAT, chatInfo.info);
1962
2020
  }
1963
2021
  }
1964
- else if (data[0].type === constants_1.InternalApi.CONTACT_INVITE) {
1965
- const invite = data[0];
1966
- if (!promises_1.default.resolve(data[0].internalMessageId, invite.invite)) {
1967
- __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_INVITE, invite.invite);
1968
- }
1969
- }
1970
- else if (data[0].type === constants_1.InternalApi.CONTACT_UPDATED) {
1971
- const contact = data[0];
1972
- if (!promises_1.default.resolve(data[0].internalMessageId, contact.contact)) {
1973
- __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_UPDATE, contact.contact);
1974
- }
1975
- }
1976
- else if (data[0].type === constants_1.InternalApi.CONTACT_REMOVED) {
1977
- const contact = data[0];
1978
- if (!promises_1.default.resolve(data[0].internalMessageId, contact.contact)) {
1979
- __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_REMOVED, contact.contact);
1980
- }
1981
- }
1982
2022
  else if (data[0].type === constants_1.InternalApi.CHAT_DELETED) {
1983
2023
  const chat = data[0];
1984
2024
  if (!promises_1.default.resolve(data[0].internalMessageId, chat.info)) {
@@ -2386,6 +2426,60 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
2386
2426
  const event = data[0];
2387
2427
  __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.MeetingSyncEvent.MEETING_NAME_UPDATED_SYNC, event);
2388
2428
  }
2429
+ else if (data[0].type === constants_1.SfuEvent.USER_CONTACTS) {
2430
+ const event = data[0];
2431
+ if (!promises_1.default.resolve(data[0].internalMessageId, event.contacts)) {
2432
+ __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.USER_CONTACTS, event);
2433
+ }
2434
+ }
2435
+ else if (data[0].type === constants_1.SfuEvent.NEW_CONTACT) {
2436
+ const event = data[0];
2437
+ if (!promises_1.default.resolve(data[0].internalMessageId, event.contact)) {
2438
+ __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_CONTACT, event);
2439
+ }
2440
+ }
2441
+ else if (data[0].type === constants_1.SfuEvent.CONTACT_UPDATED) {
2442
+ const event = data[0];
2443
+ if (!promises_1.default.resolve(data[0].internalMessageId, event.contact)) {
2444
+ __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_UPDATED, event);
2445
+ }
2446
+ }
2447
+ else if (data[0].type === constants_1.SfuEvent.CONTACT_DELETED) {
2448
+ const event = data[0];
2449
+ if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
2450
+ __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_DELETED, event);
2451
+ }
2452
+ }
2453
+ else if (data[0].type === constants_1.SfuEvent.NEW_INCOMING_FRIEND_INVITE) {
2454
+ const event = data[0];
2455
+ if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
2456
+ __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_INCOMING_FRIEND_INVITE, event);
2457
+ }
2458
+ }
2459
+ else if (data[0].type === constants_1.SfuEvent.NEW_OUTGOING_FRIEND_INVITE) {
2460
+ const event = data[0];
2461
+ if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
2462
+ __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_OUTGOING_FRIEND_INVITE, event);
2463
+ }
2464
+ }
2465
+ else if (data[0].type === constants_1.SfuEvent.INCOMING_FRIEND_INVITE_DELETED) {
2466
+ const event = data[0];
2467
+ if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
2468
+ __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.INCOMING_FRIEND_INVITE_DELETED, event);
2469
+ }
2470
+ }
2471
+ else if (data[0].type === constants_1.SfuEvent.OUTGOING_FRIEND_INVITE_DELETED) {
2472
+ const event = data[0];
2473
+ if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
2474
+ __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.OUTGOING_FRIEND_INVITE_DELETED, event);
2475
+ }
2476
+ }
2477
+ else if (data[0].type === constants_1.SfuEvent.USER_PRESENCE_STATUS_UPDATED) {
2478
+ const event = data[0];
2479
+ if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
2480
+ __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.USER_PRESENCE_STATUS_UPDATED, event);
2481
+ }
2482
+ }
2389
2483
  else {
2390
2484
  __classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(data[0].type, data[0]);
2391
2485
  }