@webex/plugin-meetings 3.12.0 → 3.13.0-next.10

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 (354) hide show
  1. package/.sdd/manifest.json +1312 -0
  2. package/.sdd/templates/.source.json +30 -0
  3. package/.sdd/templates/component-repo/module-docs/module-spec-quality.md +111 -0
  4. package/.sdd/templates/component-repo/module-docs/module-spec.template.md +321 -0
  5. package/.sdd/templates/component-repo/reference-docs/adr/_adr-example.md +59 -0
  6. package/.sdd/templates/component-repo/reference-docs/patterns/_pattern-example.md +49 -0
  7. package/.sdd/templates/component-repo/reference-docs/rules/_rule-example.md +42 -0
  8. package/.sdd/templates/component-repo/standing-docs/AGENTS.template.md +120 -0
  9. package/.sdd/templates/component-repo/standing-docs/ARCHITECTURE.template.md +206 -0
  10. package/.sdd/templates/component-repo/standing-docs/CONTRACTS.template.md +90 -0
  11. package/.sdd/templates/component-repo/standing-docs/DATA_MODEL.template.md +68 -0
  12. package/.sdd/templates/component-repo/standing-docs/GETTING_STARTED.template.md +111 -0
  13. package/.sdd/templates/component-repo/standing-docs/GLOSSARY.template.md +57 -0
  14. package/.sdd/templates/component-repo/standing-docs/REVIEW_CHECKLIST.template.md +69 -0
  15. package/.sdd/templates/component-repo/standing-docs/RULES.template.md +96 -0
  16. package/.sdd/templates/component-repo/standing-docs/SECURITY.template.md +84 -0
  17. package/.sdd/templates/component-repo/standing-docs/SERVICE_STATE.template.md +82 -0
  18. package/.sdd/templates/component-repo/standing-docs/SPEC_INDEX.template.md +94 -0
  19. package/.sdd/templates/component-repo/standing-docs/TEST_INDEX.template.md +64 -0
  20. package/.sdd/templates/component-repo/template-map.json +112 -0
  21. package/AGENTS.md +135 -0
  22. package/ai-docs/ARCHITECTURE.md +208 -0
  23. package/ai-docs/CONTRACTS.md +267 -0
  24. package/ai-docs/DATA_MODEL.md +64 -0
  25. package/ai-docs/GETTING_STARTED.md +73 -0
  26. package/ai-docs/GLOSSARY.md +56 -0
  27. package/ai-docs/REVIEW_CHECKLIST.md +45 -0
  28. package/ai-docs/RULES.md +79 -0
  29. package/ai-docs/SECURITY.md +74 -0
  30. package/ai-docs/SERVICE_STATE.md +59 -0
  31. package/ai-docs/SPEC_INDEX.md +85 -0
  32. package/ai-docs/TEST_INDEX.md +45 -0
  33. package/ai-docs/adr/0001-migrate-existing-docs-into-sdd.md +61 -0
  34. package/ai-docs/patterns/defensive-error-propagation.md +55 -0
  35. package/ai-docs/patterns/event-scope-emission.md +46 -0
  36. package/ai-docs/patterns/source-to-test-path-mirroring.md +45 -0
  37. package/ai-docs/patterns/stateless-plugin-request-classes.md +53 -0
  38. package/ai-docs/patterns/typed-constants-and-enum-values.md +47 -0
  39. package/assets/README.md +28 -0
  40. package/assets/e2ee-0.0.1.js +2 -0
  41. package/assets/e2ee-0.0.1.wasm +0 -0
  42. package/babel.config.js +17 -1
  43. package/dist/aiEnableRequest/index.js +15 -2
  44. package/dist/aiEnableRequest/index.js.map +1 -1
  45. package/dist/annotation/index.js +55 -19
  46. package/dist/annotation/index.js.map +1 -1
  47. package/dist/assets/e2ee-0.0.1.js +2 -0
  48. package/dist/assets/e2ee-0.0.1.wasm +0 -0
  49. package/dist/breakouts/breakout.js +8 -3
  50. package/dist/breakouts/breakout.js.map +1 -1
  51. package/dist/breakouts/events.js +29 -14
  52. package/dist/breakouts/events.js.map +1 -1
  53. package/dist/breakouts/index.js +128 -7
  54. package/dist/breakouts/index.js.map +1 -1
  55. package/dist/common/errors/webex-errors.js +54 -5
  56. package/dist/common/errors/webex-errors.js.map +1 -1
  57. package/dist/common/wasm-loader.js +174 -0
  58. package/dist/common/wasm-loader.js.map +1 -0
  59. package/dist/config.js +5 -2
  60. package/dist/config.js.map +1 -1
  61. package/dist/constants.js +39 -11
  62. package/dist/constants.js.map +1 -1
  63. package/dist/controls-options-manager/constants.js +11 -1
  64. package/dist/controls-options-manager/constants.js.map +1 -1
  65. package/dist/controls-options-manager/index.js +67 -29
  66. package/dist/controls-options-manager/index.js.map +1 -1
  67. package/dist/controls-options-manager/util.js +91 -0
  68. package/dist/controls-options-manager/util.js.map +1 -1
  69. package/dist/e2ee/E2eeManager.js +91 -0
  70. package/dist/e2ee/E2eeManager.js.map +1 -0
  71. package/dist/e2ee/E2eeSignaling.js +200 -0
  72. package/dist/e2ee/E2eeSignaling.js.map +1 -0
  73. package/dist/e2ee/MediaEncryptionService.js +75 -0
  74. package/dist/e2ee/MediaEncryptionService.js.map +1 -0
  75. package/dist/e2ee/mls.js +558 -0
  76. package/dist/e2ee/mls.js.map +1 -0
  77. package/dist/e2ee/types.js +59 -0
  78. package/dist/e2ee/types.js.map +1 -0
  79. package/dist/e2ee/wasm.d.js +7 -0
  80. package/dist/e2ee/wasm.d.js.map +1 -0
  81. package/dist/hashTree/constants.js +13 -1
  82. package/dist/hashTree/constants.js.map +1 -1
  83. package/dist/hashTree/hashTreeParser.js +1245 -404
  84. package/dist/hashTree/hashTreeParser.js.map +1 -1
  85. package/dist/hashTree/utils.js +42 -0
  86. package/dist/hashTree/utils.js.map +1 -1
  87. package/dist/index.js +8 -0
  88. package/dist/index.js.map +1 -1
  89. package/dist/interceptors/dataChannelAuthToken.js +58 -16
  90. package/dist/interceptors/dataChannelAuthToken.js.map +1 -1
  91. package/dist/interceptors/locusRetry.js +24 -9
  92. package/dist/interceptors/locusRetry.js.map +1 -1
  93. package/dist/interpretation/index.js +55 -12
  94. package/dist/interpretation/index.js.map +1 -1
  95. package/dist/interpretation/interpretation.types.js +7 -0
  96. package/dist/interpretation/interpretation.types.js.map +1 -0
  97. package/dist/interpretation/siLanguage.js +1 -1
  98. package/dist/locus-info/controlsUtils.js +4 -1
  99. package/dist/locus-info/controlsUtils.js.map +1 -1
  100. package/dist/locus-info/index.js +914 -196
  101. package/dist/locus-info/index.js.map +1 -1
  102. package/dist/locus-info/infoUtils.js +36 -5
  103. package/dist/locus-info/infoUtils.js.map +1 -1
  104. package/dist/locus-info/types.js +20 -0
  105. package/dist/locus-info/types.js.map +1 -1
  106. package/dist/media/MediaConnectionAwaiter.js +229 -166
  107. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  108. package/dist/media/index.js +8 -2
  109. package/dist/media/index.js.map +1 -1
  110. package/dist/media/properties.js +4 -5
  111. package/dist/media/properties.js.map +1 -1
  112. package/dist/meeting/in-meeting-actions.js +5 -1
  113. package/dist/meeting/in-meeting-actions.js.map +1 -1
  114. package/dist/meeting/index.js +1931 -887
  115. package/dist/meeting/index.js.map +1 -1
  116. package/dist/meeting/locusMediaRequest.js +229 -82
  117. package/dist/meeting/locusMediaRequest.js.map +1 -1
  118. package/dist/meeting/muteState.js +10 -1
  119. package/dist/meeting/muteState.js.map +1 -1
  120. package/dist/meeting/request.js +5 -2
  121. package/dist/meeting/request.js.map +1 -1
  122. package/dist/meeting/util.js +42 -3
  123. package/dist/meeting/util.js.map +1 -1
  124. package/dist/meeting/voicea-meeting.js +2 -1
  125. package/dist/meeting/voicea-meeting.js.map +1 -1
  126. package/dist/meeting-info/meeting-info-v2.js +12 -5
  127. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  128. package/dist/meetings/index.js +342 -129
  129. package/dist/meetings/index.js.map +1 -1
  130. package/dist/meetings/meetings.types.js +6 -1
  131. package/dist/meetings/meetings.types.js.map +1 -1
  132. package/dist/meetings/request.js +39 -0
  133. package/dist/meetings/request.js.map +1 -1
  134. package/dist/meetings/util.js +116 -18
  135. package/dist/meetings/util.js.map +1 -1
  136. package/dist/member/index.js +10 -0
  137. package/dist/member/index.js.map +1 -1
  138. package/dist/member/types.js.map +1 -1
  139. package/dist/member/util.js +30 -0
  140. package/dist/member/util.js.map +1 -1
  141. package/dist/members/index.js +101 -43
  142. package/dist/members/index.js.map +1 -1
  143. package/dist/members/util.js +8 -1
  144. package/dist/members/util.js.map +1 -1
  145. package/dist/metrics/constants.js +11 -1
  146. package/dist/metrics/constants.js.map +1 -1
  147. package/dist/multistream/codec/constants.js +63 -0
  148. package/dist/multistream/codec/constants.js.map +1 -0
  149. package/dist/multistream/mediaRequestManager.js +62 -15
  150. package/dist/multistream/mediaRequestManager.js.map +1 -1
  151. package/dist/multistream/receiveSlot.js +9 -0
  152. package/dist/multistream/receiveSlot.js.map +1 -1
  153. package/dist/multistream/remoteMediaManager.js +32 -4
  154. package/dist/multistream/remoteMediaManager.js.map +1 -1
  155. package/dist/multistream/sendSlotManager.js +127 -3
  156. package/dist/multistream/sendSlotManager.js.map +1 -1
  157. package/dist/reachability/clusterReachability.js.map +1 -1
  158. package/dist/reachability/index.js +121 -83
  159. package/dist/reachability/index.js.map +1 -1
  160. package/dist/reachability/reachability.types.js +2 -0
  161. package/dist/reachability/reachability.types.js.map +1 -1
  162. package/dist/reachability/util.js +45 -0
  163. package/dist/reachability/util.js.map +1 -1
  164. package/dist/reactions/reactions.type.js.map +1 -1
  165. package/dist/recording-controller/index.js +1 -3
  166. package/dist/recording-controller/index.js.map +1 -1
  167. package/dist/roap/turnDiscovery.js +8 -1
  168. package/dist/roap/turnDiscovery.js.map +1 -1
  169. package/dist/types/annotation/index.d.ts +19 -0
  170. package/dist/types/common/errors/webex-errors.d.ts +36 -2
  171. package/dist/types/common/wasm-loader.d.ts +55 -0
  172. package/dist/types/config.d.ts +5 -2
  173. package/dist/types/constants.d.ts +15 -2
  174. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  175. package/dist/types/controls-options-manager/index.d.ts +16 -0
  176. package/dist/types/e2ee/E2eeManager.d.ts +23 -0
  177. package/dist/types/e2ee/E2eeSignaling.d.ts +94 -0
  178. package/dist/types/e2ee/MediaEncryptionService.d.ts +27 -0
  179. package/dist/types/e2ee/mls.d.ts +191 -0
  180. package/dist/types/e2ee/types.d.ts +104 -0
  181. package/dist/types/hashTree/constants.d.ts +2 -0
  182. package/dist/types/hashTree/hashTreeParser.d.ts +230 -18
  183. package/dist/types/hashTree/utils.d.ts +18 -0
  184. package/dist/types/index.d.ts +4 -0
  185. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  186. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  187. package/dist/types/locus-info/index.d.ts +151 -15
  188. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  189. package/dist/types/locus-info/types.d.ts +28 -1
  190. package/dist/types/media/MediaConnectionAwaiter.d.ts +66 -49
  191. package/dist/types/media/properties.d.ts +6 -2
  192. package/dist/types/meeting/in-meeting-actions.d.ts +4 -0
  193. package/dist/types/meeting/index.d.ts +247 -13
  194. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  195. package/dist/types/meeting/request.d.ts +1 -0
  196. package/dist/types/meeting/util.d.ts +12 -1
  197. package/dist/types/meeting-info/meeting-info-v2.d.ts +1 -0
  198. package/dist/types/meetings/index.d.ts +44 -19
  199. package/dist/types/meetings/meetings.types.d.ts +15 -0
  200. package/dist/types/meetings/request.d.ts +14 -0
  201. package/dist/types/member/index.d.ts +1 -0
  202. package/dist/types/member/types.d.ts +1 -0
  203. package/dist/types/member/util.d.ts +9 -0
  204. package/dist/types/members/index.d.ts +15 -2
  205. package/dist/types/members/util.d.ts +1 -5
  206. package/dist/types/metrics/constants.d.ts +10 -0
  207. package/dist/types/multistream/codec/constants.d.ts +7 -0
  208. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  209. package/dist/types/multistream/remoteMediaManager.d.ts +18 -0
  210. package/dist/types/multistream/sendSlotManager.d.ts +28 -2
  211. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  212. package/dist/types/reachability/index.d.ts +10 -3
  213. package/dist/types/reachability/reachability.types.d.ts +7 -0
  214. package/dist/types/reachability/util.d.ts +17 -0
  215. package/dist/types/reactions/reactions.type.d.ts +3 -0
  216. package/dist/webinar/index.js +539 -245
  217. package/dist/webinar/index.js.map +1 -1
  218. package/package.json +26 -24
  219. package/src/aiEnableRequest/ai-docs/ai-enable-request-spec.md +223 -0
  220. package/src/aiEnableRequest/index.ts +16 -0
  221. package/src/annotation/ai-docs/annotation-spec.md +236 -0
  222. package/src/annotation/index.ts +61 -29
  223. package/src/breakouts/ai-docs/breakouts-spec.md +324 -0
  224. package/src/breakouts/breakout.ts +3 -1
  225. package/src/breakouts/events.ts +33 -11
  226. package/src/breakouts/index.ts +145 -3
  227. package/src/common/errors/webex-errors.ts +56 -3
  228. package/src/common/wasm-loader.ts +124 -0
  229. package/src/config.ts +9 -3
  230. package/src/constants.ts +23 -4
  231. package/src/controls-options-manager/ai-docs/controls-options-manager-spec.md +243 -0
  232. package/src/controls-options-manager/constants.ts +14 -1
  233. package/src/controls-options-manager/index.ts +87 -28
  234. package/src/controls-options-manager/util.ts +81 -1
  235. package/src/e2ee/E2eeManager.ts +58 -0
  236. package/src/e2ee/E2eeSignaling.ts +215 -0
  237. package/src/e2ee/MediaEncryptionService.ts +41 -0
  238. package/src/e2ee/mls.ts +548 -0
  239. package/src/e2ee/types.ts +114 -0
  240. package/src/e2ee/wasm.d.ts +153 -0
  241. package/src/hashTree/ai-docs/hash-tree-spec.md +267 -0
  242. package/src/hashTree/constants.ts +16 -0
  243. package/src/hashTree/hashTreeParser.ts +1021 -214
  244. package/src/hashTree/utils.ts +36 -0
  245. package/src/index.ts +7 -0
  246. package/src/interceptors/ai-docs/interceptors-spec.md +247 -0
  247. package/src/interceptors/dataChannelAuthToken.ts +59 -12
  248. package/src/interceptors/locusRetry.ts +26 -5
  249. package/src/interpretation/ai-docs/interpretation-spec.md +256 -0
  250. package/src/interpretation/index.ts +65 -10
  251. package/src/interpretation/interpretation.types.ts +11 -0
  252. package/src/locus-info/ai-docs/locus-info-spec.md +293 -0
  253. package/src/locus-info/controlsUtils.ts +3 -1
  254. package/src/locus-info/index.ts +907 -184
  255. package/src/locus-info/infoUtils.ts +41 -6
  256. package/src/locus-info/types.ts +33 -1
  257. package/src/media/MediaConnectionAwaiter.ts +229 -196
  258. package/src/media/ai-docs/media-spec.md +267 -0
  259. package/src/media/index.ts +10 -1
  260. package/src/media/properties.ts +8 -3
  261. package/src/meeting/ai-docs/meeting-spec.md +404 -0
  262. package/src/meeting/in-meeting-actions.ts +8 -0
  263. package/src/meeting/index.ts +1237 -254
  264. package/src/meeting/locusMediaRequest.ts +106 -6
  265. package/src/meeting/muteState.ts +10 -1
  266. package/src/meeting/request.ts +11 -0
  267. package/src/meeting/util.ts +53 -8
  268. package/src/meeting/voicea-meeting.ts +1 -1
  269. package/src/meeting-info/ai-docs/meeting-info-spec.md +261 -0
  270. package/src/meeting-info/meeting-info-v2.ts +11 -4
  271. package/src/meetings/ai-docs/meetings-spec.md +298 -0
  272. package/src/meetings/index.ts +242 -80
  273. package/src/meetings/meetings.types.ts +19 -0
  274. package/src/meetings/request.ts +43 -0
  275. package/src/meetings/util.ts +117 -4
  276. package/src/member/ai-docs/member-spec.md +196 -0
  277. package/src/member/index.ts +10 -0
  278. package/src/member/types.ts +1 -0
  279. package/src/member/util.ts +29 -0
  280. package/src/members/ai-docs/members-spec.md +256 -0
  281. package/src/members/index.ts +70 -7
  282. package/src/members/util.ts +12 -4
  283. package/src/metrics/ai-docs/metrics-spec.md +185 -0
  284. package/src/metrics/constants.ts +11 -0
  285. package/src/multistream/ai-docs/multistream-spec.md +295 -0
  286. package/src/multistream/codec/constants.ts +58 -0
  287. package/src/multistream/mediaRequestManager.ts +119 -28
  288. package/src/multistream/receiveSlot.ts +18 -0
  289. package/src/multistream/remoteMediaManager.ts +23 -1
  290. package/src/multistream/sendSlotManager.ts +112 -4
  291. package/src/personal-meeting-room/ai-docs/personal-meeting-room-spec.md +234 -0
  292. package/src/reachability/ai-docs/reachability-spec.md +261 -0
  293. package/src/reachability/clusterReachability.ts +3 -2
  294. package/src/reachability/index.ts +47 -16
  295. package/src/reachability/reachability.types.ts +11 -0
  296. package/src/reachability/util.ts +36 -0
  297. package/src/reactions/ai-docs/reactions-spec.md +198 -0
  298. package/src/reactions/reactions.type.ts +3 -0
  299. package/src/reconnection-manager/ai-docs/reconnection-manager-spec.md +272 -0
  300. package/src/recording-controller/ai-docs/recording-controller-spec.md +223 -0
  301. package/src/recording-controller/index.ts +1 -2
  302. package/src/roap/ai-docs/roap-spec.md +241 -0
  303. package/src/roap/turnDiscovery.ts +9 -1
  304. package/src/webinar/ai-docs/webinar-spec.md +243 -0
  305. package/src/webinar/index.ts +333 -73
  306. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  307. package/test/unit/spec/annotation/index.ts +214 -182
  308. package/test/unit/spec/breakouts/breakout.ts +9 -3
  309. package/test/unit/spec/breakouts/events.ts +120 -2
  310. package/test/unit/spec/breakouts/index.ts +336 -15
  311. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  312. package/test/unit/spec/common/wasm-loader.ts +171 -0
  313. package/test/unit/spec/controls-options-manager/index.js +244 -29
  314. package/test/unit/spec/controls-options-manager/util.js +165 -0
  315. package/test/unit/spec/e2ee/E2eeManager.ts +82 -0
  316. package/test/unit/spec/e2ee/E2eeSignaling.ts +172 -0
  317. package/test/unit/spec/e2ee/MediaEncryptionService.ts +43 -0
  318. package/test/unit/spec/e2ee/mls.ts +765 -0
  319. package/test/unit/spec/hashTree/hashTreeParser.ts +3126 -238
  320. package/test/unit/spec/hashTree/utils.ts +125 -1
  321. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +179 -1
  322. package/test/unit/spec/interceptors/locusRetry.ts +234 -5
  323. package/test/unit/spec/interpretation/index.ts +119 -4
  324. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  325. package/test/unit/spec/locus-info/index.js +1880 -136
  326. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  327. package/test/unit/spec/media/MediaConnectionAwaiter.ts +479 -17
  328. package/test/unit/spec/media/index.ts +92 -0
  329. package/test/unit/spec/media/properties.ts +26 -26
  330. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  331. package/test/unit/spec/meeting/index.js +3697 -501
  332. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  333. package/test/unit/spec/meeting/muteState.js +81 -0
  334. package/test/unit/spec/meeting/request.js +12 -0
  335. package/test/unit/spec/meeting/utils.js +206 -16
  336. package/test/unit/spec/meeting/voicea-meeting.ts +85 -1
  337. package/test/unit/spec/meeting-info/index.js +2 -3
  338. package/test/unit/spec/meeting-info/meetinginfov2.js +88 -11
  339. package/test/unit/spec/meetings/index.js +606 -53
  340. package/test/unit/spec/meetings/request.js +141 -0
  341. package/test/unit/spec/meetings/utils.js +402 -51
  342. package/test/unit/spec/member/index.js +7 -0
  343. package/test/unit/spec/member/util.js +89 -0
  344. package/test/unit/spec/members/index.js +216 -0
  345. package/test/unit/spec/members/request.js +37 -1
  346. package/test/unit/spec/members/utils.js +63 -0
  347. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  348. package/test/unit/spec/multistream/remoteMediaManager.ts +46 -0
  349. package/test/unit/spec/multistream/sendSlotManager.ts +165 -38
  350. package/test/unit/spec/reachability/index.ts +128 -46
  351. package/test/unit/spec/reachability/util.ts +31 -0
  352. package/test/unit/spec/recording-controller/index.js +9 -8
  353. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  354. package/test/unit/spec/webinar/index.ts +982 -328
