@webex/plugin-meetings 3.12.0-next.13 → 3.12.0-next.130

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 (232) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +15 -2
  3. package/dist/aiEnableRequest/index.js.map +1 -1
  4. package/dist/annotation/index.js +2 -2
  5. package/dist/annotation/index.js.map +1 -1
  6. package/dist/breakouts/breakout.js +8 -3
  7. package/dist/breakouts/breakout.js.map +1 -1
  8. package/dist/breakouts/events.js +29 -14
  9. package/dist/breakouts/events.js.map +1 -1
  10. package/dist/breakouts/index.js +99 -4
  11. package/dist/breakouts/index.js.map +1 -1
  12. package/dist/common/errors/webex-errors.js +49 -5
  13. package/dist/common/errors/webex-errors.js.map +1 -1
  14. package/dist/config.js +2 -2
  15. package/dist/config.js.map +1 -1
  16. package/dist/constants.js +37 -10
  17. package/dist/constants.js.map +1 -1
  18. package/dist/controls-options-manager/index.js +46 -10
  19. package/dist/controls-options-manager/index.js.map +1 -1
  20. package/dist/hashTree/constants.js +4 -1
  21. package/dist/hashTree/constants.js.map +1 -1
  22. package/dist/hashTree/hashTreeParser.js +1045 -393
  23. package/dist/hashTree/hashTreeParser.js.map +1 -1
  24. package/dist/hashTree/utils.js +20 -0
  25. package/dist/hashTree/utils.js.map +1 -1
  26. package/dist/index.js +7 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/interceptors/dataChannelAuthToken.js +75 -15
  29. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  30. package/dist/interceptors/locusRetry.js +23 -8
  31. package/dist/interceptors/locusRetry.js.map +1 -1
  32. package/dist/interpretation/index.js +10 -1
  33. package/dist/interpretation/index.js.map +1 -1
  34. package/dist/interpretation/interpretation.types.js +7 -0
  35. package/dist/interpretation/interpretation.types.js.map +1 -0
  36. package/dist/interpretation/siLanguage.js +1 -1
  37. package/dist/locus-info/controlsUtils.js +4 -1
  38. package/dist/locus-info/controlsUtils.js.map +1 -1
  39. package/dist/locus-info/index.js +409 -122
  40. package/dist/locus-info/index.js.map +1 -1
  41. package/dist/locus-info/infoUtils.js +36 -5
  42. package/dist/locus-info/infoUtils.js.map +1 -1
  43. package/dist/locus-info/types.js +19 -0
  44. package/dist/locus-info/types.js.map +1 -1
  45. package/dist/media/MediaConnectionAwaiter.js +15 -2
  46. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  47. package/dist/media/index.js +8 -2
  48. package/dist/media/index.js.map +1 -1
  49. package/dist/media/properties.js +4 -5
  50. package/dist/media/properties.js.map +1 -1
  51. package/dist/meeting/in-meeting-actions.js +5 -1
  52. package/dist/meeting/in-meeting-actions.js.map +1 -1
  53. package/dist/meeting/index.js +1669 -835
  54. package/dist/meeting/index.js.map +1 -1
  55. package/dist/meeting/locusMediaRequest.js +229 -82
  56. package/dist/meeting/locusMediaRequest.js.map +1 -1
  57. package/dist/meeting/muteState.js +10 -1
  58. package/dist/meeting/muteState.js.map +1 -1
  59. package/dist/meeting/request.js +5 -2
  60. package/dist/meeting/request.js.map +1 -1
  61. package/dist/meeting/util.js +34 -2
  62. package/dist/meeting/util.js.map +1 -1
  63. package/dist/meeting-info/meeting-info-v2.js +9 -3
  64. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  65. package/dist/meetings/index.js +281 -124
  66. package/dist/meetings/index.js.map +1 -1
  67. package/dist/meetings/meetings.types.js +6 -1
  68. package/dist/meetings/meetings.types.js.map +1 -1
  69. package/dist/meetings/request.js +39 -0
  70. package/dist/meetings/request.js.map +1 -1
  71. package/dist/meetings/util.js +116 -18
  72. package/dist/meetings/util.js.map +1 -1
  73. package/dist/member/index.js +10 -0
  74. package/dist/member/index.js.map +1 -1
  75. package/dist/member/types.js.map +1 -1
  76. package/dist/member/util.js +30 -0
  77. package/dist/member/util.js.map +1 -1
  78. package/dist/members/index.js +101 -43
  79. package/dist/members/index.js.map +1 -1
  80. package/dist/members/util.js +8 -1
  81. package/dist/members/util.js.map +1 -1
  82. package/dist/metrics/constants.js +7 -1
  83. package/dist/metrics/constants.js.map +1 -1
  84. package/dist/multistream/codec/constants.js +63 -0
  85. package/dist/multistream/codec/constants.js.map +1 -0
  86. package/dist/multistream/mediaRequestManager.js +62 -15
  87. package/dist/multistream/mediaRequestManager.js.map +1 -1
  88. package/dist/multistream/receiveSlot.js +9 -0
  89. package/dist/multistream/receiveSlot.js.map +1 -1
  90. package/dist/reachability/clusterReachability.js.map +1 -1
  91. package/dist/reachability/index.js +121 -83
  92. package/dist/reachability/index.js.map +1 -1
  93. package/dist/reachability/reachability.types.js +2 -0
  94. package/dist/reachability/reachability.types.js.map +1 -1
  95. package/dist/reachability/util.js +45 -0
  96. package/dist/reachability/util.js.map +1 -1
  97. package/dist/reactions/reactions.type.js.map +1 -1
  98. package/dist/recording-controller/index.js +1 -3
  99. package/dist/recording-controller/index.js.map +1 -1
  100. package/dist/roap/turnDiscovery.js +8 -1
  101. package/dist/roap/turnDiscovery.js.map +1 -1
  102. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  103. package/dist/types/config.d.ts +2 -2
  104. package/dist/types/constants.d.ts +13 -1
  105. package/dist/types/controls-options-manager/index.d.ts +16 -0
  106. package/dist/types/hashTree/constants.d.ts +1 -0
  107. package/dist/types/hashTree/hashTreeParser.d.ts +189 -22
  108. package/dist/types/hashTree/utils.d.ts +7 -0
  109. package/dist/types/index.d.ts +3 -0
  110. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  111. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  112. package/dist/types/locus-info/index.d.ts +61 -7
  113. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  114. package/dist/types/locus-info/types.d.ts +21 -1
  115. package/dist/types/media/MediaConnectionAwaiter.d.ts +10 -1
  116. package/dist/types/media/properties.d.ts +6 -2
  117. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  118. package/dist/types/meeting/index.d.ts +175 -11
  119. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  120. package/dist/types/meeting/request.d.ts +1 -0
  121. package/dist/types/meeting/util.d.ts +9 -0
  122. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  123. package/dist/types/meetings/index.d.ts +38 -18
  124. package/dist/types/meetings/meetings.types.d.ts +15 -0
  125. package/dist/types/meetings/request.d.ts +14 -0
  126. package/dist/types/member/index.d.ts +1 -0
  127. package/dist/types/member/types.d.ts +1 -0
  128. package/dist/types/member/util.d.ts +9 -0
  129. package/dist/types/members/index.d.ts +15 -2
  130. package/dist/types/members/util.d.ts +1 -5
  131. package/dist/types/metrics/constants.d.ts +6 -0
  132. package/dist/types/multistream/codec/constants.d.ts +7 -0
  133. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  134. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  135. package/dist/types/reachability/index.d.ts +10 -3
  136. package/dist/types/reachability/reachability.types.d.ts +7 -0
  137. package/dist/types/reachability/util.d.ts +17 -0
  138. package/dist/types/reactions/reactions.type.d.ts +3 -0
  139. package/dist/webinar/index.js +307 -161
  140. package/dist/webinar/index.js.map +1 -1
  141. package/package.json +23 -23
  142. package/src/aiEnableRequest/index.ts +16 -0
  143. package/src/annotation/index.ts +6 -4
  144. package/src/breakouts/breakout.ts +3 -1
  145. package/src/breakouts/events.ts +33 -11
  146. package/src/breakouts/index.ts +122 -2
  147. package/src/common/errors/webex-errors.ts +50 -3
  148. package/src/config.ts +2 -2
  149. package/src/constants.ts +21 -3
  150. package/src/controls-options-manager/index.ts +62 -10
  151. package/src/hashTree/constants.ts +7 -0
  152. package/src/hashTree/hashTreeParser.ts +796 -192
  153. package/src/hashTree/utils.ts +19 -0
  154. package/src/index.ts +6 -0
  155. package/src/interceptors/dataChannelAuthToken.ts +88 -12
  156. package/src/interceptors/locusRetry.ts +25 -4
  157. package/src/interpretation/index.ts +27 -9
  158. package/src/interpretation/interpretation.types.ts +11 -0
  159. package/src/locus-info/controlsUtils.ts +3 -1
  160. package/src/locus-info/index.ts +413 -130
  161. package/src/locus-info/infoUtils.ts +41 -6
  162. package/src/locus-info/types.ts +25 -1
  163. package/src/media/MediaConnectionAwaiter.ts +21 -4
  164. package/src/media/index.ts +10 -1
  165. package/src/media/properties.ts +8 -3
  166. package/src/meeting/in-meeting-actions.ts +8 -0
  167. package/src/meeting/index.ts +923 -117
  168. package/src/meeting/locusMediaRequest.ts +106 -6
  169. package/src/meeting/muteState.ts +10 -1
  170. package/src/meeting/request.ts +11 -0
  171. package/src/meeting/util.ts +46 -5
  172. package/src/meeting-info/meeting-info-v2.ts +10 -4
  173. package/src/meetings/index.ts +178 -78
  174. package/src/meetings/meetings.types.ts +19 -0
  175. package/src/meetings/request.ts +43 -0
  176. package/src/meetings/util.ts +117 -4
  177. package/src/member/index.ts +10 -0
  178. package/src/member/types.ts +1 -0
  179. package/src/member/util.ts +29 -0
  180. package/src/members/index.ts +70 -7
  181. package/src/members/util.ts +12 -4
  182. package/src/metrics/constants.ts +6 -0
  183. package/src/multistream/codec/constants.ts +58 -0
  184. package/src/multistream/mediaRequestManager.ts +119 -28
  185. package/src/multistream/receiveSlot.ts +18 -0
  186. package/src/reachability/clusterReachability.ts +3 -2
  187. package/src/reachability/index.ts +47 -16
  188. package/src/reachability/reachability.types.ts +11 -0
  189. package/src/reachability/util.ts +36 -0
  190. package/src/reactions/reactions.type.ts +3 -0
  191. package/src/recording-controller/index.ts +1 -2
  192. package/src/roap/turnDiscovery.ts +9 -1
  193. package/src/webinar/index.ts +216 -38
  194. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  195. package/test/unit/spec/annotation/index.ts +3 -3
  196. package/test/unit/spec/breakouts/breakout.ts +9 -3
  197. package/test/unit/spec/breakouts/events.ts +120 -2
  198. package/test/unit/spec/breakouts/index.ts +223 -3
  199. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  200. package/test/unit/spec/controls-options-manager/index.js +139 -32
  201. package/test/unit/spec/hashTree/hashTreeParser.ts +2299 -243
  202. package/test/unit/spec/hashTree/utils.ts +37 -0
  203. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +196 -0
  204. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  205. package/test/unit/spec/interpretation/index.ts +26 -4
  206. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  207. package/test/unit/spec/locus-info/index.js +671 -63
  208. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  209. package/test/unit/spec/media/MediaConnectionAwaiter.ts +55 -0
  210. package/test/unit/spec/media/index.ts +92 -0
  211. package/test/unit/spec/media/properties.ts +23 -23
  212. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  213. package/test/unit/spec/meeting/index.js +2733 -116
  214. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  215. package/test/unit/spec/meeting/muteState.js +81 -0
  216. package/test/unit/spec/meeting/request.js +12 -0
  217. package/test/unit/spec/meeting/utils.js +153 -1
  218. package/test/unit/spec/meeting-info/meetinginfov2.js +76 -10
  219. package/test/unit/spec/meetings/index.js +486 -49
  220. package/test/unit/spec/meetings/request.js +141 -0
  221. package/test/unit/spec/meetings/utils.js +402 -51
  222. package/test/unit/spec/member/index.js +7 -0
  223. package/test/unit/spec/member/util.js +89 -0
  224. package/test/unit/spec/members/index.js +216 -0
  225. package/test/unit/spec/members/request.js +37 -1
  226. package/test/unit/spec/members/utils.js +63 -0
  227. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  228. package/test/unit/spec/reachability/index.ts +128 -46
  229. package/test/unit/spec/reachability/util.ts +31 -0
  230. package/test/unit/spec/recording-controller/index.js +9 -8
  231. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  232. package/test/unit/spec/webinar/index.ts +332 -31
