fcr-core 3.10.5 → 3.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/lib/engine/index.js +108 -102
  2. package/lib/imports.js +0 -1
  3. package/lib/index.d.ts +1 -1
  4. package/lib/media-control/desktop.js +13 -22
  5. package/lib/media-control/mobile.js +13 -22
  6. package/lib/monitor-control/index.js +7 -17
  7. package/lib/peer-session/index.js +121 -120
  8. package/lib/plugins/chat/chatroom.js +96 -119
  9. package/lib/plugins/chat/connector.js +48 -69
  10. package/lib/remote-control/index.js +216 -194
  11. package/lib/room-control/ability-control/index.js +10 -20
  12. package/lib/room-control/application-control/index.js +75 -82
  13. package/lib/room-control/group-control/index.js +30 -31
  14. package/lib/room-control/helpers/board-init-info-helper.js +10 -16
  15. package/lib/room-control/helpers/validation-helper.js +1 -1
  16. package/lib/room-control/index.js +51 -70
  17. package/lib/room-control/infinity-room-control/index.js +19 -27
  18. package/lib/room-control/interpreter-control/index.js +65 -77
  19. package/lib/room-control/interpreter-control/room.js +4 -6
  20. package/lib/room-control/join-before-host-waitingroom-control/index.js +4 -6
  21. package/lib/room-control/mainroom-control/index.js +25 -37
  22. package/lib/room-control/privilege-control/helper.js +13 -28
  23. package/lib/room-control/privilege-control/index.js +28 -36
  24. package/lib/room-control/room-connector-control/index.js +47 -52
  25. package/lib/room-control/room-control-factory.js +12 -10
  26. package/lib/room-control/room-session/index.js +74 -77
  27. package/lib/room-control/shared-cache.js +56 -63
  28. package/lib/room-control/sharing-control/index.js +57 -65
  29. package/lib/room-control/stream-control/index.js +238 -203
  30. package/lib/room-control/stream-control/type.d.ts +11 -1
  31. package/lib/room-control/stt-control/de-compress-gzip.js +0 -10
  32. package/lib/room-control/stt-control/index.js +86 -93
  33. package/lib/room-control/user-control/index.js +155 -162
  34. package/lib/room-control/waitingroom-control/index.js +9 -18
  35. package/lib/room-control/whiteboard-control/utils.js +2 -4
  36. package/lib/room-control/whiteboard-control-v1/board-subwindow.js +1 -2
  37. package/lib/room-control/whiteboard-control-v1/board-window.js +103 -120
  38. package/lib/room-control/whiteboard-control-v1/factory.js +4 -7
  39. package/lib/room-control/whiteboard-control-v1/index.js +67 -80
  40. package/lib/room-control/whiteboard-control-v1/mount-manager.js +2 -4
  41. package/lib/room-control/whiteboard-control-v1/utils.js +14 -17
  42. package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +10 -14
  43. package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +8 -17
  44. package/lib/room-control/whiteboard-control-v2/base/index.js +53 -61
  45. package/lib/room-control/whiteboard-control-v2/base/main-window.js +30 -39
  46. package/lib/room-control/whiteboard-control-v2/utils.js +10 -10
  47. package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +33 -45
  48. package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +11 -27
  49. package/lib/room-control/widget-control/index.js +33 -43
  50. package/lib/room-router/index.js +58 -66
  51. package/lib/service/api.js +548 -446
  52. package/lib/struct.js +2 -5
  53. package/lib/type.d.ts +1 -1
  54. package/lib/utilities/abortable-retry.js +0 -3
  55. package/lib/utilities/collection.js +11 -15
  56. package/lib/utilities/error-helpers.js +27 -34
  57. package/lib/utilities/error.js +3 -4
  58. package/lib/utilities/join-helper.js +31 -37
  59. package/lib/utilities/logger.js +5 -8
  60. package/lib/utilities/parameters.js +10 -21
  61. package/lib/utilities/retry-helpers.js +0 -1
  62. package/lib/utilities/stream.js +11 -16
  63. package/lib/utilities/user.js +3 -4
  64. package/lib/utilities/validate-params.js +1 -1
  65. package/lib/utilities/video-encoder-config.js +5 -10
  66. package/lib-es/engine/index.js +108 -102
  67. package/lib-es/media-control/desktop.js +13 -22
  68. package/lib-es/media-control/mobile.js +13 -22
  69. package/lib-es/monitor-control/index.js +7 -16
  70. package/lib-es/peer-session/index.js +121 -120
  71. package/lib-es/plugins/chat/chatroom.js +95 -118
  72. package/lib-es/plugins/chat/connector.js +47 -67
  73. package/lib-es/remote-control/index.js +216 -194
  74. package/lib-es/room-control/ability-control/index.js +10 -19
  75. package/lib-es/room-control/application-control/index.js +75 -81
  76. package/lib-es/room-control/group-control/index.js +30 -31
  77. package/lib-es/room-control/helpers/board-init-info-helper.js +10 -15
  78. package/lib-es/room-control/helpers/validation-helper.js +1 -1
  79. package/lib-es/room-control/index.js +51 -69
  80. package/lib-es/room-control/infinity-room-control/index.js +19 -26
  81. package/lib-es/room-control/interpreter-control/index.js +65 -77
  82. package/lib-es/room-control/interpreter-control/room.js +4 -5
  83. package/lib-es/room-control/join-before-host-waitingroom-control/index.js +4 -5
  84. package/lib-es/room-control/mainroom-control/index.js +25 -37
  85. package/lib-es/room-control/privilege-control/helper.js +13 -27
  86. package/lib-es/room-control/privilege-control/index.js +28 -36
  87. package/lib-es/room-control/room-connector-control/index.js +47 -52
  88. package/lib-es/room-control/room-control-factory.js +12 -10
  89. package/lib-es/room-control/room-session/index.js +74 -77
  90. package/lib-es/room-control/shared-cache.js +56 -62
  91. package/lib-es/room-control/sharing-control/index.js +57 -64
  92. package/lib-es/room-control/stream-control/index.js +240 -205
  93. package/lib-es/room-control/stt-control/de-compress-gzip.js +0 -10
  94. package/lib-es/room-control/stt-control/index.js +86 -93
  95. package/lib-es/room-control/user-control/index.js +155 -162
  96. package/lib-es/room-control/waitingroom-control/index.js +9 -18
  97. package/lib-es/room-control/whiteboard-control/utils.js +2 -4
  98. package/lib-es/room-control/whiteboard-control-v1/board-subwindow.js +1 -2
  99. package/lib-es/room-control/whiteboard-control-v1/board-window.js +103 -120
  100. package/lib-es/room-control/whiteboard-control-v1/factory.js +4 -6
  101. package/lib-es/room-control/whiteboard-control-v1/index.js +67 -80
  102. package/lib-es/room-control/whiteboard-control-v1/mount-manager.js +2 -3
  103. package/lib-es/room-control/whiteboard-control-v1/utils.js +14 -17
  104. package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +10 -13
  105. package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +8 -16
  106. package/lib-es/room-control/whiteboard-control-v2/base/index.js +53 -60
  107. package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +30 -39
  108. package/lib-es/room-control/whiteboard-control-v2/utils.js +10 -10
  109. package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +33 -45
  110. package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +11 -26
  111. package/lib-es/room-control/widget-control/index.js +33 -42
  112. package/lib-es/room-router/index.js +58 -66
  113. package/lib-es/service/api.js +548 -445
  114. package/lib-es/struct.js +2 -4
  115. package/lib-es/utilities/abortable-retry.js +0 -3
  116. package/lib-es/utilities/collection.js +11 -14
  117. package/lib-es/utilities/error-helpers.js +26 -33
  118. package/lib-es/utilities/error.js +3 -4
  119. package/lib-es/utilities/join-helper.js +29 -36
  120. package/lib-es/utilities/logger.js +5 -7
  121. package/lib-es/utilities/parameters.js +10 -21
  122. package/lib-es/utilities/retry-helpers.js +0 -1
  123. package/lib-es/utilities/stream.js +11 -15
  124. package/lib-es/utilities/user.js +3 -4
  125. package/lib-es/utilities/validate-params.js +1 -1
  126. package/lib-es/utilities/video-encoder-config.js +5 -10
  127. package/package.json +4 -4
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.symbol.description.js");
4
- require("core-js/modules/es.error.cause.js");
5
3
  require("core-js/modules/es.array.push.js");
