@flashphoner/sfusdk 2.0.277 → 2.0.279
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 +137 -1
- package/dist/sdk/constants.js +136 -0
- 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 +565 -91
- package/dist/sdk/sfu-extended.js +694 -214
- 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 +319 -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 +146 -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.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 +93 -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/constants.UserState.html +4 -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 +198 -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.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.ContactInviteEvent.html +1 -0
- package/docs/types/constants.ContactRemovedEvent.html +1 -0
- package/docs/types/constants.ContactUpdateEvent.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.InternalMessage.html +1 -0
- package/docs/types/constants.Invite.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.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.User.html +1 -0
- package/docs/types/constants.UserCalendarEvent.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.UserListEvent.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.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,18 @@ 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
|
+
*/
|
|
87
99
|
connect(options) {
|
|
88
100
|
if (!options) {
|
|
89
101
|
throw new TypeError("No options provided");
|
|
@@ -129,6 +141,32 @@ class SfuExtended {
|
|
|
129
141
|
}));
|
|
130
142
|
}
|
|
131
143
|
;
|
|
144
|
+
/**
|
|
145
|
+
* Method to disconnect from the server
|
|
146
|
+
*
|
|
147
|
+
* When disconnecting, user leaves all active rooms
|
|
148
|
+
*
|
|
149
|
+
* {@link state} changed to {@link State.DISCONNECTED | DISCONNECTED}
|
|
150
|
+
*/
|
|
151
|
+
disconnect() {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
for (const [key, value] of Object.entries(__classPrivateFieldGet(this, _SfuExtended_rooms, "f"))) {
|
|
154
|
+
value.leaveRoom();
|
|
155
|
+
}
|
|
156
|
+
__classPrivateFieldSet(this, _SfuExtended__user, undefined, "f");
|
|
157
|
+
if (__classPrivateFieldGet(this, _SfuExtended__state, "f") !== constants_1.State.DISCONNECTED) {
|
|
158
|
+
yield __classPrivateFieldGet(this, _SfuExtended_connection, "f").close();
|
|
159
|
+
__classPrivateFieldSet(this, _SfuExtended__state, constants_1.State.DISCONNECTED, "f");
|
|
160
|
+
}
|
|
161
|
+
__classPrivateFieldSet(this, _SfuExtended_rooms, {}, "f");
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
;
|
|
165
|
+
/**
|
|
166
|
+
* Sign up for new users
|
|
167
|
+
*
|
|
168
|
+
* Works in a separate connection
|
|
169
|
+
*/
|
|
132
170
|
signUp(options) {
|
|
133
171
|
const connectionConfig = __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_getConnectionConfigForAnonymousUser).call(this, options.url, options.timeout);
|
|
134
172
|
const self = this;
|
|
@@ -191,6 +229,11 @@ class SfuExtended {
|
|
|
191
229
|
});
|
|
192
230
|
}));
|
|
193
231
|
}
|
|
232
|
+
/**
|
|
233
|
+
* Reset password
|
|
234
|
+
*
|
|
235
|
+
* When calls, returns {@link ResetPasswordHandler} then need to call {@link ResetPasswordHandler.resetPassword} to reset the password
|
|
236
|
+
*/
|
|
194
237
|
resetPassword(options) {
|
|
195
238
|
const connectionConfig = __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_getConnectionConfigForAnonymousUser).call(this, options.url, options.timeout);
|
|
196
239
|
const self = this;
|
|
@@ -282,6 +325,9 @@ class SfuExtended {
|
|
|
282
325
|
}
|
|
283
326
|
}));
|
|
284
327
|
}
|
|
328
|
+
/**
|
|
329
|
+
* Remove user (internal using)
|
|
330
|
+
*/
|
|
285
331
|
removeUser(options) {
|
|
286
332
|
const connectionConfig = __classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_getConnectionConfigForAnonymousUser).call(this, options.url, options.timeout);
|
|
287
333
|
const self = this;
|
|
@@ -324,6 +370,9 @@ class SfuExtended {
|
|
|
324
370
|
});
|
|
325
371
|
}));
|
|
326
372
|
}
|
|
373
|
+
/**
|
|
374
|
+
* Logout from app
|
|
375
|
+
*/
|
|
327
376
|
logout() {
|
|
328
377
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
329
378
|
const self = this;
|
|
@@ -332,6 +381,29 @@ class SfuExtended {
|
|
|
332
381
|
});
|
|
333
382
|
}
|
|
334
383
|
;
|
|
384
|
+
/**
|
|
385
|
+
* Load messages for Direct chat | Channel | Thread
|
|
386
|
+
*
|
|
387
|
+
* @param params.timeFrame to load by start date to end date. For load all messages used with start = 0, end = -1.
|
|
388
|
+
* @param params.boundaries to load messages by specifying a particular message using its date,
|
|
389
|
+
* along with the number of messages above and below it. Upper limit includes message with date dateMark.
|
|
390
|
+
*/
|
|
391
|
+
loadMessages(params) {
|
|
392
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
393
|
+
const self = this;
|
|
394
|
+
return new Promise(function (resolve, reject) {
|
|
395
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.LOAD_MESSAGES, params, resolve, reject);
|
|
396
|
+
});
|
|
397
|
+
}
|
|
398
|
+
;
|
|
399
|
+
/**
|
|
400
|
+
* Send a message to a Direct chat | Channel | Thread
|
|
401
|
+
*
|
|
402
|
+
* Members will receive {@link SfuEvent.MESSAGE} with {@link Message}
|
|
403
|
+
*
|
|
404
|
+
* @param msg.parentId to send reply message
|
|
405
|
+
* @param msg.to to send a private message
|
|
406
|
+
*/
|
|
335
407
|
sendMessage(msg) {
|
|
336
408
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
337
409
|
const self = this;
|
|
@@ -356,6 +428,145 @@ class SfuExtended {
|
|
|
356
428
|
});
|
|
357
429
|
}
|
|
358
430
|
;
|
|
431
|
+
/**
|
|
432
|
+
* Edit a message in a Direct chat | Channel | Thread
|
|
433
|
+
*
|
|
434
|
+
* Members will receive {@link SfuEvent.CHAT_MESSAGE_EDITED} with {@link MessageEdited}
|
|
435
|
+
*
|
|
436
|
+
* @param msg.attachmentsToSend to add attachments to sent message
|
|
437
|
+
* @param msg.attachmentIdsToDelete to send a private message
|
|
438
|
+
*/
|
|
439
|
+
editMessage(msg) {
|
|
440
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
441
|
+
const self = this;
|
|
442
|
+
return new Promise(function (resolve, reject) {
|
|
443
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.EDIT_MESSAGE, {
|
|
444
|
+
id: msg.messageId,
|
|
445
|
+
targetEntityType: msg.targetEntityType,
|
|
446
|
+
targetEntityId: msg.targetEntityId,
|
|
447
|
+
body: msg.body,
|
|
448
|
+
attachments: msg.attachmentsToSend,
|
|
449
|
+
attachmentIdsToDelete: msg.attachmentIdsToDelete
|
|
450
|
+
}, resolve, reject);
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Delete a message in a Direct chat | Channel | Thread
|
|
455
|
+
*
|
|
456
|
+
* The message body will be changed to an empty string.
|
|
457
|
+
* The {@link Message.status} will be changed to {@link MessageState.DELETED}
|
|
458
|
+
*
|
|
459
|
+
* Attachments will be removed.
|
|
460
|
+
*
|
|
461
|
+
* Members will receive {@link SfuEvent.CHAT_MESSAGE_DELETED} with {@link MessageDeleted}
|
|
462
|
+
*/
|
|
463
|
+
deleteMessage(msg) {
|
|
464
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
465
|
+
const self = this;
|
|
466
|
+
return new Promise(function (resolve, reject) {
|
|
467
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.DELETE_MESSAGE, {
|
|
468
|
+
id: msg.messageId,
|
|
469
|
+
targetEntityType: msg.targetEntityType,
|
|
470
|
+
targetEntityId: msg.targetEntityId,
|
|
471
|
+
}, resolve, reject);
|
|
472
|
+
});
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Mark message as read in a Direct chat | Channel | Thread
|
|
476
|
+
*
|
|
477
|
+
* In targetEntity will change lastReadMessageId and lastReadMessageDate
|
|
478
|
+
*
|
|
479
|
+
* All unread messages with a {@link Message.date} earlier than or equal to the marked one will be marked as read.
|
|
480
|
+
* The sender of each message will receive {@link SfuEvent.UPDATE_MESSAGES_DELIVERY_STATUS}
|
|
481
|
+
* with {@link UpdateMessagesDeliveryStatusEvent} and {@link Message.deliveryStatus} will be changed at the server side to {@link DeliveryStatus.READ}.
|
|
482
|
+
*/
|
|
483
|
+
markMessageRead(msg) {
|
|
484
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
485
|
+
const self = this;
|
|
486
|
+
return new Promise(function (resolve, reject) {
|
|
487
|
+
if (!msg) {
|
|
488
|
+
reject(new Error("Can't mark null message"));
|
|
489
|
+
}
|
|
490
|
+
else if (!msg.id || msg.id === "") {
|
|
491
|
+
reject(new Error("Can't mark message without massage id"));
|
|
492
|
+
}
|
|
493
|
+
else {
|
|
494
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.MARK_MESSAGE_READ, {
|
|
495
|
+
id: msg.id,
|
|
496
|
+
targetEntityType: msg.targetEntityType,
|
|
497
|
+
targetEntityId: msg.targetEntityId,
|
|
498
|
+
}, resolve, reject);
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* Mark message as unread in a Direct chat | Channel | Thread
|
|
504
|
+
*
|
|
505
|
+
* In targetEntity will change lastReadMessageId and lastReadMessageDate. {@link Message.deliveryStatus}
|
|
506
|
+
*
|
|
507
|
+
* {@link Message.deliveryStatus} will not be changed at the server side. Senders will not receive events,
|
|
508
|
+
* however if the previous lastReadMessageDate is earlier than the updated value,
|
|
509
|
+
* the senders of those messages will receive {@link SfuEvent.UPDATE_MESSAGES_DELIVERY_STATUS}
|
|
510
|
+
* with {@link UpdateMessagesDeliveryStatusEvent} and {@link Message.deliveryStatus} will be changed at the server side to {@link DeliveryStatus.READ}.
|
|
511
|
+
*/
|
|
512
|
+
markMessageUnread(msg) {
|
|
513
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
514
|
+
const self = this;
|
|
515
|
+
return new Promise(function (resolve, reject) {
|
|
516
|
+
if (!msg) {
|
|
517
|
+
reject(new Error("Can't mark null message"));
|
|
518
|
+
}
|
|
519
|
+
else if (!msg.id || msg.id === "") {
|
|
520
|
+
reject(new Error("Can't mark message without massage id"));
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.MARK_MESSAGE_UNREAD, {
|
|
524
|
+
id: msg.id,
|
|
525
|
+
targetEntityType: msg.targetEntityType,
|
|
526
|
+
targetEntityId: msg.targetEntityId,
|
|
527
|
+
}, resolve, reject);
|
|
528
|
+
}
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
/**
|
|
532
|
+
* Get messages count in entity from {@link MessageTargetEntityType}
|
|
533
|
+
*/
|
|
534
|
+
getMessagesCount(options) {
|
|
535
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
536
|
+
const self = this;
|
|
537
|
+
return new Promise(function (resolve, reject) {
|
|
538
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_MESSAGES_COUNT, {
|
|
539
|
+
targetEntityType: options.targetEntityType,
|
|
540
|
+
targetEntityId: options.targetEntityId
|
|
541
|
+
}, resolve, reject);
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Get first message and last message in entity from {@link MessageTargetEntityType}
|
|
546
|
+
*/
|
|
547
|
+
getFirstAndLastMessage(options) {
|
|
548
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
549
|
+
const self = this;
|
|
550
|
+
return new Promise(function (resolve, reject) {
|
|
551
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_FIRST_AND_LAST_MESSAGE, {
|
|
552
|
+
targetEntityType: options.targetEntityType,
|
|
553
|
+
targetEntityId: options.targetEntityId
|
|
554
|
+
}, resolve, reject);
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Get count of unread messages in entity from {@link MessageTargetEntityType}
|
|
559
|
+
*/
|
|
560
|
+
getUnreadMessagesCount(options) {
|
|
561
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
562
|
+
const self = this;
|
|
563
|
+
return new Promise(function (resolve, reject) {
|
|
564
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_UNREAD_MESSAGES_COUNT, {
|
|
565
|
+
targetEntityType: options.targetEntityType,
|
|
566
|
+
targetEntityId: options.targetEntityId
|
|
567
|
+
}, resolve, reject);
|
|
568
|
+
});
|
|
569
|
+
}
|
|
359
570
|
/**
|
|
360
571
|
* This method is recommended for using to generate attachment id before sending.
|
|
361
572
|
* Sending and downloading attachments may not work with other generating options.
|
|
@@ -364,6 +575,11 @@ class SfuExtended {
|
|
|
364
575
|
static generateAttachmentId() {
|
|
365
576
|
return (0, uuid_1.v4)();
|
|
366
577
|
}
|
|
578
|
+
/**
|
|
579
|
+
* Get handler for send or cancel sending attachments
|
|
580
|
+
*
|
|
581
|
+
* Can't cancel sent attachment
|
|
582
|
+
*/
|
|
367
583
|
getSendingAttachmentsHandler(attachments, messageId) {
|
|
368
584
|
const self = this;
|
|
369
585
|
const messageWithAttachmentsState = __classPrivateFieldGet(self, _SfuExtended_uploadingAttachmentState, "f")[messageId];
|
|
@@ -506,6 +722,11 @@ class SfuExtended {
|
|
|
506
722
|
}
|
|
507
723
|
return new sending_attachments_handler_1.SendingAttachmentsHandler(sendAttachments());
|
|
508
724
|
}
|
|
725
|
+
/**
|
|
726
|
+
* Load attachment from server
|
|
727
|
+
*
|
|
728
|
+
* On client side should receive {@link SfuEvent.MESSAGE_ATTACHMENT_STATE} with {@link AttachmentStatus} to show progress
|
|
729
|
+
*/
|
|
509
730
|
getMessageAttachment(attachment) {
|
|
510
731
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
511
732
|
const self = this;
|
|
@@ -530,52 +751,90 @@ class SfuExtended {
|
|
|
530
751
|
}, resolve, reject);
|
|
531
752
|
});
|
|
532
753
|
}
|
|
533
|
-
|
|
754
|
+
/**
|
|
755
|
+
* Get all users from server
|
|
756
|
+
*/
|
|
757
|
+
getUserList() {
|
|
534
758
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
535
759
|
const self = this;
|
|
536
760
|
return new Promise(function (resolve, reject) {
|
|
537
|
-
|
|
538
|
-
reject(new Error("Can't mark null message"));
|
|
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
|
-
}
|
|
761
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_LIST, {}, resolve, reject);
|
|
550
762
|
});
|
|
551
763
|
}
|
|
552
|
-
|
|
764
|
+
;
|
|
765
|
+
/**
|
|
766
|
+
* Invite user to contacts
|
|
767
|
+
*
|
|
768
|
+
* UserId must be passed if user exist. That user will receive {@link SfuEvent.CONTACT_INVITE} with {@link Invite}
|
|
769
|
+
*
|
|
770
|
+
* UserEmail must be passed if there is no such user yet. In this case user will be created at the server side with {@link UserState.PENDING_REGISTRATION} and default parameters
|
|
771
|
+
*/
|
|
772
|
+
inviteContact(invite) {
|
|
553
773
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
554
774
|
const self = this;
|
|
555
775
|
return new Promise(function (resolve, reject) {
|
|
556
|
-
|
|
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
|
-
}
|
|
776
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.INVITE_CONTACT, { from: __classPrivateFieldGet(self, _SfuExtended__user, "f").username, to: invite.to }, resolve, reject);
|
|
569
777
|
});
|
|
570
778
|
}
|
|
571
|
-
|
|
779
|
+
/**
|
|
780
|
+
* Add contact to favourites
|
|
781
|
+
*
|
|
782
|
+
* {@link User.favourite} will be changed to true at the server side
|
|
783
|
+
*/
|
|
784
|
+
addContactToFavourites(contact) {
|
|
572
785
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
573
786
|
const self = this;
|
|
574
787
|
return new Promise(function (resolve, reject) {
|
|
575
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
788
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_CONTACT_TO_FAVOURITES, { id: contact.id }, resolve, reject);
|
|
576
789
|
});
|
|
577
790
|
}
|
|
578
|
-
|
|
791
|
+
/**
|
|
792
|
+
* Remove contact from favourites
|
|
793
|
+
*
|
|
794
|
+
* {@link User.favourite} will be changed to false at the server side
|
|
795
|
+
*/
|
|
796
|
+
removeContactFromFavourites(contact) {
|
|
797
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
798
|
+
const self = this;
|
|
799
|
+
return new Promise(function (resolve, reject) {
|
|
800
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CONTACT_FROM_FAVOURITES, { id: contact.id }, resolve, reject);
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Confirm contact
|
|
805
|
+
*
|
|
806
|
+
* {@link User.confirmed} will be changed to true for both users.
|
|
807
|
+
*
|
|
808
|
+
* @param invite.from - user with that userId will receive {@link SfuEvent.CONTACT_UPDATE} with {@link User}
|
|
809
|
+
*/
|
|
810
|
+
confirmContact(invite) {
|
|
811
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
812
|
+
const self = this;
|
|
813
|
+
return new Promise(function (resolve, reject) {
|
|
814
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CONFIRM_CONTACT, {
|
|
815
|
+
from: invite.from,
|
|
816
|
+
to: invite.to,
|
|
817
|
+
id: invite.id
|
|
818
|
+
}, resolve, reject);
|
|
819
|
+
});
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* Confirm contact
|
|
823
|
+
*
|
|
824
|
+
* {@link User.confirmed} will be changed to true for both users.
|
|
825
|
+
*
|
|
826
|
+
* @param contact.id - user with that userId will receive {@link SfuEvent.CONTACT_REMOVED} with {@link User}
|
|
827
|
+
*/
|
|
828
|
+
removeContact(contact) {
|
|
829
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
830
|
+
const self = this;
|
|
831
|
+
return new Promise(function (resolve, reject) {
|
|
832
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CONTACT, { id: contact.id }, resolve, reject);
|
|
833
|
+
});
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Get all user calendar events
|
|
837
|
+
*/
|
|
579
838
|
getUserCalendar() {
|
|
580
839
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
581
840
|
const self = this;
|
|
@@ -584,6 +843,50 @@ class SfuExtended {
|
|
|
584
843
|
});
|
|
585
844
|
}
|
|
586
845
|
;
|
|
846
|
+
/**
|
|
847
|
+
* Add calendar event
|
|
848
|
+
*
|
|
849
|
+
* @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}
|
|
850
|
+
*/
|
|
851
|
+
addCalendarEvent(event) {
|
|
852
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
853
|
+
const self = this;
|
|
854
|
+
return new Promise(function (resolve, reject) {
|
|
855
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_CALENDAR_EVENT, {
|
|
856
|
+
event: event
|
|
857
|
+
}, resolve, reject);
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
;
|
|
861
|
+
removeCalendarEvent(event) {
|
|
862
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
863
|
+
const self = this;
|
|
864
|
+
return new Promise(function (resolve, reject) {
|
|
865
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CALENDAR_EVENT, {
|
|
866
|
+
event: event
|
|
867
|
+
}, resolve, reject);
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
;
|
|
871
|
+
/**
|
|
872
|
+
* Update calendar event
|
|
873
|
+
*
|
|
874
|
+
* @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}
|
|
875
|
+
*/
|
|
876
|
+
updateCalendarEvent(event) {
|
|
877
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
878
|
+
const self = this;
|
|
879
|
+
return new Promise(function (resolve, reject) {
|
|
880
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_CALENDAR_EVENT, {
|
|
881
|
+
event: event
|
|
882
|
+
}, resolve, reject);
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* Get user pmi settings
|
|
887
|
+
*
|
|
888
|
+
* Used for create meetings
|
|
889
|
+
*/
|
|
587
890
|
getUserPmiSettings() {
|
|
588
891
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
589
892
|
const self = this;
|
|
@@ -591,6 +894,9 @@ class SfuExtended {
|
|
|
591
894
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_PMI_SETTINGS, {}, resolve, reject);
|
|
592
895
|
});
|
|
593
896
|
}
|
|
897
|
+
/**
|
|
898
|
+
* Update user pmi settings
|
|
899
|
+
*/
|
|
594
900
|
updateUserPmiSettings(settings) {
|
|
595
901
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
596
902
|
const self = this;
|
|
@@ -598,6 +904,11 @@ class SfuExtended {
|
|
|
598
904
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_USER_PMI_SETTINGS, Object.assign({}, settings), resolve, reject);
|
|
599
905
|
});
|
|
600
906
|
}
|
|
907
|
+
/**
|
|
908
|
+
* Get user info
|
|
909
|
+
*
|
|
910
|
+
* Usually used to display profile info
|
|
911
|
+
*/
|
|
601
912
|
getUserInfo() {
|
|
602
913
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
603
914
|
const self = this;
|
|
@@ -605,6 +916,11 @@ class SfuExtended {
|
|
|
605
916
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_INFO, {}, resolve, reject);
|
|
606
917
|
});
|
|
607
918
|
}
|
|
919
|
+
/**
|
|
920
|
+
* Change user email
|
|
921
|
+
*
|
|
922
|
+
* Users will receive {@link SfuEvent.CONTACT_UPDATED} with changed email
|
|
923
|
+
*/
|
|
608
924
|
changeUserEmail(email) {
|
|
609
925
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
610
926
|
const self = this;
|
|
@@ -628,6 +944,11 @@ class SfuExtended {
|
|
|
628
944
|
});
|
|
629
945
|
}
|
|
630
946
|
;
|
|
947
|
+
/**
|
|
948
|
+
* Change user email
|
|
949
|
+
*
|
|
950
|
+
* Users will receive {@link SfuEvent.CONTACT_UPDATED} with changed nickname
|
|
951
|
+
*/
|
|
631
952
|
changeUserNickname(nickname) {
|
|
632
953
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
633
954
|
const self = this;
|
|
@@ -668,43 +989,9 @@ class SfuExtended {
|
|
|
668
989
|
});
|
|
669
990
|
}
|
|
670
991
|
;
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
return new Promise(function (resolve, reject) {
|
|
675
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_CALENDAR_EVENT, {
|
|
676
|
-
event: event
|
|
677
|
-
}, resolve, reject);
|
|
678
|
-
});
|
|
679
|
-
}
|
|
680
|
-
;
|
|
681
|
-
removeCalendarEvent(event) {
|
|
682
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
683
|
-
const self = this;
|
|
684
|
-
return new Promise(function (resolve, reject) {
|
|
685
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CALENDAR_EVENT, {
|
|
686
|
-
event: event
|
|
687
|
-
}, resolve, reject);
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
;
|
|
691
|
-
updateCalendarEvent(event) {
|
|
692
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
693
|
-
const self = this;
|
|
694
|
-
return new Promise(function (resolve, reject) {
|
|
695
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_CALENDAR_EVENT, {
|
|
696
|
-
event: event
|
|
697
|
-
}, resolve, reject);
|
|
698
|
-
});
|
|
699
|
-
}
|
|
700
|
-
getUserChats() {
|
|
701
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
702
|
-
const self = this;
|
|
703
|
-
return new Promise(function (resolve, reject) {
|
|
704
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_CHATS, {}, resolve, reject);
|
|
705
|
-
});
|
|
706
|
-
}
|
|
707
|
-
;
|
|
992
|
+
/**
|
|
993
|
+
* @deprecated
|
|
994
|
+
*/
|
|
708
995
|
getPublicChannels() {
|
|
709
996
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
710
997
|
const self = this;
|
|
@@ -713,22 +1000,9 @@ class SfuExtended {
|
|
|
713
1000
|
});
|
|
714
1001
|
}
|
|
715
1002
|
;
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
return new Promise(function (resolve, reject) {
|
|
720
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.LOAD_CHAT, { id: chat.id }, resolve, reject);
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
;
|
|
724
|
-
loadMessages(params) {
|
|
725
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
726
|
-
const self = this;
|
|
727
|
-
return new Promise(function (resolve, reject) {
|
|
728
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.LOAD_MESSAGES, params, resolve, reject);
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
;
|
|
1003
|
+
/**
|
|
1004
|
+
* @deprecated
|
|
1005
|
+
*/
|
|
732
1006
|
searchChatMessages(params) {
|
|
733
1007
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
734
1008
|
const self = this;
|
|
@@ -737,36 +1011,9 @@ class SfuExtended {
|
|
|
737
1011
|
});
|
|
738
1012
|
}
|
|
739
1013
|
;
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
return new Promise(function (resolve, reject) {
|
|
744
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_MESSAGES_COUNT, {
|
|
745
|
-
targetEntityType: options.targetEntityType,
|
|
746
|
-
targetEntityId: options.targetEntityId
|
|
747
|
-
}, resolve, reject);
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
getFirstAndLastMessage(options) {
|
|
751
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
752
|
-
const self = this;
|
|
753
|
-
return new Promise(function (resolve, reject) {
|
|
754
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_FIRST_AND_LAST_MESSAGE, {
|
|
755
|
-
targetEntityType: options.targetEntityType,
|
|
756
|
-
targetEntityId: options.targetEntityId
|
|
757
|
-
}, resolve, reject);
|
|
758
|
-
});
|
|
759
|
-
}
|
|
760
|
-
getUnreadMessagesCount(options) {
|
|
761
|
-
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
762
|
-
const self = this;
|
|
763
|
-
return new Promise(function (resolve, reject) {
|
|
764
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_UNREAD_MESSAGES_COUNT, {
|
|
765
|
-
targetEntityType: options.targetEntityType,
|
|
766
|
-
targetEntityId: options.targetEntityId
|
|
767
|
-
}, resolve, reject);
|
|
768
|
-
});
|
|
769
|
-
}
|
|
1014
|
+
/**
|
|
1015
|
+
* @deprecated
|
|
1016
|
+
*/
|
|
770
1017
|
searchMessageAttachments(params) {
|
|
771
1018
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
772
1019
|
const self = this;
|
|
@@ -783,6 +1030,9 @@ class SfuExtended {
|
|
|
783
1030
|
});
|
|
784
1031
|
}
|
|
785
1032
|
;
|
|
1033
|
+
/**
|
|
1034
|
+
* @deprecated
|
|
1035
|
+
*/
|
|
786
1036
|
loadMessagesWithMentions(params) {
|
|
787
1037
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
788
1038
|
const self = this;
|
|
@@ -797,6 +1047,36 @@ class SfuExtended {
|
|
|
797
1047
|
});
|
|
798
1048
|
}
|
|
799
1049
|
;
|
|
1050
|
+
/**
|
|
1051
|
+
* Get chats.
|
|
1052
|
+
*
|
|
1053
|
+
* To work with messages in the chat, you need to use {@link MessageTargetEntityType.CHAT}
|
|
1054
|
+
*/
|
|
1055
|
+
getUserChats() {
|
|
1056
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1057
|
+
const self = this;
|
|
1058
|
+
return new Promise(function (resolve, reject) {
|
|
1059
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_CHATS, {}, resolve, reject);
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
;
|
|
1063
|
+
loadChat(chat) {
|
|
1064
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1065
|
+
const self = this;
|
|
1066
|
+
return new Promise(function (resolve, reject) {
|
|
1067
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.LOAD_CHAT, { id: chat.id }, resolve, reject);
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
;
|
|
1071
|
+
/**
|
|
1072
|
+
* Create chat
|
|
1073
|
+
*
|
|
1074
|
+
* @param chat.members - these members will receive {@link SfuEvent.NEW_CHAT} with {@link UserSpecificChatInfo}
|
|
1075
|
+
* @param chat.type - @deprecated
|
|
1076
|
+
* @param chat.channelSendPolicy - @deprecated
|
|
1077
|
+
* @param chat.sendPermissionList - @deprecated
|
|
1078
|
+
* @param chat.allowedToAddExternalUser - @deprecated
|
|
1079
|
+
*/
|
|
800
1080
|
createChat(chat) {
|
|
801
1081
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
802
1082
|
const self = this;
|
|
@@ -815,6 +1095,13 @@ class SfuExtended {
|
|
|
815
1095
|
});
|
|
816
1096
|
}
|
|
817
1097
|
;
|
|
1098
|
+
/**
|
|
1099
|
+
* Delete chat
|
|
1100
|
+
*
|
|
1101
|
+
* Chat members will receive {@link SfuEvent.CHAT_DELETED} with {@link UserSpecificChatInfo}
|
|
1102
|
+
*
|
|
1103
|
+
* If a direct meeting was started, it will end, and chat participants will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1104
|
+
*/
|
|
818
1105
|
deleteChat(chat) {
|
|
819
1106
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
820
1107
|
const self = this;
|
|
@@ -823,6 +1110,11 @@ class SfuExtended {
|
|
|
823
1110
|
});
|
|
824
1111
|
}
|
|
825
1112
|
;
|
|
1113
|
+
/**
|
|
1114
|
+
* Update chat
|
|
1115
|
+
*
|
|
1116
|
+
* Chat members will receive {@link SfuEvent.CHAT_UPDATED} with {@link UserSpecificChatInfo}
|
|
1117
|
+
*/
|
|
826
1118
|
renameChat(chat) {
|
|
827
1119
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
828
1120
|
const self = this;
|
|
@@ -831,31 +1123,15 @@ class SfuExtended {
|
|
|
831
1123
|
});
|
|
832
1124
|
}
|
|
833
1125
|
;
|
|
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
|
-
}
|
|
1126
|
+
/**
|
|
1127
|
+
* Add a member to chat
|
|
1128
|
+
*
|
|
1129
|
+
* Chat members will receive {@link SfuEvent.CHAT_UPDATED} with {@link UserSpecificChatInfo}
|
|
1130
|
+
*
|
|
1131
|
+
* If a direct meeting was started, user will receive {@link SfuEvent.NEW_MEETING} with {@link NewMeeting}.
|
|
1132
|
+
*
|
|
1133
|
+
* @param chat.member - user will receive {@link SfuEvent.NEW_CHAT} with {@link UserSpecificChatInfo}.
|
|
1134
|
+
*/
|
|
859
1135
|
addMemberToChat(chat) {
|
|
860
1136
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
861
1137
|
const self = this;
|
|
@@ -864,6 +1140,16 @@ class SfuExtended {
|
|
|
864
1140
|
});
|
|
865
1141
|
}
|
|
866
1142
|
;
|
|
1143
|
+
/**
|
|
1144
|
+
* Remove a member to chat
|
|
1145
|
+
*
|
|
1146
|
+
* Chat members will receive {@link SfuEvent.CHAT_UPDATED} with {@link UserSpecificChatInfo}
|
|
1147
|
+
*
|
|
1148
|
+
* If a direct meeting was started and user was , user will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1149
|
+
* If the user was a participant in the meeting, users will receive {@link RoomEvent.EVICTED} with {@link EvictedFromRoom}.
|
|
1150
|
+
*
|
|
1151
|
+
* @param chat.member - user will receive {@link SfuEvent.CHAT_DELETED} with {@link UserSpecificChatInfo}.
|
|
1152
|
+
*/
|
|
867
1153
|
removeMemberFromChat(chat) {
|
|
868
1154
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
869
1155
|
const self = this;
|
|
@@ -872,45 +1158,9 @@ class SfuExtended {
|
|
|
872
1158
|
});
|
|
873
1159
|
}
|
|
874
1160
|
;
|
|
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
|
-
}
|
|
1161
|
+
/**
|
|
1162
|
+
* @deprecated
|
|
1163
|
+
*/
|
|
914
1164
|
updateChannelSendPolicy(channel) {
|
|
915
1165
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
916
1166
|
const self = this;
|
|
@@ -931,6 +1181,9 @@ class SfuExtended {
|
|
|
931
1181
|
}, resolve, reject);
|
|
932
1182
|
});
|
|
933
1183
|
}
|
|
1184
|
+
/**
|
|
1185
|
+
* @deprecated
|
|
1186
|
+
*/
|
|
934
1187
|
addChannelSendPermissionListMember(channel) {
|
|
935
1188
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
936
1189
|
const self = this;
|
|
@@ -941,6 +1194,9 @@ class SfuExtended {
|
|
|
941
1194
|
}, resolve, reject);
|
|
942
1195
|
});
|
|
943
1196
|
}
|
|
1197
|
+
/**
|
|
1198
|
+
* @deprecated
|
|
1199
|
+
*/
|
|
944
1200
|
removeChannelSendPermissionListMember(channel) {
|
|
945
1201
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
946
1202
|
const self = this;
|
|
@@ -951,6 +1207,9 @@ class SfuExtended {
|
|
|
951
1207
|
}, resolve, reject);
|
|
952
1208
|
});
|
|
953
1209
|
}
|
|
1210
|
+
/**
|
|
1211
|
+
* @deprecated
|
|
1212
|
+
*/
|
|
954
1213
|
updateChatConfiguration(chat) {
|
|
955
1214
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
956
1215
|
const self = this;
|
|
@@ -958,6 +1217,9 @@ class SfuExtended {
|
|
|
958
1217
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_CHAT_CONFIGURATION, chat, resolve, reject);
|
|
959
1218
|
});
|
|
960
1219
|
}
|
|
1220
|
+
/**
|
|
1221
|
+
* Used to change {@link UserSpecificChatInfo.favourite} to true
|
|
1222
|
+
*/
|
|
961
1223
|
addChatToFavourites(chat) {
|
|
962
1224
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
963
1225
|
const self = this;
|
|
@@ -965,6 +1227,9 @@ class SfuExtended {
|
|
|
965
1227
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_CHAT_TO_FAVOURITES, { id: chat.id }, resolve, reject);
|
|
966
1228
|
});
|
|
967
1229
|
}
|
|
1230
|
+
/**
|
|
1231
|
+
* Used to change {@link UserSpecificChatInfo.favourite} to false
|
|
1232
|
+
*/
|
|
968
1233
|
removeChatFromFavourites(chat) {
|
|
969
1234
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
970
1235
|
const self = this;
|
|
@@ -972,6 +1237,15 @@ class SfuExtended {
|
|
|
972
1237
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CHAT_FROM_FAVOURITES, { id: chat.id }, resolve, reject);
|
|
973
1238
|
});
|
|
974
1239
|
}
|
|
1240
|
+
/**
|
|
1241
|
+
* Create room
|
|
1242
|
+
*
|
|
1243
|
+
* To create with PMI settings, PMI must be specified as the ID.
|
|
1244
|
+
*
|
|
1245
|
+
* To join, you need to use room.join.
|
|
1246
|
+
*
|
|
1247
|
+
* @return {@link RoomExtended} with {@link RoomExtended.conferenceType()} that equal {@link ConferenceType.GLOBAL}
|
|
1248
|
+
*/
|
|
975
1249
|
createRoom(options) {
|
|
976
1250
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
977
1251
|
const self = this;
|
|
@@ -984,6 +1258,44 @@ class SfuExtended {
|
|
|
984
1258
|
});
|
|
985
1259
|
}
|
|
986
1260
|
;
|
|
1261
|
+
/**
|
|
1262
|
+
* Create channel meeting
|
|
1263
|
+
*
|
|
1264
|
+
* {@link Room.id()} will be equal channelId
|
|
1265
|
+
*
|
|
1266
|
+
* @return {@link RoomExtended} with {@link RoomExtended.conferenceType()} that equal {@link ConferenceType.CHANNEL}
|
|
1267
|
+
*/
|
|
1268
|
+
createChannelMeeting(options) {
|
|
1269
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1270
|
+
const self = this;
|
|
1271
|
+
return new Promise(function (resolve, reject) {
|
|
1272
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CREATE_CHANNEL_MEETING, {
|
|
1273
|
+
spaceId: options.spaceId,
|
|
1274
|
+
channelId: options.channelId
|
|
1275
|
+
}, resolve, reject);
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
/**
|
|
1279
|
+
* Create channel meeting
|
|
1280
|
+
*
|
|
1281
|
+
* {@link Room.id()} will be equal directChatId
|
|
1282
|
+
*
|
|
1283
|
+
* @return {@link RoomExtended} with {@link RoomExtended.conferenceType()} that equal {@link ConferenceType.DIRECT}
|
|
1284
|
+
*/
|
|
1285
|
+
createDirectMeeting(options) {
|
|
1286
|
+
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1287
|
+
const self = this;
|
|
1288
|
+
return new Promise(function (resolve, reject) {
|
|
1289
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CREATE_DIRECT_MEETING, {
|
|
1290
|
+
directChatId: options.directChatId,
|
|
1291
|
+
}, resolve, reject);
|
|
1292
|
+
});
|
|
1293
|
+
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Creating a room based on a calendar event created using {@link addCalendarEvent}.
|
|
1296
|
+
*
|
|
1297
|
+
* To join, you need to use room.join()
|
|
1298
|
+
*/
|
|
987
1299
|
createRoomFromEvent(event) {
|
|
988
1300
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
989
1301
|
const self = this;
|
|
@@ -993,12 +1305,20 @@ class SfuExtended {
|
|
|
993
1305
|
}, resolve, reject);
|
|
994
1306
|
});
|
|
995
1307
|
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Get running rooms
|
|
1310
|
+
*/
|
|
996
1311
|
loadActiveRooms() {
|
|
997
1312
|
const self = this;
|
|
998
1313
|
return new Promise((resolve, reject) => {
|
|
999
1314
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_ACTIVE_ROOMS, {}, resolve, reject);
|
|
1000
1315
|
});
|
|
1001
1316
|
}
|
|
1317
|
+
/**
|
|
1318
|
+
* Check and get an available room.
|
|
1319
|
+
*
|
|
1320
|
+
* To join, you need to use room.join()
|
|
1321
|
+
*/
|
|
1002
1322
|
roomAvailable(options) {
|
|
1003
1323
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1004
1324
|
const self = this;
|
|
@@ -1010,6 +1330,9 @@ class SfuExtended {
|
|
|
1010
1330
|
});
|
|
1011
1331
|
}
|
|
1012
1332
|
;
|
|
1333
|
+
/**
|
|
1334
|
+
* Checks for the existence of a running room.
|
|
1335
|
+
*/
|
|
1013
1336
|
roomExists(options) {
|
|
1014
1337
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1015
1338
|
const self = this;
|
|
@@ -1028,6 +1351,11 @@ class SfuExtended {
|
|
|
1028
1351
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1029
1352
|
return __classPrivateFieldGet(this, _SfuExtended_rooms, "f")[options.id];
|
|
1030
1353
|
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Get user spaces
|
|
1356
|
+
*
|
|
1357
|
+
* If channel meetings were started, user will receive {@link SfuEvent.USER_MEETINGS} with {@link MeetingsPreviewEvent}.
|
|
1358
|
+
*/
|
|
1031
1359
|
getUserSpaces() {
|
|
1032
1360
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1033
1361
|
const self = this;
|
|
@@ -1035,16 +1363,9 @@ class SfuExtended {
|
|
|
1035
1363
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_SPACES, {}, resolve, reject);
|
|
1036
1364
|
});
|
|
1037
1365
|
}
|
|
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
|
-
}
|
|
1366
|
+
/**
|
|
1367
|
+
* The space is created with the default category Category1, default channel Channel1 and default role "@everyone".
|
|
1368
|
+
*/
|
|
1048
1369
|
createSpace(space) {
|
|
1049
1370
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1050
1371
|
const self = this;
|
|
@@ -1054,6 +1375,11 @@ class SfuExtended {
|
|
|
1054
1375
|
}, resolve, reject);
|
|
1055
1376
|
});
|
|
1056
1377
|
}
|
|
1378
|
+
/**
|
|
1379
|
+
* Update space overview
|
|
1380
|
+
*
|
|
1381
|
+
* Space members will receive {@link SpaceEvent.SPACE_OVERVIEW_UPDATED} with {@link SpaceOverviewUpdated}
|
|
1382
|
+
*/
|
|
1057
1383
|
updateSpaceOverview(space) {
|
|
1058
1384
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1059
1385
|
const self = this;
|
|
@@ -1064,6 +1390,13 @@ class SfuExtended {
|
|
|
1064
1390
|
}, resolve, reject);
|
|
1065
1391
|
});
|
|
1066
1392
|
}
|
|
1393
|
+
/**
|
|
1394
|
+
* Delete space
|
|
1395
|
+
*
|
|
1396
|
+
* Space members will receive {@link SpaceEvent.SPACE_DELETED} with {@link SpaceDeletedEvent}
|
|
1397
|
+
*
|
|
1398
|
+
* If channel meetings were started, users will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1399
|
+
*/
|
|
1067
1400
|
deleteSpace(space) {
|
|
1068
1401
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1069
1402
|
const self = this;
|
|
@@ -1073,6 +1406,16 @@ class SfuExtended {
|
|
|
1073
1406
|
}, resolve, reject);
|
|
1074
1407
|
});
|
|
1075
1408
|
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Leave space
|
|
1411
|
+
*
|
|
1412
|
+
* Space members will receive {@link SpaceEvent.USER_LEFT_SPACE} with {@link UserLeftSpace}
|
|
1413
|
+
*
|
|
1414
|
+
* After receiving the event, it is necessary to remove the user from the list of members in the space and channels/threads.
|
|
1415
|
+
*
|
|
1416
|
+
* If channel meetings were started, user will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1417
|
+
* If the user was a participant in the meeting, users will receive {@link RoomEvent.EVICTED} with {@link EvictedFromRoom}.
|
|
1418
|
+
*/
|
|
1076
1419
|
leaveSpace(space) {
|
|
1077
1420
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1078
1421
|
const self = this;
|
|
@@ -1082,6 +1425,12 @@ class SfuExtended {
|
|
|
1082
1425
|
}, resolve, reject);
|
|
1083
1426
|
});
|
|
1084
1427
|
}
|
|
1428
|
+
/**
|
|
1429
|
+
* Generate space invite
|
|
1430
|
+
*
|
|
1431
|
+
* If user has permission to create a space invite - generating invite code with 8 symbols.
|
|
1432
|
+
* To create invite link - use 'ws:{serverUrl}:{port}/join-space/inviteCode'
|
|
1433
|
+
*/
|
|
1085
1434
|
generateNewSpaceInvite(options) {
|
|
1086
1435
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1087
1436
|
const self = this;
|
|
@@ -1092,6 +1441,9 @@ class SfuExtended {
|
|
|
1092
1441
|
}, resolve, reject);
|
|
1093
1442
|
});
|
|
1094
1443
|
}
|
|
1444
|
+
/**
|
|
1445
|
+
* Removing the space invite
|
|
1446
|
+
*/
|
|
1095
1447
|
revokeSpaceInvite(options) {
|
|
1096
1448
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1097
1449
|
const self = this;
|
|
@@ -1102,6 +1454,14 @@ class SfuExtended {
|
|
|
1102
1454
|
}, resolve, reject);
|
|
1103
1455
|
});
|
|
1104
1456
|
}
|
|
1457
|
+
/**
|
|
1458
|
+
* Join space by invite code
|
|
1459
|
+
*
|
|
1460
|
+
* Space members will receive {@link SpaceEvent.USER_JOINED_TO_SPACE} with {@link UserJoinedToSpaceEvent}.
|
|
1461
|
+
* On the client side, this user should be added to the list of participants in public channels and threads.
|
|
1462
|
+
*
|
|
1463
|
+
* If channel meetings were started, user will receive {@link SfuEvent.USER_MEETINGS} with {@link MeetingsPreviewEvent}.
|
|
1464
|
+
*/
|
|
1105
1465
|
joinSpaceByInviteCode(inviteCode) {
|
|
1106
1466
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1107
1467
|
const self = this;
|
|
@@ -1111,6 +1471,13 @@ class SfuExtended {
|
|
|
1111
1471
|
}, resolve, reject);
|
|
1112
1472
|
});
|
|
1113
1473
|
}
|
|
1474
|
+
/**
|
|
1475
|
+
* Create space category
|
|
1476
|
+
*
|
|
1477
|
+
* For space owner/user that has permission to manage categories
|
|
1478
|
+
*
|
|
1479
|
+
* Space members will receive {@link SpaceEvent.NEW_SPACE_CATEGORY} with {@link NewSpaceCategoryEvent}
|
|
1480
|
+
*/
|
|
1114
1481
|
createSpaceCategory(category) {
|
|
1115
1482
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1116
1483
|
const self = this;
|
|
@@ -1121,6 +1488,13 @@ class SfuExtended {
|
|
|
1121
1488
|
}, resolve, reject);
|
|
1122
1489
|
});
|
|
1123
1490
|
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Delete space category
|
|
1493
|
+
*
|
|
1494
|
+
* For space owner/category creator/user that has permission to manage categories
|
|
1495
|
+
*
|
|
1496
|
+
* Space members will receive {@link SpaceEvent.SPACE_CATEGORY_DELETED} with {@link SpaceCategoryDeleted}
|
|
1497
|
+
*/
|
|
1124
1498
|
deleteSpaceCategory(options) {
|
|
1125
1499
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1126
1500
|
const self = this;
|
|
@@ -1131,6 +1505,13 @@ class SfuExtended {
|
|
|
1131
1505
|
}, resolve, reject);
|
|
1132
1506
|
});
|
|
1133
1507
|
}
|
|
1508
|
+
/**
|
|
1509
|
+
* Delete space category
|
|
1510
|
+
*
|
|
1511
|
+
* For space owner/category creator/user that has permission to manage categories
|
|
1512
|
+
*
|
|
1513
|
+
* Space members will receive {@link SpaceEvent.SPACE_CATEGORY_UPDATED} with {@link SpaceCategoryUpdated}
|
|
1514
|
+
*/
|
|
1134
1515
|
updateSpaceCategory(options) {
|
|
1135
1516
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1136
1517
|
const self = this;
|
|
@@ -1142,6 +1523,16 @@ class SfuExtended {
|
|
|
1142
1523
|
}, resolve, reject);
|
|
1143
1524
|
});
|
|
1144
1525
|
}
|
|
1526
|
+
/**
|
|
1527
|
+
* Create space channel
|
|
1528
|
+
*
|
|
1529
|
+
* For space owner/user that has permission to manage channels
|
|
1530
|
+
*
|
|
1531
|
+
* Channel members will receive {@link SpaceEvent.NEW_SPACE_CHANNEL} with {@link NewSpaceChannelEvent}
|
|
1532
|
+
*
|
|
1533
|
+
* @param channel.roles - used to create a private channel. Array of role ids or empty array.
|
|
1534
|
+
* @param channel.members - used to create a private channel. Array of member ids or empty array.
|
|
1535
|
+
*/
|
|
1145
1536
|
createSpaceChannel(channel) {
|
|
1146
1537
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1147
1538
|
const self = this;
|
|
@@ -1156,6 +1547,22 @@ class SfuExtended {
|
|
|
1156
1547
|
}, resolve, reject);
|
|
1157
1548
|
});
|
|
1158
1549
|
}
|
|
1550
|
+
/**
|
|
1551
|
+
* Update space channel
|
|
1552
|
+
*
|
|
1553
|
+
* For space owner/user that has permission to manage channels
|
|
1554
|
+
*
|
|
1555
|
+
* Channel members will receive {@link SpaceEvent.SPACE_CHANNEL_UPDATED} with {@link SpaceChannelUpdated}
|
|
1556
|
+
* In the private channel added members will receive {@link SpaceEvent.NEW_SPACE_CHANNEL} with {@link NewSpaceChannelEvent}.
|
|
1557
|
+
* If the channel meeting was started, added members will receive {@link SfuEvent.NEW_MEETING} with {@link NewMeeting}.
|
|
1558
|
+
*
|
|
1559
|
+
* In the private channel deleted members will receive {@link SpaceEvent.SPACE_CHANNEL_DELETED} with {@link SpaceChannelDeleted}
|
|
1560
|
+
* If the channel meeting was started, deleted members will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1561
|
+
* If the deleted user was a participant in the meeting, users will receive {@link RoomEvent.EVICTED} with {@link EvictedFromRoom}.
|
|
1562
|
+
*
|
|
1563
|
+
* @param channel.roles - used to create a private channel. Array of role ids or empty array.
|
|
1564
|
+
* @param channel.members - used to create a private channel. Array of member ids or empty array.
|
|
1565
|
+
*/
|
|
1159
1566
|
updateSpaceChannel(channel) {
|
|
1160
1567
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1161
1568
|
const self = this;
|
|
@@ -1170,6 +1577,13 @@ class SfuExtended {
|
|
|
1170
1577
|
}, resolve, reject);
|
|
1171
1578
|
});
|
|
1172
1579
|
}
|
|
1580
|
+
/**
|
|
1581
|
+
* Move space channel
|
|
1582
|
+
*
|
|
1583
|
+
* Channel members will receive {@link SpaceEvent.SPACE_CHANNEL_MOVED} with {@link SpaceChannelMoved}
|
|
1584
|
+
*
|
|
1585
|
+
* @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.
|
|
1586
|
+
*/
|
|
1173
1587
|
moveSpaceChannel(channel) {
|
|
1174
1588
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1175
1589
|
const self = this;
|
|
@@ -1181,6 +1595,13 @@ class SfuExtended {
|
|
|
1181
1595
|
}, resolve, reject);
|
|
1182
1596
|
});
|
|
1183
1597
|
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Delete space channel
|
|
1600
|
+
*
|
|
1601
|
+
* Channel members will receive {@link SpaceEvent.SPACE_CHANNEL_DELETED} with {@link SpaceChannelDeleted}
|
|
1602
|
+
*
|
|
1603
|
+
* If the channel meeting was started, members will receive {@link MeetingSyncEvent.MEETING_ENDED_SYNC} with {@link MeetingEndedSync}.
|
|
1604
|
+
*/
|
|
1184
1605
|
deleteSpaceChannel(options) {
|
|
1185
1606
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1186
1607
|
const self = this;
|
|
@@ -1191,6 +1612,11 @@ class SfuExtended {
|
|
|
1191
1612
|
}, resolve, reject);
|
|
1192
1613
|
});
|
|
1193
1614
|
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Create space thread
|
|
1617
|
+
*
|
|
1618
|
+
* Thread members will receive {@link SpaceEvent.NEW_SPACE_THREAD} with {@link NewSpaceThreadEvent}
|
|
1619
|
+
*/
|
|
1194
1620
|
createSpaceThread(thread) {
|
|
1195
1621
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1196
1622
|
const self = this;
|
|
@@ -1203,6 +1629,13 @@ class SfuExtended {
|
|
|
1203
1629
|
}, resolve, reject);
|
|
1204
1630
|
});
|
|
1205
1631
|
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Update space thread
|
|
1634
|
+
*
|
|
1635
|
+
* For space owner/thread creator
|
|
1636
|
+
*
|
|
1637
|
+
* Thread members will receive {@link SpaceEvent.SPACE_THREAD_UPDATED} with {@link SpaceThreadUpdated}
|
|
1638
|
+
*/
|
|
1206
1639
|
updateSpaceThread(options) {
|
|
1207
1640
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1208
1641
|
const self = this;
|
|
@@ -1215,6 +1648,13 @@ class SfuExtended {
|
|
|
1215
1648
|
}, resolve, reject);
|
|
1216
1649
|
});
|
|
1217
1650
|
}
|
|
1651
|
+
/**
|
|
1652
|
+
* Delete space thread
|
|
1653
|
+
*
|
|
1654
|
+
* For space owner/thread creator
|
|
1655
|
+
*
|
|
1656
|
+
* Thread members will receive {@link SpaceEvent.SPACE_THREAD_DELETED} with {@link SpaceThreadDeleted}
|
|
1657
|
+
*/
|
|
1218
1658
|
deleteSpaceThread(options) {
|
|
1219
1659
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1220
1660
|
const self = this;
|
|
@@ -1226,6 +1666,15 @@ class SfuExtended {
|
|
|
1226
1666
|
}, resolve, reject);
|
|
1227
1667
|
});
|
|
1228
1668
|
}
|
|
1669
|
+
/**
|
|
1670
|
+
* Add space role
|
|
1671
|
+
*
|
|
1672
|
+
* For space owner/user that has permission to manage roles
|
|
1673
|
+
*
|
|
1674
|
+
* Space members will receive {@link SpaceEvent.NEW_SPACE_ROLE} with {@link NewSpaceRoleAdded}
|
|
1675
|
+
*
|
|
1676
|
+
* On the client side, a new role must be added to the participants listed in the {@link NewSpaceRoleAdded.members}
|
|
1677
|
+
*/
|
|
1229
1678
|
addSpaceRole(role) {
|
|
1230
1679
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1231
1680
|
const self = this;
|
|
@@ -1239,6 +1688,22 @@ class SfuExtended {
|
|
|
1239
1688
|
}, resolve, reject);
|
|
1240
1689
|
});
|
|
1241
1690
|
}
|
|
1691
|
+
/**
|
|
1692
|
+
* Update space role
|
|
1693
|
+
*
|
|
1694
|
+
* For space owner/user that has permission to manage roles
|
|
1695
|
+
*
|
|
1696
|
+
* Space members will receive {@link SpaceEvent.SPACE_ROLE_UPDATED} with {@link SpaceRoleUpdated}
|
|
1697
|
+
*
|
|
1698
|
+
* On the client side, a new role must be added to the participants listed in the {@link SpaceRoleUpdated.membersForAddRole}
|
|
1699
|
+
* and must be removed from participants listed in the {@link SpaceRoleUpdated.membersForDeleteRole}
|
|
1700
|
+
*
|
|
1701
|
+
* 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.
|
|
1702
|
+
*
|
|
1703
|
+
* 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.
|
|
1704
|
+
*
|
|
1705
|
+
* 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.
|
|
1706
|
+
*/
|
|
1242
1707
|
updateSpaceRole(role) {
|
|
1243
1708
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1244
1709
|
const self = this;
|
|
@@ -1253,6 +1718,15 @@ class SfuExtended {
|
|
|
1253
1718
|
}, resolve, reject);
|
|
1254
1719
|
});
|
|
1255
1720
|
}
|
|
1721
|
+
/**
|
|
1722
|
+
* Delete space role
|
|
1723
|
+
*
|
|
1724
|
+
* For space owner/user that has permission to manage roles
|
|
1725
|
+
*
|
|
1726
|
+
* Space members will receive {@link SpaceEvent.SPACE_ROLE_DELETED} with {@link SpaceRoleDeleted}
|
|
1727
|
+
*
|
|
1728
|
+
* On the client side, should remove this role from channel's access rights and update channel members list
|
|
1729
|
+
*/
|
|
1256
1730
|
deleteSpaceRole(options) {
|
|
1257
1731
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1258
1732
|
const self = this;
|
|
@@ -1263,6 +1737,16 @@ class SfuExtended {
|
|
|
1263
1737
|
}, resolve, reject);
|
|
1264
1738
|
});
|
|
1265
1739
|
}
|
|
1740
|
+
/**
|
|
1741
|
+
* Add space role to member
|
|
1742
|
+
*
|
|
1743
|
+
* For space owner/user that has permission to manage roles
|
|
1744
|
+
*
|
|
1745
|
+
* Space members will receive {@link SpaceEvent.ADDED_ROLE_TO_MEMBER} with {@link AddedRoleToMember}
|
|
1746
|
+
*
|
|
1747
|
+
* 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.
|
|
1748
|
+
* Other members of these channels will receive {@link SpaceEvent.SPACE_CHANNEL_UPDATED} with {@link SpaceChannelUpdated}.
|
|
1749
|
+
*/
|
|
1266
1750
|
addRoleToMember(options) {
|
|
1267
1751
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1268
1752
|
const self = this;
|
|
@@ -1274,6 +1758,16 @@ class SfuExtended {
|
|
|
1274
1758
|
}, resolve, reject);
|
|
1275
1759
|
});
|
|
1276
1760
|
}
|
|
1761
|
+
/**
|
|
1762
|
+
* Remove space role from member
|
|
1763
|
+
*
|
|
1764
|
+
* For space owner/user that has permission to manage roles
|
|
1765
|
+
*
|
|
1766
|
+
* Space members will receive {@link SpaceEvent.REMOVED_ROLE_FROM_MEMBER} with {@link RemovedRoleFromMember}
|
|
1767
|
+
*
|
|
1768
|
+
* 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.
|
|
1769
|
+
* Other members of these channels will receive {@link SpaceEvent.SPACE_CHANNEL_UPDATED} with {@link SpaceChannelUpdated}.
|
|
1770
|
+
*/
|
|
1277
1771
|
removeRoleFromMember(options) {
|
|
1278
1772
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1279
1773
|
const self = this;
|
|
@@ -1292,20 +1786,6 @@ class SfuExtended {
|
|
|
1292
1786
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_ROLE_PERMISSIONS, {}, resolve, reject);
|
|
1293
1787
|
});
|
|
1294
1788
|
}
|
|
1295
|
-
disconnect() {
|
|
1296
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1297
|
-
for (const [key, value] of Object.entries(__classPrivateFieldGet(this, _SfuExtended_rooms, "f"))) {
|
|
1298
|
-
value.leaveRoom();
|
|
1299
|
-
}
|
|
1300
|
-
__classPrivateFieldSet(this, _SfuExtended__user, undefined, "f");
|
|
1301
|
-
if (__classPrivateFieldGet(this, _SfuExtended__state, "f") !== constants_1.State.DISCONNECTED) {
|
|
1302
|
-
yield __classPrivateFieldGet(this, _SfuExtended_connection, "f").close();
|
|
1303
|
-
__classPrivateFieldSet(this, _SfuExtended__state, constants_1.State.DISCONNECTED, "f");
|
|
1304
|
-
}
|
|
1305
|
-
__classPrivateFieldSet(this, _SfuExtended_rooms, {}, "f");
|
|
1306
|
-
});
|
|
1307
|
-
}
|
|
1308
|
-
;
|
|
1309
1789
|
user() {
|
|
1310
1790
|
return __classPrivateFieldGet(this, _SfuExtended__user, "f");
|
|
1311
1791
|
}
|
|
@@ -1379,7 +1859,17 @@ class SfuExtended {
|
|
|
1379
1859
|
}
|
|
1380
1860
|
}
|
|
1381
1861
|
exports.SfuExtended = SfuExtended;
|
|
1382
|
-
_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(),
|
|
1862
|
+
_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) {
|
|
1863
|
+
const id = (0, uuid_1.v4)();
|
|
1864
|
+
promises_1.default.add(id, resolve, reject);
|
|
1865
|
+
__classPrivateFieldGet(this, _SfuExtended_connection, "f").send(action, Object.assign(Object.assign({}, data), { internalMessageId: id }));
|
|
1866
|
+
}, _SfuExtended_emmitBinaryAction = function _SfuExtended_emmitBinaryAction(data) {
|
|
1867
|
+
__classPrivateFieldGet(this, _SfuExtended_connection, "f").sendBinaryData(data);
|
|
1868
|
+
}, _SfuExtended_checkAuthenticated = function _SfuExtended_checkAuthenticated() {
|
|
1869
|
+
if (__classPrivateFieldGet(this, _SfuExtended__state, "f") !== constants_1.State.AUTHENTICATED) {
|
|
1870
|
+
throw new Error("User isn't authenticated, current state " + __classPrivateFieldGet(this, _SfuExtended__state, "f"));
|
|
1871
|
+
}
|
|
1872
|
+
}, _SfuExtended_createConnection = function _SfuExtended_createConnection() {
|
|
1383
1873
|
const self = this;
|
|
1384
1874
|
__classPrivateFieldSet(this, _SfuExtended_connection, new connection_1.Connection((name, data) => {
|
|
1385
1875
|
__classPrivateFieldGet(this, _SfuExtended_logger, "f").debug("onMessage: ", data[0]);
|
|
@@ -1965,16 +2455,6 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
|
|
|
1965
2455
|
__classPrivateFieldGet(self, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONNECTION_FAILED, event);
|
|
1966
2456
|
}
|
|
1967
2457
|
}, __classPrivateFieldGet(this, _SfuExtended_logger, "f")), "f");
|
|
1968
|
-
}, _SfuExtended_emmitAction = function _SfuExtended_emmitAction(action, data, resolve, reject) {
|
|
1969
|
-
const id = (0, uuid_1.v4)();
|
|
1970
|
-
promises_1.default.add(id, resolve, reject);
|
|
1971
|
-
__classPrivateFieldGet(this, _SfuExtended_connection, "f").send(action, Object.assign(Object.assign({}, data), { internalMessageId: id }));
|
|
1972
|
-
}, _SfuExtended_emmitBinaryAction = function _SfuExtended_emmitBinaryAction(data) {
|
|
1973
|
-
__classPrivateFieldGet(this, _SfuExtended_connection, "f").sendBinaryData(data);
|
|
1974
|
-
}, _SfuExtended_checkAuthenticated = function _SfuExtended_checkAuthenticated() {
|
|
1975
|
-
if (__classPrivateFieldGet(this, _SfuExtended__state, "f") !== constants_1.State.AUTHENTICATED) {
|
|
1976
|
-
throw new Error("User isn't authenticated, current state " + __classPrivateFieldGet(this, _SfuExtended__state, "f"));
|
|
1977
|
-
}
|
|
1978
2458
|
}, _SfuExtended_getConnectionConfigForAnonymousUser = function _SfuExtended_getConnectionConfigForAnonymousUser(url, timeout) {
|
|
1979
2459
|
return {
|
|
1980
2460
|
url: url,
|