@@ -14,12 +14,13 @@ _Object$defineProperty(exports, "__esModule", {
14
14
  value: true
15
15
  });
16
16
  exports.default = void 0;
17
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
18
+ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
17
19
  var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
18
20
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
19
21
  var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
20
22
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
21
23
  var _values = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/values"));
22
- var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
23
24
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
24
25
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
25
26
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
@@ -29,6 +30,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
29
30
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
30
31
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
31
32
  var _lodash = require("lodash");
33
+ var _webCapabilities = require("@webex/web-capabilities");
32
34
  require("@webex/internal-plugin-mercury");
33
35
  require("@webex/internal-plugin-conversation");
34
36
  require("@webex/internal-plugin-metrics");
@@ -64,7 +66,7 @@ var _noMeetingInfo = _interopRequireDefault(require("../common/errors/no-meeting
64
66
  var _joinForbiddenError = _interopRequireDefault(require("../common/errors/join-forbidden-error"));
65
67
  var _utils = require("../hashTree/utils");
66
68
  var _locusInfo = require("../locus-info");
67
- function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t3 in e) "default" !== _t3 && {}.hasOwnProperty.call(e, _t3) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t3)) && (i.get || i.set) ? o(f, _t3, i) : f[_t3] = e[_t3]); return f; })(e, t); }
69
+ function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t4 in e) "default" !== _t4 && {}.hasOwnProperty.call(e, _t4) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t4)) && (i.get || i.set) ? o(f, _t4, i) : f[_t4] = e[_t4]); return f; })(e, t); }
68
70
  function ownKeys(e, r) { var t = _Object$keys2(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; }
69
71
  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; }