6
4
  require("core-js/modules/esnext.function.metadata.js");
7
- require("core-js/modules/esnext.iterator.filter.js");
8
5
  require("core-js/modules/esnext.map.delete-all.js");
9
6
  require("core-js/modules/esnext.map.emplace.js");
10
7
  require("core-js/modules/esnext.map.every.js");
@@ -20,7 +17,6 @@ require("core-js/modules/esnext.map.reduce.js");
20
17
  require("core-js/modules/esnext.map.some.js");
21
18
  require("core-js/modules/esnext.map.update.js");
22
19
  require("core-js/modules/esnext.symbol.metadata.js");
23
- require("core-js/modules/web.dom-collections.iterator.js");
24
20
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
25
21
  Object.defineProperty(exports, "__esModule", {
26
22
  value: true
@@ -29,8 +25,6 @@ exports.FcrPrivilegeControlImpl = void 0;
29
25
  require("core-js/modules/esnext.iterator.constructor.js");
30
26
  require("core-js/modules/esnext.iterator.for-each.js");
31
27
  require("core-js/modules/esnext.iterator.map.js");
32
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
33
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
34
28
  var _imports = require("../../imports");
35
29
  var _schema = require("../../schema");
36
30
  var _type = require("../../type");
@@ -40,10 +34,7 @@ var _user = require("../../utilities/user");
40
34
  var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
41
35
  var _helper = require("./helper");
42
36
  var _type2 = require("./type");
43
- var _FcrPrivilegeControlImpl;
44
- let _initProto, _allowWriteAnnotationDecs, _getSecurityInfoDecs, _getLocalUserPermissionInfoDecs, _enableLockedRoomDecs, _allowShareAndWriteDecs, _allowWriteBoardDecs, _allowWriteBoardByUserIdsDecs, _allowSendChatDecs, _allowStartAudioDecs, _allowStartVideoDecs, _allowJoinWithMutedAudioDecs, _allowJoinWithMutedVideoDecs, _allowWatermarkDecs, _allowChangeUserNameDecs, _allowStartCaptionDecs, _allowStartTranscribingDecs, _allowUpdateSttSourceLanguageDecs, _allowJoinWithPromptSoundDecs, _getRemoteUserPermissionEnableDecs, _allowViewUserCountDecs, _allowHandsUpDecs, _allowSendChatByUserRoleDecs, _allowSendChatByUserIdDecs, _ref;
45
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
46
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
37
+ let _initProto, _allowWriteAnnotationDecs, _getSecurityInfoDecs, _getLocalUserPermissionInfoDecs, _enableLockedRoomDecs, _allowShareAndWriteDecs, _allowWriteBoardDecs, _allowWriteBoardByUserIdsDecs, _allowSendChatDecs, _allowStartAudioDecs, _allowStartVideoDecs, _allowJoinWithMutedAudioDecs, _allowJoinWithMutedVideoDecs, _allowWatermarkDecs, _allowChangeUserNameDecs, _allowStartCaptionDecs, _allowStartTranscribingDecs, _allowUpdateSttSourceLanguageDecs, _allowJoinWithPromptSoundDecs, _getRemoteUserPermissionEnableDecs, _allowViewUserCountDecs, _allowHandsUpDecs, _allowSendChatByUserRoleDecs, _allowSendChatByUserIdDecs;
47
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)]; } }; }
48
39
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
49
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); }
@@ -52,14 +43,16 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
52
43
  /**
53
44
  * @internal
54
45
  */
