@flashphoner/sfusdk 2.0.278 → 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 +135 -0
- package/dist/sdk/constants.js +135 -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 -94
- package/dist/sdk/sfu-extended.js +696 -225
- 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,44 +751,9 @@ class SfuExtended {
|
|
|
530
751
|
}, resolve, reject);
|
|
531
752
|
});
|
|
532
753
|
}
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
return new Promise(function (resolve, reject) {
|
|
537
|
-
if (!msg) {
|
|
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
|
-
}
|
|
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
|
-
}
|
|
754
|
+
/**
|
|
755
|
+
* Get all users from server
|
|
756
|
+
*/
|
|
571
757
|
getUserList() {
|
|
572
758
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
573
759
|
const self = this;
|
|
@@ -576,197 +762,258 @@ class SfuExtended {
|
|
|
576
762
|
});
|
|
577
763
|
}
|
|
578
764
|
;
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
getUserPmiSettings() {
|
|
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) {
|
|
588
773
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
589
774
|
const self = this;
|
|
590
775
|
return new Promise(function (resolve, reject) {
|
|
591
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
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);
|
|
592
777
|
});
|
|
593
778
|
}
|
|
594
|
-
|
|
779
|
+
/**
|
|
780
|
+
* Add contact to favourites
|
|
781
|
+
*
|
|
782
|
+
* {@link User.favourite} will be changed to true at the server side
|
|
783
|
+
*/
|
|
784
|
+
addContactToFavourites(contact) {
|
|
595
785
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
596
786
|
const self = this;
|
|
597
787
|
return new Promise(function (resolve, reject) {
|
|
598
|
-
__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);
|
|
599
789
|
});
|
|
600
790
|
}
|
|
601
|
-
|
|
791
|
+
/**
|
|
792
|
+
* Remove contact from favourites
|
|
793
|
+
*
|
|
794
|
+
* {@link User.favourite} will be changed to false at the server side
|
|
795
|
+
*/
|
|
796
|
+
removeContactFromFavourites(contact) {
|
|
602
797
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
603
798
|
const self = this;
|
|
604
799
|
return new Promise(function (resolve, reject) {
|
|
605
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
800
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CONTACT_FROM_FAVOURITES, { id: contact.id }, resolve, reject);
|
|
606
801
|
});
|
|
607
802
|
}
|
|
608
|
-
|
|
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) {
|
|
609
811
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
610
812
|
const self = this;
|
|
611
813
|
return new Promise(function (resolve, reject) {
|
|
612
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
613
|
-
|
|
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
|
|
614
818
|
}, resolve, reject);
|
|
615
819
|
});
|
|
616
820
|
}
|
|
617
|
-
|
|
618
|
-
|
|
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) {
|
|
619
829
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
620
830
|
const self = this;
|
|
621
831
|
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);
|
|
832
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CONTACT, { id: contact.id }, resolve, reject);
|
|
628
833
|
});
|
|
629
834
|
}
|
|
630
|
-
|
|
631
|
-
|
|
835
|
+
/**
|
|
836
|
+
* Get all user calendar events
|
|
837
|
+
*/
|
|
838
|
+
getUserCalendar() {
|
|
632
839
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
633
840
|
const self = this;
|
|
634
841
|
return new Promise(function (resolve, reject) {
|
|
635
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
636
|
-
nickname: nickname
|
|
637
|
-
}, resolve, reject);
|
|
842
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_CALENDAR, {}, resolve, reject);
|
|
638
843
|
});
|
|
639
844
|
}
|
|
640
845
|
;
|
|
641
|
-
|
|
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) {
|
|
642
852
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
643
853
|
const self = this;
|
|
644
854
|
return new Promise(function (resolve, reject) {
|
|
645
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
646
|
-
|
|
855
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.ADD_CALENDAR_EVENT, {
|
|
856
|
+
event: event
|
|
647
857
|
}, resolve, reject);
|
|
648
858
|
});
|
|
649
859
|
}
|
|
650
860
|
;
|
|
651
|
-
|
|
861
|
+
removeCalendarEvent(event) {
|
|
652
862
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
653
863
|
const self = this;
|
|
654
864
|
return new Promise(function (resolve, reject) {
|
|
655
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
656
|
-
|
|
865
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.REMOVE_CALENDAR_EVENT, {
|
|
866
|
+
event: event
|
|
657
867
|
}, resolve, reject);
|
|
658
868
|
});
|
|
659
869
|
}
|
|
660
870
|
;
|
|
661
|
-
|
|
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) {
|
|
662
877
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
663
878
|
const self = this;
|
|
664
879
|
return new Promise(function (resolve, reject) {
|
|
665
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
666
|
-
|
|
880
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_CALENDAR_EVENT, {
|
|
881
|
+
event: event
|
|
667
882
|
}, resolve, reject);
|
|
668
883
|
});
|
|
669
884
|
}
|
|
670
|
-
|
|
671
|
-
|
|
885
|
+
/**
|
|
886
|
+
* Get user pmi settings
|
|
887
|
+
*
|
|
888
|
+
* Used for create meetings
|
|
889
|
+
*/
|
|
890
|
+
getUserPmiSettings() {
|
|
672
891
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
673
892
|
const self = this;
|
|
674
893
|
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);
|
|
894
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_PMI_SETTINGS, {}, resolve, reject);
|
|
678
895
|
});
|
|
679
896
|
}
|
|
680
|
-
|
|
681
|
-
|
|
897
|
+
/**
|
|
898
|
+
* Update user pmi settings
|
|
899
|
+
*/
|
|
900
|
+
updateUserPmiSettings(settings) {
|
|
682
901
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
683
902
|
const self = this;
|
|
684
903
|
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);
|
|
904
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.UPDATE_USER_PMI_SETTINGS, Object.assign({}, settings), resolve, reject);
|
|
688
905
|
});
|
|
689
906
|
}
|
|
690
|
-
|
|
691
|
-
|
|
907
|
+
/**
|
|
908
|
+
* Get user info
|
|
909
|
+
*
|
|
910
|
+
* Usually used to display profile info
|
|
911
|
+
*/
|
|
912
|
+
getUserInfo() {
|
|
692
913
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
693
914
|
const self = this;
|
|
694
915
|
return new Promise(function (resolve, reject) {
|
|
695
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
696
|
-
event: event
|
|
697
|
-
}, resolve, reject);
|
|
916
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_USER_INFO, {}, resolve, reject);
|
|
698
917
|
});
|
|
699
918
|
}
|
|
700
|
-
|
|
919
|
+
/**
|
|
920
|
+
* Change user email
|
|
921
|
+
*
|
|
922
|
+
* Users will receive {@link SfuEvent.CONTACT_UPDATED} with changed email
|
|
923
|
+
*/
|
|
924
|
+
changeUserEmail(email) {
|
|
701
925
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
702
926
|
const self = this;
|
|
703
927
|
return new Promise(function (resolve, reject) {
|
|
704
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
928
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CHANGE_USER_EMAIL, {
|
|
929
|
+
email: email
|
|
930
|
+
}, resolve, reject);
|
|
705
931
|
});
|
|
706
932
|
}
|
|
707
933
|
;
|
|
708
|
-
|
|
934
|
+
changeUserPassword(currentPassword, newPassword) {
|
|
709
935
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
710
936
|
const self = this;
|
|
711
937
|
return new Promise(function (resolve, reject) {
|
|
712
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
938
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CHANGE_USER_PASSWORD, {
|
|
939
|
+
password: {
|
|
940
|
+
currentPassword: currentPassword,
|
|
941
|
+
newPassword: newPassword
|
|
942
|
+
}
|
|
943
|
+
}, resolve, reject);
|
|
713
944
|
});
|
|
714
945
|
}
|
|
715
946
|
;
|
|
716
|
-
|
|
947
|
+
/**
|
|
948
|
+
* Change user email
|
|
949
|
+
*
|
|
950
|
+
* Users will receive {@link SfuEvent.CONTACT_UPDATED} with changed nickname
|
|
951
|
+
*/
|
|
952
|
+
changeUserNickname(nickname) {
|
|
717
953
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
718
954
|
const self = this;
|
|
719
955
|
return new Promise(function (resolve, reject) {
|
|
720
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
956
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CHANGE_USER_NICKNAME, {
|
|
957
|
+
nickname: nickname
|
|
958
|
+
}, resolve, reject);
|
|
721
959
|
});
|
|
722
960
|
}
|
|
723
961
|
;
|
|
724
|
-
|
|
962
|
+
changeUserPhoneNumber(phoneNumber) {
|
|
725
963
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
726
964
|
const self = this;
|
|
727
965
|
return new Promise(function (resolve, reject) {
|
|
728
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
966
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CHANGE_USER_PHONE_NUMBER, {
|
|
967
|
+
phoneNumber: phoneNumber
|
|
968
|
+
}, resolve, reject);
|
|
729
969
|
});
|
|
730
970
|
}
|
|
731
971
|
;
|
|
732
|
-
|
|
972
|
+
changeUserHostKey(hostKey) {
|
|
733
973
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
734
974
|
const self = this;
|
|
735
975
|
return new Promise(function (resolve, reject) {
|
|
736
|
-
__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_HOST_KEY, {
|
|
977
|
+
hostKey: hostKey
|
|
978
|
+
}, resolve, reject);
|
|
737
979
|
});
|
|
738
980
|
}
|
|
739
981
|
;
|
|
740
|
-
|
|
982
|
+
changeUserTimezone(timezone) {
|
|
741
983
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
742
984
|
const self = this;
|
|
743
985
|
return new Promise(function (resolve, reject) {
|
|
744
|
-
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.
|
|
745
|
-
|
|
746
|
-
targetEntityId: options.targetEntityId
|
|
986
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.CHANGE_USER_TIMEZONE, {
|
|
987
|
+
timezone: timezone
|
|
747
988
|
}, resolve, reject);
|
|
748
989
|
});
|
|
749
990
|
}
|
|
750
|
-
|
|
991
|
+
;
|
|
992
|
+
/**
|
|
993
|
+
* @deprecated
|
|
994
|
+
*/
|
|
995
|
+
getPublicChannels() {
|
|
751
996
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
752
997
|
const self = this;
|
|
753
998
|
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);
|
|
999
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_PUBLIC_CHANNELS, {}, resolve, reject);
|
|
758
1000
|
});
|
|
759
1001
|
}
|
|
760
|
-
|
|
1002
|
+
;
|
|
1003
|
+
/**
|
|
1004
|
+
* @deprecated
|
|
1005
|
+
*/
|
|
1006
|
+
searchChatMessages(params) {
|
|
761
1007
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
762
1008
|
const self = this;
|
|
763
1009
|
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);
|
|
1010
|
+
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.SEARCH_CHAT_MESSAGES, params, resolve, reject);
|
|
768
1011
|
});
|
|
769
1012
|
}
|
|
1013
|
+
;
|
|
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,25 +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
|
-
}
|
|
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
|
-
}
|
|
1366
|
+
/**
|
|
1367
|
+
* The space is created with the default category Category1, default channel Channel1 and default role "@everyone".
|
|
1368
|
+
*/
|
|
1057
1369
|
createSpace(space) {
|
|
1058
1370
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1059
1371
|
const self = this;
|
|
@@ -1063,6 +1375,11 @@ class SfuExtended {
|
|
|
1063
1375
|
}, resolve, reject);
|
|
1064
1376
|
});
|
|
1065
1377
|
}
|
|
1378
|
+
/**
|
|
1379
|
+
* Update space overview
|
|
1380
|
+
*
|
|
1381
|
+
* Space members will receive {@link SpaceEvent.SPACE_OVERVIEW_UPDATED} with {@link SpaceOverviewUpdated}
|
|
1382
|
+
*/
|
|
1066
1383
|
updateSpaceOverview(space) {
|
|
1067
1384
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1068
1385
|
const self = this;
|
|
@@ -1073,6 +1390,13 @@ class SfuExtended {
|
|
|
1073
1390
|
}, resolve, reject);
|
|
1074
1391
|
});
|
|
1075
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
|
+
*/
|
|
1076
1400
|
deleteSpace(space) {
|
|
1077
1401
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1078
1402
|
const self = this;
|
|
@@ -1082,6 +1406,16 @@ class SfuExtended {
|
|
|
1082
1406
|
}, resolve, reject);
|
|
1083
1407
|
});
|
|
1084
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
|
+
*/
|
|
1085
1419
|
leaveSpace(space) {
|
|
1086
1420
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1087
1421
|
const self = this;
|
|
@@ -1091,6 +1425,12 @@ class SfuExtended {
|
|
|
1091
1425
|
}, resolve, reject);
|
|
1092
1426
|
});
|
|
1093
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
|
+
*/
|
|
1094
1434
|
generateNewSpaceInvite(options) {
|
|
1095
1435
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1096
1436
|
const self = this;
|
|
@@ -1101,6 +1441,9 @@ class SfuExtended {
|
|
|
1101
1441
|
}, resolve, reject);
|
|
1102
1442
|
});
|
|
1103
1443
|
}
|
|
1444
|
+
/**
|
|
1445
|
+
* Removing the space invite
|
|
1446
|
+
*/
|
|
1104
1447
|
revokeSpaceInvite(options) {
|
|
1105
1448
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1106
1449
|
const self = this;
|
|
@@ -1111,6 +1454,14 @@ class SfuExtended {
|
|
|
1111
1454
|
}, resolve, reject);
|
|
1112
1455
|
});
|
|
1113
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
|
+
*/
|
|
1114
1465
|
joinSpaceByInviteCode(inviteCode) {
|
|
1115
1466
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1116
1467
|
const self = this;
|
|
@@ -1120,6 +1471,13 @@ class SfuExtended {
|
|
|
1120
1471
|
}, resolve, reject);
|
|
1121
1472
|
});
|
|
1122
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
|
+
*/
|
|
1123
1481
|
createSpaceCategory(category) {
|
|
1124
1482
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1125
1483
|
const self = this;
|
|
@@ -1130,6 +1488,13 @@ class SfuExtended {
|
|
|
1130
1488
|
}, resolve, reject);
|
|
1131
1489
|
});
|
|
1132
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
|
+
*/
|
|
1133
1498
|
deleteSpaceCategory(options) {
|
|
1134
1499
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1135
1500
|
const self = this;
|
|
@@ -1140,6 +1505,13 @@ class SfuExtended {
|
|
|
1140
1505
|
}, resolve, reject);
|
|
1141
1506
|
});
|
|
1142
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
|
+
*/
|
|
1143
1515
|
updateSpaceCategory(options) {
|
|
1144
1516
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1145
1517
|
const self = this;
|
|
@@ -1151,6 +1523,16 @@ class SfuExtended {
|
|
|
1151
1523
|
}, resolve, reject);
|
|
1152
1524
|
});
|
|
1153
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
|
+
*/
|
|
1154
1536
|
createSpaceChannel(channel) {
|
|
1155
1537
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1156
1538
|
const self = this;
|
|
@@ -1165,6 +1547,22 @@ class SfuExtended {
|
|
|
1165
1547
|
}, resolve, reject);
|
|
1166
1548
|
});
|
|
1167
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
|
+
*/
|
|
1168
1566
|
updateSpaceChannel(channel) {
|
|
1169
1567
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1170
1568
|
const self = this;
|
|
@@ -1179,6 +1577,13 @@ class SfuExtended {
|
|
|
1179
1577
|
}, resolve, reject);
|
|
1180
1578
|
});
|
|
1181
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
|
+
*/
|
|
1182
1587
|
moveSpaceChannel(channel) {
|
|
1183
1588
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1184
1589
|
const self = this;
|
|
@@ -1190,6 +1595,13 @@ class SfuExtended {
|
|
|
1190
1595
|
}, resolve, reject);
|
|
1191
1596
|
});
|
|
1192
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
|
+
*/
|
|
1193
1605
|
deleteSpaceChannel(options) {
|
|
1194
1606
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1195
1607
|
const self = this;
|
|
@@ -1200,6 +1612,11 @@ class SfuExtended {
|
|
|
1200
1612
|
}, resolve, reject);
|
|
1201
1613
|
});
|
|
1202
1614
|
}
|
|
1615
|
+
/**
|
|
1616
|
+
* Create space thread
|
|
1617
|
+
*
|
|
1618
|
+
* Thread members will receive {@link SpaceEvent.NEW_SPACE_THREAD} with {@link NewSpaceThreadEvent}
|
|
1619
|
+
*/
|
|
1203
1620
|
createSpaceThread(thread) {
|
|
1204
1621
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1205
1622
|
const self = this;
|
|
@@ -1212,6 +1629,13 @@ class SfuExtended {
|
|
|
1212
1629
|
}, resolve, reject);
|
|
1213
1630
|
});
|
|
1214
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
|
+
*/
|
|
1215
1639
|
updateSpaceThread(options) {
|
|
1216
1640
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1217
1641
|
const self = this;
|
|
@@ -1224,6 +1648,13 @@ class SfuExtended {
|
|
|
1224
1648
|
}, resolve, reject);
|
|
1225
1649
|
});
|
|
1226
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
|
+
*/
|
|
1227
1658
|
deleteSpaceThread(options) {
|
|
1228
1659
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1229
1660
|
const self = this;
|
|
@@ -1235,6 +1666,15 @@ class SfuExtended {
|
|
|
1235
1666
|
}, resolve, reject);
|
|
1236
1667
|
});
|
|
1237
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
|
+
*/
|
|
1238
1678
|
addSpaceRole(role) {
|
|
1239
1679
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1240
1680
|
const self = this;
|
|
@@ -1248,6 +1688,22 @@ class SfuExtended {
|
|
|
1248
1688
|
}, resolve, reject);
|
|
1249
1689
|
});
|
|
1250
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
|
+
*/
|
|
1251
1707
|
updateSpaceRole(role) {
|
|
1252
1708
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1253
1709
|
const self = this;
|
|
@@ -1262,6 +1718,15 @@ class SfuExtended {
|
|
|
1262
1718
|
}, resolve, reject);
|
|
1263
1719
|
});
|
|
1264
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
|
+
*/
|
|
1265
1730
|
deleteSpaceRole(options) {
|
|
1266
1731
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1267
1732
|
const self = this;
|
|
@@ -1272,6 +1737,16 @@ class SfuExtended {
|
|
|
1272
1737
|
}, resolve, reject);
|
|
1273
1738
|
});
|
|
1274
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
|
+
*/
|
|
1275
1750
|
addRoleToMember(options) {
|
|
1276
1751
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1277
1752
|
const self = this;
|
|
@@ -1283,6 +1758,16 @@ class SfuExtended {
|
|
|
1283
1758
|
}, resolve, reject);
|
|
1284
1759
|
});
|
|
1285
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
|
+
*/
|
|
1286
1771
|
removeRoleFromMember(options) {
|
|
1287
1772
|
__classPrivateFieldGet(this, _SfuExtended_instances, "m", _SfuExtended_checkAuthenticated).call(this);
|
|
1288
1773
|
const self = this;
|
|
@@ -1301,20 +1786,6 @@ class SfuExtended {
|
|
|
1301
1786
|
__classPrivateFieldGet(self, _SfuExtended_instances, "m", _SfuExtended_emmitAction).call(self, constants_1.InternalApi.GET_ROLE_PERMISSIONS, {}, resolve, reject);
|
|
1302
1787
|
});
|
|
1303
1788
|
}
|
|
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
1789
|
user() {
|
|
1319
1790
|
return __classPrivateFieldGet(this, _SfuExtended__user, "f");
|
|
1320
1791
|
}
|
|
@@ -1388,7 +1859,17 @@ class SfuExtended {
|
|
|
1388
1859
|
}
|
|
1389
1860
|
}
|
|
1390
1861
|
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(),
|
|
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() {
|
|
1392
1873
|
const self = this;
|
|
1393
1874
|
__classPrivateFieldSet(this, _SfuExtended_connection, new connection_1.Connection((name, data) => {
|
|
1394
1875
|
__classPrivateFieldGet(this, _SfuExtended_logger, "f").debug("onMessage: ", data[0]);
|
|
@@ -1974,16 +2455,6 @@ _SfuExtended_connection = new WeakMap(), _SfuExtended__user = new WeakMap(), _Sf
|
|
|
1974
2455
|
__classPrivateFieldGet(self, _SfuExtended_notifier, "f").notify(constants_1.SfuEvent.CONNECTION_FAILED, event);
|
|
1975
2456
|
}
|
|
1976
2457
|
}, __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
2458
|
}, _SfuExtended_getConnectionConfigForAnonymousUser = function _SfuExtended_getConnectionConfigForAnonymousUser(url, timeout) {
|
|
1988
2459
|
return {
|
|
1989
2460
|
url: url,
|