70
72
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
@@ -204,6 +206,51 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
204
206
  (0, _defineProperty2.default)(_this, "breakoutLocusForHandleLater", void 0);
205
207
  (0, _defineProperty2.default)(_this, "namespace", _constants.MEETINGS);
206
208
  (0, _defineProperty2.default)(_this, "registrationStatus", void 0);
209
+ /**
210
+ * Emits a metric describing how well this browser runs WebAssembly, used to spot browsers
211
+ * where real-time WASM effects (e.g. background noise removal) run poorly.
212
+ *
213
+ * @param {string} correlationId - correlation id to report the result against
214
+ * @returns {void}
215
+ */
216
+ (0, _defineProperty2.default)(_this, "emitWasmRuntimePerformance", (0, _lodash.once)(function (correlationId) {
217
+ // Probe and telemetry failures must not prevent meeting creation.
218
+ _webCapabilities.WasmRuntimeProbe.check().then(function (result) {
219
+ var status = result.status,
220
+ capability = result.capability,
221
+ reason = result.reason,
222
+ measurements = result.measurements;
223
+ var _ref = measurements !== null && measurements !== void 0 ? measurements : {},
224
+ _ref$divRatio = _ref.divRatio,
225
+ divRatio = _ref$divRatio === void 0 ? null : _ref$divRatio,
226
+ _ref$sqrtRatio = _ref.sqrtRatio,
227
+ sqrtRatio = _ref$sqrtRatio === void 0 ? null : _ref$sqrtRatio,
228
+ _ref$addNsPerOp = _ref.addNsPerOp,
229
+ addNsPerOp = _ref$addNsPerOp === void 0 ? null : _ref$addNsPerOp,
230
+ _ref$addMedianMs = _ref.addMedianMs,
231
+ addMedianMs = _ref$addMedianMs === void 0 ? null : _ref$addMedianMs,
232
+ _ref$divMedianMs = _ref.divMedianMs,
233
+ divMedianMs = _ref$divMedianMs === void 0 ? null : _ref$divMedianMs,
234
+ _ref$sqrtMedianMs = _ref.sqrtMedianMs,
235
+ sqrtMedianMs = _ref$sqrtMedianMs === void 0 ? null : _ref$sqrtMedianMs;
236
+ var measurementsLog = (0, _stringify.default)(measurements);
237
+ _loggerProxy.default.logger.log("Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status: ".concat(status, ", capability: ").concat(capability, ", reason: ").concat(reason, ", measurements: ").concat(measurementsLog));
238
+ return _metrics.default.sendBehavioralMetric(_constants2.default.WASM_RUNTIME_PERFORMANCE, {
239
+ status: status,
240
+ capability: capability,
241
+ reason: reason,
242
+ divRatio: divRatio,
243
+ sqrtRatio: sqrtRatio,
244
+ addNsPerOp: addNsPerOp,
245
+ addMedianMs: addMedianMs,
246
+ divMedianMs: divMedianMs,
247
+ sqrtMedianMs: sqrtMedianMs,
248
+ correlation_id: correlationId
249
+ });
250
+ }).catch(function (error) {
251
+ _loggerProxy.default.logger.error("Meetings:index#emitWasmRuntimePerformance --> ERROR, failed to probe or report WASM runtime performance: ".concat(error.message));
252
+ });
253
+ }));
207
254
  /**
208
255
  * Creates a noise reduction effect
209
256
  *
@@ -213,7 +260,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
213
260
  * @memberof Meetings
214
261
  */
215
262
  (0, _defineProperty2.default)(_this, "createNoiseReductionEffect", /*#__PURE__*/function () {
216
- var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(options) {
263
+ var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(options) {
217
264
  var authToken;
218
265
  return _regenerator.default.wrap(function (_context) {
219
266
  while (1) switch (_context.prev = _context.next) {
@@ -230,7 +277,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
230
277
  }, _callee);
231
278
  }));
232
279
  return function (_x) {
233
- return _ref.apply(this, arguments);
280
+ return _ref2.apply(this, arguments);
234
281
  };
235
282
  }());
236
283
  /**
@@ -242,7 +289,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
242
289
  * @memberof Meetings
243
290
  */
244
291
  (0, _defineProperty2.default)(_this, "createVirtualBackgroundEffect", /*#__PURE__*/function () {
245
- var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(options) {
292
+ var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(options) {
246
293
  var authToken;
247
294
  return _regenerator.default.wrap(function (_context2) {
248
295
  while (1) switch (_context2.prev = _context2.next) {
@@ -259,7 +306,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
259
306
  }, _callee2);
260
307
  }));
261
308
  return function (_x2) {
262
- return _ref2.apply(this, arguments);
309
+ return _ref3.apply(this, arguments);
263
310
  };
264
311
  }());