55
- _ref = (_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)], _getRemoteUserPermissionEnableDecs = (0, _imports.trace)(['userId', 'type']), _allowViewUserCountDecs = (0, _imports.trace)(['enable', 'targetRoles']), _allowHandsUpDecs = (0, _imports.trace)(['enable', 'targetRoles']), _allowSendChatByUserRoleDecs = (0, _imports.trace)(['config', 'targetRoles']), _allowSendChatByUserIdDecs = (0, _imports.trace)(['enable', 'userId']), "logger");
56
46
  class FcrPrivilegeControlImpl {
47
+ static {
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"], [_getRemoteUserPermissionEnableDecs, 2, "getRemoteUserPermissionEnable"], [_allowViewUserCountDecs, 2, "allowViewUserCount"], [_allowHandsUpDecs, 2, "allowHandsUp"], [_allowSendChatByUserRoleDecs, 2, "allowSendChatByUserRole"], [_allowSendChatByUserIdDecs, 2, "allowSendChatByUserId"], [_imports.trace, 2, "release"]], []).e;
49
+ }
50
+ //@internal
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)], _getRemoteUserPermissionEnableDecs = (0, _imports.trace)(['userId', 'type']), _allowViewUserCountDecs = (0, _imports.trace)(['enable', 'targetRoles']), _allowHandsUpDecs = (0, _imports.trace)(['enable', 'targetRoles']), _allowSendChatByUserRoleDecs = (0, _imports.trace)(['config', 'targetRoles']), _allowSendChatByUserIdDecs = (0, _imports.trace)(['enable', 'userId']), "logger")] = (_initProto(this), (0, _logger.createLogger)({
52
+ prefix: 'FcrPrivilegeControlImpl'
53
+ }));
54
+ _observable = new _imports.AgoraObservable();
57
55
  constructor(_engine, _scene, _api, _sharedCache) {
58
- //@internal
59
- (0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
60
- prefix: 'FcrPrivilegeControlImpl'
61
- })));
62
- (0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
63
56
  this._engine = _engine;
64
57
  this._scene = _scene;
65
58
  this._api = _api;
@@ -80,7 +73,7 @@ class FcrPrivilegeControlImpl {
80
73
  return _type.FcrReturnCode.SUCCESS;
81
74
  }
82
75
  getSecurityInfo(action) {
83
- const info = this._scene.getScenePropertiesByKeyPath("security.".concat(action));
76
+ const info = this._scene.getScenePropertiesByKeyPath(`security.${action}`);
84
77
  return this._convertSecurityInfo(info, action);
85
78
  }
86
79
  // @trace
@@ -108,7 +101,7 @@ class FcrPrivilegeControlImpl {
108
101
 
109
102
  // @trace
110
103
  getAllLocalUserPermissionInfo() {
111
- const permissionStringArray = this._scene.getUserPropertiesByKeyPath("permission.list", this._scene.localUser.getLocalUserId());
104
+ const permissionStringArray = this._scene.getUserPropertiesByKeyPath(`permission.list`, this._scene.localUser.getLocalUserId());
112
105
  return permissionStringArray.map(permissionString => this._convertPermissionInfo(_helper.FcrPermission.fromString(permissionString), _type2.FcrOperatePermissionType.GET));
113
106
  }
114
107
  async enableLockedRoom(enable, targetRoles) {
@@ -222,7 +215,7 @@ class FcrPrivilegeControlImpl {
222
215
  enable,
223
216
  targetRoles: targetRoles.map(role => _type2.FcrPrivilegeUserRoleToStringMap[role]),
224
217
  payload: {
225
- lineType: lineType !== null && lineType !== void 0 ? lineType : _type.FcrLineType.SINGLE_ROW
218
+ lineType: lineType ?? _type.FcrLineType.SINGLE_ROW
226
219
  }
227
220
  }), _imports.ErrorModuleCode.FCR_ROOM_PRIVILEGE, 'allow water mark failed');
228
221
  return _type.FcrReturnCode.SUCCESS;
@@ -332,15 +325,18 @@ class FcrPrivilegeControlImpl {
332
325
  enable: false
333
326
  };
334
327
  }
