fcr-core 3.10.2 → 3.10.5

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