265
312
  _this.mediaHelpers = mediaHelpersModule;
@@ -354,11 +401,11 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
354
401
  return (0, _createClass2.default)(Meetings, [{
355
402
  key: "isNeedHandleMainLocus",
356
403
  value: function isNeedHandleMainLocus(meeting, newLocus) {
357
- var _newLocus$controls, _newLocus$controls$br, _newLocus$self, _newLocus$self2, _newLocus$self3, _breakoutLocus$joined, _newLocus$self4;
404
+ var _newLocus$controls, _newLocus$controls$br, _newLocus$self, _breakoutLocus$joined, _newLocus$self2;
358
405
  var breakoutUrl = (_newLocus$controls = newLocus.controls) === null || _newLocus$controls === void 0 ? void 0 : (_newLocus$controls$br = _newLocus$controls.breakout) === null || _newLocus$controls$br === void 0 ? void 0 : _newLocus$controls$br.url;
359
406
  var breakoutLocus = this.meetingCollection.getActiveBreakoutLocus(breakoutUrl);
360
407
  var isSelfJoined = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self = newLocus.self) === null || _newLocus$self === void 0 ? void 0 : _newLocus$self.state) === _constants._JOINED_;
361
- var isSelfMoved = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self2 = newLocus.self) === null || _newLocus$self2 === void 0 ? void 0 : _newLocus$self2.state) === _constants._LEFT_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self3 = newLocus.self) === null || _newLocus$self3 === void 0 ? void 0 : _newLocus$self3.reason) === _constants._MOVED_;
408
+ var isSelfMoved = _util2.default.isSelfMovedOrBreakoutEnded(newLocus);
362
409
  // @ts-ignore
363
410
  var deviceFromNewLocus = _util2.default.getThisDevice(newLocus, this.webex.internal.device.url);
364
411
  var isResourceMovedOnThisDevice = (deviceFromNewLocus === null || deviceFromNewLocus === void 0 ? void 0 : deviceFromNewLocus.state) === _constants._LEFT_ && (deviceFromNewLocus === null || deviceFromNewLocus === void 0 ? void 0 : deviceFromNewLocus.reason) === _constants._MOVED_;
@@ -383,7 +430,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
383
430
  _loggerProxy.default.logger.log("Meetings:index#isNeedHandleMainLocus --> there is active breakout session and joined on this device, and don't need to handle main session: ".concat(breakoutUrl));
384
431
  return false;
385
432
  }
386
- if (isSelfMoved && (newLocus !== null && newLocus !== void 0 && (_newLocus$self4 = newLocus.self) !== null && _newLocus$self4 !== void 0 && _newLocus$self4.removed || isResourceMovedOnThisDevice)) {
433
+ if (isSelfMoved && (newLocus !== null && newLocus !== void 0 && (_newLocus$self2 = newLocus.self) !== null && _newLocus$self2 !== void 0 && _newLocus$self2.removed || isResourceMovedOnThisDevice)) {
387
434
  _loggerProxy.default.logger.log('Meetings:index#isNeedHandleMainLocus --> self moved main locus with self removed status or with device resource moved, not need to handle');
388
435
  return false;
389
436
  }
@@ -407,15 +454,15 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
407
454
  key: "isNeedHandleLocusDTO",
408
455
  value: function isNeedHandleLocusDTO(meeting, newLocus) {
409
456
  if (newLocus) {
410
- var _newLocus$self5, _newLocus$self6, _newLocus$self7, _newLocus$self7$devic, _newLocus$self7$devic2, _newLocus$self8, _newLocus$self8$devic, _newLocus$self8$devic2;
457
+ var _newLocus$self3, _newLocus$self3$devic, _newLocus$self3$devic2, _newLocus$self4, _newLocus$self4$devic, _newLocus$self4$devic2;
411
458
  var isNewLocusAsBreakout = _util2.default.isBreakoutLocusDTO(newLocus);
412
- var isSelfMoved = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self5 = newLocus.self) === null || _newLocus$self5 === void 0 ? void 0 : _newLocus$self5.state) === _constants._LEFT_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self6 = newLocus.self) === null || _newLocus$self6 === void 0 ? void 0 : _newLocus$self6.reason) === _constants._MOVED_;
413
- var isSelfMovedToLobby = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self7 = newLocus.self) === null || _newLocus$self7 === void 0 ? void 0 : (_newLocus$self7$devic = _newLocus$self7.devices[0]) === null || _newLocus$self7$devic === void 0 ? void 0 : (_newLocus$self7$devic2 = _newLocus$self7$devic.intent) === null || _newLocus$self7$devic2 === void 0 ? void 0 : _newLocus$self7$devic2.reason) === _constants._ON_HOLD_LOBBY_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self8 = newLocus.self) === null || _newLocus$self8 === void 0 ? void 0 : (_newLocus$self8$devic = _newLocus$self8.devices[0]) === null || _newLocus$self8$devic === void 0 ? void 0 : (_newLocus$self8$devic2 = _newLocus$self8$devic.intent) === null || _newLocus$self8$devic2 === void 0 ? void 0 : _newLocus$self8$devic2.type) === _constants._WAIT_;
459
+ var isSelfMoved = _util2.default.isSelfMovedOrBreakoutEnded(newLocus);
460
+ var isSelfMovedToLobby = (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self3 = newLocus.self) === null || _newLocus$self3 === void 0 ? void 0 : (_newLocus$self3$devic = _newLocus$self3.devices[0]) === null || _newLocus$self3$devic === void 0 ? void 0 : (_newLocus$self3$devic2 = _newLocus$self3$devic.intent) === null || _newLocus$self3$devic2 === void 0 ? void 0 : _newLocus$self3$devic2.reason) === _constants._ON_HOLD_LOBBY_ && (newLocus === null || newLocus === void 0 ? void 0 : (_newLocus$self4 = newLocus.self) === null || _newLocus$self4 === void 0 ? void 0 : (_newLocus$self4$devic = _newLocus$self4.devices[0]) === null || _newLocus$self4$devic === void 0 ? void 0 : (_newLocus$self4$devic2 = _newLocus$self4$devic.intent) === null || _newLocus$self4$devic2 === void 0 ? void 0 : _newLocus$self4$devic2.type) === _constants._WAIT_;
414
461
  if (!meeting) {
415
462
  if (isNewLocusAsBreakout) {
416
- var _newLocus$fullState, _newLocus$self9;
463
+ var _newLocus$fullState, _newLocus$self5;
417
464
  _loggerProxy.default.logger.log("Meetings:index#isNeedHandleLocusDTO --> the first breakout session locusDTO active status: ".concat((_newLocus$fullState = newLocus.fullState) === null || _newLocus$fullState === void 0 ? void 0 : _newLocus$fullState.active));
418
- return ((_newLocus$self9 = newLocus.self) === null || _newLocus$self9 === void 0 ? void 0 : _newLocus$self9.state) === _constants._JOINED_;
465
+ return ((_newLocus$self5 = newLocus.self) === null || _newLocus$self5 === void 0 ? void 0 : _newLocus$self5.state) === _constants._JOINED_;
419
466
  }
420
467
  return this.isNeedHandleMainLocus(meeting, newLocus);
421
468
  }