335
- const targetRoles = security.targetRoles,
336
- payload = security.payload;
328
+ const {
329
+ targetRoles,
330
+ payload
331
+ } = security;
337
332
  if (action === _type2.FcrSecurityAction.Annotation) {
338
- return _objectSpread({
333
+ return {
339
334
  info: {
340
335
  action: action,
341
336
  payload
342
- }
343
- }, security);
337
+ },
338
+ ...security
339
+ };
344
340
  }
345
341
  return {
346
342
  enable: !!security.enable,
@@ -357,13 +353,15 @@ class FcrPrivilegeControlImpl {
357
353
  enable: false
358
354
  };
359
355
  }
360
- const module = permission.module,
361
- action = permission.action;
356
+ const {
357
+ module,
358
+ action
359
+ } = permission;
362
360
  const permissionInfo = {
363
361
  enable: operateType === _type2.FcrOperatePermissionType.ADD || operateType === _type2.FcrOperatePermissionType.GET ? true : false,
364
362
  info: {
365
363
  targetRoles: permission.targetRoles.map(role => (0, _user.convertStringPrivilegeRoleToFcrPrivilegeRole)(role)),
366
- action: "".concat(module, ":").concat(action),
364
+ action: `${module}:${action}`,
367
365
  params: permission.conditions
368
366
  }
369
367
  };
