@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
@@ -1,5 +1,6 @@
1
1
  /* eslint no-shadow: ["error", { "allow": ["eventType"] }] */
2
- import {cloneDeep, clone, set} from 'lodash';
2
+ import {cloneDeep, clone, set, once} from 'lodash';
3
+ import {WasmRuntimeProbe} from '@webex/web-capabilities';
3
4
  import '@webex/internal-plugin-mercury';
4
5
  import '@webex/internal-plugin-conversation';
5
6
  import '@webex/internal-plugin-metrics';
@@ -55,10 +56,12 @@ import PasswordError from '../common/errors/password-error';
55
56
  import CaptchaError from '../common/errors/captcha-error';
56
57
  import MeetingCollection from './collection';
57
58
  import {
59
+ FetchSitePreferencesMeViaSiteOptions,
58
60
  MEETING_KEY,
59
61
  INoiseReductionEffect,
60
62
  IVirtualBackgroundEffect,
61
63
  MeetingRegistrationStatus,
64
+ SitePreferencesResponse,
62
65
  } from './meetings.types';
63
66
  import MeetingsUtil from './util';
64
67
  import PermissionError from '../common/errors/permission';
@@ -69,7 +72,9 @@ import JoinForbiddenError from '../common/errors/join-forbidden-error';
69
72
  import {HashTreeMessage} from '../hashTree/hashTreeParser';
70
73
  import {HashTreeObject} from '../hashTree/types';
71
74
  import {isSelf} from '../hashTree/utils';
75
+
72
76
  import {createLocusFromHashTreeMessage, findMeetingForHashTreeMessage} from '../locus-info';
77
+ import {LocusDTO} from '../locus-info/types';
73
78
 
74
79
  let mediaLogger;
75
80
 