@@ -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';
@@ -20,6 +21,8 @@ import LoggerRequest from '../common/logs/request';
20
21
  import Trigger from '../common/events/trigger-proxy';
21
22
  import Media from '../media';
22
23
  import MeetingUtil from '../meeting/util';
24
+ import WasmLoader from '../common/wasm-loader';
25
+ import E2eeManager from '../e2ee/E2eeManager';
23
26
  import {
24
27
  MEETINGS,
25
28
  EVENTS,
@@ -47,7 +50,7 @@ import {
47
50
  import BEHAVIORAL_METRICS from '../metrics/constants';
48
51
  import MeetingInfo from '../meeting-info';
49
52
  import MeetingInfoV2 from '../meeting-info/meeting-info-v2';
50
- import Meeting, {CallStateForMetrics} from '../meeting';
53
+ import Meeting, {CallStateForMetrics, storeEventForDebugging} from '../meeting';
51
54
  import PersonalMeetingRoom from '../personal-meeting-room';
52
55
  import Reachability from '../reachability';
53
56
  import Request from './request';
@@ -55,10 +58,12 @@ import PasswordError from '../common/errors/password-error';
55
58
  import CaptchaError from '../common/errors/captcha-error';
56
59
  import MeetingCollection from './collection';
57
60
  import {
61
+ FetchSitePreferencesMeViaSiteOptions,
58
62
  MEETING_KEY,
59
63
  INoiseReductionEffect,
60
64
  IVirtualBackgroundEffect,
61
65
  MeetingRegistrationStatus,
66
+ SitePreferencesResponse,
62
67
  } from './meetings.types';
63
68
  import MeetingsUtil from './util';
64
69
  import PermissionError from '../common/errors/permission';
@@ -69,7 +74,9 @@ import JoinForbiddenError from '../common/errors/join-forbidden-error';
69
74
  import {HashTreeMessage} from '../hashTree/hashTreeParser';
70
75
  import {HashTreeObject} from '../hashTree/types';
71
76
  import {isSelf} from '../hashTree/utils';
72
- import {createLocusFromHashTreeMessage} from '../locus-info';
77
+
78
+ import {createLocusFromHashTreeMessage, findMeetingForHashTreeMessage} from '../locus-info';
79
+ import {LocusDTO} from '../locus-info/types';
73
80
 
74
81
  let mediaLogger;
75
82
 
@@ -205,6 +212,54 @@ export default class Meetings extends WebexPlugin {
205
212
  breakoutLocusForHandleLater: any;
206
213
  namespace = MEETINGS;
207
214
  registrationStatus: MeetingRegistrationStatus;
215
+ wasmLoader?: WasmLoader;
216
+ e2eeManager?: E2eeManager;
217
+
218
+ /**
219
+ * Emits a metric describing how well this browser runs WebAssembly, used to spot browsers
220
+ * where real-time WASM effects (e.g. background noise removal) run poorly.
221
+ *
222
+ * @param {string} correlationId - correlation id to report the result against
223
+ * @returns {void}
224
+ */
225
+ private emitWasmRuntimePerformance = once((correlationId: string): void => {
226
+ // Probe and telemetry failures must not prevent meeting creation.
227
+ WasmRuntimeProbe.check()
228
+ .then((result) => {
229
+ const {status, capability, reason, measurements} = result;
230
+ const {
231
+ divRatio = null,
232
+ sqrtRatio = null,
233
+ addNsPerOp = null,
234
+ addMedianMs = null,
235
+ divMedianMs = null,
236
+ sqrtMedianMs = null,
237
+ } = measurements ?? {};
238
+ const measurementsLog = JSON.stringify(measurements);
239
+
240
+ LoggerProxy.logger.log(
241
+ `Meetings:index#emitWasmRuntimePerformance --> WASM runtime performance status: ${status}, capability: ${capability}, reason: ${reason}, measurements: ${measurementsLog}`
242
+ );
243
+
244
+ return Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.WASM_RUNTIME_PERFORMANCE, {
245
+ status,
246
+ capability,
247
+ reason,
248
+ divRatio,
249
+ sqrtRatio,
250
+ addNsPerOp,
251
+ addMedianMs,
252
+ divMedianMs,
253
+ sqrtMedianMs,
254
+ correlation_id: correlationId,
255
+ });
256
+ })
257
+ .catch((error) => {
258
+ LoggerProxy.logger.error(
259
+ `Meetings:index#emitWasmRuntimePerformance --> ERROR, failed to probe or report WASM runtime performance: ${error.message}`
260
+ );
261
+ });
262
+ });
208
263
 
209
264
  /**
210
265
  * Initializes the Meetings Plugin
@@ -297,6 +352,9 @@ export default class Meetings extends WebexPlugin {
297
352
  getUserMedia: Media.getUserMedia,
298
353
  };
299
354
 
355
+ // Shared runtime cache for WASM modules used by meetings.
356
+ this.wasmLoader = new WasmLoader();
357
+
300
358
  this.onReady();
301
359
  }
302
360
 
@@ -313,7 +371,7 @@ export default class Meetings extends WebexPlugin {
313
371
  const breakoutLocus = this.meetingCollection.getActiveBreakoutLocus(breakoutUrl);
314
372
 
315
373
  const isSelfJoined = newLocus?.self?.state === _JOINED_;
316
- const isSelfMoved = newLocus?.self?.state === _LEFT_ && newLocus?.self?.reason === _MOVED_;
374
+ const isSelfMoved = MeetingsUtil.isSelfMovedOrBreakoutEnded(newLocus);
317
375
  // @ts-ignore
318
376
  const deviceFromNewLocus = MeetingsUtil.getThisDevice(newLocus, this.webex.internal.device.url);
319
377
  const isResourceMovedOnThisDevice =
@@ -390,7 +448,7 @@ export default class Meetings extends WebexPlugin {
390
448
  private isNeedHandleLocusDTO(meeting: any, newLocus: any) {
391
449
  if (newLocus) {
392
450
  const isNewLocusAsBreakout = MeetingsUtil.isBreakoutLocusDTO(newLocus);
393
- const isSelfMoved = newLocus?.self?.state === _LEFT_ && newLocus?.self?.reason === _MOVED_;
451
+ const isSelfMoved = MeetingsUtil.isSelfMovedOrBreakoutEnded(newLocus);
394
452
  const isSelfMovedToLobby =
395
453
  newLocus?.self?.devices[0]?.intent?.reason === _ON_HOLD_LOBBY_ &&
396
454
  newLocus?.self?.devices[0]?.intent?.type === _WAIT_;
@@ -435,6 +493,17 @@ export default class Meetings extends WebexPlugin {
435
493
  if (existingMeeting) {
436
494
  return existingMeeting;
437
495
  }
496
+ if (data.eventType === LOCUSEVENT.HASH_TREE_DATA_UPDATED) {
497
+ // need to check if maybe this event indicates a move to/from breakout
498
+ const meetingForHashTreeMessage = findMeetingForHashTreeMessage(
499
+ data?.stateElementsMessage,
500
+ this.meetingCollection
501
+ );
502
+
503
+ if (meetingForHashTreeMessage) {
504
+ return meetingForHashTreeMessage;
505
+ }
506
+ }
438
507
 
439
508
  // if that didn't work, fallback to other fields like correlationId, sipUri, etc
440
509
 
@@ -478,6 +547,10 @@ export default class Meetings extends WebexPlugin {
478
547
  */
479
548
  private handleLocusEvent(data: LocusEvent, useRandomDelayForInfo = false) {
480
549
  let meeting = this.getCorrespondingMeetingByLocus(data);
550
+ // @ts-ignore
551
+ if (this.config.experimental.storeLocusHashTreeEventsForDebugging) {
552
+ storeEventForDebugging('mercury', data);
553
+ }
481
554
 
482
555
  // Special case when locus has got replaced, This only happend once if a replace locus exists
483
556
  // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call
@@ -492,8 +565,9 @@ export default class Meetings extends WebexPlugin {
492
565
  }
493
566
 
494
567
  if (meeting && !MeetingsUtil.isBreakoutLocusDTO(data.locus)) {
495
- meeting.locusInfo.updateMainSessionLocusCache(data.locus);
568
+ meeting.locusInfo.updateMainSessionLocusCache(data.locus); // here data.locus will never be a complete locus
496
569
  }
570
+
497
571
  if (!this.isNeedHandleLocusDTO(meeting, data.locus)) {
498
572
  LoggerProxy.logger.log(
499
573
  `Meetings:index#handleLocusEvent --> doesn't need to process locus event`
@@ -567,17 +641,21 @@ export default class Meetings extends WebexPlugin {
567
641
  this.create(data.locus, DESTINATION_TYPE.LOCUS_ID, useRandomDelayForInfo)
568
642
  .then(async (newMeeting) => {
569
643
  meeting = newMeeting;
570
-
571
644
  try {
572
645
  // It's a new meeting so initialize the locus data
573
- await meeting.locusInfo.initialSetup({
574
- trigger:
575
- data.eventType === LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS
576
- ? 'get-loci-response'
577
- : 'locus-message',
578
- locus: data.locus,
579
- hashTreeMessage: data.stateElementsMessage,
580
- });
646
+ await meeting.locusInfo.initialSetup(
647
+ {
648
+ trigger:
649
+ data.eventType === LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS
650
+ ? 'get-loci-response'
651
+ : 'locus-message',
652
+ locus: data.locus,
653
+ hashTreeMessage: data.stateElementsMessage,
654
+ },
655
+ (locus: LocusDTO) => {
656
+ meeting.finalizeMeetingAfterInitialLocusSetup(locus);
657
+ }
658
+ );
581
659
  } catch (error) {
582
660
  LoggerProxy.logger.warn(
583
661
  `Meetings:index#handleLocusEvent --> Error initializing locus data: ${error.message}`
@@ -688,7 +766,14 @@ export default class Meetings extends WebexPlugin {
688
766
 
689
767
  // @ts-ignore
690
768
  this.webex.internal.mercury.on(ONLINE, () => {
691
- this.syncMeetings({keepOnlyLocusMeetings: false});
769
+ // Fire-and-forget sync on socket recovery. Unlike the reconnection manager (which awaits and
770
+ // retries), nothing consumes this promise, so catch its rejection to avoid an unhandled
771
+ // promise rejection (a transient guest classic-sync failure would otherwise crash Node hosts).
772
+ this.syncMeetings({keepOnlyLocusMeetings: false}).catch((error) => {
773
+ LoggerProxy.logger.warn(
774
+ `Meetings:index#listenForEvents --> syncMeetings after ONLINE event failed: ${error}`
775
+ );
776
+ });
692
777
  });
693
778
 
694
779
  // @ts-ignore
@@ -730,6 +815,10 @@ export default class Meetings extends WebexPlugin {
730
815
  mediaLogger = new MediaLogger();
731
816
  setLogger(mediaLogger);
732
817
 
818
+ // Construct after READY because the manager uses the initialized webex client and config.
819
+ // @ts-ignore
820
+ this.e2eeManager = new E2eeManager({webex: this.webex, wasmLoader: this.wasmLoader});
821
+
733
822
  /**
734
823
  * The MeetingInfo object to interact with server
735
824
  * @instance
@@ -818,97 +907,82 @@ export default class Meetings extends WebexPlugin {
818
907
  }
819
908
 
820
909
  /**
821
- * API to toggle TCP reachability, needs to be called before webex.meetings.register()
822
- * @param {Boolean} newValue
823
- * @private
824
- * @memberof Meetings
825
- * @returns {undefined}
826
- */
827
- private _toggleTcpReachability(newValue: boolean) {
828
- if (typeof newValue !== 'boolean') {
829
- return;
830
- }
831
- // @ts-ignore
832
- if (this.config.experimental.enableTcpReachability !== newValue) {
833
- // @ts-ignore
834
- this.config.experimental.enableTcpReachability = newValue;
835
- }
836
- }
837
-
838
- /**
839
- * API to toggle TLS reachability, needs to be called before webex.meetings.register()
910
+ * API to toggle backend ipv6 native support config, needs to be called before webex.meetings.register()
911
+ *
840
912
  * @param {Boolean} newValue
841
913
  * @private
842
914
  * @memberof Meetings
843
915
  * @returns {undefined}
844
916
  */
845
- private _toggleTlsReachability(newValue: boolean) {
917
+ private _toggleIpv6BackendNativeSupport(newValue: boolean) {
846
918
  if (typeof newValue !== 'boolean') {
847
919
  return;
848
920
  }
849
921
  // @ts-ignore
850
- if (this.config.experimental.enableTlsReachability !== newValue) {
922
+ if (this.config.backendIpv6NativeSupport !== newValue) {
851
923
  // @ts-ignore
852
- this.config.experimental.enableTlsReachability = newValue;
924
+ this.config.backendIpv6NativeSupport = newValue;
853
925
  }
854
926
  }
855
927
 
856
928
  /**
857
- * API to toggle backend ipv6 native support config, needs to be called before webex.meetings.register()
929
+ * API to toggle usage of audio main DTX, needs to be called before webex.meetings.register()
858
930
  *
859
931
  * @param {Boolean} newValue
860
932
  * @private
861
933
  * @memberof Meetings
862
934
  * @returns {undefined}
863
935
  */
864
- private _toggleIpv6BackendNativeSupport(newValue: boolean) {
936
+ private _toggleDisableAudioMainDtx(newValue: boolean) {
865
937
  if (typeof newValue !== 'boolean') {
866
938
  return;
867
939
  }
940
+
868
941
  // @ts-ignore
869
- if (this.config.backendIpv6NativeSupport !== newValue) {
942
+ if (this.config.experimental.disableAudioMainDtx !== newValue) {
870
943
  // @ts-ignore
871
- this.config.backendIpv6NativeSupport = newValue;
944
+ this.config.experimental.disableAudioMainDtx = newValue;
872
945
  }
873
946
  }
874
947
 
875
948
  /**
876
- * API to toggle usage of audio main DTX, needs to be called before webex.meetings.register()
949
+ * API to toggle usage of audio twcc support
877
950
  *
878
951
  * @param {Boolean} newValue
879
952
  * @private
880
953
  * @memberof Meetings
881
954
  * @returns {undefined}
882
955
  */
883
- private _toggleDisableAudioMainDtx(newValue: boolean) {
956
+ private _toggleEnableAudioTwccForMultistream(newValue: boolean) {
884
957
  if (typeof newValue !== 'boolean') {
885
958
  return;
886
959
  }
887
960
 
888
961
  // @ts-ignore
889
- if (this.config.experimental.disableAudioMainDtx !== newValue) {
962
+ if (this.config.enableAudioTwccForMultistream !== newValue) {
890
963
  // @ts-ignore
891
- this.config.experimental.disableAudioMainDtx = newValue;
964
+ this.config.enableAudioTwccForMultistream = newValue;
892
965
  }
893
966
  }
894
967
 
895
968
  /**
896
- * API to toggle usage of audio twcc support
969
+ * API to toggle AV1 codec support for video slides in multistream,
970
+ * needs to be called before webex.meetings.joinWithMedia()
897
971
  *
898
972
  * @param {Boolean} newValue
899
973
  * @private
900
974
  * @memberof Meetings
901
975
  * @returns {undefined}
902
976
  */
903
- private _toggleEnableAudioTwccForMultistream(newValue: boolean) {
977
+ private _toggleEnableAv1SlidesSupport(newValue: boolean) {
904
978
  if (typeof newValue !== 'boolean') {
905
979
  return;
906
980
  }
907
981
 
908
982
  // @ts-ignore
909
- if (this.config.enableAudioTwccForMultistream !== newValue) {
983
+ if (this.config.enableAv1SlidesSupport !== newValue) {
910
984
  // @ts-ignore
911
- this.config.enableAudioTwccForMultistream = newValue;
985
+ this.config.enableAv1SlidesSupport = newValue;
912
986
  }
913
987
  }
914
988
 
@@ -1062,6 +1136,13 @@ export default class Meetings extends WebexPlugin {
1062
1136
  );
1063
1137
  this.registered = true;
1064
1138
  Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_SUCCESS);
1139
+
1140
+ // Preload is best-effort and must not delay or fail Meetings registration.
1141
+ this.e2eeManager?.preload().catch((error) => {
1142
+ LoggerProxy.logger.warn(
1143
+ `Meetings:index#register --> E2EE preload failed: ${error?.message || error}`
1144
+ );
1145
+ });
1065
1146
  })
1066
1147
  .catch((error) => {
1067
1148
  LoggerProxy.logger.error(
@@ -1384,6 +1465,31 @@ export default class Meetings extends WebexPlugin {
1384
1465
  return this.personalMeetingRoom;
1385
1466
  }
1386
1467
 
1468
+ /**
1469
+ * Fetches site preferences for the provided Webex site, or the preferred Webex site.
1470
+ * This is used to determine capabilities of the site, such as whether scheduling a webinar is supported.
1471
+ *
1472
+ * @param {object} [options]
1473
+ * @param {string} [options.siteUrl] - Webex site URL. Defaults to preferredWebexSite, for example "cisco.webex.com".
1474
+ * @param {string} [options.siteName] - Site name query override. Defaults to the site name derived from siteUrl, for example "cisco" for "cisco.webex.com".
1475
+ * @param {SitePreferenceSelectOption[]} [options.selectOptions] - Preference sections to fetch. Defaults to 'scheduling'.
1476
+ * @returns {Promise<SitePreferencesResponse>} site preferences response body
1477
+ * @throws {ParameterError}
1478
+ * @public
1479
+ * @memberof Meetings
1480
+ * @example
1481
+ * const preferences = await webex.meetings.fetchSitePreferencesMeViaSite();
1482
+ * const supportScheduleWebinar = preferences?.scheduling?.supportScheduleWebinar;
1483
+ */
1484
+ public fetchSitePreferencesMeViaSite(
1485
+ options: FetchSitePreferencesMeViaSiteOptions = {}
1486
+ ): Promise<SitePreferencesResponse> {
1487
+ return this.request.fetchSitePreferencesMeViaSite({
1488
+ ...options,
1489
+ siteUrl: options.siteUrl || this.preferredWebexSite,
1490
+ });
1491
+ }
1492
+
1387
1493
  /**
1388
1494
  * Returns basic information about a meeting that exists or
1389
1495
  * used to exist in the MeetingCollection
@@ -1404,7 +1510,11 @@ export default class Meetings extends WebexPlugin {
1404
1510
  * @memberof Meetings
1405
1511
  */
1406
1512
  private destroy(meeting: Meeting, reason: object) {
1407
- MeetingUtil.cleanUp(meeting);
1513
+ MeetingUtil.cleanUp(meeting, {preserveVoiceaChannel: false});
1514
+
1515
+ // Tear down hash tree parsers here (and not in MeetingUtil.cleanUp) so they survive
1516
+ // leave/endMeetingForAll to consume the final sentinel END message from Locus.
1517
+ meeting.locusInfo?.cleanUp();
1408
1518
  // keep some basic info about the deleted meeting forever
1409
1519
  this.deletedMeetings.set(meeting.id, {
1410
1520
  id: meeting.id,
@@ -1601,6 +1711,8 @@ export default class Meetings extends WebexPlugin {
1601
1711
  });
1602
1712
  }
1603
1713
  });
1714
+
1715
+ this.emitWasmRuntimePerformance(createdMeeting.correlationId);
1604
1716
  } else {
1605
1717
  LoggerProxy.logger.error(
1606
1718
  `Meetings:index#create --> ERROR, meeting does not have on method, will not be destroyed, meeting cleanup impossible for meeting: ${meeting}`
@@ -1746,10 +1858,14 @@ export default class Meetings extends WebexPlugin {
1746
1858
  extraParams: infoExtraParams,
1747
1859
  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
1748
1860
  };
1861
+ const shouldDeferMeetingInfoFetch = type === DESTINATION_TYPE.LOCUS_ID && !destination?.info;
1862
+
1863
+ const isOneOnOneCallLocus =
1864
+ type === DESTINATION_TYPE.LOCUS_ID && MeetingsUtil.isOneOnOneCall(destination);
1749
1865
 
1750
1866
  if (meetingInfo) {
1751
1867
  meeting.injectMeetingInfo(meetingInfo, meetingInfoOptions, meetingLookupUrl);
1752
- } else if (type !== DESTINATION_TYPE.ONE_ON_ONE_CALL) {
1868
+ } else if (type !== DESTINATION_TYPE.ONE_ON_ONE_CALL && !isOneOnOneCallLocus) {
1753
1869
  // ignore fetchMeetingInfo for 1:1 meetings
1754
1870
  if (enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0) {
1755
1871
  meeting.fetchMeetingInfoTimeoutId = setTimeout(
@@ -1757,8 +1873,12 @@ export default class Meetings extends WebexPlugin {
1757
1873
  waitingTime
1758
1874
  );
1759
1875
  meeting.parseMeetingInfo(undefined, destination);
1760
- } else {
1876
+ } else if (!shouldDeferMeetingInfoFetch) {
1761
1877
  await meeting.fetchMeetingInfo(meetingInfoOptions);
1878
+ } else {
1879
+ LoggerProxy.logger.info(
1880
+ 'Meetings:index#createMeeting --> defer fetchMeetingInfo for incomplete locus, will do it after locus initialSetup'
1881
+ );
1762
1882
  }
1763
1883
  }
1764
1884
  } catch (err) {
@@ -1792,7 +1912,11 @@ export default class Meetings extends WebexPlugin {
1792
1912
  // For type LOCUS_ID we need to parse the locus object to get the information
1793
1913
  // about the caller and callee
1794
1914
  // Meeting Added event will be created in `handleLocusEvent`
1795
- if (type !== DESTINATION_TYPE.LOCUS_ID) {
1915
+ // Only emit MEETING_ADDED if the meeting still exists in the collection.
1916
+ // If fetchMeetingInfo failed and the meeting was destroyed in the catch block,
1917
+ // skip emitting to prevent orphaned meeting references on the consumer side.
1918
+ // @ts-ignore - getMeetingByType types value as object but accepts strings (same as handleLocusEvent)
1919
+ if (type !== DESTINATION_TYPE.LOCUS_ID && this.getMeetingByType(_ID_, meeting.id)) {
1796
1920
  if (!meeting.sipUri) {
1797
1921
  meeting.setSipUri(destination);
1798
1922
  }
@@ -1861,29 +1985,35 @@ export default class Meetings extends WebexPlugin {
1861
1985
  }
1862
1986
 
1863
1987
  /**
1864
- * Syncs all the meetings from server. Does nothing and returns immediately if unverified guest.
1988
+ * Syncs all the meetings from server. For unverified guests it skips the getActiveMeetings() call
1989
+ * (which Locus rejects for them) and instead resyncs each meeting individually via LocusInfo#sync.
1865
1990
  * @param {boolean} keepOnlyLocusMeetings - whether the sync should keep only locus meetings or any other meeting in meetingCollection
1866
1991
  * @returns {Promise<void>}
1867
1992
  * @public
1868
1993
  * @memberof Meetings
1869
1994
  */
1870
- public syncMeetings({keepOnlyLocusMeetings = true} = {}): Promise<void> {
1995
+ public async syncMeetings({
1996
+ keepOnlyLocusMeetings = true,
1997
+ skipHashTreeSync = false,
1998
+ } = {}): Promise<void> {
1871
1999
  // @ts-ignore
1872
- if (this.webex.credentials.isUnverifiedGuest) {
2000
+ const isUnverifiedGuest = Boolean(this.webex.credentials.isUnverifiedGuest);
2001
+
2002
+ if (isUnverifiedGuest) {
1873
2003
  LoggerProxy.logger.info(
1874
- 'Meetings:index#syncMeetings --> skipping meeting sync as unverified guest'
2004
+ 'Meetings:index#syncMeetings --> user is unverified guest, skipping calling Locus for meeting sync'
1875
2005
  );
1876
2006
 
1877
- return Promise.resolve();
1878
- }
1879
-
1880
- return this.request
1881
- .getActiveMeetings()
1882
- .then((locusArray) => {
1883
- const activeLocusUrl = [];
2007
+ // Locus rejects getActiveMeetings() for unverified guests, so the per-meeting sync below
2008
+ // (with canSyncClassicLocus enabled) resyncs each classic meeting individually instead.
2009
+ } else {
2010
+ try {
2011
+ const locusArray = await this.request.getActiveMeetings();
2012
+ const activeLocusUrl: string[] = [];
1884
2013
 
1885
2014
  if (locusArray?.loci && locusArray.loci.length > 0) {
1886
2015
  const lociToUpdate = this.sortLocusArrayToUpdate(locusArray.loci);
2016
+
1887
2017
  lociToUpdate.forEach((locus) => {
1888
2018
  activeLocusUrl.push(locus.url);
1889
2019
  this.handleLocusEvent({
@@ -1901,21 +2031,54 @@ export default class Meetings extends WebexPlugin {
1901
2031
  // (they had a locusUrl previously but are no longer active) in the sync
1902
2032
  for (const meeting of Object.values(meetingsCollection)) {
1903
2033
  // @ts-ignore
1904
- const {locusUrl} = meeting;
2034
+ const {locusUrl, locusInfo} = meeting;
1905
2035
  if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1906
- // destroy function also uploads logs
1907
- // @ts-ignore
1908
- this.destroy(meeting, MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
2036
+ const globalMeetingId = locusInfo?.info?.globalMeetingId;
2037
+
2038
+ if (
2039
+ globalMeetingId &&
2040
+ locusArray?.loci?.some(
2041
+ (locus: LocusDTO) => locus.info?.globalMeetingId === globalMeetingId
2042
+ )
2043
+ ) {
2044
+ // don't destroy the meeting as Locus API still returned some Locus that shares
2045
+ // the same globalMeetingId - that happens for example if a webinar user (who hasn't scheduled it)
2046
+ // is in a breakout and gets moved to a different breakout while we were offline
2047
+ } else {
2048
+ // destroy function also uploads logs
2049
+ // @ts-ignore
2050
+ this.destroy(meeting, MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
2051
+ }
1909
2052
  }
1910
2053
  }
1911
2054
  }
1912
- })
1913
- .catch((error) => {
2055
+ } catch (error) {
1914
2056
  LoggerProxy.logger.error(
1915
2057
  `Meetings:index#syncMeetings --> failed to sync meetings, ${error}`
1916
2058
  );
1917
- throw new Error(error);
1918
- });
2059
+ throw error;
2060
+ }
2061
+ }
2062
+
2063
+ // Resync each remaining meeting via LocusInfo#sync, which routes to hash tree or classic. For
2064
+ // signed-in users classic meetings were already synced above, so only the hash tree sync runs.
2065
+ const remainingMeetings = this.meetingCollection.getAll();
2066
+ const syncPromises = [];
2067
+
2068
+ for (const meeting of Object.values(remainingMeetings) as any[]) {
2069
+ if (meeting.locusInfo) {
2070
+ syncPromises.push(
2071
+ meeting.locusInfo.sync(meeting, {
2072
+ canSyncClassicLocus: isUnverifiedGuest,
2073
+ canSyncHashTree: !skipHashTreeSync,
2074
+ })
2075
+ );
2076
+ }
2077
+ }
2078
+
2079
+ if (syncPromises.length > 0) {
2080
+ await Promise.all(syncPromises);
2081
+ }
1919
2082
  }
1920
2083
 
1921
2084
  /**
@@ -1931,8 +2094,8 @@ export default class Meetings extends WebexPlugin {
1931
2094
  this.breakoutLocusForHandleLater = [];
1932
2095
  const lociToUpdate = [...mainLoci];
1933
2096
  breakoutLoci.forEach((breakoutLocus) => {
1934
- const associateMainLocus = mainLoci.find(
1935
- (mainLocus) => mainLocus.controls?.breakout?.url === breakoutLocus.controls?.breakout?.url
2097
+ const associateMainLocus = mainLoci.find((mainLocus) =>
2098
+ MeetingsUtil.isMainAssociatedWithBreakout(mainLocus, breakoutLocus)
1936
2099
  );
1937
2100
  const existCorrespondingMeeting = this.getCorrespondingMeetingByLocus({
1938
2101
  eventType: LOCUSEVENT.SDK_NO_EVENT,
@@ -1960,7 +2123,7 @@ export default class Meetings extends WebexPlugin {
1960
2123
  * @public
1961
2124
  * @memberof Meetings
1962
2125
  */
1963
- checkHandleBreakoutLocus(newCreatedLocus) {
2126
+ checkHandleBreakoutLocus(newCreatedLocus: any) {
1964
2127
  if (
1965
2128
  !newCreatedLocus ||
1966
2129
  !this.breakoutLocusForHandleLater ||
@@ -1971,9 +2134,8 @@ export default class Meetings extends WebexPlugin {
1971
2134
  if (MeetingsUtil.isBreakoutLocusDTO(newCreatedLocus)) {
1972
2135
  return;
1973
2136
  }
1974
- const existIndex = this.breakoutLocusForHandleLater.findIndex(
1975
- (breakoutLocus) =>
1976
- breakoutLocus.controls?.breakout?.url === newCreatedLocus.controls?.breakout?.url
2137
+ const existIndex = this.breakoutLocusForHandleLater.findIndex((breakoutLocus: any) =>
2138
+ MeetingsUtil.isMainAssociatedWithBreakout(newCreatedLocus, breakoutLocus)
1977
2139
  );
1978
2140
 
1979
2141
  if (existIndex < 0) {
@@ -1982,7 +2144,7 @@ export default class Meetings extends WebexPlugin {
1982
2144
 
1983
2145
  const associateBreakoutLocus = this.breakoutLocusForHandleLater[existIndex];
1984
2146
  this.handleLocusEvent({
1985
- eventType: LOCUSEVENT.SDK_NO_EVENT,
2147
+ eventType: LOCUSEVENT.SDK_LOCUS_FROM_SYNC_MEETINGS,
1986
2148
  locus: associateBreakoutLocus,
1987
2149
  locusUrl: associateBreakoutLocus.url,
1988
2150
  });
@@ -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
  /**