@@ -375,7 +373,7 @@ class FcrPrivilegeControlImpl {
375
373
  if ('security' in event.changedProperties) {
376
374
  const securityChangedKeys = Object.keys(event.changedProperties.security);
377
375
  securityChangedKeys.forEach(key => {
378
- const infoObj = (0, _imports.get)(event.changedProperties, "security.".concat(key));
376
+ const infoObj = (0, _imports.get)(event.changedProperties, `security.${key}`);
379
377
  this._observable.notifyObservers('onSecurityInfoUpdated', sceneId, {
380
378
  securityInfo: this._convertSecurityInfo(infoObj, key),
381
379
  operatorUser: (0, _user.checkFcrUserRole)((0, _user.convertRteUserToFcrUser)(event.operatorUser, this._roomCache)),
@@ -385,8 +383,7 @@ class FcrPrivilegeControlImpl {
385
383
  }
386
384
  },
387
385
  onUserPropertiesUpdated: (sceneId, event) => {
388
- var _event$cause;
389
- if (((_event$cause = event.cause) === null || _event$cause === void 0 ? void 0 : _event$cause.cmd) === 3190) {
386
+ if (event.cause?.cmd === 3190) {
390
387
  const sendChatPublic = event.changedProperties['security.sendChat.public'];
391
388
  const sendChatPrivateHost = event.changedProperties['security.sendChat.private.host'];
392
389
  const sendChatPrivateCoHost = event.changedProperties['security.sendChat.private.cohost'];
@@ -426,9 +423,4 @@ class FcrPrivilegeControlImpl {
426
423
  this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onSecurityInfoUpdated', ['roomId', 'event']], ['onLocalUserPermissionInfoAdded', ['roomId', 'event']], ['onLocalUserPermissionInfoDeleted', ['roomId', 'event']]]));
427
424
  }
428
425
  }
429
- exports.FcrPrivilegeControlImpl = FcrPrivilegeControlImpl;
430
- _FcrPrivilegeControlImpl = FcrPrivilegeControlImpl;
431
- var _applyDecs$e = _applyDecs(_FcrPrivilegeControlImpl, [[_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"], [_getRemoteUserPermissionEnableDecs, 2, "getRemoteUserPermissionEnable"], [_allowViewUserCountDecs, 2, "allowViewUserCount"], [_allowHandsUpDecs, 2, "allowHandsUp"], [_allowSendChatByUserRoleDecs, 2, "allowSendChatByUserRole"], [_allowSendChatByUserIdDecs, 2, "allowSendChatByUserId"], [_imports.trace, 2, "release"]], []).e;
432
- var _applyDecs$e2 = (0, _slicedToArray2.default)(_applyDecs$e, 1);
433
- _initProto = _applyDecs$e2[0];
434
- _applyDecs$e;
426
+ exports.FcrPrivilegeControlImpl = FcrPrivilegeControlImpl;
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.symbol.description.js");
4
- require("core-js/modules/es.error.cause.js");
5
3
  require("core-js/modules/esnext.function.metadata.js");
6
4
  require("core-js/modules/esnext.map.delete-all.js");
7
5
  require("core-js/modules/esnext.map.emplace.js");
@@ -27,17 +25,13 @@ require("core-js/modules/es.array.push.js");
27
25
  require("core-js/modules/esnext.iterator.constructor.js");
28
26
  require("core-js/modules/esnext.iterator.map.js");
29
27
  require("core-js/modules/esnext.iterator.reduce.js");
30
- require("core-js/modules/web.dom-collections.iterator.js");
31
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
32
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
33
28
  var _type = require("./type");
34
29
  var _imports = require("../../imports");
35
30
  var _logger = require("../../utilities/logger");
36
31
  var _error = require("../../utilities/error");
37
32
  var _validateParams = _interopRequireDefault(require("../../utilities/validate-params"));
38
33
  var _schema = require("../../schema");
39
- var _FcrRoomConnectorControlImpl;
40
- let _initProto, _startSessionByPhoneDecs, _startSessionByIPDecs, _stopSessionDecs, _ref;
34
+ let _initProto, _startSessionByPhoneDecs, _startSessionByIPDecs, _stopSessionDecs;
41
35
  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)]; } }; }
42
36
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
43
37
  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); }
@@ -46,17 +40,19 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
46
40
  /**
47
41
  * @internal
48
42
  */
49
- _ref = (_startSessionByPhoneDecs = [(0, _imports.trace)(['params']), (0, _validateParams.default)(_schema.fcrPhoneConnectorSessionParamsSchema)], _startSessionByIPDecs = [(0, _imports.trace)(['params']), (0, _validateParams.default)(_schema.fcrIPConnectorSessionParamsSchema)], _stopSessionDecs = [(0, _imports.trace)(['sessionId']), (0, _validateParams.default)(_schema.stringSchema)], "logger");
50
43
  class FcrRoomConnectorControlImpl {
44
+ static {
45
+ [_initProto] = _applyDecs(this, [[_imports.trace, 2, "getRoomConnectorPhoneInfo"], [_imports.trace, 2, "getRoomConnectorIpInfo"], [_startSessionByPhoneDecs, 2, "startSessionByPhone"], [_startSessionByIPDecs, 2, "startSessionByIP"], [_stopSessionDecs, 2, "stopSession"], [_imports.trace, 2, "release"]], []).e;
46
+ }
47
+ //@internal
48
+ [(_startSessionByPhoneDecs = [(0, _imports.trace)(['params']), (0, _validateParams.default)(_schema.fcrPhoneConnectorSessionParamsSchema)], _startSessionByIPDecs = [(0, _imports.trace)(['params']), (0, _validateParams.default)(_schema.fcrIPConnectorSessionParamsSchema)], _stopSessionDecs = [(0, _imports.trace)(['sessionId']), (0, _validateParams.default)(_schema.stringSchema)], "logger")] = (_initProto(this), (0, _logger.createLogger)({
49
+ prefix: 'FcrRoomConnectorControlImpl'
50
+ }));
51
+ _observable = new _imports.AgoraObservable();
52
+ _sceneObserver = {
53
+ onSceneMessageReceived: this._handleMessageReceived.bind(this)
54
+ };
51
55
  constructor(_scene, _engine, _api) {
52
- //@internal
53
- (0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
54
- prefix: 'FcrRoomConnectorControlImpl'
55
- })));
56
- (0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
57
- (0, _defineProperty2.default)(this, "_sceneObserver", {
58
- onSceneMessageReceived: this._handleMessageReceived.bind(this)
59
- });
60
56
  this._scene = _scene;
61
57
  this._engine = _engine;
62
58
  this._api = _api;
@@ -64,16 +60,16 @@ class FcrRoomConnectorControlImpl {
64
60
  this._scene.addObserver(this._sceneObserver);
65
61
  }
66
62
  getRoomConnectorPhoneInfo() {
67
- var _ref2;
68
63
  const mid = this._scene.getScenePropertiesByKeyPath('call.mid');
69
- const callIn = (_ref2 = this._scene.getScenePropertiesByKeyPath('call.callIn')) !== null && _ref2 !== void 0 ? _ref2 : [];
64
+ const callIn = this._scene.getScenePropertiesByKeyPath('call.callIn') ?? [];
70
65
  const uid = this._scene.getUserPropertiesByKeyPath('call.uid', this._scene.getLocalUser().getLocalUserId());
71
66
  const regionMap = {
72
67
  cn: _type.FcrRoomConnectorPhoneRegion.CN
73
68
  };
74
- return Promise.resolve(callIn.map(_ref3 => {
75
- let callNumbers = _ref3.callNumbers,
76
- region = _ref3.region;
69
+ return Promise.resolve(callIn.map(({
70
+ callNumbers,
71
+ region
72
+ }) => {
77
73
  return {
78
74
  region: regionMap[region],
79
75
  phoneNumberList: callNumbers,
@@ -83,12 +79,12 @@ class FcrRoomConnectorControlImpl {
83
79
  }));
84
80
  }
85
81
  getRoomConnectorIpInfo() {
86
- var _ref4;
87
82
  const mid = this._scene.getScenePropertiesByKeyPath('call.mid');
88
- const callIn = (_ref4 = this._scene.getScenePropertiesByKeyPath('call.callIn')) !== null && _ref4 !== void 0 ? _ref4 : [];
83
+ const callIn = this._scene.getScenePropertiesByKeyPath('call.callIn') ?? [];
89
84
  return Promise.resolve({
90
- addressList: callIn.reduce((prev, _ref5) => {
91
- let ipAddresses = _ref5.ipAddresses;
85
+ addressList: callIn.reduce((prev, {
86
+ ipAddresses
87
+ }) => {
92
88
  if (Array.isArray(ipAddresses)) {
93
89
  prev.push(...ipAddresses);
94
90
  }
@@ -102,14 +98,15 @@ class FcrRoomConnectorControlImpl {
102
98
  [_type.FcrPhoneConnectorSessionType.PSTN]: 'pstn',
103
99
  [_type.FcrPhoneConnectorSessionType.VOLTE]: 'volte'
104
100
  }[params.type];
105
- const _await$handleRequestE = await (0, _error.handleRequestError)(() => this._api.callPstn({
106
- roomId: this._scene.sceneId,
107
- callNumber: params.phoneNumber,
108
- userId: params.phoneUserId,
109
- userName: params.userName,
110
- callType
111
- }), _imports.ErrorModuleCode.FCR_ROOM, 'start session by phone failed'),
112
- data = _await$handleRequestE.data;
101
+ const {
102
+ data
103
+ } = await (0, _error.handleRequestError)(() => this._api.callPstn({
104
+ roomId: this._scene.sceneId,
105
+ callNumber: params.phoneNumber,
106
+ userId: params.phoneUserId,
107
+ userName: params.userName,
108
+ callType
109
+ }), _imports.ErrorModuleCode.FCR_ROOM, 'start session by phone failed');
113
110
  return data.data.sessionUuid;
114
111
  }
115
112
  async startSessionByIP(params) {
@@ -117,12 +114,13 @@ class FcrRoomConnectorControlImpl {
117
114
  [_type.FcrIPConnectorSessionType.H323]: 'h323',
118
115
  [_type.FcrIPConnectorSessionType.SIP]: 'sip'
119
116
  }[params.type];
120
- const _await$handleRequestE2 = await (0, _error.handleRequestError)(() => this._api.callIp({
121
- roomId: this._scene.sceneId,
122
- callType,
123
- ipAddress: params.address
124
- }), _imports.ErrorModuleCode.FCR_ROOM, 'start session by IP failed'),
125
- data = _await$handleRequestE2.data;
117
+ const {
118
+ data
119
+ } = await (0, _error.handleRequestError)(() => this._api.callIp({
120
+ roomId: this._scene.sceneId,
121
+ callType,
122
+ ipAddress: params.address
123
+ }), _imports.ErrorModuleCode.FCR_ROOM, 'start session by IP failed');
126
124
  return data.data.sessionUuid;
127
125
  }
128
126
  async stopSession(sessionId) {
@@ -145,13 +143,15 @@ class FcrRoomConnectorControlImpl {
145
143
  _handleMessageReceived(sceneId, message) {
146
144
  const cmd = message.cmd;
147
145
  if (cmd === 2001 || cmd === 2002 || cmd === 2003) {
148
- const _ref6 = message.payload,
149
- sessionUuid = _ref6.sessionUuid,
150
- _ref6$payload = _ref6.payload,
151
- callNumber = _ref6$payload.callNumber,
152
- reason = _ref6$payload.reason,
153
- callType = _ref6$payload.callType,
154
- ipAddress = _ref6$payload.ipAddress;
146
+ const {
147
+ sessionUuid,
148
+ payload: {
149
+ callNumber,
150
+ reason,
151
+ callType,
152
+ ipAddress
153
+ }
154
+ } = message.payload;
155
155
  const reasonMap = {
156
156
  1: _type.FcrRoomConnectorSessionReason.ACCEPTED,
157
157
  2: _type.FcrRoomConnectorSessionReason.CANCELED,
@@ -193,9 +193,4 @@ class FcrRoomConnectorControlImpl {
193
193
  this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onIPConnectorSessionStateUpdated', ['session', 'state', 'reason']], ['onPhoneConnectorSessionStateUpdated', ['session', 'state', 'reason']]]));
194
194
  }
195
195
  }
196
- exports.FcrRoomConnectorControlImpl = FcrRoomConnectorControlImpl;
197
- _FcrRoomConnectorControlImpl = FcrRoomConnectorControlImpl;
198
- var _applyDecs$e = _applyDecs(_FcrRoomConnectorControlImpl, [[_imports.trace, 2, "getRoomConnectorPhoneInfo"], [_imports.trace, 2, "getRoomConnectorIpInfo"], [_startSessionByPhoneDecs, 2, "startSessionByPhone"], [_startSessionByIPDecs, 2, "startSessionByIP"], [_stopSessionDecs, 2, "stopSession"], [_imports.trace, 2, "release"]], []).e;
199
- var _applyDecs$e2 = (0, _slicedToArray2.default)(_applyDecs$e, 1);
200
- _initProto = _applyDecs$e2[0];
201
- _applyDecs$e;
196
+ exports.FcrRoomConnectorControlImpl = FcrRoomConnectorControlImpl;
@@ -44,21 +44,23 @@ class RoomControlFactory {
44
44
  * @throws {FcrError} 当房间类型不支持时抛出错误
45
45
  */
46
46
  static create(params) {
47
- const engine = params.engine,
48
- scene = params.scene,
49
- apiService = params.apiService,
50
- config = params.config,
51
- chatConnection = params.chatConnection,
52
- sharedCache = params.sharedCache,
53
- roomResponse = params.roomResponse,
54
- monitorControl = params.monitorControl;
47
+ const {
48
+ engine,
49
+ scene,
50
+ apiService,
51
+ config,
52
+ chatConnection,
53
+ sharedCache,
54
+ roomResponse,
55
+ monitorControl
56
+ } = params;
55
57
  const roomType = (0, _convertRoomType.convertServerRoomTypeToFcrRoomType)(roomResponse.room.roomProperties.roomType);
56
58
  if (roomType === null) {
57
- throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM, _imports.DetailErrorCode.UNDEFINED_ERROR, "Unsupported room types: ".concat(roomResponse.room.roomProperties.roomType));
59
+ throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM, _imports.DetailErrorCode.UNDEFINED_ERROR, `Unsupported room types: ${roomResponse.room.roomProperties.roomType}`);
58
60
  }
59
61
  const RoomControlImpl = ROOM_CONTROL_IMPLEMENTATIONS[roomType];
60
62
  if (!RoomControlImpl) {
61
- throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM, _imports.DetailErrorCode.UNDEFINED_ERROR, "Unsupported room types: ".concat(roomType));
63
+ throw (0, _error.generateFcrCoreClientError)(_imports.ErrorModuleCode.FCR_ROOM, _imports.DetailErrorCode.UNDEFINED_ERROR, `Unsupported room types: ${roomType}`);
62
64
  }
63
65
 
64
66
  // 创建聊天室控制