@@ -206,6 +211,52 @@ export default class Meetings extends WebexPlugin {
206
211
  namespace = MEETINGS;
207
212
  registrationStatus: MeetingRegistrationStatus;
208
213
 
214
+ /**
215
+ * Emits a metric describing how well this browser runs WebAssembly, used to spot browsers
216
+ * where real-time WASM effects (e.g. background noise removal) run poorly.
217
+ *
218
+ * @param {string} correlationId - correlation id to report the result against
219
+ * @returns {void}
220
+ */
221
+ private emitWasmRuntimePerformance = once((correlationId: string): void => {
222
+ // Probe and telemetry failures must not prevent meeting creation.
223
+ WasmRuntimeProbe.check()
224
+ .then((result) => {
225
+ const {status, capability, reason, measurements} = result;
226
+ const {
227
+ divRatio = null,
228
+ sqrtRatio = null,
229
+ addNsPerOp = null,
230
+ addMedianMs = null,
231
+ divMedianMs = null,
232
+ sqrtMedianMs = null,
233
+ } = measurements ?? {};
234
+ const measurementsLog = JSON.stringify(measurements);
235
+
236
+ LoggerProxy.logger.log(
237
+ `Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status: ${status}, capability: ${capability}, reason: ${reason}, measurements: ${measurementsLog}`
238
+ );
239
+
240
+ return Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.WASM_RUNTIME_PERFORMANCE, {
241
+ status,
242
+ capability,
243
+ reason,
244
+ divRatio,
245
+ sqrtRatio,
246
+ addNsPerOp,
247
+ addMedianMs,
248
+ divMedianMs,
249
+ sqrtMedianMs,
250
+ correlation_id: correlationId,
251
+ });
252
+ })
253
+ .catch((error) => {
254
+ LoggerProxy.logger.error(
255
+ `Meetings:index#emitWasmRuntimePerformance --> ERROR, failed to probe or report WASM runtime performance: ${error.message}`
256
+ );
257
+ });
258
+ });
259
+
209
260
  /**
210
261
  * Initializes the Meetings Plugin
211
262
  * @constructor
@@ -313,7 +364,7 @@ export default class Meetings extends WebexPlugin {
313
364
  const breakoutLocus = this.meetingCollection.getActiveBreakoutLocus(breakoutUrl);
314
365
 
315
366
  const isSelfJoined = newLocus?.self?.state === _JOINED_;
316
- const isSelfMoved = newLocus?.self?.state === _LEFT_ && newLocus?.self?.reason === _MOVED_;
367
+ const isSelfMoved = MeetingsUtil.isSelfMovedOrBreakoutEnded(newLocus);
317
368
  // @ts-ignore
318
369
  const deviceFromNewLocus = MeetingsUtil.getThisDevice(newLocus, this.webex.internal.device.url);
319
370
  const isResourceMovedOnThisDevice =
@@ -390,7 +441,7 @@ export default class Meetings extends WebexPlugin {
390
441
  private isNeedHandleLocusDTO(meeting: any, newLocus: any) {
391
442
  if (newLocus) {
392
443
  const isNewLocusAsBreakout = MeetingsUtil.isBreakoutLocusDTO(newLocus);
393
- const isSelfMoved = newLocus?.self?.state === _LEFT_ && newLocus?.self?.reason === _MOVED_;
444
+ const isSelfMoved = MeetingsUtil.isSelfMovedOrBreakoutEnded(newLocus);
394
445
  const isSelfMovedToLobby =
395
446
  newLocus?.self?.devices[0]?.intent?.reason === _ON_HOLD_LOBBY_ &&
396
447
  newLocus?.self?.devices[0]?.intent?.type === _WAIT_;
@@ -435,14 +486,11 @@ export default class Meetings extends WebexPlugin {
435
486
  if (existingMeeting) {
436
487
  return existingMeeting;
437
488
  }
438
-
439
489
  if (data.eventType === LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
440
490
  // need to check if maybe this event indicates a move to/from breakout
441
491
  const meetingForHashTreeMessage = findMeetingForHashTreeMessage(
442
- data.stateElementsMessage,
443
- this.meetingCollection,
444
- // @ts-ignore
445
- this.webex.internal.device.url
492
+ data?.stateElementsMessage,
493
+ this.meetingCollection
446
494
  );
447
495
 
448
496
  if (meetingForHashTreeMessage) {
@@ -492,7 +540,6 @@ export default class Meetings extends WebexPlugin {
492
540
  */