@@ -451,9 +498,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
451
498
  }
452
499
  if (data.eventType === _constants.LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
453
500
  // need to check if maybe this event indicates a move to/from breakout
454
- var meetingForHashTreeMessage = (0, _locusInfo.findMeetingForHashTreeMessage)(data.stateElementsMessage, this.meetingCollection,
455
- // @ts-ignore
456
- this.webex.internal.device.url);
501
+ var meetingForHashTreeMessage = (0, _locusInfo.findMeetingForHashTreeMessage)(data === null || data === void 0 ? void 0 : data.stateElementsMessage, this.meetingCollection);
457
502
  if (meetingForHashTreeMessage) {
458
503
  return meetingForHashTreeMessage;
459
504
  }
@@ -493,7 +538,6 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
493
538
  var _this2 = this;
494
539
  var useRandomDelayForInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
495
540
  var meeting = this.getCorrespondingMeetingByLocus(data);
496
-
497
541
  // @ts-ignore
498
542
  if (this.config.experimental.storeLocusHashTreeEventsForDebugging) {
499
543
  (0, _meeting.storeEventForDebugging)('mercury', data);
@@ -561,7 +605,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
561
605
  return;
562
606
  }
563
607
  this.create(data.locus, _constants.DESTINATION_TYPE.LOCUS_ID, useRandomDelayForInfo).then(/*#__PURE__*/function () {
564
- var _ref3 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(newMeeting) {
608
+ var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(newMeeting) {
565
609
  var _t;
566
610
  return _regenerator.default.wrap(function (_context3) {
567
611
  while (1) switch (_context3.prev = _context3.next) {
@@ -573,6 +617,8 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
573
617
  trigger: data.eventType === _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS ? 'get-loci-response' : 'locus-message',
574
618
  locus: data.locus,
575
619
  hashTreeMessage: data.stateElementsMessage
620
+ }, function (locus) {
621
+ meeting.finalizeMeetingAfterInitialLocusSetup(locus);
576
622
  });
577
623
  case 2:
578
624
  _context3.next = 4;
@@ -592,7 +638,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
592
638
  }, _callee3, null, [[1, 3]]);
593
639
  }));
594
640
  return function (_x3) {
595
- return _ref3.apply(this, arguments);
641
+ return _ref4.apply(this, arguments);
596
642
  };
597
643
  }()).catch(function (e) {
598
644
  _loggerProxy.default.logger.error(e);
@@ -825,46 +871,6 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
825
871
  }
826
872
  }
827
873
 
