@flashphoner/sfusdk 2.0.278 → 2.0.280
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.
- package/dist/client.version +1 -1
- package/dist/sdk/constants.d.ts +209 -38
- package/dist/sdk/constants.js +164 -14
- package/dist/sdk/constants.js.map +1 -1
- package/dist/sdk/room-extended.d.ts +154 -0
- package/dist/sdk/room-extended.js +154 -0
- package/dist/sdk/room-extended.js.map +1 -1
- package/dist/sdk/room.d.ts +41 -0
- package/dist/sdk/room.js +41 -0
- package/dist/sdk/room.js.map +1 -1
- package/dist/sdk/sfu-extended.d.ts +586 -96
- package/dist/sdk/sfu-extended.js +785 -247
- package/dist/sdk/sfu-extended.js.map +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/highlight.css +78 -0
- package/docs/assets/icons.js +15 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +59 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1412 -0
- package/docs/classes/BitrateTest.BitrateTest.html +11 -0
- package/docs/classes/BitrateTest.PacedSender.html +13 -0
- package/docs/classes/connection.Connection.html +15 -0
- package/docs/classes/logger.default.html +14 -0
- package/docs/classes/notifier.Notifier.html +7 -0
- package/docs/classes/reset_password_handler.ResetPasswordHandler.html +4 -0
- package/docs/classes/room.Room.html +73 -0
- package/docs/classes/room_extended.RoomExtended.html +172 -0
- package/docs/classes/sending_attachments_handler.SendingAttachmentsHandler.html +7 -0
- package/docs/classes/sfu.Sfu.html +18 -0
- package/docs/classes/sfu_extended.SfuExtended.html +335 -0
- package/docs/classes/webrtc_stats.WebRTCStats.html +11 -0
- package/docs/enums/constants.AttachmentState.html +5 -0
- package/docs/enums/constants.AuthenticationStatus.html +2 -0
- package/docs/enums/constants.ChannelSendPolicy.html +4 -0
- package/docs/enums/constants.ChatError.html +15 -0
- package/docs/enums/constants.ChatReceivePolicy.html +4 -0
- package/docs/enums/constants.ChatSectionsError.html +2 -0
- package/docs/enums/constants.ChatType.html +3 -0
- package/docs/enums/constants.ConferenceType.html +4 -0
- package/docs/enums/constants.ConnectionType.html +5 -0
- package/docs/enums/constants.ContactError.html +2 -0
- package/docs/enums/constants.DeliveryStatus.html +4 -0
- package/docs/enums/constants.InternalApi.html +150 -0
- package/docs/enums/constants.MeetingSyncEvent.html +21 -0
- package/docs/enums/constants.MessageAttachmentMediaType.html +3 -0
- package/docs/enums/constants.MessageAttachmentType.html +3 -0
- package/docs/enums/constants.MessageState.html +10 -0
- package/docs/enums/constants.MessageTargetEntityType.html +4 -0
- package/docs/enums/constants.Operations.html +79 -0
- package/docs/enums/constants.ParticipantRole.html +4 -0
- package/docs/enums/constants.PresenceStatus.html +5 -0
- package/docs/enums/constants.RemoteSdpType.html +4 -0
- package/docs/enums/constants.RoomError.html +14 -0
- package/docs/enums/constants.RoomEvent.html +91 -0
- package/docs/enums/constants.RoomState.html +6 -0
- package/docs/enums/constants.SfuEvent.html +103 -0
- package/docs/enums/constants.SortOrder.html +3 -0
- package/docs/enums/constants.SpaceError.html +3 -0
- package/docs/enums/constants.SpaceEvent.html +53 -0
- package/docs/enums/constants.State.html +7 -0
- package/docs/enums/constants.StatsType.html +3 -0
- package/docs/enums/constants.TrackType.html +3 -0
- package/docs/enums/constants.UserInfoError.html +6 -0
- package/docs/enums/constants.UserManagementError.html +11 -0
- package/docs/enums/logger.Verbosity.html +6 -0
- package/docs/functions/promises.add.html +1 -0
- package/docs/functions/promises.reject.html +1 -0
- package/docs/functions/promises.resolve.html +1 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +11 -0
- package/docs/interfaces/BitrateTest.BitrateComponentEventBus.html +6 -0
- package/docs/interfaces/BitrateTest.BitrateTestController.html +4 -0
- package/docs/interfaces/BitrateTest.BitrateTestListener.html +2 -0
- package/docs/interfaces/BitrateTest.Sink.html +3 -0
- package/docs/interfaces/room.RemoteTrack.html +13 -0
- package/docs/modules/BitrateTest.html +8 -0
- package/docs/modules/connection.html +2 -0
- package/docs/modules/constants.html +203 -0
- package/docs/modules/logger.html +4 -0
- package/docs/modules/notifier.html +3 -0
- package/docs/modules/promises.html +5 -0
- package/docs/modules/reset_password_handler.html +2 -0
- package/docs/modules/room.html +3 -0
- package/docs/modules/room_extended.html +2 -0
- package/docs/modules/sending_attachments_handler.html +2 -0
- package/docs/modules/sfu.html +2 -0
- package/docs/modules/sfu_extended.html +2 -0
- package/docs/modules/webrtc_stats.html +2 -0
- package/docs/types/BitrateTest.DynamicRate.html +1 -0
- package/docs/types/constants.AddRemoveTracks.html +1 -0
- package/docs/types/constants.AddRemoveTracksSync.html +1 -0
- package/docs/types/constants.AddedRoleToMember.html +1 -0
- package/docs/types/constants.Attachment.html +1 -0
- package/docs/types/constants.AttachmentInfo.html +1 -0
- package/docs/types/constants.AttachmentRequest.html +1 -0
- package/docs/types/constants.AttachmentRequestAck.html +1 -0
- package/docs/types/constants.AttachmentStatus.html +1 -0
- package/docs/types/constants.AttachmentStatusEvent.html +1 -0
- package/docs/types/constants.AuthenticationStatusEvent.html +1 -0
- package/docs/types/constants.BannedContact.html +1 -0
- package/docs/types/constants.BitrateTestStatus.html +1 -0
- package/docs/types/constants.BooleanEvent.html +1 -0
- package/docs/types/constants.Calendar.html +1 -0
- package/docs/types/constants.CalendarEvent.html +1 -0
- package/docs/types/constants.CalendarEventEvent.html +1 -0
- package/docs/types/constants.Chat.html +1 -0
- package/docs/types/constants.ChatLoadedEvent.html +1 -0
- package/docs/types/constants.ChatMap.html +1 -0
- package/docs/types/constants.ChatMessagesCount.html +1 -0
- package/docs/types/constants.ChatMessagesEvent.html +1 -0
- package/docs/types/constants.ChatSearchResultEvent.html +1 -0
- package/docs/types/constants.ChatsEvent.html +1 -0
- package/docs/types/constants.ConnectionDetails.html +1 -0
- package/docs/types/constants.ConnectionFailedEvent.html +1 -0
- package/docs/types/constants.Contact.html +1 -0
- package/docs/types/constants.ContactDeleted.html +1 -0
- package/docs/types/constants.ContactUpdated.html +1 -0
- package/docs/types/constants.ControlMessage.html +1 -0
- package/docs/types/constants.ControlMessageEvent.html +1 -0
- package/docs/types/constants.CreatedRoom.html +1 -0
- package/docs/types/constants.EvictedFromRoom.html +1 -0
- package/docs/types/constants.EvictedSync.html +1 -0
- package/docs/types/constants.FirstAndLastChatMessage.html +1 -0
- package/docs/types/constants.FragmentedMessage.html +1 -0
- package/docs/types/constants.FriendInvite.html +1 -0
- package/docs/types/constants.FriendInviteDeleted.html +1 -0
- package/docs/types/constants.InternalMessage.html +1 -0
- package/docs/types/constants.JoinedRoom.html +1 -0
- package/docs/types/constants.JoinedRoomSync.html +1 -0
- package/docs/types/constants.LastReadMessageUpdate.html +1 -0
- package/docs/types/constants.LastReadMessageUpdated.html +1 -0
- package/docs/types/constants.LeftMeetingSync.html +1 -0
- package/docs/types/constants.LeftRoom.html +1 -0
- package/docs/types/constants.LoadMessagesWithMentionsResult.html +1 -0
- package/docs/types/constants.MeetingEndedSync.html +1 -0
- package/docs/types/constants.MeetingNameUpdatedSync.html +1 -0
- package/docs/types/constants.MeetingsPreviewEvent.html +1 -0
- package/docs/types/constants.Message.html +1 -0
- package/docs/types/constants.MessageAttachment.html +1 -0
- package/docs/types/constants.MessageAttachmentData.html +1 -0
- package/docs/types/constants.MessageAttachmentsSearchResult.html +1 -0
- package/docs/types/constants.MessageDeleted.html +1 -0
- package/docs/types/constants.MessageDeliveryStatus.html +1 -0
- package/docs/types/constants.MessageEdited.html +1 -0
- package/docs/types/constants.MessageInfo.html +1 -0
- package/docs/types/constants.MessageStatus.html +1 -0
- package/docs/types/constants.MessageStatusEvent.html +1 -0
- package/docs/types/constants.MessageStatusUpdate.html +1 -0
- package/docs/types/constants.MessageTargetEntityId.html +1 -0
- package/docs/types/constants.MessageWithUploadingAttachments.html +1 -0
- package/docs/types/constants.NewChatEvent.html +1 -0
- package/docs/types/constants.NewContact.html +1 -0
- package/docs/types/constants.NewFriendInvite.html +1 -0
- package/docs/types/constants.NewMeeting.html +1 -0
- package/docs/types/constants.NewSpaceCategoryEvent.html +1 -0
- package/docs/types/constants.NewSpaceChannelEvent.html +1 -0
- package/docs/types/constants.NewSpaceEvent.html +1 -0
- package/docs/types/constants.NewSpaceRoleAdded.html +1 -0
- package/docs/types/constants.NewSpaceThreadEvent.html +1 -0
- package/docs/types/constants.OperationFailed.html +1 -0
- package/docs/types/constants.OperationFailedEvent.html +1 -0
- package/docs/types/constants.Participant.html +1 -0
- package/docs/types/constants.ParticipantAVSMutedEvent.html +1 -0
- package/docs/types/constants.ParticipantConfigEvent.html +1 -0
- package/docs/types/constants.ParticipantRenamed.html +1 -0
- package/docs/types/constants.ParticipantsListEvent.html +1 -0
- package/docs/types/constants.ParticipantsListSyncEvent.html +1 -0
- package/docs/types/constants.PlacedInLobbyEvent.html +1 -0
- package/docs/types/constants.PlacedInWaitingRoomEvent.html +1 -0
- package/docs/types/constants.PublicChannelsEvent.html +1 -0
- package/docs/types/constants.Quality.html +1 -0
- package/docs/types/constants.RemoteSdp.html +1 -0
- package/docs/types/constants.RemoteSdpInfo.html +1 -0
- package/docs/types/constants.RemovedChatEvent.html +1 -0
- package/docs/types/constants.RemovedRoleFromMember.html +1 -0
- package/docs/types/constants.ResetPasswordRequestStatus.html +1 -0
- package/docs/types/constants.RoleAssigned.html +1 -0
- package/docs/types/constants.RolePermissionSectionsEvent.html +1 -0
- package/docs/types/constants.RolesListEvent.html +1 -0
- package/docs/types/constants.RoomAvailable.html +1 -0
- package/docs/types/constants.RoomConfigEvent.html +1 -0
- package/docs/types/constants.RoomExtendedConfig.html +1 -0
- package/docs/types/constants.RoomExtendedParticipantConfig.html +1 -0
- package/docs/types/constants.RoomExtendedParticipantsConfig.html +1 -0
- package/docs/types/constants.RoomExtendedScreenSharingConfig.html +1 -0
- package/docs/types/constants.RoomInfo.html +1 -0
- package/docs/types/constants.RoomMessage.html +1 -0
- package/docs/types/constants.RoomNameUpdated.html +1 -0
- package/docs/types/constants.RoomScreenSharingConfigEvent.html +1 -0
- package/docs/types/constants.SFUMeetingParticipantPreview.html +1 -0
- package/docs/types/constants.SFUMeetingPreview.html +1 -0
- package/docs/types/constants.SfuMessageEvent.html +1 -0
- package/docs/types/constants.SfuSpace.html +1 -0
- package/docs/types/constants.SfuSpaceCategory.html +1 -0
- package/docs/types/constants.SfuSpaceChannel.html +1 -0
- package/docs/types/constants.SfuSpaceChannelAccessRights.html +1 -0
- package/docs/types/constants.SfuSpaceInvite.html +1 -0
- package/docs/types/constants.SfuSpaceMember.html +1 -0
- package/docs/types/constants.SfuSpaceRole.html +1 -0
- package/docs/types/constants.SfuSpaceRolePermission.html +1 -0
- package/docs/types/constants.SfuSpaceRolePermissionSection.html +1 -0
- package/docs/types/constants.SfuSpaceThread.html +1 -0
- package/docs/types/constants.SfuSpaceUserBan.html +1 -0
- package/docs/types/constants.SignUpStatus.html +1 -0
- package/docs/types/constants.SpaceCategoryDeleted.html +1 -0
- package/docs/types/constants.SpaceCategoryUpdated.html +1 -0
- package/docs/types/constants.SpaceChannelDeleted.html +1 -0
- package/docs/types/constants.SpaceChannelMoved.html +1 -0
- package/docs/types/constants.SpaceChannelUpdated.html +1 -0
- package/docs/types/constants.SpaceCreatedEvent.html +1 -0
- package/docs/types/constants.SpaceDeletedEvent.html +1 -0
- package/docs/types/constants.SpaceInviteCreated.html +1 -0
- package/docs/types/constants.SpaceInviteRevoked.html +1 -0
- package/docs/types/constants.SpaceOverviewUpdated.html +1 -0
- package/docs/types/constants.SpaceRoleDeleted.html +1 -0
- package/docs/types/constants.SpaceRoleUpdated.html +1 -0
- package/docs/types/constants.SpaceThreadDeleted.html +1 -0
- package/docs/types/constants.SpaceThreadUpdated.html +1 -0
- package/docs/types/constants.StopScreenSharingEvent.html +1 -0
- package/docs/types/constants.StopTrackEvent.html +1 -0
- package/docs/types/constants.TracksQualityState.html +1 -0
- package/docs/types/constants.UnreadMessagesCountEvent.html +1 -0
- package/docs/types/constants.UnreadMessagesCountUpdate.html +1 -0
- package/docs/types/constants.UpdateChatEvent.html +1 -0
- package/docs/types/constants.UpdateMessagesDeliveryStatusEvent.html +1 -0
- package/docs/types/constants.UploadingAttachmentInfo.html +1 -0
- package/docs/types/constants.UserCalendarEvent.html +1 -0
- package/docs/types/constants.UserContacts.html +1 -0
- package/docs/types/constants.UserContactsEvent.html +1 -0
- package/docs/types/constants.UserEmail.html +1 -0
- package/docs/types/constants.UserHostKey.html +1 -0
- package/docs/types/constants.UserHostKeyChangedEvent.html +1 -0
- package/docs/types/constants.UserId.html +1 -0
- package/docs/types/constants.UserInfo.html +1 -0
- package/docs/types/constants.UserInfoChangedEvent.html +1 -0
- package/docs/types/constants.UserInfoEvent.html +1 -0
- package/docs/types/constants.UserJoinedToSpaceEvent.html +1 -0
- package/docs/types/constants.UserLeftSpace.html +1 -0
- package/docs/types/constants.UserNickname.html +1 -0
- package/docs/types/constants.UserNicknameChangedEvent.html +1 -0
- package/docs/types/constants.UserPassword.html +1 -0
- package/docs/types/constants.UserPhoneNumber.html +1 -0
- package/docs/types/constants.UserPhoneNumberChangedEvent.html +1 -0
- package/docs/types/constants.UserPmiSettings.html +1 -0
- package/docs/types/constants.UserPresenceStatusUpdated.html +1 -0
- package/docs/types/constants.UserRoomsEvent.html +1 -0
- package/docs/types/constants.UserSpacesEvent.html +1 -0
- package/docs/types/constants.UserSpecificChatInfo.html +1 -0
- package/docs/types/constants.UserTimezone.html +1 -0
- package/docs/types/constants.UserTimezoneChangedEvent.html +1 -0
- package/docs/types/constants.WaitingListEvent.html +1 -0
- package/docs/types/constants.WaitingParticipant.html +1 -0
- package/docs/types/constants.WaitingRoomUpdate.html +1 -0
- package/docs/types/logger.PrefixFunction.html +1 -0
- package/docs/types/notifier.NotifierHandler.html +1 -0
- package/docs/variables/constants.ATTACHMENT_CHUNK_SIZE.html +1 -0
- package/docs/variables/constants.ATTACHMENT_ID_LENGTH.html +1 -0
- package/docs/variables/constants.WS_CONNECTION_TIMEOUT.html +1 -0
- package/docs/variables/constants.WS_PINGS_MISSING_THRESHOLD.html +1 -0
- package/docs/variables/constants.WS_PING_INTERVAL_MS.html +1 -0
- package/docs/variables/promises.default.html +1 -0
- package/package.json +2 -1
package/dist/sdk/sfu-extended.js
CHANGED
|
@@ -45,7 +45,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
45
45
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
46
46
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
47
47
|
};
|
|
48
|
-
var _SfuExtended_instances, _SfuExtended_connection, _SfuExtended__user, _SfuExtended__server, _SfuExtended__state, _SfuExtended_rooms, _SfuExtended_notifier, _SfuExtended_uploadingAttachmentState, _SfuExtended_downloadingAttachmentState, _SfuExtended_binaryChunkSize, _SfuExtended_logger, _SfuExtended_loggerPrefix, _SfuExtended_signUpId, _SfuExtended_resetPasswordId,
|
|
48
|
+
var _SfuExtended_instances, _SfuExtended_connection, _SfuExtended__user, _SfuExtended__server, _SfuExtended__state, _SfuExtended_rooms, _SfuExtended_notifier, _SfuExtended_uploadingAttachmentState, _SfuExtended_downloadingAttachmentState, _SfuExtended_binaryChunkSize, _SfuExtended_logger, _SfuExtended_loggerPrefix, _SfuExtended_signUpId, _SfuExtended_resetPasswordId, _SfuExtended_emmitAction, _SfuExtended_emmitBinaryAction, _SfuExtended_checkAuthenticated, _SfuExtended_createConnection, _SfuExtended_getConnectionConfigForAnonymousUser, _SfuExtended_notifyMessageAttachmentState;
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
50
|
exports.SfuExtended = void 0;
|
|
51
51
|
const uuid_1 = require("uuid");
|
|
@@ -84,6 +84,20 @@ class SfuExtended {
|
|
|
84
84
|
}
|
|
85
85
|
__classPrivateFieldGet(this, _SfuExtended_logger, "f").setVerbosity(logLevel ? logLevel : logger_1.Verbosity.ERROR);
|
|
86
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Connects the user to the server.
|
|
89
|
+
*
|
|
90
|
+
* The user can connect using either a username and password or an authToken.
|
|
91
|
+
*
|
|
92
|
+
* Once the connection is successful, the {@link state} will change to {@link State.AUTHENTICATED}.
|
|
93
|
+
* After that, the sfu-sdk will emit the event {@link SfuEvent.CONNECTED}.
|
|
94
|
+
*
|
|
95
|
+
* @param options.username - The user's username (optional if `authToken` is provided).
|
|
96
|
+
* @param options.password - The user's password (optional if `authToken` is provided).
|
|
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}
|
|
100
|
+
*/
|
|
87
101
|
connect(options) {
|
|
88
102
|
if (!options) {
|
|
89
103
|
throw new TypeError("No options provided");
|
|
@@ -129,6 +143,34 @@ class SfuExtended {
|
|
|
129
143
|
}));
|
|
130
144
|
}
|
|
131
145
|
;
|
|
146
|
+
/**
|
|
147
|
+
* Method to disconnect from the server
|
|
148
|
+
*
|
|
149
|
+
* When disconnecting, user leaves all active rooms
|
|
150
|
+
*
|
|
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}
|
|
154
|
+
*/
|
|
155
|
+
disconnect() {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
for (const [key, value] of Object.entries(__classPrivateFieldGet(this, _SfuExtended_rooms, "f"))) {
|
|
158
|
+
value.leaveRoom();
|
|
159
|
+
}
|
|
160
|
+
__classPrivateFieldSet(this, _SfuExtended__user, undefined, "f");
|
|
161
|
+
if (__classPrivateFieldGet(this, _SfuExtended__state, "f") !== constants_1.State.DISCONNECTED) {
|
|
162
|
+
yield __classPrivateFieldGet(this, _SfuExtended_connection, "f").close();
|
|
163
|
+
__classPrivateFieldSet(this, _SfuExtended__state, constants_1.State.DISCONNECTED, "f");
|
|
164
|
+
}
|
|
165
|
+
__classPrivateFieldSet(this, _SfuExtended_rooms, {}, "f");
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
;
|
|
169
|
+
/**
|
|
170
|
+
* Sign up for new users
|
|
171
|
+
*
|
|
172
|
+
* Works in a separate connection
|
|
173
|
+
*/
|
|
132
174
|
signUp(options) {
|
|
133
175
|
const connectionConfig = __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_getConnectionConfigForAnonymousUser).call(this, options.url, options.timeout);
|
|
134
176
|
const self = this;
|
|
@@ -191,6 +233,11 @@ class SfuExtended {
|
|
|
191
233
|
});
|
|
192
234
|
}));
|
|
193
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Reset password
|
|
238
|
+
*
|
|
239
|
+
* When calls, returns {@link ResetPasswordHandler} then need to call {@link ResetPasswordHandler.resetPassword} to reset the password
|
|
240
|
+
*/
|
|
194
241
|
resetPassword(options) {
|
|
195
242
|
const connectionConfig = __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_getConnectionConfigForAnonymousUser).call(this, options.url, options.timeout);
|
|
196
243
|
const self = this;
|
|
@@ -282,6 +329,9 @@ class SfuExtended {
|
|
|
282
329
|
}
|
|
283
330
|
}));
|
|
284
331
|
}
|
|
332
|
+
/**
|
|
333
|
+
* Remove user (internal using)
|
|
334
|
+
*/
|
|
285
335
|
removeUser(options) {
|
|
286
336
|
const connectionConfig = __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_getConnectionConfigForAnonymousUser).call(this, options.url, options.timeout);
|
|
287
337
|
const self = this;
|
|
@@ -324,6 +374,9 @@ class SfuExtended {
|
|
|
324
374
|
});
|
|
325
375
|
}));
|
|
326
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* Logout from app
|
|
379
|
+
*/
|
|
327
380
|
logout() {
|
|
328
381
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
329
382
|
const self = this;
|
|
@@ -332,6 +385,29 @@ class SfuExtended {
|
|
|
332
385
|
});
|
|
333
386
|
}
|
|
334
387
|
;
|
|
388
|
+
/**
|
|
389
|
+
* Load messages for Direct chat | Channel | Thread
|
|
390
|
+
*
|
|
391
|
+
* @param params.timeFrame to load by start date to end date. For load all messages used with start = 0, end = -1.
|
|
392
|
+
* @param params.boundaries to load messages by specifying a particular message using its date,
|
|
393
|
+
* along with the number of messages above and below it. Upper limit includes message with date dateMark.
|
|
394
|
+
*/
|
|
395
|
+
loadMessages(params) {
|
|
396
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
397
|
+
const self = this;
|
|
398
|
+
return new Promise(function (resolve, reject) {
|
|
399
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.LOAD_MESSAGES, params, resolve, reject);
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
;
|
|
403
|
+
/**
|
|
404
|
+
* Send a message to a Direct chat | Channel | Thread
|
|
405
|
+
*
|
|
406
|
+
* Members will receive {@link SfuEvent.MESSAGE} with {@link Message}
|
|
407
|
+
*
|
|
408
|
+
* @param msg.parentId to send reply message
|
|
409
|
+
* @param msg.to to send a private message
|
|
410
|
+
*/
|
|
335
411
|
sendMessage(msg) {
|
|
336
412
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
337
413
|
const self = this;
|
|
@@ -356,6 +432,145 @@ class SfuExtended {
|
|
|
356
432
|
});
|
|
357
433
|
}
|
|
358
434
|
;
|
|
435
|
+
/**
|
|
436
|
+
* Edit a message in a Direct chat | Channel | Thread
|
|
437
|
+
*
|
|
438
|
+
* Members will receive {@link SfuEvent.CHAT_MESSAGE_EDITED} with {@link MessageEdited}
|
|
439
|
+
*
|
|
440
|
+
* @param msg.attachmentsToSend to add attachments to sent message
|
|
441
|
+
* @param msg.attachmentIdsToDelete to send a private message
|
|
442
|
+
*/
|
|
443
|
+
editMessage(msg) {
|
|
444
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
445
|
+
const self = this;
|
|
446
|
+
return new Promise(function (resolve, reject) {
|
|
447
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.EDIT_MESSAGE, {
|
|
448
|
+
id: msg.messageId,
|
|
449
|
+
targetEntityType: msg.targetEntityType,
|
|
450
|
+
targetEntityId: msg.targetEntityId,
|
|
451
|
+
body: msg.body,
|
|
452
|
+
attachments: msg.attachmentsToSend,
|
|
453
|
+
attachmentIdsToDelete: msg.attachmentIdsToDelete
|
|
454
|
+
}, resolve, reject);
|
|
455
|
+
});
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Delete a message in a Direct chat | Channel | Thread
|
|
459
|
+
*
|
|
460
|
+
* The message body will be changed to an empty string.
|
|
461
|
+
* The {@link Message.status} will be changed to {@link MessageState.DELETED}
|
|
462
|
+
*
|
|
463
|
+
* Attachments will be removed.
|
|
464
|
+
*
|
|
465
|
+
* Members will receive {@link SfuEvent.CHAT_MESSAGE_DELETED} with {@link MessageDeleted}
|
|
466
|
+
*/
|
|
467
|
+
deleteMessage(msg) {
|
|
468
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
469
|
+
const self = this;
|
|
470
|
+
return new Promise(function (resolve, reject) {
|
|
471
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.DELETE_MESSAGE, {
|
|
472
|
+
id: msg.messageId,
|
|
473
|
+
targetEntityType: msg.targetEntityType,
|
|
474
|
+
targetEntityId: msg.targetEntityId,
|
|
475
|
+
}, resolve, reject);
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Mark message as read in a Direct chat | Channel | Thread
|
|
480
|
+
*
|
|
481
|
+
* In targetEntity will change lastReadMessageId and lastReadMessageDate
|
|
482
|
+
*
|
|
483
|
+
* All unread messages with a {@link Message.date} earlier than or equal to the marked one will be marked as read.
|
|
484
|
+
* The sender of each message will receive {@link SfuEvent.UPDATE_MESSAGES_DELIVERY_STATUS}
|
|
485
|
+
* with {@link UpdateMessagesDeliveryStatusEvent} and {@link Message.deliveryStatus} will be changed at the server side to {@link DeliveryStatus.READ}.
|
|
486
|
+
*/
|
|
487
|
+
markMessageRead(msg) {
|
|
488
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
489
|
+
const self = this;
|
|
490
|
+
return new Promise(function (resolve, reject) {
|
|
491
|
+
if (!msg) {
|
|
492
|
+
reject(new Error("Can't mark null message"));
|
|
493
|
+
}
|
|
494
|
+
else if (!msg.id || msg.id === "") {
|
|
495
|
+
reject(new Error("Can't mark message without massage id"));
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.MARK_MESSAGE_READ, {
|
|
499
|
+
id: msg.id,
|
|
500
|
+
targetEntityType: msg.targetEntityType,
|
|
501
|
+
targetEntityId: msg.targetEntityId,
|
|
502
|
+
}, resolve, reject);
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Mark message as unread in a Direct chat | Channel | Thread
|
|
508
|
+
*
|
|
509
|
+
* In targetEntity will change lastReadMessageId and lastReadMessageDate. {@link Message.deliveryStatus}
|
|
510
|
+
*
|
|
511
|
+
* {@link Message.deliveryStatus} will not be changed at the server side. Senders will not receive events,
|
|
512
|
+
* however if the previous lastReadMessageDate is earlier than the updated value,
|
|
513
|
+
* the senders of those messages will receive {@link SfuEvent.UPDATE_MESSAGES_DELIVERY_STATUS}
|
|
514
|
+
* with {@link UpdateMessagesDeliveryStatusEvent} and {@link Message.deliveryStatus} will be changed at the server side to {@link DeliveryStatus.READ}.
|
|
515
|
+
*/
|
|
516
|
+
markMessageUnread(msg) {
|
|
517
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
518
|
+
const self = this;
|
|
519
|
+
return new Promise(function (resolve, reject) {
|
|
520
|
+
if (!msg) {
|
|
521
|
+
reject(new Error("Can't mark null message"));
|
|
522
|
+
}
|
|
523
|
+
else if (!msg.id || msg.id === "") {
|
|
524
|
+
reject(new Error("Can't mark message without massage id"));
|
|
525
|
+
}
|
|
526
|
+
else {
|
|
527
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.MARK_MESSAGE_UNREAD, {
|
|
528
|
+
id: msg.id,
|
|
529
|
+
targetEntityType: msg.targetEntityType,
|
|
530
|
+
targetEntityId: msg.targetEntityId,
|
|
531
|
+
}, resolve, reject);
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Get messages count in entity from {@link MessageTargetEntityType}
|
|
537
|
+
*/
|
|
538
|
+
getMessagesCount(options) {
|
|
539
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
540
|
+
const self = this;
|
|
541
|
+
return new Promise(function (resolve, reject) {
|
|
542
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_MESSAGES_COUNT, {
|
|
543
|
+
targetEntityType: options.targetEntityType,
|
|
544
|
+
targetEntityId: options.targetEntityId
|
|
545
|
+
}, resolve, reject);
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* Get first message and last message in entity from {@link MessageTargetEntityType}
|
|
550
|
+
*/
|
|
551
|
+
getFirstAndLastMessage(options) {
|
|
552
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
553
|
+
const self = this;
|
|
554
|
+
return new Promise(function (resolve, reject) {
|
|
555
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_FIRST_AND_LAST_MESSAGE, {
|
|
556
|
+
targetEntityType: options.targetEntityType,
|
|
557
|
+
targetEntityId: options.targetEntityId
|
|
558
|
+
}, resolve, reject);
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Get count of unread messages in entity from {@link MessageTargetEntityType}
|
|
563
|
+
*/
|
|
564
|
+
getUnreadMessagesCount(options) {
|
|
565
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
566
|
+
const self = this;
|
|
567
|
+
return new Promise(function (resolve, reject) {
|
|
568
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_UNREAD_MESSAGES_COUNT, {
|
|
569
|
+
targetEntityType: options.targetEntityType,
|
|
570
|
+
targetEntityId: options.targetEntityId
|
|
571
|
+
}, resolve, reject);
|
|
572
|
+
});
|
|
573
|
+
}
|
|
359
574
|
/**
|
|
360
575
|
* This method is recommended for using to generate attachment id before sending.
|
|
361
576
|
* Sending and downloading attachments may not work with other generating options.
|
|
@@ -364,6 +579,11 @@ class SfuExtended {
|
|
|
364
579
|
static generateAttachmentId() {
|
|
365
580
|
return (0, uuid_1.v4)();
|
|
366
581
|
}
|
|
582
|
+
/**
|
|
583
|
+
* Get handler for send or cancel sending attachments
|
|
584
|
+
*
|
|
585
|
+
* Can't cancel sent attachment
|
|
586
|
+
*/
|
|
367
587
|
getSendingAttachmentsHandler(attachments, messageId) {
|
|
368
588
|
const self = this;
|
|
369
589
|
const messageWithAttachmentsState = __classPrivateFieldGet(self, _SfuExtended_uploadingAttachmentState, "f")[messageId];
|
|
@@ -506,6 +726,11 @@ class SfuExtended {
|
|
|
506
726
|
}
|
|
507
727
|
return new sending_attachments_handler_1.SendingAttachmentsHandler(sendAttachments());
|
|
508
728
|
}
|
|
729
|
+
/**
|
|
730
|
+
* Load attachment from server
|
|
731
|
+
*
|
|
732
|
+
* On client side should receive {@link SfuEvent.MESSAGE_ATTACHMENT_STATE} with {@link AttachmentStatus} to show progress
|
|
733
|
+
*/
|
|
509
734
|
getMessageAttachment(attachment) {
|
|
510
735
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
511
736
|
const self = this;
|
|
@@ -530,243 +755,301 @@ class SfuExtended {
|
|
|
530
755
|
}, resolve, reject);
|
|
531
756
|
});
|
|
532
757
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
else if (!msg.id || msg.id === "") {
|
|
541
|
-
reject(new Error("Can't mark message without massage id"));
|
|
542
|
-
}
|
|
543
|
-
else {
|
|
544
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.MARK_MESSAGE_READ, {
|
|
545
|
-
id: msg.id,
|
|
546
|
-
targetEntityType: msg.targetEntityType,
|
|
547
|
-
targetEntityId: msg.targetEntityId,
|
|
548
|
-
}, resolve, reject);
|
|
549
|
-
}
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
markMessageUnread(msg) {
|
|
553
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
554
|
-
const self = this;
|
|
555
|
-
return new Promise(function (resolve, reject) {
|
|
556
|
-
if (!msg) {
|
|
557
|
-
reject(new Error("Can't mark null message"));
|
|
558
|
-
}
|
|
559
|
-
else if (!msg.id || msg.id === "") {
|
|
560
|
-
reject(new Error("Can't mark message without massage id"));
|
|
561
|
-
}
|
|
562
|
-
else {
|
|
563
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.MARK_MESSAGE_UNREAD, {
|
|
564
|
-
id: msg.id,
|
|
565
|
-
targetEntityType: msg.targetEntityType,
|
|
566
|
-
targetEntityId: msg.targetEntityId,
|
|
567
|
-
}, resolve, reject);
|
|
568
|
-
}
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
|
-
getUserList() {
|
|
758
|
+
/**
|
|
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.
|
|
762
|
+
*/
|
|
763
|
+
getContacts() {
|
|
572
764
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
573
765
|
const self = this;
|
|
574
766
|
return new Promise(function (resolve, reject) {
|
|
575
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
767
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_CONTACTS, {}, resolve, reject);
|
|
576
768
|
});
|
|
577
769
|
}
|
|
578
770
|
;
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
771
|
+
/**
|
|
772
|
+
* Add a friend
|
|
773
|
+
*
|
|
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}.
|
|
776
|
+
*
|
|
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.
|
|
785
|
+
*/
|
|
786
|
+
addFriend(user) {
|
|
787
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
788
|
+
const self = this;
|
|
789
|
+
return new Promise(function (resolve, reject) {
|
|
790
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_FRIEND, {
|
|
791
|
+
userId: user.userId,
|
|
792
|
+
}, resolve, reject);
|
|
584
793
|
});
|
|
585
794
|
}
|
|
586
|
-
|
|
587
|
-
|
|
795
|
+
/**
|
|
796
|
+
* Remove friend
|
|
797
|
+
*
|
|
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.
|
|
800
|
+
*/
|
|
801
|
+
removeFriend(friend) {
|
|
588
802
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
589
803
|
const self = this;
|
|
590
804
|
return new Promise(function (resolve, reject) {
|
|
591
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
805
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_FRIEND, {
|
|
806
|
+
userId: friend.userId,
|
|
807
|
+
}, resolve, reject);
|
|
592
808
|
});
|
|
593
809
|
}
|
|
594
|
-
|
|
810
|
+
/**
|
|
811
|
+
* Revoke friend invite
|
|
812
|
+
*
|
|
813
|
+
* Users will receive {@link SfuEvent.OUTGOING_FRIEND_INVITE_DELETED} and {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted}.
|
|
814
|
+
*/
|
|
815
|
+
revokeFriendInvite(invite) {
|
|
595
816
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
596
817
|
const self = this;
|
|
597
818
|
return new Promise(function (resolve, reject) {
|
|
598
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
819
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REVOKE_FRIEND_INVITE, {
|
|
820
|
+
inviteId: invite.inviteId,
|
|
821
|
+
}, resolve, reject);
|
|
599
822
|
});
|
|
600
823
|
}
|
|
601
|
-
|
|
824
|
+
/**
|
|
825
|
+
* Accept friend invite
|
|
826
|
+
*
|
|
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.
|
|
830
|
+
*/
|
|
831
|
+
acceptFriendInvite(invite) {
|
|
602
832
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
603
833
|
const self = this;
|
|
604
834
|
return new Promise(function (resolve, reject) {
|
|
605
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
835
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ACCEPT_FRIEND_INVITE, {
|
|
836
|
+
inviteId: invite.inviteId,
|
|
837
|
+
}, resolve, reject);
|
|
606
838
|
});
|
|
607
839
|
}
|
|
608
|
-
|
|
840
|
+
/**
|
|
841
|
+
* Reject friend invite
|
|
842
|
+
*
|
|
843
|
+
* Promise will resolve with {@link SfuEvent.INCOMING_FRIEND_INVITE_DELETED} with {@link FriendInviteDeleted}.
|
|
844
|
+
* Outgoing friend invite will not delete.
|
|
845
|
+
*/
|
|
846
|
+
rejectFriendInvite(invite) {
|
|
609
847
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
610
848
|
const self = this;
|
|
611
849
|
return new Promise(function (resolve, reject) {
|
|
612
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
613
|
-
|
|
850
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REJECT_FRIEND_INVITE, {
|
|
851
|
+
inviteId: invite.inviteId,
|
|
614
852
|
}, resolve, reject);
|
|
615
853
|
});
|
|
616
854
|
}
|
|
617
|
-
|
|
618
|
-
|
|
855
|
+
/**
|
|
856
|
+
* Get all user calendar events
|
|
857
|
+
*/
|
|
858
|
+
getUserCalendar() {
|
|
619
859
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
620
860
|
const self = this;
|
|
621
861
|
return new Promise(function (resolve, reject) {
|
|
622
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
623
|
-
password: {
|
|
624
|
-
currentPassword: currentPassword,
|
|
625
|
-
newPassword: newPassword
|
|
626
|
-
}
|
|
627
|
-
}, resolve, reject);
|
|
862
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_CALENDAR, {}, resolve, reject);
|
|
628
863
|
});
|
|
629
864
|
}
|
|
630
865
|
;
|
|
631
|
-
|
|
866
|
+
/**
|
|
867
|
+
* Add calendar event
|
|
868
|
+
*
|
|
869
|
+
* @param event.usePMI - if true then user PMI settings will be updated and user will receive {@link SfuEvent.UPDATE_USER_PMI_SETTINGS} with {@link UserPmiSettings}
|
|
870
|
+
*/
|
|
871
|
+
addCalendarEvent(event) {
|
|
632
872
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
633
873
|
const self = this;
|
|
634
874
|
return new Promise(function (resolve, reject) {
|
|
635
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
636
|
-
|
|
875
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_CALENDAR_EVENT, {
|
|
876
|
+
event: event
|
|
637
877
|
}, resolve, reject);
|
|
638
878
|
});
|
|
639
879
|
}
|
|
640
880
|
;
|
|
641
|
-
|
|
881
|
+
removeCalendarEvent(event) {
|
|
642
882
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
643
883
|
const self = this;
|
|
644
884
|
return new Promise(function (resolve, reject) {
|
|
645
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
646
|
-
|
|
885
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CALENDAR_EVENT, {
|
|
886
|
+
event: event
|
|
647
887
|
}, resolve, reject);
|
|
648
888
|
});
|
|
649
889
|
}
|
|
650
890
|
;
|
|
651
|
-
|
|
891
|
+
/**
|
|
892
|
+
* Update calendar event
|
|
893
|
+
*
|
|
894
|
+
* @param event.usePMI - if true then user PMI settings will be updated and user will receive {@link SfuEvent.UPDATE_USER_PMI_SETTINGS} with {@link UserPmiSettings}
|
|
895
|
+
*/
|
|
896
|
+
updateCalendarEvent(event) {
|
|
652
897
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
653
898
|
const self = this;
|
|
654
899
|
return new Promise(function (resolve, reject) {
|
|
655
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
656
|
-
|
|
900
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_CALENDAR_EVENT, {
|
|
901
|
+
event: event
|
|
657
902
|
}, resolve, reject);
|
|
658
903
|
});
|
|
659
904
|
}
|
|
660
|
-
|
|
661
|
-
|
|
905
|
+
/**
|
|
906
|
+
* Get user pmi settings
|
|
907
|
+
*
|
|
908
|
+
* Used for create meetings
|
|
909
|
+
*/
|
|
910
|
+
getUserPmiSettings() {
|
|
662
911
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
663
912
|
const self = this;
|
|
664
913
|
return new Promise(function (resolve, reject) {
|
|
665
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
666
|
-
timezone: timezone
|
|
667
|
-
}, resolve, reject);
|
|
914
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_PMI_SETTINGS, {}, resolve, reject);
|
|
668
915
|
});
|
|
669
916
|
}
|
|
670
|
-
|
|
671
|
-
|
|
917
|
+
/**
|
|
918
|
+
* Update user pmi settings
|
|
919
|
+
*/
|
|
920
|
+
updateUserPmiSettings(settings) {
|
|
672
921
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
673
922
|
const self = this;
|
|
674
923
|
return new Promise(function (resolve, reject) {
|
|
675
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
676
|
-
event: event
|
|
677
|
-
}, resolve, reject);
|
|
924
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_USER_PMI_SETTINGS, Object.assign({}, settings), resolve, reject);
|
|
678
925
|
});
|
|
679
926
|
}
|
|
680
|
-
|
|
681
|
-
|
|
927
|
+
/**
|
|
928
|
+
* Get user info
|
|
929
|
+
*
|
|
930
|
+
* Usually used to display profile info
|
|
931
|
+
*/
|
|
932
|
+
getUserInfo() {
|
|
682
933
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
683
934
|
const self = this;
|
|
684
935
|
return new Promise(function (resolve, reject) {
|
|
685
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
686
|
-
event: event
|
|
687
|
-
}, resolve, reject);
|
|
936
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_INFO, {}, resolve, reject);
|
|
688
937
|
});
|
|
689
938
|
}
|
|
690
|
-
|
|
691
|
-
|
|
939
|
+
/**
|
|
940
|
+
* Change user email
|
|
941
|
+
*
|
|
942
|
+
* Users will receive {@link SfuEvent.CONTACT_UPDATED} with changed email
|
|
943
|
+
*/
|
|
944
|
+
changeUserEmail(email) {
|
|
692
945
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
693
946
|
const self = this;
|
|
694
947
|
return new Promise(function (resolve, reject) {
|
|
695
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
696
|
-
|
|
948
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CHANGE_USER_EMAIL, {
|
|
949
|
+
email: email
|
|
697
950
|
}, resolve, reject);
|
|
698
951
|
});
|
|
699
952
|
}
|
|
700
|
-
|
|
953
|
+
;
|
|
954
|
+
changeUserPassword(currentPassword, newPassword) {
|
|
701
955
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
702
956
|
const self = this;
|
|
703
957
|
return new Promise(function (resolve, reject) {
|
|
704
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
958
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CHANGE_USER_PASSWORD, {
|
|
959
|
+
password: {
|
|
960
|
+
currentPassword: currentPassword,
|
|
961
|
+
newPassword: newPassword
|
|
962
|
+
}
|
|
963
|
+
}, resolve, reject);
|
|
705
964
|
});
|
|
706
965
|
}
|
|
707
966
|
;
|
|
708
|
-
|
|
967
|
+
/**
|
|
968
|
+
* Change user email
|
|
969
|
+
*
|
|
970
|
+
* Users will receive {@link SfuEvent.CONTACT_UPDATED} with changed nickname
|
|
971
|
+
*/
|
|
972
|
+
changeUserNickname(nickname) {
|
|
709
973
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
710
974
|
const self = this;
|
|
711
975
|
return new Promise(function (resolve, reject) {
|
|
712
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
976
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CHANGE_USER_NICKNAME, {
|
|
977
|
+
nickname: nickname
|
|
978
|
+
}, resolve, reject);
|
|
713
979
|
});
|
|
714
980
|
}
|
|
715
981
|
;
|
|
716
|
-
|
|
982
|
+
changeUserPhoneNumber(phoneNumber) {
|
|
717
983
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
718
984
|
const self = this;
|
|
719
985
|
return new Promise(function (resolve, reject) {
|
|
720
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
986
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CHANGE_USER_PHONE_NUMBER, {
|
|
987
|
+
phoneNumber: phoneNumber
|
|
988
|
+
}, resolve, reject);
|
|
721
989
|
});
|
|
722
990
|
}
|
|
723
991
|
;
|
|
724
|
-
|
|
992
|
+
changeUserHostKey(hostKey) {
|
|
725
993
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
726
994
|
const self = this;
|
|
727
995
|
return new Promise(function (resolve, reject) {
|
|
728
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
996
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CHANGE_USER_HOST_KEY, {
|
|
997
|
+
hostKey: hostKey
|
|
998
|
+
}, resolve, reject);
|
|
729
999
|
});
|
|
730
1000
|
}
|
|
731
1001
|
;
|
|
732
|
-
|
|
1002
|
+
changeUserTimezone(timezone) {
|
|
733
1003
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
734
1004
|
const self = this;
|
|
735
1005
|
return new Promise(function (resolve, reject) {
|
|
736
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
1006
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CHANGE_USER_TIMEZONE, {
|
|
1007
|
+
timezone: timezone
|
|
1008
|
+
}, resolve, reject);
|
|
737
1009
|
});
|
|
738
1010
|
}
|
|
739
1011
|
;
|
|
740
|
-
|
|
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) {
|
|
741
1019
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
742
1020
|
const self = this;
|
|
743
1021
|
return new Promise(function (resolve, reject) {
|
|
744
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
745
|
-
|
|
746
|
-
targetEntityId: options.targetEntityId
|
|
1022
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_PRESENCE_STATUS, {
|
|
1023
|
+
status: status
|
|
747
1024
|
}, resolve, reject);
|
|
748
1025
|
});
|
|
749
1026
|
}
|
|
750
|
-
|
|
1027
|
+
;
|
|
1028
|
+
/**
|
|
1029
|
+
* @deprecated
|
|
1030
|
+
*/
|
|
1031
|
+
getPublicChannels() {
|
|
751
1032
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
752
1033
|
const self = this;
|
|
753
1034
|
return new Promise(function (resolve, reject) {
|
|
754
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
755
|
-
targetEntityType: options.targetEntityType,
|
|
756
|
-
targetEntityId: options.targetEntityId
|
|
757
|
-
}, resolve, reject);
|
|
1035
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_PUBLIC_CHANNELS, {}, resolve, reject);
|
|
758
1036
|
});
|
|
759
1037
|
}
|
|
760
|
-
|
|
1038
|
+
;
|
|
1039
|
+
/**
|
|
1040
|
+
* @deprecated
|
|
1041
|
+
*/
|
|
1042
|
+
searchChatMessages(params) {
|
|
761
1043
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
762
1044
|
const self = this;
|
|
763
1045
|
return new Promise(function (resolve, reject) {
|
|
764
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
765
|
-
targetEntityType: options.targetEntityType,
|
|
766
|
-
targetEntityId: options.targetEntityId
|
|
767
|
-
}, resolve, reject);
|
|
1046
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.SEARCH_CHAT_MESSAGES, params, resolve, reject);
|
|
768
1047
|
});
|
|
769
1048
|
}
|
|
1049
|
+
;
|
|
1050
|
+
/**
|
|
1051
|
+
* @deprecated
|
|
1052
|
+
*/
|
|
770
1053
|
searchMessageAttachments(params) {
|
|
771
1054
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
772
1055
|
const self = this;
|
|
@@ -783,6 +1066,9 @@ class SfuExtended {
|
|
|
783
1066
|
});
|
|
784
1067
|
}
|
|
785
1068
|
;
|
|
1069
|
+
/**
|
|
1070
|
+
* @deprecated
|
|
1071
|
+
*/
|
|
786
1072
|
loadMessagesWithMentions(params) {
|
|
787
1073
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
788
1074
|
const self = this;
|
|
@@ -797,6 +1083,36 @@ class SfuExtended {
|
|
|
797
1083
|
});
|
|
798
1084
|
}
|
|
799
1085
|
;
|
|
1086
|
+
/**
|
|
1087
|
+
* Get chats.
|
|
1088
|
+
*
|
|
1089
|
+
* To work with messages in the chat, you need to use {@link MessageTargetEntityType.CHAT}
|
|
1090
|
+
*/
|
|
1091
|
+
getUserChats() {
|
|
1092
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1093
|
+
const self = this;
|
|
1094
|
+
return new Promise(function (resolve, reject) {
|
|
1095
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_CHATS, {}, resolve, reject);
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
;
|
|
1099
|
+
loadChat(chat) {
|
|
1100
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1101
|
+
const self = this;
|
|
1102
|
+
return new Promise(function (resolve, reject) {
|
|
1103
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.LOAD_CHAT, { id: chat.id }, resolve, reject);
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
;
|
|
1107
|
+
/**
|
|
1108
|
+
* Create chat
|
|
1109
|
+
*
|
|
1110
|
+
* @param chat.members - these members will receive {@link SfuEvent.NEW_CHAT} with {@link UserSpecificChatInfo}
|
|
1111
|
+
* @param chat.type - @deprecated
|
|
1112
|
+
* @param chat.channelSendPolicy - @deprecated
|
|
1113
|
+
* @param chat.sendPermissionList - @deprecated
|
|
1114
|
+
* @param chat.allowedToAddExternalUser - @deprecated
|
|
1115
|
+
*/
|
|
800
1116
|
createChat(chat) {
|
|
801
1117
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
802
1118
|
const self = this;
|
|
@@ -815,6 +1131,13 @@ class SfuExtended {
|
|
|
815
1131
|
});
|
|
816
1132
|
}
|
|
817
1133
|
;
|
|
1134
|
+
/**
|
|
1135
|
+
* Delete chat
|
|
1136
|
+
*
|
|
1137
|
+
* Chat members will receive {@link SfuEvent.CHAT_DELETED} with {@link UserSpecificChatInfo}
|
|
1138
|
+
*
|
|
1139
|
+
* If a direct meeting was started, it will end, and chat participants will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1140
|
+
*/
|
|
818
1141
|
deleteChat(chat) {
|
|
819
1142
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
820
1143
|
const self = this;
|
|
@@ -823,6 +1146,11 @@ class SfuExtended {
|
|
|
823
1146
|
});
|
|
824
1147
|
}
|
|
825
1148
|
;
|
|
1149
|
+
/**
|
|
1150
|
+
* Update chat
|
|
1151
|
+
*
|
|
1152
|
+
* Chat members will receive {@link SfuEvent.CHAT_UPDATED} with {@link UserSpecificChatInfo}
|
|
1153
|
+
*/
|
|
826
1154
|
renameChat(chat) {
|
|
827
1155
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
828
1156
|
const self = this;
|
|
@@ -831,31 +1159,15 @@ class SfuExtended {
|
|
|
831
1159
|
});
|
|
832
1160
|
}
|
|
833
1161
|
;
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
attachments: msg.attachmentsToSend,
|
|
844
|
-
attachmentIdsToDelete: msg.attachmentIdsToDelete
|
|
845
|
-
}, resolve, reject);
|
|
846
|
-
});
|
|
847
|
-
}
|
|
848
|
-
deleteMessage(msg) {
|
|
849
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
850
|
-
const self = this;
|
|
851
|
-
return new Promise(function (resolve, reject) {
|
|
852
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.DELETE_MESSAGE, {
|
|
853
|
-
id: msg.messageId,
|
|
854
|
-
targetEntityType: msg.targetEntityType,
|
|
855
|
-
targetEntityId: msg.targetEntityId,
|
|
856
|
-
}, resolve, reject);
|
|
857
|
-
});
|
|
858
|
-
}
|
|
1162
|
+
/**
|
|
1163
|
+
* Add a member to chat
|
|
1164
|
+
*
|
|
1165
|
+
* Chat members will receive {@link SfuEvent.CHAT_UPDATED} with {@link UserSpecificChatInfo}
|
|
1166
|
+
*
|
|
1167
|
+
* If a direct meeting was started, user will receive {@link SfuEvent.NEW_MEETING} with {@link NewMeeting}.
|
|
1168
|
+
*
|
|
1169
|
+
* @param chat.member - user will receive {@link SfuEvent.NEW_CHAT} with {@link UserSpecificChatInfo}.
|
|
1170
|
+
*/
|
|
859
1171
|
addMemberToChat(chat) {
|
|
860
1172
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
861
1173
|
const self = this;
|
|
@@ -864,6 +1176,16 @@ class SfuExtended {
|
|
|
864
1176
|
});
|
|
865
1177
|
}
|
|
866
1178
|
;
|
|
1179
|
+
/**
|
|
1180
|
+
* Remove a member to chat
|
|
1181
|
+
*
|
|
1182
|
+
* Chat members will receive {@link SfuEvent.CHAT_UPDATED} with {@link UserSpecificChatInfo}
|
|
1183
|
+
*
|
|
1184
|
+
* If a direct meeting was started and user was , user will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1185
|
+
* If the user was a participant in the meeting, users will receive {@link RoomEvent.EVICTED} with {@link EvictedFromRoom}.
|
|
1186
|
+
*
|
|
1187
|
+
* @param chat.member - user will receive {@link SfuEvent.CHAT_DELETED} with {@link UserSpecificChatInfo}.
|
|
1188
|
+
*/
|
|
867
1189
|
removeMemberFromChat(chat) {
|
|
868
1190
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
869
1191
|
const self = this;
|
|
@@ -872,45 +1194,9 @@ class SfuExtended {
|
|
|
872
1194
|
});
|
|
873
1195
|
}
|
|
874
1196
|
;
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
return new Promise(function (resolve, reject) {
|
|
879
|
-
__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);
|
|
880
|
-
});
|
|
881
|
-
}
|
|
882
|
-
addContactToFavourites(contact) {
|
|
883
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
884
|
-
const self = this;
|
|
885
|
-
return new Promise(function (resolve, reject) {
|
|
886
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_CONTACT_TO_FAVOURITES, { id: contact.id }, resolve, reject);
|
|
887
|
-
});
|
|
888
|
-
}
|
|
889
|
-
removeContactFromFavourites(contact) {
|
|
890
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
891
|
-
const self = this;
|
|
892
|
-
return new Promise(function (resolve, reject) {
|
|
893
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CONTACT_FROM_FAVOURITES, { id: contact.id }, resolve, reject);
|
|
894
|
-
});
|
|
895
|
-
}
|
|
896
|
-
confirmContact(invite) {
|
|
897
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
898
|
-
const self = this;
|
|
899
|
-
return new Promise(function (resolve, reject) {
|
|
900
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CONFIRM_CONTACT, {
|
|
901
|
-
from: invite.from,
|
|
902
|
-
to: invite.to,
|
|
903
|
-
id: invite.id
|
|
904
|
-
}, resolve, reject);
|
|
905
|
-
});
|
|
906
|
-
}
|
|
907
|
-
removeContact(contact) {
|
|
908
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
909
|
-
const self = this;
|
|
910
|
-
return new Promise(function (resolve, reject) {
|
|
911
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CONTACT, { id: contact.id }, resolve, reject);
|
|
912
|
-
});
|
|
913
|
-
}
|
|
1197
|
+
/**
|
|
1198
|
+
* @deprecated
|
|
1199
|
+
*/
|
|
914
1200
|
updateChannelSendPolicy(channel) {
|
|
915
1201
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
916
1202
|
const self = this;
|
|
@@ -931,6 +1217,9 @@ class SfuExtended {
|
|
|
931
1217
|
}, resolve, reject);
|
|
932
1218
|
});
|
|
933
1219
|
}
|
|
1220
|
+
/**
|
|
1221
|
+
* @deprecated
|
|
1222
|
+
*/
|
|
934
1223
|
addChannelSendPermissionListMember(channel) {
|
|
935
1224
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
936
1225
|
const self = this;
|
|
@@ -941,6 +1230,9 @@ class SfuExtended {
|
|
|
941
1230
|
}, resolve, reject);
|
|
942
1231
|
});
|
|
943
1232
|
}
|
|
1233
|
+
/**
|
|
1234
|
+
* @deprecated
|
|
1235
|
+
*/
|
|
944
1236
|
removeChannelSendPermissionListMember(channel) {
|
|
945
1237
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
946
1238
|
const self = this;
|
|
@@ -951,6 +1243,9 @@ class SfuExtended {
|
|
|
951
1243
|
}, resolve, reject);
|
|
952
1244
|
});
|
|
953
1245
|
}
|
|
1246
|
+
/**
|
|
1247
|
+
* @deprecated
|
|
1248
|
+
*/
|
|
954
1249
|
updateChatConfiguration(chat) {
|
|
955
1250
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
956
1251
|
const self = this;
|
|
@@ -958,6 +1253,9 @@ class SfuExtended {
|
|
|
958
1253
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_CHAT_CONFIGURATION, chat, resolve, reject);
|
|
959
1254
|
});
|
|
960
1255
|
}
|
|
1256
|
+
/**
|
|
1257
|
+
* Used to change {@link UserSpecificChatInfo.favourite} to true
|
|
1258
|
+
*/
|
|
961
1259
|
addChatToFavourites(chat) {
|
|
962
1260
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
963
1261
|
const self = this;
|
|
@@ -965,6 +1263,9 @@ class SfuExtended {
|
|
|
965
1263
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_CHAT_TO_FAVOURITES, { id: chat.id }, resolve, reject);
|
|
966
1264
|
});
|
|
967
1265
|
}
|
|
1266
|
+
/**
|
|
1267
|
+
* Used to change {@link UserSpecificChatInfo.favourite} to false
|
|
1268
|
+
*/
|
|
968
1269
|
removeChatFromFavourites(chat) {
|
|
969
1270
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
970
1271
|
const self = this;
|
|
@@ -972,6 +1273,15 @@ class SfuExtended {
|
|
|
972
1273
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CHAT_FROM_FAVOURITES, { id: chat.id }, resolve, reject);
|
|
973
1274
|
});
|
|
974
1275
|
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Create room
|
|
1278
|
+
*
|
|
1279
|
+
* To create with PMI settings, PMI must be specified as the ID.
|
|
1280
|
+
*
|
|
1281
|
+
* To join, you need to use room.join.
|
|
1282
|
+
*
|
|
1283
|
+
* @return {@link RoomExtended} with {@link RoomExtended.conferenceType()} that equal {@link ConferenceType.GLOBAL}
|
|
1284
|
+
*/
|
|
975
1285
|
createRoom(options) {
|
|
976
1286
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
977
1287
|
const self = this;
|
|
@@ -984,6 +1294,44 @@ class SfuExtended {
|
|
|
984
1294
|
});
|
|
985
1295
|
}
|
|
986
1296
|
;
|
|
1297
|
+
/**
|
|
1298
|
+
* Create channel meeting
|
|
1299
|
+
*
|
|
1300
|
+
* {@link Room.id()} will be equal channelId
|
|
1301
|
+
*
|
|
1302
|
+
* @return {@link RoomExtended} with {@link RoomExtended.conferenceType()} that equal {@link ConferenceType.CHANNEL}
|
|
1303
|
+
*/
|
|
1304
|
+
createChannelMeeting(options) {
|
|
1305
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1306
|
+
const self = this;
|
|
1307
|
+
return new Promise(function (resolve, reject) {
|
|
1308
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CREATE_CHANNEL_MEETING, {
|
|
1309
|
+
spaceId: options.spaceId,
|
|
1310
|
+
channelId: options.channelId
|
|
1311
|
+
}, resolve, reject);
|
|
1312
|
+
});
|
|
1313
|
+
}
|
|
1314
|
+
/**
|
|
1315
|
+
* Create channel meeting
|
|
1316
|
+
*
|
|
1317
|
+
* {@link Room.id()} will be equal directChatId
|
|
1318
|
+
*
|
|
1319
|
+
* @return {@link RoomExtended} with {@link RoomExtended.conferenceType()} that equal {@link ConferenceType.DIRECT}
|
|
1320
|
+
*/
|
|
1321
|
+
createDirectMeeting(options) {
|
|
1322
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1323
|
+
const self = this;
|
|
1324
|
+
return new Promise(function (resolve, reject) {
|
|
1325
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CREATE_DIRECT_MEETING, {
|
|
1326
|
+
directChatId: options.directChatId,
|
|
1327
|
+
}, resolve, reject);
|
|
1328
|
+
});
|
|
1329
|
+
}
|
|
1330
|
+
/**
|
|
1331
|
+
* Creating a room based on a calendar event created using {@link addCalendarEvent}.
|
|
1332
|
+
*
|
|
1333
|
+
* To join, you need to use room.join()
|
|
1334
|
+
*/
|
|
987
1335
|
createRoomFromEvent(event) {
|
|
988
1336
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
989
1337
|
const self = this;
|
|
@@ -993,12 +1341,20 @@ class SfuExtended {
|
|
|
993
1341
|
}, resolve, reject);
|
|
994
1342
|
});
|
|
995
1343
|
}
|
|
1344
|
+
/**
|
|
1345
|
+
* Get running rooms
|
|
1346
|
+
*/
|
|
996
1347
|
loadActiveRooms() {
|
|
997
1348
|
const self = this;
|
|
998
1349
|
return new Promise((resolve, reject) => {
|
|
999
1350
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_ACTIVE_ROOMS, {}, resolve, reject);
|
|
1000
1351
|
});
|
|
1001
1352
|
}
|
|
1353
|
+
/**
|
|
1354
|
+
* Check and get an available room.
|
|
1355
|
+
*
|
|
1356
|
+
* To join, you need to use room.join()
|
|
1357
|
+
*/
|
|
1002
1358
|
roomAvailable(options) {
|
|
1003
1359
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1004
1360
|
const self = this;
|
|
@@ -1010,6 +1366,9 @@ class SfuExtended {
|
|
|
1010
1366
|
});
|
|
1011
1367
|
}
|
|
1012
1368
|
;
|
|
1369
|
+
/**
|
|
1370
|
+
* Checks for the existence of a running room.
|
|
1371
|
+
*/
|
|
1013
1372
|
roomExists(options) {
|
|
1014
1373
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1015
1374
|
const self = this;
|
|
@@ -1028,6 +1387,11 @@ class SfuExtended {
|
|
|
1028
1387
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1029
1388
|
return __classPrivateFieldGet(this, _SfuExtended_rooms, "f")[options.id];
|
|
1030
1389
|
}
|
|
1390
|
+
/**
|
|
1391
|
+
* Get user spaces
|
|
1392
|
+
*
|
|
1393
|
+
* If channel meetings were started, user will receive {@link SfuEvent.USER_MEETINGS} with {@link MeetingsPreviewEvent}.
|
|
1394
|
+
*/
|
|
1031
1395
|
getUserSpaces() {
|
|
1032
1396
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1033
1397
|
const self = this;
|
|
@@ -1035,25 +1399,9 @@ class SfuExtended {
|
|
|
1035
1399
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_SPACES, {}, resolve, reject);
|
|
1036
1400
|
});
|
|
1037
1401
|
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
return new Promise(function (resolve, reject) {
|
|
1042
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CREATE_CHANNEL_MEETING, {
|
|
1043
|
-
spaceId: options.spaceId,
|
|
1044
|
-
channelId: options.channelId
|
|
1045
|
-
}, resolve, reject);
|
|
1046
|
-
});
|
|
1047
|
-
}
|
|
1048
|
-
createDirectMeeting(options) {
|
|
1049
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1050
|
-
const self = this;
|
|
1051
|
-
return new Promise(function (resolve, reject) {
|
|
1052
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CREATE_DIRECT_MEETING, {
|
|
1053
|
-
directChatId: options.directChatId,
|
|
1054
|
-
}, resolve, reject);
|
|
1055
|
-
});
|
|
1056
|
-
}
|
|
1402
|
+
/**
|
|
1403
|
+
* The space is created with the default category Category1, default channel Channel1 and default role "@everyone".
|
|
1404
|
+
*/
|
|
1057
1405
|
createSpace(space) {
|
|
1058
1406
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1059
1407
|
const self = this;
|
|
@@ -1063,6 +1411,11 @@ class SfuExtended {
|
|
|
1063
1411
|
}, resolve, reject);
|
|
1064
1412
|
});
|
|
1065
1413
|
}
|
|
1414
|
+
/**
|
|
1415
|
+
* Update space overview
|
|
1416
|
+
*
|
|
1417
|
+
* Space members will receive {@link SpaceEvent.SPACE_OVERVIEW_UPDATED} with {@link SpaceOverviewUpdated}
|
|
1418
|
+
*/
|
|
1066
1419
|
updateSpaceOverview(space) {
|
|
1067
1420
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1068
1421
|
const self = this;
|
|
@@ -1073,6 +1426,13 @@ class SfuExtended {
|
|
|
1073
1426
|
}, resolve, reject);
|
|
1074
1427
|
});
|
|
1075
1428
|
}
|
|
1429
|
+
/**
|
|
1430
|
+
* Delete space
|
|
1431
|
+
*
|
|
1432
|
+
* Space members will receive {@link SpaceEvent.SPACE_DELETED} with {@link SpaceDeletedEvent}
|
|
1433
|
+
*
|
|
1434
|
+
* If channel meetings were started, users will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1435
|
+
*/
|
|
1076
1436
|
deleteSpace(space) {
|
|
1077
1437
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1078
1438
|
const self = this;
|
|
@@ -1082,6 +1442,16 @@ class SfuExtended {
|
|
|
1082
1442
|
}, resolve, reject);
|
|
1083
1443
|
});
|
|
1084
1444
|
}
|
|
1445
|
+
/**
|
|
1446
|
+
* Leave space
|
|
1447
|
+
*
|
|
1448
|
+
* Space members will receive {@link SpaceEvent.USER_LEFT_SPACE} with {@link UserLeftSpace}
|
|
1449
|
+
*
|
|
1450
|
+
* After receiving the event, it is necessary to remove the user from the list of members in the space and channels/threads.
|
|
1451
|
+
*
|
|
1452
|
+
* If channel meetings were started, user will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1453
|
+
* If the user was a participant in the meeting, users will receive {@link RoomEvent.EVICTED} with {@link EvictedFromRoom}.
|
|
1454
|
+
*/
|
|
1085
1455
|
leaveSpace(space) {
|
|
1086
1456
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1087
1457
|
const self = this;
|
|
@@ -1091,6 +1461,12 @@ class SfuExtended {
|
|
|
1091
1461
|
}, resolve, reject);
|
|
1092
1462
|
});
|
|
1093
1463
|
}
|
|
1464
|
+
/**
|
|
1465
|
+
* Generate space invite
|
|
1466
|
+
*
|
|
1467
|
+
* If user has permission to create a space invite - generating invite code with 8 symbols.
|
|
1468
|
+
* To create invite link - use 'ws:{serverUrl}:{port}/join-space/inviteCode'
|
|
1469
|
+
*/
|
|
1094
1470
|
generateNewSpaceInvite(options) {
|
|
1095
1471
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1096
1472
|
const self = this;
|
|
@@ -1101,6 +1477,9 @@ class SfuExtended {
|
|
|
1101
1477
|
}, resolve, reject);
|
|
1102
1478
|
});
|
|
1103
1479
|
}
|
|
1480
|
+
/**
|
|
1481
|
+
* Removing the space invite
|
|
1482
|
+
*/
|
|
1104
1483
|
revokeSpaceInvite(options) {
|
|
1105
1484
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1106
1485
|
const self = this;
|
|
@@ -1111,6 +1490,14 @@ class SfuExtended {
|
|
|
1111
1490
|
}, resolve, reject);
|
|
1112
1491
|
});
|
|
1113
1492
|
}
|
|
1493
|
+
/**
|
|
1494
|
+
* Join space by invite code
|
|
1495
|
+
*
|
|
1496
|
+
* Space members will receive {@link SpaceEvent.USER_JOINED_TO_SPACE} with {@link UserJoinedToSpaceEvent}.
|
|
1497
|
+
* On the client side, this user should be added to the list of participants in public channels and threads.
|
|
1498
|
+
*
|
|
1499
|
+
* If channel meetings were started, user will receive {@link SfuEvent.USER_MEETINGS} with {@link MeetingsPreviewEvent}.
|
|
1500
|
+
*/
|
|
1114
1501
|
joinSpaceByInviteCode(inviteCode) {
|
|
1115
1502
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1116
1503
|
const self = this;
|
|
@@ -1120,6 +1507,13 @@ class SfuExtended {
|
|
|
1120
1507
|
}, resolve, reject);
|
|
1121
1508
|
});
|
|
1122
1509
|
}
|
|
1510
|
+
/**
|
|
1511
|
+
* Create space category
|
|
1512
|
+
*
|
|
1513
|
+
* For space owner/user that has permission to manage categories
|
|
1514
|
+
*
|
|
1515
|
+
* Space members will receive {@link SpaceEvent.NEW_SPACE_CATEGORY} with {@link NewSpaceCategoryEvent}
|
|
1516
|
+
*/
|
|
1123
1517
|
createSpaceCategory(category) {
|
|
1124
1518
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1125
1519
|
const self = this;
|
|
@@ -1130,6 +1524,13 @@ class SfuExtended {
|
|
|
1130
1524
|
}, resolve, reject);
|
|
1131
1525
|
});
|
|
1132
1526
|
}
|
|
1527
|
+
/**
|
|
1528
|
+
* Delete space category
|
|
1529
|
+
*
|
|
1530
|
+
* For space owner/category creator/user that has permission to manage categories
|
|
1531
|
+
*
|
|
1532
|
+
* Space members will receive {@link SpaceEvent.SPACE_CATEGORY_DELETED} with {@link SpaceCategoryDeleted}
|
|
1533
|
+
*/
|
|
1133
1534
|
deleteSpaceCategory(options) {
|
|
1134
1535
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1135
1536
|
const self = this;
|
|
@@ -1140,6 +1541,13 @@ class SfuExtended {
|
|
|
1140
1541
|
}, resolve, reject);
|
|
1141
1542
|
});
|
|
1142
1543
|
}
|
|
1544
|
+
/**
|
|
1545
|
+
* Delete space category
|
|
1546
|
+
*
|
|
1547
|
+
* For space owner/category creator/user that has permission to manage categories
|
|
1548
|
+
*
|
|
1549
|
+
* Space members will receive {@link SpaceEvent.SPACE_CATEGORY_UPDATED} with {@link SpaceCategoryUpdated}
|
|
1550
|
+
*/
|
|
1143
1551
|
updateSpaceCategory(options) {
|
|
1144
1552
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1145
1553
|
const self = this;
|
|
@@ -1151,6 +1559,16 @@ class SfuExtended {
|
|
|
1151
1559
|
}, resolve, reject);
|
|
1152
1560
|
});
|
|
1153
1561
|
}
|
|
1562
|
+
/**
|
|
1563
|
+
* Create space channel
|
|
1564
|
+
*
|
|
1565
|
+
* For space owner/user that has permission to manage channels
|
|
1566
|
+
*
|
|
1567
|
+
* Channel members will receive {@link SpaceEvent.NEW_SPACE_CHANNEL} with {@link NewSpaceChannelEvent}
|
|
1568
|
+
*
|
|
1569
|
+
* @param channel.roles - used to create a private channel. Array of role ids or empty array.
|
|
1570
|
+
* @param channel.members - used to create a private channel. Array of member ids or empty array.
|
|
1571
|
+
*/
|
|
1154
1572
|
createSpaceChannel(channel) {
|
|
1155
1573
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1156
1574
|
const self = this;
|
|
@@ -1165,6 +1583,22 @@ class SfuExtended {
|
|
|
1165
1583
|
}, resolve, reject);
|
|
1166
1584
|
});
|
|
1167
1585
|
}
|
|
1586
|
+
/**
|
|
1587
|
+
* Update space channel
|
|
1588
|
+
*
|
|
1589
|
+
* For space owner/user that has permission to manage channels
|
|
1590
|
+
*
|
|
1591
|
+
* Channel members will receive {@link SpaceEvent.SPACE_CHANNEL_UPDATED} with {@link SpaceChannelUpdated}
|
|
1592
|
+
* In the private channel added members will receive {@link SpaceEvent.NEW_SPACE_CHANNEL} with {@link NewSpaceChannelEvent}.
|
|
1593
|
+
* If the channel meeting was started, added members will receive {@link SfuEvent.NEW_MEETING} with {@link NewMeeting}.
|
|
1594
|
+
*
|
|
1595
|
+
* In the private channel deleted members will receive {@link SpaceEvent.SPACE_CHANNEL_DELETED} with {@link SpaceChannelDeleted}
|
|
1596
|
+
* If the channel meeting was started, deleted members will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1597
|
+
* If the deleted user was a participant in the meeting, users will receive {@link RoomEvent.EVICTED} with {@link EvictedFromRoom}.
|
|
1598
|
+
*
|
|
1599
|
+
* @param channel.roles - used to create a private channel. Array of role ids or empty array.
|
|
1600
|
+
* @param channel.members - used to create a private channel. Array of member ids or empty array.
|
|
1601
|
+
*/
|
|
1168
1602
|
updateSpaceChannel(channel) {
|
|
1169
1603
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1170
1604
|
const self = this;
|
|
@@ -1179,6 +1613,13 @@ class SfuExtended {
|
|
|
1179
1613
|
}, resolve, reject);
|
|
1180
1614
|
});
|
|
1181
1615
|
}
|
|
1616
|
+
/**
|
|
1617
|
+
* Move space channel
|
|
1618
|
+
*
|
|
1619
|
+
* Channel members will receive {@link SpaceEvent.SPACE_CHANNEL_MOVED} with {@link SpaceChannelMoved}
|
|
1620
|
+
*
|
|
1621
|
+
* @param channel.categoryId - Specify the identifier of the category to which you want to move the channel, or an empty string to leave the channel uncategorized.
|
|
1622
|
+
*/
|
|
1182
1623
|
moveSpaceChannel(channel) {
|
|
1183
1624
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1184
1625
|
const self = this;
|
|
@@ -1190,6 +1631,13 @@ class SfuExtended {
|
|
|
1190
1631
|
}, resolve, reject);
|
|
1191
1632
|
});
|
|
1192
1633
|
}
|
|
1634
|
+
/**
|
|
1635
|
+
* Delete space channel
|
|
1636
|
+
*
|
|
1637
|
+
* Channel members will receive {@link SpaceEvent.SPACE_CHANNEL_DELETED} with {@link SpaceChannelDeleted}
|
|
1638
|
+
*
|
|
1639
|
+
* If the channel meeting was started, members will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1640
|
+
*/
|
|
1193
1641
|
deleteSpaceChannel(options) {
|
|
1194
1642
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1195
1643
|
const self = this;
|
|
@@ -1200,6 +1648,11 @@ class SfuExtended {
|
|
|
1200
1648
|
}, resolve, reject);
|
|
1201
1649
|
});
|
|
1202
1650
|
}
|
|
1651
|
+
/**
|
|
1652
|
+
* Create space thread
|
|
1653
|
+
*
|
|
1654
|
+
* Thread members will receive {@link SpaceEvent.NEW_SPACE_THREAD} with {@link NewSpaceThreadEvent}
|
|
1655
|
+
*/
|
|
1203
1656
|
createSpaceThread(thread) {
|
|
1204
1657
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1205
1658
|
const self = this;
|
|
@@ -1212,6 +1665,13 @@ class SfuExtended {
|
|
|
1212
1665
|
}, resolve, reject);
|
|
1213
1666
|
});
|
|
1214
1667
|
}
|
|
1668
|
+
/**
|
|
1669
|
+
* Update space thread
|
|
1670
|
+
*
|
|
1671
|
+
* For space owner/thread creator
|
|
1672
|
+
*
|
|
1673
|
+
* Thread members will receive {@link SpaceEvent.SPACE_THREAD_UPDATED} with {@link SpaceThreadUpdated}
|
|
1674
|
+
*/
|
|
1215
1675
|
updateSpaceThread(options) {
|
|
1216
1676
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1217
1677
|
const self = this;
|
|
@@ -1224,6 +1684,13 @@ class SfuExtended {
|
|
|
1224
1684
|
}, resolve, reject);
|
|
1225
1685
|
});
|
|
1226
1686
|
}
|
|
1687
|
+
/**
|
|
1688
|
+
* Delete space thread
|
|
1689
|
+
*
|
|
1690
|
+
* For space owner/thread creator
|
|
1691
|
+
*
|
|
1692
|
+
* Thread members will receive {@link SpaceEvent.SPACE_THREAD_DELETED} with {@link SpaceThreadDeleted}
|
|
1693
|
+
*/
|
|
1227
1694
|
deleteSpaceThread(options) {
|
|
1228
1695
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1229
1696
|
const self = this;
|
|
@@ -1235,6 +1702,15 @@ class SfuExtended {
|
|
|
1235
1702
|
}, resolve, reject);
|
|
1236
1703
|
});
|
|
1237
1704
|
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Add space role
|
|
1707
|
+
*
|
|
1708
|
+
* For space owner/user that has permission to manage roles
|
|
1709
|
+
*
|
|
1710
|
+
* Space members will receive {@link SpaceEvent.NEW_SPACE_ROLE} with {@link NewSpaceRoleAdded}
|
|
1711
|
+
*
|
|
1712
|
+
* On the client side, a new role must be added to the participants listed in the {@link NewSpaceRoleAdded.members}
|
|
1713
|
+
*/
|
|
1238
1714
|
addSpaceRole(role) {
|
|
1239
1715
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1240
1716
|
const self = this;
|
|
@@ -1248,6 +1724,22 @@ class SfuExtended {
|
|
|
1248
1724
|
}, resolve, reject);
|
|
1249
1725
|
});
|
|
1250
1726
|
}
|
|
1727
|
+
/**
|
|
1728
|
+
* Update space role
|
|
1729
|
+
*
|
|
1730
|
+
* For space owner/user that has permission to manage roles
|
|
1731
|
+
*
|
|
1732
|
+
* Space members will receive {@link SpaceEvent.SPACE_ROLE_UPDATED} with {@link SpaceRoleUpdated}
|
|
1733
|
+
*
|
|
1734
|
+
* On the client side, a new role must be added to the participants listed in the {@link SpaceRoleUpdated.membersForAddRole}
|
|
1735
|
+
* and must be removed from participants listed in the {@link SpaceRoleUpdated.membersForDeleteRole}
|
|
1736
|
+
*
|
|
1737
|
+
* Participants from whom this role will be removed will receive {@link SpaceEvent.SPACE_CHANNEL_DELETED} with {@link SpaceChannelDeleted} for each channel they were part of because of this role.
|
|
1738
|
+
*
|
|
1739
|
+
* Participants who are assigned this role will receive {@link SpaceEvent.NEW_SPACE_CHANNEL} with {@link NewSpaceChannelEvent} for each channel that has this role in its access rights.
|
|
1740
|
+
*
|
|
1741
|
+
* Participants who had the role before the update and still have it afterward will receive {@link SpaceEvent.SPACE_CHANNEL_UPDATED} with {@link SpaceChannelUpdated} for each channel that has this role in its access rights.
|
|
1742
|
+
*/
|
|
1251
1743
|
updateSpaceRole(role) {
|
|
1252
1744
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1253
1745
|
const self = this;
|
|
@@ -1262,6 +1754,15 @@ class SfuExtended {
|
|
|
1262
1754
|
}, resolve, reject);
|
|
1263
1755
|
});
|
|
1264
1756
|
}
|
|
1757
|
+
/**
|
|
1758
|
+
* Delete space role
|
|
1759
|
+
*
|
|
1760
|
+
* For space owner/user that has permission to manage roles
|
|
1761
|
+
*
|
|
1762
|
+
* Space members will receive {@link SpaceEvent.SPACE_ROLE_DELETED} with {@link SpaceRoleDeleted}
|
|
1763
|
+
*
|
|
1764
|
+
* On the client side, should remove this role from channel's access rights and update channel members list
|
|
1765
|
+
*/
|
|
1265
1766
|
deleteSpaceRole(options) {
|
|
1266
1767
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1267
1768
|
const self = this;
|
|
@@ -1272,6 +1773,16 @@ class SfuExtended {
|
|
|
1272
1773
|
}, resolve, reject);
|
|
1273
1774
|
});
|
|
1274
1775
|
}
|
|
1776
|
+
/**
|
|
1777
|
+
* Add space role to member
|
|
1778
|
+
*
|
|
1779
|
+
* For space owner/user that has permission to manage roles
|
|
1780
|
+
*
|
|
1781
|
+
* Space members will receive {@link SpaceEvent.ADDED_ROLE_TO_MEMBER} with {@link AddedRoleToMember}
|
|
1782
|
+
*
|
|
1783
|
+
* Member who are assigned this role will receive {@link SpaceEvent.NEW_SPACE_CHANNEL} with {@link NewSpaceChannelEvent} for each channel that has this role in its access rights.
|
|
1784
|
+
* Other members of these channels will receive {@link SpaceEvent.SPACE_CHANNEL_UPDATED} with {@link SpaceChannelUpdated}.
|
|
1785
|
+
*/
|
|
1275
1786
|
addRoleToMember(options) {
|
|
1276
1787
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1277
1788
|
const self = this;
|
|
@@ -1283,6 +1794,16 @@ class SfuExtended {
|
|
|
1283
1794
|
}, resolve, reject);
|
|
1284
1795
|
});
|
|
1285
1796
|
}
|
|
1797
|
+
/**
|
|
1798
|
+
* Remove space role from member
|
|
1799
|
+
*
|
|
1800
|
+
* For space owner/user that has permission to manage roles
|
|
1801
|
+
*
|
|
1802
|
+
* Space members will receive {@link SpaceEvent.REMOVED_ROLE_FROM_MEMBER} with {@link RemovedRoleFromMember}
|
|
1803
|
+
*
|
|
1804
|
+
* Participant from whom this role will be removed will receive {@link SpaceEvent.SPACE_CHANNEL_DELETED} with {@link SpaceChannelDeleted} for each channel they were part of because of this role.
|
|
1805
|
+
* Other members of these channels will receive {@link SpaceEvent.SPACE_CHANNEL_UPDATED} with {@link SpaceChannelUpdated}.
|
|
1806
|
+
*/
|
|
1286
1807
|
removeRoleFromMember(options) {
|
|
1287
1808
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1288
1809
|
const self = this;
|
|
@@ -1301,20 +1822,6 @@ class SfuExtended {
|
|
|
1301
1822
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_ROLE_PERMISSIONS, {}, resolve, reject);
|
|
1302
1823
|
});
|
|
1303
1824
|
}
|
|
1304
|
-
disconnect() {
|
|
1305
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1306
|
-
for (const [key, value] of Object.entries(__classPrivateFieldGet(this, _SfuExtended_rooms, "f"))) {
|
|
1307
|
-
value.leaveRoom();
|
|
1308
|
-
}
|
|
1309
|
-
__classPrivateFieldSet(this, _SfuExtended__user, undefined, "f");
|
|
1310
|
-
if (__classPrivateFieldGet(this, _SfuExtended__state, "f") !== constants_1.State.DISCONNECTED) {
|
|
1311
|
-
yield __classPrivateFieldGet(this, _SfuExtended_connection, "f").close();
|
|
1312
|
-
__classPrivateFieldSet(this, _SfuExtended__state, constants_1.State.DISCONNECTED, "f");
|
|
1313
|
-
}
|
|
1314
|
-
__classPrivateFieldSet(this, _SfuExtended_rooms, {}, "f");
|
|
1315
|
-
});
|
|
1316
|
-
}
|
|
1317
|
-
;
|
|
1318
1825
|
user() {
|
|
1319
1826
|
return __classPrivateFieldGet(this, _SfuExtended__user, "f");
|
|
1320
1827
|
}
|
|
@@ -1388,7 +1895,17 @@ class SfuExtended {
|
|
|
1388
1895
|
}
|
|
1389
1896
|
}
|
|
1390
1897
|
exports.SfuExtended = SfuExtended;
|
|
1391
|
-
_SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _SfuExtended__server = new WeakMap(), _SfuExtended__state = new WeakMap(), _SfuExtended_rooms = new WeakMap(), _SfuExtended_notifier = new WeakMap(), _SfuExtended_uploadingAttachmentState = new WeakMap(), _SfuExtended_downloadingAttachmentState = new WeakMap(), _SfuExtended_binaryChunkSize = new WeakMap(), _SfuExtended_logger = new WeakMap(), _SfuExtended_loggerPrefix = new WeakMap(), _SfuExtended_signUpId = new WeakMap(), _SfuExtended_resetPasswordId = new WeakMap(), _SfuExtended_instances = new WeakSet(),
|
|
1898
|
+
_SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _SfuExtended__server = new WeakMap(), _SfuExtended__state = new WeakMap(), _SfuExtended_rooms = new WeakMap(), _SfuExtended_notifier = new WeakMap(), _SfuExtended_uploadingAttachmentState = new WeakMap(), _SfuExtended_downloadingAttachmentState = new WeakMap(), _SfuExtended_binaryChunkSize = new WeakMap(), _SfuExtended_logger = new WeakMap(), _SfuExtended_loggerPrefix = new WeakMap(), _SfuExtended_signUpId = new WeakMap(), _SfuExtended_resetPasswordId = new WeakMap(), _SfuExtended_instances = new WeakSet(), _SfuExtended_emmitAction = function _SfuExtended_emmitAction(action, data, resolve, reject) {
|
|
1899
|
+
const id = (0, uuid_1.v4)();
|
|
1900
|
+
promises_1.default.add(id, resolve, reject);
|
|
1901
|
+
__classPrivateFieldGet(this, _SfuExtended_connection, "f").send(action, Object.assign(Object.assign({}, data), { internalMessageId: id }));
|
|
1902
|
+
}, _SfuExtended_emmitBinaryAction = function _SfuExtended_emmitBinaryAction(data) {
|
|
1903
|
+
__classPrivateFieldGet(this, _SfuExtended_connection, "f").sendBinaryData(data);
|
|
1904
|
+
}, _SfuExtended_checkAuthenticated = function _SfuExtended_checkAuthenticated() {
|
|
1905
|
+
if (__classPrivateFieldGet(this, _SfuExtended__state, "f") !== constants_1.State.AUTHENTICATED) {
|
|
1906
|
+
throw new Error("User isn't authenticated, current state " + __classPrivateFieldGet(this, _SfuExtended__state, "f"));
|
|
1907
|
+
}
|
|
1908
|
+
}, _SfuExtended_createConnection = function _SfuExtended_createConnection() {
|
|
1392
1909
|
const self = this;
|
|
1393
1910
|
__classPrivateFieldSet(this, _SfuExtended_connection, new connection_1.Connection((name, data) => {
|
|
1394
1911
|
__classPrivateFieldGet(this, _SfuExtended_logger, "f").debug("onMessage: ", data[0]);
|
|
@@ -1434,11 +1951,6 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
|
|
|
1434
1951
|
__classPrivateFieldGet(this, _SfuExtended_downloadingAttachmentState, "f").push(Object.assign(Object.assign({}, request), { payload: null, internalMessageId: ack.internalMessageId }));
|
|
1435
1952
|
}
|
|
1436
1953
|
}
|
|
1437
|
-
else if (data[0].type === constants_1.InternalApi.USER_LIST) {
|
|
1438
|
-
const userList = data[0];
|
|
1439
|
-
promises_1.default.resolve(data[0].internalMessageId, userList.list);
|
|
1440
|
-
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.USER_LIST, userList.list);
|
|
1441
|
-
}
|
|
1442
1954
|
else if (data[0].type === constants_1.InternalApi.USER_CALENDAR) {
|
|
1443
1955
|
const calendar = data[0];
|
|
1444
1956
|
promises_1.default.resolve(data[0].internalMessageId, calendar.calendar);
|
|
@@ -1480,24 +1992,6 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
|
|
|
1480
1992
|
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_CHAT, chatInfo.info);
|
|
1481
1993
|
}
|
|
1482
1994
|
}
|
|
1483
|
-
else if (data[0].type === constants_1.InternalApi.CONTACT_INVITE) {
|
|
1484
|
-
const invite = data[0];
|
|
1485
|
-
if (!promises_1.default.resolve(data[0].internalMessageId, invite.invite)) {
|
|
1486
|
-
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_INVITE, invite.invite);
|
|
1487
|
-
}
|
|
1488
|
-
}
|
|
1489
|
-
else if (data[0].type === constants_1.InternalApi.CONTACT_UPDATED) {
|
|
1490
|
-
const contact = data[0];
|
|
1491
|
-
if (!promises_1.default.resolve(data[0].internalMessageId, contact.contact)) {
|
|
1492
|
-
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_UPDATE, contact.contact);
|
|
1493
|
-
}
|
|
1494
|
-
}
|
|
1495
|
-
else if (data[0].type === constants_1.InternalApi.CONTACT_REMOVED) {
|
|
1496
|
-
const contact = data[0];
|
|
1497
|
-
if (!promises_1.default.resolve(data[0].internalMessageId, contact.contact)) {
|
|
1498
|
-
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_REMOVED, contact.contact);
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
1995
|
else if (data[0].type === constants_1.InternalApi.CHAT_DELETED) {
|
|
1502
1996
|
const chat = data[0];
|
|
1503
1997
|
if (!promises_1.default.resolve(data[0].internalMessageId, chat.info)) {
|
|
@@ -1905,6 +2399,60 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
|
|
|
1905
2399
|
const event = data[0];
|
|
1906
2400
|
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.MeetingSyncEvent.MEETING_NAME_UPDATED_SYNC, event);
|
|
1907
2401
|
}
|
|
2402
|
+
else if (data[0].type === constants_1.SfuEvent.USER_CONTACTS) {
|
|
2403
|
+
const event = data[0];
|
|
2404
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event.contacts)) {
|
|
2405
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.USER_CONTACTS, event);
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
else if (data[0].type === constants_1.SfuEvent.NEW_CONTACT) {
|
|
2409
|
+
const event = data[0];
|
|
2410
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event.contact)) {
|
|
2411
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_CONTACT, event);
|
|
2412
|
+
}
|
|
2413
|
+
}
|
|
2414
|
+
else if (data[0].type === constants_1.SfuEvent.CONTACT_UPDATED) {
|
|
2415
|
+
const event = data[0];
|
|
2416
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event.contact)) {
|
|
2417
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_UPDATED, event);
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
else if (data[0].type === constants_1.SfuEvent.CONTACT_DELETED) {
|
|
2421
|
+
const event = data[0];
|
|
2422
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2423
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONTACT_DELETED, event);
|
|
2424
|
+
}
|
|
2425
|
+
}
|
|
2426
|
+
else if (data[0].type === constants_1.SfuEvent.NEW_INCOMING_FRIEND_INVITE) {
|
|
2427
|
+
const event = data[0];
|
|
2428
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2429
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_INCOMING_FRIEND_INVITE, event);
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
else if (data[0].type === constants_1.SfuEvent.NEW_OUTGOING_FRIEND_INVITE) {
|
|
2433
|
+
const event = data[0];
|
|
2434
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2435
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.NEW_OUTGOING_FRIEND_INVITE, event);
|
|
2436
|
+
}
|
|
2437
|
+
}
|
|
2438
|
+
else if (data[0].type === constants_1.SfuEvent.INCOMING_FRIEND_INVITE_DELETED) {
|
|
2439
|
+
const event = data[0];
|
|
2440
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2441
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.INCOMING_FRIEND_INVITE_DELETED, event);
|
|
2442
|
+
}
|
|
2443
|
+
}
|
|
2444
|
+
else if (data[0].type === constants_1.SfuEvent.OUTGOING_FRIEND_INVITE_DELETED) {
|
|
2445
|
+
const event = data[0];
|
|
2446
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2447
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.OUTGOING_FRIEND_INVITE_DELETED, event);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
else if (data[0].type === constants_1.SfuEvent.USER_PRESENCE_STATUS_UPDATED) {
|
|
2451
|
+
const event = data[0];
|
|
2452
|
+
if (!promises_1.default.resolve(data[0].internalMessageId, event)) {
|
|
2453
|
+
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.USER_PRESENCE_STATUS_UPDATED, event);
|
|
2454
|
+
}
|
|
2455
|
+
}
|
|
1908
2456
|
else {
|
|
1909
2457
|
__classPrivateFieldGet(this, _SfuExtended_notifier, "f").notify(data[0].type, data[0]);
|
|
1910
2458
|
}
|
|
@@ -1974,16 +2522,6 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
|
|
|
1974
2522
|
__classPrivateFieldGet(self, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONNECTION_FAILED, event);
|
|
1975
2523
|
}
|
|
1976
2524
|
}, __classPrivateFieldGet(this, _SfuExtended_logger, "f")), "f");
|
|
1977
|
-
}, _SfuExtended_emmitAction = function _SfuExtended_emmitAction(action, data, resolve, reject) {
|
|
1978
|
-
const id = (0, uuid_1.v4)();
|
|
1979
|
-
promises_1.default.add(id, resolve, reject);
|
|
1980
|
-
__classPrivateFieldGet(this, _SfuExtended_connection, "f").send(action, Object.assign(Object.assign({}, data), { internalMessageId: id }));
|
|
1981
|
-
}, _SfuExtended_emmitBinaryAction = function _SfuExtended_emmitBinaryAction(data) {
|
|
1982
|
-
__classPrivateFieldGet(this, _SfuExtended_connection, "f").sendBinaryData(data);
|
|
1983
|
-
}, _SfuExtended_checkAuthenticated = function _SfuExtended_checkAuthenticated() {
|
|
1984
|
-
if (__classPrivateFieldGet(this, _SfuExtended__state, "f") !== constants_1.State.AUTHENTICATED) {
|
|
1985
|
-
throw new Error("User isn't authenticated, current state " + __classPrivateFieldGet(this, _SfuExtended__state, "f"));
|
|
1986
|
-
}
|
|
1987
2525
|
}, _SfuExtended_getConnectionConfigForAnonymousUser = function _SfuExtended_getConnectionConfigForAnonymousUser(url, timeout) {
|
|
1988
2526
|
return {
|
|
1989
2527
|
url: url,
|