fcr-core 3.8.2 → 3.9.0-alpha
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/lib/chat-connector/type.d.ts +40 -0
- package/lib/{chat-connection → chat-connector}/type.js +1 -1
- package/lib/engine/index.d.ts +10 -11
- package/lib/engine/index.js +63 -72
- package/lib/engine/type.d.ts +96 -0
- package/lib/engine/type.js +5 -0
- package/lib/imports.d.ts +7 -4
- package/lib/imports.js +30 -4
- package/lib/index.d.ts +3 -2
- package/lib/index.js +21 -2
- package/lib/media-control/desktop.js +12 -12
- package/lib/media-control/mobile.js +4 -0
- package/lib/media-control/type.d.ts +32 -33
- package/lib/monitor-control/index.js +3 -3
- package/lib/peer-session/index.js +14 -14
- package/lib/peer-session/type.d.ts +1 -1
- package/lib/plugins/chat/chatroom.js +417 -0
- package/lib/{chat-connection → plugins/chat}/config.d.ts +1 -0
- package/lib/{chat-connection → plugins/chat}/config.js +2 -1
- package/lib/plugins/chat/connector.d.ts +38 -0
- package/lib/{chat-connection/index.js → plugins/chat/connector.js} +181 -61
- package/lib/room-control/ability-control/index.js +5 -4
- package/lib/room-control/ability-control/type.d.ts +5 -1
- package/lib/room-control/ability-control/type.js +4 -0
- package/lib/room-control/chatroom-control/type.d.ts +44 -35
- package/lib/room-control/group-control/index.js +9 -9
- package/lib/room-control/index.js +37 -22
- package/lib/room-control/interpreter-control/index.js +7 -4
- package/lib/room-control/interpreter-control/room.js +3 -3
- package/lib/room-control/interpreter-control/types.d.ts +2 -2
- package/lib/room-control/join-before-host-waitingroom-control/index.js +3 -3
- package/lib/room-control/mainroom-control/index.js +15 -13
- package/lib/room-control/privilege-control/index.js +39 -24
- package/lib/room-control/privilege-control/type.d.ts +15 -15
- package/lib/room-control/room-connector-control/index.js +7 -5
- package/lib/room-control/room-connector-control/type.d.ts +1 -1
- package/lib/room-control/room-control-factory.d.ts +3 -3
- package/lib/room-control/room-control-factory.js +7 -7
- package/lib/room-control/room-session/index.js +17 -15
- package/lib/room-control/room-session/type.d.ts +3 -3
- package/lib/room-control/sharing-control/index.js +13 -7
- package/lib/room-control/stream-control/index.js +18 -16
- package/lib/room-control/stream-control/type.d.ts +5 -5
- package/lib/room-control/stt-control/index.js +38 -31
- package/lib/room-control/type.d.ts +19 -19
- package/lib/room-control/user-control/index.js +20 -22
- package/lib/room-control/user-control/type.d.ts +1 -1
- package/lib/room-control/waitingroom-control/index.js +11 -11
- package/lib/room-control/whiteboard-control-v1/board-window.d.ts +21 -20
- package/lib/room-control/whiteboard-control-v1/board-window.js +27 -8
- package/lib/room-control/whiteboard-control-v1/factory.js +1 -1
- package/lib/room-control/whiteboard-control-v1/index.js +26 -18
- package/lib/room-control/whiteboard-control-v1/type.d.ts +26 -25
- package/lib/room-control/whiteboard-control-v1/type.js +1 -0
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.d.ts +15 -6
- package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.d.ts +4 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +6 -5
- package/lib/room-control/whiteboard-control-v2/annotation-control/type.d.ts +7 -1
- package/lib/room-control/whiteboard-control-v2/base/index.d.ts +9 -8
- package/lib/room-control/whiteboard-control-v2/base/index.js +84 -42
- package/lib/room-control/whiteboard-control-v2/base/main-window.d.ts +16 -15
- package/lib/room-control/whiteboard-control-v2/base/main-window.js +23 -4
- package/lib/room-control/whiteboard-control-v2/type.d.ts +17 -17
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.d.ts +12 -6
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +64 -18
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.d.ts +2 -2
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
- package/lib/room-control/whiteboard-control-v2/whiteboard-control/type.d.ts +1 -1
- package/lib/room-router/index.js +10 -7
- package/lib/room-router/type.d.ts +1 -1
- package/lib/schema.d.ts +24 -46
- package/lib/schema.js +1 -2
- package/lib/service/api.d.ts +5 -3
- package/lib/service/api.js +17 -12
- package/lib/type.d.ts +64 -45
- package/lib/type.js +76 -11
- package/lib/utilities/abortable-retry.d.ts +38 -0
- package/lib/utilities/abortable-retry.js +61 -0
- package/lib/utilities/dual-video-stream-config.d.ts +6 -0
- package/lib/utilities/dual-video-stream-config.js +25 -0
- package/lib/utilities/error-helpers.d.ts +10 -9
- package/lib/utilities/error-helpers.js +12 -11
- package/lib/utilities/error.d.ts +4 -40
- package/lib/utilities/error.js +20 -77
- package/lib/utilities/join-helper.js +2 -2
- package/lib/utilities/logger.d.ts +2 -2
- package/lib/utilities/logger.js +6 -25
- package/lib/utilities/package-info.d.ts +1 -2
- package/lib/utilities/package-info.js +4 -8
- package/lib/utilities/parameters.js +88 -15
- package/lib/utilities/validate-params.js +1 -1
- package/lib/utilities/video-encoder-config.d.ts +9 -0
- package/lib/utilities/video-encoder-config.js +109 -0
- package/lib-es/{chat-connection → chat-connector}/type.js +1 -1
- package/lib-es/engine/index.js +46 -56
- package/lib-es/engine/type.js +1 -0
- package/lib-es/imports.js +5 -3
- package/lib-es/index.js +2 -1
- package/lib-es/media-control/desktop.js +12 -12
- package/lib-es/media-control/mobile.js +4 -0
- package/lib-es/monitor-control/index.js +3 -3
- package/lib-es/peer-session/index.js +16 -15
- package/lib-es/plugins/chat/chatroom.js +409 -0
- package/lib-es/{chat-connection → plugins/chat}/config.js +2 -1
- package/lib-es/{chat-connection/index.js → plugins/chat/connector.js} +178 -58
- package/lib-es/room-control/ability-control/index.js +5 -4
- package/lib-es/room-control/ability-control/type.js +4 -0
- package/lib-es/room-control/group-control/index.js +11 -10
- package/lib-es/room-control/index.js +40 -26
- package/lib-es/room-control/interpreter-control/index.js +10 -5
- package/lib-es/room-control/interpreter-control/room.js +3 -3
- package/lib-es/room-control/join-before-host-waitingroom-control/index.js +4 -3
- package/lib-es/room-control/mainroom-control/index.js +16 -17
- package/lib-es/room-control/privilege-control/index.js +43 -29
- package/lib-es/room-control/room-connector-control/index.js +9 -6
- package/lib-es/room-control/room-control-factory.js +6 -6
- package/lib-es/room-control/room-session/index.js +21 -22
- package/lib-es/room-control/sharing-control/index.js +13 -7
- package/lib-es/room-control/stream-control/index.js +21 -18
- package/lib-es/room-control/stt-control/index.js +23 -15
- package/lib-es/room-control/user-control/index.js +23 -23
- package/lib-es/room-control/waitingroom-control/index.js +10 -9
- package/lib-es/room-control/whiteboard-control-v1/board-window.js +27 -8
- package/lib-es/room-control/whiteboard-control-v1/factory.js +1 -1
- package/lib-es/room-control/whiteboard-control-v1/index.js +26 -17
- package/lib-es/room-control/whiteboard-control-v1/type.js +1 -0
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +39 -5
- package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +7 -6
- package/lib-es/room-control/whiteboard-control-v2/base/index.js +86 -42
- package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +23 -4
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +60 -13
- package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +10 -10
- package/lib-es/room-router/index.js +10 -6
- package/lib-es/schema.js +1 -2
- package/lib-es/service/api.js +17 -12
- package/lib-es/type.js +70 -18
- package/lib-es/utilities/abortable-retry.js +54 -0
- package/lib-es/utilities/dual-video-stream-config.js +19 -0
- package/lib-es/utilities/error-helpers.js +13 -12
- package/lib-es/utilities/error.js +9 -75
- package/lib-es/utilities/join-helper.js +4 -3
- package/lib-es/utilities/logger.js +7 -23
- package/lib-es/utilities/package-info.js +4 -6
- package/lib-es/utilities/parameters.js +88 -15
- package/lib-es/utilities/validate-params.js +3 -2
- package/lib-es/utilities/video-encoder-config.js +103 -0
- package/package.json +7 -7
- package/lib/chat-connection/index.d.ts +0 -24
- package/lib/chat-connection/type.d.ts +0 -17
- package/lib/plugins/chatroom.js +0 -454
- package/lib/room-control/chatroom-control/config.d.ts +0 -51
- package/lib/room-control/chatroom-control/config.js +0 -105
- package/lib/utilities/storage.d.ts +0 -8
- package/lib/utilities/storage.js +0 -33
- package/lib-es/plugins/chatroom.js +0 -446
- package/lib-es/room-control/chatroom-control/config.js +0 -100
- package/lib-es/utilities/storage.js +0 -27
- /package/lib/plugins/{chatroom.d.ts → chat/chatroom.d.ts} +0 -0
|
@@ -24,21 +24,21 @@ exports.FcrSubRoomControlImpl = exports.FcrBaseRoomControlImpl = void 0;
|
|
|
24
24
|
var _imports = require("../imports");
|
|
25
25
|
var _type = require("../type");
|
|
26
26
|
var _type2 = require("./type");
|
|
27
|
+
var _abilityControl = require("./ability-control");
|
|
28
|
+
var _privilegeControl = require("./privilege-control");
|
|
27
29
|
var _roomConnectorControl = require("./room-connector-control");
|
|
28
30
|
var _roomSession = require("./room-session");
|
|
29
|
-
var _privilegeControl = require("./privilege-control");
|
|
30
|
-
var _userControl = require("./user-control");
|
|
31
|
-
var _streamControl = require("./stream-control");
|
|
32
|
-
var _abilityControl = require("./ability-control");
|
|
33
31
|
var _sharingControl = require("./sharing-control");
|
|
34
|
-
var
|
|
32
|
+
var _streamControl = require("./stream-control");
|
|
33
|
+
var _userControl = require("./user-control");
|
|
35
34
|
var _collection = require("../utilities/collection");
|
|
35
|
+
var _error = require("../utilities/error");
|
|
36
36
|
var _logger = require("../utilities/logger");
|
|
37
37
|
var _2 = require("..");
|
|
38
|
-
var _helpers = require("./helpers");
|
|
39
38
|
var _errorHelpers = require("../utilities/error-helpers");
|
|
39
|
+
var _helpers = require("./helpers");
|
|
40
40
|
var _sttControl = require("./stt-control");
|
|
41
|
-
let _initProto; // Core SDK imports
|
|
41
|
+
let _initProto, _joinDecs, _updateRoomPropertiesDecs, _updateIncrementRoomPropertiesDecs, _deleteRoomPropertiesDecs, _startCloudRecordingDecs, _startLiveStreamingDecs, _updateLiveStreamingLayoutDecs, _sendRoomMessageDecs; // Core SDK imports
|
|
42
42
|
// Service and API imports
|
|
43
43
|
// Type definitions
|
|
44
44
|
// Room control types and interfaces
|
|
@@ -61,10 +61,10 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
61
61
|
*/
|
|
62
62
|
class FcrBaseRoomControlImpl {
|
|
63
63
|
static {
|
|
64
|
-
[_initProto] = _applyDecs(this, [[_imports.trace, 2, "getSyncTimestamp"], [_imports.trace, 2, "getRoomInfo"], [_imports.trace, 2, "getRoomSchedule"], [
|
|
64
|
+
[_initProto] = _applyDecs(this, [[_imports.trace, 2, "getSyncTimestamp"], [_imports.trace, 2, "getRoomInfo"], [_imports.trace, 2, "getRoomSchedule"], [_joinDecs, 2, "join"], [_imports.trace, 2, "leave"], [_imports.trace, 2, "start"], [_imports.trace, 2, "end"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getRoomState"], [_imports.trace, 2, "getRoomProperties"], [_imports.trace, 2, "getRoomPropertiesByKeyPath"], [_updateRoomPropertiesDecs, 2, "updateRoomProperties"], [_updateIncrementRoomPropertiesDecs, 2, "updateIncrementRoomProperties"], [_deleteRoomPropertiesDecs, 2, "deleteRoomProperties"], [_startCloudRecordingDecs, 2, "startCloudRecording"], [_imports.trace, 2, "pauseCloudRecording"], [_imports.trace, 2, "resumeCloudRecording"], [_imports.trace, 2, "stopCloudRecording"], [_imports.trace, 2, "getLiveStreamingState"], [_imports.trace, 2, "getLiveStreamingConfig"], [_startLiveStreamingDecs, 2, "startLiveStreaming"], [_updateLiveStreamingLayoutDecs, 2, "updateLiveStreamingLayout"], [_imports.trace, 2, "stopLiveStreaming"], [_imports.trace, 2, "getCloudRecordingState"], [_sendRoomMessageDecs, 2, "sendRoomMessage"]], []).e;
|
|
65
65
|
}
|
|
66
66
|
//@internal
|
|
67
|
-
logger = (_initProto(this), (0, _logger.createLogger)({
|
|
67
|
+
[(_joinDecs = (0, _imports.trace)(['options']), _updateRoomPropertiesDecs = (0, _imports.trace)(['properties', 'cause']), _updateIncrementRoomPropertiesDecs = (0, _imports.trace)(['increments', 'cause']), _deleteRoomPropertiesDecs = (0, _imports.trace)(['properties', 'cause']), _startCloudRecordingDecs = (0, _imports.trace)(['config']), _startLiveStreamingDecs = (0, _imports.trace)(['data']), _updateLiveStreamingLayoutDecs = (0, _imports.trace)(['layoutType']), _sendRoomMessageDecs = (0, _imports.trace)(['payload', 'guaranteedDelivery']), "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
68
68
|
prefix: 'FcrBaseRoomControlImpl'
|
|
69
69
|
}));
|
|
70
70
|
_observable = new _imports.AgoraObservable();
|
|
@@ -106,7 +106,7 @@ class FcrBaseRoomControlImpl {
|
|
|
106
106
|
if (this._streamControl && !this.sharingControl &&
|
|
107
107
|
// TODO: 确认是否需要限制在主房间
|
|
108
108
|
this._roomType === _type2.FcrRoomType.Mainroom) {
|
|
109
|
-
this.logger.info('
|
|
109
|
+
this.logger.info('join scene success, start create sharing control');
|
|
110
110
|
this.sharingControl = new _sharingControl.FcrSharingControlImpl(this._scene, this._api, this._engine, this._privilegeControl, this._streamControl, this._sharedCache, this._userControl);
|
|
111
111
|
}
|
|
112
112
|
this._sttControl = new _sttControl.FcrSttControlImpl(this._scene, this._api, this._sharedCache);
|
|
@@ -117,7 +117,7 @@ class FcrBaseRoomControlImpl {
|
|
|
117
117
|
// 'onJoinRoomFailure',
|
|
118
118
|
// sceneId,
|
|
119
119
|
// generateFcrCoreClientError(
|
|
120
|
-
//
|
|
120
|
+
// ErrorModuleCode.ROOM,
|
|
121
121
|
// FcrErrorCode.NOT_JOINED_ROOM,
|
|
122
122
|
// 'join room failed',
|
|
123
123
|
// error,
|
|
@@ -352,7 +352,9 @@ class FcrBaseRoomControlImpl {
|
|
|
352
352
|
|
|
353
353
|
// 处理机器人用户的特殊逻辑
|
|
354
354
|
await this._handleRobotUserSetup(options);
|
|
355
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
355
356
|
} catch (error) {
|
|
357
|
+
this._cleanup();
|
|
356
358
|
// 处理加入失败
|
|
357
359
|
this._handleJoinFailure(error);
|
|
358
360
|
throw error;
|
|
@@ -415,7 +417,7 @@ class FcrBaseRoomControlImpl {
|
|
|
415
417
|
*/
|
|
416
418
|
async _handleRobotUserSetup(options) {
|
|
417
419
|
if (options.userRole === _type.FcrUserRole.ROBOT) {
|
|
418
|
-
const res = (0, _error.handleRequestError)(() => this._api.setCloudRecordingReady(this._scene.sceneId),
|
|
420
|
+
const res = (0, _error.handleRequestError)(() => this._api.setCloudRecordingReady(this._scene.sceneId), _imports.ErrorModuleCode.FCR_ROOM, 'set cloud recording ready failed');
|
|
419
421
|
this.logger.info(`set cloud recording ready, response: ${(0, _imports.jsonstring)(res)}`);
|
|
420
422
|
}
|
|
421
423
|
}
|
|
@@ -437,6 +439,7 @@ class FcrBaseRoomControlImpl {
|
|
|
437
439
|
async leave() {
|
|
438
440
|
this._joinState = _helpers.ROOM_CONTROL_CONSTANTS.JOIN_STATE.CANCELED;
|
|
439
441
|
await this._cleanup();
|
|
442
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
440
443
|
}
|
|
441
444
|
|
|
442
445
|
/**
|
|
@@ -446,6 +449,7 @@ class FcrBaseRoomControlImpl {
|
|
|
446
449
|
*/
|
|
447
450
|
async start() {
|
|
448
451
|
await this._api.startRoom(this._scene.sceneId);
|
|
452
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
449
453
|
}
|
|
450
454
|
|
|
451
455
|
/**
|
|
@@ -455,9 +459,11 @@ class FcrBaseRoomControlImpl {
|
|
|
455
459
|
*/
|
|
456
460
|
async end() {
|
|
457
461
|
await this._api.endRoom(this._scene.sceneId);
|
|
462
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
458
463
|
}
|
|
459
464
|
async close() {
|
|
460
465
|
await this._api.closeRoom(this._scene.sceneId);
|
|
466
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
461
467
|
}
|
|
462
468
|
getRoomState() {
|
|
463
469
|
return this._scene.getScenePropertiesByKeyPath('schedule.state');
|
|
@@ -473,33 +479,40 @@ class FcrBaseRoomControlImpl {
|
|
|
473
479
|
roomId: this._scene.sceneId,
|
|
474
480
|
properties,
|
|
475
481
|
cause
|
|
476
|
-
}),
|
|
482
|
+
}), _imports.ErrorModuleCode.FCR_ROOM, 'update room properties failed');
|
|
483
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
477
484
|
}
|
|
478
485
|
async updateIncrementRoomProperties(increments, cause) {
|
|
479
486
|
await (0, _error.handleRequestError)(() => this._api.updateRoomProperties({
|
|
480
487
|
roomId: this._scene.sceneId,
|
|
481
488
|
increments,
|
|
482
489
|
cause
|
|
483
|
-
}),
|
|
490
|
+
}), _imports.ErrorModuleCode.FCR_ROOM, 'update room properties failed');
|
|
491
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
484
492
|
}
|
|
485
493
|
async deleteRoomProperties(properties, cause) {
|
|
486
494
|
await (0, _error.handleRequestError)(() => this._api.deleteRoomProperties({
|
|
487
495
|
roomId: this._scene.sceneId,
|
|
488
496
|
properties,
|
|
489
497
|
cause
|
|
490
|
-
}),
|
|
498
|
+
}), _imports.ErrorModuleCode.FCR_ROOM, 'delete room rroperties failed');
|
|
499
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
491
500
|
}
|
|
492
501
|
async startCloudRecording(config) {
|
|
493
|
-
await (0, _error.handleRequestError)(() => this._api.startCloudRecording(config, this._scene.sceneId),
|
|
502
|
+
await (0, _error.handleRequestError)(() => this._api.startCloudRecording(config, this._scene.sceneId), _imports.ErrorModuleCode.FCR_ROOM, 'start cloud recording failed');
|
|
503
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
494
504
|
}
|
|
495
505
|
async pauseCloudRecording() {
|
|
496
|
-
await (0, _error.handleRequestError)(() => this._api.pauseCloudRecording(this._scene.sceneId),
|
|
506
|
+
await (0, _error.handleRequestError)(() => this._api.pauseCloudRecording(this._scene.sceneId), _imports.ErrorModuleCode.FCR_ROOM, 'pause cloud recording failed');
|
|
507
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
497
508
|
}
|
|
498
509
|
async resumeCloudRecording() {
|
|
499
|
-
await (0, _error.handleRequestError)(() => this._api.resumeCloudRecording(this._scene.sceneId),
|
|
510
|
+
await (0, _error.handleRequestError)(() => this._api.resumeCloudRecording(this._scene.sceneId), _imports.ErrorModuleCode.FCR_ROOM, 'resume cloud recording failed');
|
|
511
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
500
512
|
}
|
|
501
513
|
async stopCloudRecording() {
|
|
502
|
-
await (0, _error.handleRequestError)(() => this._api.stopCloudRecording(this._scene.sceneId),
|
|
514
|
+
await (0, _error.handleRequestError)(() => this._api.stopCloudRecording(this._scene.sceneId), _imports.ErrorModuleCode.FCR_ROOM, 'stop cloud recording failed');
|
|
515
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
503
516
|
}
|
|
504
517
|
getLiveStreamingState() {
|
|
505
518
|
let liveStreamingState = this._scene.getScenePropertiesByKeyPath('live.state');
|
|
@@ -530,12 +543,15 @@ class FcrBaseRoomControlImpl {
|
|
|
530
543
|
}
|
|
531
544
|
async startLiveStreaming(data) {
|
|
532
545
|
await this._liveStreamingAction(() => this._api.startLiveStreaming(this._scene.sceneId, data), 'start live streaming failed');
|
|
546
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
533
547
|
}
|
|
534
548
|
async updateLiveStreamingLayout(layoutType) {
|
|
535
549
|
await this._liveStreamingAction(() => this._api.updateLiveStreamingLayout(this._scene.sceneId, layoutType), 'update live streaming layout failed');
|
|
550
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
536
551
|
}
|
|
537
552
|
async stopLiveStreaming() {
|
|
538
553
|
await this._liveStreamingAction(() => this._api.stopLiveStreaming(this._scene.sceneId), 'stop live streaming failed');
|
|
554
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
539
555
|
}
|
|
540
556
|
getCloudRecordingState() {
|
|
541
557
|
const {
|
|
@@ -548,6 +564,7 @@ class FcrBaseRoomControlImpl {
|
|
|
548
564
|
async sendRoomMessage(payload, guaranteedDelivery) {
|
|
549
565
|
try {
|
|
550
566
|
await this._scene.localUser.sendSceneMessage(payload, '101', guaranteedDelivery);
|
|
567
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
551
568
|
} catch (e) {
|
|
552
569
|
throw _helpers.roomControlErrorHelper.createSendMessageError(e);
|
|
553
570
|
}
|
|
@@ -565,9 +582,7 @@ class FcrBaseRoomControlImpl {
|
|
|
565
582
|
this._scene.removeObserver(this._sceneObserver);
|
|
566
583
|
this._engine.removeObserver(this._engineObserver);
|
|
567
584
|
try {
|
|
568
|
-
return await Promise.all([
|
|
569
|
-
// @ts-ignore
|
|
570
|
-
this._chatRoomControl?.leave(), this.sharingControl?.getBoardControl().close(), this.sharingControl?.getAnnotationControl().close(), this._scene.leave()]);
|
|
585
|
+
return await Promise.all([this._chatRoomControl?.leave(), this.sharingControl?.getBoardControl().close(), this.sharingControl?.getAnnotationControl().close(), this._scene.leave()]);
|
|
571
586
|
} finally {
|
|
572
587
|
this._joinRoomSuccess = false;
|
|
573
588
|
}
|
|
@@ -27,6 +27,7 @@ require("core-js/modules/esnext.iterator.map.js");
|
|
|
27
27
|
var _imports = require("../../imports");
|
|
28
28
|
var _room = require("./room");
|
|
29
29
|
var _types = require("./types");
|
|
30
|
+
var _type = require("../../type");
|
|
30
31
|
var _user = require("../../utilities/user");
|
|
31
32
|
var _logger = require("../../utilities/logger");
|
|
32
33
|
var _error = require("../../utilities/error");
|
|
@@ -46,7 +47,7 @@ class FcrInterpreterControlImpl {
|
|
|
46
47
|
[_initProto] = _applyDecs(this, [[_createRoomControlDecs, 2, "createRoomControl"], [_setInterpreterUsersDecs, 2, "setInterpreterUsers"], [_imports.trace, 2, "close"], [_imports.trace, 2, "getState"], [_imports.trace, 2, "getInterpreterRoomList"], [_imports.trace, 2, "getInterpreterLanguageList"]], []).e;
|
|
47
48
|
}
|
|
48
49
|
//@internal
|
|
49
|
-
[(_createRoomControlDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _setInterpreterUsersDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrInterpreterUsersParamsArraySchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
50
|
+
[(_createRoomControlDecs = [(0, _imports.trace)(['roomId']), (0, _validateParams.default)(_schema.stringSchema)], _setInterpreterUsersDecs = [(0, _imports.trace)(['params']), (0, _validateParams.default)(_schema.fcrInterpreterUsersParamsArraySchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
50
51
|
prefix: 'FcrInterpreterControlImpl'
|
|
51
52
|
}));
|
|
52
53
|
_observable = new _imports.AgoraObservable();
|
|
@@ -83,12 +84,14 @@ class FcrInterpreterControlImpl {
|
|
|
83
84
|
};
|
|
84
85
|
})
|
|
85
86
|
}
|
|
86
|
-
}),
|
|
87
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_INTERPRETER, 'set interpreterUsers failed');
|
|
88
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
87
89
|
}
|
|
88
90
|
async close() {
|
|
89
91
|
await (0, _error.handleRequestError)(() => this._api.closeInterpreter({
|
|
90
92
|
roomId: this._roomId
|
|
91
|
-
}),
|
|
93
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_INTERPRETER, 'close interpreter failed');
|
|
94
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
92
95
|
}
|
|
93
96
|
getState() {
|
|
94
97
|
const enable = this._scene.getScenePropertiesByKeyPath('interpreter.enable');
|
|
@@ -169,7 +172,7 @@ class FcrInterpreterControlImpl {
|
|
|
169
172
|
});
|
|
170
173
|
}
|
|
171
174
|
_addLogObserver() {
|
|
172
|
-
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onInterpreterStateUpdated', 'onInterpreterUsersUpdated', 'onInterpreterRoomListUpdated']));
|
|
175
|
+
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onInterpreterStateUpdated', ['roomId', 'state', 'operatorUser']], ['onInterpreterUsersUpdated', ['roomId', 'users', 'operatorUser']], ['onInterpreterRoomListUpdated', ['roomId', 'rooms', 'operatorUser']]]));
|
|
173
176
|
}
|
|
174
177
|
}
|
|
175
178
|
exports.FcrInterpreterControlImpl = FcrInterpreterControlImpl;
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FcrInterpreterRoomControlImpl = void 0;
|
|
7
7
|
var _ = require("..");
|
|
8
|
-
var _type = require("../type");
|
|
9
8
|
var _logger = require("../../utilities/logger");
|
|
9
|
+
var _type = require("../type");
|
|
10
10
|
/**
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
@@ -26,10 +26,10 @@ class FcrInterpreterRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
26
26
|
this._addLogObserver();
|
|
27
27
|
}
|
|
28
28
|
_addLogObserver() {
|
|
29
|
-
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onCloudRecordingStateUpdated', 'onJoinRoomFailure', 'onJoinRoomSuccess', 'onLiveStreamingStateUpdated',
|
|
29
|
+
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onCloudRecordingStateUpdated', ['roomId', 'state']], ['onJoinRoomFailure', ['roomId', 'error']], ['onJoinRoomSuccess', ['roomId']], ['onLiveStreamingStateUpdated', ['roomId', 'state', 'url', 'reason']],
|
|
30
30
|
// 'onNetworkQualityUpdated',
|
|
31
31
|
// 'onNetworkStatsUpdated',
|
|
32
|
-
'onRoomMessageReceived', 'onRoomPropertiesDeleted', 'onRoomPropertiesUpdated', 'onRoomStateUpdated']));
|
|
32
|
+
['onRoomMessageReceived', ['roomId', 'message']], ['onRoomPropertiesDeleted', ['roomId', 'event']], ['onRoomPropertiesUpdated', ['roomId', 'event']], ['onRoomStateUpdated', ['roomId', 'state']]]));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
exports.FcrInterpreterRoomControlImpl = FcrInterpreterRoomControlImpl;
|
|
@@ -48,8 +48,8 @@ export interface FcrInterpreterRoomControl extends FcrBaseRoomControl {
|
|
|
48
48
|
}
|
|
49
49
|
export interface FcrInterpreterControl {
|
|
50
50
|
createRoomControl(roomId: string): FcrInterpreterRoomControl;
|
|
51
|
-
setInterpreterUsers(params: FcrInterpreterUsersParams[]): Promise<
|
|
52
|
-
close(): Promise<
|
|
51
|
+
setInterpreterUsers(params: FcrInterpreterUsersParams[]): Promise<number>;
|
|
52
|
+
close(): Promise<number>;
|
|
53
53
|
getState(): FcrInterpreterState;
|
|
54
54
|
getInterpreterRoomList(): FcrInterpreterRoomInfo[] | null;
|
|
55
55
|
getInterpreterUserList(): FcrInterpreterUserInfo[] | null;
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.FcrJoinBeforeHostWaitingRoomControlImpl = void 0;
|
|
7
7
|
var _ = require("..");
|
|
8
|
-
var _type = require("../type");
|
|
9
8
|
var _logger = require("../../utilities/logger");
|
|
9
|
+
var _type = require("../type");
|
|
10
10
|
/**
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
@@ -26,10 +26,10 @@ class FcrJoinBeforeHostWaitingRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
26
26
|
super.removeObserver(observer);
|
|
27
27
|
}
|
|
28
28
|
_addLogObserver() {
|
|
29
|
-
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onCloudRecordingStateUpdated', 'onJoinRoomFailure', 'onJoinRoomSuccess', 'onLiveStreamingStateUpdated',
|
|
29
|
+
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onCloudRecordingStateUpdated', ['roomId', 'state']], ['onJoinRoomFailure', ['roomId', 'error']], ['onJoinRoomSuccess', ['roomId']], ['onLiveStreamingStateUpdated', ['roomId', 'state', 'url', 'reason']],
|
|
30
30
|
// 'onNetworkQualityUpdated',
|
|
31
31
|
// 'onNetworkStatsUpdated',
|
|
32
|
-
'onRoomMessageReceived', 'onRoomPropertiesDeleted', 'onRoomPropertiesUpdated', 'onRoomStateUpdated']));
|
|
32
|
+
['onRoomMessageReceived', ['roomId', 'message']], ['onRoomPropertiesDeleted', ['roomId', 'event']], ['onRoomPropertiesUpdated', ['roomId', 'event']], ['onRoomStateUpdated', ['roomId', 'state']]]));
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
exports.FcrJoinBeforeHostWaitingRoomControlImpl = FcrJoinBeforeHostWaitingRoomControlImpl;
|
|
@@ -25,17 +25,17 @@ exports.FcrMainRoomControlImpl = void 0;
|
|
|
25
25
|
require("core-js/modules/es.json.stringify.js");
|
|
26
26
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
27
27
|
require("core-js/modules/esnext.iterator.find.js");
|
|
28
|
-
var _imports = require("../../imports");
|
|
29
28
|
var _ = require("..");
|
|
30
|
-
var
|
|
29
|
+
var _imports = require("../../imports");
|
|
30
|
+
var _schema = require("../../schema");
|
|
31
31
|
var _type = require("../../type");
|
|
32
|
-
var _type2 = require("../type");
|
|
33
32
|
var _error = require("../../utilities/error");
|
|
34
|
-
var _interpreterControl = require("../interpreter-control");
|
|
35
|
-
var _schema = require("../../schema");
|
|
36
33
|
var _logger = require("../../utilities/logger");
|
|
37
|
-
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
38
34
|
var _sharedStorage = require("../../utilities/shared-storage");
|
|
35
|
+
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
36
|
+
var _groupControl = require("../group-control");
|
|
37
|
+
var _interpreterControl = require("../interpreter-control");
|
|
38
|
+
var _type2 = require("../type");
|
|
39
39
|
var _utils = require("../whiteboard-control-v2/utils");
|
|
40
40
|
var _utils2 = require("../whiteboard-control/utils");
|
|
41
41
|
let _initProto, _enableWaitingRoomDecs, _moveToWaitingRoomByUserIdsDecs;
|
|
@@ -56,7 +56,7 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
56
56
|
[_initProto] = _applyDecs(this, [[_imports.trace, 2, "join"], [_imports.trace, 2, "leave"], [_enableWaitingRoomDecs, 2, "enableWaitingRoom"], [_moveToWaitingRoomByUserIdsDecs, 2, "moveToWaitingRoomByUserIds"], [_imports.trace, 2, "moveToWaitingRoomByUserRoles"], [_imports.bound, 2, "_onLocalUserPermissionInfoAdded"], [_imports.bound, 2, "_onLocalUserPermissionInfoDeleted"]], [], 0, void 0, _.FcrBaseRoomControlImpl).e;
|
|
57
57
|
}
|
|
58
58
|
//@internal
|
|
59
|
-
[(_enableWaitingRoomDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema)], _moveToWaitingRoomByUserIdsDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringArraySchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
59
|
+
[(_enableWaitingRoomDecs = [(0, _imports.trace)(['enable']), (0, _validateParams.default)(_schema.booleanSchema)], _moveToWaitingRoomByUserIdsDecs = [(0, _imports.trace)(['userIds']), (0, _validateParams.default)(_schema.stringArraySchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
60
60
|
prefix: 'FcrMainRoomControlImpl'
|
|
61
61
|
}));
|
|
62
62
|
_privilegeObserver = {
|
|
@@ -113,6 +113,7 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
113
113
|
});
|
|
114
114
|
}, Duration.minute(5), false);
|
|
115
115
|
this._logUploadTask = task;
|
|
116
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
116
117
|
} finally {
|
|
117
118
|
this._engine.getMonitor().uploadLog({
|
|
118
119
|
userUuid: this._config.userId,
|
|
@@ -143,7 +144,7 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
143
144
|
return (0, _error.handleRequestError)(() => this._api.enableWaitingRoom({
|
|
144
145
|
enable,
|
|
145
146
|
roomId: this._scene.sceneId
|
|
146
|
-
}),
|
|
147
|
+
}), _imports.ErrorModuleCode.FCR_ROOM, 'enable waiting room failed');
|
|
147
148
|
}
|
|
148
149
|
async moveToWaitingRoomByUserIds(userIds) {
|
|
149
150
|
const [error] = await (0, _imports.to)(this._api.moveToWaitingRoomByUserIds(userIds, this._scene.sceneId));
|
|
@@ -152,8 +153,9 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
152
153
|
if (error instanceof _imports.AgoraRestfulClientError) {
|
|
153
154
|
throw (0, _error.generateFcrCoreServerError)(error.serviceCode ?? -1, error.message, error);
|
|
154
155
|
}
|
|
155
|
-
throw (0, _error.generateFcrCoreClientError)(
|
|
156
|
+
throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM, _imports.DetailErrorCode.UNDEFINED_ERROR, 'move to waiting room failed', error);
|
|
156
157
|
}
|
|
158
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
157
159
|
}
|
|
158
160
|
async moveToWaitingRoomByUserRoles() {
|
|
159
161
|
return this._api.moveToWaitingRoomByUserRoles([_type.FcrUserRoleToStringMap[_type.FcrUserRole.PARTICIPANT]], this._scene.sceneId);
|
|
@@ -184,13 +186,13 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
184
186
|
return await (0, _error.handleRequestError)(() => this._api.getAnnotationToken({
|
|
185
187
|
roomId,
|
|
186
188
|
userId
|
|
187
|
-
}),
|
|
189
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'get whiteboard token failed');
|
|
188
190
|
}
|
|
189
191
|
async _getBoardToken(roomId, userId) {
|
|
190
192
|
return await (0, _error.handleRequestError)(() => this._api.getWhiteboardToken({
|
|
191
193
|
roomId,
|
|
192
194
|
userId
|
|
193
|
-
}),
|
|
195
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'get whiteboard token failed');
|
|
194
196
|
}
|
|
195
197
|
_onLocalUserPermissionInfoAdded(roomId, event) {
|
|
196
198
|
if ((0, _utils2.hasBoardWritePermission)(event.permissionInfo)) {
|
|
@@ -245,10 +247,10 @@ class FcrMainRoomControlImpl extends _.FcrBaseRoomControlImpl {
|
|
|
245
247
|
}
|
|
246
248
|
}
|
|
247
249
|
_addLogObserver() {
|
|
248
|
-
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onCloudRecordingStateUpdated', 'onJoinRoomFailure', 'onJoinRoomSuccess', 'onLiveStreamingStateUpdated',
|
|
250
|
+
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onCloudRecordingStateUpdated', ['roomId', 'state']], ['onJoinRoomFailure', ['roomId', 'error']], ['onJoinRoomSuccess', ['roomId']], ['onLiveStreamingStateUpdated', ['roomId', 'state', 'url', 'reason']],
|
|
249
251
|
// 'onNetworkQualityUpdated',
|
|
250
252
|
// 'onNetworkStatsUpdated',
|
|
251
|
-
'onRoomMessageReceived', 'onRoomPropertiesDeleted', 'onRoomPropertiesUpdated', 'onRoomStateUpdated']));
|
|
253
|
+
['onRoomMessageReceived', ['roomId', 'message']], ['onRoomPropertiesDeleted', ['roomId', 'event']], ['onRoomPropertiesUpdated', ['roomId', 'event']], ['onRoomStateUpdated', ['roomId', 'state']]]));
|
|
252
254
|
}
|
|
253
255
|
}
|
|
254
256
|
exports.FcrMainRoomControlImpl = FcrMainRoomControlImpl;
|
|
@@ -26,15 +26,15 @@ require("core-js/modules/esnext.iterator.constructor.js");
|
|
|
26
26
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
27
27
|
require("core-js/modules/esnext.iterator.map.js");
|
|
28
28
|
var _imports = require("../../imports");
|
|
29
|
+
var _schema = require("../../schema");
|
|
29
30
|
var _type = require("../../type");
|
|
31
|
+
var _error = require("../../utilities/error");
|
|
32
|
+
var _logger = require("../../utilities/logger");
|
|
30
33
|
var _user = require("../../utilities/user");
|
|
34
|
+
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
31
35
|
var _helper = require("./helper");
|
|
32
36
|
var _type2 = require("./type");
|
|
33
|
-
|
|
34
|
-
var _error = require("../../utilities/error");
|
|
35
|
-
var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
|
|
36
|
-
var _schema = require("../../schema");
|
|
37
|
-
let _initProto, _getSecurityInfoDecs, _getLocalUserPermissionInfoDecs, _enableLockedRoomDecs, _allowShareAndWriteDecs, _allowWriteBoardDecs, _allowWriteBoardByUserIdsDecs, _allowSendChatDecs, _allowStartAudioDecs, _allowStartVideoDecs, _allowJoinWithMutedAudioDecs, _allowJoinWithMutedVideoDecs, _allowWatermarkDecs, _allowChangeUserNameDecs, _allowStartCaptionDecs, _allowStartTranscribingDecs, _allowUpdateSttSourceLanguageDecs, _allowJoinWithPromptSoundDecs;
|
|
37
|
+
let _initProto, _allowWriteAnnotationDecs, _getSecurityInfoDecs, _getLocalUserPermissionInfoDecs, _enableLockedRoomDecs, _allowShareAndWriteDecs, _allowWriteBoardDecs, _allowWriteBoardByUserIdsDecs, _allowSendChatDecs, _allowStartAudioDecs, _allowStartVideoDecs, _allowJoinWithMutedAudioDecs, _allowJoinWithMutedVideoDecs, _allowWatermarkDecs, _allowChangeUserNameDecs, _allowStartCaptionDecs, _allowStartTranscribingDecs, _allowUpdateSttSourceLanguageDecs, _allowJoinWithPromptSoundDecs;
|
|
38
38
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
39
39
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
40
40
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
@@ -45,10 +45,10 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
45
45
|
*/
|
|
46
46
|
class FcrPrivilegeControlImpl {
|
|
47
47
|
static {
|
|
48
|
-
[_initProto] = _applyDecs(this, [[
|
|
48
|
+
[_initProto] = _applyDecs(this, [[_allowWriteAnnotationDecs, 2, "allowWriteAnnotation"], [_getSecurityInfoDecs, 2, "getSecurityInfo"], [_getLocalUserPermissionInfoDecs, 2, "getLocalUserPermissionInfo"], [_enableLockedRoomDecs, 2, "enableLockedRoom"], [_allowShareAndWriteDecs, 2, "allowShareAndWrite"], [_allowWriteBoardDecs, 2, "allowWriteBoard"], [_allowWriteBoardByUserIdsDecs, 2, "allowWriteBoardByUserIds"], [_allowSendChatDecs, 2, "allowSendChat"], [_allowStartAudioDecs, 2, "allowStartAudio"], [_allowStartVideoDecs, 2, "allowStartVideo"], [_allowJoinWithMutedAudioDecs, 2, "allowJoinWithMutedAudio"], [_allowJoinWithMutedVideoDecs, 2, "allowJoinWithMutedVideo"], [_allowWatermarkDecs, 2, "allowWatermark"], [_allowChangeUserNameDecs, 2, "allowChangeUserName"], [_allowStartCaptionDecs, 2, "allowStartCaption"], [_allowStartTranscribingDecs, 2, "allowStartTranscribing"], [_allowUpdateSttSourceLanguageDecs, 2, "allowUpdateSttSourceLanguage"], [_allowJoinWithPromptSoundDecs, 2, "allowJoinWithPromptSound"]], []).e;
|
|
49
49
|
}
|
|
50
50
|
//@internal
|
|
51
|
-
[(_getSecurityInfoDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrSecurityActionSchema)], _getLocalUserPermissionInfoDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrPermissionActionSchema)], _enableLockedRoomDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowShareAndWriteDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowWriteBoardDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowWriteBoardByUserIdsDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.stringArraySchema)], _allowSendChatDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema, _schema.fcrSecuritySendChatPayloadSchema)], _allowStartAudioDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowStartVideoDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedAudioDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedVideoDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowWatermarkDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema, _schema.fcrLineTypeSchema.optional())], _allowChangeUserNameDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowStartCaptionDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowStartTranscribingDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowUpdateSttSourceLanguageDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowJoinWithPromptSoundDecs = [_imports.trace, (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
51
|
+
[(_allowWriteAnnotationDecs = (0, _imports.trace)(['enable', 'targetRoles']), _getSecurityInfoDecs = [(0, _imports.trace)(['action']), (0, _validateParams.default)(_schema.fcrSecurityActionSchema)], _getLocalUserPermissionInfoDecs = [(0, _imports.trace)(['action']), (0, _validateParams.default)(_schema.fcrPermissionActionSchema)], _enableLockedRoomDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowShareAndWriteDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowWriteBoardDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowWriteBoardByUserIdsDecs = [(0, _imports.trace)(['enable', 'targetUserIds']), (0, _validateParams.default)(_schema.booleanSchema, _schema.stringArraySchema)], _allowSendChatDecs = [(0, _imports.trace)(['enable', 'targetRoles', 'payload']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema, _schema.fcrSecuritySendChatPayloadSchema)], _allowStartAudioDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowStartVideoDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedAudioDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowJoinWithMutedVideoDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowWatermarkDecs = [(0, _imports.trace)(['enable', 'targetRoles', 'lineType']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema, _schema.fcrLineTypeSchema.optional())], _allowChangeUserNameDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowStartCaptionDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowStartTranscribingDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowUpdateSttSourceLanguageDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], _allowJoinWithPromptSoundDecs = [(0, _imports.trace)(['enable', 'targetRoles']), (0, _validateParams.default)(_schema.booleanSchema, _schema.fcrPrivilegeUserRoleArraySchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
|
|
52
52
|
prefix: 'FcrPrivilegeControlImpl'
|
|
53
53
|
}));
|
|
54
54
|
_observable = new _imports.AgoraObservable();
|
|
@@ -69,7 +69,8 @@ class FcrPrivilegeControlImpl {
|
|
|
69
69
|
payload: {
|
|
70
70
|
write: enable ? 1 : 0
|
|
71
71
|
}
|
|
72
|
-
}),
|
|
72
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_WHITEBOARD, 'allow annotation failed');
|
|
73
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
73
74
|
}
|
|
74
75
|
getSecurityInfo(action) {
|
|
75
76
|
const info = this._scene.getScenePropertiesByKeyPath(`security.${action}`);
|
|
@@ -108,7 +109,7 @@ class FcrPrivilegeControlImpl {
|
|
|
108
109
|
enable,
|
|
109
110
|
roomId: this._scene.sceneId,
|
|
110
111
|
targetRoles
|
|
111
|
-
}),
|
|
112
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'enable locked room failed');
|
|
112
113
|
}
|
|
113
114
|
async allowShareAndWrite(enable, targetRoles) {
|
|
114
115
|
await (0, _error.handleRequestError)(() => this._api.toggleShareEnable({
|
|
@@ -124,7 +125,8 @@ class FcrPrivilegeControlImpl {
|
|
|
124
125
|
start: enable ? 1 : 0
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
|
-
}),
|
|
128
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow share failed');
|
|
129
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
128
130
|
}
|
|
129
131
|
async allowWriteBoard(enable, targetRoles) {
|
|
130
132
|
await (0, _error.handleRequestError)(() => this._api.toggleShareEnable({
|
|
@@ -140,7 +142,8 @@ class FcrPrivilegeControlImpl {
|
|
|
140
142
|
write: enable ? 1 : 0
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
|
-
}),
|
|
145
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow write board failed');
|
|
146
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
144
147
|
}
|
|
145
148
|
async allowWriteBoardByUserIds(enable, targetUserIds) {
|
|
146
149
|
await (0, _error.handleRequestError)(() => this._api.toggleShareEnableByUserIds({
|
|
@@ -152,7 +155,8 @@ class FcrPrivilegeControlImpl {
|
|
|
152
155
|
write: enable ? 1 : 0
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
|
-
}),
|
|
158
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow write board by user ids failed');
|
|
159
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
156
160
|
}
|
|
157
161
|
async allowSendChat(enable, targetRoles, payload) {
|
|
158
162
|
await (0, _error.handleRequestError)(() => this._api.allowSendChat({
|
|
@@ -160,35 +164,40 @@ class FcrPrivilegeControlImpl {
|
|
|
160
164
|
targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role]),
|
|
161
165
|
roomId: this._scene.sceneId,
|
|
162
166
|
payload
|
|
163
|
-
}),
|
|
167
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow send chat failed');
|
|
168
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
164
169
|
}
|
|
165
170
|
async allowStartAudio(enable, targetRoles) {
|
|
166
171
|
await (0, _error.handleRequestError)(() => this._api.allowStartAudio({
|
|
167
172
|
enable,
|
|
168
173
|
targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role]),
|
|
169
174
|
roomId: this._scene.sceneId
|
|
170
|
-
}),
|
|
175
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow start audio failed');
|
|
176
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
171
177
|
}
|
|
172
178
|
async allowStartVideo(enable, targetRoles) {
|
|
173
179
|
await (0, _error.handleRequestError)(() => this._api.allowStartVideo({
|
|
174
180
|
enable,
|
|
175
181
|
targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role]),
|
|
176
182
|
roomId: this._scene.sceneId
|
|
177
|
-
}),
|
|
183
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow start video failed');
|
|
184
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
178
185
|
}
|
|
179
186
|
async allowJoinWithMutedAudio(enable, targetRoles) {
|
|
180
187
|
await (0, _error.handleRequestError)(() => this._api.allowJoinWithMuteAudio({
|
|
181
188
|
enable,
|
|
182
189
|
targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role]),
|
|
183
190
|
roomId: this._scene.sceneId
|
|
184
|
-
}),
|
|
191
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow join with mute audio failed');
|
|
192
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
185
193
|
}
|
|
186
194
|
async allowJoinWithMutedVideo(enable, targetRoles) {
|
|
187
195
|
await (0, _error.handleRequestError)(() => this._api.allowJoinWithMutedVideo({
|
|
188
196
|
enable,
|
|
189
197
|
targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role]),
|
|
190
198
|
roomId: this._scene.sceneId
|
|
191
|
-
}),
|
|
199
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow join with mute audio failed');
|
|
200
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
192
201
|
}
|
|
193
202
|
|
|
194
203
|
/* async allowChangeName(enable: boolean, targetRoles: FcrPrivilegeUserRole[]) {
|
|
@@ -208,42 +217,48 @@ class FcrPrivilegeControlImpl {
|
|
|
208
217
|
payload: {
|
|
209
218
|
lineType: lineType ?? _type.FcrLineType.SINGLE_ROW
|
|
210
219
|
}
|
|
211
|
-
}),
|
|
220
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow water mark failed');
|
|
221
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
212
222
|
}
|
|
213
223
|
async allowChangeUserName(enable, targetRoles) {
|
|
214
224
|
await (0, _error.handleRequestError)(() => this._api.allowChangeUserName({
|
|
215
225
|
roomId: this._scene.sceneId,
|
|
216
226
|
enable,
|
|
217
227
|
targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role])
|
|
218
|
-
}),
|
|
228
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow change user name failed');
|
|
229
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
219
230
|
}
|
|
220
231
|
async allowStartCaption(enable, targetRoles) {
|
|
221
232
|
await (0, _error.handleRequestError)(() => this._api.allowStartCaption({
|
|
222
233
|
roomUuid: this._scene.sceneId,
|
|
223
234
|
enable,
|
|
224
235
|
targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role])
|
|
225
|
-
}),
|
|
236
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_STT, 'allow start caption failed');
|
|
237
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
226
238
|
}
|
|
227
239
|
async allowStartTranscribing(enable, targetRoles) {
|
|
228
240
|
await (0, _error.handleRequestError)(() => this._api.allowStartTranscribing({
|
|
229
241
|
roomUuid: this._scene.sceneId,
|
|
230
242
|
enable,
|
|
231
243
|
targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role])
|
|
232
|
-
}),
|
|
244
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_STT, 'allow start transcribing failed');
|
|
245
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
233
246
|
}
|
|
234
247
|
async allowUpdateSttSourceLanguage(enable, targetRoles) {
|
|
235
248
|
await (0, _error.handleRequestError)(() => this._api.allowUpdateSttSourceLanguage({
|
|
236
249
|
roomUuid: this._scene.sceneId,
|
|
237
250
|
enable,
|
|
238
251
|
targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role])
|
|
239
|
-
}),
|
|
252
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_STT, 'allow update stt source language failed');
|
|
253
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
240
254
|
}
|
|
241
255
|
async allowJoinWithPromptSound(enable, targetRoles) {
|
|
242
256
|
await (0, _error.handleRequestError)(() => this._api.allowJoinWithPromptSound({
|
|
243
257
|
roomId: this._scene.sceneId,
|
|
244
258
|
enable,
|
|
245
259
|
targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role])
|
|
246
|
-
}),
|
|
260
|
+
}), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow join with prompt sound failed');
|
|
261
|
+
return _type.FcrReturnCode.SUCCESS;
|
|
247
262
|
}
|
|
248
263
|
addObserver(observer) {
|
|
249
264
|
this._observable.addObserver(observer);
|
|
@@ -325,7 +340,7 @@ class FcrPrivilegeControlImpl {
|
|
|
325
340
|
}, this._roomCache);
|
|
326
341
|
}
|
|
327
342
|
_addLogObserver() {
|
|
328
|
-
this.addObserver((0, _logger.generateLogObserver)(this.logger, ['onSecurityInfoUpdated', 'onLocalUserPermissionInfoAdded', 'onLocalUserPermissionInfoDeleted']));
|
|
343
|
+
this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onSecurityInfoUpdated', ['roomId', 'event']], ['onLocalUserPermissionInfoAdded', ['roomId', 'event']], ['onLocalUserPermissionInfoDeleted', ['roomId', 'event']]]));
|
|
329
344
|
}
|
|
330
345
|
}
|
|
331
346
|
exports.FcrPrivilegeControlImpl = FcrPrivilegeControlImpl;
|