828
- /**
829
- * API to toggle TCP reachability, needs to be called before webex.meetings.register()
830
- * @param {Boolean} newValue
831
- * @private
832
- * @memberof Meetings
833
- * @returns {undefined}
834
- */
835
- }, {
836
- key: "_toggleTcpReachability",
837
- value: function _toggleTcpReachability(newValue) {
838
- if (typeof newValue !== 'boolean') {
839
- return;
840
- }
841
- // @ts-ignore
842
- if (this.config.experimental.enableTcpReachability !== newValue) {
843
- // @ts-ignore
844
- this.config.experimental.enableTcpReachability = newValue;
845
- }
846
- }
847
-
848
- /**
849
- * API to toggle TLS reachability, needs to be called before webex.meetings.register()
850
- * @param {Boolean} newValue
851
- * @private
852
- * @memberof Meetings
853
- * @returns {undefined}
854
- */
855
- }, {
856
- key: "_toggleTlsReachability",
857
- value: function _toggleTlsReachability(newValue) {
858
- if (typeof newValue !== 'boolean') {
859
- return;
860
- }
861
- // @ts-ignore
862
- if (this.config.experimental.enableTlsReachability !== newValue) {
863
- // @ts-ignore
864
- this.config.experimental.enableTlsReachability = newValue;
865
- }
866
- }
867
-
868
874
  /**
869
875
  * API to toggle backend ipv6 native support config, needs to be called before webex.meetings.register()
870
876
  *
@@ -930,6 +936,29 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
930
936
  }
931
937
  }
932
938
 
939
+ /**
940
+ * API to toggle AV1 codec support for video slides in multistream,
941
+ * needs to be called before webex.meetings.joinWithMedia()
942
+ *
943
+ * @param {Boolean} newValue
944
+ * @private
945
+ * @memberof Meetings
946
+ * @returns {undefined}
947
+ */
948
+ }, {
949
+ key: "_toggleEnableAv1SlidesSupport",
950
+ value: function _toggleEnableAv1SlidesSupport(newValue) {
951
+ if (typeof newValue !== 'boolean') {
952
+ return;
953
+ }
954
+
955
+ // @ts-ignore
956
+ if (this.config.enableAv1SlidesSupport !== newValue) {
957
+ // @ts-ignore
958
+ this.config.enableAv1SlidesSupport = newValue;
959
+ }
960
+ }
961
+
933
962
  /**
934
963
  * API to toggle stopping ICE Candidates Gathering after first relay candidate,
935
964
  * needs to be called before webex.meetings.joinWithMedia()
@@ -1275,6 +1304,31 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1275
1304
  return this.personalMeetingRoom;
1276
1305
  }
1277
1306
 
1307
+ /**
1308
+ * Fetches site preferences for the provided Webex site, or the preferred Webex site.
1309
+ * This is used to determine capabilities of the site, such as whether scheduling a webinar is supported.
1310
+ *
1311
+ * @param {object} [options]
1312
+ * @param {string} [options.siteUrl] - Webex site URL. Defaults to preferredWebexSite, for example "cisco.webex.com".
1313
+ * @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from siteUrl, for example "cisco" for "cisco.webex.com".
1314
+ * @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.
1315
+ * @returns {Promise<SitePreferencesResponse>} site preferences response body
1316
+ * @throws {ParameterError}
1317
+ * @public
1318
+ * @memberof Meetings
1319
+ * @example
1320
+ * const preferences = await webex.meetings.fetchSitePreferencesMeViaSite();
1321
+ * const supportScheduleWebinar = preferences?.scheduling?.supportScheduleWebinar;
1322
+ */
1323
+ }, {
1324
+ key: "fetchSitePreferencesMeViaSite",
1325
+ value: function fetchSitePreferencesMeViaSite() {
1326
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1327
+ return this.request.fetchSitePreferencesMeViaSite(_objectSpread(_objectSpread({}, options), {}, {
1328
+ siteUrl: options.siteUrl || this.preferredWebexSite
1329
+ }));
1330
+ }
1331
+
1278
1332
  /**
1279
1333
  * Returns basic information about a meeting that exists or
1280
1334
  * used to exist in the MeetingCollection
@@ -1470,6 +1524,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1470
1524
  });
1471
1525
  }
1472
1526
  });
1527
+ _this1.emitWasmRuntimePerformance(createdMeeting.correlationId);
1473
1528
  } else {
1474
1529
  _loggerProxy.default.logger.error("Meetings:index#create --> ERROR, meeting does not have on method, will not be destroyed, meeting cleanup impossible for meeting: ".concat(meeting));
1475
1530
  }
@@ -1567,6 +1622,8 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1567
1622
  isMeetingActive,
1568
1623
  enableUnifiedMeetings,
1569
1624
  meetingInfoOptions,
1625
+ shouldDeferMeetingInfoFetch,
1626
+ isOneOnOneCallLocus,
1570
1627
  meetingAddedType,
1571
1628
  _args4 = arguments,
1572
1629
  _t2;
@@ -1621,16 +1678,18 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1621
1678
  extraParams: infoExtraParams,
1622
1679
  sendCAevents: !!(callStateForMetrics !== null && callStateForMetrics !== void 0 && callStateForMetrics.correlationId) // if client sends correlation id as argument of public create(), then it means that this meeting creation is part of a pre-join intent from user
1623
1680
  };
1681
+ shouldDeferMeetingInfoFetch = type === _constants.DESTINATION_TYPE.LOCUS_ID && !(destination !== null && destination !== void 0 && destination.info);
1682
+ isOneOnOneCallLocus = type === _constants.DESTINATION_TYPE.LOCUS_ID && _util2.default.isOneOnOneCall(destination);
1624
1683
  if (!meetingInfo) {
1625
1684
  _context4.next = 2;
1626
1685
  break;
1627
1686
  }
1628
1687
  meeting.injectMeetingInfo(meetingInfo, meetingInfoOptions, meetingLookupUrl);
1629
- _context4.next = 4;
1688
+ _context4.next = 6;
1630
1689
  break;
1631
1690
  case 2:
1632
- if (!(type !== _constants.DESTINATION_TYPE.ONE_ON_ONE_CALL)) {
1633
- _context4.next = 4;
1691
+ if (!(type !== _constants.DESTINATION_TYPE.ONE_ON_ONE_CALL && !isOneOnOneCallLocus)) {
1692
+ _context4.next = 6;
1634
1693
  break;
1635
1694
  }
1636
1695
  if (!(enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0)) {
@@ -1641,37 +1700,46 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1641
1700
  return meeting.fetchMeetingInfo(meetingInfoOptions);
1642
1701
  }, waitingTime);
1643
1702
  meeting.parseMeetingInfo(undefined, destination);
1644
- _context4.next = 4;
1703
+ _context4.next = 6;
1645
1704
  break;
1646
1705
  case 3:
1706
+ if (shouldDeferMeetingInfoFetch) {
1707
+ _context4.next = 5;
1708
+ break;
1709
+ }
1647
1710
  _context4.next = 4;
1648
1711
  return meeting.fetchMeetingInfo(meetingInfoOptions);
1649
1712
  case 4:
1650
- _context4.next = 8;
1713
+ _context4.next = 6;
1651
1714
  break;
1652
1715
  case 5:
1653
- _context4.prev = 5;
1716
+ _loggerProxy.default.logger.info('Meetings:index#createMeeting --> defer fetchMeetingInfo for incomplete locus, will do it after locus initialSetup');
1717
+ case 6:
1718
+ _context4.next = 10;
1719
+ break;
1720
+ case 7:
1721
+ _context4.prev = 7;
1654
1722
  _t2 = _context4["catch"](1);
1655
1723
  if (!(!(_t2 instanceof _captchaError.default) && !(_t2 instanceof _passwordError.default) && !(_t2 instanceof _permission.default) && !(_t2 instanceof _joinWebinarError.default) && !(_t2 instanceof _joinForbiddenError.default))) {
1656
- _context4.next = 7;
1724
+ _context4.next = 9;
1657
1725
  break;
1658
1726
  }
1659
1727
  _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Info Unable to fetch meeting info for ".concat(destination, "."));
1660
1728
  if (!failOnMissingMeetingInfo) {
1661
- _context4.next = 6;
1729
+ _context4.next = 8;
1662
1730
  break;
1663
1731
  }
1664
1732
  _loggerProxy.default.logger.info("Meetings:index#createMeeting --> Destroying meeting due to missing meeting info.");
1665
1733
  // @ts-ignore
1666
1734
  this.destroy(meeting, _constants.MEETING_REMOVED_REASON.MISSING_MEETING_INFO);
1667
1735
  throw new _noMeetingInfo.default();
1668
- case 6:
1736
+ case 8:
1669
1737
  // if there is no meeting info and no error should be thrown then we assume its a 1:1 call or wireless share
1670
1738
  _loggerProxy.default.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
1671
- case 7:
1739
+ case 9:
1672
1740
  _loggerProxy.default.logger.debug("Meetings:index#createMeeting --> Debug ".concat(_t2, " fetching /meetingInfo for creation."));
1673
- case 8:
1674
- _context4.prev = 8;
1741
+ case 10:
1742
+ _context4.prev = 10;
1675
1743
  // For type LOCUS_ID we need to parse the locus object to get the information
1676
1744
  // about the caller and callee
1677
1745
  // Meeting Added event will be created in `handleLocusEvent`
@@ -1695,14 +1763,14 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1695
1763
  type: meetingAddedType
1696
1764
  });
1697
1765
  }
1698
- return _context4.finish(8);
1699
- case 9:
1766
+ return _context4.finish(10);
1767
+ case 11:
1700
1768
  return _context4.abrupt("return", meeting);
1701
- case 10:
1769
+ case 12:
1702
1770
  case "end":
1703
1771
  return _context4.stop();
1704
1772
  }
1705
- }, _callee4, this, [[1, 5, 8, 9]]);
1773
+ }, _callee4, this, [[1, 7, 10, 11]]);
1706
1774
  }));
1707
1775
  function createMeeting(_x4) {
1708
1776
  return _createMeeting.apply(this, arguments);
@@ -1745,51 +1813,141 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1745
1813
  */
1746
1814
  }, {
1747
1815
  key: "syncMeetings",
1748
- value: function syncMeetings() {
1749
- var _this11 = this;
1750
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1751
- _ref4$keepOnlyLocusMe = _ref4.keepOnlyLocusMeetings,
1752
- keepOnlyLocusMeetings = _ref4$keepOnlyLocusMe === void 0 ? true : _ref4$keepOnlyLocusMe;
1753
- // @ts-ignore
1754
- if (this.webex.credentials.isUnverifiedGuest) {
1755
- _loggerProxy.default.logger.info('Meetings:index#syncMeetings --> skipping meeting sync as unverified guest');
1756
- return _promise.default.resolve();
1757
- }
1758
- return this.request.getActiveMeetings().then(function (locusArray) {
1759
- var activeLocusUrl = [];
1760
- if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1761
- var lociToUpdate = _this11.sortLocusArrayToUpdate(locusArray.loci);
1762
- lociToUpdate.forEach(function (locus) {
1763
- activeLocusUrl.push(locus.url);
1764
- _this11.handleLocusEvent({
1765
- eventType: _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS,
1766
- locus: locus,
1767
- locusUrl: locus.url
1768
- });
1769
- });
1770
- }
1771
- var meetingsCollection = _this11.meetingCollection.getAll();
1772
- if ((0, _keys.default)(meetingsCollection).length > 0) {
1773
- // Sometimes the mercury events are lost after mercury reconnect
1774
- // Remove any Locus meetings that are not returned by Locus
1775
- // (they had a locusUrl previously but are no longer active) in the sync
1776
- for (var _i = 0, _Object$values = (0, _values.default)(meetingsCollection); _i < _Object$values.length; _i++) {
1777
- var meeting = _Object$values[_i];
1778
- // @ts-ignore
1779
- var locusUrl = meeting.locusUrl;
1780
- if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1781
- // destroy function also uploads logs
1782
- // @ts-ignore
1783
- _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1784
- }
1816
+ value: (function () {
1817
+ var _syncMeetings = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
1818
+ var _this11 = this;
1819
+ var _ref5,
1820
+ _ref5$keepOnlyLocusMe,
1821
+ keepOnlyLocusMeetings,
1822
+ _ref5$skipHashTreeSyn,
1823
+ skipHashTreeSync,
1824
+ locusArray,
1825
+ activeLocusUrl,
1826
+ lociToUpdate,
1827
+ meetingsCollection,
1828
+ _loop,
1829
+ _i,
1830
+ _Object$values,
1831
+ remainingMeetings,
1832
+ syncPromises,
1833
+ _i2,
1834
+ _arr,
1835
+ meeting,
1836
+ _args6 = arguments,
1837
+ _t3;
1838
+ return _regenerator.default.wrap(function (_context6) {
1839
+ while (1) switch (_context6.prev = _context6.next) {
1840
+ case 0:
1841
+ _ref5 = _args6.length > 0 && _args6[0] !== undefined ? _args6[0] : {}, _ref5$keepOnlyLocusMe = _ref5.keepOnlyLocusMeetings, keepOnlyLocusMeetings = _ref5$keepOnlyLocusMe === void 0 ? true : _ref5$keepOnlyLocusMe, _ref5$skipHashTreeSyn = _ref5.skipHashTreeSync, skipHashTreeSync = _ref5$skipHashTreeSyn === void 0 ? false : _ref5$skipHashTreeSyn;
1842
+ if (!this.webex.credentials.isUnverifiedGuest) {
1843
+ _context6.next = 1;
1844
+ break;
1845
+ }
1846
+ _loggerProxy.default.logger.info('Meetings:index#syncMeetings --> user is unverified guest, skipping calling Locus for meeting sync');
1847
+ _context6.next = 7;
1848
+ break;
1849
+ case 1:
1850
+ _context6.prev = 1;
1851
+ _context6.next = 2;
1852
+ return this.request.getActiveMeetings();
1853
+ case 2:
1854
+ locusArray = _context6.sent;
1855
+ activeLocusUrl = [];
1856
+ if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1857
+ lociToUpdate = this.sortLocusArrayToUpdate(locusArray.loci);
1858
+ lociToUpdate.forEach(function (locus) {
1859
+ activeLocusUrl.push(locus.url);
1860
+ _this11.handleLocusEvent({
1861
+ eventType: _constants.LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS,
1862
+ locus: locus,
1863
+ locusUrl: locus.url
1864
+ });
1865
+ });
1866
+ }
1867
+ meetingsCollection = this.meetingCollection.getAll();
1868
+ if (!((0, _keys.default)(meetingsCollection).length > 0)) {
1869
+ _context6.next = 5;
1870
+ break;
1871
+ }
1872
+ _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
1873
+ var meeting, locusUrl, locusInfo, _locusInfo$info, _locusArray$loci, globalMeetingId;
1874
+ return _regenerator.default.wrap(function (_context5) {
1875
+ while (1) switch (_context5.prev = _context5.next) {
1876
+ case 0:
1877
+ meeting = _Object$values[_i];
1878
+ // @ts-ignore
1879
+ locusUrl = meeting.locusUrl, locusInfo = meeting.locusInfo;
1880
+ if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1881
+ globalMeetingId = locusInfo === null || locusInfo === void 0 ? void 0 : (_locusInfo$info = locusInfo.info) === null || _locusInfo$info === void 0 ? void 0 : _locusInfo$info.globalMeetingId;
1882
+ if (globalMeetingId && locusArray !== null && locusArray !== void 0 && (_locusArray$loci = locusArray.loci) !== null && _locusArray$loci !== void 0 && _locusArray$loci.some(function (locus) {
1883
+ var _locus$info;
1884
+ return ((_locus$info = locus.info) === null || _locus$info === void 0 ? void 0 : _locus$info.globalMeetingId) === globalMeetingId;
1885
+ })) {
1886
+ // don't destroy the meeting as Locus API still returned some Locus that shares
1887
+ // the same globalMeetingId - that happens for example if a webinar user (who hasn't scheduled it)
1888
+ // is in a breakout and gets moved to a different breakout while we were offline
1889
+ } else {
1890
+ // destroy function also uploads logs
1891
+ // @ts-ignore
1892
+ _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1893
+ }
1894
+ }
1895
+ case 1:
1896
+ case "end":
1897
+ return _context5.stop();
1898
+ }
1899
+ }, _loop);
1900
+ });
1901
+ _i = 0, _Object$values = (0, _values.default)(meetingsCollection);
1902
+ case 3:
1903
+ if (!(_i < _Object$values.length)) {
1904
+ _context6.next = 5;
1905
+ break;
1906
+ }
1907
+ return _context6.delegateYield(_loop(), "t0", 4);
1908
+ case 4:
1909
+ _i++;
1910
+ _context6.next = 3;
1911
+ break;
1912
+ case 5:
1913
+ _context6.next = 7;
1914
+ break;
1915
+ case 6:
1916
+ _context6.prev = 6;
1917
+ _t3 = _context6["catch"](1);
1918
+ _loggerProxy.default.logger.error("Meetings:index#syncMeetings --> failed to sync meetings, ".concat(_t3));
1919
+ throw _t3;
1920
+ case 7:
1921
+ if (skipHashTreeSync) {
1922
+ _context6.next = 8;
1923
+ break;
1924
+ }
1925
+ // Trigger hash tree syncs for all remaining meetings
1926
+ remainingMeetings = this.meetingCollection.getAll();
1927
+ syncPromises = [];
1928
+ for (_i2 = 0, _arr = (0, _values.default)(remainingMeetings); _i2 < _arr.length; _i2++) {
1929
+ meeting = _arr[_i2];
1930
+ if (meeting.locusInfo) {
1931
+ syncPromises.push(meeting.locusInfo.syncAllHashTreeDatasets());
1932
+ }
1933
+ }
1934
+ if (!(syncPromises.length > 0)) {
1935
+ _context6.next = 8;
1936
+ break;
1937
+ }
1938
+ _context6.next = 8;
1939
+ return _promise.default.all(syncPromises);
1940
+ case 8:
1941
+ case "end":
1942
+ return _context6.stop();
1785
1943
  }
1786
- }
1787
- }).catch(function (error) {
1788
- _loggerProxy.default.logger.error("Meetings:index#syncMeetings --> failed to sync meetings, ".concat(error));
1789
- throw new Error(error);
1790
- });
1791
- }
1792
-
1944
+ }, _callee5, this, [[1, 6]]);
1945
+ }));
1946
+ function syncMeetings() {
1947
+ return _syncMeetings.apply(this, arguments);
1948
+ }
1949
+ return syncMeetings;
1950
+ }()
1793
1951
  /**
1794
1952
  * sort out locus array for initial creating
1795
1953
  * @param {Array} loci original locus array
@@ -1797,6 +1955,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1797
1955
  * @public
1798
1956
  * @memberof Meetings
1799
1957
  */