493
541
  private handleLocusEvent(data: LocusEvent, useRandomDelayForInfo = false) {
494
542
  let meeting = this.getCorrespondingMeetingByLocus(data);
495
-
496
543
  // @ts-ignore
497
544
  if (this.config.experimental.storeLocusHashTreeEventsForDebugging) {
498
545
  storeEventForDebugging('mercury', data);
@@ -513,6 +560,7 @@ export default class Meetings extends WebexPlugin {
513
560
  if (meeting && !MeetingsUtil.isBreakoutLocusDTO(data.locus)) {
514
561
  meeting.locusInfo.updateMainSessionLocusCache(data.locus); // here data.locus will never be a complete locus
515
562
  }
563
+
516
564
  if (!this.isNeedHandleLocusDTO(meeting, data.locus)) {
517
565
  LoggerProxy.logger.log(
518
566
  `Meetings:index#handleLocusEvent --> doesn't need to process locus event`
@@ -586,17 +634,21 @@ export default class Meetings extends WebexPlugin {
586
634
  this.create(data.locus, DESTINATION_TYPE.LOCUS_ID, useRandomDelayForInfo)
587
635
  .then(async (newMeeting) => {
588
636
  meeting = newMeeting;
589
-
590
637
  try {
591
638
  // It's a new meeting so initialize the locus data
592
- await meeting.locusInfo.initialSetup({
593
- trigger:
594
- data.eventType === LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS
595
- ? 'get-loci-response'
596
- : 'locus-message',
597
- locus: data.locus,
598
- hashTreeMessage: data.stateElementsMessage,
599
- });
639
+ await meeting.locusInfo.initialSetup(
640
+ {
641
+ trigger:
642
+ data.eventType === LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS
643
+ ? 'get-loci-response'
644
+ : 'locus-message',
645
+ locus: data.locus,
646
+ hashTreeMessage: data.stateElementsMessage,
647
+ },
648
+ (locus: LocusDTO) => {
649
+ meeting.finalizeMeetingAfterInitialLocusSetup(locus);
650
+ }
651
+ );
600
652
  } catch (error) {
601
653
  LoggerProxy.logger.warn(
602
654
  `Meetings:index#handleLocusEvent --> Error initializing locus data: ${error.message}`
@@ -837,97 +889,82 @@ export default class Meetings extends WebexPlugin {
837
889
  }
838
890
 
839
891
  /**
840
- * API to toggle TCP reachability, needs to be called before webex.meetings.register()
841
- * @param {Boolean} newValue
842
- * @private
843
- * @memberof Meetings
844
- * @returns {undefined}
845
- */
846
- private _toggleTcpReachability(newValue: boolean) {
847
- if (typeof newValue !== 'boolean') {
848
- return;
849
- }
850
- // @ts-ignore
851
- if (this.config.experimental.enableTcpReachability !== newValue) {
852
- // @ts-ignore
853
- this.config.experimental.enableTcpReachability = newValue;
854
- }
855
- }
856
-
857
- /**
858
- * API to toggle TLS reachability, needs to be called before webex.meetings.register()
892
+ * API to toggle backend ipv6 native support config, needs to be called before webex.meetings.register()
893
+ *
859
894
  * @param {Boolean} newValue
860
895
  * @private
861
896
  * @memberof Meetings
862
897
  * @returns {undefined}
863
898
  */
864
- private _toggleTlsReachability(newValue: boolean) {
899
+ private _toggleIpv6BackendNativeSupport(newValue: boolean) {
865
900
  if (typeof newValue !== 'boolean') {
866
901
  return;
867
902
  }
868
903
  // @ts-ignore
869
- if (this.config.experimental.enableTlsReachability !== newValue) {
904
+ if (this.config.backendIpv6NativeSupport !== newValue) {
870
905
  // @ts-ignore
871
- this.config.experimental.enableTlsReachability = newValue;
906
+ this.config.backendIpv6NativeSupport = newValue;
872
907
  }
873
908
  }
874
909
 
875
910
  /**
876
- * API to toggle backend ipv6 native support config, needs to be called before webex.meetings.register()
911
+ * API to toggle usage of audio main DTX, needs to be called before webex.meetings.register()
877
912
  *
878
913
  * @param {Boolean} newValue
879
914
  * @private
880
915
  * @memberof Meetings
881
916
  * @returns {undefined}
882
917
  */
883
- private _toggleIpv6BackendNativeSupport(newValue: boolean) {
918
+ private _toggleDisableAudioMainDtx(newValue: boolean) {
884
919
  if (typeof newValue !== 'boolean') {
885
920
  return;
886
921
  }
922
+
887
923
  // @ts-ignore
888
- if (this.config.backendIpv6NativeSupport !== newValue) {
924
+ if (this.config.experimental.disableAudioMainDtx !== newValue) {
889
925
  // @ts-ignore
890
- this.config.backendIpv6NativeSupport = newValue;
926
+ this.config.experimental.disableAudioMainDtx = newValue;
891
927
  }
892
928
  }
893
929
 
894
930
  /**
895
- * API to toggle usage of audio main DTX, needs to be called before webex.meetings.register()
931
+ * API to toggle usage of audio twcc support
896
932
  *
897
933
  * @param {Boolean} newValue
898
934
  * @private
899
935
  * @memberof Meetings
900
936
  * @returns {undefined}
901
937
  */
902
- private _toggleDisableAudioMainDtx(newValue: boolean) {
938
+ private _toggleEnableAudioTwccForMultistream(newValue: boolean) {
903
939
  if (typeof newValue !== 'boolean') {
904
940
  return;
905
941
  }
906
942
 
907
943
  // @ts-ignore
908
- if (this.config.experimental.disableAudioMainDtx !== newValue) {
944
+ if (this.config.enableAudioTwccForMultistream !== newValue) {
909
945
  // @ts-ignore
910
- this.config.experimental.disableAudioMainDtx = newValue;
946
+ this.config.enableAudioTwccForMultistream = newValue;
911
947
  }
912
948
  }
913
949
 
914
950
  /**
915
- * API to toggle usage of audio twcc support
951
+ * API to toggle AV1 codec support for video slides in multistream,
952
+ * needs to be called before webex.meetings.joinWithMedia()
916
953
  *
917
954
  * @param {Boolean} newValue
918
955
  * @private
919
956
  * @memberof Meetings
920
957
  * @returns {undefined}
921
958
  */
922
- private _toggleEnableAudioTwccForMultistream(newValue: boolean) {
959
+ private _toggleEnableAv1SlidesSupport(newValue: boolean) {
923
960
  if (typeof newValue !== 'boolean') {
924
961
  return;
925
962
  }
926
963
 
927
964
  // @ts-ignore
928
- if (this.config.enableAudioTwccForMultistream !== newValue) {
965
+ if (this.config.enableAv1SlidesSupport !== newValue) {
929
966
  // @ts-ignore
930
- this.config.enableAudioTwccForMultistream = newValue;
967
+ this.config.enableAv1SlidesSupport = newValue;
931
968
  }
932
969
  }
933
970
 
@@ -1403,6 +1440,31 @@ export default class Meetings extends WebexPlugin {
1403
1440
  return this.personalMeetingRoom;
1404
1441
  }
1405
1442
 
1443
+ /**
1444
+ * Fetches site preferences for the provided Webex site, or the preferred Webex site.
1445
+ * This is used to determine capabilities of the site, such as whether scheduling a webinar is supported.
1446
+ *
1447
+ * @param {object} [options]
1448
+ * @param {string} [options.siteUrl] - Webex site URL. Defaults to preferredWebexSite, for example "cisco.webex.com".
1449
+ * @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from siteUrl, for example "cisco" for "cisco.webex.com".
1450
+ * @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.
1451
+ * @returns {Promise<SitePreferencesResponse>} site preferences response body
1452
+ * @throws {ParameterError}
1453
+ * @public
1454
+ * @memberof Meetings
1455
+ * @example
1456
+ * const preferences = await webex.meetings.fetchSitePreferencesMeViaSite();
1457
+ * const supportScheduleWebinar = preferences?.scheduling?.supportScheduleWebinar;
1458
+ */
1459
+ public fetchSitePreferencesMeViaSite(
1460
+ options: FetchSitePreferencesMeViaSiteOptions = {}
1461
+ ): Promise<SitePreferencesResponse> {
1462
+ return this.request.fetchSitePreferencesMeViaSite({
1463
+ ...options,
1464
+ siteUrl: options.siteUrl || this.preferredWebexSite,
1465
+ });
1466
+ }
1467
+
1406
1468
  /**
1407
1469
  * Returns basic information about a meeting that exists or
1408
1470
  * used to exist in the MeetingCollection
@@ -1620,6 +1682,8 @@ export default class Meetings extends WebexPlugin {
1620
1682
  });
1621
1683
  }
1622
1684
  });
1685
+
1686
+ this.emitWasmRuntimePerformance(createdMeeting.correlationId);
1623
1687
  } else {
1624
1688
  LoggerProxy.logger.error(
1625
1689
  `Meetings:index#create --> ERROR, meeting does not have on method, will not be destroyed, meeting cleanup impossible for meeting: ${meeting}`
@@ -1765,10 +1829,14 @@ export default class Meetings extends WebexPlugin {
1765
1829
  extraParams: infoExtraParams,
1766
1830
  sendCAevents: !!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
1767
1831
  };
1832
+ const shouldDeferMeetingInfoFetch = type === DESTINATION_TYPE.LOCUS_ID && !destination?.info;
1833
+
1834
+ const isOneOnOneCallLocus =
1835
+ type === DESTINATION_TYPE.LOCUS_ID && MeetingsUtil.isOneOnOneCall(destination);
1768
1836
 
1769
1837
  if (meetingInfo) {
1770
1838
  meeting.injectMeetingInfo(meetingInfo, meetingInfoOptions, meetingLookupUrl);
1771
- } else if (type !== DESTINATION_TYPE.ONE_ON_ONE_CALL) {
1839
+ } else if (type !== DESTINATION_TYPE.ONE_ON_ONE_CALL && !isOneOnOneCallLocus) {
1772
1840
  // ignore fetchMeetingInfo for 1:1 meetings
1773
1841
  if (enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0) {
1774
1842
  meeting.fetchMeetingInfoTimeoutId = setTimeout(
@@ -1776,8 +1844,12 @@ export default class Meetings extends WebexPlugin {
1776
1844
  waitingTime
1777
1845
  );
1778
1846
  meeting.parseMeetingInfo(undefined, destination);
1779
- } else {
1847
+ } else if (!shouldDeferMeetingInfoFetch) {
1780
1848
  await meeting.fetchMeetingInfo(meetingInfoOptions);
1849
+ } else {
1850
+ LoggerProxy.logger.info(
1851
+ 'Meetings:index#createMeeting --> defer fetchMeetingInfo for incomplete locus, will do it after locus initialSetup'
1852
+ );
1781
1853
  }
1782
1854
  }
1783
1855
  } catch (err) {
@@ -1890,23 +1962,23 @@ export default class Meetings extends WebexPlugin {
1890
1962
  * @public
1891
1963
  * @memberof Meetings
1892
1964
  */
1893
- public syncMeetings({keepOnlyLocusMeetings = true} = {}): Promise<void> {
1965
+ public async syncMeetings({
1966
+ keepOnlyLocusMeetings = true,
1967
+ skipHashTreeSync = false,
1968
+ } = {}): Promise<void> {
1894
1969
  // @ts-ignore
1895
1970
  if (this.webex.credentials.isUnverifiedGuest) {
1896
1971
  LoggerProxy.logger.info(
1897
- 'Meetings:index#syncMeetings --> skipping meeting sync as unverified guest'
1972
+ 'Meetings:index#syncMeetings --> user is unverified guest, skipping calling Locus for meeting sync'
1898
1973
  );
1899
-
1900
- return Promise.resolve();
1901
- }
1902
-
1903
- return this.request
1904
- .getActiveMeetings()
1905
- .then((locusArray) => {
1906
- const activeLocusUrl = [];
1974
+ } else {
1975
+ try {
1976
+ const locusArray = await this.request.getActiveMeetings();
1977
+ const activeLocusUrl: string[] = [];
1907
1978
 
1908
1979
  if (locusArray?.loci && locusArray.loci.length > 0) {
1909
1980
  const lociToUpdate = this.sortLocusArrayToUpdate(locusArray.loci);
1981
+
1910
1982
  lociToUpdate.forEach((locus) => {
1911
1983
  activeLocusUrl.push(locus.url);
1912
1984
  this.handleLocusEvent({
@@ -1924,21 +1996,50 @@ export default class Meetings extends WebexPlugin {
1924
1996
  // (they had a locusUrl previously but are no longer active) in the sync
1925
1997
  for (const meeting of Object.values(meetingsCollection)) {
1926
1998
  // @ts-ignore
1927
- const {locusUrl} = meeting;
1999
+ const {locusUrl, locusInfo} = meeting;
1928
2000
  if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1929
- // destroy function also uploads logs
1930
- // @ts-ignore
1931
- this.destroy(meeting, MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
2001
+ const globalMeetingId = locusInfo?.info?.globalMeetingId;
2002
+
2003
+ if (
2004
+ globalMeetingId &&
2005
+ locusArray?.loci?.some(
2006
+ (locus: LocusDTO) => locus.info?.globalMeetingId === globalMeetingId
2007
+ )
2008
+ ) {
2009
+ // don't destroy the meeting as Locus API still returned some Locus that shares
2010
+ // the same globalMeetingId - that happens for example if a webinar user (who hasn't scheduled it)
2011
+ // is in a breakout and gets moved to a different breakout while we were offline
2012
+ } else {
2013
+ // destroy function also uploads logs
2014
+ // @ts-ignore
2015
+ this.destroy(meeting, MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
2016
+ }
1932
2017
  }
1933
2018
  }
1934
2019
  }
1935
- })
1936
- .catch((error) => {
2020
+ } catch (error) {
1937
2021
  LoggerProxy.logger.error(
1938
2022
  `Meetings:index#syncMeetings --> failed to sync meetings, ${error}`
1939
2023
  );
1940
- throw new Error(error);
1941
- });
2024
+ throw error;
2025
+ }
2026
+ }
2027
+
2028
+ if (!skipHashTreeSync) {
2029
+ // Trigger hash tree syncs for all remaining meetings
2030
+ const remainingMeetings = this.meetingCollection.getAll();
2031
+ const syncPromises = [];
2032
+
2033
+ for (const meeting of Object.values(remainingMeetings) as any[]) {
2034
+ if (meeting.locusInfo) {
2035
+ syncPromises.push(meeting.locusInfo.syncAllHashTreeDatasets());
2036
+ }
2037
+ }
2038
+
2039
+ if (syncPromises.length > 0) {
2040
+ await Promise.all(syncPromises);
2041
+ }
2042
+ }
1942
2043
  }
1943
2044
 
1944
2045
  /**
@@ -1954,8 +2055,8 @@ export default class Meetings extends WebexPlugin {
1954
2055
  this.breakoutLocusForHandleLater = [];
1955
2056
  const lociToUpdate = [...mainLoci];
1956
2057
  breakoutLoci.forEach((breakoutLocus) => {
1957
- const associateMainLocus = mainLoci.find(
1958
- (mainLocus) => mainLocus.controls?.breakout?.url === breakoutLocus.controls?.breakout?.url
2058
+ const associateMainLocus = mainLoci.find((mainLocus) =>
2059
+ MeetingsUtil.isMainAssociatedWithBreakout(mainLocus, breakoutLocus)
1959
2060
  );
1960
2061
  const existCorrespondingMeeting = this.getCorrespondingMeetingByLocus({
1961
2062
  eventType: LOCUSEVENT.SDK_NO_EVENT,
@@ -1983,7 +2084,7 @@ export default class Meetings extends WebexPlugin {
1983
2084
  * @public
1984
2085
  * @memberof Meetings
1985
2086
  */
1986
- checkHandleBreakoutLocus(newCreatedLocus) {
2087
+ checkHandleBreakoutLocus(newCreatedLocus: any) {
1987
2088
  if (
1988
2089
  !newCreatedLocus ||
1989
2090
  !this.breakoutLocusForHandleLater ||
@@ -1994,9 +2095,8 @@ export default class Meetings extends WebexPlugin {
1994
2095
  if (MeetingsUtil.isBreakoutLocusDTO(newCreatedLocus)) {
1995
2096
  return;
1996
2097
  }
1997
- const existIndex = this.breakoutLocusForHandleLater.findIndex(
1998
- (breakoutLocus) =>
1999
- breakoutLocus.controls?.breakout?.url === newCreatedLocus.controls?.breakout?.url
2098
+ const existIndex = this.breakoutLocusForHandleLater.findIndex((breakoutLocus: any) =>
2099
+ MeetingsUtil.isMainAssociatedWithBreakout(newCreatedLocus, breakoutLocus)
2000
2100
  );
2001
2101
 
2002
2102
  if (existIndex < 0) {
@@ -31,3 +31,22 @@ export type MeetingRegistrationStatus = {
31
31
  mercuryConnect: boolean;
32
32
  checkH264Support: boolean;
33
33
  };
34
+
35
+ export enum SitePreferenceSelectOption {
36
+ SCHEDULING = 'scheduling',
37
+ }
38
+
39
+ export type FetchSitePreferencesMeViaSiteOptions = {
40
+ siteUrl?: string;
41
+ siteName?: string;
42
+ selectOptions?: SitePreferenceSelectOption[];
43
+ };
44
+
45
+ export const DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS = [SitePreferenceSelectOption.SCHEDULING];
46
+
47
+ export type SitePreferencesResponse = {
48
+ scheduling?: {
49
+ supportScheduleWebinar?: boolean;
50
+ webinarWebLink?: string;
51
+ };
52
+ };
@@ -2,7 +2,14 @@
2
2
  import {StatelessWebexPlugin} from '@webex/webex-core';
3
3
 
4
4
  import LoggerProxy from '../common/logs/logger-proxy';
5
+ import ParameterError from '../common/errors/parameter';
5
6
  import {HTTP_VERBS, API, RESOURCE} from '../constants';
7
+ import {
8
+ DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS,
9
+ type FetchSitePreferencesMeViaSiteOptions,
10
+ type SitePreferencesResponse,
11
+ } from './meetings.types';
12
+ import MeetingsUtil from './util';
6
13
 
7
14
  /**
8
15
  * @class MeetingRequest
@@ -45,6 +52,42 @@ export default class MeetingRequest extends StatelessWebexPlugin {
45
52
  return this.webex.internal.services.getMeetingPreferences();
46
53
  }
47
54
 
55
+ /**
56
+ * Fetches site preferences from a given site given a select option and a siteUrl with an optional siteName. If siteName is not provided, it will be derived from the siteUrl. If siteUrl is not provided, it will throw an error. If selectOptions is not provided, it will default to scheduling.
57
+ *
58
+ * @param {object} [options]
59
+ * @param {string} [options.siteUrl] - Webex site URL, for example "cisco.webex.com".
60
+ * @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from options.siteUrl, e.g., "cisco".
61
+ * @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.
62
+ * @returns {Promise<SitePreferencesResponse>} site preferences response body
63
+ * @throws {ParameterError}
64
+ * @public
65
+ * @memberof MeetingRequest
66
+ */
67
+ fetchSitePreferencesMeViaSite(
68
+ options: FetchSitePreferencesMeViaSiteOptions = {}
69
+ ): Promise<SitePreferencesResponse> {
70
+ const {siteUrl, selectOptions = DEFAULT_SITE_PREFERENCE_SELECT_OPTIONS} = options;
71
+
72
+ if (!siteUrl) {
73
+ throw new ParameterError(
74
+ 'No siteUrl available. Call register() before fetching site preferences or provide options.siteUrl.'
75
+ );
76
+ }
77
+
78
+ // @ts-ignore - config comes from registerPlugin
79
+ const multipartSitePrefixList = this.config.meetings.multipartSitePrefixList || [];
80
+ const siteName = options.siteName || MeetingsUtil.getSiteName(siteUrl, multipartSitePrefixList);
81
+
82
+ // @ts-ignore
83
+ return this.request({
84
+ method: HTTP_VERBS.GET,
85
+ uri: `https://${siteUrl}/wbxappapi/v1/users/me/preference?select=${encodeURIComponent(
86
+ selectOptions.join(',')
87
+ )}&siteurl=${encodeURIComponent(siteName)}`,
88
+ }).then((res: any) => res.body);
89
+ }
90
+
48
91
  // locus federation, determines and populate locus if the responseBody has remote URLs to fetch locus details
49
92
 
50
93
  /**