1958
+ )
1800
1959
  }, {
1801
1960
  key: "sortLocusArrayToUpdate",
1802
1961
  value: function sortLocusArrayToUpdate(loci) {
@@ -1811,8 +1970,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1811
1970
  var lociToUpdate = (0, _toConsumableArray2.default)(mainLoci);
1812
1971
  breakoutLoci.forEach(function (breakoutLocus) {
1813
1972
  var associateMainLocus = mainLoci.find(function (mainLocus) {
1814
- var _mainLocus$controls, _mainLocus$controls$b, _breakoutLocus$contro, _breakoutLocus$contro2;
1815
- return ((_mainLocus$controls = mainLocus.controls) === null || _mainLocus$controls === void 0 ? void 0 : (_mainLocus$controls$b = _mainLocus$controls.breakout) === null || _mainLocus$controls$b === void 0 ? void 0 : _mainLocus$controls$b.url) === ((_breakoutLocus$contro = breakoutLocus.controls) === null || _breakoutLocus$contro === void 0 ? void 0 : (_breakoutLocus$contro2 = _breakoutLocus$contro.breakout) === null || _breakoutLocus$contro2 === void 0 ? void 0 : _breakoutLocus$contro2.url);
1973
+ return _util2.default.isMainAssociatedWithBreakout(mainLocus, breakoutLocus);
1816
1974
  });
1817
1975
  var existCorrespondingMeeting = _this12.getCorrespondingMeetingByLocus({
1818
1976
  eventType: _constants.LOCUSEVENT.SDK_NO_EVENT,
@@ -1848,8 +2006,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1848
2006
  return;
1849
2007
  }
1850
2008
  var existIndex = this.breakoutLocusForHandleLater.findIndex(function (breakoutLocus) {
1851
- var _breakoutLocus$contro3, _breakoutLocus$contro4, _newCreatedLocus$cont, _newCreatedLocus$cont2;
1852
- return ((_breakoutLocus$contro3 = breakoutLocus.controls) === null || _breakoutLocus$contro3 === void 0 ? void 0 : (_breakoutLocus$contro4 = _breakoutLocus$contro3.breakout) === null || _breakoutLocus$contro4 === void 0 ? void 0 : _breakoutLocus$contro4.url) === ((_newCreatedLocus$cont = newCreatedLocus.controls) === null || _newCreatedLocus$cont === void 0 ? void 0 : (_newCreatedLocus$cont2 = _newCreatedLocus$cont.breakout) === null || _newCreatedLocus$cont2 === void 0 ? void 0 : _newCreatedLocus$cont2.url);
2009
+ return _util2.default.isMainAssociatedWithBreakout(newCreatedLocus, breakoutLocus);
1853
2010
  });
1854
2011
  if (existIndex < 0) {
1855
2012
  return;